Fri, 28 Jun 2013 18:28:17 +0200
Merge
1.1 --- a/make/bsd/makefiles/build_vm_def.sh Thu Jun 27 09:59:59 2013 +0200 1.2 +++ b/make/bsd/makefiles/build_vm_def.sh Fri Jun 28 18:28:17 2013 +0200 1.3 @@ -7,6 +7,6 @@ 1.4 NM=nm 1.5 fi 1.6 1.7 -$NM --defined-only $* | awk ' 1.8 - { if ($3 ~ /^_ZTV/ || $3 ~ /^gHotSpotVM/) print "\t" $3 ";" } 1.9 +$NM -Uj $* | awk ' 1.10 + { if ($3 ~ /^_ZTV/ || $3 ~ /^gHotSpotVM/) print "\t" $3 } 1.11 '
2.1 --- a/make/bsd/makefiles/gcc.make Thu Jun 27 09:59:59 2013 +0200 2.2 +++ b/make/bsd/makefiles/gcc.make Fri Jun 28 18:28:17 2013 +0200 2.3 @@ -1,5 +1,5 @@ 2.4 # 2.5 -# Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. 2.6 +# Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. 2.7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 2.8 # 2.9 # This code is free software; you can redistribute it and/or modify it 2.10 @@ -368,8 +368,8 @@ 2.11 # Standard linker flags 2.12 LFLAGS += 2.13 2.14 - # Darwin doesn't use ELF and doesn't support version scripts 2.15 - LDNOMAP = true 2.16 + # The apple linker has its own variant of mapfiles/version-scripts 2.17 + MAPFLAG = -Xlinker -exported_symbols_list -Xlinker FILENAME 2.18 2.19 # Use $(SONAMEFLAG:SONAME=soname) to specify the intrinsic name of a shared obj 2.20 SONAMEFLAG =
3.1 --- a/make/bsd/makefiles/mapfile-vers-debug Thu Jun 27 09:59:59 2013 +0200 3.2 +++ b/make/bsd/makefiles/mapfile-vers-debug Fri Jun 28 18:28:17 2013 +0200 3.3 @@ -1,7 +1,3 @@ 3.4 -# 3.5 -# @(#)mapfile-vers-debug 1.18 07/10/25 16:47:35 3.6 -# 3.7 - 3.8 # 3.9 # Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. 3.10 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3.11 @@ -23,273 +19,244 @@ 3.12 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 3.13 # or visit www.oracle.com if you need additional information or have any 3.14 # questions. 3.15 -# 3.16 # 3.17 +# 3.18 +# Only used for OSX/Darwin builds 3.19 3.20 # Define public interface. 3.21 + # _JNI 3.22 + _JNI_CreateJavaVM 3.23 + _JNI_GetCreatedJavaVMs 3.24 + _JNI_GetDefaultJavaVMInitArgs 3.25 3.26 -SUNWprivate_1.1 { 3.27 - global: 3.28 - # JNI 3.29 - JNI_CreateJavaVM; 3.30 - JNI_GetCreatedJavaVMs; 3.31 - JNI_GetDefaultJavaVMInitArgs; 3.32 + # _JVM 3.33 + _JVM_Accept 3.34 + _JVM_ActiveProcessorCount 3.35 + _JVM_AllocateNewArray 3.36 + _JVM_AllocateNewObject 3.37 + _JVM_ArrayCopy 3.38 + _JVM_AssertionStatusDirectives 3.39 + _JVM_Available 3.40 + _JVM_Bind 3.41 + _JVM_ClassDepth 3.42 + _JVM_ClassLoaderDepth 3.43 + _JVM_Clone 3.44 + _JVM_Close 3.45 + _JVM_CX8Field 3.46 + _JVM_CompileClass 3.47 + _JVM_CompileClasses 3.48 + _JVM_CompilerCommand 3.49 + _JVM_Connect 3.50 + _JVM_ConstantPoolGetClassAt 3.51 + _JVM_ConstantPoolGetClassAtIfLoaded 3.52 + _JVM_ConstantPoolGetDoubleAt 3.53 + _JVM_ConstantPoolGetFieldAt 3.54 + _JVM_ConstantPoolGetFieldAtIfLoaded 3.55 + _JVM_ConstantPoolGetFloatAt 3.56 + _JVM_ConstantPoolGetIntAt 3.57 + _JVM_ConstantPoolGetLongAt 3.58 + _JVM_ConstantPoolGetMethodAt 3.59 + _JVM_ConstantPoolGetMethodAtIfLoaded 3.60 + _JVM_ConstantPoolGetMemberRefInfoAt 3.61 + _JVM_ConstantPoolGetSize 3.62 + _JVM_ConstantPoolGetStringAt 3.63 + _JVM_ConstantPoolGetUTF8At 3.64 + _JVM_CountStackFrames 3.65 + _JVM_CurrentClassLoader 3.66 + _JVM_CurrentLoadedClass 3.67 + _JVM_CurrentThread 3.68 + _JVM_CurrentTimeMillis 3.69 + _JVM_DefineClass 3.70 + _JVM_DefineClassWithSource 3.71 + _JVM_DefineClassWithSourceCond 3.72 + _JVM_DesiredAssertionStatus 3.73 + _JVM_DisableCompiler 3.74 + _JVM_DoPrivileged 3.75 + _JVM_DTraceGetVersion 3.76 + _JVM_DTraceActivate 3.77 + _JVM_DTraceIsProbeEnabled 3.78 + _JVM_DTraceIsSupported 3.79 + _JVM_DTraceDispose 3.80 + _JVM_DumpAllStacks 3.81 + _JVM_DumpThreads 3.82 + _JVM_EnableCompiler 3.83 + _JVM_Exit 3.84 + _JVM_FillInStackTrace 3.85 + _JVM_FindClassFromClass 3.86 + _JVM_FindClassFromClassLoader 3.87 + _JVM_FindClassFromBootLoader 3.88 + _JVM_FindLibraryEntry 3.89 + _JVM_FindLoadedClass 3.90 + _JVM_FindPrimitiveClass 3.91 + _JVM_FindSignal 3.92 + _JVM_FreeMemory 3.93 + _JVM_GC 3.94 + _JVM_GetAllThreads 3.95 + _JVM_GetArrayElement 3.96 + _JVM_GetArrayLength 3.97 + _JVM_GetCPClassNameUTF 3.98 + _JVM_GetCPFieldClassNameUTF 3.99 + _JVM_GetCPFieldModifiers 3.100 + _JVM_GetCPFieldNameUTF 3.101 + _JVM_GetCPFieldSignatureUTF 3.102 + _JVM_GetCPMethodClassNameUTF 3.103 + _JVM_GetCPMethodModifiers 3.104 + _JVM_GetCPMethodNameUTF 3.105 + _JVM_GetCPMethodSignatureUTF 3.106 + _JVM_GetCallerClass 3.107 + _JVM_GetClassAccessFlags 3.108 + _JVM_GetClassAnnotations 3.109 + _JVM_GetClassCPEntriesCount 3.110 + _JVM_GetClassCPTypes 3.111 + _JVM_GetClassConstantPool 3.112 + _JVM_GetClassContext 3.113 + _JVM_GetClassDeclaredConstructors 3.114 + _JVM_GetClassDeclaredFields 3.115 + _JVM_GetClassDeclaredMethods 3.116 + _JVM_GetClassFieldsCount 3.117 + _JVM_GetClassInterfaces 3.118 + _JVM_GetClassLoader 3.119 + _JVM_GetClassMethodsCount 3.120 + _JVM_GetClassModifiers 3.121 + _JVM_GetClassName 3.122 + _JVM_GetClassNameUTF 3.123 + _JVM_GetClassSignature 3.124 + _JVM_GetClassSigners 3.125 + _JVM_GetClassTypeAnnotations 3.126 + _JVM_GetComponentType 3.127 + _JVM_GetDeclaredClasses 3.128 + _JVM_GetDeclaringClass 3.129 + _JVM_GetEnclosingMethodInfo 3.130 + _JVM_GetFieldAnnotations 3.131 + _JVM_GetFieldIxModifiers 3.132 + _JVM_GetFieldTypeAnnotations 3.133 + _JVM_GetHostName 3.134 + _JVM_GetInheritedAccessControlContext 3.135 + _JVM_GetInterfaceVersion 3.136 + _JVM_GetLastErrorString 3.137 + _JVM_GetManagement 3.138 + _JVM_GetMethodAnnotations 3.139 + _JVM_GetMethodDefaultAnnotationValue 3.140 + _JVM_GetMethodIxArgsSize 3.141 + _JVM_GetMethodIxByteCode 3.142 + _JVM_GetMethodIxByteCodeLength 3.143 + _JVM_GetMethodIxExceptionIndexes 3.144 + _JVM_GetMethodIxExceptionTableEntry 3.145 + _JVM_GetMethodIxExceptionTableLength 3.146 + _JVM_GetMethodIxExceptionsCount 3.147 + _JVM_GetMethodIxLocalsCount 3.148 + _JVM_GetMethodIxMaxStack 3.149 + _JVM_GetMethodIxModifiers 3.150 + _JVM_GetMethodIxNameUTF 3.151 + _JVM_GetMethodIxSignatureUTF 3.152 + _JVM_GetMethodParameterAnnotations 3.153 + _JVM_GetMethodParameters 3.154 + _JVM_GetMethodTypeAnnotations 3.155 + _JVM_GetPrimitiveArrayElement 3.156 + _JVM_GetProtectionDomain 3.157 + _JVM_GetSockName 3.158 + _JVM_GetSockOpt 3.159 + _JVM_GetStackAccessControlContext 3.160 + _JVM_GetStackTraceDepth 3.161 + _JVM_GetStackTraceElement 3.162 + _JVM_GetSystemPackage 3.163 + _JVM_GetSystemPackages 3.164 + _JVM_GetThreadStateNames 3.165 + _JVM_GetThreadStateValues 3.166 + _JVM_GetVersionInfo 3.167 + _JVM_Halt 3.168 + _JVM_HoldsLock 3.169 + _JVM_IHashCode 3.170 + _JVM_InitAgentProperties 3.171 + _JVM_InitProperties 3.172 + _JVM_InitializeCompiler 3.173 + _JVM_InitializeSocketLibrary 3.174 + _JVM_InternString 3.175 + _JVM_Interrupt 3.176 + _JVM_InvokeMethod 3.177 + _JVM_IsArrayClass 3.178 + _JVM_IsConstructorIx 3.179 + _JVM_IsInterface 3.180 + _JVM_IsInterrupted 3.181 + _JVM_IsNaN 3.182 + _JVM_IsPrimitiveClass 3.183 + _JVM_IsSameClassPackage 3.184 + _JVM_IsSilentCompiler 3.185 + _JVM_IsSupportedJNIVersion 3.186 + _JVM_IsThreadAlive 3.187 + _JVM_IsVMGeneratedMethodIx 3.188 + _JVM_LatestUserDefinedLoader 3.189 + _JVM_Listen 3.190 + _JVM_LoadClass0 3.191 + _JVM_LoadLibrary 3.192 + _JVM_Lseek 3.193 + _JVM_MaxObjectInspectionAge 3.194 + _JVM_MaxMemory 3.195 + _JVM_MonitorNotify 3.196 + _JVM_MonitorNotifyAll 3.197 + _JVM_MonitorWait 3.198 + _JVM_NanoTime 3.199 + _JVM_NativePath 3.200 + _JVM_NewArray 3.201 + _JVM_NewInstanceFromConstructor 3.202 + _JVM_NewMultiArray 3.203 + _JVM_OnExit 3.204 + _JVM_Open 3.205 + _JVM_RaiseSignal 3.206 + _JVM_RawMonitorCreate 3.207 + _JVM_RawMonitorDestroy 3.208 + _JVM_RawMonitorEnter 3.209 + _JVM_RawMonitorExit 3.210 + _JVM_Read 3.211 + _JVM_Recv 3.212 + _JVM_RecvFrom 3.213 + _JVM_RegisterSignal 3.214 + _JVM_ReleaseUTF 3.215 + _JVM_ResolveClass 3.216 + _JVM_ResumeThread 3.217 + _JVM_Send 3.218 + _JVM_SendTo 3.219 + _JVM_SetArrayElement 3.220 + _JVM_SetClassSigners 3.221 + _JVM_SetLength 3.222 + _JVM_SetNativeThreadName 3.223 + _JVM_SetPrimitiveArrayElement 3.224 + _JVM_SetProtectionDomain 3.225 + _JVM_SetSockOpt 3.226 + _JVM_SetThreadPriority 3.227 + _JVM_Sleep 3.228 + _JVM_Socket 3.229 + _JVM_SocketAvailable 3.230 + _JVM_SocketClose 3.231 + _JVM_SocketShutdown 3.232 + _JVM_StartThread 3.233 + _JVM_StopThread 3.234 + _JVM_SuspendThread 3.235 + _JVM_SupportsCX8 3.236 + _JVM_Sync 3.237 + _JVM_Timeout 3.238 + _JVM_TotalMemory 3.239 + _JVM_TraceInstructions 3.240 + _JVM_TraceMethodCalls 3.241 + _JVM_UnloadLibrary 3.242 + _JVM_Write 3.243 + _JVM_Yield 3.244 + _JVM_handle_bsd_signal 3.245 3.246 - # JVM 3.247 - JVM_Accept; 3.248 - JVM_ActiveProcessorCount; 3.249 - JVM_AllocateNewArray; 3.250 - JVM_AllocateNewObject; 3.251 - JVM_ArrayCopy; 3.252 - JVM_AssertionStatusDirectives; 3.253 - JVM_Available; 3.254 - JVM_Bind; 3.255 - JVM_ClassDepth; 3.256 - JVM_ClassLoaderDepth; 3.257 - JVM_Clone; 3.258 - JVM_Close; 3.259 - JVM_CX8Field; 3.260 - JVM_CompileClass; 3.261 - JVM_CompileClasses; 3.262 - JVM_CompilerCommand; 3.263 - JVM_Connect; 3.264 - JVM_ConstantPoolGetClassAt; 3.265 - JVM_ConstantPoolGetClassAtIfLoaded; 3.266 - JVM_ConstantPoolGetDoubleAt; 3.267 - JVM_ConstantPoolGetFieldAt; 3.268 - JVM_ConstantPoolGetFieldAtIfLoaded; 3.269 - JVM_ConstantPoolGetFloatAt; 3.270 - JVM_ConstantPoolGetIntAt; 3.271 - JVM_ConstantPoolGetLongAt; 3.272 - JVM_ConstantPoolGetMethodAt; 3.273 - JVM_ConstantPoolGetMethodAtIfLoaded; 3.274 - JVM_ConstantPoolGetMemberRefInfoAt; 3.275 - JVM_ConstantPoolGetSize; 3.276 - JVM_ConstantPoolGetStringAt; 3.277 - JVM_ConstantPoolGetUTF8At; 3.278 - JVM_CountStackFrames; 3.279 - JVM_CurrentClassLoader; 3.280 - JVM_CurrentLoadedClass; 3.281 - JVM_CurrentThread; 3.282 - JVM_CurrentTimeMillis; 3.283 - JVM_DefineClass; 3.284 - JVM_DefineClassWithSource; 3.285 - JVM_DefineClassWithSourceCond; 3.286 - JVM_DesiredAssertionStatus; 3.287 - JVM_DisableCompiler; 3.288 - JVM_DoPrivileged; 3.289 - JVM_DTraceGetVersion; 3.290 - JVM_DTraceActivate; 3.291 - JVM_DTraceIsProbeEnabled; 3.292 - JVM_DTraceIsSupported; 3.293 - JVM_DTraceDispose; 3.294 - JVM_DumpAllStacks; 3.295 - JVM_DumpThreads; 3.296 - JVM_EnableCompiler; 3.297 - JVM_Exit; 3.298 - JVM_FillInStackTrace; 3.299 - JVM_FindClassFromClass; 3.300 - JVM_FindClassFromClassLoader; 3.301 - JVM_FindClassFromBootLoader; 3.302 - JVM_FindLibraryEntry; 3.303 - JVM_FindLoadedClass; 3.304 - JVM_FindPrimitiveClass; 3.305 - JVM_FindSignal; 3.306 - JVM_FreeMemory; 3.307 - JVM_GC; 3.308 - JVM_GetAllThreads; 3.309 - JVM_GetArrayElement; 3.310 - JVM_GetArrayLength; 3.311 - JVM_GetCPClassNameUTF; 3.312 - JVM_GetCPFieldClassNameUTF; 3.313 - JVM_GetCPFieldModifiers; 3.314 - JVM_GetCPFieldNameUTF; 3.315 - JVM_GetCPFieldSignatureUTF; 3.316 - JVM_GetCPMethodClassNameUTF; 3.317 - JVM_GetCPMethodModifiers; 3.318 - JVM_GetCPMethodNameUTF; 3.319 - JVM_GetCPMethodSignatureUTF; 3.320 - JVM_GetCallerClass; 3.321 - JVM_GetClassAccessFlags; 3.322 - JVM_GetClassAnnotations; 3.323 - JVM_GetClassCPEntriesCount; 3.324 - JVM_GetClassCPTypes; 3.325 - JVM_GetClassConstantPool; 3.326 - JVM_GetClassContext; 3.327 - JVM_GetClassDeclaredConstructors; 3.328 - JVM_GetClassDeclaredFields; 3.329 - JVM_GetClassDeclaredMethods; 3.330 - JVM_GetClassFieldsCount; 3.331 - JVM_GetClassInterfaces; 3.332 - JVM_GetClassLoader; 3.333 - JVM_GetClassMethodsCount; 3.334 - JVM_GetClassModifiers; 3.335 - JVM_GetClassName; 3.336 - JVM_GetClassNameUTF; 3.337 - JVM_GetClassSignature; 3.338 - JVM_GetClassSigners; 3.339 - JVM_GetClassTypeAnnotations; 3.340 - JVM_GetComponentType; 3.341 - JVM_GetDeclaredClasses; 3.342 - JVM_GetDeclaringClass; 3.343 - JVM_GetEnclosingMethodInfo; 3.344 - JVM_GetFieldAnnotations; 3.345 - JVM_GetFieldIxModifiers; 3.346 - JVM_GetFieldTypeAnnotations; 3.347 - JVM_GetHostName; 3.348 - JVM_GetInheritedAccessControlContext; 3.349 - JVM_GetInterfaceVersion; 3.350 - JVM_GetLastErrorString; 3.351 - JVM_GetManagement; 3.352 - JVM_GetMethodAnnotations; 3.353 - JVM_GetMethodDefaultAnnotationValue; 3.354 - JVM_GetMethodIxArgsSize; 3.355 - JVM_GetMethodIxByteCode; 3.356 - JVM_GetMethodIxByteCodeLength; 3.357 - JVM_GetMethodIxExceptionIndexes; 3.358 - JVM_GetMethodIxExceptionTableEntry; 3.359 - JVM_GetMethodIxExceptionTableLength; 3.360 - JVM_GetMethodIxExceptionsCount; 3.361 - JVM_GetMethodIxLocalsCount; 3.362 - JVM_GetMethodIxMaxStack; 3.363 - JVM_GetMethodIxModifiers; 3.364 - JVM_GetMethodIxNameUTF; 3.365 - JVM_GetMethodIxSignatureUTF; 3.366 - JVM_GetMethodParameterAnnotations; 3.367 - JVM_GetMethodParameters; 3.368 - JVM_GetMethodTypeAnnotations; 3.369 - JVM_GetPrimitiveArrayElement; 3.370 - JVM_GetProtectionDomain; 3.371 - JVM_GetSockName; 3.372 - JVM_GetSockOpt; 3.373 - JVM_GetStackAccessControlContext; 3.374 - JVM_GetStackTraceDepth; 3.375 - JVM_GetStackTraceElement; 3.376 - JVM_GetSystemPackage; 3.377 - JVM_GetSystemPackages; 3.378 - JVM_GetThreadStateNames; 3.379 - JVM_GetThreadStateValues; 3.380 - JVM_GetVersionInfo; 3.381 - JVM_Halt; 3.382 - JVM_HoldsLock; 3.383 - JVM_IHashCode; 3.384 - JVM_InitAgentProperties; 3.385 - JVM_InitProperties; 3.386 - JVM_InitializeCompiler; 3.387 - JVM_InitializeSocketLibrary; 3.388 - JVM_InternString; 3.389 - JVM_Interrupt; 3.390 - JVM_InvokeMethod; 3.391 - JVM_IsArrayClass; 3.392 - JVM_IsConstructorIx; 3.393 - JVM_IsInterface; 3.394 - JVM_IsInterrupted; 3.395 - JVM_IsNaN; 3.396 - JVM_IsPrimitiveClass; 3.397 - JVM_IsSameClassPackage; 3.398 - JVM_IsSilentCompiler; 3.399 - JVM_IsSupportedJNIVersion; 3.400 - JVM_IsThreadAlive; 3.401 - JVM_IsVMGeneratedMethodIx; 3.402 - JVM_LatestUserDefinedLoader; 3.403 - JVM_Listen; 3.404 - JVM_LoadClass0; 3.405 - JVM_LoadLibrary; 3.406 - JVM_Lseek; 3.407 - JVM_MaxObjectInspectionAge; 3.408 - JVM_MaxMemory; 3.409 - JVM_MonitorNotify; 3.410 - JVM_MonitorNotifyAll; 3.411 - JVM_MonitorWait; 3.412 - JVM_NanoTime; 3.413 - JVM_NativePath; 3.414 - JVM_NewArray; 3.415 - JVM_NewInstanceFromConstructor; 3.416 - JVM_NewMultiArray; 3.417 - JVM_OnExit; 3.418 - JVM_Open; 3.419 - JVM_RaiseSignal; 3.420 - JVM_RawMonitorCreate; 3.421 - JVM_RawMonitorDestroy; 3.422 - JVM_RawMonitorEnter; 3.423 - JVM_RawMonitorExit; 3.424 - JVM_Read; 3.425 - JVM_Recv; 3.426 - JVM_RecvFrom; 3.427 - JVM_RegisterSignal; 3.428 - JVM_ReleaseUTF; 3.429 - JVM_ResolveClass; 3.430 - JVM_ResumeThread; 3.431 - JVM_Send; 3.432 - JVM_SendTo; 3.433 - JVM_SetArrayElement; 3.434 - JVM_SetClassSigners; 3.435 - JVM_SetLength; 3.436 - JVM_SetPrimitiveArrayElement; 3.437 - JVM_SetProtectionDomain; 3.438 - JVM_SetSockOpt; 3.439 - JVM_SetThreadPriority; 3.440 - JVM_Sleep; 3.441 - JVM_Socket; 3.442 - JVM_SocketAvailable; 3.443 - JVM_SocketClose; 3.444 - JVM_SocketShutdown; 3.445 - JVM_StartThread; 3.446 - JVM_StopThread; 3.447 - JVM_SuspendThread; 3.448 - JVM_SupportsCX8; 3.449 - JVM_Sync; 3.450 - JVM_Timeout; 3.451 - JVM_TotalMemory; 3.452 - JVM_TraceInstructions; 3.453 - JVM_TraceMethodCalls; 3.454 - JVM_UnloadLibrary; 3.455 - JVM_Write; 3.456 - JVM_Yield; 3.457 - JVM_handle_bsd_signal; 3.458 - 3.459 - # Old reflection routines 3.460 - # These do not need to be present in the product build in JDK 1.4 3.461 - # but their code has not been removed yet because there will not 3.462 - # be a substantial code savings until JVM_InvokeMethod and 3.463 - # JVM_NewInstanceFromConstructor can also be removed; see 3.464 - # reflectionCompat.hpp. 3.465 - JVM_GetClassConstructor; 3.466 - JVM_GetClassConstructors; 3.467 - JVM_GetClassField; 3.468 - JVM_GetClassFields; 3.469 - JVM_GetClassMethod; 3.470 - JVM_GetClassMethods; 3.471 - JVM_GetField; 3.472 - JVM_GetPrimitiveField; 3.473 - JVM_NewInstance; 3.474 - JVM_SetField; 3.475 - JVM_SetPrimitiveField; 3.476 - 3.477 - # debug JVM 3.478 - JVM_AccessVMBooleanFlag; 3.479 - JVM_AccessVMIntFlag; 3.480 - JVM_VMBreakPoint; 3.481 + # debug _JVM 3.482 + _JVM_AccessVMBooleanFlag 3.483 + _JVM_AccessVMIntFlag 3.484 + _JVM_VMBreakPoint 3.485 3.486 # miscellaneous functions 3.487 - jio_fprintf; 3.488 - jio_printf; 3.489 - jio_snprintf; 3.490 - jio_vfprintf; 3.491 - jio_vsnprintf; 3.492 - fork1; 3.493 - numa_warn; 3.494 - numa_error; 3.495 - 3.496 - # Needed because there is no JVM interface for this. 3.497 - sysThreadAvailableStackWithSlack; 3.498 + _jio_fprintf 3.499 + _jio_printf 3.500 + _jio_snprintf 3.501 + _jio_vfprintf 3.502 + _jio_vsnprintf 3.503 3.504 # This is for Forte Analyzer profiling support. 3.505 - AsyncGetCallTrace; 3.506 + _AsyncGetCallTrace 3.507 3.508 # INSERT VTABLE SYMBOLS HERE 3.509 3.510 - local: 3.511 - *; 3.512 -}; 3.513 -
4.1 --- a/make/bsd/makefiles/mapfile-vers-product Thu Jun 27 09:59:59 2013 +0200 4.2 +++ b/make/bsd/makefiles/mapfile-vers-product Fri Jun 28 18:28:17 2013 +0200 4.3 @@ -1,7 +1,3 @@ 4.4 -# 4.5 -# @(#)mapfile-vers-product 1.19 08/02/12 10:56:37 4.6 -# 4.7 - 4.8 # 4.9 # Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. 4.10 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4.11 @@ -23,268 +19,239 @@ 4.12 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 4.13 # or visit www.oracle.com if you need additional information or have any 4.14 # questions. 4.15 -# 4.16 # 4.17 +# 4.18 +# Only used for OSX/Darwin builds 4.19 4.20 # Define public interface. 4.21 + # _JNI 4.22 + _JNI_CreateJavaVM 4.23 + _JNI_GetCreatedJavaVMs 4.24 + _JNI_GetDefaultJavaVMInitArgs 4.25 4.26 -SUNWprivate_1.1 { 4.27 - global: 4.28 - # JNI 4.29 - JNI_CreateJavaVM; 4.30 - JNI_GetCreatedJavaVMs; 4.31 - JNI_GetDefaultJavaVMInitArgs; 4.32 - 4.33 - # JVM 4.34 - JVM_Accept; 4.35 - JVM_ActiveProcessorCount; 4.36 - JVM_AllocateNewArray; 4.37 - JVM_AllocateNewObject; 4.38 - JVM_ArrayCopy; 4.39 - JVM_AssertionStatusDirectives; 4.40 - JVM_Available; 4.41 - JVM_Bind; 4.42 - JVM_ClassDepth; 4.43 - JVM_ClassLoaderDepth; 4.44 - JVM_Clone; 4.45 - JVM_Close; 4.46 - JVM_CX8Field; 4.47 - JVM_CompileClass; 4.48 - JVM_CompileClasses; 4.49 - JVM_CompilerCommand; 4.50 - JVM_Connect; 4.51 - JVM_ConstantPoolGetClassAt; 4.52 - JVM_ConstantPoolGetClassAtIfLoaded; 4.53 - JVM_ConstantPoolGetDoubleAt; 4.54 - JVM_ConstantPoolGetFieldAt; 4.55 - JVM_ConstantPoolGetFieldAtIfLoaded; 4.56 - JVM_ConstantPoolGetFloatAt; 4.57 - JVM_ConstantPoolGetIntAt; 4.58 - JVM_ConstantPoolGetLongAt; 4.59 - JVM_ConstantPoolGetMethodAt; 4.60 - JVM_ConstantPoolGetMethodAtIfLoaded; 4.61 - JVM_ConstantPoolGetMemberRefInfoAt; 4.62 - JVM_ConstantPoolGetSize; 4.63 - JVM_ConstantPoolGetStringAt; 4.64 - JVM_ConstantPoolGetUTF8At; 4.65 - JVM_CountStackFrames; 4.66 - JVM_CurrentClassLoader; 4.67 - JVM_CurrentLoadedClass; 4.68 - JVM_CurrentThread; 4.69 - JVM_CurrentTimeMillis; 4.70 - JVM_DefineClass; 4.71 - JVM_DefineClassWithSource; 4.72 - JVM_DefineClassWithSourceCond; 4.73 - JVM_DesiredAssertionStatus; 4.74 - JVM_DisableCompiler; 4.75 - JVM_DoPrivileged; 4.76 - JVM_DTraceGetVersion; 4.77 - JVM_DTraceActivate; 4.78 - JVM_DTraceIsProbeEnabled; 4.79 - JVM_DTraceIsSupported; 4.80 - JVM_DTraceDispose; 4.81 - JVM_DumpAllStacks; 4.82 - JVM_DumpThreads; 4.83 - JVM_EnableCompiler; 4.84 - JVM_Exit; 4.85 - JVM_FillInStackTrace; 4.86 - JVM_FindClassFromClass; 4.87 - JVM_FindClassFromClassLoader; 4.88 - JVM_FindClassFromBootLoader; 4.89 - JVM_FindLibraryEntry; 4.90 - JVM_FindLoadedClass; 4.91 - JVM_FindPrimitiveClass; 4.92 - JVM_FindSignal; 4.93 - JVM_FreeMemory; 4.94 - JVM_GC; 4.95 - JVM_GetAllThreads; 4.96 - JVM_GetArrayElement; 4.97 - JVM_GetArrayLength; 4.98 - JVM_GetCPClassNameUTF; 4.99 - JVM_GetCPFieldClassNameUTF; 4.100 - JVM_GetCPFieldModifiers; 4.101 - JVM_GetCPFieldNameUTF; 4.102 - JVM_GetCPFieldSignatureUTF; 4.103 - JVM_GetCPMethodClassNameUTF; 4.104 - JVM_GetCPMethodModifiers; 4.105 - JVM_GetCPMethodNameUTF; 4.106 - JVM_GetCPMethodSignatureUTF; 4.107 - JVM_GetCallerClass; 4.108 - JVM_GetClassAccessFlags; 4.109 - JVM_GetClassAnnotations; 4.110 - JVM_GetClassCPEntriesCount; 4.111 - JVM_GetClassCPTypes; 4.112 - JVM_GetClassConstantPool; 4.113 - JVM_GetClassContext; 4.114 - JVM_GetClassDeclaredConstructors; 4.115 - JVM_GetClassDeclaredFields; 4.116 - JVM_GetClassDeclaredMethods; 4.117 - JVM_GetClassFieldsCount; 4.118 - JVM_GetClassInterfaces; 4.119 - JVM_GetClassLoader; 4.120 - JVM_GetClassMethodsCount; 4.121 - JVM_GetClassModifiers; 4.122 - JVM_GetClassName; 4.123 - JVM_GetClassNameUTF; 4.124 - JVM_GetClassSignature; 4.125 - JVM_GetClassSigners; 4.126 - JVM_GetClassTypeAnnotations; 4.127 - JVM_GetComponentType; 4.128 - JVM_GetDeclaredClasses; 4.129 - JVM_GetDeclaringClass; 4.130 - JVM_GetEnclosingMethodInfo; 4.131 - JVM_GetFieldAnnotations; 4.132 - JVM_GetFieldIxModifiers; 4.133 - JVM_GetFieldTypeAnnotations; 4.134 - JVM_GetHostName; 4.135 - JVM_GetInheritedAccessControlContext; 4.136 - JVM_GetInterfaceVersion; 4.137 - JVM_GetLastErrorString; 4.138 - JVM_GetManagement; 4.139 - JVM_GetMethodAnnotations; 4.140 - JVM_GetMethodDefaultAnnotationValue; 4.141 - JVM_GetMethodIxArgsSize; 4.142 - JVM_GetMethodIxByteCode; 4.143 - JVM_GetMethodIxByteCodeLength; 4.144 - JVM_GetMethodIxExceptionIndexes; 4.145 - JVM_GetMethodIxExceptionTableEntry; 4.146 - JVM_GetMethodIxExceptionTableLength; 4.147 - JVM_GetMethodIxExceptionsCount; 4.148 - JVM_GetMethodIxLocalsCount; 4.149 - JVM_GetMethodIxMaxStack; 4.150 - JVM_GetMethodIxModifiers; 4.151 - JVM_GetMethodIxNameUTF; 4.152 - JVM_GetMethodIxSignatureUTF; 4.153 - JVM_GetMethodParameterAnnotations; 4.154 - JVM_GetMethodParameters; 4.155 - JVM_GetMethodTypeAnnotations; 4.156 - JVM_GetPrimitiveArrayElement; 4.157 - JVM_GetProtectionDomain; 4.158 - JVM_GetSockName; 4.159 - JVM_GetSockOpt; 4.160 - JVM_GetStackAccessControlContext; 4.161 - JVM_GetStackTraceDepth; 4.162 - JVM_GetStackTraceElement; 4.163 - JVM_GetSystemPackage; 4.164 - JVM_GetSystemPackages; 4.165 - JVM_GetThreadStateNames; 4.166 - JVM_GetThreadStateValues; 4.167 - JVM_GetVersionInfo; 4.168 - JVM_Halt; 4.169 - JVM_HoldsLock; 4.170 - JVM_IHashCode; 4.171 - JVM_InitAgentProperties; 4.172 - JVM_InitProperties; 4.173 - JVM_InitializeCompiler; 4.174 - JVM_InitializeSocketLibrary; 4.175 - JVM_InternString; 4.176 - JVM_Interrupt; 4.177 - JVM_InvokeMethod; 4.178 - JVM_IsArrayClass; 4.179 - JVM_IsConstructorIx; 4.180 - JVM_IsInterface; 4.181 - JVM_IsInterrupted; 4.182 - JVM_IsNaN; 4.183 - JVM_IsPrimitiveClass; 4.184 - JVM_IsSameClassPackage; 4.185 - JVM_IsSilentCompiler; 4.186 - JVM_IsSupportedJNIVersion; 4.187 - JVM_IsThreadAlive; 4.188 - JVM_IsVMGeneratedMethodIx; 4.189 - JVM_LatestUserDefinedLoader; 4.190 - JVM_Listen; 4.191 - JVM_LoadClass0; 4.192 - JVM_LoadLibrary; 4.193 - JVM_Lseek; 4.194 - JVM_MaxObjectInspectionAge; 4.195 - JVM_MaxMemory; 4.196 - JVM_MonitorNotify; 4.197 - JVM_MonitorNotifyAll; 4.198 - JVM_MonitorWait; 4.199 - JVM_NanoTime; 4.200 - JVM_NativePath; 4.201 - JVM_NewArray; 4.202 - JVM_NewInstanceFromConstructor; 4.203 - JVM_NewMultiArray; 4.204 - JVM_OnExit; 4.205 - JVM_Open; 4.206 - JVM_RaiseSignal; 4.207 - JVM_RawMonitorCreate; 4.208 - JVM_RawMonitorDestroy; 4.209 - JVM_RawMonitorEnter; 4.210 - JVM_RawMonitorExit; 4.211 - JVM_Read; 4.212 - JVM_Recv; 4.213 - JVM_RecvFrom; 4.214 - JVM_RegisterSignal; 4.215 - JVM_ReleaseUTF; 4.216 - JVM_ResolveClass; 4.217 - JVM_ResumeThread; 4.218 - JVM_Send; 4.219 - JVM_SendTo; 4.220 - JVM_SetArrayElement; 4.221 - JVM_SetClassSigners; 4.222 - JVM_SetLength; 4.223 - JVM_SetPrimitiveArrayElement; 4.224 - JVM_SetProtectionDomain; 4.225 - JVM_SetSockOpt; 4.226 - JVM_SetThreadPriority; 4.227 - JVM_Sleep; 4.228 - JVM_Socket; 4.229 - JVM_SocketAvailable; 4.230 - JVM_SocketClose; 4.231 - JVM_SocketShutdown; 4.232 - JVM_StartThread; 4.233 - JVM_StopThread; 4.234 - JVM_SuspendThread; 4.235 - JVM_SupportsCX8; 4.236 - JVM_Sync; 4.237 - JVM_Timeout; 4.238 - JVM_TotalMemory; 4.239 - JVM_TraceInstructions; 4.240 - JVM_TraceMethodCalls; 4.241 - JVM_UnloadLibrary; 4.242 - JVM_Write; 4.243 - JVM_Yield; 4.244 - JVM_handle_bsd_signal; 4.245 - 4.246 - # Old reflection routines 4.247 - # These do not need to be present in the product build in JDK 1.4 4.248 - # but their code has not been removed yet because there will not 4.249 - # be a substantial code savings until JVM_InvokeMethod and 4.250 - # JVM_NewInstanceFromConstructor can also be removed; see 4.251 - # reflectionCompat.hpp. 4.252 - JVM_GetClassConstructor; 4.253 - JVM_GetClassConstructors; 4.254 - JVM_GetClassField; 4.255 - JVM_GetClassFields; 4.256 - JVM_GetClassMethod; 4.257 - JVM_GetClassMethods; 4.258 - JVM_GetField; 4.259 - JVM_GetPrimitiveField; 4.260 - JVM_NewInstance; 4.261 - JVM_SetField; 4.262 - JVM_SetPrimitiveField; 4.263 + # _JVM 4.264 + _JVM_Accept 4.265 + _JVM_ActiveProcessorCount 4.266 + _JVM_AllocateNewArray 4.267 + _JVM_AllocateNewObject 4.268 + _JVM_ArrayCopy 4.269 + _JVM_AssertionStatusDirectives 4.270 + _JVM_Available 4.271 + _JVM_Bind 4.272 + _JVM_ClassDepth 4.273 + _JVM_ClassLoaderDepth 4.274 + _JVM_Clone 4.275 + _JVM_Close 4.276 + _JVM_CX8Field 4.277 + _JVM_CompileClass 4.278 + _JVM_CompileClasses 4.279 + _JVM_CompilerCommand 4.280 + _JVM_Connect 4.281 + _JVM_ConstantPoolGetClassAt 4.282 + _JVM_ConstantPoolGetClassAtIfLoaded 4.283 + _JVM_ConstantPoolGetDoubleAt 4.284 + _JVM_ConstantPoolGetFieldAt 4.285 + _JVM_ConstantPoolGetFieldAtIfLoaded 4.286 + _JVM_ConstantPoolGetFloatAt 4.287 + _JVM_ConstantPoolGetIntAt 4.288 + _JVM_ConstantPoolGetLongAt 4.289 + _JVM_ConstantPoolGetMethodAt 4.290 + _JVM_ConstantPoolGetMethodAtIfLoaded 4.291 + _JVM_ConstantPoolGetMemberRefInfoAt 4.292 + _JVM_ConstantPoolGetSize 4.293 + _JVM_ConstantPoolGetStringAt 4.294 + _JVM_ConstantPoolGetUTF8At 4.295 + _JVM_CountStackFrames 4.296 + _JVM_CurrentClassLoader 4.297 + _JVM_CurrentLoadedClass 4.298 + _JVM_CurrentThread 4.299 + _JVM_CurrentTimeMillis 4.300 + _JVM_DefineClass 4.301 + _JVM_DefineClassWithSource 4.302 + _JVM_DefineClassWithSourceCond 4.303 + _JVM_DesiredAssertionStatus 4.304 + _JVM_DisableCompiler 4.305 + _JVM_DoPrivileged 4.306 + _JVM_DTraceGetVersion 4.307 + _JVM_DTraceActivate 4.308 + _JVM_DTraceIsProbeEnabled 4.309 + _JVM_DTraceIsSupported 4.310 + _JVM_DTraceDispose 4.311 + _JVM_DumpAllStacks 4.312 + _JVM_DumpThreads 4.313 + _JVM_EnableCompiler 4.314 + _JVM_Exit 4.315 + _JVM_FillInStackTrace 4.316 + _JVM_FindClassFromClass 4.317 + _JVM_FindClassFromClassLoader 4.318 + _JVM_FindClassFromBootLoader 4.319 + _JVM_FindLibraryEntry 4.320 + _JVM_FindLoadedClass 4.321 + _JVM_FindPrimitiveClass 4.322 + _JVM_FindSignal 4.323 + _JVM_FreeMemory 4.324 + _JVM_GC 4.325 + _JVM_GetAllThreads 4.326 + _JVM_GetArrayElement 4.327 + _JVM_GetArrayLength 4.328 + _JVM_GetCPClassNameUTF 4.329 + _JVM_GetCPFieldClassNameUTF 4.330 + _JVM_GetCPFieldModifiers 4.331 + _JVM_GetCPFieldNameUTF 4.332 + _JVM_GetCPFieldSignatureUTF 4.333 + _JVM_GetCPMethodClassNameUTF 4.334 + _JVM_GetCPMethodModifiers 4.335 + _JVM_GetCPMethodNameUTF 4.336 + _JVM_GetCPMethodSignatureUTF 4.337 + _JVM_GetCallerClass 4.338 + _JVM_GetClassAccessFlags 4.339 + _JVM_GetClassAnnotations 4.340 + _JVM_GetClassCPEntriesCount 4.341 + _JVM_GetClassCPTypes 4.342 + _JVM_GetClassConstantPool 4.343 + _JVM_GetClassContext 4.344 + _JVM_GetClassDeclaredConstructors 4.345 + _JVM_GetClassDeclaredFields 4.346 + _JVM_GetClassDeclaredMethods 4.347 + _JVM_GetClassFieldsCount 4.348 + _JVM_GetClassInterfaces 4.349 + _JVM_GetClassLoader 4.350 + _JVM_GetClassMethodsCount 4.351 + _JVM_GetClassModifiers 4.352 + _JVM_GetClassName 4.353 + _JVM_GetClassNameUTF 4.354 + _JVM_GetClassSignature 4.355 + _JVM_GetClassSigners 4.356 + _JVM_GetClassTypeAnnotations 4.357 + _JVM_GetComponentType 4.358 + _JVM_GetDeclaredClasses 4.359 + _JVM_GetDeclaringClass 4.360 + _JVM_GetEnclosingMethodInfo 4.361 + _JVM_GetFieldAnnotations 4.362 + _JVM_GetFieldIxModifiers 4.363 + _JVM_GetFieldTypeAnnotations 4.364 + _JVM_GetHostName 4.365 + _JVM_GetInheritedAccessControlContext 4.366 + _JVM_GetInterfaceVersion 4.367 + _JVM_GetLastErrorString 4.368 + _JVM_GetManagement 4.369 + _JVM_GetMethodAnnotations 4.370 + _JVM_GetMethodDefaultAnnotationValue 4.371 + _JVM_GetMethodIxArgsSize 4.372 + _JVM_GetMethodIxByteCode 4.373 + _JVM_GetMethodIxByteCodeLength 4.374 + _JVM_GetMethodIxExceptionIndexes 4.375 + _JVM_GetMethodIxExceptionTableEntry 4.376 + _JVM_GetMethodIxExceptionTableLength 4.377 + _JVM_GetMethodIxExceptionsCount 4.378 + _JVM_GetMethodIxLocalsCount 4.379 + _JVM_GetMethodIxMaxStack 4.380 + _JVM_GetMethodIxModifiers 4.381 + _JVM_GetMethodIxNameUTF 4.382 + _JVM_GetMethodIxSignatureUTF 4.383 + _JVM_GetMethodParameterAnnotations 4.384 + _JVM_GetMethodParameters 4.385 + _JVM_GetMethodTypeAnnotations 4.386 + _JVM_GetPrimitiveArrayElement 4.387 + _JVM_GetProtectionDomain 4.388 + _JVM_GetSockName 4.389 + _JVM_GetSockOpt 4.390 + _JVM_GetStackAccessControlContext 4.391 + _JVM_GetStackTraceDepth 4.392 + _JVM_GetStackTraceElement 4.393 + _JVM_GetSystemPackage 4.394 + _JVM_GetSystemPackages 4.395 + _JVM_GetThreadStateNames 4.396 + _JVM_GetThreadStateValues 4.397 + _JVM_GetVersionInfo 4.398 + _JVM_Halt 4.399 + _JVM_HoldsLock 4.400 + _JVM_IHashCode 4.401 + _JVM_InitAgentProperties 4.402 + _JVM_InitProperties 4.403 + _JVM_InitializeCompiler 4.404 + _JVM_InitializeSocketLibrary 4.405 + _JVM_InternString 4.406 + _JVM_Interrupt 4.407 + _JVM_InvokeMethod 4.408 + _JVM_IsArrayClass 4.409 + _JVM_IsConstructorIx 4.410 + _JVM_IsInterface 4.411 + _JVM_IsInterrupted 4.412 + _JVM_IsNaN 4.413 + _JVM_IsPrimitiveClass 4.414 + _JVM_IsSameClassPackage 4.415 + _JVM_IsSilentCompiler 4.416 + _JVM_IsSupportedJNIVersion 4.417 + _JVM_IsThreadAlive 4.418 + _JVM_IsVMGeneratedMethodIx 4.419 + _JVM_LatestUserDefinedLoader 4.420 + _JVM_Listen 4.421 + _JVM_LoadClass0 4.422 + _JVM_LoadLibrary 4.423 + _JVM_Lseek 4.424 + _JVM_MaxObjectInspectionAge 4.425 + _JVM_MaxMemory 4.426 + _JVM_MonitorNotify 4.427 + _JVM_MonitorNotifyAll 4.428 + _JVM_MonitorWait 4.429 + _JVM_NanoTime 4.430 + _JVM_NativePath 4.431 + _JVM_NewArray 4.432 + _JVM_NewInstanceFromConstructor 4.433 + _JVM_NewMultiArray 4.434 + _JVM_OnExit 4.435 + _JVM_Open 4.436 + _JVM_RaiseSignal 4.437 + _JVM_RawMonitorCreate 4.438 + _JVM_RawMonitorDestroy 4.439 + _JVM_RawMonitorEnter 4.440 + _JVM_RawMonitorExit 4.441 + _JVM_Read 4.442 + _JVM_Recv 4.443 + _JVM_RecvFrom 4.444 + _JVM_RegisterSignal 4.445 + _JVM_ReleaseUTF 4.446 + _JVM_ResolveClass 4.447 + _JVM_ResumeThread 4.448 + _JVM_Send 4.449 + _JVM_SendTo 4.450 + _JVM_SetArrayElement 4.451 + _JVM_SetClassSigners 4.452 + _JVM_SetLength 4.453 + _JVM_SetNativeThreadName 4.454 + _JVM_SetPrimitiveArrayElement 4.455 + _JVM_SetProtectionDomain 4.456 + _JVM_SetSockOpt 4.457 + _JVM_SetThreadPriority 4.458 + _JVM_Sleep 4.459 + _JVM_Socket 4.460 + _JVM_SocketAvailable 4.461 + _JVM_SocketClose 4.462 + _JVM_SocketShutdown 4.463 + _JVM_StartThread 4.464 + _JVM_StopThread 4.465 + _JVM_SuspendThread 4.466 + _JVM_SupportsCX8 4.467 + _JVM_Sync 4.468 + _JVM_Timeout 4.469 + _JVM_TotalMemory 4.470 + _JVM_TraceInstructions 4.471 + _JVM_TraceMethodCalls 4.472 + _JVM_UnloadLibrary 4.473 + _JVM_Write 4.474 + _JVM_Yield 4.475 + _JVM_handle_bsd_signal 4.476 4.477 # miscellaneous functions 4.478 - jio_fprintf; 4.479 - jio_printf; 4.480 - jio_snprintf; 4.481 - jio_vfprintf; 4.482 - jio_vsnprintf; 4.483 - fork1; 4.484 - numa_warn; 4.485 - numa_error; 4.486 - 4.487 - # Needed because there is no JVM interface for this. 4.488 - sysThreadAvailableStackWithSlack; 4.489 + _jio_fprintf 4.490 + _jio_printf 4.491 + _jio_snprintf 4.492 + _jio_vfprintf 4.493 + _jio_vsnprintf 4.494 4.495 # This is for Forte Analyzer profiling support. 4.496 - AsyncGetCallTrace; 4.497 + _AsyncGetCallTrace 4.498 4.499 - # INSERT VTABLE SYMBOLS HERE 4.500 + # INSERT VTABLE SYMBOLS HERE 4.501 4.502 - local: 4.503 - *; 4.504 -}; 4.505 -
5.1 --- a/make/excludeSrc.make Thu Jun 27 09:59:59 2013 +0200 5.2 +++ b/make/excludeSrc.make Fri Jun 28 18:28:17 2013 +0200 5.3 @@ -112,3 +112,5 @@ 5.4 endif 5.5 5.6 -include $(HS_ALT_MAKE)/excludeSrc.make 5.7 + 5.8 +.PHONY: $(HS_ALT_MAKE)/excludeSrc.make
6.1 --- a/make/linux/makefiles/gcc.make Thu Jun 27 09:59:59 2013 +0200 6.2 +++ b/make/linux/makefiles/gcc.make Fri Jun 28 18:28:17 2013 +0200 6.3 @@ -350,9 +350,9 @@ 6.4 ifeq ($(DEBUG_CFLAGS/$(BUILDARCH)),) 6.5 ifeq ($(USE_CLANG), true) 6.6 # Clang doesn't understand -gstabs 6.7 - OPT_CFLAGS += -g 6.8 + DEBUG_CFLAGS += -g 6.9 else 6.10 - OPT_CFLAGS += -gstabs 6.11 + DEBUG_CFLAGS += -gstabs 6.12 endif 6.13 endif 6.14 6.15 @@ -365,9 +365,9 @@ 6.16 ifeq ($(FASTDEBUG_CFLAGS/$(BUILDARCH)),) 6.17 ifeq ($(USE_CLANG), true) 6.18 # Clang doesn't understand -gstabs 6.19 - OPT_CFLAGS += -g 6.20 + FASTDEBUG_CFLAGS += -g 6.21 else 6.22 - OPT_CFLAGS += -gstabs 6.23 + FASTDEBUG_CFLAGS += -gstabs 6.24 endif 6.25 endif 6.26
7.1 --- a/src/cpu/sparc/vm/frame_sparc.cpp Thu Jun 27 09:59:59 2013 +0200 7.2 +++ b/src/cpu/sparc/vm/frame_sparc.cpp Fri Jun 28 18:28:17 2013 +0200 7.3 @@ -680,7 +680,7 @@ 7.4 7.5 // validate ConstantPoolCache* 7.6 ConstantPoolCache* cp = *interpreter_frame_cache_addr(); 7.7 - if (cp == NULL || !cp->is_metadata()) return false; 7.8 + if (cp == NULL || !cp->is_metaspace_object()) return false; 7.9 7.10 // validate locals 7.11
8.1 --- a/src/cpu/sparc/vm/macroAssembler_sparc.cpp Thu Jun 27 09:59:59 2013 +0200 8.2 +++ b/src/cpu/sparc/vm/macroAssembler_sparc.cpp Fri Jun 28 18:28:17 2013 +0200 8.3 @@ -1161,12 +1161,6 @@ 8.4 while (offset() % modulus != 0) nop(); 8.5 } 8.6 8.7 - 8.8 -void MacroAssembler::safepoint() { 8.9 - relocate(breakpoint_Relocation::spec(breakpoint_Relocation::safepoint)); 8.10 -} 8.11 - 8.12 - 8.13 void RegistersForDebugging::print(outputStream* s) { 8.14 FlagSetting fs(Debugging, true); 8.15 int j;
9.1 --- a/src/cpu/sparc/vm/relocInfo_sparc.cpp Thu Jun 27 09:59:59 2013 +0200 9.2 +++ b/src/cpu/sparc/vm/relocInfo_sparc.cpp Fri Jun 28 18:28:17 2013 +0200 9.3 @@ -193,36 +193,6 @@ 9.4 return *(address*)addr(); 9.5 } 9.6 9.7 - 9.8 -int Relocation::pd_breakpoint_size() { 9.9 - // minimum breakpoint size, in short words 9.10 - return NativeIllegalInstruction::instruction_size / sizeof(short); 9.11 -} 9.12 - 9.13 -void Relocation::pd_swap_in_breakpoint(address x, short* instrs, int instrlen) { 9.14 - Untested("pd_swap_in_breakpoint"); 9.15 - // %%% probably do not need a general instrlen; just use the trap size 9.16 - if (instrs != NULL) { 9.17 - assert(instrlen * sizeof(short) == NativeIllegalInstruction::instruction_size, "enough instrlen in reloc. data"); 9.18 - for (int i = 0; i < instrlen; i++) { 9.19 - instrs[i] = ((short*)x)[i]; 9.20 - } 9.21 - } 9.22 - NativeIllegalInstruction::insert(x); 9.23 -} 9.24 - 9.25 - 9.26 -void Relocation::pd_swap_out_breakpoint(address x, short* instrs, int instrlen) { 9.27 - Untested("pd_swap_out_breakpoint"); 9.28 - assert(instrlen * sizeof(short) == sizeof(int), "enough buf"); 9.29 - union { int l; short s[1]; } u; 9.30 - for (int i = 0; i < instrlen; i++) { 9.31 - u.s[i] = instrs[i]; 9.32 - } 9.33 - NativeInstruction* ni = nativeInstruction_at(x); 9.34 - ni->set_long_at(0, u.l); 9.35 -} 9.36 - 9.37 void poll_Relocation::fix_relocation_after_move(const CodeBuffer* src, CodeBuffer* dest) { 9.38 } 9.39
10.1 --- a/src/cpu/x86/vm/frame_x86.cpp Thu Jun 27 09:59:59 2013 +0200 10.2 +++ b/src/cpu/x86/vm/frame_x86.cpp Fri Jun 28 18:28:17 2013 +0200 10.3 @@ -587,7 +587,7 @@ 10.4 10.5 // validate ConstantPoolCache* 10.6 ConstantPoolCache* cp = *interpreter_frame_cache_addr(); 10.7 - if (cp == NULL || !cp->is_metadata()) return false; 10.8 + if (cp == NULL || !cp->is_metaspace_object()) return false; 10.9 10.10 // validate locals 10.11
11.1 --- a/src/cpu/x86/vm/relocInfo_x86.cpp Thu Jun 27 09:59:59 2013 +0200 11.2 +++ b/src/cpu/x86/vm/relocInfo_x86.cpp Fri Jun 28 18:28:17 2013 +0200 11.3 @@ -177,30 +177,6 @@ 11.4 return *pd_address_in_code(); 11.5 } 11.6 11.7 -int Relocation::pd_breakpoint_size() { 11.8 - // minimum breakpoint size, in short words 11.9 - return NativeIllegalInstruction::instruction_size / sizeof(short); 11.10 -} 11.11 - 11.12 -void Relocation::pd_swap_in_breakpoint(address x, short* instrs, int instrlen) { 11.13 - Untested("pd_swap_in_breakpoint"); 11.14 - if (instrs != NULL) { 11.15 - assert(instrlen * sizeof(short) == NativeIllegalInstruction::instruction_size, "enough instrlen in reloc. data"); 11.16 - for (int i = 0; i < instrlen; i++) { 11.17 - instrs[i] = ((short*)x)[i]; 11.18 - } 11.19 - } 11.20 - NativeIllegalInstruction::insert(x); 11.21 -} 11.22 - 11.23 - 11.24 -void Relocation::pd_swap_out_breakpoint(address x, short* instrs, int instrlen) { 11.25 - Untested("pd_swap_out_breakpoint"); 11.26 - assert(NativeIllegalInstruction::instruction_size == sizeof(short), "right address unit for update"); 11.27 - NativeInstruction* ni = nativeInstruction_at(x); 11.28 - *(short*)ni->addr_at(0) = instrs[0]; 11.29 -} 11.30 - 11.31 void poll_Relocation::fix_relocation_after_move(const CodeBuffer* src, CodeBuffer* dest) { 11.32 #ifdef _LP64 11.33 if (!Assembler::is_polling_page_far()) {
12.1 --- a/src/cpu/zero/vm/relocInfo_zero.cpp Thu Jun 27 09:59:59 2013 +0200 12.2 +++ b/src/cpu/zero/vm/relocInfo_zero.cpp Fri Jun 28 18:28:17 2013 +0200 12.3 @@ -52,22 +52,6 @@ 12.4 return (address *) addr(); 12.5 } 12.6 12.7 -int Relocation::pd_breakpoint_size() { 12.8 - ShouldNotCallThis(); 12.9 -} 12.10 - 12.11 -void Relocation::pd_swap_in_breakpoint(address x, 12.12 - short* instrs, 12.13 - int instrlen) { 12.14 - ShouldNotCallThis(); 12.15 -} 12.16 - 12.17 -void Relocation::pd_swap_out_breakpoint(address x, 12.18 - short* instrs, 12.19 - int instrlen) { 12.20 - ShouldNotCallThis(); 12.21 -} 12.22 - 12.23 void poll_Relocation::fix_relocation_after_move(const CodeBuffer* src, 12.24 CodeBuffer* dst) { 12.25 ShouldNotCallThis();
13.1 --- a/src/os_cpu/linux_x86/vm/os_linux_x86.cpp Thu Jun 27 09:59:59 2013 +0200 13.2 +++ b/src/os_cpu/linux_x86/vm/os_linux_x86.cpp Fri Jun 28 18:28:17 2013 +0200 13.3 @@ -289,6 +289,16 @@ 13.4 } 13.5 #endif // AMD64 13.6 13.7 +#ifndef AMD64 13.8 + // Halt if SI_KERNEL before more crashes get misdiagnosed as Java bugs 13.9 + // This can happen in any running code (currently more frequently in 13.10 + // interpreter code but has been seen in compiled code) 13.11 + if (sig == SIGSEGV && info->si_addr == 0 && info->si_code == SI_KERNEL) { 13.12 + fatal("An irrecoverable SI_KERNEL SIGSEGV has occurred due " 13.13 + "to unstable signal handling in this distribution."); 13.14 + } 13.15 +#endif // AMD64 13.16 + 13.17 // Handle ALL stack overflow variations here 13.18 if (sig == SIGSEGV) { 13.19 address addr = (address) info->si_addr;
14.1 --- a/src/share/vm/ci/ciObjectFactory.cpp Thu Jun 27 09:59:59 2013 +0200 14.2 +++ b/src/share/vm/ci/ciObjectFactory.cpp Fri Jun 28 18:28:17 2013 +0200 14.3 @@ -265,8 +265,6 @@ 14.4 ciMetadata* ciObjectFactory::get_metadata(Metadata* key) { 14.5 ASSERT_IN_VM; 14.6 14.7 - assert(key == NULL || key->is_metadata(), "must be"); 14.8 - 14.9 #ifdef ASSERT 14.10 if (CIObjectFactoryVerify) { 14.11 Metadata* last = NULL;
15.1 --- a/src/share/vm/classfile/dictionary.cpp Thu Jun 27 09:59:59 2013 +0200 15.2 +++ b/src/share/vm/classfile/dictionary.cpp Fri Jun 28 18:28:17 2013 +0200 15.3 @@ -555,7 +555,7 @@ 15.4 loader_data->class_loader() == NULL || 15.5 loader_data->class_loader()->is_instance(), 15.6 "checking type of class_loader"); 15.7 - e->verify(); 15.8 + e->verify(/*check_dictionary*/false); 15.9 probe->verify_protection_domain_set(); 15.10 element_count++; 15.11 }
16.1 --- a/src/share/vm/code/debugInfo.hpp Thu Jun 27 09:59:59 2013 +0200 16.2 +++ b/src/share/vm/code/debugInfo.hpp Fri Jun 28 18:28:17 2013 +0200 16.3 @@ -274,7 +274,7 @@ 16.4 Method* read_method() { 16.5 Method* o = (Method*)(code()->metadata_at(read_int())); 16.6 assert(o == NULL || 16.7 - o->is_metadata(), "meta data only"); 16.8 + o->is_metaspace_object(), "meta data only"); 16.9 return o; 16.10 } 16.11 ScopeValue* read_object_value();
17.1 --- a/src/share/vm/code/dependencies.cpp Thu Jun 27 09:59:59 2013 +0200 17.2 +++ b/src/share/vm/code/dependencies.cpp Fri Jun 28 18:28:17 2013 +0200 17.3 @@ -655,8 +655,8 @@ 17.4 } else { 17.5 o = _deps->oop_recorder()->metadata_at(i); 17.6 } 17.7 - assert(o == NULL || o->is_metadata(), 17.8 - err_msg("Should be perm " PTR_FORMAT, o)); 17.9 + assert(o == NULL || o->is_metaspace_object(), 17.10 + err_msg("Should be metadata " PTR_FORMAT, o)); 17.11 return o; 17.12 } 17.13
18.1 --- a/src/share/vm/code/nmethod.cpp Thu Jun 27 09:59:59 2013 +0200 18.2 +++ b/src/share/vm/code/nmethod.cpp Fri Jun 28 18:28:17 2013 +0200 18.3 @@ -1081,11 +1081,6 @@ 18.4 metadata_Relocation* reloc = iter.metadata_reloc(); 18.5 reloc->fix_metadata_relocation(); 18.6 } 18.7 - 18.8 - // There must not be any interfering patches or breakpoints. 18.9 - assert(!(iter.type() == relocInfo::breakpoint_type 18.10 - && iter.breakpoint_reloc()->active()), 18.11 - "no active breakpoint"); 18.12 } 18.13 } 18.14
19.1 --- a/src/share/vm/code/relocInfo.cpp Thu Jun 27 09:59:59 2013 +0200 19.2 +++ b/src/share/vm/code/relocInfo.cpp Fri Jun 28 18:28:17 2013 +0200 19.3 @@ -338,31 +338,6 @@ 19.4 _limit = limit; 19.5 } 19.6 19.7 - 19.8 -void PatchingRelocIterator:: prepass() { 19.9 - // turn breakpoints off during patching 19.10 - _init_state = (*this); // save cursor 19.11 - while (next()) { 19.12 - if (type() == relocInfo::breakpoint_type) { 19.13 - breakpoint_reloc()->set_active(false); 19.14 - } 19.15 - } 19.16 - (RelocIterator&)(*this) = _init_state; // reset cursor for client 19.17 -} 19.18 - 19.19 - 19.20 -void PatchingRelocIterator:: postpass() { 19.21 - // turn breakpoints back on after patching 19.22 - (RelocIterator&)(*this) = _init_state; // reset cursor again 19.23 - while (next()) { 19.24 - if (type() == relocInfo::breakpoint_type) { 19.25 - breakpoint_Relocation* bpt = breakpoint_reloc(); 19.26 - bpt->set_active(bpt->enabled()); 19.27 - } 19.28 - } 19.29 -} 19.30 - 19.31 - 19.32 // All the strange bit-encodings are in here. 19.33 // The idea is to encode relocation data which are small integers 19.34 // very efficiently (a single extra halfword). Larger chunks of 19.35 @@ -704,51 +679,6 @@ 19.36 _target = address_from_scaled_offset(offset, base); 19.37 } 19.38 19.39 - 19.40 -void breakpoint_Relocation::pack_data_to(CodeSection* dest) { 19.41 - short* p = (short*) dest->locs_end(); 19.42 - address point = dest->locs_point(); 19.43 - 19.44 - *p++ = _bits; 19.45 - 19.46 - assert(_target != NULL, "sanity"); 19.47 - 19.48 - if (internal()) normalize_address(_target, dest); 19.49 - 19.50 - jint target_bits = 19.51 - (jint)( internal() ? scaled_offset (_target, point) 19.52 - : runtime_address_to_index(_target) ); 19.53 - if (settable()) { 19.54 - // save space for set_target later 19.55 - p = add_jint(p, target_bits); 19.56 - } else { 19.57 - p = add_var_int(p, target_bits); 19.58 - } 19.59 - 19.60 - for (int i = 0; i < instrlen(); i++) { 19.61 - // put placeholder words until bytes can be saved 19.62 - p = add_short(p, (short)0x7777); 19.63 - } 19.64 - 19.65 - dest->set_locs_end((relocInfo*) p); 19.66 -} 19.67 - 19.68 - 19.69 -void breakpoint_Relocation::unpack_data() { 19.70 - _bits = live_bits(); 19.71 - 19.72 - int targetlen = datalen() - 1 - instrlen(); 19.73 - jint target_bits = 0; 19.74 - if (targetlen == 0) target_bits = 0; 19.75 - else if (targetlen == 1) target_bits = *(data()+1); 19.76 - else if (targetlen == 2) target_bits = relocInfo::jint_from_data(data()+1); 19.77 - else { ShouldNotReachHere(); } 19.78 - 19.79 - _target = internal() ? address_from_scaled_offset(target_bits, addr()) 19.80 - : index_to_runtime_address (target_bits); 19.81 -} 19.82 - 19.83 - 19.84 //// miscellaneous methods 19.85 oop* oop_Relocation::oop_addr() { 19.86 int n = _oop_index; 19.87 @@ -933,81 +863,6 @@ 19.88 return target; 19.89 } 19.90 19.91 - 19.92 -breakpoint_Relocation::breakpoint_Relocation(int kind, address target, bool internal) { 19.93 - bool active = false; 19.94 - bool enabled = (kind == initialization); 19.95 - bool removable = (kind != safepoint); 19.96 - bool settable = (target == NULL); 19.97 - 19.98 - int bits = kind; 19.99 - if (enabled) bits |= enabled_state; 19.100 - if (internal) bits |= internal_attr; 19.101 - if (removable) bits |= removable_attr; 19.102 - if (settable) bits |= settable_attr; 19.103 - 19.104 - _bits = bits | high_bit; 19.105 - _target = target; 19.106 - 19.107 - assert(this->kind() == kind, "kind encoded"); 19.108 - assert(this->enabled() == enabled, "enabled encoded"); 19.109 - assert(this->active() == active, "active encoded"); 19.110 - assert(this->internal() == internal, "internal encoded"); 19.111 - assert(this->removable() == removable, "removable encoded"); 19.112 - assert(this->settable() == settable, "settable encoded"); 19.113 -} 19.114 - 19.115 - 19.116 -address breakpoint_Relocation::target() const { 19.117 - return _target; 19.118 -} 19.119 - 19.120 - 19.121 -void breakpoint_Relocation::set_target(address x) { 19.122 - assert(settable(), "must be settable"); 19.123 - jint target_bits = 19.124 - (jint)(internal() ? scaled_offset (x, addr()) 19.125 - : runtime_address_to_index(x)); 19.126 - short* p = &live_bits() + 1; 19.127 - p = add_jint(p, target_bits); 19.128 - assert(p == instrs(), "new target must fit"); 19.129 - _target = x; 19.130 -} 19.131 - 19.132 - 19.133 -void breakpoint_Relocation::set_enabled(bool b) { 19.134 - if (enabled() == b) return; 19.135 - 19.136 - if (b) { 19.137 - set_bits(bits() | enabled_state); 19.138 - } else { 19.139 - set_active(false); // remove the actual breakpoint insn, if any 19.140 - set_bits(bits() & ~enabled_state); 19.141 - } 19.142 -} 19.143 - 19.144 - 19.145 -void breakpoint_Relocation::set_active(bool b) { 19.146 - assert(!b || enabled(), "cannot activate a disabled breakpoint"); 19.147 - 19.148 - if (active() == b) return; 19.149 - 19.150 - // %%% should probably seize a lock here (might not be the right lock) 19.151 - //MutexLockerEx ml_patch(Patching_lock, true); 19.152 - //if (active() == b) return; // recheck state after locking 19.153 - 19.154 - if (b) { 19.155 - set_bits(bits() | active_state); 19.156 - if (instrlen() == 0) 19.157 - fatal("breakpoints in original code must be undoable"); 19.158 - pd_swap_in_breakpoint (addr(), instrs(), instrlen()); 19.159 - } else { 19.160 - set_bits(bits() & ~active_state); 19.161 - pd_swap_out_breakpoint(addr(), instrs(), instrlen()); 19.162 - } 19.163 -} 19.164 - 19.165 - 19.166 //--------------------------------------------------------------------------------- 19.167 // Non-product code 19.168
20.1 --- a/src/share/vm/code/relocInfo.hpp Thu Jun 27 09:59:59 2013 +0200 20.2 +++ b/src/share/vm/code/relocInfo.hpp Fri Jun 28 18:28:17 2013 +0200 20.3 @@ -49,9 +49,6 @@ 20.4 // RelocIterator 20.5 // A StackObj which iterates over the relocations associated with 20.6 // a range of code addresses. Can be used to operate a copy of code. 20.7 -// PatchingRelocIterator 20.8 -// Specialized subtype of RelocIterator which removes breakpoints 20.9 -// temporarily during iteration, then restores them. 20.10 // BoundRelocation 20.11 // An _internal_ type shared by packers and unpackers of relocations. 20.12 // It pastes together a RelocationHolder with some pointers into 20.13 @@ -204,15 +201,6 @@ 20.14 // immediate field must not straddle a unit of memory coherence. 20.15 // //%note reloc_3 20.16 // 20.17 -// relocInfo::breakpoint_type -- a conditional breakpoint in the code 20.18 -// Value: none 20.19 -// Instruction types: any whatsoever 20.20 -// Data: [b [T]t i...] 20.21 -// The b is a bit-packed word representing the breakpoint's attributes. 20.22 -// The t is a target address which the breakpoint calls (when it is enabled). 20.23 -// The i... is a place to store one or two instruction words overwritten 20.24 -// by a trap, so that the breakpoint may be subsequently removed. 20.25 -// 20.26 // relocInfo::static_stub_type -- an extra stub for each static_call_type 20.27 // Value: none 20.28 // Instruction types: a virtual call: { set_oop; jump; } 20.29 @@ -271,8 +259,8 @@ 20.30 section_word_type = 9, // internal, but a cross-section reference 20.31 poll_type = 10, // polling instruction for safepoints 20.32 poll_return_type = 11, // polling instruction for safepoints at return 20.33 - breakpoint_type = 12, // an initialization barrier or safepoint 20.34 - metadata_type = 13, // metadata that used to be oops 20.35 + metadata_type = 12, // metadata that used to be oops 20.36 + yet_unused_type_1 = 13, // Still unused 20.37 yet_unused_type_2 = 14, // Still unused 20.38 data_prefix_tag = 15, // tag for a prefix (carries data arguments) 20.39 type_mask = 15 // A mask which selects only the above values 20.40 @@ -312,7 +300,6 @@ 20.41 visitor(internal_word) \ 20.42 visitor(poll) \ 20.43 visitor(poll_return) \ 20.44 - visitor(breakpoint) \ 20.45 visitor(section_word) \ 20.46 20.47 20.48 @@ -454,7 +441,7 @@ 20.49 public: 20.50 enum { 20.51 // Conservatively large estimate of maximum length (in shorts) 20.52 - // of any relocation record (probably breakpoints are largest). 20.53 + // of any relocation record. 20.54 // Extended format is length prefix, data words, and tag/offset suffix. 20.55 length_limit = 1 + 1 + (3*BytesPerWord/BytesPerShort) + 1, 20.56 have_format = format_width > 0 20.57 @@ -571,8 +558,6 @@ 20.58 20.59 void initialize(nmethod* nm, address begin, address limit); 20.60 20.61 - friend class PatchingRelocIterator; 20.62 - // make an uninitialized one, for PatchingRelocIterator: 20.63 RelocIterator() { initialize_misc(); } 20.64 20.65 public: 20.66 @@ -779,9 +764,6 @@ 20.67 void pd_verify_data_value (address x, intptr_t off) { pd_set_data_value(x, off, true); } 20.68 address pd_call_destination (address orig_addr = NULL); 20.69 void pd_set_call_destination (address x); 20.70 - void pd_swap_in_breakpoint (address x, short* instrs, int instrlen); 20.71 - void pd_swap_out_breakpoint (address x, short* instrs, int instrlen); 20.72 - static int pd_breakpoint_size (); 20.73 20.74 // this extracts the address of an address in the code stream instead of the reloc data 20.75 address* pd_address_in_code (); 20.76 @@ -1302,87 +1284,6 @@ 20.77 void fix_relocation_after_move(const CodeBuffer* src, CodeBuffer* dest); 20.78 }; 20.79 20.80 - 20.81 -class breakpoint_Relocation : public Relocation { 20.82 - relocInfo::relocType type() { return relocInfo::breakpoint_type; } 20.83 - 20.84 - enum { 20.85 - // attributes which affect the interpretation of the data: 20.86 - removable_attr = 0x0010, // buffer [i...] allows for undoing the trap 20.87 - internal_attr = 0x0020, // the target is an internal addr (local stub) 20.88 - settable_attr = 0x0040, // the target is settable 20.89 - 20.90 - // states which can change over time: 20.91 - enabled_state = 0x0100, // breakpoint must be active in running code 20.92 - active_state = 0x0200, // breakpoint instruction actually in code 20.93 - 20.94 - kind_mask = 0x000F, // mask for extracting kind 20.95 - high_bit = 0x4000 // extra bit which is always set 20.96 - }; 20.97 - 20.98 - public: 20.99 - enum { 20.100 - // kinds: 20.101 - initialization = 1, 20.102 - safepoint = 2 20.103 - }; 20.104 - 20.105 - // If target is NULL, 32 bits are reserved for a later set_target(). 20.106 - static RelocationHolder spec(int kind, address target = NULL, bool internal_target = false) { 20.107 - RelocationHolder rh = newHolder(); 20.108 - new(rh) breakpoint_Relocation(kind, target, internal_target); 20.109 - return rh; 20.110 - } 20.111 - 20.112 - private: 20.113 - // We require every bits value to NOT to fit into relocInfo::datalen_width, 20.114 - // because we are going to actually store state in the reloc, and so 20.115 - // cannot allow it to be compressed (and hence copied by the iterator). 20.116 - 20.117 - short _bits; // bit-encoded kind, attrs, & state 20.118 - address _target; 20.119 - 20.120 - breakpoint_Relocation(int kind, address target, bool internal_target); 20.121 - 20.122 - friend class RelocIterator; 20.123 - breakpoint_Relocation() { } 20.124 - 20.125 - short bits() const { return _bits; } 20.126 - short& live_bits() const { return data()[0]; } 20.127 - short* instrs() const { return data() + datalen() - instrlen(); } 20.128 - int instrlen() const { return removable() ? pd_breakpoint_size() : 0; } 20.129 - 20.130 - void set_bits(short x) { 20.131 - assert(live_bits() == _bits, "must be the only mutator of reloc info"); 20.132 - live_bits() = _bits = x; 20.133 - } 20.134 - 20.135 - public: 20.136 - address target() const; 20.137 - void set_target(address x); 20.138 - 20.139 - int kind() const { return bits() & kind_mask; } 20.140 - bool enabled() const { return (bits() & enabled_state) != 0; } 20.141 - bool active() const { return (bits() & active_state) != 0; } 20.142 - bool internal() const { return (bits() & internal_attr) != 0; } 20.143 - bool removable() const { return (bits() & removable_attr) != 0; } 20.144 - bool settable() const { return (bits() & settable_attr) != 0; } 20.145 - 20.146 - void set_enabled(bool b); // to activate, you must also say set_active 20.147 - void set_active(bool b); // actually inserts bpt (must be enabled 1st) 20.148 - 20.149 - // data is packed as 16 bits, followed by the target (1 or 2 words), followed 20.150 - // if necessary by empty storage for saving away original instruction bytes. 20.151 - void pack_data_to(CodeSection* dest); 20.152 - void unpack_data(); 20.153 - 20.154 - // during certain operations, breakpoints must be out of the way: 20.155 - void fix_relocation_after_move(const CodeBuffer* src, CodeBuffer* dest) { 20.156 - assert(!active(), "cannot perform relocation on enabled breakpoints"); 20.157 - } 20.158 -}; 20.159 - 20.160 - 20.161 // We know all the xxx_Relocation classes, so now we can define these: 20.162 #define EACH_CASE(name) \ 20.163 inline name##_Relocation* RelocIterator::name##_reloc() { \ 20.164 @@ -1401,25 +1302,4 @@ 20.165 initialize(nm, begin, limit); 20.166 } 20.167 20.168 -// if you are going to patch code, you should use this subclass of 20.169 -// RelocIterator 20.170 -class PatchingRelocIterator : public RelocIterator { 20.171 - private: 20.172 - RelocIterator _init_state; 20.173 - 20.174 - void prepass(); // deactivates all breakpoints 20.175 - void postpass(); // reactivates all enabled breakpoints 20.176 - 20.177 - // do not copy these puppies; it would have unpredictable side effects 20.178 - // these are private and have no bodies defined because they should not be called 20.179 - PatchingRelocIterator(const RelocIterator&); 20.180 - void operator=(const RelocIterator&); 20.181 - 20.182 - public: 20.183 - PatchingRelocIterator(nmethod* nm, address begin = NULL, address limit = NULL) 20.184 - : RelocIterator(nm, begin, limit) { prepass(); } 20.185 - 20.186 - ~PatchingRelocIterator() { postpass(); } 20.187 -}; 20.188 - 20.189 #endif // SHARE_VM_CODE_RELOCINFO_HPP
21.1 --- a/src/share/vm/gc_implementation/g1/heapRegion.cpp Thu Jun 27 09:59:59 2013 +0200 21.2 +++ b/src/share/vm/gc_implementation/g1/heapRegion.cpp Fri Jun 28 18:28:17 2013 +0200 21.3 @@ -798,7 +798,7 @@ 21.4 if (!g1->is_obj_dead_cond(obj, this, vo)) { 21.5 if (obj->is_oop()) { 21.6 Klass* klass = obj->klass(); 21.7 - if (!klass->is_metadata()) { 21.8 + if (!klass->is_metaspace_object()) { 21.9 gclog_or_tty->print_cr("klass "PTR_FORMAT" of object "PTR_FORMAT" " 21.10 "not metadata", klass, obj); 21.11 *failures = true;
22.1 --- a/src/share/vm/interpreter/bytecodeInterpreter.cpp Thu Jun 27 09:59:59 2013 +0200 22.2 +++ b/src/share/vm/interpreter/bytecodeInterpreter.cpp Fri Jun 28 18:28:17 2013 +0200 22.3 @@ -481,9 +481,9 @@ 22.4 // So we have a second version of the assertion which handles the case where EnableInvokeDynamic was 22.5 // switched off because of the wrong classes. 22.6 if (EnableInvokeDynamic || FLAG_IS_CMDLINE(EnableInvokeDynamic)) { 22.7 - assert(abs(istate->_stack_base - istate->_stack_limit) == (istate->_method->max_stack() + 1), "bad stack limit"); 22.8 + assert(labs(istate->_stack_base - istate->_stack_limit) == (istate->_method->max_stack() + 1), "bad stack limit"); 22.9 } else { 22.10 - const int extra_stack_entries = Method::extra_stack_entries_for_indy; 22.11 + const int extra_stack_entries = Method::extra_stack_entries_for_jsr292; 22.12 assert(labs(istate->_stack_base - istate->_stack_limit) == (istate->_method->max_stack() + extra_stack_entries 22.13 + 1), "bad stack limit"); 22.14 } 22.15 @@ -2233,7 +2233,7 @@ 22.16 } 22.17 22.18 Method* method = cache->f1_as_method(); 22.19 - VERIFY_OOP(method); 22.20 + if (VerifyOops) method->verify(); 22.21 22.22 if (cache->has_appendix()) { 22.23 ConstantPool* constants = METHOD->constants(); 22.24 @@ -2265,8 +2265,7 @@ 22.25 } 22.26 22.27 Method* method = cache->f1_as_method(); 22.28 - 22.29 - VERIFY_OOP(method); 22.30 + if (VerifyOops) method->verify(); 22.31 22.32 if (cache->has_appendix()) { 22.33 ConstantPool* constants = METHOD->constants();
23.1 --- a/src/share/vm/memory/allocation.cpp Thu Jun 27 09:59:59 2013 +0200 23.2 +++ b/src/share/vm/memory/allocation.cpp Fri Jun 28 18:28:17 2013 +0200 23.3 @@ -71,13 +71,6 @@ 23.4 return MetaspaceShared::is_in_shared_space(this); 23.5 } 23.6 23.7 -bool MetaspaceObj::is_metadata() const { 23.8 - // GC Verify checks use this in guarantees. 23.9 - // TODO: either replace them with is_metaspace_object() or remove them. 23.10 - // is_metaspace_object() is slower than this test. This test doesn't 23.11 - // seem very useful for metaspace objects anymore though. 23.12 - return !Universe::heap()->is_in_reserved(this); 23.13 -} 23.14 23.15 bool MetaspaceObj::is_metaspace_object() const { 23.16 return Metaspace::contains((void*)this);
24.1 --- a/src/share/vm/memory/allocation.hpp Thu Jun 27 09:59:59 2013 +0200 24.2 +++ b/src/share/vm/memory/allocation.hpp Fri Jun 28 18:28:17 2013 +0200 24.3 @@ -264,7 +264,6 @@ 24.4 24.5 class MetaspaceObj { 24.6 public: 24.7 - bool is_metadata() const; 24.8 bool is_metaspace_object() const; // more specific test but slower 24.9 bool is_shared() const; 24.10 void print_address_on(outputStream* st) const; // nonvirtual address printing
25.1 --- a/src/share/vm/memory/heapInspection.cpp Thu Jun 27 09:59:59 2013 +0200 25.2 +++ b/src/share/vm/memory/heapInspection.cpp Fri Jun 28 18:28:17 2013 +0200 25.3 @@ -157,7 +157,6 @@ 25.4 } 25.5 25.6 uint KlassInfoTable::hash(const Klass* p) { 25.7 - assert(p->is_metadata(), "all klasses are metadata"); 25.8 return (uint)(((uintptr_t)p - (uintptr_t)_ref) >> 2); 25.9 } 25.10
26.1 --- a/src/share/vm/oops/arrayKlass.cpp Thu Jun 27 09:59:59 2013 +0200 26.2 +++ b/src/share/vm/oops/arrayKlass.cpp Fri Jun 28 18:28:17 2013 +0200 26.3 @@ -221,8 +221,8 @@ 26.4 26.5 // Verification 26.6 26.7 -void ArrayKlass::verify_on(outputStream* st) { 26.8 - Klass::verify_on(st); 26.9 +void ArrayKlass::verify_on(outputStream* st, bool check_dictionary) { 26.10 + Klass::verify_on(st, check_dictionary); 26.11 26.12 if (component_mirror() != NULL) { 26.13 guarantee(component_mirror()->klass() != NULL, "should have a class");
27.1 --- a/src/share/vm/oops/arrayKlass.hpp Thu Jun 27 09:59:59 2013 +0200 27.2 +++ b/src/share/vm/oops/arrayKlass.hpp Fri Jun 28 18:28:17 2013 +0200 27.3 @@ -152,7 +152,7 @@ 27.4 void oop_print_on(oop obj, outputStream* st); 27.5 27.6 // Verification 27.7 - void verify_on(outputStream* st); 27.8 + void verify_on(outputStream* st, bool check_dictionary); 27.9 27.10 void oop_verify_on(oop obj, outputStream* st); 27.11 };
28.1 --- a/src/share/vm/oops/compiledICHolder.cpp Thu Jun 27 09:59:59 2013 +0200 28.2 +++ b/src/share/vm/oops/compiledICHolder.cpp Fri Jun 28 18:28:17 2013 +0200 28.3 @@ -48,8 +48,6 @@ 28.4 // Verification 28.5 28.6 void CompiledICHolder::verify_on(outputStream* st) { 28.7 - guarantee(holder_method()->is_metadata(), "should be in metaspace"); 28.8 guarantee(holder_method()->is_method(), "should be method"); 28.9 - guarantee(holder_klass()->is_metadata(), "should be in metaspace"); 28.10 guarantee(holder_klass()->is_klass(), "should be klass"); 28.11 }
29.1 --- a/src/share/vm/oops/constMethod.cpp Thu Jun 27 09:59:59 2013 +0200 29.2 +++ b/src/share/vm/oops/constMethod.cpp Fri Jun 28 18:28:17 2013 +0200 29.3 @@ -440,7 +440,6 @@ 29.4 29.5 void ConstMethod::verify_on(outputStream* st) { 29.6 guarantee(is_constMethod(), "object must be constMethod"); 29.7 - guarantee(is_metadata(), err_msg("Should be metadata " PTR_FORMAT, this)); 29.8 29.9 // Verification can occur during oop construction before the method or 29.10 // other fields have been initialized.
30.1 --- a/src/share/vm/oops/constantPool.cpp Thu Jun 27 09:59:59 2013 +0200 30.2 +++ b/src/share/vm/oops/constantPool.cpp Fri Jun 28 18:28:17 2013 +0200 30.3 @@ -2095,12 +2095,10 @@ 30.4 CPSlot entry = slot_at(i); 30.5 if (tag.is_klass()) { 30.6 if (entry.is_resolved()) { 30.7 - guarantee(entry.get_klass()->is_metadata(), "should be metadata"); 30.8 guarantee(entry.get_klass()->is_klass(), "should be klass"); 30.9 } 30.10 } else if (tag.is_unresolved_klass()) { 30.11 if (entry.is_resolved()) { 30.12 - guarantee(entry.get_klass()->is_metadata(), "should be metadata"); 30.13 guarantee(entry.get_klass()->is_klass(), "should be klass"); 30.14 } 30.15 } else if (tag.is_symbol()) { 30.16 @@ -2112,13 +2110,11 @@ 30.17 if (cache() != NULL) { 30.18 // Note: cache() can be NULL before a class is completely setup or 30.19 // in temporary constant pools used during constant pool merging 30.20 - guarantee(cache()->is_metadata(), "should be metadata"); 30.21 guarantee(cache()->is_constantPoolCache(), "should be constant pool cache"); 30.22 } 30.23 if (pool_holder() != NULL) { 30.24 // Note: pool_holder() can be NULL in temporary constant pools 30.25 // used during constant pool merging 30.26 - guarantee(pool_holder()->is_metadata(), "should be metadata"); 30.27 guarantee(pool_holder()->is_klass(), "should be klass"); 30.28 } 30.29 }
31.1 --- a/src/share/vm/oops/instanceKlass.cpp Thu Jun 27 09:59:59 2013 +0200 31.2 +++ b/src/share/vm/oops/instanceKlass.cpp Fri Jun 28 18:28:17 2013 +0200 31.3 @@ -3088,27 +3088,26 @@ 31.4 virtual void do_oop(narrowOop* p) { VerifyFieldClosure::do_oop_work(p); } 31.5 }; 31.6 31.7 -void InstanceKlass::verify_on(outputStream* st) { 31.8 - Klass::verify_on(st); 31.9 - Thread *thread = Thread::current(); 31.10 - 31.11 +void InstanceKlass::verify_on(outputStream* st, bool check_dictionary) { 31.12 #ifndef PRODUCT 31.13 - // Avoid redundant verifies 31.14 + // Avoid redundant verifies, this really should be in product. 31.15 if (_verify_count == Universe::verify_count()) return; 31.16 _verify_count = Universe::verify_count(); 31.17 #endif 31.18 - // Verify that klass is present in SystemDictionary 31.19 - if (is_loaded() && !is_anonymous()) { 31.20 + 31.21 + // Verify Klass 31.22 + Klass::verify_on(st, check_dictionary); 31.23 + 31.24 + // Verify that klass is present in SystemDictionary if not already 31.25 + // verifying the SystemDictionary. 31.26 + if (is_loaded() && !is_anonymous() && check_dictionary) { 31.27 Symbol* h_name = name(); 31.28 SystemDictionary::verify_obj_klass_present(h_name, class_loader_data()); 31.29 } 31.30 31.31 - // Verify static fields 31.32 - VerifyFieldClosure blk; 31.33 - 31.34 // Verify vtables 31.35 if (is_linked()) { 31.36 - ResourceMark rm(thread); 31.37 + ResourceMark rm; 31.38 // $$$ This used to be done only for m/s collections. Doing it 31.39 // always seemed a valid generalization. (DLD -- 6/00) 31.40 vtable()->verify(st); 31.41 @@ -3116,7 +3115,6 @@ 31.42 31.43 // Verify first subklass 31.44 if (subklass_oop() != NULL) { 31.45 - guarantee(subklass_oop()->is_metadata(), "should be in metaspace"); 31.46 guarantee(subklass_oop()->is_klass(), "should be klass"); 31.47 } 31.48 31.49 @@ -3128,7 +3126,6 @@ 31.50 fatal(err_msg("subclass points to itself " PTR_FORMAT, sib)); 31.51 } 31.52 31.53 - guarantee(sib->is_metadata(), "should be in metaspace"); 31.54 guarantee(sib->is_klass(), "should be klass"); 31.55 guarantee(sib->super() == super, "siblings should have same superklass"); 31.56 } 31.57 @@ -3164,7 +3161,6 @@ 31.58 if (methods() != NULL) { 31.59 Array<Method*>* methods = this->methods(); 31.60 for (int j = 0; j < methods->length(); j++) { 31.61 - guarantee(methods->at(j)->is_metadata(), "should be in metaspace"); 31.62 guarantee(methods->at(j)->is_method(), "non-method in methods array"); 31.63 } 31.64 for (int j = 0; j < methods->length() - 1; j++) { 31.65 @@ -3202,16 +3198,13 @@ 31.66 31.67 // Verify other fields 31.68 if (array_klasses() != NULL) { 31.69 - guarantee(array_klasses()->is_metadata(), "should be in metaspace"); 31.70 guarantee(array_klasses()->is_klass(), "should be klass"); 31.71 } 31.72 if (constants() != NULL) { 31.73 - guarantee(constants()->is_metadata(), "should be in metaspace"); 31.74 guarantee(constants()->is_constantPool(), "should be constant pool"); 31.75 } 31.76 const Klass* host = host_klass(); 31.77 if (host != NULL) { 31.78 - guarantee(host->is_metadata(), "should be in metaspace"); 31.79 guarantee(host->is_klass(), "should be klass"); 31.80 } 31.81 }
32.1 --- a/src/share/vm/oops/instanceKlass.hpp Thu Jun 27 09:59:59 2013 +0200 32.2 +++ b/src/share/vm/oops/instanceKlass.hpp Fri Jun 28 18:28:17 2013 +0200 32.3 @@ -1050,7 +1050,7 @@ 32.4 const char* internal_name() const; 32.5 32.6 // Verification 32.7 - void verify_on(outputStream* st); 32.8 + void verify_on(outputStream* st, bool check_dictionary); 32.9 32.10 void oop_verify_on(oop obj, outputStream* st); 32.11 };
33.1 --- a/src/share/vm/oops/klass.cpp Thu Jun 27 09:59:59 2013 +0200 33.2 +++ b/src/share/vm/oops/klass.cpp Fri Jun 28 18:28:17 2013 +0200 33.3 @@ -377,7 +377,6 @@ 33.4 } 33.5 33.6 bool Klass::is_loader_alive(BoolObjectClosure* is_alive) { 33.7 - assert(is_metadata(), "p is not meta-data"); 33.8 assert(ClassLoaderDataGraph::contains((address)this), "is in the metaspace"); 33.9 33.10 #ifdef ASSERT 33.11 @@ -648,27 +647,24 @@ 33.12 33.13 // Verification 33.14 33.15 -void Klass::verify_on(outputStream* st) { 33.16 - guarantee(!Universe::heap()->is_in_reserved(this), "Shouldn't be"); 33.17 - guarantee(this->is_metadata(), "should be in metaspace"); 33.18 +void Klass::verify_on(outputStream* st, bool check_dictionary) { 33.19 33.20 + // This can be expensive, but it is worth checking that this klass is actually 33.21 + // in the CLD graph but not in production. 33.22 assert(ClassLoaderDataGraph::contains((address)this), "Should be"); 33.23 33.24 guarantee(this->is_klass(),"should be klass"); 33.25 33.26 if (super() != NULL) { 33.27 - guarantee(super()->is_metadata(), "should be in metaspace"); 33.28 guarantee(super()->is_klass(), "should be klass"); 33.29 } 33.30 if (secondary_super_cache() != NULL) { 33.31 Klass* ko = secondary_super_cache(); 33.32 - guarantee(ko->is_metadata(), "should be in metaspace"); 33.33 guarantee(ko->is_klass(), "should be klass"); 33.34 } 33.35 for ( uint i = 0; i < primary_super_limit(); i++ ) { 33.36 Klass* ko = _primary_supers[i]; 33.37 if (ko != NULL) { 33.38 - guarantee(ko->is_metadata(), "should be in metaspace"); 33.39 guarantee(ko->is_klass(), "should be klass"); 33.40 } 33.41 } 33.42 @@ -680,7 +676,6 @@ 33.43 33.44 void Klass::oop_verify_on(oop obj, outputStream* st) { 33.45 guarantee(obj->is_oop(), "should be oop"); 33.46 - guarantee(obj->klass()->is_metadata(), "should not be in Java heap"); 33.47 guarantee(obj->klass()->is_klass(), "klass field is not a klass"); 33.48 } 33.49
34.1 --- a/src/share/vm/oops/klass.hpp Thu Jun 27 09:59:59 2013 +0200 34.2 +++ b/src/share/vm/oops/klass.hpp Fri Jun 28 18:28:17 2013 +0200 34.3 @@ -703,8 +703,8 @@ 34.4 virtual const char* internal_name() const = 0; 34.5 34.6 // Verification 34.7 - virtual void verify_on(outputStream* st); 34.8 - void verify() { verify_on(tty); } 34.9 + virtual void verify_on(outputStream* st, bool check_dictionary); 34.10 + void verify(bool check_dictionary = true) { verify_on(tty, check_dictionary); } 34.11 34.12 #ifndef PRODUCT 34.13 void verify_vtable_index(int index);
35.1 --- a/src/share/vm/oops/method.cpp Thu Jun 27 09:59:59 2013 +0200 35.2 +++ b/src/share/vm/oops/method.cpp Fri Jun 28 18:28:17 2013 +0200 35.3 @@ -1969,14 +1969,9 @@ 35.4 35.5 void Method::verify_on(outputStream* st) { 35.6 guarantee(is_method(), "object must be method"); 35.7 - guarantee(is_metadata(), "should be metadata"); 35.8 guarantee(constants()->is_constantPool(), "should be constant pool"); 35.9 - guarantee(constants()->is_metadata(), "should be metadata"); 35.10 guarantee(constMethod()->is_constMethod(), "should be ConstMethod*"); 35.11 - guarantee(constMethod()->is_metadata(), "should be metadata"); 35.12 MethodData* md = method_data(); 35.13 guarantee(md == NULL || 35.14 - md->is_metadata(), "should be metadata"); 35.15 - guarantee(md == NULL || 35.16 md->is_methodData(), "should be method data"); 35.17 }
36.1 --- a/src/share/vm/oops/objArrayKlass.cpp Thu Jun 27 09:59:59 2013 +0200 36.2 +++ b/src/share/vm/oops/objArrayKlass.cpp Fri Jun 28 18:28:17 2013 +0200 36.3 @@ -676,11 +676,9 @@ 36.4 36.5 // Verification 36.6 36.7 -void ObjArrayKlass::verify_on(outputStream* st) { 36.8 - ArrayKlass::verify_on(st); 36.9 - guarantee(element_klass()->is_metadata(), "should be in metaspace"); 36.10 +void ObjArrayKlass::verify_on(outputStream* st, bool check_dictionary) { 36.11 + ArrayKlass::verify_on(st, check_dictionary); 36.12 guarantee(element_klass()->is_klass(), "should be klass"); 36.13 - guarantee(bottom_klass()->is_metadata(), "should be in metaspace"); 36.14 guarantee(bottom_klass()->is_klass(), "should be klass"); 36.15 Klass* bk = bottom_klass(); 36.16 guarantee(bk->oop_is_instance() || bk->oop_is_typeArray(), "invalid bottom klass");
37.1 --- a/src/share/vm/oops/objArrayKlass.hpp Thu Jun 27 09:59:59 2013 +0200 37.2 +++ b/src/share/vm/oops/objArrayKlass.hpp Fri Jun 28 18:28:17 2013 +0200 37.3 @@ -151,7 +151,7 @@ 37.4 const char* internal_name() const; 37.5 37.6 // Verification 37.7 - void verify_on(outputStream* st); 37.8 + void verify_on(outputStream* st, bool check_dictionary); 37.9 37.10 void oop_verify_on(oop obj, outputStream* st); 37.11 };
38.1 --- a/src/share/vm/oops/symbol.cpp Thu Jun 27 09:59:59 2013 +0200 38.2 +++ b/src/share/vm/oops/symbol.cpp Fri Jun 28 18:28:17 2013 +0200 38.3 @@ -32,7 +32,9 @@ 38.4 #include "memory/allocation.inline.hpp" 38.5 #include "memory/resourceArea.hpp" 38.6 38.7 -Symbol::Symbol(const u1* name, int length, int refcount) : _refcount(refcount), _length(length) { 38.8 +Symbol::Symbol(const u1* name, int length, int refcount) { 38.9 + _refcount = refcount; 38.10 + _length = length; 38.11 _identity_hash = os::random(); 38.12 for (int i = 0; i < _length; i++) { 38.13 byte_at_put(i, name[i]);
39.1 --- a/src/share/vm/oops/symbol.hpp Thu Jun 27 09:59:59 2013 +0200 39.2 +++ b/src/share/vm/oops/symbol.hpp Fri Jun 28 18:28:17 2013 +0200 39.3 @@ -27,6 +27,7 @@ 39.4 39.5 #include "utilities/utf8.hpp" 39.6 #include "memory/allocation.hpp" 39.7 +#include "runtime/atomic.hpp" 39.8 39.9 // A Symbol is a canonicalized string. 39.10 // All Symbols reside in global SymbolTable and are reference counted. 39.11 @@ -101,14 +102,22 @@ 39.12 // type without virtual functions. 39.13 class ClassLoaderData; 39.14 39.15 -class Symbol : public MetaspaceObj { 39.16 +// We separate the fields in SymbolBase from Symbol::_body so that 39.17 +// Symbol::size(int) can correctly calculate the space needed. 39.18 +class SymbolBase : public MetaspaceObj { 39.19 + public: 39.20 + ATOMIC_SHORT_PAIR( 39.21 + volatile short _refcount, // needs atomic operation 39.22 + unsigned short _length // number of UTF8 characters in the symbol (does not need atomic op) 39.23 + ); 39.24 + int _identity_hash; 39.25 +}; 39.26 + 39.27 +class Symbol : private SymbolBase { 39.28 friend class VMStructs; 39.29 friend class SymbolTable; 39.30 friend class MoveSymbols; 39.31 private: 39.32 - volatile int _refcount; 39.33 - int _identity_hash; 39.34 - unsigned short _length; // number of UTF8 characters in the symbol 39.35 jbyte _body[1]; 39.36 39.37 enum { 39.38 @@ -117,7 +126,7 @@ 39.39 }; 39.40 39.41 static int size(int length) { 39.42 - size_t sz = heap_word_size(sizeof(Symbol) + (length > 0 ? length - 1 : 0)); 39.43 + size_t sz = heap_word_size(sizeof(SymbolBase) + (length > 0 ? length : 0)); 39.44 return align_object_size(sz); 39.45 } 39.46
40.1 --- a/src/share/vm/opto/memnode.cpp Thu Jun 27 09:59:59 2013 +0200 40.2 +++ b/src/share/vm/opto/memnode.cpp Fri Jun 28 18:28:17 2013 +0200 40.3 @@ -2943,11 +2943,19 @@ 40.4 Node* my_mem = in(MemBarNode::Precedent); 40.5 // The MembarAquire may keep an unused LoadNode alive through the Precedent edge 40.6 if ((my_mem != NULL) && (opc == Op_MemBarAcquire) && (my_mem->outcnt() == 1)) { 40.7 - assert(my_mem->unique_out() == this, "sanity"); 40.8 - phase->hash_delete(this); 40.9 - del_req(Precedent); 40.10 - phase->is_IterGVN()->_worklist.push(my_mem); // remove dead node later 40.11 - my_mem = NULL; 40.12 + // if the Precedent is a decodeN and its input (a Load) is used at more than one place, 40.13 + // replace this Precedent (decodeN) with the Load instead. 40.14 + if ((my_mem->Opcode() == Op_DecodeN) && (my_mem->in(1)->outcnt() > 1)) { 40.15 + Node* load_node = my_mem->in(1); 40.16 + set_req(MemBarNode::Precedent, load_node); 40.17 + phase->is_IterGVN()->_worklist.push(my_mem); 40.18 + my_mem = load_node; 40.19 + } else { 40.20 + assert(my_mem->unique_out() == this, "sanity"); 40.21 + del_req(Precedent); 40.22 + phase->is_IterGVN()->_worklist.push(my_mem); // remove dead node later 40.23 + my_mem = NULL; 40.24 + } 40.25 } 40.26 if (my_mem != NULL && my_mem->is_Mem()) { 40.27 const TypeOopPtr* t_oop = my_mem->in(MemNode::Address)->bottom_type()->isa_oopptr();
41.1 --- a/src/share/vm/runtime/atomic.cpp Thu Jun 27 09:59:59 2013 +0200 41.2 +++ b/src/share/vm/runtime/atomic.cpp Fri Jun 28 18:28:17 2013 +0200 41.3 @@ -80,3 +80,32 @@ 41.4 } 41.5 return old; 41.6 } 41.7 + 41.8 +void Atomic::inc(volatile short* dest) { 41.9 + // Most platforms do not support atomic increment on a 2-byte value. However, 41.10 + // if the value occupies the most significant 16 bits of an aligned 32-bit 41.11 + // word, then we can do this with an atomic add of 0x10000 to the 32-bit word. 41.12 + // 41.13 + // The least significant parts of this 32-bit word will never be affected, even 41.14 + // in case of overflow/underflow. 41.15 + // 41.16 + // Use the ATOMIC_SHORT_PAIR macro to get the desired alignment. 41.17 +#ifdef VM_LITTLE_ENDIAN 41.18 + assert((intx(dest) & 0x03) == 0x02, "wrong alignment"); 41.19 + (void)Atomic::add(0x10000, (volatile int*)(dest-1)); 41.20 +#else 41.21 + assert((intx(dest) & 0x03) == 0x00, "wrong alignment"); 41.22 + (void)Atomic::add(0x10000, (volatile int*)(dest)); 41.23 +#endif 41.24 +} 41.25 + 41.26 +void Atomic::dec(volatile short* dest) { 41.27 +#ifdef VM_LITTLE_ENDIAN 41.28 + assert((intx(dest) & 0x03) == 0x02, "wrong alignment"); 41.29 + (void)Atomic::add(-0x10000, (volatile int*)(dest-1)); 41.30 +#else 41.31 + assert((intx(dest) & 0x03) == 0x00, "wrong alignment"); 41.32 + (void)Atomic::add(-0x10000, (volatile int*)(dest)); 41.33 +#endif 41.34 +} 41.35 +
42.1 --- a/src/share/vm/runtime/atomic.hpp Thu Jun 27 09:59:59 2013 +0200 42.2 +++ b/src/share/vm/runtime/atomic.hpp Fri Jun 28 18:28:17 2013 +0200 42.3 @@ -64,11 +64,13 @@ 42.4 42.5 // Atomically increment location 42.6 inline static void inc (volatile jint* dest); 42.7 + static void inc (volatile jshort* dest); 42.8 inline static void inc_ptr(volatile intptr_t* dest); 42.9 inline static void inc_ptr(volatile void* dest); 42.10 42.11 // Atomically decrement a location 42.12 inline static void dec (volatile jint* dest); 42.13 + static void dec (volatile jshort* dest); 42.14 inline static void dec_ptr(volatile intptr_t* dest); 42.15 inline static void dec_ptr(volatile void* dest); 42.16 42.17 @@ -95,4 +97,24 @@ 42.18 inline static void* cmpxchg_ptr(void* exchange_value, volatile void* dest, void* compare_value); 42.19 }; 42.20 42.21 +// To use Atomic::inc(jshort* dest) and Atomic::dec(jshort* dest), the address must be specially 42.22 +// aligned, such that (*dest) occupies the upper 16 bits of an aligned 32-bit word. The best way to 42.23 +// achieve is to place your short value next to another short value, which doesn't need atomic ops. 42.24 +// 42.25 +// Example 42.26 +// ATOMIC_SHORT_PAIR( 42.27 +// volatile short _refcount, // needs atomic operation 42.28 +// unsigned short _length // number of UTF8 characters in the symbol (does not need atomic op) 42.29 +// ); 42.30 + 42.31 +#ifdef VM_LITTLE_ENDIAN 42.32 +#define ATOMIC_SHORT_PAIR(atomic_decl, non_atomic_decl) \ 42.33 + non_atomic_decl; \ 42.34 + atomic_decl 42.35 +#else 42.36 +#define ATOMIC_SHORT_PAIR(atomic_decl, non_atomic_decl) \ 42.37 + atomic_decl ; \ 42.38 + non_atomic_decl 42.39 +#endif 42.40 + 42.41 #endif // SHARE_VM_RUNTIME_ATOMIC_HPP
43.1 --- a/src/share/vm/runtime/frame.cpp Thu Jun 27 09:59:59 2013 +0200 43.2 +++ b/src/share/vm/runtime/frame.cpp Fri Jun 28 18:28:17 2013 +0200 43.3 @@ -387,7 +387,6 @@ 43.4 Method* frame::interpreter_frame_method() const { 43.5 assert(is_interpreted_frame(), "interpreted frame expected"); 43.6 Method* m = *interpreter_frame_method_addr(); 43.7 - assert(m->is_metadata(), "bad Method* in interpreter frame"); 43.8 assert(m->is_method(), "not a Method*"); 43.9 return m; 43.10 } 43.11 @@ -713,7 +712,8 @@ 43.12 Method* m = ((nmethod *)_cb)->method(); 43.13 if (m != NULL) { 43.14 m->name_and_sig_as_C_string(buf, buflen); 43.15 - st->print("J %s", buf); 43.16 + st->print("J %s @ " PTR_FORMAT " [" PTR_FORMAT "+" SIZE_FORMAT "]", 43.17 + buf, _pc, _cb->code_begin(), _pc - _cb->code_begin()); 43.18 } else { 43.19 st->print("J " PTR_FORMAT, pc()); 43.20 }
44.1 --- a/src/share/vm/runtime/globals.cpp Thu Jun 27 09:59:59 2013 +0200 44.2 +++ b/src/share/vm/runtime/globals.cpp Fri Jun 28 18:28:17 2013 +0200 44.3 @@ -73,12 +73,6 @@ 44.4 strcmp(kind, "{C2 diagnostic}") == 0 || 44.5 strcmp(kind, "{ARCH diagnostic}") == 0 || 44.6 strcmp(kind, "{Shark diagnostic}") == 0) { 44.7 - if (strcmp(name, "EnableInvokeDynamic") == 0 && UnlockExperimentalVMOptions && !UnlockDiagnosticVMOptions) { 44.8 - // transitional logic to allow tests to run until they are changed 44.9 - static int warned; 44.10 - if (++warned == 1) warning("Use -XX:+UnlockDiagnosticVMOptions before EnableInvokeDynamic flag"); 44.11 - return true; 44.12 - } 44.13 return UnlockDiagnosticVMOptions; 44.14 } else if (strcmp(kind, "{experimental}") == 0 || 44.15 strcmp(kind, "{C2 experimental}") == 0 ||
45.1 --- a/src/share/vm/runtime/sharedRuntime.cpp Thu Jun 27 09:59:59 2013 +0200 45.2 +++ b/src/share/vm/runtime/sharedRuntime.cpp Fri Jun 28 18:28:17 2013 +0200 45.3 @@ -813,8 +813,11 @@ 45.4 // 3. Implict null exception in nmethod 45.5 45.6 if (!cb->is_nmethod()) { 45.7 - guarantee(cb->is_adapter_blob() || cb->is_method_handles_adapter_blob(), 45.8 - "exception happened outside interpreter, nmethods and vtable stubs (1)"); 45.9 + bool is_in_blob = cb->is_adapter_blob() || cb->is_method_handles_adapter_blob(); 45.10 + if (!is_in_blob) { 45.11 + cb->print(); 45.12 + fatal(err_msg("exception happened outside interpreter, nmethods and vtable stubs at pc " INTPTR_FORMAT, pc)); 45.13 + } 45.14 Events::log_exception(thread, "NullPointerException in code blob at " INTPTR_FORMAT, pc); 45.15 // There is no handler here, so we will simply unwind. 45.16 return StubRoutines::throw_NullPointerException_at_call_entry();
46.1 --- a/src/share/vm/runtime/thread.cpp Thu Jun 27 09:59:59 2013 +0200 46.2 +++ b/src/share/vm/runtime/thread.cpp Fri Jun 28 18:28:17 2013 +0200 46.3 @@ -220,7 +220,7 @@ 46.4 set_osthread(NULL); 46.5 set_resource_area(new (mtThread)ResourceArea()); 46.6 set_handle_area(new (mtThread) HandleArea(NULL)); 46.7 - set_metadata_handles(new (ResourceObj::C_HEAP, mtClass) GrowableArray<Metadata*>(300, true)); 46.8 + set_metadata_handles(new (ResourceObj::C_HEAP, mtClass) GrowableArray<Metadata*>(30, true)); 46.9 set_active_handles(NULL); 46.10 set_free_handle_block(NULL); 46.11 set_last_handle_mark(NULL);
47.1 --- a/src/share/vm/runtime/vmStructs.cpp Thu Jun 27 09:59:59 2013 +0200 47.2 +++ b/src/share/vm/runtime/vmStructs.cpp Fri Jun 28 18:28:17 2013 +0200 47.3 @@ -379,7 +379,7 @@ 47.4 nonstatic_field(ConstMethod, _size_of_parameters, u2) \ 47.5 nonstatic_field(ObjArrayKlass, _element_klass, Klass*) \ 47.6 nonstatic_field(ObjArrayKlass, _bottom_klass, Klass*) \ 47.7 - volatile_nonstatic_field(Symbol, _refcount, int) \ 47.8 + volatile_nonstatic_field(Symbol, _refcount, short) \ 47.9 nonstatic_field(Symbol, _identity_hash, int) \ 47.10 nonstatic_field(Symbol, _length, unsigned short) \ 47.11 unchecked_nonstatic_field(Symbol, _body, sizeof(jbyte)) /* NOTE: no type */ \
48.1 --- a/src/share/vm/shark/sharkBuilder.cpp Thu Jun 27 09:59:59 2013 +0200 48.2 +++ b/src/share/vm/shark/sharkBuilder.cpp Fri Jun 28 18:28:17 2013 +0200 48.3 @@ -471,7 +471,7 @@ 48.4 48.5 Value* SharkBuilder::CreateInlineMetadata(Metadata* metadata, llvm::PointerType* type, const char* name) { 48.6 assert(metadata != NULL, "inlined metadata must not be NULL"); 48.7 - assert(metadata->is_metadata(), "sanity check"); 48.8 + assert(metadata->is_metaspace_object(), "sanity check"); 48.9 return CreateLoad( 48.10 CreateIntToPtr( 48.11 code_buffer_address(code_buffer()->inline_Metadata(metadata)),
49.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 49.2 +++ b/test/compiler/8005956/PolynomialRoot.java Fri Jun 28 18:28:17 2013 +0200 49.3 @@ -0,0 +1,776 @@ 49.4 +//package com.polytechnik.utils; 49.5 +/* 49.6 + * (C) Vladislav Malyshkin 2010 49.7 + * This file is under GPL version 3. 49.8 + * 49.9 + */ 49.10 + 49.11 +/** Polynomial root. 49.12 + * @version $Id: PolynomialRoot.java,v 1.105 2012/08/18 00:00:05 mal Exp $ 49.13 + * @author Vladislav Malyshkin mal@gromco.com 49.14 + */ 49.15 + 49.16 +/** 49.17 +* @test 49.18 +* @bug 8005956 49.19 +* @summary C2: assert(!def_outside->member(r)) failed: Use of external LRG overlaps the same LRG defined in this block 49.20 +* 49.21 +* @run main PolynomialRoot 49.22 +*/ 49.23 + 49.24 +public class PolynomialRoot { 49.25 + 49.26 + 49.27 +public static int findPolynomialRoots(final int n, 49.28 + final double [] p, 49.29 + final double [] re_root, 49.30 + final double [] im_root) 49.31 +{ 49.32 + if(n==4) 49.33 + { 49.34 + return root4(p,re_root,im_root); 49.35 + } 49.36 + else if(n==3) 49.37 + { 49.38 + return root3(p,re_root,im_root); 49.39 + } 49.40 + else if(n==2) 49.41 + { 49.42 + return root2(p,re_root,im_root); 49.43 + } 49.44 + else if(n==1) 49.45 + { 49.46 + return root1(p,re_root,im_root); 49.47 + } 49.48 + else 49.49 + { 49.50 + throw new RuntimeException("n="+n+" is not supported yet"); 49.51 + } 49.52 +} 49.53 + 49.54 + 49.55 + 49.56 +static final double SQRT3=Math.sqrt(3.0),SQRT2=Math.sqrt(2.0); 49.57 + 49.58 + 49.59 +private static final boolean PRINT_DEBUG=false; 49.60 + 49.61 +public static int root4(final double [] p,final double [] re_root,final double [] im_root) 49.62 +{ 49.63 + if(PRINT_DEBUG) System.err.println("=====================root4:p="+java.util.Arrays.toString(p)); 49.64 + final double vs=p[4]; 49.65 + if(PRINT_DEBUG) System.err.println("p[4]="+p[4]); 49.66 + if(!(Math.abs(vs)>EPS)) 49.67 + { 49.68 + re_root[0]=re_root[1]=re_root[2]=re_root[3]= 49.69 + im_root[0]=im_root[1]=im_root[2]=im_root[3]=Double.NaN; 49.70 + return -1; 49.71 + } 49.72 + 49.73 +/* zsolve_quartic.c - finds the complex roots of 49.74 + * x^4 + a x^3 + b x^2 + c x + d = 0 49.75 + */ 49.76 + final double a=p[3]/vs,b=p[2]/vs,c=p[1]/vs,d=p[0]/vs; 49.77 + if(PRINT_DEBUG) System.err.println("input a="+a+" b="+b+" c="+c+" d="+d); 49.78 + 49.79 + 49.80 + final double r4 = 1.0 / 4.0; 49.81 + final double q2 = 1.0 / 2.0, q4 = 1.0 / 4.0, q8 = 1.0 / 8.0; 49.82 + final double q1 = 3.0 / 8.0, q3 = 3.0 / 16.0; 49.83 + final int mt; 49.84 + 49.85 + /* Deal easily with the cases where the quartic is degenerate. The 49.86 + * ordering of solutions is done explicitly. */ 49.87 + if (0 == b && 0 == c) 49.88 + { 49.89 + if (0 == d) 49.90 + { 49.91 + re_root[0]=-a; 49.92 + im_root[0]=im_root[1]=im_root[2]=im_root[3]=0; 49.93 + re_root[1]=re_root[2]=re_root[3]=0; 49.94 + return 4; 49.95 + } 49.96 + else if (0 == a) 49.97 + { 49.98 + if (d > 0) 49.99 + { 49.100 + final double sq4 = Math.sqrt(Math.sqrt(d)); 49.101 + re_root[0]=sq4*SQRT2/2; 49.102 + im_root[0]=re_root[0]; 49.103 + re_root[1]=-re_root[0]; 49.104 + im_root[1]=re_root[0]; 49.105 + re_root[2]=-re_root[0]; 49.106 + im_root[2]=-re_root[0]; 49.107 + re_root[3]=re_root[0]; 49.108 + im_root[3]=-re_root[0]; 49.109 + if(PRINT_DEBUG) System.err.println("Path a=0 d>0"); 49.110 + } 49.111 + else 49.112 + { 49.113 + final double sq4 = Math.sqrt(Math.sqrt(-d)); 49.114 + re_root[0]=sq4; 49.115 + im_root[0]=0; 49.116 + re_root[1]=0; 49.117 + im_root[1]=sq4; 49.118 + re_root[2]=0; 49.119 + im_root[2]=-sq4; 49.120 + re_root[3]=-sq4; 49.121 + im_root[3]=0; 49.122 + if(PRINT_DEBUG) System.err.println("Path a=0 d<0"); 49.123 + } 49.124 + return 4; 49.125 + } 49.126 + } 49.127 + 49.128 + if (0.0 == c && 0.0 == d) 49.129 + { 49.130 + root2(new double []{p[2],p[3],p[4]},re_root,im_root); 49.131 + re_root[2]=im_root[2]=re_root[3]=im_root[3]=0; 49.132 + return 4; 49.133 + } 49.134 + 49.135 + if(PRINT_DEBUG) System.err.println("G Path c="+c+" d="+d); 49.136 + final double [] u=new double[3]; 49.137 + 49.138 + if(PRINT_DEBUG) System.err.println("Generic Path"); 49.139 + /* For non-degenerate solutions, proceed by constructing and 49.140 + * solving the resolvent cubic */ 49.141 + final double aa = a * a; 49.142 + final double pp = b - q1 * aa; 49.143 + final double qq = c - q2 * a * (b - q4 * aa); 49.144 + final double rr = d - q4 * a * (c - q4 * a * (b - q3 * aa)); 49.145 + final double rc = q2 * pp , rc3 = rc / 3; 49.146 + final double sc = q4 * (q4 * pp * pp - rr); 49.147 + final double tc = -(q8 * qq * q8 * qq); 49.148 + if(PRINT_DEBUG) System.err.println("aa="+aa+" pp="+pp+" qq="+qq+" rr="+rr+" rc="+rc+" sc="+sc+" tc="+tc); 49.149 + final boolean flag_realroots; 49.150 + 49.151 + /* This code solves the resolvent cubic in a convenient fashion 49.152 + * for this implementation of the quartic. If there are three real 49.153 + * roots, then they are placed directly into u[]. If two are 49.154 + * complex, then the real root is put into u[0] and the real 49.155 + * and imaginary part of the complex roots are placed into 49.156 + * u[1] and u[2], respectively. */ 49.157 + { 49.158 + final double qcub = (rc * rc - 3 * sc); 49.159 + final double rcub = (rc*(2 * rc * rc - 9 * sc) + 27 * tc); 49.160 + 49.161 + final double Q = qcub / 9; 49.162 + final double R = rcub / 54; 49.163 + 49.164 + final double Q3 = Q * Q * Q; 49.165 + final double R2 = R * R; 49.166 + 49.167 + final double CR2 = 729 * rcub * rcub; 49.168 + final double CQ3 = 2916 * qcub * qcub * qcub; 49.169 + 49.170 + if(PRINT_DEBUG) System.err.println("CR2="+CR2+" CQ3="+CQ3+" R="+R+" Q="+Q); 49.171 + 49.172 + if (0 == R && 0 == Q) 49.173 + { 49.174 + flag_realroots=true; 49.175 + u[0] = -rc3; 49.176 + u[1] = -rc3; 49.177 + u[2] = -rc3; 49.178 + } 49.179 + else if (CR2 == CQ3) 49.180 + { 49.181 + flag_realroots=true; 49.182 + final double sqrtQ = Math.sqrt (Q); 49.183 + if (R > 0) 49.184 + { 49.185 + u[0] = -2 * sqrtQ - rc3; 49.186 + u[1] = sqrtQ - rc3; 49.187 + u[2] = sqrtQ - rc3; 49.188 + } 49.189 + else 49.190 + { 49.191 + u[0] = -sqrtQ - rc3; 49.192 + u[1] = -sqrtQ - rc3; 49.193 + u[2] = 2 * sqrtQ - rc3; 49.194 + } 49.195 + } 49.196 + else if (R2 < Q3) 49.197 + { 49.198 + flag_realroots=true; 49.199 + final double ratio = (R >= 0?1:-1) * Math.sqrt (R2 / Q3); 49.200 + final double theta = Math.acos (ratio); 49.201 + final double norm = -2 * Math.sqrt (Q); 49.202 + 49.203 + u[0] = norm * Math.cos (theta / 3) - rc3; 49.204 + u[1] = norm * Math.cos ((theta + 2.0 * Math.PI) / 3) - rc3; 49.205 + u[2] = norm * Math.cos ((theta - 2.0 * Math.PI) / 3) - rc3; 49.206 + } 49.207 + else 49.208 + { 49.209 + flag_realroots=false; 49.210 + final double A = -(R >= 0?1:-1)*Math.pow(Math.abs(R)+Math.sqrt(R2-Q3),1.0/3.0); 49.211 + final double B = Q / A; 49.212 + 49.213 + u[0] = A + B - rc3; 49.214 + u[1] = -0.5 * (A + B) - rc3; 49.215 + u[2] = -(SQRT3*0.5) * Math.abs (A - B); 49.216 + } 49.217 + if(PRINT_DEBUG) System.err.println("u[0]="+u[0]+" u[1]="+u[1]+" u[2]="+u[2]+" qq="+qq+" disc="+((CR2 - CQ3) / 2125764.0)); 49.218 + } 49.219 + /* End of solution to resolvent cubic */ 49.220 + 49.221 + /* Combine the square roots of the roots of the cubic 49.222 + * resolvent appropriately. Also, calculate 'mt' which 49.223 + * designates the nature of the roots: 49.224 + * mt=1 : 4 real roots 49.225 + * mt=2 : 0 real roots 49.226 + * mt=3 : 2 real roots 49.227 + */ 49.228 + 49.229 + 49.230 + final double w1_re,w1_im,w2_re,w2_im,w3_re,w3_im,mod_w1w2,mod_w1w2_squared; 49.231 + if (flag_realroots) 49.232 + { 49.233 + mod_w1w2=-1; 49.234 + mt = 2; 49.235 + int jmin=0; 49.236 + double vmin=Math.abs(u[jmin]); 49.237 + for(int j=1;j<3;j++) 49.238 + { 49.239 + final double vx=Math.abs(u[j]); 49.240 + if(vx<vmin) 49.241 + { 49.242 + vmin=vx; 49.243 + jmin=j; 49.244 + } 49.245 + } 49.246 + final double u1=u[(jmin+1)%3],u2=u[(jmin+2)%3]; 49.247 + mod_w1w2_squared=Math.abs(u1*u2); 49.248 + if(u1>=0) 49.249 + { 49.250 + w1_re=Math.sqrt(u1); 49.251 + w1_im=0; 49.252 + } 49.253 + else 49.254 + { 49.255 + w1_re=0; 49.256 + w1_im=Math.sqrt(-u1); 49.257 + } 49.258 + if(u2>=0) 49.259 + { 49.260 + w2_re=Math.sqrt(u2); 49.261 + w2_im=0; 49.262 + } 49.263 + else 49.264 + { 49.265 + w2_re=0; 49.266 + w2_im=Math.sqrt(-u2); 49.267 + } 49.268 + if(PRINT_DEBUG) System.err.println("u1="+u1+" u2="+u2+" jmin="+jmin); 49.269 + } 49.270 + else 49.271 + { 49.272 + mt = 3; 49.273 + final double w_mod2_sq=u[1]*u[1]+u[2]*u[2],w_mod2=Math.sqrt(w_mod2_sq),w_mod=Math.sqrt(w_mod2); 49.274 + if(w_mod2_sq<=0) 49.275 + { 49.276 + w1_re=w1_im=0; 49.277 + } 49.278 + else 49.279 + { 49.280 + // calculate square root of a complex number (u[1],u[2]) 49.281 + // the result is in the (w1_re,w1_im) 49.282 + final double absu1=Math.abs(u[1]),absu2=Math.abs(u[2]),w; 49.283 + if(absu1>=absu2) 49.284 + { 49.285 + final double t=absu2/absu1; 49.286 + w=Math.sqrt(absu1*0.5 * (1.0 + Math.sqrt(1.0 + t * t))); 49.287 + if(PRINT_DEBUG) System.err.println(" Path1 "); 49.288 + } 49.289 + else 49.290 + { 49.291 + final double t=absu1/absu2; 49.292 + w=Math.sqrt(absu2*0.5 * (t + Math.sqrt(1.0 + t * t))); 49.293 + if(PRINT_DEBUG) System.err.println(" Path1a "); 49.294 + } 49.295 + if(u[1]>=0) 49.296 + { 49.297 + w1_re=w; 49.298 + w1_im=u[2]/(2*w); 49.299 + if(PRINT_DEBUG) System.err.println(" Path2 "); 49.300 + } 49.301 + else 49.302 + { 49.303 + final double vi = (u[2] >= 0) ? w : -w; 49.304 + w1_re=u[2]/(2*vi); 49.305 + w1_im=vi; 49.306 + if(PRINT_DEBUG) System.err.println(" Path2a "); 49.307 + } 49.308 + } 49.309 + final double absu0=Math.abs(u[0]); 49.310 + if(w_mod2>=absu0) 49.311 + { 49.312 + mod_w1w2=w_mod2; 49.313 + mod_w1w2_squared=w_mod2_sq; 49.314 + w2_re=w1_re; 49.315 + w2_im=-w1_im; 49.316 + } 49.317 + else 49.318 + { 49.319 + mod_w1w2=-1; 49.320 + mod_w1w2_squared=w_mod2*absu0; 49.321 + if(u[0]>=0) 49.322 + { 49.323 + w2_re=Math.sqrt(absu0); 49.324 + w2_im=0; 49.325 + } 49.326 + else 49.327 + { 49.328 + w2_re=0; 49.329 + w2_im=Math.sqrt(absu0); 49.330 + } 49.331 + } 49.332 + if(PRINT_DEBUG) System.err.println("u[0]="+u[0]+"u[1]="+u[1]+" u[2]="+u[2]+" absu0="+absu0+" w_mod="+w_mod+" w_mod2="+w_mod2); 49.333 + } 49.334 + 49.335 + /* Solve the quadratic in order to obtain the roots 49.336 + * to the quartic */ 49.337 + if(mod_w1w2>0) 49.338 + { 49.339 + // a shorcut to reduce rounding error 49.340 + w3_re=qq/(-8)/mod_w1w2; 49.341 + w3_im=0; 49.342 + } 49.343 + else if(mod_w1w2_squared>0) 49.344 + { 49.345 + // regular path 49.346 + final double mqq8n=qq/(-8)/mod_w1w2_squared; 49.347 + w3_re=mqq8n*(w1_re*w2_re-w1_im*w2_im); 49.348 + w3_im=-mqq8n*(w1_re*w2_im+w2_re*w1_im); 49.349 + } 49.350 + else 49.351 + { 49.352 + // typically occur when qq==0 49.353 + w3_re=w3_im=0; 49.354 + } 49.355 + 49.356 + final double h = r4 * a; 49.357 + if(PRINT_DEBUG) System.err.println("w1_re="+w1_re+" w1_im="+w1_im+" w2_re="+w2_re+" w2_im="+w2_im+" w3_re="+w3_re+" w3_im="+w3_im+" h="+h); 49.358 + 49.359 + re_root[0]=w1_re+w2_re+w3_re-h; 49.360 + im_root[0]=w1_im+w2_im+w3_im; 49.361 + re_root[1]=-(w1_re+w2_re)+w3_re-h; 49.362 + im_root[1]=-(w1_im+w2_im)+w3_im; 49.363 + re_root[2]=w2_re-w1_re-w3_re-h; 49.364 + im_root[2]=w2_im-w1_im-w3_im; 49.365 + re_root[3]=w1_re-w2_re-w3_re-h; 49.366 + im_root[3]=w1_im-w2_im-w3_im; 49.367 + 49.368 + return 4; 49.369 +} 49.370 + 49.371 + 49.372 + 49.373 + static void setRandomP(final double [] p,final int n,java.util.Random r) 49.374 + { 49.375 + if(r.nextDouble()<0.1) 49.376 + { 49.377 + // integer coefficiens 49.378 + for(int j=0;j<p.length;j++) 49.379 + { 49.380 + if(j<=n) 49.381 + { 49.382 + p[j]=(r.nextInt(2)<=0?-1:1)*r.nextInt(10); 49.383 + } 49.384 + else 49.385 + { 49.386 + p[j]=0; 49.387 + } 49.388 + } 49.389 + } 49.390 + else 49.391 + { 49.392 + // real coefficiens 49.393 + for(int j=0;j<p.length;j++) 49.394 + { 49.395 + if(j<=n) 49.396 + { 49.397 + p[j]=-1+2*r.nextDouble(); 49.398 + } 49.399 + else 49.400 + { 49.401 + p[j]=0; 49.402 + } 49.403 + } 49.404 + } 49.405 + if(Math.abs(p[n])<1e-2) 49.406 + { 49.407 + p[n]=(r.nextInt(2)<=0?-1:1)*(0.1+r.nextDouble()); 49.408 + } 49.409 + } 49.410 + 49.411 + 49.412 + static void checkValues(final double [] p, 49.413 + final int n, 49.414 + final double rex, 49.415 + final double imx, 49.416 + final double eps, 49.417 + final String txt) 49.418 + { 49.419 + double res=0,ims=0,sabs=0; 49.420 + final double xabs=Math.abs(rex)+Math.abs(imx); 49.421 + for(int k=n;k>=0;k--) 49.422 + { 49.423 + final double res1=(res*rex-ims*imx)+p[k]; 49.424 + final double ims1=(ims*rex+res*imx); 49.425 + res=res1; 49.426 + ims=ims1; 49.427 + sabs+=xabs*sabs+p[k]; 49.428 + } 49.429 + sabs=Math.abs(sabs); 49.430 + if(false && sabs>1/eps? 49.431 + (!(Math.abs(res/sabs)<=eps)||!(Math.abs(ims/sabs)<=eps)) 49.432 + : 49.433 + (!(Math.abs(res)<=eps)||!(Math.abs(ims)<=eps))) 49.434 + { 49.435 + throw new RuntimeException( 49.436 + getPolinomTXT(p)+"\n"+ 49.437 + "\t x.r="+rex+" x.i="+imx+"\n"+ 49.438 + "res/sabs="+(res/sabs)+" ims/sabs="+(ims/sabs)+ 49.439 + " sabs="+sabs+ 49.440 + "\nres="+res+" ims="+ims+" n="+n+" eps="+eps+" "+ 49.441 + " sabs>1/eps="+(sabs>1/eps)+ 49.442 + " f1="+(!(Math.abs(res/sabs)<=eps)||!(Math.abs(ims/sabs)<=eps))+ 49.443 + " f2="+(!(Math.abs(res)<=eps)||!(Math.abs(ims)<=eps))+ 49.444 + " "+txt); 49.445 + } 49.446 + } 49.447 + 49.448 + static String getPolinomTXT(final double [] p) 49.449 + { 49.450 + final StringBuilder buf=new StringBuilder(); 49.451 + buf.append("order="+(p.length-1)+"\t"); 49.452 + for(int k=0;k<p.length;k++) 49.453 + { 49.454 + buf.append("p["+k+"]="+p[k]+";"); 49.455 + } 49.456 + return buf.toString(); 49.457 + } 49.458 + 49.459 + static String getRootsTXT(int nr,final double [] re,final double [] im) 49.460 + { 49.461 + final StringBuilder buf=new StringBuilder(); 49.462 + for(int k=0;k<nr;k++) 49.463 + { 49.464 + buf.append("x."+k+"("+re[k]+","+im[k]+")\n"); 49.465 + } 49.466 + return buf.toString(); 49.467 + } 49.468 + 49.469 + static void testRoots(final int n, 49.470 + final int n_tests, 49.471 + final java.util.Random rn, 49.472 + final double eps) 49.473 + { 49.474 + final double [] p=new double [n+1]; 49.475 + final double [] rex=new double [n],imx=new double [n]; 49.476 + for(int i=0;i<n_tests;i++) 49.477 + { 49.478 + for(int dg=n;dg-->-1;) 49.479 + { 49.480 + for(int dr=3;dr-->0;) 49.481 + { 49.482 + setRandomP(p,n,rn); 49.483 + for(int j=0;j<=dg;j++) 49.484 + { 49.485 + p[j]=0; 49.486 + } 49.487 + if(dr==0) 49.488 + { 49.489 + p[0]=-1+2.0*rn.nextDouble(); 49.490 + } 49.491 + else if(dr==1) 49.492 + { 49.493 + p[0]=p[1]=0; 49.494 + } 49.495 + 49.496 + findPolynomialRoots(n,p,rex,imx); 49.497 + 49.498 + for(int j=0;j<n;j++) 49.499 + { 49.500 + //System.err.println("j="+j); 49.501 + checkValues(p,n,rex[j],imx[j],eps," t="+i); 49.502 + } 49.503 + } 49.504 + } 49.505 + } 49.506 + System.err.println("testRoots(): n_tests="+n_tests+" OK, dim="+n); 49.507 + } 49.508 + 49.509 + 49.510 + 49.511 + 49.512 + static final double EPS=0; 49.513 + 49.514 + public static int root1(final double [] p,final double [] re_root,final double [] im_root) 49.515 + { 49.516 + if(!(Math.abs(p[1])>EPS)) 49.517 + { 49.518 + re_root[0]=im_root[0]=Double.NaN; 49.519 + return -1; 49.520 + } 49.521 + re_root[0]=-p[0]/p[1]; 49.522 + im_root[0]=0; 49.523 + return 1; 49.524 + } 49.525 + 49.526 + public static int root2(final double [] p,final double [] re_root,final double [] im_root) 49.527 + { 49.528 + if(!(Math.abs(p[2])>EPS)) 49.529 + { 49.530 + re_root[0]=re_root[1]=im_root[0]=im_root[1]=Double.NaN; 49.531 + return -1; 49.532 + } 49.533 + final double b2=0.5*(p[1]/p[2]),c=p[0]/p[2],d=b2*b2-c; 49.534 + if(d>=0) 49.535 + { 49.536 + final double sq=Math.sqrt(d); 49.537 + if(b2<0) 49.538 + { 49.539 + re_root[1]=-b2+sq; 49.540 + re_root[0]=c/re_root[1]; 49.541 + } 49.542 + else if(b2>0) 49.543 + { 49.544 + re_root[0]=-b2-sq; 49.545 + re_root[1]=c/re_root[0]; 49.546 + } 49.547 + else 49.548 + { 49.549 + re_root[0]=-b2-sq; 49.550 + re_root[1]=-b2+sq; 49.551 + } 49.552 + im_root[0]=im_root[1]=0; 49.553 + } 49.554 + else 49.555 + { 49.556 + final double sq=Math.sqrt(-d); 49.557 + re_root[0]=re_root[1]=-b2; 49.558 + im_root[0]=sq; 49.559 + im_root[1]=-sq; 49.560 + } 49.561 + return 2; 49.562 + } 49.563 + 49.564 + public static int root3(final double [] p,final double [] re_root,final double [] im_root) 49.565 + { 49.566 + final double vs=p[3]; 49.567 + if(!(Math.abs(vs)>EPS)) 49.568 + { 49.569 + re_root[0]=re_root[1]=re_root[2]= 49.570 + im_root[0]=im_root[1]=im_root[2]=Double.NaN; 49.571 + return -1; 49.572 + } 49.573 + final double a=p[2]/vs,b=p[1]/vs,c=p[0]/vs; 49.574 + /* zsolve_cubic.c - finds the complex roots of x^3 + a x^2 + b x + c = 0 49.575 + */ 49.576 + final double q = (a * a - 3 * b); 49.577 + final double r = (a*(2 * a * a - 9 * b) + 27 * c); 49.578 + 49.579 + final double Q = q / 9; 49.580 + final double R = r / 54; 49.581 + 49.582 + final double Q3 = Q * Q * Q; 49.583 + final double R2 = R * R; 49.584 + 49.585 + final double CR2 = 729 * r * r; 49.586 + final double CQ3 = 2916 * q * q * q; 49.587 + final double a3=a/3; 49.588 + 49.589 + if (R == 0 && Q == 0) 49.590 + { 49.591 + re_root[0]=re_root[1]=re_root[2]=-a3; 49.592 + im_root[0]=im_root[1]=im_root[2]=0; 49.593 + return 3; 49.594 + } 49.595 + else if (CR2 == CQ3) 49.596 + { 49.597 + /* this test is actually R2 == Q3, written in a form suitable 49.598 + for exact computation with integers */ 49.599 + 49.600 + /* Due to finite precision some double roots may be missed, and 49.601 + will be considered to be a pair of complex roots z = x +/- 49.602 + epsilon i close to the real axis. */ 49.603 + 49.604 + final double sqrtQ = Math.sqrt (Q); 49.605 + 49.606 + if (R > 0) 49.607 + { 49.608 + re_root[0] = -2 * sqrtQ - a3; 49.609 + re_root[1]=re_root[2]=sqrtQ - a3; 49.610 + im_root[0]=im_root[1]=im_root[2]=0; 49.611 + } 49.612 + else 49.613 + { 49.614 + re_root[0]=re_root[1] = -sqrtQ - a3; 49.615 + re_root[2]=2 * sqrtQ - a3; 49.616 + im_root[0]=im_root[1]=im_root[2]=0; 49.617 + } 49.618 + return 3; 49.619 + } 49.620 + else if (R2 < Q3) 49.621 + { 49.622 + final double sgnR = (R >= 0 ? 1 : -1); 49.623 + final double ratio = sgnR * Math.sqrt (R2 / Q3); 49.624 + final double theta = Math.acos (ratio); 49.625 + final double norm = -2 * Math.sqrt (Q); 49.626 + final double r0 = norm * Math.cos (theta/3) - a3; 49.627 + final double r1 = norm * Math.cos ((theta + 2.0 * Math.PI) / 3) - a3; 49.628 + final double r2 = norm * Math.cos ((theta - 2.0 * Math.PI) / 3) - a3; 49.629 + 49.630 + re_root[0]=r0; 49.631 + re_root[1]=r1; 49.632 + re_root[2]=r2; 49.633 + im_root[0]=im_root[1]=im_root[2]=0; 49.634 + return 3; 49.635 + } 49.636 + else 49.637 + { 49.638 + final double sgnR = (R >= 0 ? 1 : -1); 49.639 + final double A = -sgnR * Math.pow (Math.abs (R) + Math.sqrt (R2 - Q3), 1.0 / 3.0); 49.640 + final double B = Q / A; 49.641 + 49.642 + re_root[0]=A + B - a3; 49.643 + im_root[0]=0; 49.644 + re_root[1]=-0.5 * (A + B) - a3; 49.645 + im_root[1]=-(SQRT3*0.5) * Math.abs(A - B); 49.646 + re_root[2]=re_root[1]; 49.647 + im_root[2]=-im_root[1]; 49.648 + return 3; 49.649 + } 49.650 + 49.651 + } 49.652 + 49.653 + 49.654 + static void root3a(final double [] p,final double [] re_root,final double [] im_root) 49.655 + { 49.656 + if(Math.abs(p[3])>EPS) 49.657 + { 49.658 + final double v=p[3], 49.659 + a=p[2]/v,b=p[1]/v,c=p[0]/v, 49.660 + a3=a/3,a3a=a3*a, 49.661 + pd3=(b-a3a)/3, 49.662 + qd2=a3*(a3a/3-0.5*b)+0.5*c, 49.663 + Q=pd3*pd3*pd3+qd2*qd2; 49.664 + if(Q<0) 49.665 + { 49.666 + // three real roots 49.667 + final double SQ=Math.sqrt(-Q); 49.668 + final double th=Math.atan2(SQ,-qd2); 49.669 + im_root[0]=im_root[1]=im_root[2]=0; 49.670 + final double f=2*Math.sqrt(-pd3); 49.671 + re_root[0]=f*Math.cos(th/3)-a3; 49.672 + re_root[1]=f*Math.cos((th+2*Math.PI)/3)-a3; 49.673 + re_root[2]=f*Math.cos((th+4*Math.PI)/3)-a3; 49.674 + //System.err.println("3r"); 49.675 + } 49.676 + else 49.677 + { 49.678 + // one real & two complex roots 49.679 + final double SQ=Math.sqrt(Q); 49.680 + final double r1=-qd2+SQ,r2=-qd2-SQ; 49.681 + final double v1=Math.signum(r1)*Math.pow(Math.abs(r1),1.0/3), 49.682 + v2=Math.signum(r2)*Math.pow(Math.abs(r2),1.0/3), 49.683 + sv=v1+v2; 49.684 + // real root 49.685 + re_root[0]=sv-a3; 49.686 + im_root[0]=0; 49.687 + // complex roots 49.688 + re_root[1]=re_root[2]=-0.5*sv-a3; 49.689 + im_root[1]=(v1-v2)*(SQRT3*0.5); 49.690 + im_root[2]=-im_root[1]; 49.691 + //System.err.println("1r2c"); 49.692 + } 49.693 + } 49.694 + else 49.695 + { 49.696 + re_root[0]=re_root[1]=re_root[2]=im_root[0]=im_root[1]=im_root[2]=Double.NaN; 49.697 + } 49.698 + } 49.699 + 49.700 + 49.701 + static void printSpecialValues() 49.702 + { 49.703 + for(int st=0;st<6;st++) 49.704 + { 49.705 + //final double [] p=new double []{8,1,3,3.6,1}; 49.706 + final double [] re_root=new double [4],im_root=new double [4]; 49.707 + final double [] p; 49.708 + final int n; 49.709 + if(st<=3) 49.710 + { 49.711 + if(st<=0) 49.712 + { 49.713 + p=new double []{2,-4,6,-4,1}; 49.714 + //p=new double []{-6,6,-6,8,-2}; 49.715 + } 49.716 + else if(st==1) 49.717 + { 49.718 + p=new double []{0,-4,8,3,-9}; 49.719 + } 49.720 + else if(st==2) 49.721 + { 49.722 + p=new double []{-1,0,2,0,-1}; 49.723 + } 49.724 + else 49.725 + { 49.726 + p=new double []{-5,2,8,-2,-3}; 49.727 + } 49.728 + root4(p,re_root,im_root); 49.729 + n=4; 49.730 + } 49.731 + else 49.732 + { 49.733 + p=new double []{0,2,0,1}; 49.734 + if(st==4) 49.735 + { 49.736 + p[1]=-p[1]; 49.737 + } 49.738 + root3(p,re_root,im_root); 49.739 + n=3; 49.740 + } 49.741 + System.err.println("======== n="+n); 49.742 + for(int i=0;i<=n;i++) 49.743 + { 49.744 + if(i<n) 49.745 + { 49.746 + System.err.println(String.valueOf(i)+"\t"+ 49.747 + p[i]+"\t"+ 49.748 + re_root[i]+"\t"+ 49.749 + im_root[i]); 49.750 + } 49.751 + else 49.752 + { 49.753 + System.err.println(String.valueOf(i)+"\t"+p[i]+"\t"); 49.754 + } 49.755 + } 49.756 + } 49.757 + } 49.758 + 49.759 + 49.760 + 49.761 + public static void main(final String [] args) 49.762 + { 49.763 + final long t0=System.currentTimeMillis(); 49.764 + final double eps=1e-6; 49.765 + //checkRoots(); 49.766 + final java.util.Random r=new java.util.Random(-1381923); 49.767 + printSpecialValues(); 49.768 + 49.769 + final int n_tests=10000000; 49.770 + //testRoots(2,n_tests,r,eps); 49.771 + //testRoots(3,n_tests,r,eps); 49.772 + testRoots(4,n_tests,r,eps); 49.773 + final long t1=System.currentTimeMillis(); 49.774 + System.err.println("PolynomialRoot.main: "+n_tests+" tests OK done in "+(t1-t0)+" milliseconds. ver=$Id: PolynomialRoot.java,v 1.105 2012/08/18 00:00:05 mal Exp $"); 49.775 + } 49.776 + 49.777 + 49.778 + 49.779 +}