changeset 5906:06e2c3bf8117

Merge from main OpenJDK repository
author Greg Lewis <glewis@eyesbeyond.com>
date Mon, 01 Feb 2016 17:27:22 -0800
parents b3c5ff648bca (current diff) afc7b53e0ad5 (diff)
children ab7efd71a2f1
files .hgtags src/os/bsd/vm/perfMemory_bsd.cpp
diffstat 35 files changed, 621 insertions(+), 272 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Thu Jan 14 20:45:31 2016 +0000
+++ b/.hgtags	Mon Feb 01 17:27:22 2016 -0800
@@ -182,6 +182,7 @@
 38fa55e5e79232d48f1bb8cf27d88bc094c9375a hs21-b16
 81d815b05abb564aa1f4100ae13491c949b9a07e jdk7-b147
 81d815b05abb564aa1f4100ae13491c949b9a07e hs21-b17
+f1a18ada5853af49fce54d43dd5a5b67dc291470 7u0
 9b0ca45cd756d538c4c30afab280a91868eee1a5 jdk7u2-b01
 0cc8a70952c368e06de2adab1f2649a408f5e577 jdk8-b01
 31e253c1da429124bb87570ab095d9bc89850d0a jdk8-b02
--- a/agent/src/os/bsd/ps_proc.c	Thu Jan 14 20:45:31 2016 +0000
+++ b/agent/src/os/bsd/ps_proc.c	Mon Feb 01 17:27:22 2016 -0800
@@ -131,7 +131,7 @@
 
 static bool ptrace_continue(pid_t pid, int signal) {
   // pass the signal to the process so we don't swallow it
-  if (ptrace(PTRACE_CONT, pid, NULL, signal) < 0) {
+  if (ptrace(PT_CONTINUE, pid, NULL, signal) < 0) {
     print_debug("ptrace(PTRACE_CONT, ..) failed for %d\n", pid);
     return false;
   }
--- a/agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java	Thu Jan 14 20:45:31 2016 +0000
+++ b/agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java	Mon Feb 01 17:27:22 2016 -0800
@@ -33,6 +33,7 @@
 import sun.jvm.hotspot.debugger.remote.*;
 import sun.jvm.hotspot.debugger.windbg.*;
 import sun.jvm.hotspot.debugger.linux.*;
+import sun.jvm.hotspot.debugger.bsd.*;
 import sun.jvm.hotspot.memory.*;
 import sun.jvm.hotspot.oops.*;
 import sun.jvm.hotspot.runtime.*;
--- a/agent/src/share/classes/sun/jvm/hotspot/bugspot/BugSpotAgent.java	Thu Jan 14 20:45:31 2016 +0000
+++ b/agent/src/share/classes/sun/jvm/hotspot/bugspot/BugSpotAgent.java	Mon Feb 01 17:27:22 2016 -0800
@@ -35,6 +35,7 @@
 import sun.jvm.hotspot.debugger.windbg.*;
 import sun.jvm.hotspot.debugger.linux.*;
 import sun.jvm.hotspot.debugger.sparc.*;
+import sun.jvm.hotspot.debugger.bsd.*;
 import sun.jvm.hotspot.debugger.remote.*;
 import sun.jvm.hotspot.livejvm.*;
 import sun.jvm.hotspot.memory.*;
--- a/make/bsd/Makefile	Thu Jan 14 20:45:31 2016 +0000
+++ b/make/bsd/Makefile	Mon Feb 01 17:27:22 2016 -0800
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2012, 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
@@ -211,6 +211,8 @@
 BUILDTREE_VARS    = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OSNAME) SRCARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) LIBRARY_SUFFIX=$(LIBRARY_SUFFIX)
 BUILDTREE_VARS   += HOTSPOT_RELEASE_VERSION=$(HOTSPOT_RELEASE_VERSION) HOTSPOT_BUILD_VERSION=$(HOTSPOT_BUILD_VERSION) JRE_RELEASE_VERSION=$(JRE_RELEASE_VERSION)
 
+BUILDTREE_VARS   += ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS) OBJCOPY=$(OBJCOPY) STRIP_POLICY=$(STRIP_POLICY) ZIP_DEBUGINFO_FILES=$(ZIP_DEBUGINFO_FILES) ZIPEXE=$(ZIPEXE)
+
 BUILDTREE         = $(MAKE) -f $(BUILDTREE_MAKE) $(BUILDTREE_VARS)
 
 #-------------------------------------------------------------------------------
@@ -337,9 +339,11 @@
 
 # Doc target.  This is the same for all build options.
 #     Hence create a docs directory beside ...$(ARCH)_[...]
+# We specify 'BUILD_FLAVOR=product' so that the proper
+# ENABLE_FULL_DEBUG_SYMBOLS value is used.
 docs: checks
 	$(QUIETLY) mkdir -p $(SUBDIR_DOCS)
-	$(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/makefiles/jvmti.make $(MFLAGS) $(BUILDTREE_VARS) JvmtiOutDir=$(SUBDIR_DOCS) jvmtidocs
+	$(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/makefiles/jvmti.make $(MFLAGS) $(BUILDTREE_VARS) JvmtiOutDir=$(SUBDIR_DOCS) BUILD_FLAVOR=product jvmtidocs
 
 # Synonyms for win32-like targets.
 compiler2:  jvmg product
--- a/make/bsd/makefiles/build_vm_def.sh	Thu Jan 14 20:45:31 2016 +0000
+++ b/make/bsd/makefiles/build_vm_def.sh	Mon Feb 01 17:27:22 2016 -0800
@@ -1,12 +1,28 @@
 #!/bin/sh
 
 # If we're cross compiling use that path for nm
-if [ "$CROSS_COMPILE_ARCH" != "" ]; then 
-NM=$ALT_COMPILER_PATH/nm
+if [ "$CROSS_COMPILE_ARCH" != "" ]; then
+    NM=$ALT_COMPILER_PATH/nm
 else
-NM=nm
+    NM=nm
 fi
 
-$NM -Uj $* | awk '
-   { if ($3 ~ /^_ZTV/ || $3 ~ /^gHotSpotVM/) print "\t" $3 }
-   '
+case "$(uname -s)" in
+Darwin )
+    $NM -Uj $@ | awk '{
+        if ($3 ~ /^_ZTV/ || $3 ~ /^gHotSpotVM/) print "\t" $3
+    }' ;;
+OpenBSD )
+    $NM $@ | awk '{
+        if ($2 == "U") next
+        if ($3 ~ /^_ZTV/ || $3 ~ /^gHotSpotVM/) print "\t" $3 ";"
+        if ($3 ~ /^UseSharedSpaces$/) print "\t" $3 ";"
+        if ($3 ~ /^_ZN9Arguments17SharedArchivePathE$/) print "\t" $3 ";"
+    }' | sort -u ;;
+* )
+    $NM --defined-only $@ | awk '{
+        if ($3 ~ /^_ZTV/ || $3 ~ /^gHotSpotVM/) print "\t" $3 ";"
+        if ($3 ~ /^UseSharedSpaces$/) print "\t" $3 ";"
+        if ($3 ~ /^_ZN9Arguments17SharedArchivePathE$/) print "\t" $3 ";"
+    }' | sort -u ;;
+esac
--- a/make/bsd/makefiles/buildtree.make	Thu Jan 14 20:45:31 2016 +0000
+++ b/make/bsd/makefiles/buildtree.make	Mon Feb 01 17:27:22 2016 -0800
@@ -255,6 +255,16 @@
 	echo "$(call gamma-path,commonsrc,os/posix/vm)"; \
 	[ -n "$(CFLAGS_BROWSE)" ] && \
 	    echo && echo "CFLAGS_BROWSE = $(CFLAGS_BROWSE)"; \
+	[ -n "$(ENABLE_FULL_DEBUG_SYMBOLS)" ] && \
+	    echo && echo "ENABLE_FULL_DEBUG_SYMBOLS = $(ENABLE_FULL_DEBUG_SYMBOLS)"; \
+	[ -n "$(OBJCOPY)" ] && \
+	    echo && echo "OBJCOPY = $(OBJCOPY)"; \
+	[ -n "$(STRIP_POLICY)" ] && \
+	    echo && echo "STRIP_POLICY = $(STRIP_POLICY)"; \
+	[ -n "$(ZIP_DEBUGINFO_FILES)" ] && \
+	    echo && echo "ZIP_DEBUGINFO_FILES = $(ZIP_DEBUGINFO_FILES)"; \
+	[ -n "$(ZIPEXE)" ] && \
+	    echo && echo "ZIPEXE = $(ZIPEXE)"; \
 	[ -n "$(HOTSPOT_EXTRA_SYSDEFS)" ] && \
 	    echo && \
 	    echo "HOTSPOT_EXTRA_SYSDEFS\$$(HOTSPOT_EXTRA_SYSDEFS) = $(HOTSPOT_EXTRA_SYSDEFS)" && \
@@ -384,7 +394,7 @@
 	$(QUIETLY) ( \
 	$(BUILDTREE_COMMENT); \
 	echo "JDK=${JAVA_HOME}"; \
-	) > $@	   
+	) > $@
 
 .dbxrc:  $(BUILDTREE_MAKE)
 	@echo Creating $@ ...
--- a/make/bsd/makefiles/gcc.make	Thu Jan 14 20:45:31 2016 +0000
+++ b/make/bsd/makefiles/gcc.make	Mon Feb 01 17:27:22 2016 -0800
@@ -117,7 +117,10 @@
 CFLAGS += -fno-rtti
 CFLAGS += -fno-exceptions
 CFLAGS += -pthread
-CFLAGS += -fcheck-new
+# Clang does not support -fcheck-new
+ifeq (,$(findstring clang,$(shell $(CC) -v 2>&1)))
+  CFLAGS += -fcheck-new
+endif
 # version 4 and above support fvisibility=hidden (matches jni_x86.h file)
 # except 4.1.2 gives pointless warnings that can't be disabled (afaik)
 ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0"
@@ -215,7 +218,11 @@
 
 # Flags for generating make dependency flags.
 ifneq ("${CC_VER_MAJOR}", "2")
-DEPFLAGS = -fpch-deps -MMD -MP -MF $(DEP_DIR)/$(@:%=%.d)
+DEPFLAGS =
+ifeq (,$(findstring clang,$(shell $(CC) -v 2>&1)))
+DEPFLAGS += -fpch-deps
+endif
+DEPFLAGS += -MMD -MP -MF $(DEP_DIR)/$(@:%=%.d)
 endif
 
 # -DDONT_USE_PRECOMPILED_HEADER will exclude all includes in precompiled.hpp.
--- a/make/bsd/makefiles/jsig.make	Thu Jan 14 20:45:31 2016 +0000
+++ b/make/bsd/makefiles/jsig.make	Mon Feb 01 17:27:22 2016 -0800
@@ -36,9 +36,16 @@
   LIBJSIG_G = lib$(JSIG_G).so
 endif
 
+LIBJSIG_DEBUGINFO   = lib$(JSIG).debuginfo
+LIBJSIG_DIZ         = lib$(JSIG).diz
+LIBJSIG_G_DEBUGINFO = lib$(JSIG_G).debuginfo
+LIBJSIG_G_DIZ       = lib$(JSIG_G).diz
+
 JSIGSRCDIR = $(GAMMADIR)/src/os/$(Platform_os_family)/vm
 
 DEST_JSIG  = $(JDK_LIBDIR)/$(LIBJSIG)
+DEST_JSIG_DEBUGINFO = $(JDK_LIBDIR)/$(LIBJSIG_DEBUGINFO)
+DEST_JSIG_DIZ       = $(JDK_LIBDIR)/$(LIBJSIG_DIZ)
 
 LIBJSIG_MAPFILE = $(MAKEFILES_DIR)/mapfile-vers-jsig
 
@@ -57,11 +64,33 @@
 $(LIBJSIG): $(JSIGSRCDIR)/jsig.c $(LIBJSIG_MAPFILE)
 	@echo Making signal interposition lib...
 	$(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) $(SHARED_FLAG) $(PICFLAG) \
-                         $(LFLAGS_JSIG) $(JSIG_DEBUG_CFLAGS) -o $@ $<
+			$(LFLAGS_JSIG) $(JSIG_DEBUG_CFLAGS) -o $@ $<
 	$(QUIETLY) [ -f $(LIBJSIG_G) ] || { ln -s $@ $(LIBJSIG_G); }
+ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
+	$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJSIG_DEBUGINFO)
+	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJSIG_DEBUGINFO) $@
+  ifeq ($(STRIP_POLICY),all_strip)
+	$(QUIETLY) $(STRIP) $@
+  else
+    ifeq ($(STRIP_POLICY),min_strip)
+	$(QUIETLY) $(STRIP) -S $@
+    # implied else here is no stripping at all
+    endif
+  endif
+	[ -f $(LIBJSIG_G_DEBUGINFO) ] || { ln -s $(LIBJSIG_DEBUGINFO) $(LIBJSIG_G_DEBUGINFO); }
+  ifeq ($(ZIP_DEBUGINFO_FILES),1)
+	$(ZIPEXE) -q -y $(LIBJSIG_DIZ) $(LIBJSIG_DEBUGINFO) $(LIBJSIG_G_DEBUGINFO)
+	$(RM) $(LIBJSIG_DEBUGINFO) $(LIBJSIG_G_DEBUGINFO)
+	[ -f $(LIBJSIG_G_DIZ) ] || { ln -s $(LIBJSIG_DIZ) $(LIBJSIG_G_DIZ); }
+  endif
+endif
 
 install_jsig: $(LIBJSIG)
 	@echo "Copying $(LIBJSIG) to $(DEST_JSIG)"
+	$(QUIETLY) test -f $(LIBJSIG_DEBUGINFO) && \
+	    cp -f $(LIBJSIG_DEBUGINFO) $(DEST_JSIG_DEBUGINFO)
+	$(QUIETLY) test -f $(LIBJSIG_DIZ) && \
+	    cp -f $(LIBJSIG_DIZ) $(DEST_JSIG_DIZ)
 	$(QUIETLY) cp -f $(LIBJSIG) $(DEST_JSIG) && echo "Done"
 
 .PHONY: install_jsig
--- a/make/bsd/makefiles/launcher.make	Thu Jan 14 20:45:31 2016 +0000
+++ b/make/bsd/makefiles/launcher.make	Mon Feb 01 17:27:22 2016 -0800
@@ -50,7 +50,7 @@
   LIBS_LAUNCHER             += $(STATIC_STDCXX) $(LIBS)
 else
   LAUNCHER.o                 = launcher.o
-  LFLAGS_LAUNCHER           += -L`pwd` 
+  LFLAGS_LAUNCHER           += -L`pwd`
 
   # The gamma launcher runs the JDK from $JAVA_HOME, overriding the JVM with a
   # freshly built JVM at ./libjvm.{so|dylib}.  This is accomplished by setting 
--- a/make/bsd/makefiles/mapfile-vers-product	Thu Jan 14 20:45:31 2016 +0000
+++ b/make/bsd/makefiles/mapfile-vers-product	Mon Feb 01 17:27:22 2016 -0800
@@ -19,237 +19,248 @@
 # 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.
-#
+#  
 #
-# Only used for OSX/Darwin builds
 
 # Define public interface.
-                # _JNI
-                _JNI_CreateJavaVM
-                _JNI_GetCreatedJavaVMs
-                _JNI_GetDefaultJavaVMInitArgs
+
+SUNWprivate_1.1 {
+        global:
+                # JNI
+                JNI_CreateJavaVM;
+                JNI_GetCreatedJavaVMs;
+                JNI_GetDefaultJavaVMInitArgs;
 
-                # _JVM
-                _JVM_Accept
-                _JVM_ActiveProcessorCount
-                _JVM_AllocateNewArray
-                _JVM_AllocateNewObject
-                _JVM_ArrayCopy
-                _JVM_AssertionStatusDirectives
-                _JVM_Available
-                _JVM_Bind
-                _JVM_ClassDepth
-                _JVM_ClassLoaderDepth
-                _JVM_Clone
-                _JVM_Close
-                _JVM_CX8Field
-                _JVM_CompileClass
-                _JVM_CompileClasses
-                _JVM_CompilerCommand
-                _JVM_Connect
-                _JVM_ConstantPoolGetClassAt
-                _JVM_ConstantPoolGetClassAtIfLoaded
-                _JVM_ConstantPoolGetDoubleAt
-                _JVM_ConstantPoolGetFieldAt
-                _JVM_ConstantPoolGetFieldAtIfLoaded
-                _JVM_ConstantPoolGetFloatAt
-                _JVM_ConstantPoolGetIntAt
-                _JVM_ConstantPoolGetLongAt
-                _JVM_ConstantPoolGetMethodAt
-                _JVM_ConstantPoolGetMethodAtIfLoaded
-                _JVM_ConstantPoolGetMemberRefInfoAt
-                _JVM_ConstantPoolGetSize
-                _JVM_ConstantPoolGetStringAt
-                _JVM_ConstantPoolGetUTF8At
-                _JVM_CountStackFrames
-                _JVM_CurrentClassLoader
-                _JVM_CurrentLoadedClass
-                _JVM_CurrentThread
-                _JVM_CurrentTimeMillis
-                _JVM_DefineClass
-                _JVM_DefineClassWithSource
-                _JVM_DefineClassWithSourceCond
-                _JVM_DesiredAssertionStatus
-                _JVM_DisableCompiler
-                _JVM_DoPrivileged
-                _JVM_DTraceGetVersion
-                _JVM_DTraceActivate
-                _JVM_DTraceIsProbeEnabled
-                _JVM_DTraceIsSupported
-                _JVM_DTraceDispose
-                _JVM_DumpAllStacks
-                _JVM_DumpThreads
-                _JVM_EnableCompiler
-                _JVM_Exit
-                _JVM_FillInStackTrace
-                _JVM_FindClassFromCaller
-                _JVM_FindClassFromClass
-                _JVM_FindClassFromClassLoader
-                _JVM_FindClassFromBootLoader
-                _JVM_FindLibraryEntry
-                _JVM_FindLoadedClass
-                _JVM_FindPrimitiveClass
-                _JVM_FindSignal
-                _JVM_FreeMemory
-                _JVM_GC
-                _JVM_GetAllThreads
-                _JVM_GetArrayElement
-                _JVM_GetArrayLength
-                _JVM_GetCPClassNameUTF
-                _JVM_GetCPFieldClassNameUTF
-                _JVM_GetCPFieldModifiers
-                _JVM_GetCPFieldNameUTF
-                _JVM_GetCPFieldSignatureUTF
-                _JVM_GetCPMethodClassNameUTF
-                _JVM_GetCPMethodModifiers
-                _JVM_GetCPMethodNameUTF
-                _JVM_GetCPMethodSignatureUTF
-                _JVM_GetCallerClass
-                _JVM_GetClassAccessFlags
-                _JVM_GetClassAnnotations
-                _JVM_GetClassCPEntriesCount
-                _JVM_GetClassCPTypes
-                _JVM_GetClassConstantPool
-                _JVM_GetClassContext
-                _JVM_GetClassDeclaredConstructors
-                _JVM_GetClassDeclaredFields
-                _JVM_GetClassDeclaredMethods
-                _JVM_GetClassFieldsCount
-                _JVM_GetClassInterfaces
-                _JVM_GetClassLoader
-                _JVM_GetClassMethodsCount
-                _JVM_GetClassModifiers
-                _JVM_GetClassName
-                _JVM_GetClassNameUTF
-                _JVM_GetClassSignature
-                _JVM_GetClassSigners
-                _JVM_GetComponentType
-                _JVM_GetDeclaredClasses
-                _JVM_GetDeclaringClass
-                _JVM_GetEnclosingMethodInfo
-                _JVM_GetFieldAnnotations
-                _JVM_GetFieldIxModifiers
-                _JVM_GetHostName
-                _JVM_GetInheritedAccessControlContext
-                _JVM_GetInterfaceVersion
-                _JVM_GetLastErrorString
-                _JVM_GetManagement
-                _JVM_GetMethodAnnotations
-                _JVM_GetMethodDefaultAnnotationValue
-                _JVM_GetMethodIxArgsSize
-                _JVM_GetMethodIxByteCode
-                _JVM_GetMethodIxByteCodeLength
-                _JVM_GetMethodIxExceptionIndexes
-                _JVM_GetMethodIxExceptionTableEntry
-                _JVM_GetMethodIxExceptionTableLength
-                _JVM_GetMethodIxExceptionsCount
-                _JVM_GetMethodIxLocalsCount
-                _JVM_GetMethodIxMaxStack
-                _JVM_GetMethodIxModifiers
-                _JVM_GetMethodIxNameUTF
-                _JVM_GetMethodIxSignatureUTF
-                _JVM_GetMethodParameterAnnotations
-                _JVM_GetPrimitiveArrayElement
-                _JVM_GetProtectionDomain
-                _JVM_GetSockName
-                _JVM_GetSockOpt
-                _JVM_GetStackAccessControlContext
-                _JVM_GetStackTraceDepth
-                _JVM_GetStackTraceElement
-                _JVM_GetSystemPackage
-                _JVM_GetSystemPackages
-                _JVM_GetTemporaryDirectory
-                _JVM_GetThreadStateNames
-                _JVM_GetThreadStateValues
-                _JVM_GetVersionInfo
-                _JVM_Halt
-                _JVM_HoldsLock
-                _JVM_IHashCode
-                _JVM_InitAgentProperties
-                _JVM_InitProperties
-                _JVM_InitializeCompiler
-                _JVM_InitializeSocketLibrary
-                _JVM_InternString
-                _JVM_Interrupt
-                _JVM_InvokeMethod
-                _JVM_IsArrayClass
-                _JVM_IsConstructorIx
-                _JVM_IsInterface
-                _JVM_IsInterrupted
-                _JVM_IsNaN
-                _JVM_IsPrimitiveClass
-                _JVM_IsSameClassPackage
-                _JVM_IsSilentCompiler
-                _JVM_IsSupportedJNIVersion
-                _JVM_IsThreadAlive
-                _JVM_LatestUserDefinedLoader
-                _JVM_Listen
-                _JVM_LoadClass0
-                _JVM_LoadLibrary
-                _JVM_Lseek
-                _JVM_MaxObjectInspectionAge
-                _JVM_MaxMemory
-                _JVM_MonitorNotify
-                _JVM_MonitorNotifyAll
-                _JVM_MonitorWait
-                _JVM_NanoTime
-                _JVM_NativePath
-                _JVM_NewArray
-                _JVM_NewInstanceFromConstructor
-                _JVM_NewMultiArray
-                _JVM_OnExit
-                _JVM_Open
-                _JVM_PrintStackTrace
-                _JVM_RaiseSignal
-                _JVM_RawMonitorCreate
-                _JVM_RawMonitorDestroy
-                _JVM_RawMonitorEnter
-                _JVM_RawMonitorExit
-                _JVM_Read
-                _JVM_Recv
-                _JVM_RecvFrom
-                _JVM_RegisterSignal
-                _JVM_ReleaseUTF
-                _JVM_ResolveClass
-                _JVM_ResumeThread
-                _JVM_Send
-                _JVM_SendTo
-                _JVM_SetArrayElement
-                _JVM_SetClassSigners
-                _JVM_SetLength
-                _JVM_SetNativeThreadName
-                _JVM_SetPrimitiveArrayElement
-                _JVM_SetProtectionDomain
-                _JVM_SetSockOpt
-                _JVM_SetThreadPriority
-                _JVM_Sleep
-                _JVM_Socket
-                _JVM_SocketAvailable
-                _JVM_SocketClose
-                _JVM_SocketShutdown
-                _JVM_StartThread
-                _JVM_StopThread
-                _JVM_SuspendThread
-                _JVM_SupportsCX8
-                _JVM_Sync
-                _JVM_Timeout
-                _JVM_TotalMemory
-                _JVM_TraceInstructions
-                _JVM_TraceMethodCalls
-                _JVM_UnloadLibrary
-                _JVM_Write
-                _JVM_Yield
-                _JVM_handle_bsd_signal
+                # JVM
+                JVM_Accept;
+                JVM_ActiveProcessorCount;
+                JVM_AllocateNewArray;
+                JVM_AllocateNewObject;
+                JVM_ArrayCopy;
+                JVM_AssertionStatusDirectives;
+                JVM_Available;
+                JVM_Bind;
+                JVM_ClassDepth;
+                JVM_ClassLoaderDepth;
+                JVM_Clone;
+                JVM_Close;
+                JVM_CX8Field;
+                JVM_CompileClass;
+                JVM_CompileClasses;
+                JVM_CompilerCommand;
+                JVM_Connect;
+                JVM_ConstantPoolGetClassAt;
+                JVM_ConstantPoolGetClassAtIfLoaded;
+                JVM_ConstantPoolGetDoubleAt;
+                JVM_ConstantPoolGetFieldAt;
+                JVM_ConstantPoolGetFieldAtIfLoaded;
+                JVM_ConstantPoolGetFloatAt;
+                JVM_ConstantPoolGetIntAt;
+                JVM_ConstantPoolGetLongAt;
+                JVM_ConstantPoolGetMethodAt;
+                JVM_ConstantPoolGetMethodAtIfLoaded;
+                JVM_ConstantPoolGetMemberRefInfoAt;
+                JVM_ConstantPoolGetSize;
+                JVM_ConstantPoolGetStringAt;
+                JVM_ConstantPoolGetUTF8At;
+                JVM_CountStackFrames;
+                JVM_CurrentClassLoader;
+                JVM_CurrentLoadedClass;
+                JVM_CurrentThread;
+                JVM_CurrentTimeMillis;
+                JVM_DefineClass;
+                JVM_DefineClassWithSource;
+                JVM_DefineClassWithSourceCond;
+                JVM_DesiredAssertionStatus;
+                JVM_DisableCompiler;
+                JVM_DoPrivileged;
+                JVM_DTraceGetVersion;
+                JVM_DTraceActivate;
+                JVM_DTraceIsProbeEnabled;
+                JVM_DTraceIsSupported;
+                JVM_DTraceDispose;
+                JVM_DumpAllStacks;
+                JVM_DumpThreads;
+                JVM_EnableCompiler;
+                JVM_Exit;
+                JVM_FillInStackTrace;
+                JVM_FindClassFromCaller;
+                JVM_FindClassFromClass;
+                JVM_FindClassFromClassLoader;
+                JVM_FindClassFromBootLoader;
+                JVM_FindLibraryEntry;
+                JVM_FindLoadedClass;
+                JVM_FindPrimitiveClass;
+                JVM_FindSignal;
+                JVM_FreeMemory;
+                JVM_GC;
+                JVM_GetAllThreads;
+                JVM_GetArrayElement;
+                JVM_GetArrayLength;
+                JVM_GetCPClassNameUTF;
+                JVM_GetCPFieldClassNameUTF;
+                JVM_GetCPFieldModifiers;
+                JVM_GetCPFieldNameUTF;
+                JVM_GetCPFieldSignatureUTF;
+                JVM_GetCPMethodClassNameUTF;
+                JVM_GetCPMethodModifiers;
+                JVM_GetCPMethodNameUTF;
+                JVM_GetCPMethodSignatureUTF;
+                JVM_GetCallerClass;
+                JVM_GetClassAccessFlags;
+                JVM_GetClassAnnotations;
+                JVM_GetClassCPEntriesCount;
+                JVM_GetClassCPTypes;
+                JVM_GetClassConstantPool;
+                JVM_GetClassContext;
+                JVM_GetClassDeclaredConstructors;
+                JVM_GetClassDeclaredFields;
+                JVM_GetClassDeclaredMethods;
+                JVM_GetClassFieldsCount;
+                JVM_GetClassInterfaces;
+                JVM_GetClassLoader;
+                JVM_GetClassMethodsCount;
+                JVM_GetClassModifiers;
+                JVM_GetClassName;
+                JVM_GetClassNameUTF;
+                JVM_GetClassSignature;
+                JVM_GetClassSigners;
+                JVM_GetComponentType;
+                JVM_GetDeclaredClasses;
+                JVM_GetDeclaringClass;
+                JVM_GetEnclosingMethodInfo;
+                JVM_GetFieldAnnotations;
+                JVM_GetFieldIxModifiers;
+                JVM_GetHostName;
+                JVM_GetInheritedAccessControlContext;
+                JVM_GetInterfaceVersion;
+                JVM_GetLastErrorString;
+                JVM_GetManagement;
+                JVM_GetMethodAnnotations;
+                JVM_GetMethodDefaultAnnotationValue;
+                JVM_GetMethodIxArgsSize;
+                JVM_GetMethodIxByteCode;
+                JVM_GetMethodIxByteCodeLength;
+                JVM_GetMethodIxExceptionIndexes;
+                JVM_GetMethodIxExceptionTableEntry;
+                JVM_GetMethodIxExceptionTableLength;
+                JVM_GetMethodIxExceptionsCount;
+                JVM_GetMethodIxLocalsCount;
+                JVM_GetMethodIxMaxStack;
+                JVM_GetMethodIxModifiers;
+                JVM_GetMethodIxNameUTF;
+                JVM_GetMethodIxSignatureUTF;
+                JVM_GetMethodParameterAnnotations;
+                JVM_GetPrimitiveArrayElement;
+                JVM_GetProtectionDomain;
+                JVM_GetSockName;
+                JVM_GetSockOpt;
+                JVM_GetStackAccessControlContext;
+                JVM_GetStackTraceDepth;
+                JVM_GetStackTraceElement;
+                JVM_GetSystemPackage;
+                JVM_GetSystemPackages;
+                JVM_GetTemporaryDirectory;
+                JVM_GetThreadStateNames;
+                JVM_GetThreadStateValues;
+                JVM_GetVersionInfo;
+                JVM_Halt;
+                JVM_HoldsLock;
+                JVM_IHashCode;
+                JVM_InitAgentProperties;
+                JVM_InitProperties;
+                JVM_InitializeCompiler;
+                JVM_InitializeSocketLibrary;
+                JVM_InternString;
+                JVM_Interrupt;
+                JVM_InvokeMethod;
+                JVM_IsArrayClass;
+                JVM_IsConstructorIx;
+                JVM_IsInterface;
+                JVM_IsInterrupted;
+                JVM_IsNaN;
+                JVM_IsPrimitiveClass;
+                JVM_IsSameClassPackage;
+                JVM_IsSilentCompiler;
+                JVM_IsSupportedJNIVersion;
+                JVM_IsThreadAlive;
+                JVM_LatestUserDefinedLoader;
+                JVM_Listen;
+                JVM_LoadClass0;
+                JVM_LoadLibrary;
+                JVM_Lseek;
+                JVM_MaxObjectInspectionAge;
+                JVM_MaxMemory;
+                JVM_MonitorNotify;
+                JVM_MonitorNotifyAll;
+                JVM_MonitorWait;
+                JVM_NanoTime;
+                JVM_NativePath;
+                JVM_NewArray;
+                JVM_NewInstanceFromConstructor;
+                JVM_NewMultiArray;
+                JVM_OnExit;
+                JVM_Open;
+                JVM_PrintStackTrace;
+                JVM_RaiseSignal;
+                JVM_RawMonitorCreate;
+                JVM_RawMonitorDestroy;
+                JVM_RawMonitorEnter;
+                JVM_RawMonitorExit;
+                JVM_Read;
+                JVM_Recv;
+                JVM_RecvFrom;
+                JVM_RegisterSignal;
+                JVM_ReleaseUTF;
+                JVM_ResolveClass;
+                JVM_ResumeThread;
+                JVM_Send;
+                JVM_SendTo;
+                JVM_SetArrayElement;
+                JVM_SetClassSigners;
+                JVM_SetLength;
+                JVM_SetNativeThreadName;
+                JVM_SetPrimitiveArrayElement;
+                JVM_SetProtectionDomain;
+                JVM_SetSockOpt;
+                JVM_SetThreadPriority;
+                JVM_Sleep;
+                JVM_Socket;
+                JVM_SocketAvailable;
+                JVM_SocketClose;
+                JVM_SocketShutdown;
+                JVM_StartThread;
+                JVM_StopThread;
+                JVM_SuspendThread;
+                JVM_SupportsCX8;
+                JVM_Sync;
+                JVM_Timeout;
+                JVM_TotalMemory;
+                JVM_TraceInstructions;
+                JVM_TraceMethodCalls;
+                JVM_UnloadLibrary;
+                JVM_Write;
+                JVM_Yield;
+                JVM_handle_bsd_signal;
 
                 # miscellaneous functions
-                _jio_fprintf
-                _jio_printf
-                _jio_snprintf
-                _jio_vfprintf
-                _jio_vsnprintf
+                jio_fprintf;
+                jio_printf;
+                jio_snprintf;
+                jio_vfprintf;
+                jio_vsnprintf;
+                fork1;
+                numa_warn;
+                numa_error;
+
+                # Needed because there is no JVM interface for this.
+                sysThreadAvailableStackWithSlack;
 
                 # This is for Forte Analyzer profiling support.
-                _AsyncGetCallTrace
+                AsyncGetCallTrace;
+
+		# INSERT VTABLE SYMBOLS HERE
 
-                # INSERT VTABLE SYMBOLS HERE
-
+        local:
+                *;
+};
--- a/make/bsd/makefiles/ppc.make	Thu Jan 14 20:45:31 2016 +0000
+++ b/make/bsd/makefiles/ppc.make	Mon Feb 01 17:27:22 2016 -0800
@@ -28,3 +28,6 @@
 # Must also specify if CPU is big endian
 CFLAGS += -DVM_BIG_ENDIAN
 
+ifdef E500V2
+ASFLAGS += -Wa,-mspe -Wa,--defsym -Wa,E500V2=1 
+endif
--- a/make/bsd/makefiles/saproc.make	Thu Jan 14 20:45:31 2016 +0000
+++ b/make/bsd/makefiles/saproc.make	Mon Feb 01 17:27:22 2016 -0800
@@ -36,6 +36,11 @@
   LIBSAPROC_G = lib$(SAPROC_G).so
 endif
 
+LIBSAPROC_DEBUGINFO   = lib$(SAPROC).debuginfo
+LIBSAPROC_DIZ         = lib$(SAPROC).diz
+LIBSAPROC_G_DEBUGINFO = lib$(SAPROC_G).debuginfo
+LIBSAPROC_G_DIZ       = lib$(SAPROC_G).diz
+
 AGENT_DIR = $(GAMMADIR)/agent
 
 SASRCDIR = $(AGENT_DIR)/src/os/$(Platform_os_family)
@@ -66,7 +71,9 @@
 
 SAMAPFILE = $(SASRCDIR)/mapfile
 
-DEST_SAPROC = $(JDK_LIBDIR)/$(LIBSAPROC)
+DEST_SAPROC           = $(JDK_LIBDIR)/$(LIBSAPROC)
+DEST_SAPROC_DEBUGINFO = $(JDK_LIBDIR)/$(LIBSAPROC_DEBUGINFO)
+DEST_SAPROC_DIZ       = $(JDK_LIBDIR)/$(LIBSAPROC_DIZ)
 
 # DEBUG_BINARIES overrides everything, use full -g debug information
 ifeq ($(DEBUG_BINARIES), true)
@@ -114,10 +121,32 @@
 	           -o $@                                                \
 	           $(SALIBS)
 	$(QUIETLY) [ -f $(LIBSAPROC_G) ] || { ln -s $@ $(LIBSAPROC_G); }
+ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
+	$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBSAPROC_DEBUGINFO)
+	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBSAPROC_DEBUGINFO) $@
+  ifeq ($(STRIP_POLICY),all_strip)
+	$(QUIETLY) $(STRIP) $@
+  else
+    ifeq ($(STRIP_POLICY),min_strip)
+	$(QUIETLY) $(STRIP) -S $@
+    # implied else here is no stripping at all
+    endif
+  endif
+	[ -f $(LIBSAPROC_G_DEBUGINFO) ] || { ln -s $(LIBSAPROC_DEBUGINFO) $(LIBSAPROC_G_DEBUGINFO); }
+  ifeq ($(ZIP_DEBUGINFO_FILES),1)
+	$(ZIPEXE) -q -y $(LIBSAPROC_DIZ) $(LIBSAPROC_DEBUGINFO) $(LIBSAPROC_G_DEBUGINFO)
+	$(RM) $(LIBSAPROC_DEBUGINFO) $(LIBSAPROC_G_DEBUGINFO)
+	[ -f $(LIBSAPROC_G_DIZ) ] || { ln -s $(LIBSAPROC_DIZ) $(LIBSAPROC_G_DIZ); }
+  endif
+endif
 
 install_saproc: $(BUILDLIBSAPROC)
 	$(QUIETLY) if [ -e $(LIBSAPROC) ] ; then             \
 	  echo "Copying $(LIBSAPROC) to $(DEST_SAPROC)";     \
+	  test -f $(LIBSAPROC_DEBUGINFO) &&                  \
+	    cp -f $(LIBSAPROC_DEBUGINFO) $(DEST_SAPROC_DEBUGINFO); \
+	  test -f $(LIBSAPROC_DIZ) &&                  \
+	    cp -f $(LIBSAPROC_DIZ) $(DEST_SAPROC_DIZ); \
 	  cp -f $(LIBSAPROC) $(DEST_SAPROC) && echo "Done";  \
 	fi
 
--- a/make/solaris/makefiles/defs.make	Thu Jan 14 20:45:31 2016 +0000
+++ b/make/solaris/makefiles/defs.make	Mon Feb 01 17:27:22 2016 -0800
@@ -221,8 +221,8 @@
 endif
 ifeq ($(JVM_VARIANT_CLIENT),true)
   EXPORT_LIST += $(EXPORT_CLIENT_DIR)/Xusage.txt
-  EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.$(LIBRARY_SUFFIX) 
-  EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm_db.$(LIBRARY_SUFFIX) 
+  EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.$(LIBRARY_SUFFIX)
+  EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm_db.$(LIBRARY_SUFFIX)
   EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm_dtrace.$(LIBRARY_SUFFIX)
   ifeq ($(ARCH_DATA_MODEL),32)
     EXPORT_LIST += $(EXPORT_CLIENT_DIR)/64/libjvm_db.$(LIBRARY_SUFFIX)
--- a/src/cpu/sparc/vm/globals_sparc.hpp	Thu Jan 14 20:45:31 2016 +0000
+++ b/src/cpu/sparc/vm/globals_sparc.hpp	Mon Feb 01 17:27:22 2016 -0800
@@ -71,7 +71,11 @@
 define_pd_global(bool, RewriteBytecodes,     true);
 define_pd_global(bool, RewriteFrequentPairs, true);
 
+#ifdef _ALLBSD_SOURCE
+define_pd_global(bool, UseMembar,            true);
+#else
 define_pd_global(bool, UseMembar,            false);
+#endif
 
 // GC Ergo Flags
 define_pd_global(intx, CMSYoungGenPerWorker, 16*M);  // default max size of CMS young gen, per GC worker thread
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/os/bsd/vm/decoder_bsd.cpp	Mon Feb 01 17:27:22 2016 -0800
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include "prims/jvm.h"
+#include "utilities/decoder_elf.hpp"
+
+#include <cxxabi.h>
+
+bool ElfDecoder::demangle(const char* symbol, char *buf, int buflen) {
+  int   status;
+  char* result;
+  size_t size = (size_t)buflen;
+
+  // Don't pass buf to __cxa_demangle. In case of the 'buf' is too small,
+  // __cxa_demangle will call system "realloc" for additional memory, which
+  // may use different malloc/realloc mechanism that allocates 'buf'.
+  if ((result = abi::__cxa_demangle(symbol, NULL, NULL, &status)) != NULL) {
+    jio_snprintf(buf, buflen, "%s", result);
+      // call c library's free
+      ::free(result);
+      return true;
+  }
+  return false;
+}
+
--- a/src/os/bsd/vm/os_bsd.cpp	Thu Jan 14 20:45:31 2016 +0000
+++ b/src/os/bsd/vm/os_bsd.cpp	Mon Feb 01 17:27:22 2016 -0800
@@ -187,6 +187,8 @@
 static int SR_signum = SIGUSR2;
 sigset_t SR_sigset;
 
+// Declarations
+static void unpackTime(timespec* absTime, bool isAbsolute, jlong time);
 
 ////////////////////////////////////////////////////////////////////////////////
 // utility functions
@@ -355,7 +357,13 @@
    * since it returns a 64 bit value)
    */
   mib[0] = CTL_HW;
+#ifdef HW_MEMSIZE
   mib[1] = HW_MEMSIZE;
+#elif defined (HW_USERMEM64)
+  mib[1] = HW_USERMEM64;
+#else
+  mib[1] = HW_USERMEM;
+#endif
   len = sizeof(mem_val);
   if (sysctl(mib, 2, &mem_val, &len, NULL, 0) != -1) {
        assert(len == sizeof(mem_val), "unexpected data size");
@@ -1848,9 +1856,15 @@
   return n;
 }
 
+#ifdef __NetBSD__
+#include <lwp.h>
+#endif
+
 intx os::current_thread_id() {
 #ifdef __APPLE__
   return (intx)::pthread_mach_thread_np(::pthread_self());
+#elif defined(__NetBSD__)
+  return (intx)_lwp_self();
 #else
   return (intx)::pthread_self();
 #endif
@@ -2401,14 +2415,14 @@
 }
 
 void os::print_os_info_brief(outputStream* st) {
-  st->print("Bsd");
+  st->print("BSD");
 
   os::Posix::print_uname_info(st);
 }
 
 void os::print_os_info(outputStream* st) {
   st->print("OS:");
-  st->print("Bsd");
+  st->print("BSD");
 
   os::Posix::print_uname_info(st);
 
@@ -2417,10 +2431,6 @@
   os::Posix::print_load_average(st);
 }
 
-void os::pd_print_cpu_info(outputStream* st) {
-  // Nothing to do for now.
-}
-
 void os::print_memory_info(outputStream* st) {
 
   st->print("Memory:");
@@ -2437,6 +2447,7 @@
   st->print("(" UINT64_FORMAT "k free)",
             os::available_memory() >> 10);
 #ifndef _ALLBSD_SOURCE
+  // FIXME: Make this work for *BSD
   st->print(", swap " UINT64_FORMAT "k",
             ((jlong)si.totalswap * si.mem_unit) >> 10);
   st->print("(" UINT64_FORMAT "k free)",
@@ -2444,12 +2455,22 @@
 #endif
   st->cr();
 
+  // FIXME: Make this work for *BSD
   // meminfo
   st->print("\n/proc/meminfo:\n");
   _print_ascii_file("/proc/meminfo", st);
   st->cr();
 }
 
+void os::pd_print_cpu_info(outputStream* st) {
+  // FIXME: Make this work for *BSD
+  st->print("\n/proc/cpuinfo:\n");
+  if (!_print_ascii_file("/proc/cpuinfo", st)) {
+    st->print("  <Not Available>");
+  }
+  st->cr();
+}
+
 // Taken from /usr/include/bits/siginfo.h  Supposed to be architecture specific
 // but they're the same for all the bsd arch that we support
 // and they're the same for solaris but there's no common place to put this.
@@ -2596,6 +2617,25 @@
         assert(len < buflen, "Ran out of buffer space");
         jrelib_p = buf + len;
 
+#ifndef __APPLE__
+        snprintf(jrelib_p, buflen-len, "/jre/lib/%s", cpu_arch);
+        if (0 != access(buf, F_OK)) {
+          snprintf(jrelib_p, buflen-len, "/lib/%s", cpu_arch);
+        }
+
+        if (0 == access(buf, F_OK)) {
+          // Use current module name "libjvm[_g].so" instead of
+          // "libjvm"debug_only("_g")".so" since for fastdebug version
+          // we should have "libjvm.so" but debug_only("_g") adds "_g"!
+          len = strlen(buf);
+          snprintf(buf + len, buflen-len, "/hotspot/libjvm%s.so", p);
+        } else {
+          // Go back to path of .so
+          rp = realpath(dli_fname, buf);
+          if (rp == NULL)
+            return;
+        }
+#else
         // Add the appropriate library subdir
         snprintf(jrelib_p, buflen-len, "/jre/lib");
         if (0 != access(buf, F_OK)) {
@@ -2625,6 +2665,7 @@
           if (rp == NULL)
             return;
         }
+#endif
       }
     }
   }
@@ -2728,10 +2769,14 @@
     bool timedwait(unsigned int sec, int nsec);
   private:
     jlong currenttime() const;
-    semaphore_t _semaphore;
+    os_semaphore_t _semaphore;
 };
 
+#if defined(__FreeBSD__) && __FreeBSD__ > 8
+Semaphore::Semaphore() : _semaphore() {
+#else
 Semaphore::Semaphore() : _semaphore(0) {
+#endif
   SEM_INIT(_semaphore, 0);
 }
 
@@ -2796,7 +2841,7 @@
 
 bool Semaphore::timedwait(unsigned int sec, int nsec) {
   struct timespec ts;
-  jlong endtime = unpackTime(&ts, false, (sec * NANOSECS_PER_SEC) + nsec);
+  unpackTime(&ts, false, (sec * NANOSECS_PER_SEC) + nsec);
 
   while (1) {
     int result = sem_timedwait(&_semaphore, &ts);
@@ -3017,7 +3062,11 @@
 }
 
 void os::pd_free_memory(char *addr, size_t bytes, size_t alignment_hint) {
+#if !defined(__APPLE__) && !defined(__FreeBSD__)
+  commit_memory(addr, bytes, alignment_hint, false);
+#else
   ::madvise(addr, bytes, MADV_DONTNEED);
+#endif
 }
 
 void os::numa_make_global(char *addr, size_t bytes) {
@@ -3864,6 +3913,7 @@
   return OS_OK;
 #elif defined(__FreeBSD__)
   int ret = pthread_setprio(thread->osthread()->pthread_id(), newpri);
+  return (ret == 0) ? OS_OK : OS_ERR;
 #elif defined(__APPLE__) || defined(__NetBSD__)
   struct sched_param sp;
   int policy;
--- a/src/os/bsd/vm/os_bsd.hpp	Thu Jan 14 20:45:31 2016 +0000
+++ b/src/os/bsd/vm/os_bsd.hpp	Mon Feb 01 17:27:22 2016 -0800
@@ -103,6 +103,12 @@
 
   static bool hugetlbfs_sanity_check(bool warn, size_t page_size);
 
+  static void print_full_memory_info(outputStream* st);
+#ifndef _ALLBSD_SOURCE
+  static void print_distro_info(outputStream* st);
+  static void print_libversion_info(outputStream* st);
+#endif
+
  public:
 
   static void init_thread_fpu_state();
--- a/src/os/bsd/vm/os_bsd.inline.hpp	Thu Jan 14 20:45:31 2016 +0000
+++ b/src/os/bsd/vm/os_bsd.inline.hpp	Mon Feb 01 17:27:22 2016 -0800
@@ -31,10 +31,22 @@
 # include "atomic_bsd_x86.inline.hpp"
 # include "orderAccess_bsd_x86.inline.hpp"
 #endif
+#ifdef TARGET_OS_ARCH_bsd_sparc
+# include "atomic_bsd_sparc.inline.hpp"
+# include "orderAccess_bsd_sparc.inline.hpp"
+#endif
 #ifdef TARGET_OS_ARCH_bsd_zero
 # include "atomic_bsd_zero.inline.hpp"
 # include "orderAccess_bsd_zero.inline.hpp"
 #endif
+#ifdef TARGET_OS_ARCH_bsd_arm
+# include "atomic_bsd_arm.inline.hpp"
+# include "orderAccess_bsd_arm.inline.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_bsd_ppc
+# include "atomic_bsd_ppc.inline.hpp"
+# include "orderAccess_bsd_ppc.inline.hpp"
+#endif
 
 // System includes
 
--- a/src/os/bsd/vm/thread_bsd.inline.hpp	Thu Jan 14 20:45:31 2016 +0000
+++ b/src/os/bsd/vm/thread_bsd.inline.hpp	Mon Feb 01 17:27:22 2016 -0800
@@ -34,11 +34,26 @@
 # include "orderAccess_bsd_x86.inline.hpp"
 # include "prefetch_bsd_x86.inline.hpp"
 #endif
+#ifdef TARGET_OS_ARCH_bsd_sparc
+# include "atomic_bsd_sparc.inline.hpp"
+# include "orderAccess_bsd_sparc.inline.hpp"
+# include "prefetch_bsd_sparc.inline.hpp"
+#endif
 #ifdef TARGET_OS_ARCH_bsd_zero
 # include "atomic_bsd_zero.inline.hpp"
 # include "orderAccess_bsd_zero.inline.hpp"
 # include "prefetch_bsd_zero.inline.hpp"
 #endif
+#ifdef TARGET_OS_ARCH_bsd_arm
+# include "atomic_bsd_arm.inline.hpp"
+# include "orderAccess_bsd_arm.inline.hpp"
+# include "prefetch_bsd_arm.inline.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_bsd_ppc
+# include "atomic_bsd_ppc.inline.hpp"
+# include "orderAccess_bsd_ppc.inline.hpp"
+# include "prefetch_bsd_ppc.inline.hpp"
+#endif
 
 // Contains inlined functions for class Thread and ThreadLocalStorage
 
--- a/src/os/posix/vm/os_posix.cpp	Thu Jan 14 20:45:31 2016 +0000
+++ b/src/os/posix/vm/os_posix.cpp	Mon Feb 01 17:27:22 2016 -0800
@@ -175,11 +175,19 @@
   if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity");
   else st->print("%d", rlim.rlim_cur);
 
+#ifdef __OpenBSD__
+  st->print(", DATA ");
+  getrlimit(RLIMIT_DATA, &rlim);
+  if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity");
+  else st->print("%uk", rlim.rlim_cur >> 10);
+  st->cr();
+#else
   st->print(", AS ");
   getrlimit(RLIMIT_AS, &rlim);
   if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity");
   else st->print("%uk", rlim.rlim_cur >> 10);
   st->cr();
+#endif
 }
 
 void os::Posix::print_uname_info(outputStream* st) {
--- a/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp	Thu Jan 14 20:45:31 2016 +0000
+++ b/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp	Mon Feb 01 17:27:22 2016 -0800
@@ -945,7 +945,7 @@
   if (rslt != 0)
     fatal(err_msg("pthread_stackseg_np failed with err = %d", rslt));
 
-  *bottom = (address)((char *)ss.ss_sp - ss.ss_size);
+  *bottom = (address)(align_size_up((intptr_t)ss.ss_sp, os::vm_page_size()) - ss.ss_size);
   *size   = ss.ss_size;
 #elif defined(_ALLBSD_SOURCE)
   pthread_attr_t attr;
--- a/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp	Thu Jan 14 20:45:31 2016 +0000
+++ b/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp	Mon Feb 01 17:27:22 2016 -0800
@@ -24,7 +24,7 @@
  */
 
 #if defined(_ALLBSD_SOURCE) && !defined(__APPLE__) && !defined(__NetBSD__)
-#include <pthread.h>
+# include <pthread.h>
 # include <pthread_np.h> /* For pthread_attr_get_np */
 #endif
 
--- a/src/share/vm/code/relocInfo.hpp	Thu Jan 14 20:45:31 2016 +0000
+++ b/src/share/vm/code/relocInfo.hpp	Mon Feb 01 17:27:22 2016 -0800
@@ -371,7 +371,7 @@
   // "immediate" in the prefix header word itself.  This optimization
   // is invisible outside this module.)
 
-  inline friend relocInfo prefix_relocInfo(int datalen = 0);
+  inline friend relocInfo prefix_relocInfo(int datalen);
 
  protected:
   // an immediate relocInfo optimizes a prefix with one 10-bit unsigned value
@@ -466,7 +466,7 @@
   return relocInfo(relocInfo::none, relocInfo::offset_limit() - relocInfo::offset_unit);
 }
 
-inline relocInfo prefix_relocInfo(int datalen) {
+inline relocInfo prefix_relocInfo(int datalen = 0) {
   assert(relocInfo::fits_into_immediate(datalen), "datalen in limits");
   return relocInfo(relocInfo::data_prefix_tag, relocInfo::RAW_BITS, relocInfo::datalen_tag | datalen);
 }
--- a/src/share/vm/gc_implementation/shared/gcTraceSend.cpp	Thu Jan 14 20:45:31 2016 +0000
+++ b/src/share/vm/gc_implementation/shared/gcTraceSend.cpp	Mon Feb 01 17:27:22 2016 -0800
@@ -111,7 +111,7 @@
   if (e.should_commit()) {
     e.set_gcId(_shared_gc_info.id());
     e.set_data(to_trace_struct(pf_info));
-    e.set_thread(pf_info.thread()->thread_id());
+    e.set_thread((uint64_t) pf_info.thread()->thread_id());
     e.commit();
   }
 }
--- a/src/share/vm/runtime/atomic.cpp	Thu Jan 14 20:45:31 2016 +0000
+++ b/src/share/vm/runtime/atomic.cpp	Mon Feb 01 17:27:22 2016 -0800
@@ -54,6 +54,12 @@
 #ifdef TARGET_OS_ARCH_windows_x86
 # include "atomic_windows_x86.inline.hpp"
 #endif
+#ifdef TARGET_OS_ARCH_bsd_x86
+# include "atomic_bsd_x86.inline.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_bsd_zero
+# include "atomic_bsd_zero.inline.hpp"
+#endif
 #ifdef TARGET_OS_ARCH_linux_arm
 # include "atomic_linux_arm.inline.hpp"
 #endif
--- a/src/share/vm/runtime/objectMonitor.cpp	Thu Jan 14 20:45:31 2016 +0000
+++ b/src/share/vm/runtime/objectMonitor.cpp	Mon Feb 01 17:27:22 2016 -0800
@@ -1744,7 +1744,7 @@
      }
      iterator->_notified = 1 ;
      Thread * Self = THREAD;
-     iterator->_notifier_tid = Self->osthread()->thread_id();
+     iterator->_notifier_tid = (jlong) Self->osthread()->thread_id();
 
      ObjectWaiter * List = _EntryList ;
      if (List != NULL) {
@@ -1870,7 +1870,7 @@
      guarantee (iterator->_notified == 0, "invariant") ;
      iterator->_notified = 1 ;
      Thread * Self = THREAD;
-     iterator->_notifier_tid = Self->osthread()->thread_id();
+     iterator->_notifier_tid = (jlong) Self->osthread()->thread_id();
      if (Policy != 4) {
         iterator->TState = ObjectWaiter::TS_ENTER ;
      }
--- a/src/share/vm/runtime/os.cpp	Thu Jan 14 20:45:31 2016 +0000
+++ b/src/share/vm/runtime/os.cpp	Mon Feb 01 17:27:22 2016 -0800
@@ -399,13 +399,6 @@
     if (_native_java_library == NULL) {
       vm_exit_during_initialization("Unable to load native library", ebuf);
     }
-
-#if defined(__OpenBSD__)
-    // Work-around OpenBSD's lack of $ORIGIN support by pre-loading libnet.so
-    // ignore errors
-    dll_build_name(buffer, sizeof(buffer), Arguments::get_dll_dir(), "net");
-    dll_load(buffer, ebuf, sizeof(ebuf));
-#endif
   }
   static jboolean onLoaded = JNI_FALSE;
   if (onLoaded) {
--- a/src/share/vm/runtime/os.hpp	Thu Jan 14 20:45:31 2016 +0000
+++ b/src/share/vm/runtime/os.hpp	Mon Feb 01 17:27:22 2016 -0800
@@ -30,6 +30,9 @@
 #include "runtime/extendedPC.hpp"
 #include "runtime/handles.hpp"
 #include "utilities/top.hpp"
+#ifdef TARGET_OS_FAMILY_bsd
+# include "jvm_bsd.h"
+#endif
 #ifdef TARGET_OS_FAMILY_linux
 # include "jvm_linux.h"
 # include <setjmp.h>
@@ -755,8 +758,8 @@
 # include "os_windows.hpp"
 #endif
 #ifdef TARGET_OS_FAMILY_bsd
+# include "os_bsd.hpp"
 # include "os_posix.hpp"
-# include "os_bsd.hpp"
 #endif
 #ifdef TARGET_OS_ARCH_linux_x86
 # include "os_linux_x86.hpp"
--- a/src/share/vm/runtime/vmThread.cpp	Thu Jan 14 20:45:31 2016 +0000
+++ b/src/share/vm/runtime/vmThread.cpp	Mon Feb 01 17:27:22 2016 -0800
@@ -393,7 +393,7 @@
       // Only write caller thread information for non-concurrent vm operations.
       // For concurrent vm operations, the thread id is set to 0 indicating thread is unknown.
       // This is because the caller thread could have exited already.
-      event.set_caller(is_concurrent ? 0 : op->calling_thread()->osthread()->thread_id());
+      event.set_caller(is_concurrent ? 0 : (uint64_t) op->calling_thread()->osthread()->thread_id());
       event.commit();
     }
 
--- a/src/share/vm/trace/tracetypes.xml	Thu Jan 14 20:45:31 2016 +0000
+++ b/src/share/vm/trace/tracetypes.xml	Mon Feb 01 17:27:22 2016 -0800
@@ -60,7 +60,7 @@
  <types>
   <content_types>
     <content_type id="Thread" hr_name="Thread"
-                  type="U4" builtin_type="OSTHREAD">
+                  type="thread_id_t" builtin_type="OSTHREAD">
       <value type="UTF8" field="name" label="Thread name"/>
     </content_type>
 
@@ -294,8 +294,8 @@
                   type="u8" sizeop="sizeof(u8)"/>
 
     <!-- OS Thread ID -->
-    <primary_type symbol="OSTHREAD" datatype="U4" contenttype="OSTHREAD"
-                  type="u4" sizeop="sizeof(u4)"/>
+    <primary_type symbol="OSTHREAD" datatype="U8" contenttype="OSTHREAD"
+                  type="u8" sizeop="sizeof(u8)"/>
 
     <!-- VM Thread ID Note: changed from U2 to U8 for hotspot -->
     <primary_type symbol="VMTHREAD" datatype="U8" contenttype="VMTHREAD"
--- a/test/compiler/5091921/Test7005594.sh	Thu Jan 14 20:45:31 2016 +0000
+++ b/test/compiler/5091921/Test7005594.sh	Mon Feb 01 17:27:22 2016 -0800
@@ -60,6 +60,9 @@
   # Windows/MKS
   MEM=`"$ROOTDIR/mksnt/sysinf" memory -v | grep "Total Physical Memory: " | sed 's/Total Physical Memory: *//g'`
   MEM="$(($machine_memory / 1024))"
+elif [ -n `sysctl -n hw.physmem64 2> /dev/null` -o -n `sysctl -n hw.physmem 2> /dev/null` ];
+  # BSD
+  MEM=`sysctl -n hw.physmem64 2> /dev/null || sysctl -n hw.physmem) | awk '{print int($$NF / 1048576); }'`
 else
   echo "Unable to determine amount of physical memory on the machine"
 fi
--- a/test/runtime/7110720/Test7110720.sh	Thu Jan 14 20:45:31 2016 +0000
+++ b/test/runtime/7110720/Test7110720.sh	Mon Feb 01 17:27:22 2016 -0800
@@ -28,7 +28,7 @@
 # set platform-dependent variables
 OS=`uname -s`
 case "$OS" in
-  SunOS | Linux | Darwin )
+  SunOS | Linux | Darwin | *BSD )
     FS="/"
     RM=/bin/rm
     CP=/bin/cp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/runtime/7158800/Test7158800.sh	Mon Feb 01 17:27:22 2016 -0800
@@ -0,0 +1,91 @@
+#!/bin/sh
+# 
+#  Copyright (c) 2012, 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.
+# 
+#
+#   Run test for InternTest.java
+#
+
+if [ "${TESTSRC}" = "" ]
+then TESTSRC=.
+fi
+
+if [ "${TESTJAVA}" = "" ]
+then
+  PARENT=`dirname \`which java\``
+  TESTJAVA=`dirname ${PARENT}`
+  echo "TESTJAVA not set, selecting " ${TESTJAVA}
+  echo "If this is incorrect, try setting the variable manually."
+fi
+
+if [ "${TESTCLASSES}" = "" ]
+then
+  echo "TESTCLASSES not set.  Test cannot execute.  Failed."
+  exit 1
+fi
+
+# set platform-dependent variables
+OS=`uname -s`
+case "$OS" in
+  SunOS | Linux | *BSD )
+    NULL=/dev/null
+    PS=":"
+    FS="/"
+    ;;
+  Windows_* )
+    NULL=NUL
+    PS=";"
+    FS="\\"
+    ;;
+  * )
+    echo "Unrecognized system!"
+    exit 1;
+    ;;
+esac
+
+JEMMYPATH=${CPAPPEND}
+CLASSPATH=.${PS}${TESTCLASSES}${PS}${JEMMYPATH} ; export CLASSPATH
+
+THIS_DIR=`pwd`
+
+${TESTJAVA}${FS}bin${FS}java -fullversion
+
+${TESTJAVA}${FS}bin${FS}javac -d . ${TESTSRC}${FS}InternTest.java
+
+cp ${TESTSRC}${FS}badstrings.txt .
+
+${TESTJAVA}${FS}bin${FS}java -XX:+PrintStringTableStatistics -XX:+TraceSafepointCleanupTime InternTest bad > test.out 2>&1 &
+C_PID=$!
+
+sleep 60
+
+ps | grep ${C_PID} | grep -v grep
+
+if [ $? = 0 ]
+then
+    kill -9 ${C_PID}
+    echo "Test Failed"
+    exit 1
+else
+    echo "Test Passed"
+    exit 0
+fi
--- a/test/runtime/XCheckJniJsig/XCheckJSig.java	Thu Jan 14 20:45:31 2016 +0000
+++ b/test/runtime/XCheckJniJsig/XCheckJSig.java	Mon Feb 01 17:27:22 2016 -0800
@@ -36,8 +36,8 @@
     public static void main(String args[]) throws Throwable {
 
         System.out.println("Regression test for bugs 7051189 and 8023393");
-        if (!Platform.isSolaris() && !Platform.isLinux() && !Platform.isOSX()) {
-            System.out.println("Test only applicable on Solaris, Linux, and Mac OSX, skipping");
+        if (!Platform.isSolaris() && !Platform.isLinux() && !Platform.isOSX() && !Platform.isBSD()) {
+            System.out.println("Test only applicable on Solaris, Linux, BSD, and Mac OSX, skipping");
             return;
         }