# HG changeset patch # User kvn # Date 1372356739 25200 # Node ID be0600ec1102819bef708e3d7ef07d5b4fc8c4ee # Parent f8972b867dedb71ddf990a0484f08658a213913f# Parent 6a0ead6dc6db02b266767b5aa8e72c07a0e90085 Merge diff -r 6a0ead6dc6db -r be0600ec1102 make/bsd/makefiles/build_vm_def.sh --- a/make/bsd/makefiles/build_vm_def.sh Mon Jun 24 16:11:47 2013 +0200 +++ b/make/bsd/makefiles/build_vm_def.sh Thu Jun 27 11:12:19 2013 -0700 @@ -7,6 +7,6 @@ NM=nm fi -$NM --defined-only $* | awk ' - { if ($3 ~ /^_ZTV/ || $3 ~ /^gHotSpotVM/) print "\t" $3 ";" } +$NM -Uj $* | awk ' + { if ($3 ~ /^_ZTV/ || $3 ~ /^gHotSpotVM/) print "\t" $3 } ' diff -r 6a0ead6dc6db -r be0600ec1102 make/bsd/makefiles/gcc.make --- a/make/bsd/makefiles/gcc.make Mon Jun 24 16:11:47 2013 +0200 +++ b/make/bsd/makefiles/gcc.make Thu Jun 27 11:12:19 2013 -0700 @@ -1,5 +1,5 @@ # -# Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1999, 2013, 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 @@ -368,8 +368,8 @@ # Standard linker flags LFLAGS += - # Darwin doesn't use ELF and doesn't support version scripts - LDNOMAP = true + # The apple linker has its own variant of mapfiles/version-scripts + MAPFLAG = -Xlinker -exported_symbols_list -Xlinker FILENAME # Use $(SONAMEFLAG:SONAME=soname) to specify the intrinsic name of a shared obj SONAMEFLAG = diff -r 6a0ead6dc6db -r be0600ec1102 make/bsd/makefiles/mapfile-vers-debug --- a/make/bsd/makefiles/mapfile-vers-debug Mon Jun 24 16:11:47 2013 +0200 +++ b/make/bsd/makefiles/mapfile-vers-debug Thu Jun 27 11:12:19 2013 -0700 @@ -1,7 +1,3 @@ -# -# @(#)mapfile-vers-debug 1.18 07/10/25 16:47:35 -# - # # Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -23,273 +19,244 @@ # 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. - -SUNWprivate_1.1 { - global: - # JNI - JNI_CreateJavaVM; - JNI_GetCreatedJavaVMs; - JNI_GetDefaultJavaVMInitArgs; + # _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_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_GetClassTypeAnnotations; - JVM_GetComponentType; - JVM_GetDeclaredClasses; - JVM_GetDeclaringClass; - JVM_GetEnclosingMethodInfo; - JVM_GetFieldAnnotations; - JVM_GetFieldIxModifiers; - JVM_GetFieldTypeAnnotations; - 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_GetMethodParameters; - JVM_GetMethodTypeAnnotations; - JVM_GetPrimitiveArrayElement; - JVM_GetProtectionDomain; - JVM_GetSockName; - JVM_GetSockOpt; - JVM_GetStackAccessControlContext; - JVM_GetStackTraceDepth; - JVM_GetStackTraceElement; - JVM_GetSystemPackage; - JVM_GetSystemPackages; - 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_IsVMGeneratedMethodIx; - 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_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_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_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_GetClassTypeAnnotations + _JVM_GetComponentType + _JVM_GetDeclaredClasses + _JVM_GetDeclaringClass + _JVM_GetEnclosingMethodInfo + _JVM_GetFieldAnnotations + _JVM_GetFieldIxModifiers + _JVM_GetFieldTypeAnnotations + _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_GetMethodParameters + _JVM_GetMethodTypeAnnotations + _JVM_GetPrimitiveArrayElement + _JVM_GetProtectionDomain + _JVM_GetSockName + _JVM_GetSockOpt + _JVM_GetStackAccessControlContext + _JVM_GetStackTraceDepth + _JVM_GetStackTraceElement + _JVM_GetSystemPackage + _JVM_GetSystemPackages + _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_IsVMGeneratedMethodIx + _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_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 - # Old reflection routines - # These do not need to be present in the product build in JDK 1.4 - # but their code has not been removed yet because there will not - # be a substantial code savings until JVM_InvokeMethod and - # JVM_NewInstanceFromConstructor can also be removed; see - # reflectionCompat.hpp. - JVM_GetClassConstructor; - JVM_GetClassConstructors; - JVM_GetClassField; - JVM_GetClassFields; - JVM_GetClassMethod; - JVM_GetClassMethods; - JVM_GetField; - JVM_GetPrimitiveField; - JVM_NewInstance; - JVM_SetField; - JVM_SetPrimitiveField; - - # debug JVM - JVM_AccessVMBooleanFlag; - JVM_AccessVMIntFlag; - JVM_VMBreakPoint; + # debug _JVM + _JVM_AccessVMBooleanFlag + _JVM_AccessVMIntFlag + _JVM_VMBreakPoint # miscellaneous functions - 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; + _jio_fprintf + _jio_printf + _jio_snprintf + _jio_vfprintf + _jio_vsnprintf # This is for Forte Analyzer profiling support. - AsyncGetCallTrace; + _AsyncGetCallTrace # INSERT VTABLE SYMBOLS HERE - local: - *; -}; - diff -r 6a0ead6dc6db -r be0600ec1102 make/bsd/makefiles/mapfile-vers-product --- a/make/bsd/makefiles/mapfile-vers-product Mon Jun 24 16:11:47 2013 +0200 +++ b/make/bsd/makefiles/mapfile-vers-product Thu Jun 27 11:12:19 2013 -0700 @@ -1,7 +1,3 @@ -# -# @(#)mapfile-vers-product 1.19 08/02/12 10:56:37 -# - # # Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -23,268 +19,239 @@ # 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. - -SUNWprivate_1.1 { - global: - # JNI - JNI_CreateJavaVM; - JNI_GetCreatedJavaVMs; - JNI_GetDefaultJavaVMInitArgs; + # _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_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_GetClassTypeAnnotations; - JVM_GetComponentType; - JVM_GetDeclaredClasses; - JVM_GetDeclaringClass; - JVM_GetEnclosingMethodInfo; - JVM_GetFieldAnnotations; - JVM_GetFieldIxModifiers; - JVM_GetFieldTypeAnnotations; - 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_GetMethodParameters; - JVM_GetMethodTypeAnnotations; - JVM_GetPrimitiveArrayElement; - JVM_GetProtectionDomain; - JVM_GetSockName; - JVM_GetSockOpt; - JVM_GetStackAccessControlContext; - JVM_GetStackTraceDepth; - JVM_GetStackTraceElement; - JVM_GetSystemPackage; - JVM_GetSystemPackages; - 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_IsVMGeneratedMethodIx; - 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_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_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; - - # Old reflection routines - # These do not need to be present in the product build in JDK 1.4 - # but their code has not been removed yet because there will not - # be a substantial code savings until JVM_InvokeMethod and - # JVM_NewInstanceFromConstructor can also be removed; see - # reflectionCompat.hpp. - JVM_GetClassConstructor; - JVM_GetClassConstructors; - JVM_GetClassField; - JVM_GetClassFields; - JVM_GetClassMethod; - JVM_GetClassMethods; - JVM_GetField; - JVM_GetPrimitiveField; - JVM_NewInstance; - JVM_SetField; - JVM_SetPrimitiveField; + # _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_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_GetClassTypeAnnotations + _JVM_GetComponentType + _JVM_GetDeclaredClasses + _JVM_GetDeclaringClass + _JVM_GetEnclosingMethodInfo + _JVM_GetFieldAnnotations + _JVM_GetFieldIxModifiers + _JVM_GetFieldTypeAnnotations + _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_GetMethodParameters + _JVM_GetMethodTypeAnnotations + _JVM_GetPrimitiveArrayElement + _JVM_GetProtectionDomain + _JVM_GetSockName + _JVM_GetSockOpt + _JVM_GetStackAccessControlContext + _JVM_GetStackTraceDepth + _JVM_GetStackTraceElement + _JVM_GetSystemPackage + _JVM_GetSystemPackages + _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_IsVMGeneratedMethodIx + _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_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; - fork1; - numa_warn; - numa_error; - - # Needed because there is no JVM interface for this. - sysThreadAvailableStackWithSlack; + _jio_fprintf + _jio_printf + _jio_snprintf + _jio_vfprintf + _jio_vsnprintf # This is for Forte Analyzer profiling support. - AsyncGetCallTrace; - - # INSERT VTABLE SYMBOLS HERE + _AsyncGetCallTrace - local: - *; -}; + # INSERT VTABLE SYMBOLS HERE diff -r 6a0ead6dc6db -r be0600ec1102 make/excludeSrc.make --- a/make/excludeSrc.make Mon Jun 24 16:11:47 2013 +0200 +++ b/make/excludeSrc.make Thu Jun 27 11:12:19 2013 -0700 @@ -112,3 +112,5 @@ endif -include $(HS_ALT_MAKE)/excludeSrc.make + +.PHONY: $(HS_ALT_MAKE)/excludeSrc.make diff -r 6a0ead6dc6db -r be0600ec1102 make/linux/makefiles/vm.make --- a/make/linux/makefiles/vm.make Mon Jun 24 16:11:47 2013 +0200 +++ b/make/linux/makefiles/vm.make Thu Jun 27 11:12:19 2013 -0700 @@ -107,6 +107,10 @@ # File specific flags CXXFLAGS += $(CXXFLAGS/BYFILE) +# Large File Support +ifneq ($(LP64), 1) +CXXFLAGS/ostream.o += -D_FILE_OFFSET_BITS=64 +endif # ifneq ($(LP64), 1) # CFLAGS_WARN holds compiler options to suppress/enable warnings. CFLAGS += $(CFLAGS_WARN/BYFILE) diff -r 6a0ead6dc6db -r be0600ec1102 make/solaris/makefiles/vm.make --- a/make/solaris/makefiles/vm.make Mon Jun 24 16:11:47 2013 +0200 +++ b/make/solaris/makefiles/vm.make Thu Jun 27 11:12:19 2013 -0700 @@ -95,6 +95,10 @@ # File specific flags CXXFLAGS += $(CXXFLAGS/BYFILE) +# Large File Support +ifneq ($(LP64), 1) +CXXFLAGS/ostream.o += -D_FILE_OFFSET_BITS=64 +endif # ifneq ($(LP64), 1) # CFLAGS_WARN holds compiler options to suppress/enable warnings. CFLAGS += $(CFLAGS_WARN) diff -r 6a0ead6dc6db -r be0600ec1102 src/cpu/sparc/vm/frame_sparc.cpp --- a/src/cpu/sparc/vm/frame_sparc.cpp Mon Jun 24 16:11:47 2013 +0200 +++ b/src/cpu/sparc/vm/frame_sparc.cpp Thu Jun 27 11:12:19 2013 -0700 @@ -680,7 +680,7 @@ // validate ConstantPoolCache* ConstantPoolCache* cp = *interpreter_frame_cache_addr(); - if (cp == NULL || !cp->is_metadata()) return false; + if (cp == NULL || !cp->is_metaspace_object()) return false; // validate locals diff -r 6a0ead6dc6db -r be0600ec1102 src/cpu/x86/vm/frame_x86.cpp --- a/src/cpu/x86/vm/frame_x86.cpp Mon Jun 24 16:11:47 2013 +0200 +++ b/src/cpu/x86/vm/frame_x86.cpp Thu Jun 27 11:12:19 2013 -0700 @@ -587,7 +587,7 @@ // validate ConstantPoolCache* ConstantPoolCache* cp = *interpreter_frame_cache_addr(); - if (cp == NULL || !cp->is_metadata()) return false; + if (cp == NULL || !cp->is_metaspace_object()) return false; // validate locals diff -r 6a0ead6dc6db -r be0600ec1102 src/os/solaris/vm/os_solaris.inline.hpp --- a/src/os/solaris/vm/os_solaris.inline.hpp Mon Jun 24 16:11:47 2013 +0200 +++ b/src/os/solaris/vm/os_solaris.inline.hpp Thu Jun 27 11:12:19 2013 -0700 @@ -89,7 +89,7 @@ inline struct dirent* os::readdir(DIR* dirp, dirent* dbuf) { assert(dirp != NULL, "just checking"); -#if defined(_LP64) || defined(_GNU_SOURCE) +#if defined(_LP64) || defined(_GNU_SOURCE) || _FILE_OFFSET_BITS==64 dirent* p; int status; @@ -98,9 +98,9 @@ return NULL; } else return p; -#else // defined(_LP64) || defined(_GNU_SOURCE) +#else // defined(_LP64) || defined(_GNU_SOURCE) || _FILE_OFFSET_BITS==64 return ::readdir_r(dirp, dbuf); -#endif // defined(_LP64) || defined(_GNU_SOURCE) +#endif // defined(_LP64) || defined(_GNU_SOURCE) || _FILE_OFFSET_BITS==64 } inline int os::closedir(DIR *dirp) { diff -r 6a0ead6dc6db -r be0600ec1102 src/os_cpu/linux_x86/vm/os_linux_x86.cpp --- a/src/os_cpu/linux_x86/vm/os_linux_x86.cpp Mon Jun 24 16:11:47 2013 +0200 +++ b/src/os_cpu/linux_x86/vm/os_linux_x86.cpp Thu Jun 27 11:12:19 2013 -0700 @@ -289,6 +289,16 @@ } #endif // AMD64 +#ifndef AMD64 + // Halt if SI_KERNEL before more crashes get misdiagnosed as Java bugs + // This can happen in any running code (currently more frequently in + // interpreter code but has been seen in compiled code) + if (sig == SIGSEGV && info->si_addr == 0 && info->si_code == SI_KERNEL) { + fatal("An irrecoverable SI_KERNEL SIGSEGV has occurred due " + "to unstable signal handling in this distribution."); + } +#endif // AMD64 + // Handle ALL stack overflow variations here if (sig == SIGSEGV) { address addr = (address) info->si_addr; diff -r 6a0ead6dc6db -r be0600ec1102 src/share/vm/ci/ciObjectFactory.cpp --- a/src/share/vm/ci/ciObjectFactory.cpp Mon Jun 24 16:11:47 2013 +0200 +++ b/src/share/vm/ci/ciObjectFactory.cpp Thu Jun 27 11:12:19 2013 -0700 @@ -265,8 +265,6 @@ ciMetadata* ciObjectFactory::get_metadata(Metadata* key) { ASSERT_IN_VM; - assert(key == NULL || key->is_metadata(), "must be"); - #ifdef ASSERT if (CIObjectFactoryVerify) { Metadata* last = NULL; diff -r 6a0ead6dc6db -r be0600ec1102 src/share/vm/classfile/dictionary.cpp --- a/src/share/vm/classfile/dictionary.cpp Mon Jun 24 16:11:47 2013 +0200 +++ b/src/share/vm/classfile/dictionary.cpp Thu Jun 27 11:12:19 2013 -0700 @@ -555,7 +555,7 @@ loader_data->class_loader() == NULL || loader_data->class_loader()->is_instance(), "checking type of class_loader"); - e->verify(); + e->verify(/*check_dictionary*/false); probe->verify_protection_domain_set(); element_count++; } diff -r 6a0ead6dc6db -r be0600ec1102 src/share/vm/code/debugInfo.hpp --- a/src/share/vm/code/debugInfo.hpp Mon Jun 24 16:11:47 2013 +0200 +++ b/src/share/vm/code/debugInfo.hpp Thu Jun 27 11:12:19 2013 -0700 @@ -274,7 +274,7 @@ Method* read_method() { Method* o = (Method*)(code()->metadata_at(read_int())); assert(o == NULL || - o->is_metadata(), "meta data only"); + o->is_metaspace_object(), "meta data only"); return o; } ScopeValue* read_object_value(); diff -r 6a0ead6dc6db -r be0600ec1102 src/share/vm/code/dependencies.cpp --- a/src/share/vm/code/dependencies.cpp Mon Jun 24 16:11:47 2013 +0200 +++ b/src/share/vm/code/dependencies.cpp Thu Jun 27 11:12:19 2013 -0700 @@ -655,8 +655,8 @@ } else { o = _deps->oop_recorder()->metadata_at(i); } - assert(o == NULL || o->is_metadata(), - err_msg("Should be perm " PTR_FORMAT, o)); + assert(o == NULL || o->is_metaspace_object(), + err_msg("Should be metadata " PTR_FORMAT, o)); return o; } diff -r 6a0ead6dc6db -r be0600ec1102 src/share/vm/gc_implementation/g1/heapRegion.cpp --- a/src/share/vm/gc_implementation/g1/heapRegion.cpp Mon Jun 24 16:11:47 2013 +0200 +++ b/src/share/vm/gc_implementation/g1/heapRegion.cpp Thu Jun 27 11:12:19 2013 -0700 @@ -798,7 +798,7 @@ if (!g1->is_obj_dead_cond(obj, this, vo)) { if (obj->is_oop()) { Klass* klass = obj->klass(); - if (!klass->is_metadata()) { + if (!klass->is_metaspace_object()) { gclog_or_tty->print_cr("klass "PTR_FORMAT" of object "PTR_FORMAT" " "not metadata", klass, obj); *failures = true; diff -r 6a0ead6dc6db -r be0600ec1102 src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.cpp --- a/src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.cpp Mon Jun 24 16:11:47 2013 +0200 +++ b/src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.cpp Thu Jun 27 11:12:19 2013 -0700 @@ -70,6 +70,17 @@ _virtual_space = vs; } +void ASPSOldGen::initialize_work(const char* perf_data_name, int level) { + + PSOldGen::initialize_work(perf_data_name, level); + + // The old gen can grow to gen_size_limit(). _reserve reflects only + // the current maximum that can be committed. + assert(_reserved.byte_size() <= gen_size_limit(), "Consistency check"); + + initialize_performance_counters(perf_data_name, level); +} + void ASPSOldGen::reset_after_change() { _reserved = MemRegion((HeapWord*)virtual_space()->low_boundary(), (HeapWord*)virtual_space()->high_boundary()); diff -r 6a0ead6dc6db -r be0600ec1102 src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.hpp --- a/src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.hpp Mon Jun 24 16:11:47 2013 +0200 +++ b/src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.hpp Thu Jun 27 11:12:19 2013 -0700 @@ -50,6 +50,8 @@ size_t max_gen_size() { return _reserved.byte_size(); } void set_gen_size_limit(size_t v) { _gen_size_limit = v; } + virtual void initialize_work(const char* perf_data_name, int level); + // After a shrink or expand reset the generation void reset_after_change(); diff -r 6a0ead6dc6db -r be0600ec1102 src/share/vm/gc_implementation/parallelScavenge/psOldGen.hpp --- a/src/share/vm/gc_implementation/parallelScavenge/psOldGen.hpp Mon Jun 24 16:11:47 2013 +0200 +++ b/src/share/vm/gc_implementation/parallelScavenge/psOldGen.hpp Thu Jun 27 11:12:19 2013 -0700 @@ -110,7 +110,7 @@ virtual void initialize(ReservedSpace rs, size_t alignment, const char* perf_data_name, int level); void initialize_virtual_space(ReservedSpace rs, size_t alignment); - void initialize_work(const char* perf_data_name, int level); + virtual void initialize_work(const char* perf_data_name, int level); virtual void initialize_performance_counters(const char* perf_data_name, int level); MemRegion reserved() const { return _reserved; } diff -r 6a0ead6dc6db -r be0600ec1102 src/share/vm/memory/allocation.cpp --- a/src/share/vm/memory/allocation.cpp Mon Jun 24 16:11:47 2013 +0200 +++ b/src/share/vm/memory/allocation.cpp Thu Jun 27 11:12:19 2013 -0700 @@ -71,13 +71,6 @@ return MetaspaceShared::is_in_shared_space(this); } -bool MetaspaceObj::is_metadata() const { - // GC Verify checks use this in guarantees. - // TODO: either replace them with is_metaspace_object() or remove them. - // is_metaspace_object() is slower than this test. This test doesn't - // seem very useful for metaspace objects anymore though. - return !Universe::heap()->is_in_reserved(this); -} bool MetaspaceObj::is_metaspace_object() const { return Metaspace::contains((void*)this); diff -r 6a0ead6dc6db -r be0600ec1102 src/share/vm/memory/allocation.hpp --- a/src/share/vm/memory/allocation.hpp Mon Jun 24 16:11:47 2013 +0200 +++ b/src/share/vm/memory/allocation.hpp Thu Jun 27 11:12:19 2013 -0700 @@ -264,7 +264,6 @@ class MetaspaceObj { public: - bool is_metadata() const; bool is_metaspace_object() const; // more specific test but slower bool is_shared() const; void print_address_on(outputStream* st) const; // nonvirtual address printing diff -r 6a0ead6dc6db -r be0600ec1102 src/share/vm/memory/heapInspection.cpp --- a/src/share/vm/memory/heapInspection.cpp Mon Jun 24 16:11:47 2013 +0200 +++ b/src/share/vm/memory/heapInspection.cpp Thu Jun 27 11:12:19 2013 -0700 @@ -157,7 +157,6 @@ } uint KlassInfoTable::hash(const Klass* p) { - assert(p->is_metadata(), "all klasses are metadata"); return (uint)(((uintptr_t)p - (uintptr_t)_ref) >> 2); } diff -r 6a0ead6dc6db -r be0600ec1102 src/share/vm/memory/metaspace.cpp --- a/src/share/vm/memory/metaspace.cpp Mon Jun 24 16:11:47 2013 +0200 +++ b/src/share/vm/memory/metaspace.cpp Thu Jun 27 11:12:19 2013 -0700 @@ -1556,19 +1556,7 @@ // ChunkManager methods -// Verification of _free_chunks_total and _free_chunks_count does not -// work with the CMS collector because its use of additional locks -// complicate the mutex deadlock detection but it can still be useful -// for detecting errors in the chunk accounting with other collectors. - size_t ChunkManager::free_chunks_total() { -#ifdef ASSERT - if (!UseConcMarkSweepGC && !SpaceManager::expand_lock()->is_locked()) { - MutexLockerEx cl(SpaceManager::expand_lock(), - Mutex::_no_safepoint_check_flag); - slow_locked_verify_free_chunks_total(); - } -#endif return _free_chunks_total; } @@ -2608,14 +2596,14 @@ "->" SIZE_FORMAT "(" SIZE_FORMAT ")", prev_metadata_used, - allocated_capacity_bytes(), + allocated_used_bytes(), reserved_in_bytes()); } else { gclog_or_tty->print(" " SIZE_FORMAT "K" "->" SIZE_FORMAT "K" "(" SIZE_FORMAT "K)", prev_metadata_used / K, - allocated_capacity_bytes() / K, + allocated_used_bytes() / K, reserved_in_bytes()/ K); } diff -r 6a0ead6dc6db -r be0600ec1102 src/share/vm/memory/universe.cpp --- a/src/share/vm/memory/universe.cpp Mon Jun 24 16:11:47 2013 +0200 +++ b/src/share/vm/memory/universe.cpp Thu Jun 27 11:12:19 2013 -0700 @@ -1127,6 +1127,7 @@ // Initialize performance counters for metaspaces MetaspaceCounters::initialize_performance_counters(); + MemoryService::add_metaspace_memory_pools(); GC_locker::unlock(); // allow gc after bootstrapping diff -r 6a0ead6dc6db -r be0600ec1102 src/share/vm/oops/arrayKlass.cpp --- a/src/share/vm/oops/arrayKlass.cpp Mon Jun 24 16:11:47 2013 +0200 +++ b/src/share/vm/oops/arrayKlass.cpp Thu Jun 27 11:12:19 2013 -0700 @@ -221,8 +221,8 @@ // Verification -void ArrayKlass::verify_on(outputStream* st) { - Klass::verify_on(st); +void ArrayKlass::verify_on(outputStream* st, bool check_dictionary) { + Klass::verify_on(st, check_dictionary); if (component_mirror() != NULL) { guarantee(component_mirror()->klass() != NULL, "should have a class"); diff -r 6a0ead6dc6db -r be0600ec1102 src/share/vm/oops/arrayKlass.hpp --- a/src/share/vm/oops/arrayKlass.hpp Mon Jun 24 16:11:47 2013 +0200 +++ b/src/share/vm/oops/arrayKlass.hpp Thu Jun 27 11:12:19 2013 -0700 @@ -152,7 +152,7 @@ void oop_print_on(oop obj, outputStream* st); // Verification - void verify_on(outputStream* st); + void verify_on(outputStream* st, bool check_dictionary); void oop_verify_on(oop obj, outputStream* st); }; diff -r 6a0ead6dc6db -r be0600ec1102 src/share/vm/oops/compiledICHolder.cpp --- a/src/share/vm/oops/compiledICHolder.cpp Mon Jun 24 16:11:47 2013 +0200 +++ b/src/share/vm/oops/compiledICHolder.cpp Thu Jun 27 11:12:19 2013 -0700 @@ -48,8 +48,6 @@ // Verification void CompiledICHolder::verify_on(outputStream* st) { - guarantee(holder_method()->is_metadata(), "should be in metaspace"); guarantee(holder_method()->is_method(), "should be method"); - guarantee(holder_klass()->is_metadata(), "should be in metaspace"); guarantee(holder_klass()->is_klass(), "should be klass"); } diff -r 6a0ead6dc6db -r be0600ec1102 src/share/vm/oops/constMethod.cpp --- a/src/share/vm/oops/constMethod.cpp Mon Jun 24 16:11:47 2013 +0200 +++ b/src/share/vm/oops/constMethod.cpp Thu Jun 27 11:12:19 2013 -0700 @@ -440,7 +440,6 @@ void ConstMethod::verify_on(outputStream* st) { guarantee(is_constMethod(), "object must be constMethod"); - guarantee(is_metadata(), err_msg("Should be metadata " PTR_FORMAT, this)); // Verification can occur during oop construction before the method or // other fields have been initialized. diff -r 6a0ead6dc6db -r be0600ec1102 src/share/vm/oops/constantPool.cpp --- a/src/share/vm/oops/constantPool.cpp Mon Jun 24 16:11:47 2013 +0200 +++ b/src/share/vm/oops/constantPool.cpp Thu Jun 27 11:12:19 2013 -0700 @@ -2095,12 +2095,10 @@ CPSlot entry = slot_at(i); if (tag.is_klass()) { if (entry.is_resolved()) { - guarantee(entry.get_klass()->is_metadata(), "should be metadata"); guarantee(entry.get_klass()->is_klass(), "should be klass"); } } else if (tag.is_unresolved_klass()) { if (entry.is_resolved()) { - guarantee(entry.get_klass()->is_metadata(), "should be metadata"); guarantee(entry.get_klass()->is_klass(), "should be klass"); } } else if (tag.is_symbol()) { @@ -2112,13 +2110,11 @@ if (cache() != NULL) { // Note: cache() can be NULL before a class is completely setup or // in temporary constant pools used during constant pool merging - guarantee(cache()->is_metadata(), "should be metadata"); guarantee(cache()->is_constantPoolCache(), "should be constant pool cache"); } if (pool_holder() != NULL) { // Note: pool_holder() can be NULL in temporary constant pools // used during constant pool merging - guarantee(pool_holder()->is_metadata(), "should be metadata"); guarantee(pool_holder()->is_klass(), "should be klass"); } } diff -r 6a0ead6dc6db -r be0600ec1102 src/share/vm/oops/instanceKlass.cpp --- a/src/share/vm/oops/instanceKlass.cpp Mon Jun 24 16:11:47 2013 +0200 +++ b/src/share/vm/oops/instanceKlass.cpp Thu Jun 27 11:12:19 2013 -0700 @@ -3088,27 +3088,26 @@ virtual void do_oop(narrowOop* p) { VerifyFieldClosure::do_oop_work(p); } }; -void InstanceKlass::verify_on(outputStream* st) { - Klass::verify_on(st); - Thread *thread = Thread::current(); - +void InstanceKlass::verify_on(outputStream* st, bool check_dictionary) { #ifndef PRODUCT - // Avoid redundant verifies + // Avoid redundant verifies, this really should be in product. if (_verify_count == Universe::verify_count()) return; _verify_count = Universe::verify_count(); #endif - // Verify that klass is present in SystemDictionary - if (is_loaded() && !is_anonymous()) { + + // Verify Klass + Klass::verify_on(st, check_dictionary); + + // Verify that klass is present in SystemDictionary if not already + // verifying the SystemDictionary. + if (is_loaded() && !is_anonymous() && check_dictionary) { Symbol* h_name = name(); SystemDictionary::verify_obj_klass_present(h_name, class_loader_data()); } - // Verify static fields - VerifyFieldClosure blk; - // Verify vtables if (is_linked()) { - ResourceMark rm(thread); + ResourceMark rm; // $$$ This used to be done only for m/s collections. Doing it // always seemed a valid generalization. (DLD -- 6/00) vtable()->verify(st); @@ -3116,7 +3115,6 @@ // Verify first subklass if (subklass_oop() != NULL) { - guarantee(subklass_oop()->is_metadata(), "should be in metaspace"); guarantee(subklass_oop()->is_klass(), "should be klass"); } @@ -3128,7 +3126,6 @@ fatal(err_msg("subclass points to itself " PTR_FORMAT, sib)); } - guarantee(sib->is_metadata(), "should be in metaspace"); guarantee(sib->is_klass(), "should be klass"); guarantee(sib->super() == super, "siblings should have same superklass"); } @@ -3164,7 +3161,6 @@ if (methods() != NULL) { Array* methods = this->methods(); for (int j = 0; j < methods->length(); j++) { - guarantee(methods->at(j)->is_metadata(), "should be in metaspace"); guarantee(methods->at(j)->is_method(), "non-method in methods array"); } for (int j = 0; j < methods->length() - 1; j++) { @@ -3202,16 +3198,13 @@ // Verify other fields if (array_klasses() != NULL) { - guarantee(array_klasses()->is_metadata(), "should be in metaspace"); guarantee(array_klasses()->is_klass(), "should be klass"); } if (constants() != NULL) { - guarantee(constants()->is_metadata(), "should be in metaspace"); guarantee(constants()->is_constantPool(), "should be constant pool"); } const Klass* host = host_klass(); if (host != NULL) { - guarantee(host->is_metadata(), "should be in metaspace"); guarantee(host->is_klass(), "should be klass"); } } diff -r 6a0ead6dc6db -r be0600ec1102 src/share/vm/oops/instanceKlass.hpp --- a/src/share/vm/oops/instanceKlass.hpp Mon Jun 24 16:11:47 2013 +0200 +++ b/src/share/vm/oops/instanceKlass.hpp Thu Jun 27 11:12:19 2013 -0700 @@ -1050,7 +1050,7 @@ const char* internal_name() const; // Verification - void verify_on(outputStream* st); + void verify_on(outputStream* st, bool check_dictionary); void oop_verify_on(oop obj, outputStream* st); }; diff -r 6a0ead6dc6db -r be0600ec1102 src/share/vm/oops/klass.cpp --- a/src/share/vm/oops/klass.cpp Mon Jun 24 16:11:47 2013 +0200 +++ b/src/share/vm/oops/klass.cpp Thu Jun 27 11:12:19 2013 -0700 @@ -377,7 +377,6 @@ } bool Klass::is_loader_alive(BoolObjectClosure* is_alive) { - assert(is_metadata(), "p is not meta-data"); assert(ClassLoaderDataGraph::contains((address)this), "is in the metaspace"); #ifdef ASSERT @@ -648,27 +647,24 @@ // Verification -void Klass::verify_on(outputStream* st) { - guarantee(!Universe::heap()->is_in_reserved(this), "Shouldn't be"); - guarantee(this->is_metadata(), "should be in metaspace"); +void Klass::verify_on(outputStream* st, bool check_dictionary) { + // This can be expensive, but it is worth checking that this klass is actually + // in the CLD graph but not in production. assert(ClassLoaderDataGraph::contains((address)this), "Should be"); guarantee(this->is_klass(),"should be klass"); if (super() != NULL) { - guarantee(super()->is_metadata(), "should be in metaspace"); guarantee(super()->is_klass(), "should be klass"); } if (secondary_super_cache() != NULL) { Klass* ko = secondary_super_cache(); - guarantee(ko->is_metadata(), "should be in metaspace"); guarantee(ko->is_klass(), "should be klass"); } for ( uint i = 0; i < primary_super_limit(); i++ ) { Klass* ko = _primary_supers[i]; if (ko != NULL) { - guarantee(ko->is_metadata(), "should be in metaspace"); guarantee(ko->is_klass(), "should be klass"); } } @@ -680,7 +676,6 @@ void Klass::oop_verify_on(oop obj, outputStream* st) { guarantee(obj->is_oop(), "should be oop"); - guarantee(obj->klass()->is_metadata(), "should not be in Java heap"); guarantee(obj->klass()->is_klass(), "klass field is not a klass"); } diff -r 6a0ead6dc6db -r be0600ec1102 src/share/vm/oops/klass.hpp --- a/src/share/vm/oops/klass.hpp Mon Jun 24 16:11:47 2013 +0200 +++ b/src/share/vm/oops/klass.hpp Thu Jun 27 11:12:19 2013 -0700 @@ -703,8 +703,8 @@ virtual const char* internal_name() const = 0; // Verification - virtual void verify_on(outputStream* st); - void verify() { verify_on(tty); } + virtual void verify_on(outputStream* st, bool check_dictionary); + void verify(bool check_dictionary = true) { verify_on(tty, check_dictionary); } #ifndef PRODUCT void verify_vtable_index(int index); diff -r 6a0ead6dc6db -r be0600ec1102 src/share/vm/oops/method.cpp --- a/src/share/vm/oops/method.cpp Mon Jun 24 16:11:47 2013 +0200 +++ b/src/share/vm/oops/method.cpp Thu Jun 27 11:12:19 2013 -0700 @@ -1969,14 +1969,9 @@ void Method::verify_on(outputStream* st) { guarantee(is_method(), "object must be method"); - guarantee(is_metadata(), "should be metadata"); guarantee(constants()->is_constantPool(), "should be constant pool"); - guarantee(constants()->is_metadata(), "should be metadata"); guarantee(constMethod()->is_constMethod(), "should be ConstMethod*"); - guarantee(constMethod()->is_metadata(), "should be metadata"); MethodData* md = method_data(); guarantee(md == NULL || - md->is_metadata(), "should be metadata"); - guarantee(md == NULL || md->is_methodData(), "should be method data"); } diff -r 6a0ead6dc6db -r be0600ec1102 src/share/vm/oops/objArrayKlass.cpp --- a/src/share/vm/oops/objArrayKlass.cpp Mon Jun 24 16:11:47 2013 +0200 +++ b/src/share/vm/oops/objArrayKlass.cpp Thu Jun 27 11:12:19 2013 -0700 @@ -676,11 +676,9 @@ // Verification -void ObjArrayKlass::verify_on(outputStream* st) { - ArrayKlass::verify_on(st); - guarantee(element_klass()->is_metadata(), "should be in metaspace"); +void ObjArrayKlass::verify_on(outputStream* st, bool check_dictionary) { + ArrayKlass::verify_on(st, check_dictionary); guarantee(element_klass()->is_klass(), "should be klass"); - guarantee(bottom_klass()->is_metadata(), "should be in metaspace"); guarantee(bottom_klass()->is_klass(), "should be klass"); Klass* bk = bottom_klass(); guarantee(bk->oop_is_instance() || bk->oop_is_typeArray(), "invalid bottom klass"); diff -r 6a0ead6dc6db -r be0600ec1102 src/share/vm/oops/objArrayKlass.hpp --- a/src/share/vm/oops/objArrayKlass.hpp Mon Jun 24 16:11:47 2013 +0200 +++ b/src/share/vm/oops/objArrayKlass.hpp Thu Jun 27 11:12:19 2013 -0700 @@ -151,7 +151,7 @@ const char* internal_name() const; // Verification - void verify_on(outputStream* st); + void verify_on(outputStream* st, bool check_dictionary); void oop_verify_on(oop obj, outputStream* st); }; diff -r 6a0ead6dc6db -r be0600ec1102 src/share/vm/oops/symbol.cpp --- a/src/share/vm/oops/symbol.cpp Mon Jun 24 16:11:47 2013 +0200 +++ b/src/share/vm/oops/symbol.cpp Thu Jun 27 11:12:19 2013 -0700 @@ -32,7 +32,9 @@ #include "memory/allocation.inline.hpp" #include "memory/resourceArea.hpp" -Symbol::Symbol(const u1* name, int length, int refcount) : _refcount(refcount), _length(length) { +Symbol::Symbol(const u1* name, int length, int refcount) { + _refcount = refcount; + _length = length; _identity_hash = os::random(); for (int i = 0; i < _length; i++) { byte_at_put(i, name[i]); diff -r 6a0ead6dc6db -r be0600ec1102 src/share/vm/oops/symbol.hpp --- a/src/share/vm/oops/symbol.hpp Mon Jun 24 16:11:47 2013 +0200 +++ b/src/share/vm/oops/symbol.hpp Thu Jun 27 11:12:19 2013 -0700 @@ -27,6 +27,7 @@ #include "utilities/utf8.hpp" #include "memory/allocation.hpp" +#include "runtime/atomic.hpp" // A Symbol is a canonicalized string. // All Symbols reside in global SymbolTable and are reference counted. @@ -101,14 +102,22 @@ // type without virtual functions. class ClassLoaderData; -class Symbol : public MetaspaceObj { +// We separate the fields in SymbolBase from Symbol::_body so that +// Symbol::size(int) can correctly calculate the space needed. +class SymbolBase : public MetaspaceObj { + public: + ATOMIC_SHORT_PAIR( + volatile short _refcount, // needs atomic operation + unsigned short _length // number of UTF8 characters in the symbol (does not need atomic op) + ); + int _identity_hash; +}; + +class Symbol : private SymbolBase { friend class VMStructs; friend class SymbolTable; friend class MoveSymbols; private: - volatile int _refcount; - int _identity_hash; - unsigned short _length; // number of UTF8 characters in the symbol jbyte _body[1]; enum { @@ -117,7 +126,7 @@ }; static int size(int length) { - size_t sz = heap_word_size(sizeof(Symbol) + (length > 0 ? length - 1 : 0)); + size_t sz = heap_word_size(sizeof(SymbolBase) + (length > 0 ? length : 0)); return align_object_size(sz); } diff -r 6a0ead6dc6db -r be0600ec1102 src/share/vm/runtime/atomic.cpp --- a/src/share/vm/runtime/atomic.cpp Mon Jun 24 16:11:47 2013 +0200 +++ b/src/share/vm/runtime/atomic.cpp Thu Jun 27 11:12:19 2013 -0700 @@ -80,3 +80,32 @@ } return old; } + +void Atomic::inc(volatile short* dest) { + // Most platforms do not support atomic increment on a 2-byte value. However, + // if the value occupies the most significant 16 bits of an aligned 32-bit + // word, then we can do this with an atomic add of 0x10000 to the 32-bit word. + // + // The least significant parts of this 32-bit word will never be affected, even + // in case of overflow/underflow. + // + // Use the ATOMIC_SHORT_PAIR macro to get the desired alignment. +#ifdef VM_LITTLE_ENDIAN + assert((intx(dest) & 0x03) == 0x02, "wrong alignment"); + (void)Atomic::add(0x10000, (volatile int*)(dest-1)); +#else + assert((intx(dest) & 0x03) == 0x00, "wrong alignment"); + (void)Atomic::add(0x10000, (volatile int*)(dest)); +#endif +} + +void Atomic::dec(volatile short* dest) { +#ifdef VM_LITTLE_ENDIAN + assert((intx(dest) & 0x03) == 0x02, "wrong alignment"); + (void)Atomic::add(-0x10000, (volatile int*)(dest-1)); +#else + assert((intx(dest) & 0x03) == 0x00, "wrong alignment"); + (void)Atomic::add(-0x10000, (volatile int*)(dest)); +#endif +} + diff -r 6a0ead6dc6db -r be0600ec1102 src/share/vm/runtime/atomic.hpp --- a/src/share/vm/runtime/atomic.hpp Mon Jun 24 16:11:47 2013 +0200 +++ b/src/share/vm/runtime/atomic.hpp Thu Jun 27 11:12:19 2013 -0700 @@ -64,11 +64,13 @@ // Atomically increment location inline static void inc (volatile jint* dest); + static void inc (volatile jshort* dest); inline static void inc_ptr(volatile intptr_t* dest); inline static void inc_ptr(volatile void* dest); // Atomically decrement a location inline static void dec (volatile jint* dest); + static void dec (volatile jshort* dest); inline static void dec_ptr(volatile intptr_t* dest); inline static void dec_ptr(volatile void* dest); @@ -95,4 +97,24 @@ inline static void* cmpxchg_ptr(void* exchange_value, volatile void* dest, void* compare_value); }; +// To use Atomic::inc(jshort* dest) and Atomic::dec(jshort* dest), the address must be specially +// aligned, such that (*dest) occupies the upper 16 bits of an aligned 32-bit word. The best way to +// achieve is to place your short value next to another short value, which doesn't need atomic ops. +// +// Example +// ATOMIC_SHORT_PAIR( +// volatile short _refcount, // needs atomic operation +// unsigned short _length // number of UTF8 characters in the symbol (does not need atomic op) +// ); + +#ifdef VM_LITTLE_ENDIAN +#define ATOMIC_SHORT_PAIR(atomic_decl, non_atomic_decl) \ + non_atomic_decl; \ + atomic_decl +#else +#define ATOMIC_SHORT_PAIR(atomic_decl, non_atomic_decl) \ + atomic_decl ; \ + non_atomic_decl +#endif + #endif // SHARE_VM_RUNTIME_ATOMIC_HPP diff -r 6a0ead6dc6db -r be0600ec1102 src/share/vm/runtime/frame.cpp --- a/src/share/vm/runtime/frame.cpp Mon Jun 24 16:11:47 2013 +0200 +++ b/src/share/vm/runtime/frame.cpp Thu Jun 27 11:12:19 2013 -0700 @@ -387,7 +387,6 @@ Method* frame::interpreter_frame_method() const { assert(is_interpreted_frame(), "interpreted frame expected"); Method* m = *interpreter_frame_method_addr(); - assert(m->is_metadata(), "bad Method* in interpreter frame"); assert(m->is_method(), "not a Method*"); return m; } @@ -713,7 +712,8 @@ Method* m = ((nmethod *)_cb)->method(); if (m != NULL) { m->name_and_sig_as_C_string(buf, buflen); - st->print("J %s", buf); + st->print("J %s @ " PTR_FORMAT " [" PTR_FORMAT "+" SIZE_FORMAT "]", + buf, _pc, _cb->code_begin(), _pc - _cb->code_begin()); } else { st->print("J " PTR_FORMAT, pc()); } diff -r 6a0ead6dc6db -r be0600ec1102 src/share/vm/runtime/globals.cpp --- a/src/share/vm/runtime/globals.cpp Mon Jun 24 16:11:47 2013 +0200 +++ b/src/share/vm/runtime/globals.cpp Thu Jun 27 11:12:19 2013 -0700 @@ -73,12 +73,6 @@ strcmp(kind, "{C2 diagnostic}") == 0 || strcmp(kind, "{ARCH diagnostic}") == 0 || strcmp(kind, "{Shark diagnostic}") == 0) { - if (strcmp(name, "EnableInvokeDynamic") == 0 && UnlockExperimentalVMOptions && !UnlockDiagnosticVMOptions) { - // transitional logic to allow tests to run until they are changed - static int warned; - if (++warned == 1) warning("Use -XX:+UnlockDiagnosticVMOptions before EnableInvokeDynamic flag"); - return true; - } return UnlockDiagnosticVMOptions; } else if (strcmp(kind, "{experimental}") == 0 || strcmp(kind, "{C2 experimental}") == 0 || diff -r 6a0ead6dc6db -r be0600ec1102 src/share/vm/runtime/sharedRuntime.cpp --- a/src/share/vm/runtime/sharedRuntime.cpp Mon Jun 24 16:11:47 2013 +0200 +++ b/src/share/vm/runtime/sharedRuntime.cpp Thu Jun 27 11:12:19 2013 -0700 @@ -813,8 +813,11 @@ // 3. Implict null exception in nmethod if (!cb->is_nmethod()) { - guarantee(cb->is_adapter_blob() || cb->is_method_handles_adapter_blob(), - "exception happened outside interpreter, nmethods and vtable stubs (1)"); + bool is_in_blob = cb->is_adapter_blob() || cb->is_method_handles_adapter_blob(); + if (!is_in_blob) { + cb->print(); + fatal(err_msg("exception happened outside interpreter, nmethods and vtable stubs at pc " INTPTR_FORMAT, pc)); + } Events::log_exception(thread, "NullPointerException in code blob at " INTPTR_FORMAT, pc); // There is no handler here, so we will simply unwind. return StubRoutines::throw_NullPointerException_at_call_entry(); diff -r 6a0ead6dc6db -r be0600ec1102 src/share/vm/runtime/thread.cpp --- a/src/share/vm/runtime/thread.cpp Mon Jun 24 16:11:47 2013 +0200 +++ b/src/share/vm/runtime/thread.cpp Thu Jun 27 11:12:19 2013 -0700 @@ -220,7 +220,7 @@ set_osthread(NULL); set_resource_area(new (mtThread)ResourceArea()); set_handle_area(new (mtThread) HandleArea(NULL)); - set_metadata_handles(new (ResourceObj::C_HEAP, mtClass) GrowableArray(300, true)); + set_metadata_handles(new (ResourceObj::C_HEAP, mtClass) GrowableArray(30, true)); set_active_handles(NULL); set_free_handle_block(NULL); set_last_handle_mark(NULL); diff -r 6a0ead6dc6db -r be0600ec1102 src/share/vm/runtime/vmStructs.cpp --- a/src/share/vm/runtime/vmStructs.cpp Mon Jun 24 16:11:47 2013 +0200 +++ b/src/share/vm/runtime/vmStructs.cpp Thu Jun 27 11:12:19 2013 -0700 @@ -379,7 +379,7 @@ nonstatic_field(ConstMethod, _size_of_parameters, u2) \ nonstatic_field(ObjArrayKlass, _element_klass, Klass*) \ nonstatic_field(ObjArrayKlass, _bottom_klass, Klass*) \ - volatile_nonstatic_field(Symbol, _refcount, int) \ + volatile_nonstatic_field(Symbol, _refcount, short) \ nonstatic_field(Symbol, _identity_hash, int) \ nonstatic_field(Symbol, _length, unsigned short) \ unchecked_nonstatic_field(Symbol, _body, sizeof(jbyte)) /* NOTE: no type */ \ diff -r 6a0ead6dc6db -r be0600ec1102 src/share/vm/services/management.cpp --- a/src/share/vm/services/management.cpp Mon Jun 24 16:11:47 2013 +0200 +++ b/src/share/vm/services/management.cpp Thu Jun 27 11:12:19 2013 -0700 @@ -894,12 +894,6 @@ } } - // In our current implementation, we make sure that all non-heap - // pools have defined init and max sizes. Heap pools do not matter, - // as we never use total_init and total_max for them. - assert(heap || !has_undefined_init_size, "Undefined init size"); - assert(heap || !has_undefined_max_size, "Undefined max size"); - MemoryUsage usage((heap ? InitialHeapSize : total_init), total_used, total_committed, diff -r 6a0ead6dc6db -r be0600ec1102 src/share/vm/services/memoryManager.cpp --- a/src/share/vm/services/memoryManager.cpp Mon Jun 24 16:11:47 2013 +0200 +++ b/src/share/vm/services/memoryManager.cpp Thu Jun 27 11:12:19 2013 -0700 @@ -61,6 +61,10 @@ return (MemoryManager*) new CodeCacheMemoryManager(); } +MemoryManager* MemoryManager::get_metaspace_memory_manager() { + return (MemoryManager*) new MetaspaceMemoryManager(); +} + GCMemoryManager* MemoryManager::get_copy_memory_manager() { return (GCMemoryManager*) new CopyMemoryManager(); } diff -r 6a0ead6dc6db -r be0600ec1102 src/share/vm/services/memoryManager.hpp --- a/src/share/vm/services/memoryManager.hpp Mon Jun 24 16:11:47 2013 +0200 +++ b/src/share/vm/services/memoryManager.hpp Thu Jun 27 11:12:19 2013 -0700 @@ -56,6 +56,7 @@ enum Name { Abstract, CodeCache, + Metaspace, Copy, MarkSweepCompact, ParNew, @@ -88,6 +89,7 @@ // Static factory methods to get a memory manager of a specific type static MemoryManager* get_code_cache_memory_manager(); + static MemoryManager* get_metaspace_memory_manager(); static GCMemoryManager* get_copy_memory_manager(); static GCMemoryManager* get_msc_memory_manager(); static GCMemoryManager* get_parnew_memory_manager(); @@ -108,6 +110,14 @@ const char* name() { return "CodeCacheManager"; } }; +class MetaspaceMemoryManager : public MemoryManager { +public: + MetaspaceMemoryManager() : MemoryManager() {} + + MemoryManager::Name kind() { return MemoryManager::Metaspace; } + const char *name() { return "Metaspace Manager"; } +}; + class GCStatInfo : public ResourceObj { private: size_t _index; diff -r 6a0ead6dc6db -r be0600ec1102 src/share/vm/services/memoryPool.cpp --- a/src/share/vm/services/memoryPool.cpp Mon Jun 24 16:11:47 2013 +0200 +++ b/src/share/vm/services/memoryPool.cpp Thu Jun 27 11:12:19 2013 -0700 @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "classfile/systemDictionary.hpp" #include "classfile/vmSymbols.hpp" +#include "memory/metaspace.hpp" #include "oops/oop.inline.hpp" #include "runtime/handles.inline.hpp" #include "runtime/javaCalls.hpp" @@ -33,6 +34,7 @@ #include "services/memoryManager.hpp" #include "services/memoryPool.hpp" #include "utilities/macros.hpp" +#include "utilities/globalDefinitions.hpp" MemoryPool::MemoryPool(const char* name, PoolType type, @@ -256,3 +258,39 @@ return MemoryUsage(initial_size(), used, committed, maxSize); } + +MetaspacePool::MetaspacePool() : + MemoryPool("Metaspace", NonHeap, capacity_in_bytes(), calculate_max_size(), true, false) { } + +MemoryUsage MetaspacePool::get_memory_usage() { + size_t committed = align_size_down_(capacity_in_bytes(), os::vm_page_size()); + return MemoryUsage(initial_size(), used_in_bytes(), committed, max_size()); +} + +size_t MetaspacePool::used_in_bytes() { + return MetaspaceAux::allocated_used_bytes(Metaspace::NonClassType); +} + +size_t MetaspacePool::capacity_in_bytes() const { + return MetaspaceAux::allocated_capacity_bytes(Metaspace::NonClassType); +} + +size_t MetaspacePool::calculate_max_size() const { + return FLAG_IS_CMDLINE(MaxMetaspaceSize) ? MaxMetaspaceSize : max_uintx; +} + +CompressedKlassSpacePool::CompressedKlassSpacePool() : + MemoryPool("Compressed Class Space", NonHeap, capacity_in_bytes(), ClassMetaspaceSize, true, false) { } + +size_t CompressedKlassSpacePool::used_in_bytes() { + return MetaspaceAux::allocated_used_bytes(Metaspace::ClassType); +} + +size_t CompressedKlassSpacePool::capacity_in_bytes() const { + return MetaspaceAux::allocated_capacity_bytes(Metaspace::ClassType); +} + +MemoryUsage CompressedKlassSpacePool::get_memory_usage() { + size_t committed = align_size_down_(capacity_in_bytes(), os::vm_page_size()); + return MemoryUsage(initial_size(), used_in_bytes(), committed, max_size()); +} diff -r 6a0ead6dc6db -r be0600ec1102 src/share/vm/services/memoryPool.hpp --- a/src/share/vm/services/memoryPool.hpp Mon Jun 24 16:11:47 2013 +0200 +++ b/src/share/vm/services/memoryPool.hpp Thu Jun 27 11:12:19 2013 -0700 @@ -222,4 +222,21 @@ size_t used_in_bytes() { return _codeHeap->allocated_capacity(); } }; +class MetaspacePool : public MemoryPool { + size_t calculate_max_size() const; + size_t capacity_in_bytes() const; + public: + MetaspacePool(); + MemoryUsage get_memory_usage(); + size_t used_in_bytes(); +}; + +class CompressedKlassSpacePool : public MemoryPool { + size_t capacity_in_bytes() const; + public: + CompressedKlassSpacePool(); + MemoryUsage get_memory_usage(); + size_t used_in_bytes(); +}; + #endif // SHARE_VM_SERVICES_MEMORYPOOL_HPP diff -r 6a0ead6dc6db -r be0600ec1102 src/share/vm/services/memoryService.cpp --- a/src/share/vm/services/memoryService.cpp Mon Jun 24 16:11:47 2013 +0200 +++ b/src/share/vm/services/memoryService.cpp Thu Jun 27 11:12:19 2013 -0700 @@ -35,6 +35,7 @@ #include "memory/memRegion.hpp" #include "memory/tenuredGeneration.hpp" #include "oops/oop.inline.hpp" +#include "runtime/globals.hpp" #include "runtime/javaCalls.hpp" #include "services/classLoadingService.hpp" #include "services/lowMemoryDetector.hpp" @@ -60,9 +61,11 @@ GrowableArray* MemoryService::_managers_list = new (ResourceObj::C_HEAP, mtInternal) GrowableArray(init_managers_list_size, true); -GCMemoryManager* MemoryService::_minor_gc_manager = NULL; -GCMemoryManager* MemoryService::_major_gc_manager = NULL; -MemoryPool* MemoryService::_code_heap_pool = NULL; +GCMemoryManager* MemoryService::_minor_gc_manager = NULL; +GCMemoryManager* MemoryService::_major_gc_manager = NULL; +MemoryPool* MemoryService::_code_heap_pool = NULL; +MemoryPool* MemoryService::_metaspace_pool = NULL; +MemoryPool* MemoryService::_compressed_class_pool = NULL; class GcThreadCountClosure: public ThreadClosure { private: @@ -399,6 +402,22 @@ _managers_list->append(mgr); } +void MemoryService::add_metaspace_memory_pools() { + MemoryManager* mgr = MemoryManager::get_metaspace_memory_manager(); + + _metaspace_pool = new MetaspacePool(); + mgr->add_pool(_metaspace_pool); + _pools_list->append(_metaspace_pool); + + if (UseCompressedKlassPointers) { + _compressed_class_pool = new CompressedKlassSpacePool(); + mgr->add_pool(_compressed_class_pool); + _pools_list->append(_compressed_class_pool); + } + + _managers_list->append(mgr); +} + MemoryManager* MemoryService::get_memory_manager(instanceHandle mh) { for (int i = 0; i < _managers_list->length(); i++) { MemoryManager* mgr = _managers_list->at(i); diff -r 6a0ead6dc6db -r be0600ec1102 src/share/vm/services/memoryService.hpp --- a/src/share/vm/services/memoryService.hpp Mon Jun 24 16:11:47 2013 +0200 +++ b/src/share/vm/services/memoryService.hpp Thu Jun 27 11:12:19 2013 -0700 @@ -73,6 +73,9 @@ // Code heap memory pool static MemoryPool* _code_heap_pool; + static MemoryPool* _metaspace_pool; + static MemoryPool* _compressed_class_pool; + static void add_generation_memory_pool(Generation* gen, MemoryManager* major_mgr, MemoryManager* minor_mgr); @@ -121,6 +124,7 @@ public: static void set_universe_heap(CollectedHeap* heap); static void add_code_heap_memory_pool(CodeHeap* heap); + static void add_metaspace_memory_pools(); static MemoryPool* get_memory_pool(instanceHandle pool); static MemoryManager* get_memory_manager(instanceHandle mgr); diff -r 6a0ead6dc6db -r be0600ec1102 src/share/vm/shark/sharkBuilder.cpp --- a/src/share/vm/shark/sharkBuilder.cpp Mon Jun 24 16:11:47 2013 +0200 +++ b/src/share/vm/shark/sharkBuilder.cpp Thu Jun 27 11:12:19 2013 -0700 @@ -471,7 +471,7 @@ Value* SharkBuilder::CreateInlineMetadata(Metadata* metadata, llvm::PointerType* type, const char* name) { assert(metadata != NULL, "inlined metadata must not be NULL"); - assert(metadata->is_metadata(), "sanity check"); + assert(metadata->is_metaspace_object(), "sanity check"); return CreateLoad( CreateIntToPtr( code_buffer_address(code_buffer()->inline_Metadata(metadata)), diff -r 6a0ead6dc6db -r be0600ec1102 test/gc/metaspace/TestMetaspaceMemoryPool.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/gc/metaspace/TestMetaspaceMemoryPool.java Thu Jun 27 11:12:19 2013 -0700 @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.util.List; +import java.lang.management.ManagementFactory; +import java.lang.management.MemoryManagerMXBean; +import java.lang.management.MemoryPoolMXBean; +import java.lang.management.MemoryUsage; + +import java.lang.management.RuntimeMXBean; +import java.lang.management.ManagementFactory; + +/* @test TestMetaspaceMemoryPool + * @bug 8000754 + * @summary Tests that a MemoryPoolMXBeans is created for metaspace and that a + * MemoryManagerMXBean is created. + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops TestMetaspaceMemoryPool + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops -XX:MaxMetaspaceSize=60m TestMetaspaceMemoryPool + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops -XX:+UseCompressedKlassPointers TestMetaspaceMemoryPool + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops -XX:+UseCompressedKlassPointers -XX:ClassMetaspaceSize=60m TestMetaspaceMemoryPool + */ +public class TestMetaspaceMemoryPool { + public static void main(String[] args) { + verifyThatMetaspaceMemoryManagerExists(); + verifyMemoryPool(getMemoryPool("Metaspace"), isFlagDefined("MaxMetaspaceSize")); + + if (runsOn64bit()) { + if (usesCompressedOops()) { + MemoryPoolMXBean cksPool = getMemoryPool("Compressed Class Space"); + verifyMemoryPool(cksPool, true); + } + } + } + + private static boolean runsOn64bit() { + return !System.getProperty("sun.arch.data.model").equals("32"); + } + + private static boolean usesCompressedOops() { + return isFlagDefined("+UseCompressedOops"); + } + + private static boolean isFlagDefined(String name) { + RuntimeMXBean runtimeMxBean = ManagementFactory.getRuntimeMXBean(); + List args = runtimeMxBean.getInputArguments(); + for (String arg : args) { + if (arg.startsWith("-XX:" + name)) { + return true; + } + } + return false; + } + + private static void verifyThatMetaspaceMemoryManagerExists() { + List managers = ManagementFactory.getMemoryManagerMXBeans(); + for (MemoryManagerMXBean manager : managers) { + if (manager.getName().equals("Metaspace Manager")) { + return; + } + } + + throw new RuntimeException("Expected to find a metaspace memory manager"); + } + + private static MemoryPoolMXBean getMemoryPool(String name) { + List pools = ManagementFactory.getMemoryPoolMXBeans(); + for (MemoryPoolMXBean pool : pools) { + if (pool.getName().equals(name)) { + return pool; + } + } + + throw new RuntimeException("Expected to find a memory pool with name " + name); + } + + private static void verifyMemoryPool(MemoryPoolMXBean pool, boolean isMaxDefined) { + MemoryUsage mu = pool.getUsage(); + assertDefined(mu.getInit(), "init"); + assertDefined(mu.getUsed(), "used"); + assertDefined(mu.getCommitted(), "committed"); + + if (isMaxDefined) { + assertDefined(mu.getMax(), "max"); + } else { + assertUndefined(mu.getMax(), "max"); + } + } + + private static void assertDefined(long value, String name) { + assertTrue(value != -1, "Expected " + name + " to be defined"); + } + + private static void assertUndefined(long value, String name) { + assertEquals(value, -1, "Expected " + name + " to be undefined"); + } + + private static void assertEquals(long actual, long expected, String msg) { + assertTrue(actual == expected, msg); + } + + private static void assertTrue(boolean condition, String msg) { + if (!condition) { + throw new RuntimeException(msg); + } + } +} diff -r 6a0ead6dc6db -r be0600ec1102 test/gc/parallelScavenge/AdaptiveGCBoundary.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/gc/parallelScavenge/AdaptiveGCBoundary.java Thu Jun 27 11:12:19 2013 -0700 @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2013, 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 AdaptiveGCBoundary + * @summary UseAdaptiveGCBoundary is broken + * @bug 8014546 + * @key gc + * @key regression + * @library /testlibrary + * @run main/othervm AdaptiveGCBoundary + * @author jon.masamitsu@oracle.com + */ + +import com.oracle.java.testlibrary.*; + +public class AdaptiveGCBoundary { + public static void main(String args[]) throws Exception { + + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + "-showversion", + "-XX:+UseParallelGC", + "-XX:+UseAdaptiveGCBoundary", + "-XX:+PrintCommandLineFlags", + SystemGCCaller.class.getName() + ); + + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + + output.shouldContain("+UseAdaptiveGCBoundary"); + + output.shouldNotContain("error"); + + output.shouldHaveExitValue(0); + } + static class SystemGCCaller { + public static void main(String [] args) { + System.gc(); + } + } +}