changeset 5902:47ee29d0e3f7

Merge
author ehelin
date Mon, 03 Feb 2014 10:49:49 +0100
parents 8a3eb09ed131 2c95095271e9
children 6827d470020d
files src/share/vm/runtime/arguments.cpp
diffstat 65 files changed, 1376 insertions(+), 683 deletions(-) [+]
line wrap: on
line diff
--- a/agent/make/mkinstall	Thu Jan 16 13:25:25 2014 -0800
+++ b/agent/make/mkinstall	Mon Feb 03 10:49:49 2014 +0100
@@ -27,7 +27,9 @@
 
 cp ../src/os/solaris/proc/amd64/libsaproc.so $SA_NAME/solaris/amd64
 cp ../src/os/solaris/proc/sparc/libsaproc.so $SA_NAME/solaris/sparc
+cp ../src/os/solaris/proc/sparc/libsaproc_audit.so $SA_NAME/solaris/sparc
 cp ../src/os/solaris/proc/sparcv9/libsaproc.so $SA_NAME/solaris/sparcv9
+cp ../src/os/solaris/proc/sparcv9/libsaproc_audit.so $SA_NAME/solaris/sparcv9
 cp ../src/os/solaris/proc/i386/libsaproc.so $SA_NAME/solaris/i386
 cp ../src/os/linux/i386/libsaproc.so $SA_NAME/linux/i386
 cp ../src/os/linux/ia64/libsaproc.so $SA_NAME/linux/ia64
--- a/agent/make/saenv.sh	Thu Jan 16 13:25:25 2014 -0800
+++ b/agent/make/saenv.sh	Mon Feb 03 10:49:49 2014 +0100
@@ -48,16 +48,17 @@
      CPU=i386
    fi
 else
-   # configure audit helper library if SA_ALTROOT is set
-   if [ -n "$SA_ALTROOT" ]; then
-     LD_AUDIT_32=$STARTDIR/../src/os/solaris/proc/`uname -p`/libsaproc_audit.so
-     export LD_AUDIT_32
-     if [ ! -f $LD_AUDIT_32 ]; then
-       echo "SA_ALTROOT is set and can't find libsaproc_audit.so."
-       echo "Make sure to build it with 'make natives'."
-       exit 1
-     fi
+   # configure audit helper library for solaris
+   LD_AUDIT_32=$STARTDIR/../src/os/solaris/proc/`uname -p`/libsaproc_audit.so
+   if [ ! -f $LD_AUDIT_32 ]; then
+     LD_AUDIT_32=$STARTDIR/solaris/`uname -p`/libsaproc_audit.so
+   fi  
+   if [ ! -f $LD_AUDIT_32 ]; then
+      echo "Can't find libsaproc_audit.so."
+      echo "Make sure to build it with 'make natives'."
+      exit 1
    fi
+   export LD_AUDIT_32
    SA_LIBPATH=$STARTDIR/../src/os/solaris/proc/`uname -p`:$STARTDIR/solaris/`uname -p`
    OPTIONS="-Dsa.library.path=$SA_LIBPATH -Dsun.jvm.hotspot.debugger.useProcDebugger"
    CPU=sparc
--- a/agent/make/saenv64.sh	Thu Jan 16 13:25:25 2014 -0800
+++ b/agent/make/saenv64.sh	Mon Feb 03 10:49:49 2014 +0100
@@ -43,16 +43,19 @@
   fi
 fi
 
-# configure audit helper library if SA_ALTROOT is set
-if [ -n "$SA_ALTROOT" ]; then
-  LD_AUDIT_64=$STARTDIR/../src/os/solaris/proc/$CPU/libsaproc_audit.so
-  export LD_AUDIT_64
-  if [ ! -f $LD_AUDIT_64 ]; then
-      echo "SA_ALTROOT is set and can't find libsaproc_audit.so."
-      echo "Make sure to build it with 'make natives'."
-      exit 1
-  fi
+# configure audit helper library
+LD_AUDIT_64=$STARTDIR/../src/os/solaris/proc/$CPU/libsaproc_audit.so
+if [ ! -f $LD_AUDIT_64 ]; then
+  LD_AUDIT_64=$STARTDIR/solaris/$CPU/libsaproc_audit.so
 fi
+
+if [ ! -f $LD_AUDIT_64 ]; then
+   echo "Can't find libsaproc_audit.so."
+   echo "Make sure to build it with 'make natives'."
+   exit 1
+fi
+
+export LD_AUDIT_64
 SA_LIBPATH=$STARTDIR/../src/os/solaris/proc/$CPU:$STARTDIR/solaris/$CPU
 
 OPTIONS="-Dsa.library.path=$SA_LIBPATH -Dsun.jvm.hotspot.debugger.useProcDebugger"
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPool.java	Thu Jan 16 13:25:25 2014 -0800
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPool.java	Mon Feb 03 10:49:49 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -152,7 +152,7 @@
 
   private long indexOffset(long index) {
     if (Assert.ASSERTS_ENABLED) {
-      Assert.that(index > 0 && index < getLength(),  "invalid cp index " + index + " " + getLength());
+      Assert.that(index >= 0 && index < getLength(),  "invalid cp index " + index + " " + getLength());
     }
     return (index * getElementSize()) + headerSize;
   }
--- a/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ByteCodeRewriter.java	Thu Jan 16 13:25:25 2014 -0800
+++ b/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ByteCodeRewriter.java	Mon Feb 03 10:49:49 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -98,11 +98,14 @@
            break;
        default: throw new IllegalArgumentException();
        }
+
        if (cpCache == null) {
           return (short) cpCacheIndex;
        } else if (fmt.indexOf("JJJJ") >= 0) {
-          // change byte-ordering and go via secondary cache entry
-           throw new InternalError("unimplemented");
+          // Invokedynamic require special handling
+          cpCacheIndex = ~cpCacheIndex;
+          cpCacheIndex = bytes.swapInt(cpCacheIndex);
+          return (short) cpCache.getEntryAt(cpCacheIndex).getConstantPoolIndex();
        } else if (fmt.indexOf("JJ") >= 0) {
           // change byte-ordering and go via cache
           return (short) cpCache.getEntryAt((int) (0xFFFF & bytes.swapShort((short)cpCacheIndex))).getConstantPoolIndex();
--- a/agent/src/share/classes/sun/jvm/hotspot/utilities/Hashtable.java	Thu Jan 16 13:25:25 2014 -0800
+++ b/agent/src/share/classes/sun/jvm/hotspot/utilities/Hashtable.java	Mon Feb 03 10:49:49 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -61,8 +61,9 @@
     long h = 0;
     int s = 0;
     int len = buf.length;
+    // Emulate the unsigned int in java_lang_String::hash_code
     while (len-- > 0) {
-      h = 31*h + (0xFFL & buf[s]);
+      h = 31*h + (0xFFFFFFFFL & buf[s]);
       s++;
     }
     return h & 0xFFFFFFFFL;
--- a/make/bsd/makefiles/adjust-mflags.sh	Thu Jan 16 13:25:25 2014 -0800
+++ b/make/bsd/makefiles/adjust-mflags.sh	Mon Feb 03 10:49:49 2014 +0100
@@ -64,7 +64,7 @@
 	echo "$MFLAGS" \
 	| sed '
 		s/^-/ -/
-		s/ -\([^ 	][^ 	]*\)j/ -\1 -j/
+		s/ -\([^ 	I][^ 	I]*\)j/ -\1 -j/
 		s/ -j[0-9][0-9]*/ -j/
 		s/ -j\([^ 	]\)/ -j -\1/
 		s/ -j/ -j'${HOTSPOT_BUILD_JOBS:-${default_build_jobs}}'/
--- a/make/bsd/makefiles/dtrace.make	Thu Jan 16 13:25:25 2014 -0800
+++ b/make/bsd/makefiles/dtrace.make	Mon Feb 03 10:49:49 2014 +0100
@@ -68,11 +68,9 @@
 
 # Use mapfile with libjvm_db.so
 LIBJVM_DB_MAPFILE = # no mapfile for usdt2 # $(MAKEFILES_DIR)/mapfile-vers-jvm_db
-#LFLAGS_JVM_DB += $(MAPFLAG:FILENAME=$(LIBJVM_DB_MAPFILE))
 
 # Use mapfile with libjvm_dtrace.so
 LIBJVM_DTRACE_MAPFILE = # no mapfile for usdt2 # $(MAKEFILES_DIR)/mapfile-vers-jvm_dtrace
-#LFLAGS_JVM_DTRACE += $(MAPFLAG:FILENAME=$(LIBJVM_DTRACE_MAPFILE))
 
 LFLAGS_JVM_DB += $(PICFLAG) # -D_REENTRANT
 LFLAGS_JVM_DTRACE += $(PICFLAG) # -D_REENTRANT
@@ -260,9 +258,6 @@
   endif
 endif
 
-#$(DTRACE).d: $(DTRACE_SRCDIR)/hotspot.d $(DTRACE_SRCDIR)/hotspot_jni.d \
-#             $(DTRACE_SRCDIR)/hs_private.d $(DTRACE_SRCDIR)/jhelper.d
-#	$(QUIETLY) cat $^ > $@
 
 $(DtraceOutDir):
 	mkdir $(DtraceOutDir)
@@ -276,100 +271,25 @@
 $(DtraceOutDir)/hs_private.h: $(DTRACE_SRCDIR)/hs_private.d | $(DtraceOutDir)
 	$(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_SRCDIR)/hs_private.d
 
-$(DtraceOutDir)/jhelper.h: $(DTRACE_SRCDIR)/jhelper.d $(JVMOFFS).o | $(DtraceOutDir)
-	$(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_SRCDIR)/jhelper.d
-
-# jhelper currently disabled
 dtrace_gen_headers: $(DtraceOutDir)/hotspot.h $(DtraceOutDir)/hotspot_jni.h $(DtraceOutDir)/hs_private.h 
 
-DTraced_Files = ciEnv.o \
-                classLoadingService.o \
-                compileBroker.o \
-                hashtable.o \
-                instanceKlass.o \
-                java.o \
-                jni.o \
-                jvm.o \
-                memoryManager.o \
-                nmethod.o \
-                objectMonitor.o \
-                runtimeService.o \
-                sharedRuntime.o \
-                synchronizer.o \
-                thread.o \
-                unsafe.o \
-                vmThread.o \
-                vmCMSOperations.o \
-                vmPSOperations.o \
-                vmGCOperations.o \
-
-# Dtrace is available, so we build $(DTRACE.o)  
-#$(DTRACE.o): $(DTRACE).d $(JVMOFFS).h $(JVMOFFS)Index.h $(DTraced_Files)
-#	@echo Compiling $(DTRACE).d
-
-#	$(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -G -xlazyload -o $@ -s $(DTRACE).d \
-#     $(DTraced_Files) ||\
-#  STATUS=$$?;\
-#	if [ x"$$STATUS" = x"1" -a \
-#       x`uname -r` = x"5.10" -a \
-#       x`uname -p` = x"sparc" ]; then\
-#    echo "*****************************************************************";\
-#    echo "* If you are building server compiler, and the error message is ";\
-#    echo "* \"incorrect ELF machine type...\", you have run into solaris bug ";\
-#    echo "* 6213962, \"dtrace -G doesn't work on sparcv8+ object files\".";\
-#    echo "* Either patch/upgrade your system (>= S10u1_15), or set the ";\
-#    echo "* environment variable HOTSPOT_DISABLE_DTRACE_PROBES to disable ";\
-#    echo "* dtrace probes for this build.";\
-#    echo "*****************************************************************";\
-#  fi;\
-#  exit $$STATUS
-  # Since some DTraced_Files are in LIBJVM.o and they are touched by this
-  # command, and libgenerateJvmOffsets.so depends on LIBJVM.o, 'make' will
-  # think it needs to rebuild libgenerateJvmOffsets.so and thus JvmOffsets*
-  # files, but it doesn't, so we touch the necessary files to prevent later
-  # recompilation. Note: we only touch the necessary files if they already
-  # exist in order to close a race where an empty file can be created
-  # before the real build rule is executed.
-  # But, we can't touch the *.h files:  This rule depends
-  # on them, and that would cause an infinite cycle of rebuilding.
-  # Neither the *.h or *.ccp files need to be touched, since they have
-  # rules which do not update them when the generator file has not
-  # changed their contents.
-#	$(QUIETLY) if [ -f lib$(GENOFFS).so ]; then touch lib$(GENOFFS).so; fi
-#	$(QUIETLY) if [ -f $(GENOFFS) ]; then touch $(GENOFFS); fi
-#	$(QUIETLY) if [ -f $(JVMOFFS.o) ]; then touch $(JVMOFFS.o); fi
 
 .PHONY: dtraceCheck
 
-#SYSTEM_DTRACE_H = /usr/include/dtrace.h
 SYSTEM_DTRACE_PROG = /usr/sbin/dtrace
-#PATCH_DTRACE_PROG = /opt/SUNWdtrd/sbin/dtrace
 systemDtraceFound := $(wildcard ${SYSTEM_DTRACE_PROG})
-#patchDtraceFound := $(wildcard ${PATCH_DTRACE_PROG})
-#systemDtraceHdrFound := $(wildcard $(SYSTEM_DTRACE_H))
 
-#ifneq ("$(systemDtraceHdrFound)", "") 
-#CFLAGS += -DHAVE_DTRACE_H
-#endif
-
-#ifneq ("$(patchDtraceFound)", "")
-#DTRACE_PROG=$(PATCH_DTRACE_PROG)
-#DTRACE_INCL=-I/opt/SUNWdtrd/include
-#else
 ifneq ("$(systemDtraceFound)", "")
 DTRACE_PROG=$(SYSTEM_DTRACE_PROG)
 else
 
-endif # ifneq ("$(systemDtraceFound)", "")
-#endif # ifneq ("$(patchDtraceFound)", "")
+endif
 
 ifneq ("${DTRACE_PROG}", "")
 ifeq ("${HOTSPOT_DISABLE_DTRACE_PROBES}", "")
 
 DTRACE_OBJS = $(DTRACE.o) #$(JVMOFFS.o)
 CFLAGS += -DDTRACE_ENABLED #$(DTRACE_INCL)
-#clangCFLAGS += -DDTRACE_ENABLED -fno-optimize-sibling-calls
-#MAPFILE_DTRACE_OPT = $(MAPFILE_DTRACE)
 
 
 dtraceCheck:
--- a/make/linux/makefiles/adjust-mflags.sh	Thu Jan 16 13:25:25 2014 -0800
+++ b/make/linux/makefiles/adjust-mflags.sh	Mon Feb 03 10:49:49 2014 +0100
@@ -64,7 +64,7 @@
 	echo "$MFLAGS" \
 	| sed '
 		s/^-/ -/
-		s/ -\([^ 	][^ 	]*\)j/ -\1 -j/
+		s/ -\([^ 	I][^ 	I]*\)j/ -\1 -j/
 		s/ -j[0-9][0-9]*/ -j/
 		s/ -j\([^ 	]\)/ -j -\1/
 		s/ -j/ -j'${HOTSPOT_BUILD_JOBS:-${default_build_jobs}}'/
--- a/make/solaris/makefiles/adjust-mflags.sh	Thu Jan 16 13:25:25 2014 -0800
+++ b/make/solaris/makefiles/adjust-mflags.sh	Mon Feb 03 10:49:49 2014 +0100
@@ -64,7 +64,7 @@
 	echo "$MFLAGS" \
 	| sed '
 		s/^-/ -/
-		s/ -\([^ 	][^ 	]*\)j/ -\1 -j/
+		s/ -\([^ 	I][^ 	I]*\)j/ -\1 -j/
 		s/ -j[0-9][0-9]*/ -j/
 		s/ -j\([^ 	]\)/ -j -\1/
 		s/ -j/ -j'${HOTSPOT_BUILD_JOBS:-${default_build_jobs}}'/
--- a/make/solaris/makefiles/buildtree.make	Thu Jan 16 13:25:25 2014 -0800
+++ b/make/solaris/makefiles/buildtree.make	Mon Feb 03 10:49:49 2014 +0100
@@ -117,7 +117,7 @@
 # For dependencies and recursive makes.
 BUILDTREE_MAKE	= $(GAMMADIR)/make/$(OS_FAMILY)/makefiles/buildtree.make
 
-BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make jvmti.make trace.make sa.make
+BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make jvmti.make trace.make sa.make dtrace.make
 
 BUILDTREE_VARS	= GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OS_FAMILY) \
 	ARCH=$(ARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT)
@@ -349,6 +349,16 @@
 	echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(@F)"; \
 	) > $@
 
+dtrace.make: $(BUILDTREE_MAKE)
+	@echo Creating $@ ...
+	$(QUIETLY) ( \
+	$(BUILDTREE_COMMENT); \
+	echo; \
+	echo include flags.make; \
+	echo; \
+	echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(@F)"; \
+	) > $@
+
 FORCE:
 
 .PHONY:  all FORCE
--- a/make/solaris/makefiles/dtrace.make	Thu Jan 16 13:25:25 2014 -0800
+++ b/make/solaris/makefiles/dtrace.make	Mon Feb 03 10:49:49 2014 +0100
@@ -36,6 +36,8 @@
 
 else
 
+DtraceOutDir = $(GENERATED)/dtracefiles
+
 JVM_DB = libjvm_db
 LIBJVM_DB = libjvm_db.so
 
@@ -326,6 +328,22 @@
 	$(QUIETLY) if [ -f $(GENOFFS) ]; then touch $(GENOFFS); fi
 	$(QUIETLY) if [ -f $(JVMOFFS.o) ]; then touch $(JVMOFFS.o); fi
 
+
+$(DtraceOutDir):
+	mkdir $(DtraceOutDir)
+
+$(DtraceOutDir)/hotspot.h: $(DTRACE_SRCDIR)/hotspot.d | $(DtraceOutDir)
+	$(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_SRCDIR)/hotspot.d
+
+$(DtraceOutDir)/hotspot_jni.h: $(DTRACE_SRCDIR)/hotspot_jni.d | $(DtraceOutDir)
+	$(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_SRCDIR)/hotspot_jni.d
+
+$(DtraceOutDir)/hs_private.h: $(DTRACE_SRCDIR)/hs_private.d | $(DtraceOutDir)
+	$(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_SRCDIR)/hs_private.d
+
+dtrace_gen_headers: $(DtraceOutDir)/hotspot.h $(DtraceOutDir)/hotspot_jni.h $(DtraceOutDir)/hs_private.h
+
+
 .PHONY: dtraceCheck
 
 SYSTEM_DTRACE_H = /usr/include/dtrace.h
--- a/make/solaris/makefiles/top.make	Thu Jan 16 13:25:25 2014 -0800
+++ b/make/solaris/makefiles/top.make	Mon Feb 03 10:49:49 2014 +0100
@@ -73,7 +73,7 @@
 	@echo All done.
 
 # This is an explicit dependency for the sake of parallel makes.
-vm_build_preliminaries:  checks $(Cached_plat) $(AD_Files_If_Required) jvmti_stuff trace_stuff sa_stuff
+vm_build_preliminaries:  checks $(Cached_plat) $(AD_Files_If_Required) jvmti_stuff trace_stuff sa_stuff dtrace_stuff
 	@# We need a null action here, so implicit rules don't get consulted.
 
 $(Cached_plat): $(Plat_File)
@@ -95,6 +95,9 @@
 sa_stuff:
 	@$(MAKE) -f sa.make $(MFLAGS-adjusted)
 
+dtrace_stuff: $(Cached_plat) $(adjust-mflags)
+	@$(MAKE) -f dtrace.make dtrace_gen_headers $(MFLAGS-adjusted) GENERATED=$(GENERATED)
+
 # and the VM: must use other makefile with dependencies included
 
 # We have to go to great lengths to get control over the -jN argument
--- a/src/cpu/sparc/vm/sparc.ad	Thu Jan 16 13:25:25 2014 -0800
+++ b/src/cpu/sparc/vm/sparc.ad	Mon Feb 03 10:49:49 2014 +0100
@@ -3361,8 +3361,8 @@
   interface(CONST_INTER);
 %}
 
-// Unsigned (positive) Integer Immediate: 13-bit
-operand immU13() %{
+// Unsigned Integer Immediate: 12-bit (non-negative that fits in simm13)
+operand immU12() %{
   predicate((0 <= n->get_int()) && Assembler::is_simm13(n->get_int()));
   match(ConI);
   op_cost(0);
@@ -3398,6 +3398,17 @@
   interface(CONST_INTER);
 %}
 
+// Int Immediate non-negative
+operand immU31()
+%{
+  predicate(n->get_int() >= 0);
+  match(ConI);
+
+  op_cost(0);
+  format %{ %}
+  interface(CONST_INTER);
+%}
+
 // Integer Immediate: 0-bit
 operand immI0() %{
   predicate(n->get_int() == 0);
@@ -5726,7 +5737,6 @@
   effect(TEMP dst, TEMP tmp);
   ins_cost(MEMORY_REF_COST + 2*DEFAULT_COST);
 
-  size((3+1)*4);  // set may use two instructions.
   format %{ "LDUH   $mem,$dst\t! ushort/char & 16-bit mask -> long\n\t"
             "SET    $mask,$tmp\n\t"
             "AND    $dst,$tmp,$dst" %}
@@ -5848,13 +5858,13 @@
   ins_pipe(iload_mem);
 %}
 
-// Load Integer with a 13-bit mask into a Long Register
-instruct loadI2L_immI13(iRegL dst, memory mem, immI13 mask) %{
+// Load Integer with a 12-bit mask into a Long Register
+instruct loadI2L_immU12(iRegL dst, memory mem, immU12 mask) %{
   match(Set dst (ConvI2L (AndI (LoadI mem) mask)));
   ins_cost(MEMORY_REF_COST + DEFAULT_COST);
 
   size(2*4);
-  format %{ "LDUW   $mem,$dst\t! int & 13-bit mask -> long\n\t"
+  format %{ "LDUW   $mem,$dst\t! int & 12-bit mask -> long\n\t"
             "AND    $dst,$mask,$dst" %}
   ins_encode %{
     Register Rdst = $dst$$Register;
@@ -5864,14 +5874,13 @@
   ins_pipe(iload_mem);
 %}
 
-// Load Integer with a 32-bit mask into a Long Register
-instruct loadI2L_immI(iRegL dst, memory mem, immI mask, iRegL tmp) %{
+// Load Integer with a 31-bit mask into a Long Register
+instruct loadI2L_immU31(iRegL dst, memory mem, immU31 mask, iRegL tmp) %{
   match(Set dst (ConvI2L (AndI (LoadI mem) mask)));
   effect(TEMP dst, TEMP tmp);
   ins_cost(MEMORY_REF_COST + 2*DEFAULT_COST);
 
-  size((3+1)*4);  // set may use two instructions.
-  format %{ "LDUW   $mem,$dst\t! int & 32-bit mask -> long\n\t"
+  format %{ "LDUW   $mem,$dst\t! int & 31-bit mask -> long\n\t"
             "SET    $mask,$tmp\n\t"
             "AND    $dst,$tmp,$dst" %}
   ins_encode %{
@@ -8966,7 +8975,7 @@
   ins_pipe(ialu_cconly_reg_reg);
 %}
 
-instruct compU_iReg_imm13(flagsRegU icc, iRegI op1, immU13 op2 ) %{
+instruct compU_iReg_imm13(flagsRegU icc, iRegI op1, immU12 op2 ) %{
   match(Set icc (CmpU op1 op2));
 
   size(4);
--- a/src/cpu/x86/vm/x86_32.ad	Thu Jan 16 13:25:25 2014 -0800
+++ b/src/cpu/x86/vm/x86_32.ad	Mon Feb 03 10:49:49 2014 +0100
@@ -3889,6 +3889,17 @@
   interface(CONST_INTER);
 %}
 
+// Int Immediate non-negative
+operand immU31()
+%{
+  predicate(n->get_int() >= 0);
+  match(ConI);
+
+  op_cost(0);
+  format %{ %}
+  interface(CONST_INTER);
+%}
+
 // Constant for long shifts
 operand immI_32() %{
   predicate( n->get_int() == 32 );
@@ -6119,12 +6130,12 @@
   ins_pipe(ialu_reg_mem);
 %}
 
-// Load Integer with 32-bit mask into Long Register
-instruct loadI2L_immI(eRegL dst, memory mem, immI mask, eFlagsReg cr) %{
+// Load Integer with 31-bit mask into Long Register
+instruct loadI2L_immU31(eRegL dst, memory mem, immU31 mask, eFlagsReg cr) %{
   match(Set dst (ConvI2L (AndI (LoadI mem) mask)));
   effect(KILL cr);
 
-  format %{ "MOV    $dst.lo,$mem\t# int & 32-bit mask -> long\n\t"
+  format %{ "MOV    $dst.lo,$mem\t# int & 31-bit mask -> long\n\t"
             "XOR    $dst.hi,$dst.hi\n\t"
             "AND    $dst.lo,$mask" %}
   ins_encode %{
--- a/src/cpu/x86/vm/x86_64.ad	Thu Jan 16 13:25:25 2014 -0800
+++ b/src/cpu/x86/vm/x86_64.ad	Mon Feb 03 10:49:49 2014 +0100
@@ -3086,6 +3086,17 @@
   interface(CONST_INTER);
 %}
 
+// Int Immediate non-negative
+operand immU31()
+%{
+  predicate(n->get_int() >= 0);
+  match(ConI);
+
+  op_cost(0);
+  format %{ %}
+  interface(CONST_INTER);
+%}
+
 // Constant for long shifts
 operand immI_32()
 %{
@@ -5042,12 +5053,12 @@
   ins_pipe(ialu_reg_mem);
 %}
 
-// Load Integer with a 32-bit mask into Long Register
-instruct loadI2L_immI(rRegL dst, memory mem, immI mask, rFlagsReg cr) %{
+// Load Integer with a 31-bit mask into Long Register
+instruct loadI2L_immU31(rRegL dst, memory mem, immU31 mask, rFlagsReg cr) %{
   match(Set dst (ConvI2L (AndI (LoadI mem) mask)));
   effect(KILL cr);
 
-  format %{ "movl    $dst, $mem\t# int & 32-bit mask -> long\n\t"
+  format %{ "movl    $dst, $mem\t# int & 31-bit mask -> long\n\t"
             "andl    $dst, $mask" %}
   ins_encode %{
     Register Rdst = $dst$$Register;
--- a/src/os/bsd/dtrace/hotspot.d	Thu Jan 16 13:25:25 2014 -0800
+++ b/src/os/bsd/dtrace/hotspot.d	Mon Feb 03 10:49:49 2014 +0100
@@ -56,7 +56,7 @@
   probe thread__park__end(uintptr_t);
   probe thread__unpark(uintptr_t);
   probe method__compile__begin(
-    const char*, uintptr_t, const char*, uintptr_t, const char*, uintptr_t, const char*, uintptr_t); 
+    char*, uintptr_t, char*, uintptr_t, char*, uintptr_t, char*, uintptr_t); 
   probe method__compile__end(
     char*, uintptr_t, char*, uintptr_t, char*, uintptr_t, 
     char*, uintptr_t, uintptr_t); 
--- a/src/os/bsd/vm/os_bsd.cpp	Thu Jan 16 13:25:25 2014 -0800
+++ b/src/os/bsd/vm/os_bsd.cpp	Mon Feb 03 10:49:49 2014 +0100
@@ -1557,6 +1557,17 @@
 }
 #endif /* !__APPLE__ */
 
+void* os::get_default_process_handle() {
+#ifdef __APPLE__
+  // MacOS X needs to use RTLD_FIRST instead of RTLD_LAZY
+  // to avoid finding unexpected symbols on second (or later)
+  // loads of a library.
+  return (void*)::dlopen(NULL, RTLD_FIRST);
+#else
+  return (void*)::dlopen(NULL, RTLD_LAZY);
+#endif
+}
+
 // XXX: Do we need a lock around this as per Linux?
 void* os::dll_lookup(void* handle, const char* name) {
   return dlsym(handle, name);
@@ -2625,9 +2636,21 @@
   }
 }
 
-int os::naked_sleep() {
-  // %% make the sleep time an integer flag. for now use 1 millisec.
-  return os::sleep(Thread::current(), 1, false);
+void os::naked_short_sleep(jlong ms) {
+  struct timespec req;
+
+  assert(ms < 1000, "Un-interruptable sleep, short time use only");
+  req.tv_sec = 0;
+  if (ms > 0) {
+    req.tv_nsec = (ms % 1000) * 1000000;
+  }
+  else {
+    req.tv_nsec = 1;
+  }
+
+  nanosleep(&req, NULL);
+
+  return;
 }
 
 // Sleep forever; naked call to OS-specific sleep; use with CAUTION
--- a/src/os/linux/vm/os_linux.cpp	Thu Jan 16 13:25:25 2014 -0800
+++ b/src/os/linux/vm/os_linux.cpp	Mon Feb 03 10:49:49 2014 +0100
@@ -2104,6 +2104,9 @@
   return res;
 }
 
+void* os::get_default_process_handle() {
+  return (void*)::dlopen(NULL, RTLD_LAZY);
+}
 
 static bool _print_ascii_file(const char* filename, outputStream* st) {
   int fd = ::open(filename, O_RDONLY);
@@ -3868,9 +3871,33 @@
   }
 }
 
-int os::naked_sleep() {
-  // %% make the sleep time an integer flag. for now use 1 millisec.
-  return os::sleep(Thread::current(), 1, false);
+//
+// Short sleep, direct OS call.
+//
+// Note: certain versions of Linux CFS scheduler (since 2.6.23) do not guarantee
+// sched_yield(2) will actually give up the CPU:
+//
+//   * Alone on this pariticular CPU, keeps running.
+//   * Before the introduction of "skip_buddy" with "compat_yield" disabled
+//     (pre 2.6.39).
+//
+// So calling this with 0 is an alternative.
+//
+void os::naked_short_sleep(jlong ms) {
+  struct timespec req;
+
+  assert(ms < 1000, "Un-interruptable sleep, short time use only");
+  req.tv_sec = 0;
+  if (ms > 0) {
+    req.tv_nsec = (ms % 1000) * 1000000;
+  }
+  else {
+    req.tv_nsec = 1;
+  }
+
+  nanosleep(&req, NULL);
+
+  return;
 }
 
 // Sleep forever; naked call to OS-specific sleep; use with CAUTION
--- a/src/os/posix/vm/os_posix.cpp	Thu Jan 16 13:25:25 2014 -0800
+++ b/src/os/posix/vm/os_posix.cpp	Mon Feb 03 10:49:49 2014 +0100
@@ -262,10 +262,6 @@
   return ::fdopen(fd, mode);
 }
 
-void* os::get_default_process_handle() {
-  return (void*)::dlopen(NULL, RTLD_LAZY);
-}
-
 // Builds a platform dependent Agent_OnLoad_<lib_name> function name
 // which is used to find statically linked in agents.
 // Parameters:
--- a/src/os/solaris/dtrace/hotspot.d	Thu Jan 16 13:25:25 2014 -0800
+++ b/src/os/solaris/dtrace/hotspot.d	Mon Feb 03 10:49:49 2014 +0100
@@ -25,7 +25,7 @@
 provider hotspot {
   probe class__loaded(char*, uintptr_t, void*, uintptr_t);
   probe class__unloaded(char*, uintptr_t, void*, uintptr_t);
-  probe class__initialization__required(char*, uintptr_t, void*, intptr_t,int);
+  probe class__initialization__required(char*, uintptr_t, void*, intptr_t);
   probe class__initialization__recursive(char*, uintptr_t, void*, intptr_t,int);
   probe class__initialization__concurrent(char*, uintptr_t, void*, intptr_t,int);
   probe class__initialization__erroneous(char*, uintptr_t, void*, intptr_t, int);
--- a/src/os/solaris/dtrace/hotspot_jni.d	Thu Jan 16 13:25:25 2014 -0800
+++ b/src/os/solaris/dtrace/hotspot_jni.d	Mon Feb 03 10:49:49 2014 +0100
@@ -211,7 +211,7 @@
   probe CallVoidMethodV__return();
   probe CreateJavaVM__entry(void**, void**, void*);
   probe CreateJavaVM__return(uint32_t);
-  probe DefineClass__entry(void*, const char*, void*, char, uintptr_t);
+  probe DefineClass__entry(void*, const char*, void*, char*, uintptr_t);
   probe DefineClass__return(void*);
   probe DeleteGlobalRef__entry(void*, void*);
   probe DeleteGlobalRef__return();
--- a/src/os/solaris/vm/os_solaris.cpp	Thu Jan 16 13:25:25 2014 -0800
+++ b/src/os/solaris/vm/os_solaris.cpp	Mon Feb 03 10:49:49 2014 +0100
@@ -2146,6 +2146,10 @@
   return dlsym(handle, name);
 }
 
+void* os::get_default_process_handle() {
+  return (void*)::dlopen(NULL, RTLD_LAZY);
+}
+
 int os::stat(const char *path, struct stat *sbuf) {
   char pathbuf[MAX_PATH];
   if (strlen(path) > MAX_PATH - 1) {
@@ -3536,9 +3540,14 @@
   return os_sleep(millis, interruptible);
 }
 
-int os::naked_sleep() {
-  // %% make the sleep time an integer flag. for now use 1 millisec.
-  return os_sleep(1, false);
+void os::naked_short_sleep(jlong ms) {
+  assert(ms < 1000, "Un-interruptable sleep, short time use only");
+
+  // usleep is deprecated and removed from POSIX, in favour of nanosleep, but
+  // Solaris requires -lrt for this.
+  usleep((ms * 1000));
+
+  return;
 }
 
 // Sleep forever; naked call to OS-specific sleep; use with CAUTION
--- a/src/os/windows/vm/os_windows.cpp	Thu Jan 16 13:25:25 2014 -0800
+++ b/src/os/windows/vm/os_windows.cpp	Mon Feb 03 10:49:49 2014 +0100
@@ -3486,6 +3486,16 @@
   return result;
 }
 
+//
+// Short sleep, direct OS call.
+//
+// ms = 0, means allow others (if any) to run.
+//
+void os::naked_short_sleep(jlong ms) {
+  assert(ms < 1000, "Un-interruptable sleep, short time use only");
+  Sleep(ms);
+}
+
 // Sleep forever; naked call to OS-specific sleep; use with CAUTION
 void os::infinite_sleep() {
   while (true) {    // sleep forever ...
--- a/src/os_cpu/linux_x86/vm/os_linux_x86.cpp	Thu Jan 16 13:25:25 2014 -0800
+++ b/src/os_cpu/linux_x86/vm/os_linux_x86.cpp	Mon Feb 03 10:49:49 2014 +0100
@@ -49,6 +49,7 @@
 #include "runtime/stubRoutines.hpp"
 #include "runtime/thread.inline.hpp"
 #include "runtime/timer.hpp"
+#include "services/memTracker.hpp"
 #include "utilities/events.hpp"
 #include "utilities/vmError.hpp"
 
@@ -906,6 +907,9 @@
   if ( (codebuf == NULL) || (!os::commit_memory(codebuf, page_size, true)) ) {
     return; // No matter, we tried, best effort.
   }
+
+  MemTracker::record_virtual_memory_type((address)codebuf, mtInternal);
+
   if (PrintMiscellaneous && (Verbose || WizardMode)) {
      tty->print_cr("[CS limit NX emulation work-around, exec code at: %p]", codebuf);
   }
--- a/src/share/vm/classfile/classFileParser.cpp	Thu Jan 16 13:25:25 2014 -0800
+++ b/src/share/vm/classfile/classFileParser.cpp	Mon Feb 03 10:49:49 2014 +0100
@@ -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
@@ -4504,8 +4504,8 @@
             break; // didn't find any match; get out
           }
 
-          if (super_m->is_final() &&
-              // matching method in super is final
+          if (super_m->is_final() && !super_m->is_static() &&
+              // matching method in super is final, and not static
               (Reflection::verify_field_access(this_klass(),
                                                super_m->method_holder(),
                                                super_m->method_holder(),
--- a/src/share/vm/code/dependencies.cpp	Thu Jan 16 13:25:25 2014 -0800
+++ b/src/share/vm/code/dependencies.cpp	Mon Feb 03 10:49:49 2014 +0100
@@ -1221,11 +1221,9 @@
 
   // We could also return false if m does not yet appear to be
   // executed, if the VM version supports this distinction also.
+  // Default methods are considered "concrete" as well.
   return !m->is_abstract() &&
-         !InstanceKlass::cast(m->method_holder())->is_interface();
-         // TODO: investigate whether default methods should be
-         // considered as "concrete" in this situation.  For now they
-         // are not.
+         !m->is_overpass(); // error functions aren't concrete
 }
 
 
--- a/src/share/vm/compiler/compileBroker.cpp	Thu Jan 16 13:25:25 2014 -0800
+++ b/src/share/vm/compiler/compileBroker.cpp	Mon Feb 03 10:49:49 2014 +0100
@@ -98,7 +98,7 @@
     Symbol* name = (method)->name();                                     \
     Symbol* signature = (method)->signature();                           \
     HOTSPOT_METHOD_COMPILE_BEGIN(                                        \
-      comp_name, strlen(comp_name),                                      \
+      (char *) comp_name, strlen(comp_name),                             \
       (char *) klass_name->bytes(), klass_name->utf8_length(),           \
       (char *) name->bytes(), name->utf8_length(),                       \
       (char *) signature->bytes(), signature->utf8_length());            \
@@ -110,7 +110,7 @@
     Symbol* name = (method)->name();                                     \
     Symbol* signature = (method)->signature();                           \
     HOTSPOT_METHOD_COMPILE_END(                                          \
-      comp_name, strlen(comp_name),                                      \
+      (char *) comp_name, strlen(comp_name),                             \
       (char *) klass_name->bytes(), klass_name->utf8_length(),           \
       (char *) name->bytes(), name->utf8_length(),                       \
       (char *) signature->bytes(), signature->utf8_length(), (success)); \
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.cpp	Thu Jan 16 13:25:25 2014 -0800
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.cpp	Mon Feb 03 10:49:49 2014 +0100
@@ -141,8 +141,7 @@
 #ifndef USDT2
   HS_DTRACE_PROBE(hs_private, cms__initmark__begin);
 #else /* USDT2 */
-  HS_PRIVATE_CMS_INITMARK_BEGIN(
-                                );
+  HS_PRIVATE_CMS_INITMARK_BEGIN();
 #endif /* USDT2 */
 
   _collector->_gc_timer_cm->register_gc_pause_start("Initial Mark");
@@ -162,8 +161,7 @@
 #ifndef USDT2
   HS_DTRACE_PROBE(hs_private, cms__initmark__end);
 #else /* USDT2 */
-  HS_PRIVATE_CMS_INITMARK_END(
-                                );
+  HS_PRIVATE_CMS_INITMARK_END();
 #endif /* USDT2 */
 }
 
@@ -178,8 +176,7 @@
 #ifndef USDT2
   HS_DTRACE_PROBE(hs_private, cms__remark__begin);
 #else /* USDT2 */
-  HS_PRIVATE_CMS_REMARK_BEGIN(
-                                );
+  HS_PRIVATE_CMS_REMARK_BEGIN();
 #endif /* USDT2 */
 
   _collector->_gc_timer_cm->register_gc_pause_start("Final Mark");
@@ -200,8 +197,7 @@
 #ifndef USDT2
   HS_DTRACE_PROBE(hs_private, cms__remark__end);
 #else /* USDT2 */
-  HS_PRIVATE_CMS_REMARK_END(
-                                );
+  HS_PRIVATE_CMS_REMARK_END();
 #endif /* USDT2 */
 }
 
--- a/src/share/vm/gc_implementation/shared/vmGCOperations.cpp	Thu Jan 16 13:25:25 2014 -0800
+++ b/src/share/vm/gc_implementation/shared/vmGCOperations.cpp	Mon Feb 03 10:49:49 2014 +0100
@@ -56,6 +56,7 @@
 #else /* USDT2 */
   HOTSPOT_GC_BEGIN(
                    full);
+  HS_DTRACE_WORKAROUND_TAIL_CALL_BUG();
 #endif /* USDT2 */
 }
 
@@ -64,8 +65,8 @@
   HS_DTRACE_PROBE(hotspot, gc__end);
   HS_DTRACE_WORKAROUND_TAIL_CALL_BUG();
 #else /* USDT2 */
-  HOTSPOT_GC_END(
-);
+  HOTSPOT_GC_END();
+  HS_DTRACE_WORKAROUND_TAIL_CALL_BUG();
 #endif /* USDT2 */
 }
 
--- a/src/share/vm/interpreter/linkResolver.cpp	Thu Jan 16 13:25:25 2014 -0800
+++ b/src/share/vm/interpreter/linkResolver.cpp	Mon Feb 03 10:49:49 2014 +0100
@@ -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
@@ -649,16 +649,6 @@
     }
   }
 
-  if (nostatics && resolved_method->is_static()) {
-    ResourceMark rm(THREAD);
-    char buf[200];
-    jio_snprintf(buf, sizeof(buf), "Expected instance not static method %s", Method::name_and_sig_as_C_string(resolved_klass(),
-                                                      resolved_method->name(),
-                                                      resolved_method->signature()));
-    THROW_MSG(vmSymbols::java_lang_IncompatibleClassChangeError(), buf);
-  }
-
-
   if (check_access) {
     // JDK8 adds non-public interface methods, and accessability check requirement
     assert(current_klass.not_null() , "current_klass should not be null");
@@ -702,6 +692,15 @@
     }
   }
 
+  if (nostatics && resolved_method->is_static()) {
+    ResourceMark rm(THREAD);
+    char buf[200];
+    jio_snprintf(buf, sizeof(buf), "Expected instance not static method %s",
+                 Method::name_and_sig_as_C_string(resolved_klass(),
+                 resolved_method->name(), resolved_method->signature()));
+    THROW_MSG(vmSymbols::java_lang_IncompatibleClassChangeError(), buf);
+  }
+
   if (TraceItables && Verbose) {
     ResourceMark rm(THREAD);
     tty->print("invokeinterface resolved method: caller-class:%s, compile-time-class:%s, method:%s, method_holder:%s, access_flags: ",
--- a/src/share/vm/oops/constantPool.cpp	Thu Jan 16 13:25:25 2014 -0800
+++ b/src/share/vm/oops/constantPool.cpp	Mon Feb 03 10:49:49 2014 +0100
@@ -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
@@ -1874,7 +1874,6 @@
 // Printing
 
 void ConstantPool::print_on(outputStream* st) const {
-  EXCEPTION_MARK;
   assert(is_constantPool(), "must be constantPool");
   st->print_cr(internal_name());
   if (flags() != 0) {
--- a/src/share/vm/prims/jni.cpp	Thu Jan 16 13:25:25 2014 -0800
+++ b/src/share/vm/prims/jni.cpp	Mon Feb 03 10:49:49 2014 +0100
@@ -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 (c) 2012 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -433,8 +433,7 @@
 #ifndef USDT2
   DTRACE_PROBE2(hotspot_jni, FindClass__entry, env, name);
 #else /* USDT2 */
-  HOTSPOT_JNI_FINDCLASS_ENTRY(
-                              env, (char *)name);
+  HOTSPOT_JNI_FINDCLASS_ENTRY(env, (char *)name);
 #endif /* USDT2 */
 
   jclass result = NULL;
@@ -511,8 +510,7 @@
 #ifndef USDT2
   DTRACE_PROBE2(hotspot_jni, FromReflectedMethod__entry, env, method);
 #else /* USDT2 */
-  HOTSPOT_JNI_FROMREFLECTEDMETHOD_ENTRY(
-                                        env, method);
+  HOTSPOT_JNI_FROMREFLECTEDMETHOD_ENTRY(env, method);
 #endif /* USDT2 */
   jmethodID ret = NULL;
   DT_RETURN_MARK(FromReflectedMethod, jmethodID, (const jmethodID&)ret);
@@ -552,8 +550,7 @@
 #ifndef USDT2
   DTRACE_PROBE2(hotspot_jni, FromReflectedField__entry, env, field);
 #else /* USDT2 */
-  HOTSPOT_JNI_FROMREFLECTEDFIELD_ENTRY(
-                                       env, field);
+  HOTSPOT_JNI_FROMREFLECTEDFIELD_ENTRY(env, field);
 #endif /* USDT2 */
   jfieldID ret = NULL;
   DT_RETURN_MARK(FromReflectedField, jfieldID, (const jfieldID&)ret);
@@ -601,8 +598,7 @@
 #ifndef USDT2
   DTRACE_PROBE4(hotspot_jni, ToReflectedMethod__entry, env, cls, method_id, isStatic);
 #else /* USDT2 */
-  HOTSPOT_JNI_TOREFLECTEDMETHOD_ENTRY(
-                                      env, cls, (uintptr_t) method_id, isStatic);
+  HOTSPOT_JNI_TOREFLECTEDMETHOD_ENTRY(env, cls, (uintptr_t) method_id, isStatic);
 #endif /* USDT2 */
   jobject ret = NULL;
   DT_RETURN_MARK(ToReflectedMethod, jobject, (const jobject&)ret);
@@ -631,8 +627,7 @@
 #ifndef USDT2
   DTRACE_PROBE2(hotspot_jni, GetSuperclass__entry, env, sub);
 #else /* USDT2 */
-  HOTSPOT_JNI_GETSUPERCLASS_ENTRY(
-                                  env, sub);
+  HOTSPOT_JNI_GETSUPERCLASS_ENTRY(env, sub);
 #endif /* USDT2 */
   jclass obj = NULL;
   DT_RETURN_MARK(GetSuperclass, jclass, (const jclass&)obj);
@@ -665,8 +660,7 @@
 #ifndef USDT2
   DTRACE_PROBE3(hotspot_jni, IsAssignableFrom__entry, env, sub, super);
 #else /* USDT2 */
-  HOTSPOT_JNI_ISASSIGNABLEFROM_ENTRY(
-                                     env, sub, super);
+  HOTSPOT_JNI_ISASSIGNABLEFROM_ENTRY(env, sub, super);
 #endif /* USDT2 */
   oop sub_mirror   = JNIHandles::resolve_non_null(sub);
   oop super_mirror = JNIHandles::resolve_non_null(super);
@@ -676,8 +670,7 @@
 #ifndef USDT2
     DTRACE_PROBE1(hotspot_jni, IsAssignableFrom__return, ret);
 #else /* USDT2 */
-    HOTSPOT_JNI_ISASSIGNABLEFROM_RETURN(
-                                        ret);
+    HOTSPOT_JNI_ISASSIGNABLEFROM_RETURN(ret);
 #endif /* USDT2 */
     return ret;
   }
@@ -689,8 +682,7 @@
 #ifndef USDT2
   DTRACE_PROBE1(hotspot_jni, IsAssignableFrom__return, ret);
 #else /* USDT2 */
-  HOTSPOT_JNI_ISASSIGNABLEFROM_RETURN(
-                                      ret);
+  HOTSPOT_JNI_ISASSIGNABLEFROM_RETURN(ret);
 #endif /* USDT2 */
   return ret;
 JNI_END
@@ -707,8 +699,7 @@
 #ifndef USDT2
   DTRACE_PROBE2(hotspot_jni, Throw__entry, env, obj);
 #else /* USDT2 */
-  HOTSPOT_JNI_THROW_ENTRY(
- env, obj);
+  HOTSPOT_JNI_THROW_ENTRY(env, obj);
 #endif /* USDT2 */
   jint ret = JNI_OK;
   DT_RETURN_MARK(Throw, jint, (const jint&)ret);
@@ -729,8 +720,7 @@
 #ifndef USDT2
   DTRACE_PROBE3(hotspot_jni, ThrowNew__entry, env, clazz, message);
 #else /* USDT2 */
-  HOTSPOT_JNI_THROWNEW_ENTRY(
-                             env, clazz, (char *) message);
+  HOTSPOT_JNI_THROWNEW_ENTRY(env, clazz, (char *) message);
 #endif /* USDT2 */
   jint ret = JNI_OK;
   DT_RETURN_MARK(ThrowNew, jint, (const jint&)ret);
@@ -763,8 +753,7 @@
 #ifndef USDT2
   DTRACE_PROBE1(hotspot_jni, ExceptionOccurred__entry, env);
 #else /* USDT2 */
-  HOTSPOT_JNI_EXCEPTIONOCCURRED_ENTRY(
-                                      env);
+  HOTSPOT_JNI_EXCEPTIONOCCURRED_ENTRY(env);
 #endif /* USDT2 */
   jni_check_async_exceptions(thread);
   oop exception = thread->pending_exception();
@@ -772,8 +761,7 @@
 #ifndef USDT2
   DTRACE_PROBE1(hotspot_jni, ExceptionOccurred__return, ret);
 #else /* USDT2 */
-  HOTSPOT_JNI_EXCEPTIONOCCURRED_RETURN(
-                                       ret);
+  HOTSPOT_JNI_EXCEPTIONOCCURRED_RETURN(ret);
 #endif /* USDT2 */
   return ret;
 JNI_END
@@ -784,8 +772,7 @@
 #ifndef USDT2
   DTRACE_PROBE1(hotspot_jni, ExceptionDescribe__entry, env);
 #else /* USDT2 */
-  HOTSPOT_JNI_EXCEPTIONDESCRIBE_ENTRY(
-                                      env);
+  HOTSPOT_JNI_EXCEPTIONDESCRIBE_ENTRY(env);
 #endif /* USDT2 */
   if (thread->has_pending_exception()) {
     Handle ex(thread, thread->pending_exception());
@@ -825,8 +812,7 @@
 #ifndef USDT2
   DTRACE_PROBE(hotspot_jni, ExceptionDescribe__return);
 #else /* USDT2 */
-  HOTSPOT_JNI_EXCEPTIONDESCRIBE_RETURN(
-                                       );
+  HOTSPOT_JNI_EXCEPTIONDESCRIBE_RETURN();
 #endif /* USDT2 */
 JNI_END
 
@@ -836,8 +822,7 @@
 #ifndef USDT2
   DTRACE_PROBE1(hotspot_jni, ExceptionClear__entry, env);
 #else /* USDT2 */
-  HOTSPOT_JNI_EXCEPTIONCLEAR_ENTRY(
-                                   env);
+  HOTSPOT_JNI_EXCEPTIONCLEAR_ENTRY(env);
 #endif /* USDT2 */
 
   // The jni code might be using this API to clear java thrown exception.
@@ -850,8 +835,7 @@
 #ifndef USDT2
   DTRACE_PROBE(hotspot_jni, ExceptionClear__return);
 #else /* USDT2 */
-  HOTSPOT_JNI_EXCEPTIONCLEAR_RETURN(
-                                    );
+  HOTSPOT_JNI_EXCEPTIONCLEAR_RETURN();
 #endif /* USDT2 */
 JNI_END
 
@@ -861,8 +845,7 @@
 #ifndef USDT2
   DTRACE_PROBE2(hotspot_jni, FatalError__entry, env, msg);
 #else /* USDT2 */
-  HOTSPOT_JNI_FATALERROR_ENTRY(
-                               env, (char *) msg);
+  HOTSPOT_JNI_FATALERROR_ENTRY(env, (char *) msg);
 #endif /* USDT2 */
   tty->print_cr("FATAL ERROR in native method: %s", msg);
   thread->print_stack();
@@ -875,16 +858,14 @@
 #ifndef USDT2
   DTRACE_PROBE2(hotspot_jni, PushLocalFrame__entry, env, capacity);
 #else /* USDT2 */
-  HOTSPOT_JNI_PUSHLOCALFRAME_ENTRY(
-                                   env, capacity);
+  HOTSPOT_JNI_PUSHLOCALFRAME_ENTRY(env, capacity);
 #endif /* USDT2 */
   //%note jni_11
   if (capacity < 0 || capacity > MAX_REASONABLE_LOCAL_CAPACITY) {
 #ifndef USDT2
     DTRACE_PROBE1(hotspot_jni, PushLocalFrame__return, JNI_ERR);
 #else /* USDT2 */
-    HOTSPOT_JNI_PUSHLOCALFRAME_RETURN(
-                                      (uint32_t)JNI_ERR);
+    HOTSPOT_JNI_PUSHLOCALFRAME_RETURN((uint32_t)JNI_ERR);
 #endif /* USDT2 */
     return JNI_ERR;
   }
@@ -897,8 +878,7 @@
 #ifndef USDT2
   DTRACE_PROBE1(hotspot_jni, PushLocalFrame__return, ret);
 #else /* USDT2 */
-  HOTSPOT_JNI_PUSHLOCALFRAME_RETURN(
-                                    ret);
+  HOTSPOT_JNI_PUSHLOCALFRAME_RETURN(ret);
 #endif /* USDT2 */
   return ret;
 JNI_END
@@ -909,8 +889,7 @@
 #ifndef USDT2
   DTRACE_PROBE2(hotspot_jni, PopLocalFrame__entry, env, result);
 #else /* USDT2 */
-  HOTSPOT_JNI_POPLOCALFRAME_ENTRY(
-                                  env, result);
+  HOTSPOT_JNI_POPLOCALFRAME_ENTRY(env, result);
 #endif /* USDT2 */
   //%note jni_11
   Handle result_handle(thread, JNIHandles::resolve(result));
@@ -929,8 +908,7 @@
 #ifndef USDT2
   DTRACE_PROBE1(hotspot_jni, PopLocalFrame__return, result);
 #else /* USDT2 */
-  HOTSPOT_JNI_POPLOCALFRAME_RETURN(
-                                   result);
+  HOTSPOT_JNI_POPLOCALFRAME_RETURN(result);
 #endif /* USDT2 */
   return result;
 JNI_END
@@ -941,16 +919,14 @@
 #ifndef USDT2
   DTRACE_PROBE2(hotspot_jni, NewGlobalRef__entry, env, ref);
 #else /* USDT2 */
-  HOTSPOT_JNI_NEWGLOBALREF_ENTRY(
-                                 env, ref);
+  HOTSPOT_JNI_NEWGLOBALREF_ENTRY(env, ref);
 #endif /* USDT2 */
   Handle ref_handle(thread, JNIHandles::resolve(ref));
   jobject ret = JNIHandles::make_global(ref_handle);
 #ifndef USDT2
   DTRACE_PROBE1(hotspot_jni, NewGlobalRef__return, ret);
 #else /* USDT2 */
-  HOTSPOT_JNI_NEWGLOBALREF_RETURN(
-                                  ret);
+  HOTSPOT_JNI_NEWGLOBALREF_RETURN(ret);
 #endif /* USDT2 */
   return ret;
 JNI_END
@@ -961,15 +937,13 @@
 #ifndef USDT2
   DTRACE_PROBE2(hotspot_jni, DeleteGlobalRef__entry, env, ref);
 #else /* USDT2 */
-  HOTSPOT_JNI_DELETEGLOBALREF_ENTRY(
-                                    env, ref);
+  HOTSPOT_JNI_DELETEGLOBALREF_ENTRY(env, ref);
 #endif /* USDT2 */
   JNIHandles::destroy_global(ref);
 #ifndef USDT2
   DTRACE_PROBE(hotspot_jni, DeleteGlobalRef__return);
 #else /* USDT2 */
-  HOTSPOT_JNI_DELETEGLOBALREF_RETURN(
-                                     );
+  HOTSPOT_JNI_DELETEGLOBALREF_RETURN();
 #endif /* USDT2 */
 JNI_END
 
@@ -978,15 +952,13 @@
 #ifndef USDT2
   DTRACE_PROBE2(hotspot_jni, DeleteLocalRef__entry, env, obj);
 #else /* USDT2 */
-  HOTSPOT_JNI_DELETELOCALREF_ENTRY(
-                                   env, obj);
+  HOTSPOT_JNI_DELETELOCALREF_ENTRY(env, obj);
 #endif /* USDT2 */
   JNIHandles::destroy_local(obj);
 #ifndef USDT2
   DTRACE_PROBE(hotspot_jni, DeleteLocalRef__return);
 #else /* USDT2 */
-  HOTSPOT_JNI_DELETELOCALREF_RETURN(
-                                    );
+  HOTSPOT_JNI_DELETELOCALREF_RETURN();
 #endif /* USDT2 */
 JNI_END
 
@@ -995,8 +967,7 @@
 #ifndef USDT2
   DTRACE_PROBE3(hotspot_jni, IsSameObject__entry, env, r1, r2);
 #else /* USDT2 */
-  HOTSPOT_JNI_ISSAMEOBJECT_ENTRY(
-                                 env, r1, r2);
+  HOTSPOT_JNI_ISSAMEOBJECT_ENTRY(env, r1, r2);
 #endif /* USDT2 */
   oop a = JNIHandles::resolve(r1);
   oop b = JNIHandles::resolve(r2);
@@ -1004,8 +975,7 @@
 #ifndef USDT2
   DTRACE_PROBE1(hotspot_jni, IsSameObject__return, ret);
 #else /* USDT2 */
-  HOTSPOT_JNI_ISSAMEOBJECT_RETURN(
-                                  ret);
+  HOTSPOT_JNI_ISSAMEOBJECT_RETURN(ret);
 #endif /* USDT2 */
   return ret;
 JNI_END
@@ -1016,15 +986,13 @@
 #ifndef USDT2
   DTRACE_PROBE2(hotspot_jni, NewLocalRef__entry, env, ref);
 #else /* USDT2 */
-  HOTSPOT_JNI_NEWLOCALREF_ENTRY(
-                                env, ref);
+  HOTSPOT_JNI_NEWLOCALREF_ENTRY(env, ref);
 #endif /* USDT2 */
   jobject ret = JNIHandles::make_local(env, JNIHandles::resolve(ref));
 #ifndef USDT2
   DTRACE_PROBE1(hotspot_jni, NewLocalRef__return, ret);
 #else /* USDT2 */
-  HOTSPOT_JNI_NEWLOCALREF_RETURN(
-                                 ret);
+  HOTSPOT_JNI_NEWLOCALREF_RETURN(ret);
 #endif /* USDT2 */
   return ret;
 JNI_END
@@ -1034,8 +1002,7 @@
 #ifndef USDT2
   DTRACE_PROBE2(hotspot_jni, EnsureLocalCapacity__entry, env, capacity);
 #else /* USDT2 */
-  HOTSPOT_JNI_ENSURELOCALCAPACITY_ENTRY(
-                                        env, capacity);
+  HOTSPOT_JNI_ENSURELOCALCAPACITY_ENTRY(env, capacity);
 #endif /* USDT2 */
   jint ret;
   if (capacity >= 0 && capacity <= MAX_REASONABLE_LOCAL_CAPACITY) {
@@ -1046,8 +1013,7 @@
 #ifndef USDT2
   DTRACE_PROBE1(hotspot_jni, EnsureLocalCapacity__return, ret);
 #else /* USDT2 */
-  HOTSPOT_JNI_ENSURELOCALCAPACITY_RETURN(
-                                         ret);
+  HOTSPOT_JNI_ENSURELOCALCAPACITY_RETURN(ret);
 #endif /* USDT2 */
   return ret;
 JNI_END
@@ -1058,8 +1024,7 @@
 #ifndef USDT2
   DTRACE_PROBE2(hotspot_jni, GetObjectRefType__entry, env, obj);
 #else /* USDT2 */
-  HOTSPOT_JNI_GETOBJECTREFTYPE_ENTRY(
-                                     env, obj);
+  HOTSPOT_JNI_GETOBJECTREFTYPE_ENTRY(env, obj);
 #endif /* USDT2 */
   jobjectRefType ret;
   if (JNIHandles::is_local_handle(thread, obj) ||
@@ -1074,8 +1039,7 @@
 #ifndef USDT2
   DTRACE_PROBE1(hotspot_jni, GetObjectRefType__return, ret);
 #else /* USDT2 */
-  HOTSPOT_JNI_GETOBJECTREFTYPE_RETURN(
-                                      (void *) ret);
+  HOTSPOT_JNI_GETOBJECTREFTYPE_RETURN((void *) ret);
 #endif /* USDT2 */
   return ret;
 JNI_END
@@ -1391,6 +1355,10 @@
 
 static instanceOop alloc_object(jclass clazz, TRAPS) {
   KlassHandle k(THREAD, java_lang_Class::as_Klass(JNIHandles::resolve_non_null(clazz)));
+  if (k == NULL) {
+    ResourceMark rm(THREAD);
+    THROW_(vmSymbols::java_lang_InstantiationException(), NULL);
+  }
   k()->check_valid_for_instantiation(false, CHECK_NULL);
   InstanceKlass::cast(k())->initialize(CHECK_NULL);
   instanceOop ih = InstanceKlass::cast(k())->allocate_instance(THREAD);
@@ -1410,8 +1378,7 @@
 #ifndef USDT2
   DTRACE_PROBE2(hotspot_jni, AllocObject__entry, env, clazz);
 #else /* USDT2 */
-  HOTSPOT_JNI_ALLOCOBJECT_ENTRY(
-                                env, clazz);
+  HOTSPOT_JNI_ALLOCOBJECT_ENTRY(env, clazz);
 #endif /* USDT2 */
   jobject ret = NULL;
   DT_RETURN_MARK(AllocObject, jobject, (const jobject&)ret);
@@ -1433,8 +1400,7 @@
 #ifndef USDT2
   DTRACE_PROBE3(hotspot_jni, NewObjectA__entry, env, clazz, methodID);
 #else /* USDT2 */
-  HOTSPOT_JNI_NEWOBJECTA_ENTRY(
-                               env, clazz, (uintptr_t) methodID);
+  HOTSPOT_JNI_NEWOBJECTA_ENTRY(env, clazz, (uintptr_t) methodID);
 #endif /* USDT2 */
   jobject obj = NULL;
   DT_RETURN_MARK(NewObjectA, jobject, (const jobject)obj);
@@ -1459,8 +1425,7 @@
 #ifndef USDT2
   DTRACE_PROBE3(hotspot_jni, NewObjectV__entry, env, clazz, methodID);
 #else /* USDT2 */
-  HOTSPOT_JNI_NEWOBJECTV_ENTRY(
-                               env, clazz, (uintptr_t) methodID);
+  HOTSPOT_JNI_NEWOBJECTV_ENTRY(env, clazz, (uintptr_t) methodID);
 #endif /* USDT2 */
   jobject obj = NULL;
   DT_RETURN_MARK(NewObjectV, jobject, (const jobject&)obj);
@@ -1485,8 +1450,7 @@
 #ifndef USDT2
   DTRACE_PROBE3(hotspot_jni, NewObject__entry, env, clazz, methodID);
 #else /* USDT2 */
-  HOTSPOT_JNI_NEWOBJECT_ENTRY(
-                              env, clazz, (uintptr_t) methodID);
+  HOTSPOT_JNI_NEWOBJECT_ENTRY(env, clazz, (uintptr_t) methodID);
 #endif /* USDT2 */
   jobject obj = NULL;
   DT_RETURN_MARK(NewObject, jobject, (const jobject&)obj);
@@ -1508,8 +1472,7 @@
 #ifndef USDT2
   DTRACE_PROBE2(hotspot_jni, GetObjectClass__entry, env, obj);
 #else /* USDT2 */
-  HOTSPOT_JNI_GETOBJECTCLASS_ENTRY(
-                                   env, obj);
+  HOTSPOT_JNI_GETOBJECTCLASS_ENTRY(env, obj);
 #endif /* USDT2 */
   Klass* k = JNIHandles::resolve_non_null(obj)->klass();
   jclass ret =
@@ -1517,8 +1480,7 @@
 #ifndef USDT2
   DTRACE_PROBE1(hotspot_jni, GetObjectClass__return, ret);
 #else /* USDT2 */
-  HOTSPOT_JNI_GETOBJECTCLASS_RETURN(
-                                    ret);
+  HOTSPOT_JNI_GETOBJECTCLASS_RETURN(ret);
 #endif /* USDT2 */
   return ret;
 JNI_END
@@ -1528,8 +1490,7 @@
 #ifndef USDT2
   DTRACE_PROBE3(hotspot_jni, IsInstanceOf__entry, env, obj, clazz);
 #else /* USDT2 */
-  HOTSPOT_JNI_ISINSTANCEOF_ENTRY(
-                                 env, obj, clazz);
+  HOTSPOT_JNI_ISINSTANCEOF_ENTRY(env, obj, clazz);
 #endif /* USDT2 */
   jboolean ret = JNI_TRUE;
   if (obj != NULL) {
@@ -1543,8 +1504,7 @@
 #ifndef USDT2
   DTRACE_PROBE1(hotspot_jni, IsInstanceOf__return, ret);
 #else /* USDT2 */
-  HOTSPOT_JNI_ISINSTANCEOF_RETURN(
-                                  ret);
+  HOTSPOT_JNI_ISINSTANCEOF_RETURN(ret);
 #endif /* USDT2 */
   return ret;
 JNI_END
@@ -1608,15 +1568,13 @@
 #ifndef USDT2
   DTRACE_PROBE4(hotspot_jni, GetMethodID__entry, env, clazz, name, sig);
 #else /* USDT2 */
-  HOTSPOT_JNI_GETMETHODID_ENTRY(
-                                env, clazz, (char *) name, (char *) sig);
+  HOTSPOT_JNI_GETMETHODID_ENTRY(env, clazz, (char *) name, (char *) sig);
 #endif /* USDT2 */
   jmethodID ret = get_method_id(env, clazz, name, sig, false, thread);
 #ifndef USDT2
   DTRACE_PROBE1(hotspot_jni, GetMethodID__return, ret);
 #else /* USDT2 */
-  HOTSPOT_JNI_GETMETHODID_RETURN(
-                                 (uintptr_t) ret);
+  HOTSPOT_JNI_GETMETHODID_RETURN((uintptr_t) ret);
 #endif /* USDT2 */
   return ret;
 JNI_END
@@ -1628,15 +1586,13 @@
 #ifndef USDT2
   DTRACE_PROBE4(hotspot_jni, GetStaticMethodID__entry, env, clazz, name, sig);
 #else /* USDT2 */
-  HOTSPOT_JNI_GETSTATICMETHODID_ENTRY(
-                                      env, (char *) clazz, (char *) name, (char *)sig);
+  HOTSPOT_JNI_GETSTATICMETHODID_ENTRY(env, (char *) clazz, (char *) name, (char *)sig);
 #endif /* USDT2 */
   jmethodID ret = get_method_id(env, clazz, name, sig, true, thread);
 #ifndef USDT2
   DTRACE_PROBE1(hotspot_jni, GetStaticMethodID__return, ret);
 #else /* USDT2 */
-  HOTSPOT_JNI_GETSTATICMETHODID_RETURN(
-                                       (uintptr_t) ret);
+  HOTSPOT_JNI_GETSTATICMETHODID_RETURN((uintptr_t) ret);
 #endif /* USDT2 */
   return ret;
 JNI_END
@@ -1896,8 +1852,7 @@
 #ifndef USDT2
   DTRACE_PROBE3(hotspot_jni, CallVoidMethod__entry, env, obj, methodID);
 #else /* USDT2 */
-  HOTSPOT_JNI_CALLVOIDMETHOD_ENTRY(
-                                   env, obj, (uintptr_t) methodID);
+  HOTSPOT_JNI_CALLVOIDMETHOD_ENTRY(env, obj, (uintptr_t) methodID);
 #endif /* USDT2 */
   DT_VOID_RETURN_MARK(CallVoidMethod);
 
@@ -1915,8 +1870,7 @@
 #ifndef USDT2
   DTRACE_PROBE3(hotspot_jni, CallVoidMethodV__entry, env, obj, methodID);
 #else /* USDT2 */
-  HOTSPOT_JNI_CALLVOIDMETHODV_ENTRY(
-                                    env, obj, (uintptr_t) methodID);
+  HOTSPOT_JNI_CALLVOIDMETHODV_ENTRY(env, obj, (uintptr_t) methodID);
 #endif /* USDT2 */
   DT_VOID_RETURN_MARK(CallVoidMethodV);
 
@@ -1931,8 +1885,7 @@
 #ifndef USDT2
   DTRACE_PROBE3(hotspot_jni, CallVoidMethodA__entry, env, obj, methodID);
 #else /* USDT2 */
-  HOTSPOT_JNI_CALLVOIDMETHODA_ENTRY(
-                                    env, obj, (uintptr_t) methodID);
+  HOTSPOT_JNI_CALLVOIDMETHODA_ENTRY(env, obj, (uintptr_t) methodID);
 #endif /* USDT2 */
   DT_VOID_RETURN_MARK(CallVoidMethodA);
 
@@ -2194,8 +2147,7 @@
   DTRACE_PROBE4(hotspot_jni, CallNonvirtualVoidMethod__entry,
                env, obj, cls, methodID);
 #else /* USDT2 */
-  HOTSPOT_JNI_CALLNONVIRTUALVOIDMETHOD_ENTRY(
-               env, obj, cls, (uintptr_t) methodID);
+  HOTSPOT_JNI_CALLNONVIRTUALVOIDMETHOD_ENTRY(env, obj, cls, (uintptr_t) methodID);
 #endif /* USDT2 */
   DT_VOID_RETURN_MARK(CallNonvirtualVoidMethod);
 
@@ -2496,8 +2448,7 @@
 #ifndef USDT2
   DTRACE_PROBE3(hotspot_jni, CallStaticVoidMethod__entry, env, cls, methodID);
 #else /* USDT2 */
-  HOTSPOT_JNI_CALLSTATICVOIDMETHOD_ENTRY(
-                                         env, cls, (uintptr_t) methodID);
+  HOTSPOT_JNI_CALLSTATICVOIDMETHOD_ENTRY(env, cls, (uintptr_t) methodID);
 #endif /* USDT2 */
   DT_VOID_RETURN_MARK(CallStaticVoidMethod);
 
@@ -2515,8 +2466,7 @@
 #ifndef USDT2
   DTRACE_PROBE3(hotspot_jni, CallStaticVoidMethodV__entry, env, cls, methodID);
 #else /* USDT2 */
-  HOTSPOT_JNI_CALLSTATICVOIDMETHODV_ENTRY(
-                                          env, cls, (uintptr_t) methodID);
+  HOTSPOT_JNI_CALLSTATICVOIDMETHODV_ENTRY(env, cls, (uintptr_t) methodID);
 #endif /* USDT2 */
   DT_VOID_RETURN_MARK(CallStaticVoidMethodV);
 
@@ -2531,8 +2481,7 @@
 #ifndef USDT2
   DTRACE_PROBE3(hotspot_jni, CallStaticVoidMethodA__entry, env, cls, methodID);
 #else /* USDT2 */
-  HOTSPOT_JNI_CALLSTATICVOIDMETHODA_ENTRY(
-                                          env, cls, (uintptr_t) methodID);
+  HOTSPOT_JNI_CALLSTATICVOIDMETHODA_ENTRY(env, cls, (uintptr_t) methodID);
 #endif /* USDT2 */
   DT_VOID_RETURN_MARK(CallStaticVoidMethodA);
 
@@ -2560,8 +2509,7 @@
 #ifndef USDT2
   DTRACE_PROBE4(hotspot_jni, GetFieldID__entry, env, clazz, name, sig);
 #else /* USDT2 */
-  HOTSPOT_JNI_GETFIELDID_ENTRY(
-                               env, clazz, (char *) name, (char *) sig);
+  HOTSPOT_JNI_GETFIELDID_ENTRY(env, clazz, (char *) name, (char *) sig);
 #endif /* USDT2 */
   jfieldID ret = 0;
   DT_RETURN_MARK(GetFieldID, jfieldID, (const jfieldID&)ret);
@@ -2597,8 +2545,7 @@
 #ifndef USDT2
   DTRACE_PROBE3(hotspot_jni, GetObjectField__entry, env, obj, fieldID);
 #else /* USDT2 */
-  HOTSPOT_JNI_GETOBJECTFIELD_ENTRY(
-                                   env, obj, (uintptr_t) fieldID);
+  HOTSPOT_JNI_GETOBJECTFIELD_ENTRY(env, obj, (uintptr_t) fieldID);
 #endif /* USDT2 */
   oop o = JNIHandles::resolve_non_null(obj);
   Klass* k = o->klass();
@@ -2632,8 +2579,7 @@
 #ifndef USDT2
   DTRACE_PROBE1(hotspot_jni, GetObjectField__return, ret);
 #else /* USDT2 */
-HOTSPOT_JNI_GETOBJECTFIELD_RETURN(
-                                  ret);
+HOTSPOT_JNI_GETOBJECTFIELD_RETURN(ret);
 #endif /* USDT2 */
   return ret;
 JNI_END
@@ -2758,8 +2704,7 @@
 #ifndef USDT2
   DTRACE_PROBE4(hotspot_jni, SetObjectField__entry, env, obj, fieldID, value);
 #else /* USDT2 */
-  HOTSPOT_JNI_SETOBJECTFIELD_ENTRY(
-                                   env, obj, (uintptr_t) fieldID, value);
+  HOTSPOT_JNI_SETOBJECTFIELD_ENTRY(env, obj, (uintptr_t) fieldID, value);
 #endif /* USDT2 */
   oop o = JNIHandles::resolve_non_null(obj);
   Klass* k = o->klass();
@@ -2776,8 +2721,7 @@
 #ifndef USDT2
   DTRACE_PROBE(hotspot_jni, SetObjectField__return);
 #else /* USDT2 */
-  HOTSPOT_JNI_SETOBJECTFIELD_RETURN(
-);
+  HOTSPOT_JNI_SETOBJECTFIELD_RETURN();
 #endif /* USDT2 */
 JNI_END
 
@@ -2880,8 +2824,7 @@
   DTRACE_PROBE4(hotspot_jni, ToReflectedField__entry,
                 env, cls, fieldID, isStatic);
 #else /* USDT2 */
-  HOTSPOT_JNI_TOREFLECTEDFIELD_ENTRY(
-                env, cls, (uintptr_t) fieldID, isStatic);
+  HOTSPOT_JNI_TOREFLECTEDFIELD_ENTRY(env, cls, (uintptr_t) fieldID, isStatic);
 #endif /* USDT2 */
   jobject ret = NULL;
   DT_RETURN_MARK(ToReflectedField, jobject, (const jobject&)ret);
@@ -2925,8 +2868,7 @@
 #ifndef USDT2
   DTRACE_PROBE4(hotspot_jni, GetStaticFieldID__entry, env, clazz, name, sig);
 #else /* USDT2 */
-  HOTSPOT_JNI_GETSTATICFIELDID_ENTRY(
-                                     env, clazz, (char *) name, (char *) sig);
+  HOTSPOT_JNI_GETSTATICFIELDID_ENTRY(env, clazz, (char *) name, (char *) sig);
 #endif /* USDT2 */
   jfieldID ret = NULL;
   DT_RETURN_MARK(GetStaticFieldID, jfieldID, (const jfieldID&)ret);
@@ -2966,8 +2908,7 @@
 #ifndef USDT2
   DTRACE_PROBE3(hotspot_jni, GetStaticObjectField__entry, env, clazz, fieldID);
 #else /* USDT2 */
-  HOTSPOT_JNI_GETSTATICOBJECTFIELD_ENTRY(
-                                         env, clazz, (uintptr_t) fieldID);
+  HOTSPOT_JNI_GETSTATICOBJECTFIELD_ENTRY(env, clazz, (uintptr_t) fieldID);
 #endif /* USDT2 */
 #if INCLUDE_JNI_CHECK
   DEBUG_ONLY(Klass* param_k = jniCheck::validate_class(thread, clazz);)
@@ -2983,8 +2924,7 @@
 #ifndef USDT2
   DTRACE_PROBE1(hotspot_jni, GetStaticObjectField__return, ret);
 #else /* USDT2 */
-  HOTSPOT_JNI_GETSTATICOBJECTFIELD_RETURN(
-                                          ret);
+  HOTSPOT_JNI_GETSTATICOBJECTFIELD_RETURN(ret);
 #endif /* USDT2 */
   return ret;
 JNI_END
@@ -3069,8 +3009,7 @@
 #ifndef USDT2
   DTRACE_PROBE4(hotspot_jni, SetStaticObjectField__entry, env, clazz, fieldID, value);
 #else /* USDT2 */
- HOTSPOT_JNI_SETSTATICOBJECTFIELD_ENTRY(
-                                        env, clazz, (uintptr_t) fieldID, value);
+ HOTSPOT_JNI_SETSTATICOBJECTFIELD_ENTRY(env, clazz, (uintptr_t) fieldID, value);
 #endif /* USDT2 */
   JNIid* id = jfieldIDWorkaround::from_static_jfieldID(fieldID);
   assert(id->is_static_field_id(), "invalid static field id");
@@ -3085,8 +3024,7 @@
 #ifndef USDT2
   DTRACE_PROBE(hotspot_jni, SetStaticObjectField__return);
 #else /* USDT2 */
-  HOTSPOT_JNI_SETSTATICOBJECTFIELD_RETURN(
-                                          );
+  HOTSPOT_JNI_SETSTATICOBJECTFIELD_RETURN();
 #endif /* USDT2 */
 JNI_END
 
@@ -3189,8 +3127,7 @@
 #ifndef USDT2
   DTRACE_PROBE3(hotspot_jni, NewString__entry, env, unicodeChars, len);
 #else /* USDT2 */
- HOTSPOT_JNI_NEWSTRING_ENTRY(
-                             env, (uint16_t *) unicodeChars, len);
+ HOTSPOT_JNI_NEWSTRING_ENTRY(env, (uint16_t *) unicodeChars, len);
 #endif /* USDT2 */
   jstring ret = NULL;
   DT_RETURN_MARK(NewString, jstring, (const jstring&)ret);
@@ -3205,8 +3142,7 @@
 #ifndef USDT2
   DTRACE_PROBE2(hotspot_jni, GetStringLength__entry, env, string);
 #else /* USDT2 */
-  HOTSPOT_JNI_GETSTRINGLENGTH_ENTRY(
-                                    env, string);
+  HOTSPOT_JNI_GETSTRINGLENGTH_ENTRY(env, string);
 #endif /* USDT2 */
   jsize ret = 0;
   oop s = JNIHandles::resolve_non_null(string);
@@ -3216,8 +3152,7 @@
 #ifndef USDT2
   DTRACE_PROBE1(hotspot_jni, GetStringLength__return, ret);
 #else /* USDT2 */
- HOTSPOT_JNI_GETSTRINGLENGTH_RETURN(
-                                    ret);
+ HOTSPOT_JNI_GETSTRINGLENGTH_RETURN(ret);
 #endif /* USDT2 */
   return ret;
 JNI_END
@@ -3229,8 +3164,7 @@
 #ifndef USDT2
   DTRACE_PROBE3(hotspot_jni, GetStringChars__entry, env, string, isCopy);
 #else /* USDT2 */
- HOTSPOT_JNI_GETSTRINGCHARS_ENTRY(
-                                  env, string, (uintptr_t *) isCopy);
+ HOTSPOT_JNI_GETSTRINGCHARS_ENTRY(env, string, (uintptr_t *) isCopy);
 #endif /* USDT2 */
   jchar* buf = NULL;
   oop s = JNIHandles::resolve_non_null(string);
@@ -3254,8 +3188,7 @@
 #ifndef USDT2
   DTRACE_PROBE1(hotspot_jni, GetStringChars__return, buf);
 #else /* USDT2 */
-  HOTSPOT_JNI_GETSTRINGCHARS_RETURN(
-                                    buf);
+  HOTSPOT_JNI_GETSTRINGCHARS_RETURN(buf);
 #endif /* USDT2 */
   return buf;
 JNI_END
@@ -3266,8 +3199,7 @@
 #ifndef USDT2
   DTRACE_PROBE3(hotspot_jni, ReleaseStringChars__entry, env, str, chars);
 #else /* USDT2 */
-  HOTSPOT_JNI_RELEASESTRINGCHARS_ENTRY(
-                                       env, str, (uint16_t *) chars);
+  HOTSPOT_JNI_RELEASESTRINGCHARS_ENTRY(env, str, (uint16_t *) chars);
 #endif /* USDT2 */
   //%note jni_6
   if (chars != NULL) {
@@ -3278,8 +3210,7 @@
 #ifndef USDT2
   DTRACE_PROBE(hotspot_jni, ReleaseStringChars__return);
 #else /* USDT2 */
-  HOTSPOT_JNI_RELEASESTRINGCHARS_RETURN(
-);
+  HOTSPOT_JNI_RELEASESTRINGCHARS_RETURN();
 #endif /* USDT2 */
 JNI_END
 
@@ -3298,8 +3229,7 @@
 #ifndef USDT2
   DTRACE_PROBE2(hotspot_jni, NewStringUTF__entry, env, bytes);
 #else /* USDT2 */
-  HOTSPOT_JNI_NEWSTRINGUTF_ENTRY(
-                                 env, (char *) bytes);
+  HOTSPOT_JNI_NEWSTRINGUTF_ENTRY(env, (char *) bytes);
 #endif /* USDT2 */
   jstring ret;
   DT_RETURN_MARK(NewStringUTF, jstring, (const jstring&)ret);
@@ -3315,8 +3245,7 @@
 #ifndef USDT2
   DTRACE_PROBE2(hotspot_jni, GetStringUTFLength__entry, env, string);
 #else /* USDT2 */
- HOTSPOT_JNI_GETSTRINGUTFLENGTH_ENTRY(
-                                      env, string);
+ HOTSPOT_JNI_GETSTRINGUTFLENGTH_ENTRY(env, string);
 #endif /* USDT2 */
   jsize ret = 0;
   oop java_string = JNIHandles::resolve_non_null(string);
@@ -3326,8 +3255,7 @@
 #ifndef USDT2
   DTRACE_PROBE1(hotspot_jni, GetStringUTFLength__return, ret);
 #else /* USDT2 */
-  HOTSPOT_JNI_GETSTRINGUTFLENGTH_RETURN(
-                                        ret);
+  HOTSPOT_JNI_GETSTRINGUTFLENGTH_RETURN(ret);
 #endif /* USDT2 */
   return ret;
 JNI_END
@@ -3338,8 +3266,7 @@
 #ifndef USDT2
   DTRACE_PROBE3(hotspot_jni, GetStringUTFChars__entry, env, string, isCopy);
 #else /* USDT2 */
- HOTSPOT_JNI_GETSTRINGUTFCHARS_ENTRY(
-                                     env, string, (uintptr_t *) isCopy);
+ HOTSPOT_JNI_GETSTRINGUTFCHARS_ENTRY(env, string, (uintptr_t *) isCopy);
 #endif /* USDT2 */
   char* result = NULL;
   oop java_string = JNIHandles::resolve_non_null(string);
@@ -3357,8 +3284,7 @@
 #ifndef USDT2
   DTRACE_PROBE1(hotspot_jni, GetStringUTFChars__return, result);
 #else /* USDT2 */
- HOTSPOT_JNI_GETSTRINGUTFCHARS_RETURN(
-                                      result);
+ HOTSPOT_JNI_GETSTRINGUTFCHARS_RETURN(result);
 #endif /* USDT2 */
   return result;
 JNI_END
@@ -3369,8 +3295,7 @@
 #ifndef USDT2
   DTRACE_PROBE3(hotspot_jni, ReleaseStringUTFChars__entry, env, str, chars);
 #else /* USDT2 */
- HOTSPOT_JNI_RELEASESTRINGUTFCHARS_ENTRY(
-                                         env, str, (char *) chars);
+ HOTSPOT_JNI_RELEASESTRINGUTFCHARS_ENTRY(env, str, (char *) chars);
 #endif /* USDT2 */
   if (chars != NULL) {
     FreeHeap((char*) chars);
@@ -3378,8 +3303,7 @@
 #ifndef USDT2
   DTRACE_PROBE(hotspot_jni, ReleaseStringUTFChars__return);
 #else /* USDT2 */
-HOTSPOT_JNI_RELEASESTRINGUTFCHARS_RETURN(
-);
+HOTSPOT_JNI_RELEASESTRINGUTFCHARS_RETURN();
 #endif /* USDT2 */
 JNI_END
 
@@ -3389,8 +3313,7 @@
 #ifndef USDT2
   DTRACE_PROBE2(hotspot_jni, GetArrayLength__entry, env, array);
 #else /* USDT2 */
- HOTSPOT_JNI_GETARRAYLENGTH_ENTRY(
-                                  env, array);
+ HOTSPOT_JNI_GETARRAYLENGTH_ENTRY(env, array);
 #endif /* USDT2 */
   arrayOop a = arrayOop(JNIHandles::resolve_non_null(array));
   assert(a->is_array(), "must be array");
@@ -3398,8 +3321,7 @@
 #ifndef USDT2
   DTRACE_PROBE1(hotspot_jni, GetArrayLength__return, ret);
 #else /* USDT2 */
- HOTSPOT_JNI_GETARRAYLENGTH_RETURN(
-                                   ret);
+ HOTSPOT_JNI_GETARRAYLENGTH_RETURN(ret);
 #endif /* USDT2 */
   return ret;
 JNI_END
@@ -3421,8 +3343,7 @@
 #ifndef USDT2
   DTRACE_PROBE4(hotspot_jni, NewObjectArray__entry, env, length, elementClass, initialElement);
 #else /* USDT2 */
- HOTSPOT_JNI_NEWOBJECTARRAY_ENTRY(
-                                  env, length, elementClass, initialElement);
+ HOTSPOT_JNI_NEWOBJECTARRAY_ENTRY(env, length, elementClass, initialElement);
 #endif /* USDT2 */
   jobjectArray ret = NULL;
   DT_RETURN_MARK(NewObjectArray, jobjectArray, (const jobjectArray&)ret);
@@ -3453,8 +3374,7 @@
 #ifndef USDT2
   DTRACE_PROBE3(hotspot_jni, GetObjectArrayElement__entry, env, array, index);
 #else /* USDT2 */
- HOTSPOT_JNI_GETOBJECTARRAYELEMENT_ENTRY(
-                                         env, array, index);
+ HOTSPOT_JNI_GETOBJECTARRAYELEMENT_ENTRY(env, array, index);
 #endif /* USDT2 */
   jobject ret = NULL;
   DT_RETURN_MARK(GetObjectArrayElement, jobject, (const jobject&)ret);
@@ -3481,8 +3401,7 @@
 #ifndef USDT2
   DTRACE_PROBE4(hotspot_jni, SetObjectArrayElement__entry, env, array, index, value);
 #else /* USDT2 */
- HOTSPOT_JNI_SETOBJECTARRAYELEMENT_ENTRY(
-                                         env, array, index, value);
+ HOTSPOT_JNI_SETOBJECTARRAYELEMENT_ENTRY(env, array, index, value);
 #endif /* USDT2 */
   DT_VOID_RETURN_MARK(SetObjectArrayElement);
 
@@ -4034,8 +3953,7 @@
 #ifndef USDT2
   DTRACE_PROBE4(hotspot_jni, RegisterNatives__entry, env, clazz, methods, nMethods);
 #else /* USDT2 */
-  HOTSPOT_JNI_REGISTERNATIVES_ENTRY(
-                                    env, clazz, (void *) methods, nMethods);
+  HOTSPOT_JNI_REGISTERNATIVES_ENTRY(env, clazz, (void *) methods, nMethods);
 #endif /* USDT2 */
   jint ret = 0;
   DT_RETURN_MARK(RegisterNatives, jint, (const jint&)ret);
@@ -4077,8 +3995,7 @@
 #ifndef USDT2
   DTRACE_PROBE2(hotspot_jni, UnregisterNatives__entry, env, clazz);
 #else /* USDT2 */
- HOTSPOT_JNI_UNREGISTERNATIVES_ENTRY(
-                                     env, clazz);
+ HOTSPOT_JNI_UNREGISTERNATIVES_ENTRY(env, clazz);
 #endif /* USDT2 */
   Klass* k   = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(clazz));
   //%note jni_2
@@ -4094,8 +4011,7 @@
 #ifndef USDT2
   DTRACE_PROBE1(hotspot_jni, UnregisterNatives__return, 0);
 #else /* USDT2 */
- HOTSPOT_JNI_UNREGISTERNATIVES_RETURN(
-                                      0);
+ HOTSPOT_JNI_UNREGISTERNATIVES_RETURN(0);
 #endif /* USDT2 */
   return 0;
 JNI_END
@@ -4115,8 +4031,7 @@
 #ifndef USDT2
   DTRACE_PROBE2(hotspot_jni, MonitorEnter__entry, env, jobj);
 #else /* USDT2 */
- HOTSPOT_JNI_MONITORENTER_ENTRY(
-                                env, jobj);
+ HOTSPOT_JNI_MONITORENTER_ENTRY(env, jobj);
 #endif /* USDT2 */
   jint ret = JNI_ERR;
   DT_RETURN_MARK(MonitorEnter, jint, (const jint&)ret);
@@ -4143,8 +4058,7 @@
 #ifndef USDT2
   DTRACE_PROBE2(hotspot_jni, MonitorExit__entry, env, jobj);
 #else /* USDT2 */
- HOTSPOT_JNI_MONITOREXIT_ENTRY(
-                               env, jobj);
+ HOTSPOT_JNI_MONITOREXIT_ENTRY(env, jobj);
 #endif /* USDT2 */
   jint ret = JNI_ERR;
   DT_RETURN_MARK(MonitorExit, jint, (const jint&)ret);
@@ -4177,8 +4091,7 @@
 #ifndef USDT2
   DTRACE_PROBE5(hotspot_jni, GetStringRegion__entry, env, string, start, len, buf);
 #else /* USDT2 */
- HOTSPOT_JNI_GETSTRINGREGION_ENTRY(
-                                   env, string, start, len, buf);
+ HOTSPOT_JNI_GETSTRINGREGION_ENTRY(env, string, start, len, buf);
 #endif /* USDT2 */
   DT_VOID_RETURN_MARK(GetStringRegion);
   oop s = JNIHandles::resolve_non_null(string);
@@ -4206,8 +4119,7 @@
 #ifndef USDT2
   DTRACE_PROBE5(hotspot_jni, GetStringUTFRegion__entry, env, string, start, len, buf);
 #else /* USDT2 */
- HOTSPOT_JNI_GETSTRINGUTFREGION_ENTRY(
-                                      env, string, start, len, buf);
+ HOTSPOT_JNI_GETSTRINGUTFREGION_ENTRY(env, string, start, len, buf);
 #endif /* USDT2 */
   DT_VOID_RETURN_MARK(GetStringUTFRegion);
   oop s = JNIHandles::resolve_non_null(string);
@@ -4237,8 +4149,7 @@
 #ifndef USDT2
   DTRACE_PROBE3(hotspot_jni, GetPrimitiveArrayCritical__entry, env, array, isCopy);
 #else /* USDT2 */
- HOTSPOT_JNI_GETPRIMITIVEARRAYCRITICAL_ENTRY(
-                                             env, array, (uintptr_t *) isCopy);
+ HOTSPOT_JNI_GETPRIMITIVEARRAYCRITICAL_ENTRY(env, array, (uintptr_t *) isCopy);
 #endif /* USDT2 */
   GC_locker::lock_critical(thread);
   if (isCopy != NULL) {
@@ -4256,8 +4167,7 @@
 #ifndef USDT2
   DTRACE_PROBE1(hotspot_jni, GetPrimitiveArrayCritical__return, ret);
 #else /* USDT2 */
- HOTSPOT_JNI_GETPRIMITIVEARRAYCRITICAL_RETURN(
-                                              ret);
+ HOTSPOT_JNI_GETPRIMITIVEARRAYCRITICAL_RETURN(ret);
 #endif /* USDT2 */
   return ret;
 JNI_END
@@ -4268,16 +4178,14 @@
 #ifndef USDT2
   DTRACE_PROBE4(hotspot_jni, ReleasePrimitiveArrayCritical__entry, env, array, carray, mode);
 #else /* USDT2 */
-  HOTSPOT_JNI_RELEASEPRIMITIVEARRAYCRITICAL_ENTRY(
-                                                  env, array, carray, mode);
+  HOTSPOT_JNI_RELEASEPRIMITIVEARRAYCRITICAL_ENTRY(env, array, carray, mode);
 #endif /* USDT2 */
   // The array, carray and mode arguments are ignored
   GC_locker::unlock_critical(thread);
 #ifndef USDT2
   DTRACE_PROBE(hotspot_jni, ReleasePrimitiveArrayCritical__return);
 #else /* USDT2 */
-HOTSPOT_JNI_RELEASEPRIMITIVEARRAYCRITICAL_RETURN(
-);
+HOTSPOT_JNI_RELEASEPRIMITIVEARRAYCRITICAL_RETURN();
 #endif /* USDT2 */
 JNI_END
 
@@ -4287,8 +4195,7 @@
 #ifndef USDT2
   DTRACE_PROBE3(hotspot_jni, GetStringCritical__entry, env, string, isCopy);
 #else /* USDT2 */
-  HOTSPOT_JNI_GETSTRINGCRITICAL_ENTRY(
-                                      env, string, (uintptr_t *) isCopy);
+  HOTSPOT_JNI_GETSTRINGCRITICAL_ENTRY(env, string, (uintptr_t *) isCopy);
 #endif /* USDT2 */
   GC_locker::lock_critical(thread);
   if (isCopy != NULL) {
@@ -4307,8 +4214,7 @@
 #ifndef USDT2
   DTRACE_PROBE1(hotspot_jni, GetStringCritical__return, ret);
 #else /* USDT2 */
- HOTSPOT_JNI_GETSTRINGCRITICAL_RETURN(
-                                      (uint16_t *) ret);
+ HOTSPOT_JNI_GETSTRINGCRITICAL_RETURN((uint16_t *) ret);
 #endif /* USDT2 */
   return ret;
 JNI_END
@@ -4319,16 +4225,14 @@
 #ifndef USDT2
   DTRACE_PROBE3(hotspot_jni, ReleaseStringCritical__entry, env, str, chars);
 #else /* USDT2 */
-  HOTSPOT_JNI_RELEASESTRINGCRITICAL_ENTRY(
-                                          env, str, (uint16_t *) chars);
+  HOTSPOT_JNI_RELEASESTRINGCRITICAL_ENTRY(env, str, (uint16_t *) chars);
 #endif /* USDT2 */
   // The str and chars arguments are ignored
   GC_locker::unlock_critical(thread);
 #ifndef USDT2
   DTRACE_PROBE(hotspot_jni, ReleaseStringCritical__return);
 #else /* USDT2 */
-HOTSPOT_JNI_RELEASESTRINGCRITICAL_RETURN(
-);
+HOTSPOT_JNI_RELEASESTRINGCRITICAL_RETURN();
 #endif /* USDT2 */
 JNI_END
 
@@ -4338,16 +4242,14 @@
 #ifndef USDT2
   DTRACE_PROBE2(hotspot_jni, NewWeakGlobalRef__entry, env, ref);
 #else /* USDT2 */
- HOTSPOT_JNI_NEWWEAKGLOBALREF_ENTRY(
-                                    env, ref);
+ HOTSPOT_JNI_NEWWEAKGLOBALREF_ENTRY(env, ref);
 #endif /* USDT2 */
   Handle ref_handle(thread, JNIHandles::resolve(ref));
   jweak ret = JNIHandles::make_weak_global(ref_handle);
 #ifndef USDT2
   DTRACE_PROBE1(hotspot_jni, NewWeakGlobalRef__return, ret);
 #else /* USDT2 */
- HOTSPOT_JNI_NEWWEAKGLOBALREF_RETURN(
-                                     ret);
+ HOTSPOT_JNI_NEWWEAKGLOBALREF_RETURN(ret);
 #endif /* USDT2 */
   return ret;
 JNI_END
@@ -4358,15 +4260,13 @@
 #ifndef USDT2
   DTRACE_PROBE2(hotspot_jni, DeleteWeakGlobalRef__entry, env, ref);
 #else /* USDT2 */
-  HOTSPOT_JNI_DELETEWEAKGLOBALREF_ENTRY(
-                                        env, ref);
+  HOTSPOT_JNI_DELETEWEAKGLOBALREF_ENTRY(env, ref);
 #endif /* USDT2 */
   JNIHandles::destroy_weak_global(ref);
 #ifndef USDT2
   DTRACE_PROBE(hotspot_jni, DeleteWeakGlobalRef__return);
 #else /* USDT2 */
-  HOTSPOT_JNI_DELETEWEAKGLOBALREF_RETURN(
-                                         );
+  HOTSPOT_JNI_DELETEWEAKGLOBALREF_RETURN();
 #endif /* USDT2 */
 JNI_END
 
@@ -4376,16 +4276,14 @@
 #ifndef USDT2
   DTRACE_PROBE1(hotspot_jni, ExceptionCheck__entry, env);
 #else /* USDT2 */
- HOTSPOT_JNI_EXCEPTIONCHECK_ENTRY(
-                                  env);
+ HOTSPOT_JNI_EXCEPTIONCHECK_ENTRY(env);
 #endif /* USDT2 */
   jni_check_async_exceptions(thread);
   jboolean ret = (thread->has_pending_exception()) ? JNI_TRUE : JNI_FALSE;
 #ifndef USDT2
   DTRACE_PROBE1(hotspot_jni, ExceptionCheck__return, ret);
 #else /* USDT2 */
- HOTSPOT_JNI_EXCEPTIONCHECK_RETURN(
-                                   ret);
+ HOTSPOT_JNI_EXCEPTIONCHECK_RETURN(ret);
 #endif /* USDT2 */
   return ret;
 JNI_END
@@ -4481,8 +4379,7 @@
 #ifndef USDT2
   DTRACE_PROBE3(hotspot_jni, NewDirectByteBuffer__entry, env, address, capacity);
 #else /* USDT2 */
- HOTSPOT_JNI_NEWDIRECTBYTEBUFFER_ENTRY(
-                                       env, address, capacity);
+ HOTSPOT_JNI_NEWDIRECTBYTEBUFFER_ENTRY(env, address, capacity);
 #endif /* USDT2 */
 
   if (!directBufferSupportInitializeEnded) {
@@ -4490,8 +4387,7 @@
 #ifndef USDT2
       DTRACE_PROBE1(hotspot_jni, NewDirectByteBuffer__return, NULL);
 #else /* USDT2 */
-      HOTSPOT_JNI_NEWDIRECTBYTEBUFFER_RETURN(
-                                             NULL);
+      HOTSPOT_JNI_NEWDIRECTBYTEBUFFER_RETURN(NULL);
 #endif /* USDT2 */
       return NULL;
     }
@@ -4506,8 +4402,7 @@
 #ifndef USDT2
   DTRACE_PROBE1(hotspot_jni, NewDirectByteBuffer__return, ret);
 #else /* USDT2 */
-  HOTSPOT_JNI_NEWDIRECTBYTEBUFFER_RETURN(
-                                         ret);
+  HOTSPOT_JNI_NEWDIRECTBYTEBUFFER_RETURN(ret);
 #endif /* USDT2 */
   return ret;
 }
@@ -4528,8 +4423,7 @@
 #ifndef USDT2
   DTRACE_PROBE2(hotspot_jni, GetDirectBufferAddress__entry, env, buf);
 #else /* USDT2 */
-  HOTSPOT_JNI_GETDIRECTBUFFERADDRESS_ENTRY(
-                                           env, buf);
+  HOTSPOT_JNI_GETDIRECTBUFFERADDRESS_ENTRY(env, buf);
 #endif /* USDT2 */
   void* ret = NULL;
   DT_RETURN_MARK(GetDirectBufferAddress, void*, (const void*&)ret);
@@ -4564,8 +4458,7 @@
 #ifndef USDT2
   DTRACE_PROBE2(hotspot_jni, GetDirectBufferCapacity__entry, env, buf);
 #else /* USDT2 */
-  HOTSPOT_JNI_GETDIRECTBUFFERCAPACITY_ENTRY(
-                                            env, buf);
+  HOTSPOT_JNI_GETDIRECTBUFFERCAPACITY_ENTRY(env, buf);
 #endif /* USDT2 */
   jlong ret = -1;
   DT_RETURN_MARK(GetDirectBufferCapacity, jlong, (const jlong&)ret);
@@ -4596,14 +4489,12 @@
 #ifndef USDT2
   DTRACE_PROBE1(hotspot_jni, GetVersion__entry, env);
 #else /* USDT2 */
-  HOTSPOT_JNI_GETVERSION_ENTRY(
-                               env);
+  HOTSPOT_JNI_GETVERSION_ENTRY(env);
 #endif /* USDT2 */
 #ifndef USDT2
   DTRACE_PROBE1(hotspot_jni, GetVersion__return, CurrentVersion);
 #else /* USDT2 */
-  HOTSPOT_JNI_GETVERSION_RETURN(
-                                CurrentVersion);
+  HOTSPOT_JNI_GETVERSION_RETURN(CurrentVersion);
 #endif /* USDT2 */
   return CurrentVersion;
 JNI_END
@@ -4615,15 +4506,13 @@
 #ifndef USDT2
   DTRACE_PROBE2(hotspot_jni, GetJavaVM__entry, env, vm);
 #else /* USDT2 */
-  HOTSPOT_JNI_GETJAVAVM_ENTRY(
-                              env, (void **) vm);
+  HOTSPOT_JNI_GETJAVAVM_ENTRY(env, (void **) vm);
 #endif /* USDT2 */
   *vm  = (JavaVM *)(&main_vm);
 #ifndef USDT2
   DTRACE_PROBE1(hotspot_jni, GetJavaVM__return, JNI_OK);
 #else /* USDT2 */
-  HOTSPOT_JNI_GETJAVAVM_RETURN(
-                               JNI_OK);
+  HOTSPOT_JNI_GETJAVAVM_RETURN(JNI_OK);
 #endif /* USDT2 */
   return JNI_OK;
 JNI_END
@@ -5014,8 +4903,7 @@
 #ifndef USDT2
   HS_DTRACE_PROBE1(hotspot_jni, GetDefaultJavaVMInitArgs__entry, args_);
 #else /* USDT2 */
-  HOTSPOT_JNI_GETDEFAULTJAVAVMINITARGS_ENTRY(
-                                             args_);
+  HOTSPOT_JNI_GETDEFAULTJAVAVMINITARGS_ENTRY(args_);
 #endif /* USDT2 */
   JDK1_1InitArgs *args = (JDK1_1InitArgs *)args_;
   jint ret = JNI_ERR;
@@ -5110,8 +4998,7 @@
 #ifndef USDT2
   HS_DTRACE_PROBE3(hotspot_jni, CreateJavaVM__entry, vm, penv, args);
 #else /* USDT2 */
-  HOTSPOT_JNI_CREATEJAVAVM_ENTRY(
-                                 (void **) vm, penv, args);
+  HOTSPOT_JNI_CREATEJAVAVM_ENTRY((void **) vm, penv, args);
 #endif /* USDT2 */
 
   jint result = JNI_ERR;
@@ -5168,6 +5055,7 @@
   result = Threads::create_vm((JavaVMInitArgs*) args, &can_try_again);
   if (result == JNI_OK) {
     JavaThread *thread = JavaThread::current();
+    assert(!thread->has_pending_exception(), "should have returned not OK");
     /* thread is thread_in_vm here */
     *vm = (JavaVM *)(&main_vm);
     *(JNIEnv**)penv = thread->jni_environment();
@@ -5204,6 +5092,19 @@
     // Since this is not a JVM_ENTRY we have to set the thread state manually before leaving.
     ThreadStateTransition::transition_and_fence(thread, _thread_in_vm, _thread_in_native);
   } else {
+    // If create_vm exits because of a pending exception, exit with that
+    // exception.  In the future when we figure out how to reclaim memory,
+    // we may be able to exit with JNI_ERR and allow the calling application
+    // to continue.
+    if (Universe::is_fully_initialized()) {
+      // otherwise no pending exception possible - VM will already have aborted
+      JavaThread* THREAD = JavaThread::current();
+      if (HAS_PENDING_EXCEPTION) {
+        HandleMark hm;
+        vm_exit_during_initialization(Handle(THREAD, PENDING_EXCEPTION));
+      }
+    }
+
     if (can_try_again) {
       // reset safe_to_recreate_vm to 1 so that retrial would be possible
       safe_to_recreate_vm = 1;
@@ -5233,8 +5134,7 @@
   HS_DTRACE_PROBE3(hotspot_jni, GetCreatedJavaVMs__entry, \
     vm_buf, bufLen, numVMs);
 #else /* USDT2 */
-  HOTSPOT_JNI_GETCREATEDJAVAVMS_ENTRY(
-                                      (void **) vm_buf, bufLen, (uintptr_t *) numVMs);
+  HOTSPOT_JNI_GETCREATEDJAVAVMS_ENTRY((void **) vm_buf, bufLen, (uintptr_t *) numVMs);
 #endif /* USDT2 */
   if (vm_created) {
     if (numVMs != NULL) *numVMs = 1;
@@ -5245,8 +5145,7 @@
 #ifndef USDT2
   HS_DTRACE_PROBE1(hotspot_jni, GetCreatedJavaVMs__return, JNI_OK);
 #else /* USDT2 */
-  HOTSPOT_JNI_GETCREATEDJAVAVMS_RETURN(
-                                    JNI_OK);
+  HOTSPOT_JNI_GETCREATEDJAVAVMS_RETURN(JNI_OK);
 #endif /* USDT2 */
   return JNI_OK;
 }
@@ -5264,8 +5163,7 @@
 #ifndef USDT2
   DTRACE_PROBE1(hotspot_jni, DestroyJavaVM__entry, vm);
 #else /* USDT2 */
-  HOTSPOT_JNI_DESTROYJAVAVM_ENTRY(
-                                  vm);
+  HOTSPOT_JNI_DESTROYJAVAVM_ENTRY(vm);
 #endif /* USDT2 */
   jint res = JNI_ERR;
   DT_RETURN_MARK(DestroyJavaVM, jint, (const jint&)res);
@@ -5421,15 +5319,13 @@
 #ifndef USDT2
   DTRACE_PROBE3(hotspot_jni, AttachCurrentThread__entry, vm, penv, _args);
 #else /* USDT2 */
-  HOTSPOT_JNI_ATTACHCURRENTTHREAD_ENTRY(
-                                        vm, penv, _args);
+  HOTSPOT_JNI_ATTACHCURRENTTHREAD_ENTRY(vm, penv, _args);
 #endif /* USDT2 */
   if (!vm_created) {
 #ifndef USDT2
     DTRACE_PROBE1(hotspot_jni, AttachCurrentThread__return, JNI_ERR);
 #else /* USDT2 */
-  HOTSPOT_JNI_ATTACHCURRENTTHREAD_RETURN(
-                                         (uint32_t) JNI_ERR);
+  HOTSPOT_JNI_ATTACHCURRENTTHREAD_RETURN((uint32_t) JNI_ERR);
 #endif /* USDT2 */
     return JNI_ERR;
   }
@@ -5439,8 +5335,7 @@
 #ifndef USDT2
   DTRACE_PROBE1(hotspot_jni, AttachCurrentThread__return, ret);
 #else /* USDT2 */
-  HOTSPOT_JNI_ATTACHCURRENTTHREAD_RETURN(
-                                         ret);
+  HOTSPOT_JNI_ATTACHCURRENTTHREAD_RETURN(ret);
 #endif /* USDT2 */
   return ret;
 }
@@ -5450,8 +5345,7 @@
 #ifndef USDT2
   DTRACE_PROBE1(hotspot_jni, DetachCurrentThread__entry, vm);
 #else /* USDT2 */
-  HOTSPOT_JNI_DETACHCURRENTTHREAD_ENTRY(
-                                        vm);
+  HOTSPOT_JNI_DETACHCURRENTTHREAD_ENTRY(vm);
 #endif /* USDT2 */
   VM_Exit::block_if_vm_exited();
 
@@ -5462,8 +5356,7 @@
 #ifndef USDT2
     DTRACE_PROBE1(hotspot_jni, DetachCurrentThread__return, JNI_OK);
 #else /* USDT2 */
-  HOTSPOT_JNI_DETACHCURRENTTHREAD_RETURN(
-                                         JNI_OK);
+  HOTSPOT_JNI_DETACHCURRENTTHREAD_RETURN(JNI_OK);
 #endif /* USDT2 */
     return JNI_OK;
   }
@@ -5473,8 +5366,7 @@
 #ifndef USDT2
     DTRACE_PROBE1(hotspot_jni, DetachCurrentThread__return, JNI_ERR);
 #else /* USDT2 */
-  HOTSPOT_JNI_DETACHCURRENTTHREAD_RETURN(
-                                         (uint32_t) JNI_ERR);
+  HOTSPOT_JNI_DETACHCURRENTTHREAD_RETURN((uint32_t) JNI_ERR);
 #endif /* USDT2 */
     // Can't detach a thread that's running java, that can't work.
     return JNI_ERR;
@@ -5499,8 +5391,7 @@
 #ifndef USDT2
   DTRACE_PROBE1(hotspot_jni, DetachCurrentThread__return, JNI_OK);
 #else /* USDT2 */
-  HOTSPOT_JNI_DETACHCURRENTTHREAD_RETURN(
-                                         JNI_OK);
+  HOTSPOT_JNI_DETACHCURRENTTHREAD_RETURN(JNI_OK);
 #endif /* USDT2 */
   return JNI_OK;
 }
@@ -5516,8 +5407,7 @@
 #ifndef USDT2
   DTRACE_PROBE3(hotspot_jni, GetEnv__entry, vm, penv, version);
 #else /* USDT2 */
-  HOTSPOT_JNI_GETENV_ENTRY(
-                           vm, penv, version);
+  HOTSPOT_JNI_GETENV_ENTRY(vm, penv, version);
 #endif /* USDT2 */
   jint ret = JNI_ERR;
   DT_RETURN_MARK(GetEnv, jint, (const jint&)ret);
@@ -5575,15 +5465,13 @@
 #ifndef USDT2
   DTRACE_PROBE3(hotspot_jni, AttachCurrentThreadAsDaemon__entry, vm, penv, _args);
 #else /* USDT2 */
-  HOTSPOT_JNI_ATTACHCURRENTTHREADASDAEMON_ENTRY(
-                                                vm, penv, _args);
+  HOTSPOT_JNI_ATTACHCURRENTTHREADASDAEMON_ENTRY(vm, penv, _args);
 #endif /* USDT2 */
   if (!vm_created) {
 #ifndef USDT2
     DTRACE_PROBE1(hotspot_jni, AttachCurrentThreadAsDaemon__return, JNI_ERR);
 #else /* USDT2 */
-  HOTSPOT_JNI_ATTACHCURRENTTHREADASDAEMON_RETURN(
-                                                 (uint32_t) JNI_ERR);
+  HOTSPOT_JNI_ATTACHCURRENTTHREADASDAEMON_RETURN((uint32_t) JNI_ERR);
 #endif /* USDT2 */
     return JNI_ERR;
   }
@@ -5593,8 +5481,7 @@
 #ifndef USDT2
   DTRACE_PROBE1(hotspot_jni, AttachCurrentThreadAsDaemon__return, ret);
 #else /* USDT2 */
-  HOTSPOT_JNI_ATTACHCURRENTTHREADASDAEMON_RETURN(
-                                                 ret);
+  HOTSPOT_JNI_ATTACHCURRENTTHREADASDAEMON_RETURN(ret);
 #endif /* USDT2 */
   return ret;
 }
--- a/src/share/vm/prims/jvmtiEnvThreadState.cpp	Thu Jan 16 13:25:25 2014 -0800
+++ b/src/share/vm/prims/jvmtiEnvThreadState.cpp	Mon Feb 03 10:49:49 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -272,7 +272,7 @@
     // There can be a race condition between a VM_Operation reaching a safepoint
     // and the target thread exiting from Java execution.
     // We must recheck the last Java frame still exists.
-    if (_thread->has_last_Java_frame()) {
+    if (!_thread->is_exiting() && _thread->has_last_Java_frame()) {
       javaVFrame* vf = _thread->last_java_vframe(&rm);
       assert(vf != NULL, "must have last java frame");
       Method* method = vf->method();
--- a/src/share/vm/prims/methodHandles.cpp	Thu Jan 16 13:25:25 2014 -0800
+++ b/src/share/vm/prims/methodHandles.cpp	Mon Feb 03 10:49:49 2014 +0100
@@ -175,8 +175,8 @@
 
 oop MethodHandles::init_method_MemberName(Handle mname, CallInfo& info) {
   assert(info.resolved_appendix().is_null(), "only normal methods here");
-  KlassHandle receiver_limit = info.resolved_klass();
   methodHandle m = info.resolved_method();
+  KlassHandle m_klass = m->method_holder();
   int flags = (jushort)( m->access_flags().as_short() & JVM_RECOGNIZED_METHOD_MODIFIERS );
   int vmindex = Method::invalid_vtable_index;
 
@@ -184,14 +184,13 @@
   case CallInfo::itable_call:
     vmindex = info.itable_index();
     // More importantly, the itable index only works with the method holder.
-    receiver_limit = m->method_holder();
-    assert(receiver_limit->verify_itable_index(vmindex), "");
+    assert(m_klass->verify_itable_index(vmindex), "");
     flags |= IS_METHOD | (JVM_REF_invokeInterface << REFERENCE_KIND_SHIFT);
     if (TraceInvokeDynamic) {
       ResourceMark rm;
-      tty->print_cr("memberName: invokeinterface method_holder::method: %s, receiver: %s, itableindex: %d, access_flags:",
-            Method::name_and_sig_as_C_string(receiver_limit(), m->name(), m->signature()),
-            receiver_limit()->internal_name(), vmindex);
+      tty->print_cr("memberName: invokeinterface method_holder::method: %s, itableindex: %d, access_flags:",
+            Method::name_and_sig_as_C_string(m->method_holder(), m->name(), m->signature()),
+            vmindex);
        m->access_flags().print_on(tty);
        if (!m->is_abstract()) {
          tty->print("default");
@@ -203,12 +202,35 @@
   case CallInfo::vtable_call:
     vmindex = info.vtable_index();
     flags |= IS_METHOD | (JVM_REF_invokeVirtual << REFERENCE_KIND_SHIFT);
-    assert(receiver_limit->is_subtype_of(m->method_holder()), "virtual call must be type-safe");
+    assert(info.resolved_klass()->is_subtype_of(m_klass()), "virtual call must be type-safe");
+    if (m_klass->is_interface()) {
+      // This is a vtable call to an interface method (abstract "miranda method" or default method).
+      // The vtable index is meaningless without a class (not interface) receiver type, so get one.
+      // (LinkResolver should help us figure this out.)
+      KlassHandle m_klass_non_interface = info.resolved_klass();
+      if (m_klass_non_interface->is_interface()) {
+        m_klass_non_interface = SystemDictionary::Object_klass();
+#ifdef ASSERT
+        { ResourceMark rm;
+          Method* m2 = m_klass_non_interface->vtable()->method_at(vmindex);
+          assert(m->name() == m2->name() && m->signature() == m2->signature(),
+                 err_msg("at %d, %s != %s", vmindex,
+                         m->name_and_sig_as_C_string(), m2->name_and_sig_as_C_string()));
+        }
+#endif //ASSERT
+      }
+      if (!m->is_public()) {
+        assert(m->is_public(), "virtual call must be to public interface method");
+        return NULL;  // elicit an error later in product build
+      }
+      assert(info.resolved_klass()->is_subtype_of(m_klass_non_interface()), "virtual call must be type-safe");
+      m_klass = m_klass_non_interface;
+    }
     if (TraceInvokeDynamic) {
       ResourceMark rm;
       tty->print_cr("memberName: invokevirtual method_holder::method: %s, receiver: %s, vtableindex: %d, access_flags:",
-            Method::name_and_sig_as_C_string(receiver_limit(), m->name(), m->signature()),
-            receiver_limit()->internal_name(), vmindex);
+            Method::name_and_sig_as_C_string(m->method_holder(), m->name(), m->signature()),
+            m_klass->internal_name(), vmindex);
        m->access_flags().print_on(tty);
        if (m->is_default_method()) {
          tty->print("default");
@@ -223,10 +245,8 @@
       flags |= IS_METHOD      | (JVM_REF_invokeStatic  << REFERENCE_KIND_SHIFT);
     } else if (m->is_initializer()) {
       flags |= IS_CONSTRUCTOR | (JVM_REF_invokeSpecial << REFERENCE_KIND_SHIFT);
-      assert(receiver_limit == m->method_holder(), "constructor call must be exactly typed");
     } else {
       flags |= IS_METHOD      | (JVM_REF_invokeSpecial << REFERENCE_KIND_SHIFT);
-      assert(receiver_limit->is_subtype_of(m->method_holder()), "special call must be type-safe");
     }
     break;
 
@@ -242,7 +262,7 @@
   java_lang_invoke_MemberName::set_flags(   mname_oop, flags);
   java_lang_invoke_MemberName::set_vmtarget(mname_oop, m());
   java_lang_invoke_MemberName::set_vmindex( mname_oop, vmindex);   // vtable/itable index
-  java_lang_invoke_MemberName::set_clazz(   mname_oop, receiver_limit->java_mirror());
+  java_lang_invoke_MemberName::set_clazz(   mname_oop, m_klass->java_mirror());
   // Note:  name and type can be lazily computed by resolve_MemberName,
   // if Java code needs them as resolved String and MethodType objects.
   // The clazz must be eagerly stored, because it provides a GC
@@ -569,7 +589,7 @@
 // An unresolved member name is a mere symbolic reference.
 // Resolving it plants a vmtarget/vmindex in it,
 // which refers directly to JVM internals.
-Handle MethodHandles::resolve_MemberName(Handle mname, TRAPS) {
+Handle MethodHandles::resolve_MemberName(Handle mname, KlassHandle caller, TRAPS) {
   Handle empty;
   assert(java_lang_invoke_MemberName::is_instance(mname()), "");
 
@@ -646,20 +666,20 @@
         assert(!HAS_PENDING_EXCEPTION, "");
         if (ref_kind == JVM_REF_invokeStatic) {
           LinkResolver::resolve_static_call(result,
-                        defc, name, type, KlassHandle(), false, false, THREAD);
+                        defc, name, type, caller, caller.not_null(), false, THREAD);
         } else if (ref_kind == JVM_REF_invokeInterface) {
           LinkResolver::resolve_interface_call(result, Handle(), defc,
-                        defc, name, type, KlassHandle(), false, false, THREAD);
+                        defc, name, type, caller, caller.not_null(), false, THREAD);
         } else if (mh_invoke_id != vmIntrinsics::_none) {
           assert(!is_signature_polymorphic_static(mh_invoke_id), "");
           LinkResolver::resolve_handle_call(result,
-                        defc, name, type, KlassHandle(), THREAD);
+                        defc, name, type, caller, THREAD);
         } else if (ref_kind == JVM_REF_invokeSpecial) {
           LinkResolver::resolve_special_call(result,
-                        defc, name, type, KlassHandle(), false, THREAD);
+                        defc, name, type, caller, caller.not_null(), THREAD);
         } else if (ref_kind == JVM_REF_invokeVirtual) {
           LinkResolver::resolve_virtual_call(result, Handle(), defc,
-                        defc, name, type, KlassHandle(), false, false, THREAD);
+                        defc, name, type, caller, caller.not_null(), false, THREAD);
         } else {
           assert(false, err_msg("ref_kind=%d", ref_kind));
         }
@@ -683,7 +703,7 @@
         assert(!HAS_PENDING_EXCEPTION, "");
         if (name == vmSymbols::object_initializer_name()) {
           LinkResolver::resolve_special_call(result,
-                        defc, name, type, KlassHandle(), false, THREAD);
+                        defc, name, type, caller, caller.not_null(), THREAD);
         } else {
           break;                // will throw after end of switch
         }
@@ -700,7 +720,7 @@
       fieldDescriptor result; // find_field initializes fd if found
       {
         assert(!HAS_PENDING_EXCEPTION, "");
-        LinkResolver::resolve_field(result, defc, name, type, KlassHandle(), Bytecodes::_nop, false, false, THREAD);
+        LinkResolver::resolve_field(result, defc, name, type, caller, Bytecodes::_nop, false, false, THREAD);
         if (HAS_PENDING_EXCEPTION) {
           return empty;
         }
@@ -1121,7 +1141,11 @@
     }
   }
 
-  Handle resolved = MethodHandles::resolve_MemberName(mname, CHECK_NULL);
+  KlassHandle caller(THREAD,
+                     caller_jh == NULL ? (Klass*) NULL :
+                     java_lang_Class::as_Klass(JNIHandles::resolve_non_null(caller_jh)));
+  Handle resolved = MethodHandles::resolve_MemberName(mname, caller, CHECK_NULL);
+
   if (resolved.is_null()) {
     int flags = java_lang_invoke_MemberName::flags(mname());
     int ref_kind = (flags >> REFERENCE_KIND_SHIFT) & REFERENCE_KIND_MASK;
--- a/src/share/vm/prims/methodHandles.hpp	Thu Jan 16 13:25:25 2014 -0800
+++ b/src/share/vm/prims/methodHandles.hpp	Mon Feb 03 10:49:49 2014 +0100
@@ -55,7 +55,7 @@
 
  public:
   // working with member names
-  static Handle resolve_MemberName(Handle mname, TRAPS); // compute vmtarget/vmindex from name/type
+  static Handle resolve_MemberName(Handle mname, KlassHandle caller, TRAPS); // compute vmtarget/vmindex from name/type
   static void expand_MemberName(Handle mname, int suppress, TRAPS);  // expand defc/name/type if missing
   static Handle new_MemberName(TRAPS);  // must be followed by init_MemberName
   static oop init_MemberName(Handle mname_h, Handle target_h); // compute vmtarget/vmindex from target
--- a/src/share/vm/runtime/arguments.cpp	Thu Jan 16 13:25:25 2014 -0800
+++ b/src/share/vm/runtime/arguments.cpp	Mon Feb 03 10:49:49 2014 +0100
@@ -878,7 +878,7 @@
     arg_len = equal_sign - argname;
   }
 
-  Flag* found_flag = Flag::find_flag((const char*)argname, arg_len, true);
+  Flag* found_flag = Flag::find_flag((const char*)argname, arg_len, true, true);
   if (found_flag != NULL) {
     char locked_message_buf[BUFLEN];
     found_flag->get_locked_message(locked_message_buf, BUFLEN);
--- a/src/share/vm/runtime/globals.cpp	Thu Jan 16 13:25:25 2014 -0800
+++ b/src/share/vm/runtime/globals.cpp	Mon Feb 03 10:49:49 2014 +0100
@@ -31,6 +31,7 @@
 #include "utilities/ostream.hpp"
 #include "utilities/macros.hpp"
 #include "utilities/top.hpp"
+#include "trace/tracing.hpp"
 #if INCLUDE_ALL_GCS
 #include "gc_implementation/g1/g1_globals.hpp"
 #endif // INCLUDE_ALL_GCS
@@ -62,6 +63,14 @@
 MATERIALIZE_FLAGS_EXT
 
 
+static bool is_product_build() {
+#ifdef PRODUCT
+  return true;
+#else
+  return false;
+#endif
+}
+
 void Flag::check_writable() {
   if (is_constant_in_binary()) {
     fatal(err_msg("flag is constant: %s", _name));
@@ -235,6 +244,27 @@
 // Get custom message for this locked flag, or return NULL if
 // none is available.
 void Flag::get_locked_message(char* buf, int buflen) const {
+  buf[0] = '\0';
+  if (is_diagnostic() && !is_unlocked()) {
+    jio_snprintf(buf, buflen, "Error: VM option '%s' is diagnostic and must be enabled via -XX:+UnlockDiagnosticVMOptions.\n",
+                 _name);
+    return;
+  }
+  if (is_experimental() && !is_unlocked()) {
+    jio_snprintf(buf, buflen, "Error: VM option '%s' is experimental and must be enabled via -XX:+UnlockExperimentalVMOptions.\n",
+                 _name);
+    return;
+  }
+  if (is_develop() && is_product_build()) {
+    jio_snprintf(buf, buflen, "Error: VM option '%s' is develop and is available only in debug version of VM.\n",
+                 _name);
+    return;
+  }
+  if (is_notproduct() && is_product_build()) {
+    jio_snprintf(buf, buflen, "Error: VM option '%s' is notproduct and is available only in debug version of VM.\n",
+                 _name);
+    return;
+  }
   get_locked_message_ext(buf, buflen);
 }
 
@@ -464,13 +494,13 @@
 }
 
 // Search the flag table for a named flag
-Flag* Flag::find_flag(const char* name, size_t length, bool allow_locked) {
+Flag* Flag::find_flag(const char* name, size_t length, bool allow_locked, bool return_flag) {
   for (Flag* current = &flagTable[0]; current->_name != NULL; current++) {
     if (str_equal(current->_name, name, length)) {
       // Found a matching entry.
       // Don't report notproduct and develop flags in product builds.
       if (current->is_constant_in_binary()) {
-        return NULL;
+        return (return_flag == true ? current : NULL);
       }
       // Report locked flags only if allowed.
       if (!(current->is_unlocked() || current->is_unlocker())) {
@@ -564,6 +594,17 @@
   return true;
 }
 
+template<class E, class T>
+static void trace_flag_changed(const char* name, const T old_value, const T new_value, const Flag::Flags origin)
+{
+  E e;
+  e.set_name(name);
+  e.set_old_value(old_value);
+  e.set_new_value(new_value);
+  e.set_origin(origin);
+  e.commit();
+}
+
 bool CommandLineFlags::boolAt(char* name, size_t len, bool* value) {
   Flag* result = Flag::find_flag(name, len);
   if (result == NULL) return false;
@@ -577,6 +618,7 @@
   if (result == NULL) return false;
   if (!result->is_bool()) return false;
   bool old_value = result->get_bool();
+  trace_flag_changed<EventBooleanFlagChanged, bool>(name, old_value, *value, origin);
   result->set_bool(*value);
   *value = old_value;
   result->set_origin(origin);
@@ -586,6 +628,7 @@
 void CommandLineFlagsEx::boolAtPut(CommandLineFlagWithType flag, bool value, Flag::Flags origin) {
   Flag* faddr = address_of_flag(flag);
   guarantee(faddr != NULL && faddr->is_bool(), "wrong flag type");
+  trace_flag_changed<EventBooleanFlagChanged, bool>(faddr->_name, faddr->get_bool(), value, origin);
   faddr->set_bool(value);
   faddr->set_origin(origin);
 }
@@ -603,6 +646,7 @@
   if (result == NULL) return false;
   if (!result->is_intx()) return false;
   intx old_value = result->get_intx();
+  trace_flag_changed<EventLongFlagChanged, s8>(name, old_value, *value, origin);
   result->set_intx(*value);
   *value = old_value;
   result->set_origin(origin);
@@ -612,6 +656,7 @@
 void CommandLineFlagsEx::intxAtPut(CommandLineFlagWithType flag, intx value, Flag::Flags origin) {
   Flag* faddr = address_of_flag(flag);
   guarantee(faddr != NULL && faddr->is_intx(), "wrong flag type");
+  trace_flag_changed<EventLongFlagChanged, s8>(faddr->_name, faddr->get_intx(), value, origin);
   faddr->set_intx(value);
   faddr->set_origin(origin);
 }
@@ -629,6 +674,7 @@
   if (result == NULL) return false;
   if (!result->is_uintx()) return false;
   uintx old_value = result->get_uintx();
+  trace_flag_changed<EventUnsignedLongFlagChanged, u8>(name, old_value, *value, origin);
   result->set_uintx(*value);
   *value = old_value;
   result->set_origin(origin);
@@ -638,6 +684,7 @@
 void CommandLineFlagsEx::uintxAtPut(CommandLineFlagWithType flag, uintx value, Flag::Flags origin) {
   Flag* faddr = address_of_flag(flag);
   guarantee(faddr != NULL && faddr->is_uintx(), "wrong flag type");
+  trace_flag_changed<EventUnsignedLongFlagChanged, u8>(faddr->_name, faddr->get_uintx(), value, origin);
   faddr->set_uintx(value);
   faddr->set_origin(origin);
 }
@@ -655,6 +702,7 @@
   if (result == NULL) return false;
   if (!result->is_uint64_t()) return false;
   uint64_t old_value = result->get_uint64_t();
+  trace_flag_changed<EventUnsignedLongFlagChanged, u8>(name, old_value, *value, origin);
   result->set_uint64_t(*value);
   *value = old_value;
   result->set_origin(origin);
@@ -664,6 +712,7 @@
 void CommandLineFlagsEx::uint64_tAtPut(CommandLineFlagWithType flag, uint64_t value, Flag::Flags origin) {
   Flag* faddr = address_of_flag(flag);
   guarantee(faddr != NULL && faddr->is_uint64_t(), "wrong flag type");
+  trace_flag_changed<EventUnsignedLongFlagChanged, u8>(faddr->_name, faddr->get_uint64_t(), value, origin);
   faddr->set_uint64_t(value);
   faddr->set_origin(origin);
 }
@@ -681,6 +730,7 @@
   if (result == NULL) return false;
   if (!result->is_double()) return false;
   double old_value = result->get_double();
+  trace_flag_changed<EventDoubleFlagChanged, double>(name, old_value, *value, origin);
   result->set_double(*value);
   *value = old_value;
   result->set_origin(origin);
@@ -690,6 +740,7 @@
 void CommandLineFlagsEx::doubleAtPut(CommandLineFlagWithType flag, double value, Flag::Flags origin) {
   Flag* faddr = address_of_flag(flag);
   guarantee(faddr != NULL && faddr->is_double(), "wrong flag type");
+  trace_flag_changed<EventDoubleFlagChanged, double>(faddr->_name, faddr->get_double(), value, origin);
   faddr->set_double(value);
   faddr->set_origin(origin);
 }
@@ -707,6 +758,7 @@
   if (result == NULL) return false;
   if (!result->is_ccstr()) return false;
   ccstr old_value = result->get_ccstr();
+  trace_flag_changed<EventStringFlagChanged, const char*>(name, old_value, *value, origin);
   char* new_value = NULL;
   if (*value != NULL) {
     new_value = NEW_C_HEAP_ARRAY(char, strlen(*value)+1, mtInternal);
@@ -728,6 +780,7 @@
   Flag* faddr = address_of_flag(flag);
   guarantee(faddr != NULL && faddr->is_ccstr(), "wrong flag type");
   ccstr old_value = faddr->get_ccstr();
+  trace_flag_changed<EventStringFlagChanged, const char*>(faddr->_name, old_value, value, origin);
   char* new_value = NEW_C_HEAP_ARRAY(char, strlen(value)+1, mtInternal);
   strcpy(new_value, value);
   faddr->set_ccstr(new_value);
--- a/src/share/vm/runtime/globals.hpp	Thu Jan 16 13:25:25 2014 -0800
+++ b/src/share/vm/runtime/globals.hpp	Mon Feb 03 10:49:49 2014 +0100
@@ -241,7 +241,7 @@
   // number of flags
   static size_t numFlags;
 
-  static Flag* find_flag(const char* name, size_t length, bool allow_locked = false);
+  static Flag* find_flag(const char* name, size_t length, bool allow_locked = false, bool return_flag = false);
   static Flag* fuzzy_match(const char* name, size_t length, bool allow_locked = false);
 
   void check_writable();
--- a/src/share/vm/runtime/java.cpp	Thu Jan 16 13:25:25 2014 -0800
+++ b/src/share/vm/runtime/java.cpp	Mon Feb 03 10:49:49 2014 +0100
@@ -608,6 +608,7 @@
   HS_DTRACE_WORKAROUND_TAIL_CALL_BUG();
 #else /* USDT2 */
   HOTSPOT_VM_SHUTDOWN();
+  HS_DTRACE_WORKAROUND_TAIL_CALL_BUG();
 #endif /* USDT2 */
 }
 
--- a/src/share/vm/runtime/jniHandles.cpp	Thu Jan 16 13:25:25 2014 -0800
+++ b/src/share/vm/runtime/jniHandles.cpp	Mon Feb 03 10:49:49 2014 +0100
@@ -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
@@ -195,8 +195,10 @@
   int _count;
 public:
   CountHandleClosure(): _count(0) {}
-  virtual void do_oop(oop* unused) {
-    _count++;
+  virtual void do_oop(oop* ooph) {
+    if (*ooph != JNIHandles::deleted_handle()) {
+      _count++;
+    }
   }
   virtual void do_oop(narrowOop* unused) { ShouldNotReachHere(); }
   int count() { return _count; }
--- a/src/share/vm/runtime/os.cpp	Thu Jan 16 13:25:25 2014 -0800
+++ b/src/share/vm/runtime/os.cpp	Mon Feb 03 10:49:49 2014 +0100
@@ -1262,9 +1262,6 @@
         "%/lib/jce.jar:"
         "%/lib/charsets.jar:"
         "%/lib/jfr.jar:"
-#ifdef __APPLE__
-        "%/lib/JObjC.jar:"
-#endif
         "%/classes";
     char* sysclasspath = format_boot_path(classpath_format, home, home_len, fileSep, pathSep);
     if (sysclasspath == NULL) return false;
--- a/src/share/vm/runtime/os.hpp	Thu Jan 16 13:25:25 2014 -0800
+++ b/src/share/vm/runtime/os.hpp	Mon Feb 03 10:49:49 2014 +0100
@@ -430,7 +430,10 @@
   static intx current_thread_id();
   static int current_process_id();
   static int sleep(Thread* thread, jlong ms, bool interruptable);
-  static int naked_sleep();
+  // Short standalone OS sleep suitable for slow path spin loop.
+  // Ignores Thread.interrupt() (so keep it short).
+  // 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 {
--- a/src/share/vm/runtime/park.cpp	Thu Jan 16 13:25:25 2014 -0800
+++ b/src/share/vm/runtime/park.cpp	Mon Feb 03 10:49:49 2014 +0100
@@ -59,58 +59,22 @@
 
   // Start by trying to recycle an existing but unassociated
   // ParkEvent from the global free list.
-  for (;;) {
-    ev = FreeList ;
-    if (ev == NULL) break ;
-    // 1: Detach - sequester or privatize the list
-    // Tantamount to ev = Swap (&FreeList, NULL)
-    if (Atomic::cmpxchg_ptr (NULL, &FreeList, ev) != ev) {
-       continue ;
+  // Using a spin lock since we are part of the mutex impl.
+  // 8028280: using concurrent free list without memory management can leak
+  // pretty badly it turns out.
+  Thread::SpinAcquire(&ListLock, "ParkEventFreeListAllocate");
+  {
+    ev = FreeList;
+    if (ev != NULL) {
+      FreeList = ev->FreeNext;
     }
-
-    // We've detached the list.  The list in-hand is now
-    // local to this thread.   This thread can operate on the
-    // list without risk of interference from other threads.
-    // 2: Extract -- pop the 1st element from the list.
-    ParkEvent * List = ev->FreeNext ;
-    if (List == NULL) break ;
-    for (;;) {
-        // 3: Try to reattach the residual list
-        guarantee (List != NULL, "invariant") ;
-        ParkEvent * Arv =  (ParkEvent *) Atomic::cmpxchg_ptr (List, &FreeList, NULL) ;
-        if (Arv == NULL) break ;
-
-        // New nodes arrived.  Try to detach the recent arrivals.
-        if (Atomic::cmpxchg_ptr (NULL, &FreeList, Arv) != Arv) {
-            continue ;
-        }
-        guarantee (Arv != NULL, "invariant") ;
-        // 4: Merge Arv into List
-        ParkEvent * Tail = List ;
-        while (Tail->FreeNext != NULL) Tail = Tail->FreeNext ;
-        Tail->FreeNext = Arv ;
-    }
-    break ;
   }
+  Thread::SpinRelease(&ListLock);
 
   if (ev != NULL) {
     guarantee (ev->AssociatedWith == NULL, "invariant") ;
   } else {
     // Do this the hard way -- materialize a new ParkEvent.
-    // In rare cases an allocating thread might detach a long list --
-    // installing null into FreeList -- and then stall or be obstructed.
-    // A 2nd thread calling Allocate() would see FreeList == null.
-    // The list held privately by the 1st thread is unavailable to the 2nd thread.
-    // In that case the 2nd thread would have to materialize a new ParkEvent,
-    // even though free ParkEvents existed in the system.  In this case we end up
-    // with more ParkEvents in circulation than we need, but the race is
-    // rare and the outcome is benign.  Ideally, the # of extant ParkEvents
-    // is equal to the maximum # of threads that existed at any one time.
-    // Because of the race mentioned above, segments of the freelist
-    // can be transiently inaccessible.  At worst we may end up with the
-    // # of ParkEvents in circulation slightly above the ideal.
-    // Note that if we didn't have the TSM/immortal constraint, then
-    // when reattaching, above, we could trim the list.
     ev = new ParkEvent () ;
     guarantee ((intptr_t(ev) & 0xFF) == 0, "invariant") ;
   }
@@ -124,13 +88,14 @@
   if (ev == NULL) return ;
   guarantee (ev->FreeNext == NULL      , "invariant") ;
   ev->AssociatedWith = NULL ;
-  for (;;) {
-    // Push ev onto FreeList
-    // The mechanism is "half" lock-free.
-    ParkEvent * List = FreeList ;
-    ev->FreeNext = List ;
-    if (Atomic::cmpxchg_ptr (ev, &FreeList, List) == List) break ;
+  // Note that if we didn't have the TSM/immortal constraint, then
+  // when reattaching we could trim the list.
+  Thread::SpinAcquire(&ListLock, "ParkEventFreeListRelease");
+  {
+    ev->FreeNext = FreeList;
+    FreeList = ev;
   }
+  Thread::SpinRelease(&ListLock);
 }
 
 // Override operator new and delete so we can ensure that the
@@ -164,56 +129,21 @@
 
   // Start by trying to recycle an existing but unassociated
   // Parker from the global free list.
-  for (;;) {
-    p = FreeList ;
-    if (p  == NULL) break ;
-    // 1: Detach
-    // Tantamount to p = Swap (&FreeList, NULL)
-    if (Atomic::cmpxchg_ptr (NULL, &FreeList, p) != p) {
-       continue ;
+  // 8028280: using concurrent free list without memory management can leak
+  // pretty badly it turns out.
+  Thread::SpinAcquire(&ListLock, "ParkerFreeListAllocate");
+  {
+    p = FreeList;
+    if (p != NULL) {
+      FreeList = p->FreeNext;
     }
-
-    // We've detached the list.  The list in-hand is now
-    // local to this thread.   This thread can operate on the
-    // list without risk of interference from other threads.
-    // 2: Extract -- pop the 1st element from the list.
-    Parker * List = p->FreeNext ;
-    if (List == NULL) break ;
-    for (;;) {
-        // 3: Try to reattach the residual list
-        guarantee (List != NULL, "invariant") ;
-        Parker * Arv =  (Parker *) Atomic::cmpxchg_ptr (List, &FreeList, NULL) ;
-        if (Arv == NULL) break ;
-
-        // New nodes arrived.  Try to detach the recent arrivals.
-        if (Atomic::cmpxchg_ptr (NULL, &FreeList, Arv) != Arv) {
-            continue ;
-        }
-        guarantee (Arv != NULL, "invariant") ;
-        // 4: Merge Arv into List
-        Parker * Tail = List ;
-        while (Tail->FreeNext != NULL) Tail = Tail->FreeNext ;
-        Tail->FreeNext = Arv ;
-    }
-    break ;
   }
+  Thread::SpinRelease(&ListLock);
 
   if (p != NULL) {
     guarantee (p->AssociatedWith == NULL, "invariant") ;
   } else {
     // Do this the hard way -- materialize a new Parker..
-    // In rare cases an allocating thread might detach
-    // a long list -- installing null into FreeList --and
-    // then stall.  Another thread calling Allocate() would see
-    // FreeList == null and then invoke the ctor.  In this case we
-    // end up with more Parkers in circulation than we need, but
-    // the race is rare and the outcome is benign.
-    // Ideally, the # of extant Parkers is equal to the
-    // maximum # of threads that existed at any one time.
-    // Because of the race mentioned above, segments of the
-    // freelist can be transiently inaccessible.  At worst
-    // we may end up with the # of Parkers in circulation
-    // slightly above the ideal.
     p = new Parker() ;
   }
   p->AssociatedWith = t ;          // Associate p with t
@@ -227,11 +157,12 @@
   guarantee (p->AssociatedWith != NULL, "invariant") ;
   guarantee (p->FreeNext == NULL      , "invariant") ;
   p->AssociatedWith = NULL ;
-  for (;;) {
-    // Push p onto FreeList
-    Parker * List = FreeList ;
-    p->FreeNext = List ;
-    if (Atomic::cmpxchg_ptr (p, &FreeList, List) == List) break ;
+
+  Thread::SpinAcquire(&ListLock, "ParkerFreeListRelease");
+  {
+    p->FreeNext = FreeList;
+    FreeList = p;
   }
+  Thread::SpinRelease(&ListLock);
 }
 
--- a/src/share/vm/runtime/thread.cpp	Thu Jan 16 13:25:25 2014 -0800
+++ b/src/share/vm/runtime/thread.cpp	Mon Feb 03 10:49:49 2014 +0100
@@ -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
@@ -3301,6 +3301,58 @@
   // If CompilerThreads ever become non-JavaThreads, add them here
 }
 
+
+void Threads::initialize_java_lang_classes(JavaThread* main_thread, TRAPS) {
+  TraceTime timer("Initialize java.lang classes", TraceStartupTime);
+
+  if (EagerXrunInit && Arguments::init_libraries_at_startup()) {
+    create_vm_init_libraries();
+  }
+
+  initialize_class(vmSymbols::java_lang_String(), CHECK);
+
+  // Initialize java_lang.System (needed before creating the thread)
+  initialize_class(vmSymbols::java_lang_System(), CHECK);
+  initialize_class(vmSymbols::java_lang_ThreadGroup(), CHECK);
+  Handle thread_group = create_initial_thread_group(CHECK);
+  Universe::set_main_thread_group(thread_group());
+  initialize_class(vmSymbols::java_lang_Thread(), CHECK);
+  oop thread_object = create_initial_thread(thread_group, main_thread, CHECK);
+  main_thread->set_threadObj(thread_object);
+  // Set thread status to running since main thread has
+  // been started and running.
+  java_lang_Thread::set_thread_status(thread_object,
+                                      java_lang_Thread::RUNNABLE);
+
+  // The VM creates & returns objects of this class. Make sure it's initialized.
+  initialize_class(vmSymbols::java_lang_Class(), CHECK);
+
+  // The VM preresolves methods to these classes. Make sure that they get initialized
+  initialize_class(vmSymbols::java_lang_reflect_Method(), CHECK);
+  initialize_class(vmSymbols::java_lang_ref_Finalizer(),  CHECK);
+  call_initializeSystemClass(CHECK);
+
+  // get the Java runtime name after java.lang.System is initialized
+  JDK_Version::set_runtime_name(get_java_runtime_name(THREAD));
+  JDK_Version::set_runtime_version(get_java_runtime_version(THREAD));
+
+  // an instance of OutOfMemory exception has been allocated earlier
+  initialize_class(vmSymbols::java_lang_OutOfMemoryError(), CHECK);
+  initialize_class(vmSymbols::java_lang_NullPointerException(), CHECK);
+  initialize_class(vmSymbols::java_lang_ClassCastException(), CHECK);
+  initialize_class(vmSymbols::java_lang_ArrayStoreException(), CHECK);
+  initialize_class(vmSymbols::java_lang_ArithmeticException(), CHECK);
+  initialize_class(vmSymbols::java_lang_StackOverflowError(), CHECK);
+  initialize_class(vmSymbols::java_lang_IllegalMonitorStateException(), CHECK);
+  initialize_class(vmSymbols::java_lang_IllegalArgumentException(), CHECK);
+}
+
+void Threads::initialize_jsr292_core_classes(TRAPS) {
+  initialize_class(vmSymbols::java_lang_invoke_MethodHandle(), CHECK);
+  initialize_class(vmSymbols::java_lang_invoke_MemberName(), CHECK);
+  initialize_class(vmSymbols::java_lang_invoke_MethodHandleNatives(), CHECK);
+}
+
 jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) {
 
   extern void JDK_Version_init();
@@ -3470,13 +3522,13 @@
     VMThread::execute(&verify_op);
   }
 
-  EXCEPTION_MARK;
+  Thread* THREAD = Thread::current();
 
   // At this point, the Universe is initialized, but we have not executed
   // any byte code.  Now is a good time (the only time) to dump out the
   // internal state of the JVM for sharing.
   if (DumpSharedSpaces) {
-    MetaspaceShared::preload_and_dump(CHECK_0);
+    MetaspaceShared::preload_and_dump(CHECK_JNI_ERR);
     ShouldNotReachHere();
   }
 
@@ -3487,74 +3539,12 @@
   // Notify JVMTI agents that VM has started (JNI is up) - nop if no agents.
   JvmtiExport::post_vm_start();
 
-  {
-    TraceTime timer("Initialize java.lang classes", TraceStartupTime);
-
-    if (EagerXrunInit && Arguments::init_libraries_at_startup()) {
-      create_vm_init_libraries();
-    }
-
-    initialize_class(vmSymbols::java_lang_String(), CHECK_0);
-
-    // Initialize java_lang.System (needed before creating the thread)
-    initialize_class(vmSymbols::java_lang_System(), CHECK_0);
-    initialize_class(vmSymbols::java_lang_ThreadGroup(), CHECK_0);
-    Handle thread_group = create_initial_thread_group(CHECK_0);
-    Universe::set_main_thread_group(thread_group());
-    initialize_class(vmSymbols::java_lang_Thread(), CHECK_0);
-    oop thread_object = create_initial_thread(thread_group, main_thread, CHECK_0);
-    main_thread->set_threadObj(thread_object);
-    // Set thread status to running since main thread has
-    // been started and running.
-    java_lang_Thread::set_thread_status(thread_object,
-                                        java_lang_Thread::RUNNABLE);
-
-    // The VM creates & returns objects of this class. Make sure it's initialized.
-    initialize_class(vmSymbols::java_lang_Class(), CHECK_0);
-
-    // The VM preresolves methods to these classes. Make sure that they get initialized
-    initialize_class(vmSymbols::java_lang_reflect_Method(), CHECK_0);
-    initialize_class(vmSymbols::java_lang_ref_Finalizer(),  CHECK_0);
-    call_initializeSystemClass(CHECK_0);
-
-    // get the Java runtime name after java.lang.System is initialized
-    JDK_Version::set_runtime_name(get_java_runtime_name(THREAD));
-    JDK_Version::set_runtime_version(get_java_runtime_version(THREAD));
-
-    // an instance of OutOfMemory exception has been allocated earlier
-    initialize_class(vmSymbols::java_lang_OutOfMemoryError(), CHECK_0);
-    initialize_class(vmSymbols::java_lang_NullPointerException(), CHECK_0);
-    initialize_class(vmSymbols::java_lang_ClassCastException(), CHECK_0);
-    initialize_class(vmSymbols::java_lang_ArrayStoreException(), CHECK_0);
-    initialize_class(vmSymbols::java_lang_ArithmeticException(), CHECK_0);
-    initialize_class(vmSymbols::java_lang_StackOverflowError(), CHECK_0);
-    initialize_class(vmSymbols::java_lang_IllegalMonitorStateException(), CHECK_0);
-    initialize_class(vmSymbols::java_lang_IllegalArgumentException(), CHECK_0);
-  }
-
-  // See        : bugid 4211085.
-  // Background : the static initializer of java.lang.Compiler tries to read
-  //              property"java.compiler" and read & write property "java.vm.info".
-  //              When a security manager is installed through the command line
-  //              option "-Djava.security.manager", the above properties are not
-  //              readable and the static initializer for java.lang.Compiler fails
-  //              resulting in a NoClassDefFoundError.  This can happen in any
-  //              user code which calls methods in java.lang.Compiler.
-  // Hack :       the hack is to pre-load and initialize this class, so that only
-  //              system domains are on the stack when the properties are read.
-  //              Currently even the AWT code has calls to methods in java.lang.Compiler.
-  //              On the classic VM, java.lang.Compiler is loaded very early to load the JIT.
-  // Future Fix : the best fix is to grant everyone permissions to read "java.compiler" and
-  //              read and write"java.vm.info" in the default policy file. See bugid 4211383
-  //              Once that is done, we should remove this hack.
-  initialize_class(vmSymbols::java_lang_Compiler(), CHECK_0);
-
-  // More hackery - the static initializer of java.lang.Compiler adds the string "nojit" to
-  // the java.vm.info property if no jit gets loaded through java.lang.Compiler (the hotspot
-  // compiler does not get loaded through java.lang.Compiler).  "java -version" with the
-  // hotspot vm says "nojit" all the time which is confusing.  So, we reset it here.
-  // This should also be taken out as soon as 4211383 gets fixed.
-  reset_vm_info_property(CHECK_0);
+  initialize_java_lang_classes(main_thread, CHECK_JNI_ERR);
+
+  // We need this for ClassDataSharing - the initial vm.info property is set
+  // with the default value of CDS "sharing" which may be reset through
+  // command line options.
+  reset_vm_info_property(CHECK_JNI_ERR);
 
   quicken_jni_functions();
 
@@ -3583,10 +3573,7 @@
   // Note that we do not use CHECK_0 here since we are inside an EXCEPTION_MARK and
   // set_init_completed has just been called, causing exceptions not to be shortcut
   // anymore. We call vm_exit_during_initialization directly instead.
-  SystemDictionary::compute_java_system_loader(THREAD);
-  if (HAS_PENDING_EXCEPTION) {
-    vm_exit_during_initialization(Handle(THREAD, PENDING_EXCEPTION));
-  }
+  SystemDictionary::compute_java_system_loader(CHECK_JNI_ERR);
 
 #if INCLUDE_ALL_GCS
   // Support for ConcurrentMarkSweep. This should be cleaned up
@@ -3594,12 +3581,9 @@
   // once things are properly refactored. XXX YSR
   if (UseConcMarkSweepGC || UseG1GC) {
     if (UseConcMarkSweepGC) {
-      ConcurrentMarkSweepThread::makeSurrogateLockerThread(THREAD);
+      ConcurrentMarkSweepThread::makeSurrogateLockerThread(CHECK_JNI_ERR);
     } else {
-      ConcurrentMarkThread::makeSurrogateLockerThread(THREAD);
-    }
-    if (HAS_PENDING_EXCEPTION) {
-      vm_exit_during_initialization(Handle(THREAD, PENDING_EXCEPTION));
+      ConcurrentMarkThread::makeSurrogateLockerThread(CHECK_JNI_ERR);
     }
   }
 #endif // INCLUDE_ALL_GCS
@@ -3642,19 +3626,16 @@
   CompileBroker::compilation_init();
 #endif
 
+  // Pre-initialize some JSR292 core classes to avoid deadlock during class loading.
+  // It is done after compilers are initialized, because otherwise compilations of
+  // signature polymorphic MH intrinsics can be missed
+  // (see SystemDictionary::find_method_handle_intrinsic).
   if (EnableInvokeDynamic) {
-    // Pre-initialize some JSR292 core classes to avoid deadlock during class loading.
-    // It is done after compilers are initialized, because otherwise compilations of
-    // signature polymorphic MH intrinsics can be missed
-    // (see SystemDictionary::find_method_handle_intrinsic).
-    initialize_class(vmSymbols::java_lang_invoke_MethodHandle(), CHECK_0);
-    initialize_class(vmSymbols::java_lang_invoke_MemberName(), CHECK_0);
-    initialize_class(vmSymbols::java_lang_invoke_MethodHandleNatives(), CHECK_0);
+    initialize_jsr292_core_classes(CHECK_JNI_ERR);
   }
 
 #if INCLUDE_MANAGEMENT
   Management::initialize(THREAD);
-#endif // INCLUDE_MANAGEMENT
 
   if (HAS_PENDING_EXCEPTION) {
     // management agent fails to start possibly due to
@@ -3662,6 +3643,7 @@
     // stack trace if appropriate. Simply exit VM.
     vm_exit(1);
   }
+#endif // INCLUDE_MANAGEMENT
 
   if (Arguments::has_profile())       FlatProfiler::engage(main_thread, true);
   if (MemProfiling)                   MemProfiler::engage();
@@ -4446,9 +4428,7 @@
         ++ctr ;
         if ((ctr & 0xFFF) == 0 || !os::is_MP()) {
            if (Yields > 5) {
-             // Consider using a simple NakedSleep() instead.
-             // Then SpinAcquire could be called by non-JVM threads
-             Thread::current()->_ParkEvent->park(1) ;
+             os::naked_short_sleep(1);
            } else {
              os::NakedYield() ;
              ++Yields ;
--- a/src/share/vm/runtime/thread.hpp	Thu Jan 16 13:25:25 2014 -0800
+++ b/src/share/vm/runtime/thread.hpp	Mon Feb 03 10:49:49 2014 +0100
@@ -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
@@ -1891,6 +1891,8 @@
   static bool        _vm_complete;
 #endif
 
+  static void initialize_java_lang_classes(JavaThread* main_thread, TRAPS);
+  static void initialize_jsr292_core_classes(TRAPS);
  public:
   // Thread management
   // force_daemon is a concession to JNI, where we may need to add a
--- a/src/share/vm/trace/trace.xml	Thu Jan 16 13:25:25 2014 -0800
+++ b/src/share/vm/trace/trace.xml	Mon Feb 03 10:49:49 2014 +0100
@@ -122,6 +122,46 @@
       <value type="CLASS" field="definingClassLoader" label="Defining Class Loader"/>
     </event>
 
+    <event id="LongFlagChanged" path="vm/flag/long_changed" label="Long Flag Changed"
+          is_instant="true">
+      <value type="UTF8" field="name" label="Name" />
+      <value type="LONG" field="old_value" label="Old Value" />
+      <value type="LONG" field="new_value" label="New Value" />
+      <value type="FLAGVALUEORIGIN" field="origin" label="Origin" />
+    </event>
+
+    <event id="UnsignedLongFlagChanged" path="vm/flag/ulong_changed" label="Unsigned Long Flag Changed"
+          is_instant="true">
+      <value type="UTF8" field="name" label="Name" />
+      <value type="ULONG" field="old_value" label="Old Value" />
+      <value type="ULONG" field="new_value" label="New Value" />
+      <value type="FLAGVALUEORIGIN" field="origin" label="Origin" />
+    </event>
+
+    <event id="DoubleFlagChanged" path="vm/flag/double_changed" label="Double Flag Changed"
+         is_instant="true">
+      <value type="UTF8" field="name" label="Name" />
+      <value type="DOUBLE" field="old_value" label="Old Value" />
+      <value type="DOUBLE" field="new_value" label="New Value" />
+      <value type="FLAGVALUEORIGIN" field="origin" label="Origin" />
+    </event>
+
+    <event id="BooleanFlagChanged" path="vm/flag/boolean_changed" label="Boolean Flag Changed"
+         is_instant="true">
+      <value type="UTF8" field="name" label="Name" />
+      <value type="BOOLEAN" field="old_value" label="Old Value" />
+      <value type="BOOLEAN" field="new_value" label="New Value" />
+      <value type="FLAGVALUEORIGIN" field="origin" label="Origin" />
+    </event>
+
+    <event id="StringFlagChanged" path="vm/flag/string_changed" label="String Flag Changed"
+         is_instant="true">
+      <value type="UTF8" field="name" label="Name" />
+      <value type="UTF8" field="old_value" label="Old Value" />
+      <value type="UTF8" field="new_value" label="New Value" />
+      <value type="FLAGVALUEORIGIN" field="origin" label="Origin" />
+    </event>
+
     <struct id="VirtualSpace">
       <value type="ADDRESS" field="start" label="Start Address" description="Start address of the virtual space" />
       <value type="ADDRESS" field="committedEnd" label="Committed End Address" description="End address of the committed memory for the virtual space" />
--- a/src/share/vm/trace/tracetypes.xml	Thu Jan 16 13:25:25 2014 -0800
+++ b/src/share/vm/trace/tracetypes.xml	Mon Feb 03 10:49:49 2014 +0100
@@ -150,6 +150,11 @@
       <value type="UTF8" field="phase" label="phase" />
     </content_type>
 
+    <content_type id="FlagValueOrigin" hr_name="Flag Value Origin"
+                  type="U1" jvm_type="FLAGVALUEORIGIN">
+      <value type="UTF8" field="origin" label="origin" />
+    </content_type>
+
   </content_types>
 
 
@@ -334,6 +339,10 @@
     <!-- VMOPERATIONTYPE -->
     <primary_type symbol="VMOPERATIONTYPE" datatype="U2" contenttype="VMOPERATIONTYPE"
                   type="u2" sizeop="sizeof(u2)" />
+                  
+    <!-- FLAGVALUEORIGIN -->
+    <primary_type symbol="FLAGVALUEORIGIN" datatype="U1"
+                  contenttype="FLAGVALUEORIGIN" type="u1" sizeop="sizeof(u1)" />
 
   </primary_types>
 </types>
--- a/src/share/vm/utilities/dtrace.hpp	Thu Jan 16 13:25:25 2014 -0800
+++ b/src/share/vm/utilities/dtrace.hpp	Mon Feb 03 10:49:49 2014 +0100
@@ -38,7 +38,10 @@
 #define HS_DTRACE_WORKAROUND_TAIL_CALL_BUG() \
   do { volatile size_t dtrace_workaround_tail_call_bug = 1; } while (0)
 
-#define USDT1 1
+#define USDT2 1
+#include "dtracefiles/hotspot.h"
+#include "dtracefiles/hotspot_jni.h"
+#include "dtracefiles/hs_private.h"
 #elif defined(LINUX)
 #define HS_DTRACE_WORKAROUND_TAIL_CALL_BUG()
 #define USDT1 1
--- a/src/share/vm/utilities/exceptions.hpp	Thu Jan 16 13:25:25 2014 -0800
+++ b/src/share/vm/utilities/exceptions.hpp	Mon Feb 03 10:49:49 2014 +0100
@@ -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
@@ -200,6 +200,7 @@
 #define CHECK_NH                                 CHECK_(Handle())
 #define CHECK_NULL                               CHECK_(NULL)
 #define CHECK_false                              CHECK_(false)
+#define CHECK_JNI_ERR                            CHECK_(JNI_ERR)
 
 #define CHECK_AND_CLEAR                         THREAD); if (HAS_PENDING_EXCEPTION) { CLEAR_PENDING_EXCEPTION; return;        } (void)(0
 #define CHECK_AND_CLEAR_(result)                THREAD); if (HAS_PENDING_EXCEPTION) { CLEAR_PENDING_EXCEPTION; return result; } (void)(0
--- a/test/compiler/ciReplay/common.sh	Thu Jan 16 13:25:25 2014 -0800
+++ b/test/compiler/ciReplay/common.sh	Mon Feb 03 10:49:49 2014 +0100
@@ -196,6 +196,11 @@
     then
         # enable core dump
         ulimit -c unlimited
+        new_ulimit=`ulimit -c`
+        if [ $new_ulimit != "unlimited" -a $new_ulimit != "-1" ]
+        then
+            test_fail 2 "CHECK :: ULIMIT" "Could not set 'ulimit -c unlimited'. 'ulimit -c' returns : $new_ulimit"
+        fi
 
         if [ $VM_OS = "solaris" ]
         then
@@ -228,7 +233,10 @@
     
     core_locations=`grep -i core crash.out | grep "location:" | \
             sed -e 's/.*location: //'`
+    echo CRASH OUTPUT:
+    cat crash.out    
     rm crash.out 
+    
     # processing core locations for *nix
     if [ $VM_OS != "windows" ]
     then
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/compiler/codegen/LoadWithMask.java	Mon Feb 03 10:49:49 2014 +0100
@@ -0,0 +1,44 @@
+/*
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 8032207
+ * @summary Invalid node sizing for loadUS2L_immI16 and loadI2L_immI
+ * @run main/othervm -server -Xbatch -XX:-TieredCompilation -XX:CompileCommand=compileonly,LoadWithMask.foo LoadWithMask
+ *
+ */
+public class LoadWithMask {
+  static int x[] = new int[1];
+  static long foo() {
+    return x[0] & 0xfff0ffff;
+  }
+
+  public static void main(String[] args) {
+    x[0] = -1;
+    long l = 0;
+    for (int i = 0; i < 100000; ++i) {
+      l = foo();
+    }
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/compiler/codegen/LoadWithMask2.java	Mon Feb 03 10:49:49 2014 +0100
@@ -0,0 +1,55 @@
+/*
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 8031743
+ * @summary loadI2L_immI broken for negative memory values
+ * @run main/othervm -server -Xbatch -XX:-TieredCompilation -XX:CompileCommand=compileonly,*.foo* LoadWithMask2
+ *
+ */
+public class LoadWithMask2 {
+  static int x;
+  static long foo1() {
+    return x & 0xfffffffe;
+  }
+  static long foo2() {
+    return x & 0xff000000;
+  }
+  static long foo3() {
+    return x & 0x8abcdef1;
+  }
+
+  public static void main(String[] args) {
+    x = -1;
+    long l = 0;
+    for (int i = 0; i < 100000; ++i) {
+      l = foo1() & foo2() & foo3();
+    }
+    if (l > 0) {
+      System.out.println("FAILED");
+      System.exit(97);
+    }
+    System.out.println("PASSED");
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/compiler/inlining/DefaultAndConcreteMethodsCHA.java	Mon Feb 03 10:49:49 2014 +0100
@@ -0,0 +1,58 @@
+/*
+ * 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.
+ */
+
+/**
+ * @test
+ * @bug 8031695
+ * @summary CHA ignores default methods during analysis leading to incorrect code generation
+ *
+ * @run main/othervm -Xbatch DefaultAndConcreteMethodsCHA
+ */
+interface I {
+    default int m() { return 0; }
+}
+
+class A implements I {}
+
+class C extends A { }
+class D extends A { public int m() { return 1; } }
+
+public class DefaultAndConcreteMethodsCHA {
+    public static int test(A obj) {
+        return obj.m();
+    }
+    public static void main(String[] args) {
+        for (int i = 0; i < 10000; i++) {
+            int idC = test(new C());
+            if (idC != 0) {
+                throw new Error("C.m didn't invoke I.m: id "+idC);
+            }
+
+            int idD = test(new D());
+            if (idD != 1) {
+                throw new Error("D.m didn't invoke D.m: id "+idD);
+            }
+        }
+
+    }
+}
--- a/test/runtime/6626217/Test6626217.sh	Thu Jan 16 13:25:25 2014 -0800
+++ b/test/runtime/6626217/Test6626217.sh	Mon Feb 03 10:49:49 2014 +0100
@@ -48,6 +48,11 @@
 # A Clean Compile: this line will probably fail within jtreg as have a clean dir:
 ${RM} -f *.class *.impl many_loader.java
 
+# Make sure that the compilation steps occurs in the future as not to allow fast systems
+# to copy and compile bug_21227.java so fast as to make the class and java have the same
+# time stamp, which later on would make the compilation step of many_loader.java fail
+sleep 2
+
 # 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
--- a/test/runtime/6929067/Test6929067.sh	Thu Jan 16 13:25:25 2014 -0800
+++ b/test/runtime/6929067/Test6929067.sh	Mon Feb 03 10:49:49 2014 +0100
@@ -1,15 +1,13 @@
 #!/bin/sh
 
 ##
-## @ignore 8028740
 ## @test Test6929067.sh
 ## @bug 6929067
 ## @bug 8021296
 ## @summary Stack guard pages should be removed when thread is detached
-## @compile T.java
 ## @run shell Test6929067.sh
 ##
-set -x
+
 if [ "${TESTSRC}" = "" ]
 then
   TESTSRC=${PWD}
@@ -114,10 +112,8 @@
 LD_LIBRARY_PATH=.:${COMPILEJAVA}/jre/lib/${ARCH}/${VMTYPE}:/usr/lib:$LD_LIBRARY_PATH
 export LD_LIBRARY_PATH
 
-cp ${TESTSRC}${FS}invoke.c .
-
-# Copy the result of our @compile action:
-cp ${TESTCLASSES}${FS}T.class .
+cp ${TESTSRC}${FS}*.java ${THIS_DIR}
+${TESTJAVA}${FS}bin${FS}javac *.java
 
 echo "Architecture: ${ARCH}"
 echo "Compilation flag: ${COMP_FLAG}"
@@ -127,9 +123,9 @@
 # for /usr/lib/`uname -m`-linux-gnu version ensure to add that path to below compilation.
 
 $gcc_cmd -DLINUX ${COMP_FLAG} -o invoke \
-    -I${COMPILEJAVA}/include -I${COMPILEJAVA}/include/linux \
-    -L${COMPILEJAVA}/jre/lib/${ARCH}/${VMTYPE} \
-    -ljvm -lpthread invoke.c
+    -I${TESTJAVA}/include -I${TESTJAVA}/include/linux \
+    -L${TESTJAVA}/jre/lib/${ARCH}/${VMTYPE} \
+     ${TESTSRC}${FS}invoke.c -ljvm -lpthread
 
 ./invoke
 exit $?
--- a/test/runtime/CommandLine/CompilerConfigFileWarning.java	Thu Jan 16 13:25:25 2014 -0800
+++ b/test/runtime/CommandLine/CompilerConfigFileWarning.java	Mon Feb 03 10:49:49 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,8 +33,7 @@
 
 public class CompilerConfigFileWarning {
     public static void main(String[] args) throws Exception {
-        String vmVersion = System.getProperty("java.vm.version");
-        if (vmVersion.toLowerCase().contains("debug") || vmVersion.toLowerCase().contains("jvmg")) {
+        if (Platform.isDebugBuild()) {
             System.out.println("Skip on debug builds since we'll always read the file there");
             return;
         }
--- a/test/runtime/CommandLine/ConfigFileWarning.java	Thu Jan 16 13:25:25 2014 -0800
+++ b/test/runtime/CommandLine/ConfigFileWarning.java	Mon Feb 03 10:49:49 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,8 +33,7 @@
 
 public class ConfigFileWarning {
     public static void main(String[] args) throws Exception {
-        String vmVersion = System.getProperty("java.vm.version");
-        if (vmVersion.toLowerCase().contains("debug") || vmVersion.toLowerCase().contains("jvmg")) {
+        if (Platform.isDebugBuild()) {
             System.out.println("Skip on debug builds since we'll always read the file there");
             return;
         }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/runtime/CommandLine/VMOptionWarning.java	Mon Feb 03 10:49:49 2014 +0100
@@ -0,0 +1,56 @@
+/*
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 8027314
+ * @summary Warn if diagnostic or experimental vm option is used and -XX:+UnlockDiagnosticVMOptions or -XX:+UnlockExperimentalVMOptions, respectively, isn't specified. Warn if develop or notproduct vm option is used with product version of VM.
+ * @library /testlibrary
+ */
+
+import com.oracle.java.testlibrary.*;
+
+public class VMOptionWarning {
+    public static void main(String[] args) throws Exception {
+        ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+PredictedLoadedClassCount", "-version");
+        OutputAnalyzer output = new OutputAnalyzer(pb.start());
+        output.shouldContain("Error: VM option 'PredictedLoadedClassCount' is experimental and must be enabled via -XX:+UnlockExperimentalVMOptions.");
+
+        if (Platform.isDebugBuild()) {
+            System.out.println("Skip the rest of the tests on debug builds since diagnostic, develop, and notproduct options are available on debug builds.");
+            return;
+        }
+
+        pb = ProcessTools.createJavaProcessBuilder("-XX:+PrintInlining", "-version");
+        output = new OutputAnalyzer(pb.start());
+        output.shouldContain("Error: VM option 'PrintInlining' is diagnostic and must be enabled via -XX:+UnlockDiagnosticVMOptions.");
+
+        pb = ProcessTools.createJavaProcessBuilder("-XX:+TraceJNICalls", "-version");
+        output = new OutputAnalyzer(pb.start());
+        output.shouldContain("Error: VM option 'TraceJNICalls' is develop and is available only in debug version of VM.");
+
+        pb = ProcessTools.createJavaProcessBuilder("-XX:+TraceJVMCalls", "-version");
+        output = new OutputAnalyzer(pb.start());
+        output.shouldContain("Error: VM option 'TraceJVMCalls' is notproduct and is available only in debug version of VM.");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/runtime/SharedArchiveFile/ArchiveDoesNotExist.java	Mon Feb 03 10:49:49 2014 +0100
@@ -0,0 +1,68 @@
+/*
+ * 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.
+ */
+
+/*
+ * @test ArchiveDoesNotExist
+ * @summary Test how VM handles "file does not exist" situation while
+ *          attempting to use CDS archive. JVM should exit gracefully
+ *          when sharing mode is ON, and continue w/o sharing if sharing
+ *          mode is AUTO.
+ * @library /testlibrary
+ * @run main ArchiveDoesNotExist
+ */
+
+import com.oracle.java.testlibrary.*;
+import java.io.File;
+
+public class ArchiveDoesNotExist {
+    public static void main(String[] args) throws Exception {
+        String fileName = "test.jsa";
+
+        File cdsFile = new File(fileName);
+        if (cdsFile.exists())
+            throw new RuntimeException("Test error: cds file already exists");
+
+        // Sharing: on
+        ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
+           "-XX:+UnlockDiagnosticVMOptions",
+           "-XX:SharedArchiveFile=./" + fileName,
+           "-Xshare:on",
+           "-version");
+
+        OutputAnalyzer output = new OutputAnalyzer(pb.start());
+        output.shouldContain("Specified shared archive not found");
+        output.shouldHaveExitValue(1);
+
+        // Sharing: auto
+        pb = ProcessTools.createJavaProcessBuilder(
+           "-XX:+UnlockDiagnosticVMOptions",
+           "-XX:SharedArchiveFile=./" + fileName,
+           "-Xshare:auto",
+           "-version");
+
+        output = new OutputAnalyzer(pb.start());
+        output.shouldContain("java version");
+        output.shouldNotContain("sharing");
+        output.shouldHaveExitValue(0);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/runtime/SharedArchiveFile/CdsWriteError.java	Mon Feb 03 10:49:49 2014 +0100
@@ -0,0 +1,78 @@
+/*
+ * 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.
+ */
+
+/*
+ * @test CdsWriteError
+ * @summary Test how VM handles situation when it is impossible to write the
+ *          CDS archive. VM is expected to exit gracefully and display the
+ *          correct reason for the error.
+ * @library /testlibrary
+ * @run main CdsWriteError
+ */
+
+import com.oracle.java.testlibrary.*;
+import java.io.File;
+
+public class CdsWriteError {
+    public static void main(String[] args) throws Exception {
+
+        if (Platform.isWindows()) {
+            System.out.println("This test is ignored on Windows. This test " +
+                "manipulates folder writable attribute, which is known to be " +
+                "often ignored by Windows");
+
+            return;
+        }
+
+        String folderName = "tmp";
+        String fileName = folderName + File.separator + "empty.jsa";
+
+        // create an empty archive file and make it read only
+        File folder = new File(folderName);
+        if (!folder.mkdir())
+            throw new RuntimeException("Error when creating a tmp folder");
+
+        File cdsFile = new File(fileName);
+        if (!cdsFile.createNewFile())
+            throw new RuntimeException("Error when creating an empty CDS file");
+        if (!cdsFile.setWritable(false))
+            throw new RuntimeException("Error: could not set writable attribute on cds file");
+        if (!folder.setWritable(false))
+            throw new RuntimeException("Error: could not set writable attribute on the cds folder");
+
+        try {
+           ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
+             "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./" + fileName, "-Xshare:dump");
+
+            OutputAnalyzer output = new OutputAnalyzer(pb.start());
+            output.shouldContain("Unable to create shared archive file");
+            output.shouldHaveExitValue(1);
+        } finally {
+            // doing this, just in case, to make sure that files can be deleted by the harness
+            // on any subsequent run
+            folder.setWritable(true);
+            cdsFile.setWritable(true);
+        }
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/runtime/SharedArchiveFile/DefaultUseWithClient.java	Mon Feb 03 10:49:49 2014 +0100
@@ -0,0 +1,64 @@
+/*
+ * 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.
+ */
+
+/*
+ * @test DefaultUseWithClient
+ * @summary Test default behavior of sharing with -client
+ * @library /testlibrary
+ * @run main DefaultUseWithClient
+ */
+
+import com.oracle.java.testlibrary.*;
+import java.io.File;
+
+public class DefaultUseWithClient {
+    public static void main(String[] args) throws Exception {
+        String fileName = "test.jsa";
+
+        // On 32-bit windows CDS should be on by default in "-client" config
+        // Skip this test on any other platform
+        boolean is32BitWindows = (Platform.isWindows() && Platform.is32bit());
+        if (!is32BitWindows) {
+            System.out.println("Test only applicable on 32-bit Windows. Skipping");
+            return;
+        }
+
+        // create the archive
+        ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
+           "-XX:+UnlockDiagnosticVMOptions",
+           "-XX:SharedArchiveFile=./" + fileName,
+           "-Xshare:dump");
+        OutputAnalyzer output = new OutputAnalyzer(pb.start());
+        output.shouldHaveExitValue(0);
+
+        pb = ProcessTools.createJavaProcessBuilder(
+           "-XX:+UnlockDiagnosticVMOptions",
+           "-XX:SharedArchiveFile=./" + fileName,
+           "-client",
+           "-version");
+
+        output = new OutputAnalyzer(pb.start());
+        output.shouldContain("sharing");
+        output.shouldHaveExitValue(0);
+   }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/runtime/finalStatic/FinalStatic.java	Mon Feb 03 10:49:49 2014 +0100
@@ -0,0 +1,142 @@
+/*
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 8028553
+ * @summary Test that VerifyError is not thrown when 'overriding' a static method.
+ * @run main FinalStatic
+ */
+
+import java.lang.reflect.*;
+import jdk.internal.org.objectweb.asm.ClassWriter;
+import jdk.internal.org.objectweb.asm.MethodVisitor;
+import jdk.internal.org.objectweb.asm.Opcodes;
+
+/*
+ *  class A { static final int m() {return FAIL; } }
+ *  class B extends A { int m() { return PASS; } }
+ *  class FinalStatic {
+ *      public static void main () {
+ *          Object b = new B();
+ *          b.m();
+ *      }
+ *  }
+ */
+public class FinalStatic {
+
+    static final String CLASS_NAME_A = "A";
+    static final String CLASS_NAME_B = "B";
+    static final int FAILED = 0;
+    static final int EXPECTED = 1234;
+
+    static class TestClassLoader extends ClassLoader implements Opcodes {
+
+        @Override
+        public Class findClass(String name) throws ClassNotFoundException {
+            byte[] b;
+            try {
+                b = loadClassData(name);
+            } catch (Throwable th) {
+                // th.printStackTrace();
+                throw new ClassNotFoundException("Loading error", th);
+            }
+            return defineClass(name, b, 0, b.length);
+        }
+
+        private byte[] loadClassData(String name) throws Exception {
+            ClassWriter cw = new ClassWriter(0);
+            MethodVisitor mv;
+            switch (name) {
+               case CLASS_NAME_A:
+                    cw.visit(52, ACC_SUPER | ACC_PUBLIC, CLASS_NAME_A, 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_FINAL | ACC_STATIC, "m", "()I", null, null);
+                        mv.visitCode();
+                        mv.visitLdcInsn(FAILED);
+                        mv.visitInsn(IRETURN);
+                        mv.visitMaxs(1, 1);
+                        mv.visitEnd();
+                    }
+                    break;
+                case CLASS_NAME_B:
+                    cw.visit(52, ACC_SUPER | ACC_PUBLIC, CLASS_NAME_B, null, CLASS_NAME_A, null);
+                    {
+                        mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
+                        mv.visitCode();
+                        mv.visitVarInsn(ALOAD, 0);
+                        mv.visitMethodInsn(INVOKESPECIAL, CLASS_NAME_A, "<init>", "()V");
+                        mv.visitInsn(RETURN);
+                        mv.visitMaxs(1, 1);
+                        mv.visitEnd();
+
+                        mv = cw.visitMethod(ACC_PUBLIC, "m", "()I", null, null);
+                        mv.visitCode();
+                        mv.visitLdcInsn(EXPECTED);
+                        mv.visitInsn(IRETURN);
+                        mv.visitMaxs(1, 1);
+                        mv.visitEnd();
+
+                    }
+                    break;
+                default:
+                    break;
+            }
+            cw.visitEnd();
+
+            return cw.toByteArray();
+        }
+    }
+
+    public static void main(String[] args) throws Exception {
+        TestClassLoader tcl = new TestClassLoader();
+        Class<?> a = tcl.loadClass(CLASS_NAME_A);
+        Class<?> b = tcl.loadClass(CLASS_NAME_B);
+        Object inst = b.newInstance();
+        Method[] meths = b.getDeclaredMethods();
+
+        Method m = meths[0];
+        int mod = m.getModifiers();
+        if ((mod & Modifier.FINAL) != 0) {
+            throw new Exception("FAILED: " + m + " is FINAL");
+        }
+        if ((mod & Modifier.STATIC) != 0) {
+            throw new Exception("FAILED: " + m + " is STATIC");
+        }
+
+        m.setAccessible(true);
+        if (!m.invoke(inst).equals(EXPECTED)) {
+              throw new Exception("FAILED: " + EXPECTED + " from " + m);
+        }
+
+        System.out.println("Passed.");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/runtime/lambda-features/InvokespecialInterface.java	Mon Feb 03 10:49:49 2014 +0100
@@ -0,0 +1,60 @@
+/*
+ * 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.
+ *
+ */
+
+/*
+ * @test
+ * @bug 8032024
+ * @bug 8025937
+ * @summary [JDK 8] Test invokespecial and invokeinterface with the same JVM_CONSTANT_InterfaceMethodref
+ * @run main InvokespecialInterface
+ */
+import java.util.function.*;
+import java.util.*;
+
+interface I {
+  default void imethod() { System.out.println("I::imethod"); }
+}
+
+class C implements I {
+  public void foo() { I.super.imethod(); }  // invokespecial InterfaceMethod
+  public void bar() { I i = this; i.imethod(); } // invokeinterface same
+  public void doSomeInvokedynamic() {
+      String str = "world";
+      Supplier<String> foo = ()->"hello, "+str;
+      String res = foo.get();
+      System.out.println(res);
+  }
+}
+
+public class InvokespecialInterface {
+  public static void main(java.lang.String[] unused) {
+     // need to create C and call I::foo()
+     C c = new C();
+     c.foo();
+     c.bar();
+     c.doSomeInvokedynamic();
+  }
+};
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/serviceability/sa/jmap-hashcode/Test8028623.java	Mon Feb 03 10:49:49 2014 +0100
@@ -0,0 +1,74 @@
+/*
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 8028623
+ * @summary Test hashing of extended characters in Serviceability Agent.
+ * @library /testlibrary
+ * @compile -encoding utf8 Test8028623.java
+ * @run main Test8028623
+ */
+
+import com.oracle.java.testlibrary.JDKToolLauncher;
+import com.oracle.java.testlibrary.OutputBuffer;
+import com.oracle.java.testlibrary.ProcessTools;
+
+import java.io.File;
+
+public class Test8028623 {
+
+  public static int à = 1;
+  public static String dumpFile = "heap.out";
+
+  public static void main (String[] args) {
+
+    System.out.println(Ã);
+
+    try {
+        int pid = ProcessTools.getProcessId();
+        JDKToolLauncher jmap = JDKToolLauncher.create("jmap")
+                                              .addToolArg("-F")
+                                              .addToolArg("-dump:live,format=b,file=" + dumpFile)
+                                              .addToolArg(Integer.toString(pid));
+        ProcessBuilder pb = new ProcessBuilder(jmap.getCommand());
+        OutputBuffer output = ProcessTools.getOutput(pb);
+        Process p = pb.start();
+        int e = p.waitFor();
+        System.out.println("stdout:");
+        System.out.println(output.getStdout());
+        System.out.println("stderr:");
+        System.out.println(output.getStderr());
+
+        if (e != 0) {
+            throw new RuntimeException("jmap returns: " + e);
+        }
+        if (! new File(dumpFile).exists()) {
+            throw new RuntimeException("dump file NOT created: '" + dumpFile + "'");
+        }
+    } catch (Throwable t) {
+        t.printStackTrace();
+        throw new RuntimeException("Test failed with: " + t);
+    }
+  }
+}