Wed, 03 Apr 2013 09:19:02 +0200
Merge
make/windows/projectfiles/kernel/Makefile | file | annotate | diff | comparison | revisions | |
make/windows/projectfiles/kernel/vm.def | file | annotate | diff | comparison | revisions | |
make/windows/projectfiles/kernel/vm.dsw | file | annotate | diff | comparison | revisions | |
src/os/linux/vm/os_linux.cpp | file | annotate | diff | comparison | revisions | |
src/share/vm/runtime/arguments.cpp | file | annotate | diff | comparison | revisions | |
src/share/vm/runtime/globals.hpp | file | annotate | diff | comparison | revisions | |
test/runtime/8007736/TestStaticIF.java | file | annotate | diff | comparison | revisions |
1.1 --- a/.hgtags Tue Apr 02 10:03:02 2013 +0200 1.2 +++ b/.hgtags Wed Apr 03 09:19:02 2013 +0200 1.3 @@ -326,3 +326,5 @@ 1.4 0631ebcc45f05c73b09a56c2586685af1f781c1d hs25-b23 1.5 3db4ab0e12f437fe374817de346b2b0c6b4a5b31 jdk8-b82 1.6 e3a41fc0234895eba4f272b984f7dacff495f8eb hs25-b24 1.7 +1c8db54ee9f315e20d6d5d9bf0b5c10349e9d301 jdk8-b83 1.8 +8d0f263a370c5f3e61791bb06054560804117288 hs25-b25
2.1 --- a/make/bsd/makefiles/mapfile-vers-debug Tue Apr 02 10:03:02 2013 +0200 2.2 +++ b/make/bsd/makefiles/mapfile-vers-debug Wed Apr 03 09:19:02 2013 +0200 2.3 @@ -135,6 +135,7 @@ 2.4 JVM_GetEnclosingMethodInfo; 2.5 JVM_GetFieldAnnotations; 2.6 JVM_GetFieldIxModifiers; 2.7 + JVM_GetFieldTypeAnnotations; 2.8 JVM_GetHostName; 2.9 JVM_GetInheritedAccessControlContext; 2.10 JVM_GetInterfaceVersion; 2.11 @@ -156,6 +157,7 @@ 2.12 JVM_GetMethodIxSignatureUTF; 2.13 JVM_GetMethodParameterAnnotations; 2.14 JVM_GetMethodParameters; 2.15 + JVM_GetMethodTypeAnnotations; 2.16 JVM_GetPrimitiveArrayElement; 2.17 JVM_GetProtectionDomain; 2.18 JVM_GetSockName;
3.1 --- a/make/bsd/makefiles/mapfile-vers-product Tue Apr 02 10:03:02 2013 +0200 3.2 +++ b/make/bsd/makefiles/mapfile-vers-product Wed Apr 03 09:19:02 2013 +0200 3.3 @@ -135,6 +135,7 @@ 3.4 JVM_GetEnclosingMethodInfo; 3.5 JVM_GetFieldAnnotations; 3.6 JVM_GetFieldIxModifiers; 3.7 + JVM_GetFieldTypeAnnotations; 3.8 JVM_GetHostName; 3.9 JVM_GetInheritedAccessControlContext; 3.10 JVM_GetInterfaceVersion; 3.11 @@ -156,6 +157,7 @@ 3.12 JVM_GetMethodIxSignatureUTF; 3.13 JVM_GetMethodParameterAnnotations; 3.14 JVM_GetMethodParameters; 3.15 + JVM_GetMethodTypeAnnotations; 3.16 JVM_GetPrimitiveArrayElement; 3.17 JVM_GetProtectionDomain; 3.18 JVM_GetSockName;
4.1 --- a/make/excludeSrc.make Tue Apr 02 10:03:02 2013 +0200 4.2 +++ b/make/excludeSrc.make Wed Apr 03 09:19:02 2013 +0200 4.3 @@ -28,7 +28,8 @@ 4.4 Src_Files_EXCLUDE += jvmtiGetLoadedClasses.cpp forte.cpp jvmtiThreadState.cpp jvmtiExtensions.cpp \ 4.5 jvmtiImpl.cpp jvmtiManageCapabilities.cpp jvmtiRawMonitor.cpp jvmtiUtil.cpp jvmtiTrace.cpp \ 4.6 jvmtiCodeBlobEvents.cpp jvmtiEnv.cpp jvmtiRedefineClasses.cpp jvmtiEnvBase.cpp jvmtiEnvThreadState.cpp \ 4.7 - jvmtiTagMap.cpp jvmtiEventController.cpp evmCompat.cpp jvmtiEnter.xsl jvmtiExport.cpp 4.8 + jvmtiTagMap.cpp jvmtiEventController.cpp evmCompat.cpp jvmtiEnter.xsl jvmtiExport.cpp \ 4.9 + jvmtiClassFileReconstituter.cpp 4.10 endif 4.11 4.12 ifeq ($(INCLUDE_FPROF), false)
5.1 --- a/make/hotspot_version Tue Apr 02 10:03:02 2013 +0200 5.2 +++ b/make/hotspot_version Wed Apr 03 09:19:02 2013 +0200 5.3 @@ -35,7 +35,7 @@ 5.4 5.5 HS_MAJOR_VER=25 5.6 HS_MINOR_VER=0 5.7 -HS_BUILD_NUMBER=25 5.8 +HS_BUILD_NUMBER=26 5.9 5.10 JDK_MAJOR_VER=1 5.11 JDK_MINOR_VER=8
6.1 --- a/make/linux/makefiles/mapfile-vers-debug Tue Apr 02 10:03:02 2013 +0200 6.2 +++ b/make/linux/makefiles/mapfile-vers-debug Wed Apr 03 09:19:02 2013 +0200 6.3 @@ -131,6 +131,7 @@ 6.4 JVM_GetEnclosingMethodInfo; 6.5 JVM_GetFieldAnnotations; 6.6 JVM_GetFieldIxModifiers; 6.7 + JVM_GetFieldTypeAnnotations; 6.8 JVM_GetHostName; 6.9 JVM_GetInheritedAccessControlContext; 6.10 JVM_GetInterfaceVersion; 6.11 @@ -152,6 +153,7 @@ 6.12 JVM_GetMethodIxSignatureUTF; 6.13 JVM_GetMethodParameterAnnotations; 6.14 JVM_GetMethodParameters; 6.15 + JVM_GetMethodTypeAnnotations; 6.16 JVM_GetPrimitiveArrayElement; 6.17 JVM_GetProtectionDomain; 6.18 JVM_GetSockName;
7.1 --- a/make/linux/makefiles/mapfile-vers-product Tue Apr 02 10:03:02 2013 +0200 7.2 +++ b/make/linux/makefiles/mapfile-vers-product Wed Apr 03 09:19:02 2013 +0200 7.3 @@ -131,6 +131,7 @@ 7.4 JVM_GetEnclosingMethodInfo; 7.5 JVM_GetFieldAnnotations; 7.6 JVM_GetFieldIxModifiers; 7.7 + JVM_GetFieldTypeAnnotations; 7.8 JVM_GetHostName; 7.9 JVM_GetInheritedAccessControlContext; 7.10 JVM_GetInterfaceVersion; 7.11 @@ -152,6 +153,7 @@ 7.12 JVM_GetMethodIxSignatureUTF; 7.13 JVM_GetMethodParameterAnnotations; 7.14 JVM_GetMethodParameters; 7.15 + JVM_GetMethodTypeAnnotations; 7.16 JVM_GetPrimitiveArrayElement; 7.17 JVM_GetProtectionDomain; 7.18 JVM_GetSockName;
8.1 --- a/make/solaris/makefiles/mapfile-vers Tue Apr 02 10:03:02 2013 +0200 8.2 +++ b/make/solaris/makefiles/mapfile-vers Wed Apr 03 09:19:02 2013 +0200 8.3 @@ -131,6 +131,7 @@ 8.4 JVM_GetEnclosingMethodInfo; 8.5 JVM_GetFieldAnnotations; 8.6 JVM_GetFieldIxModifiers; 8.7 + JVM_GetFieldTypeAnnotations; 8.8 JVM_GetHostName; 8.9 JVM_GetInheritedAccessControlContext; 8.10 JVM_GetInterfaceVersion; 8.11 @@ -152,6 +153,7 @@ 8.12 JVM_GetMethodIxSignatureUTF; 8.13 JVM_GetMethodParameterAnnotations; 8.14 JVM_GetMethodParameters; 8.15 + JVM_GetMethodTypeAnnotations; 8.16 JVM_GetPrimitiveArrayElement; 8.17 JVM_GetProtectionDomain; 8.18 JVM_GetSockName;
9.1 --- a/make/windows/build.make Tue Apr 02 10:03:02 2013 +0200 9.2 +++ b/make/windows/build.make Wed Apr 03 09:19:02 2013 +0200 9.3 @@ -110,8 +110,6 @@ 9.4 !endif 9.5 !elseif "$(Variant)" == "tiered" 9.6 VARIANT_TEXT=Tiered 9.7 -!elseif "$(Variant)" == "kernel" 9.8 -VARIANT_TEXT=Kernel 9.9 !endif 9.10 9.11 ######################################################################### 9.12 @@ -305,9 +303,9 @@ 9.13 checks: checkVariant checkWorkSpace checkSA 9.14 9.15 checkVariant: 9.16 - @ if "$(Variant)"=="" echo Need to specify "Variant=[tiered|compiler2|compiler1|kernel|core]" && false 9.17 - @ if "$(Variant)" NEQ "tiered" if "$(Variant)" NEQ "compiler2" if "$(Variant)" NEQ "compiler1" if "$(Variant)" NEQ "kernel" if "$(Variant)" NEQ "core" \ 9.18 - echo Need to specify "Variant=[tiered|compiler2|compiler1|kernel|core]" && false 9.19 + @ if "$(Variant)"=="" echo Need to specify "Variant=[tiered|compiler2|compiler1|core]" && false 9.20 + @ if "$(Variant)" NEQ "tiered" if "$(Variant)" NEQ "compiler2" if "$(Variant)" NEQ "compiler1" if "$(Variant)" NEQ "core" \ 9.21 + echo Need to specify "Variant=[tiered|compiler2|compiler1|core]" && false 9.22 9.23 checkWorkSpace: 9.24 @ if "$(WorkSpace)"=="" echo Need to specify "WorkSpace=..." && false
10.1 --- a/make/windows/create.bat Tue Apr 02 10:03:02 2013 +0200 10.2 +++ b/make/windows/create.bat Wed Apr 03 09:19:02 2013 +0200 10.3 @@ -148,7 +148,7 @@ 10.4 10.5 REM This is now safe to do. 10.6 :copyfiles 10.7 -for /D %%i in (compiler1, compiler2, tiered, core, kernel) do ( 10.8 +for /D %%i in (compiler1, compiler2, tiered, core) do ( 10.9 if NOT EXIST %HotSpotBuildSpace%\%%i\generated mkdir %HotSpotBuildSpace%\%%i\generated 10.10 copy %HotSpotWorkSpace%\make\windows\projectfiles\%%i\* %HotSpotBuildSpace%\%%i\generated > NUL 10.11 ) 10.12 @@ -156,7 +156,7 @@ 10.13 REM force regneration of ProjectFile 10.14 if exist %ProjectFile% del %ProjectFile% 10.15 10.16 -for /D %%i in (compiler1, compiler2, tiered, core, kernel) do ( 10.17 +for /D %%i in (compiler1, compiler2, tiered, core) do ( 10.18 echo -- %%i -- 10.19 echo # Generated file! > %HotSpotBuildSpace%\%%i\local.make 10.20 echo # Changing a variable below and then deleting %ProjectFile% will cause >> %HotSpotBuildSpace%\%%i\local.make
11.1 --- a/make/windows/makefiles/compile.make Tue Apr 02 10:03:02 2013 +0200 11.2 +++ b/make/windows/makefiles/compile.make Wed Apr 03 09:19:02 2013 +0200 11.3 @@ -221,13 +221,6 @@ 11.4 !endif 11.5 !endif 11.6 11.7 -# Compile for space above time. 11.8 -!if "$(Variant)" == "kernel" 11.9 -PRODUCT_OPT_OPTION = /O1 /Oy- 11.10 -FASTDEBUG_OPT_OPTION = /O1 /Oy- 11.11 -DEBUG_OPT_OPTION = /Od 11.12 -!endif 11.13 - 11.14 # If NO_OPTIMIZATIONS is defined in the environment, turn everything off 11.15 !ifdef NO_OPTIMIZATIONS 11.16 PRODUCT_OPT_OPTION = $(DEBUG_OPT_OPTION)
12.1 --- a/make/windows/makefiles/product.make Tue Apr 02 10:03:02 2013 +0200 12.2 +++ b/make/windows/makefiles/product.make Wed Apr 03 09:19:02 2013 +0200 12.3 @@ -51,13 +51,6 @@ 12.4 # Force resources to be rebuilt every time 12.5 $(Res_Files): FORCE 12.6 12.7 -# Kernel doesn't need exported vtbl symbols. 12.8 -!if "$(Variant)" == "kernel" 12.9 -$(AOUT): $(Res_Files) $(Obj_Files) 12.10 - $(LD) @<< 12.11 - $(LD_FLAGS) /out:$@ /implib:$*.lib $(Obj_Files) $(Res_Files) 12.12 -<< 12.13 -!else 12.14 vm.def: $(Obj_Files) 12.15 sh $(WorkSpace)/make/windows/build_vm_def.sh 12.16 12.17 @@ -65,7 +58,6 @@ 12.18 $(LD) @<< 12.19 $(LD_FLAGS) /out:$@ /implib:$*.lib /def:vm.def $(Obj_Files) $(Res_Files) 12.20 << 12.21 -!endif 12.22 !if "$(MT)" != "" 12.23 # The previous link command created a .manifest file that we want to 12.24 # insert into the linked artifact so we do not need to track it
13.1 --- a/make/windows/makefiles/vm.make Tue Apr 02 10:03:02 2013 +0200 13.2 +++ b/make/windows/makefiles/vm.make Wed Apr 03 09:19:02 2013 +0200 13.3 @@ -89,12 +89,8 @@ 13.4 # AsyncGetCallTrace is not supported on IA64 yet 13.5 AGCT_EXPORT= 13.6 !else 13.7 -!if "$(Variant)" == "kernel" 13.8 -AGCT_EXPORT= 13.9 -!else 13.10 AGCT_EXPORT=/export:AsyncGetCallTrace 13.11 !endif 13.12 -!endif 13.13 13.14 # If you modify exports below please do the corresponding changes in 13.15 # src/share/tools/ProjectCreator/WinGammaPlatformVC7.java
14.1 --- a/make/windows/projectfiles/kernel/Makefile Tue Apr 02 10:03:02 2013 +0200 14.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 14.3 @@ -1,27 +0,0 @@ 14.4 -# 14.5 -# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. 14.6 -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 14.7 -# 14.8 -# This code is free software; you can redistribute it and/or modify it 14.9 -# under the terms of the GNU General Public License version 2 only, as 14.10 -# published by the Free Software Foundation. 14.11 -# 14.12 -# This code is distributed in the hope that it will be useful, but WITHOUT 14.13 -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 14.14 -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14.15 -# version 2 for more details (a copy is included in the LICENSE file that 14.16 -# accompanied this code). 14.17 -# 14.18 -# You should have received a copy of the GNU General Public License version 14.19 -# 2 along with this work; if not, write to the Free Software Foundation, 14.20 -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 14.21 -# 14.22 -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 14.23 -# or visit www.oracle.com if you need additional information or have any 14.24 -# questions. 14.25 -# 14.26 -# 14.27 - 14.28 -!include ../local.make 14.29 - 14.30 -!include $(HOTSPOTWORKSPACE)/make/windows/projectfiles/common/Makefile
15.1 --- a/make/windows/projectfiles/kernel/vm.def Tue Apr 02 10:03:02 2013 +0200 15.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 15.3 @@ -1,7 +0,0 @@ 15.4 -; 15.5 -; This .DEF file is a placeholder for one which is automatically 15.6 -; generated during the build process. See 15.7 -; make\windows\build_vm_def.sh and 15.8 -; make\windows\makefiles\projectcreator.make (esp. the "-prelink" 15.9 -; options). 15.10 -;
16.1 --- a/make/windows/projectfiles/kernel/vm.dsw Tue Apr 02 10:03:02 2013 +0200 16.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 16.3 @@ -1,29 +0,0 @@ 16.4 -Microsoft Developer Studio Workspace File, Format Version 6.00 16.5 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 16.6 - 16.7 -############################################################################### 16.8 - 16.9 -Project: "vm"=.\vm.dsp - Package Owner=<4> 16.10 - 16.11 -Package=<5> 16.12 -{{{ 16.13 -}}} 16.14 - 16.15 -Package=<4> 16.16 -{{{ 16.17 -}}} 16.18 - 16.19 -############################################################################### 16.20 - 16.21 -Global: 16.22 - 16.23 -Package=<5> 16.24 -{{{ 16.25 -}}} 16.26 - 16.27 -Package=<3> 16.28 -{{{ 16.29 -}}} 16.30 - 16.31 -############################################################################### 16.32 -
17.1 --- a/src/os/linux/vm/os_linux.cpp Tue Apr 02 10:03:02 2013 +0200 17.2 +++ b/src/os/linux/vm/os_linux.cpp Wed Apr 03 09:19:02 2013 +0200 17.3 @@ -1797,13 +1797,15 @@ 17.4 class VM_LinuxDllLoad: public VM_Operation { 17.5 private: 17.6 const char *_filename; 17.7 + char *_ebuf; 17.8 + int _ebuflen; 17.9 void *_lib; 17.10 public: 17.11 - VM_LinuxDllLoad(const char *fn) : 17.12 - _filename(fn), _lib(NULL) {} 17.13 + VM_LinuxDllLoad(const char *fn, char *ebuf, int ebuflen) : 17.14 + _filename(fn), _ebuf(ebuf), _ebuflen(ebuflen), _lib(NULL) {} 17.15 VMOp_Type type() const { return VMOp_LinuxDllLoad; } 17.16 void doit() { 17.17 - _lib = os::Linux::dll_load_inner(_filename); 17.18 + _lib = os::Linux::dll_load_in_vmthread(_filename, _ebuf, _ebuflen); 17.19 os::Linux::_stack_is_executable = true; 17.20 } 17.21 void* loaded_library() { return _lib; } 17.22 @@ -1851,13 +1853,13 @@ 17.23 // This is for the case where the DLL has an static 17.24 // constructor function that executes JNI code. We cannot 17.25 // load such DLLs in the VMThread. 17.26 - result = ::dlopen(filename, RTLD_LAZY); 17.27 + result = os::Linux::dlopen_helper(filename, ebuf, ebuflen); 17.28 } 17.29 17.30 ThreadInVMfromNative tiv(jt); 17.31 debug_only(VMNativeEntryWrapper vew;) 17.32 17.33 - VM_LinuxDllLoad op(filename); 17.34 + VM_LinuxDllLoad op(filename, ebuf, ebuflen); 17.35 VMThread::execute(&op); 17.36 if (LoadExecStackDllInVMThread) { 17.37 result = op.loaded_library(); 17.38 @@ -1869,7 +1871,7 @@ 17.39 } 17.40 17.41 if (!load_attempted) { 17.42 - result = ::dlopen(filename, RTLD_LAZY); 17.43 + result = os::Linux::dlopen_helper(filename, ebuf, ebuflen); 17.44 } 17.45 17.46 if (result != NULL) { 17.47 @@ -1878,11 +1880,6 @@ 17.48 } 17.49 17.50 Elf32_Ehdr elf_head; 17.51 - 17.52 - // Read system error message into ebuf 17.53 - // It may or may not be overwritten below 17.54 - ::strncpy(ebuf, ::dlerror(), ebuflen-1); 17.55 - ebuf[ebuflen-1]='\0'; 17.56 int diag_msg_max_length=ebuflen-strlen(ebuf); 17.57 char* diag_msg_buf=ebuf+strlen(ebuf); 17.58 17.59 @@ -2025,10 +2022,19 @@ 17.60 return NULL; 17.61 } 17.62 17.63 -void * os::Linux::dll_load_inner(const char *filename) { 17.64 +void * os::Linux::dlopen_helper(const char *filename, char *ebuf, int ebuflen) { 17.65 + void * result = ::dlopen(filename, RTLD_LAZY); 17.66 + if (result == NULL) { 17.67 + ::strncpy(ebuf, ::dlerror(), ebuflen - 1); 17.68 + ebuf[ebuflen-1] = '\0'; 17.69 + } 17.70 + return result; 17.71 +} 17.72 + 17.73 +void * os::Linux::dll_load_in_vmthread(const char *filename, char *ebuf, int ebuflen) { 17.74 void * result = NULL; 17.75 if (LoadExecStackDllInVMThread) { 17.76 - result = ::dlopen(filename, RTLD_LAZY); 17.77 + result = dlopen_helper(filename, ebuf, ebuflen); 17.78 } 17.79 17.80 // Since 7019808, libjvm.so is linked with -noexecstack. If the VM loads a
18.1 --- a/src/os/linux/vm/os_linux.hpp Tue Apr 02 10:03:02 2013 +0200 18.2 +++ b/src/os/linux/vm/os_linux.hpp Wed Apr 03 09:19:02 2013 +0200 18.3 @@ -95,7 +95,8 @@ 18.4 18.5 public: 18.6 static bool _stack_is_executable; 18.7 - static void *dll_load_inner(const char *name); 18.8 + static void *dlopen_helper(const char *name, char *ebuf, int ebuflen); 18.9 + static void *dll_load_in_vmthread(const char *name, char *ebuf, int ebuflen); 18.10 18.11 static void init_thread_fpu_state(); 18.12 static int get_fpu_control_word();
19.1 --- a/src/os_cpu/bsd_x86/vm/globals_bsd_x86.hpp Tue Apr 02 10:03:02 2013 +0200 19.2 +++ b/src/os_cpu/bsd_x86/vm/globals_bsd_x86.hpp Wed Apr 03 09:19:02 2013 +0200 19.3 @@ -46,7 +46,7 @@ 19.4 19.5 define_pd_global(uintx, JVMInvokeMethodSlack, 8192); 19.6 19.7 -// Used on 64 bit platforms for UseCompressedOops base address or CDS 19.8 +// Used on 64 bit platforms for UseCompressedOops base address 19.9 define_pd_global(uintx, HeapBaseMinAddress, 2*G); 19.10 19.11 #endif // OS_CPU_BSD_X86_VM_GLOBALS_BSD_X86_HPP
20.1 --- a/src/os_cpu/bsd_zero/vm/globals_bsd_zero.hpp Tue Apr 02 10:03:02 2013 +0200 20.2 +++ b/src/os_cpu/bsd_zero/vm/globals_bsd_zero.hpp Wed Apr 03 09:19:02 2013 +0200 20.3 @@ -41,7 +41,7 @@ 20.4 define_pd_global(intx, CompilerThreadStackSize, 0); 20.5 define_pd_global(uintx, JVMInvokeMethodSlack, 8192); 20.6 20.7 -// Used on 64 bit platforms for UseCompressedOops base address or CDS 20.8 +// Used on 64 bit platforms for UseCompressedOops base address 20.9 define_pd_global(uintx, HeapBaseMinAddress, 2*G); 20.10 20.11 #endif // OS_CPU_BSD_ZERO_VM_GLOBALS_BSD_ZERO_HPP
21.1 --- a/src/os_cpu/linux_sparc/vm/globals_linux_sparc.hpp Tue Apr 02 10:03:02 2013 +0200 21.2 +++ b/src/os_cpu/linux_sparc/vm/globals_linux_sparc.hpp Wed Apr 03 09:19:02 2013 +0200 21.3 @@ -33,7 +33,7 @@ 21.4 define_pd_global(uintx, JVMInvokeMethodSlack, 12288); 21.5 define_pd_global(intx, CompilerThreadStackSize, 0); 21.6 21.7 -// Used on 64 bit platforms for UseCompressedOops base address or CDS 21.8 +// Used on 64 bit platforms for UseCompressedOops base address 21.9 define_pd_global(uintx, HeapBaseMinAddress, CONST64(4)*G); 21.10 21.11 #endif // OS_CPU_LINUX_SPARC_VM_GLOBALS_LINUX_SPARC_HPP
22.1 --- a/src/os_cpu/linux_x86/vm/globals_linux_x86.hpp Tue Apr 02 10:03:02 2013 +0200 22.2 +++ b/src/os_cpu/linux_x86/vm/globals_linux_x86.hpp Wed Apr 03 09:19:02 2013 +0200 22.3 @@ -44,7 +44,7 @@ 22.4 22.5 define_pd_global(uintx,JVMInvokeMethodSlack, 8192); 22.6 22.7 -// Used on 64 bit platforms for UseCompressedOops base address or CDS 22.8 +// Used on 64 bit platforms for UseCompressedOops base address 22.9 define_pd_global(uintx,HeapBaseMinAddress, 2*G); 22.10 22.11 #endif // OS_CPU_LINUX_X86_VM_GLOBALS_LINUX_X86_HPP
23.1 --- a/src/os_cpu/linux_zero/vm/globals_linux_zero.hpp Tue Apr 02 10:03:02 2013 +0200 23.2 +++ b/src/os_cpu/linux_zero/vm/globals_linux_zero.hpp Wed Apr 03 09:19:02 2013 +0200 23.3 @@ -41,7 +41,7 @@ 23.4 define_pd_global(intx, CompilerThreadStackSize, 0); 23.5 define_pd_global(uintx, JVMInvokeMethodSlack, 8192); 23.6 23.7 -// Used on 64 bit platforms for UseCompressedOops base address or CDS 23.8 +// Used on 64 bit platforms for UseCompressedOops base address 23.9 define_pd_global(uintx, HeapBaseMinAddress, 2*G); 23.10 23.11 #endif // OS_CPU_LINUX_ZERO_VM_GLOBALS_LINUX_ZERO_HPP
24.1 --- a/src/os_cpu/solaris_sparc/vm/globals_solaris_sparc.hpp Tue Apr 02 10:03:02 2013 +0200 24.2 +++ b/src/os_cpu/solaris_sparc/vm/globals_solaris_sparc.hpp Wed Apr 03 09:19:02 2013 +0200 24.3 @@ -33,7 +33,7 @@ 24.4 define_pd_global(uintx, JVMInvokeMethodSlack, 12288); 24.5 define_pd_global(intx, CompilerThreadStackSize, 0); 24.6 24.7 -// Used on 64 bit platforms for UseCompressedOops base address or CDS 24.8 +// Used on 64 bit platforms for UseCompressedOops base address 24.9 #ifdef _LP64 24.10 define_pd_global(uintx, HeapBaseMinAddress, CONST64(4)*G); 24.11 #else
25.1 --- a/src/os_cpu/solaris_x86/vm/globals_solaris_x86.hpp Tue Apr 02 10:03:02 2013 +0200 25.2 +++ b/src/os_cpu/solaris_x86/vm/globals_solaris_x86.hpp Wed Apr 03 09:19:02 2013 +0200 25.3 @@ -43,7 +43,7 @@ 25.4 25.5 define_pd_global(intx, CompilerThreadStackSize, 0); 25.6 25.7 -// Used on 64 bit platforms for UseCompressedOops base address or CDS 25.8 +// Used on 64 bit platforms for UseCompressedOops base address 25.9 define_pd_global(uintx,HeapBaseMinAddress, 256*M); 25.10 25.11 #endif // OS_CPU_SOLARIS_X86_VM_GLOBALS_SOLARIS_X86_HPP
26.1 --- a/src/os_cpu/windows_x86/vm/globals_windows_x86.hpp Tue Apr 02 10:03:02 2013 +0200 26.2 +++ b/src/os_cpu/windows_x86/vm/globals_windows_x86.hpp Wed Apr 03 09:19:02 2013 +0200 26.3 @@ -45,7 +45,7 @@ 26.4 26.5 define_pd_global(uintx, JVMInvokeMethodSlack, 8192); 26.6 26.7 -// Used on 64 bit platforms for UseCompressedOops base address or CDS 26.8 +// Used on 64 bit platforms for UseCompressedOops base address 26.9 define_pd_global(uintx, HeapBaseMinAddress, 2*G); 26.10 26.11 #endif // OS_CPU_WINDOWS_X86_VM_GLOBALS_WINDOWS_X86_HPP
27.1 --- a/src/share/tools/ProjectCreator/BuildConfig.java Tue Apr 02 10:03:02 2013 +0200 27.2 +++ b/src/share/tools/ProjectCreator/BuildConfig.java Wed Apr 03 09:19:02 2013 +0200 27.3 @@ -568,36 +568,6 @@ 27.4 } 27.5 } 27.6 27.7 -class KernelDebugConfig extends GenericDebugConfig { 27.8 - String getOptFlag() { 27.9 - return getCI().getNoOptFlag(); 27.10 - } 27.11 - 27.12 - KernelDebugConfig() { 27.13 - initNames("kernel", "debug", "jvm.dll"); 27.14 - init(getIncludes(), getDefines()); 27.15 - } 27.16 -} 27.17 - 27.18 - 27.19 -class KernelFastDebugConfig extends GenericDebugConfig { 27.20 - String getOptFlag() { 27.21 - return getCI().getOptFlag(); 27.22 - } 27.23 - 27.24 - KernelFastDebugConfig() { 27.25 - initNames("kernel", "fastdebug", "jvm.dll"); 27.26 - init(getIncludes(), getDefines()); 27.27 - } 27.28 -} 27.29 - 27.30 - 27.31 -class KernelProductConfig extends ProductConfig { 27.32 - KernelProductConfig() { 27.33 - initNames("kernel", "product", "jvm.dll"); 27.34 - init(getIncludes(), getDefines()); 27.35 - } 27.36 -} 27.37 27.38 abstract class CompilerInterface { 27.39 abstract Vector getBaseCompilerFlags(Vector defines, Vector includes, String outDir);
28.1 --- a/src/share/tools/ProjectCreator/WinGammaPlatform.java Tue Apr 02 10:03:02 2013 +0200 28.2 +++ b/src/share/tools/ProjectCreator/WinGammaPlatform.java Wed Apr 03 09:19:02 2013 +0200 28.3 @@ -564,12 +564,6 @@ 28.4 allConfigs.add(new CoreFastDebugConfig()); 28.5 allConfigs.add(new CoreProductConfig()); 28.6 28.7 - if (platform.equals("Win32")) { 28.8 - allConfigs.add(new KernelDebugConfig()); 28.9 - allConfigs.add(new KernelFastDebugConfig()); 28.10 - allConfigs.add(new KernelProductConfig()); 28.11 - } 28.12 - 28.13 return allConfigs; 28.14 } 28.15
29.1 --- a/src/share/vm/classfile/classFileParser.cpp Tue Apr 02 10:03:02 2013 +0200 29.2 +++ b/src/share/vm/classfile/classFileParser.cpp Wed Apr 03 09:19:02 2013 +0200 29.3 @@ -2196,8 +2196,7 @@ 29.4 true, // is LVTT 29.5 CHECK_(nullHandle)); 29.6 lvtt_cnt++; 29.7 - } else if (UseSplitVerifier && 29.8 - _major_version >= Verifier::STACKMAP_ATTRIBUTE_MAJOR_VERSION && 29.9 + } else if (_major_version >= Verifier::STACKMAP_ATTRIBUTE_MAJOR_VERSION && 29.10 _cp->symbol_at(code_attribute_name_index) == vmSymbols::tag_stack_map_table()) { 29.11 // Stack map is only needed by the new verifier in JDK1.5. 29.12 if (parsed_stackmap_attribute) {
30.1 --- a/src/share/vm/classfile/verifier.cpp Tue Apr 02 10:03:02 2013 +0200 30.2 +++ b/src/share/vm/classfile/verifier.cpp Wed Apr 03 09:19:02 2013 +0200 30.3 @@ -61,8 +61,8 @@ 30.4 # include "bytes_ppc.hpp" 30.5 #endif 30.6 30.7 -#define NOFAILOVER_MAJOR_VERSION 51 30.8 -#define STATIC_METHOD_IN_INTERFACE_MAJOR_VERSION 52 30.9 +#define NOFAILOVER_MAJOR_VERSION 51 30.10 +#define NONZERO_PADDING_BYTES_IN_SWITCH_MAJOR_VERSION 51 30.11 30.12 // Access to external entry for VerifyClassCodes - old byte code verifier 30.13 30.14 @@ -127,8 +127,7 @@ 30.15 if (TraceClassInitialization) { 30.16 tty->print_cr("Start class verification for: %s", klassName); 30.17 } 30.18 - if (UseSplitVerifier && 30.19 - klass->major_version() >= STACKMAP_ATTRIBUTE_MAJOR_VERSION) { 30.20 + if (klass->major_version() >= STACKMAP_ATTRIBUTE_MAJOR_VERSION) { 30.21 ClassVerifier split_verifier(klass, THREAD); 30.22 split_verifier.verify_class(THREAD); 30.23 exception_name = split_verifier.result(); 30.24 @@ -2027,16 +2026,19 @@ 30.25 address bcp = bcs->bcp(); 30.26 address aligned_bcp = (address) round_to((intptr_t)(bcp + 1), jintSize); 30.27 30.28 - // 4639449 & 4647081: padding bytes must be 0 30.29 - u2 padding_offset = 1; 30.30 - while ((bcp + padding_offset) < aligned_bcp) { 30.31 - if(*(bcp + padding_offset) != 0) { 30.32 - verify_error(ErrorContext::bad_code(bci), 30.33 - "Nonzero padding byte in lookswitch or tableswitch"); 30.34 - return; 30.35 + if (_klass->major_version() < NONZERO_PADDING_BYTES_IN_SWITCH_MAJOR_VERSION) { 30.36 + // 4639449 & 4647081: padding bytes must be 0 30.37 + u2 padding_offset = 1; 30.38 + while ((bcp + padding_offset) < aligned_bcp) { 30.39 + if(*(bcp + padding_offset) != 0) { 30.40 + verify_error(ErrorContext::bad_code(bci), 30.41 + "Nonzero padding byte in lookswitch or tableswitch"); 30.42 + return; 30.43 + } 30.44 + padding_offset++; 30.45 } 30.46 - padding_offset++; 30.47 } 30.48 + 30.49 int default_offset = (int) Bytes::get_Java_u4(aligned_bcp); 30.50 int keys, delta; 30.51 current_frame->pop_stack( 30.52 @@ -2318,11 +2320,6 @@ 30.53 types = (1 << JVM_CONSTANT_InterfaceMethodref) | 30.54 (1 << JVM_CONSTANT_Methodref); 30.55 break; 30.56 - case Bytecodes::_invokestatic: 30.57 - types = (_klass->major_version() < STATIC_METHOD_IN_INTERFACE_MAJOR_VERSION) ? 30.58 - (1 << JVM_CONSTANT_Methodref) : 30.59 - ((1 << JVM_CONSTANT_InterfaceMethodref) | (1 << JVM_CONSTANT_Methodref)); 30.60 - break; 30.61 default: 30.62 types = 1 << JVM_CONSTANT_Methodref; 30.63 }
31.1 --- a/src/share/vm/memory/filemap.cpp Tue Apr 02 10:03:02 2013 +0200 31.2 +++ b/src/share/vm/memory/filemap.cpp Wed Apr 03 09:19:02 2013 +0200 31.3 @@ -372,7 +372,7 @@ 31.4 // other reserved memory (like the code cache). 31.5 ReservedSpace rs(size, alignment, false, requested_addr); 31.6 if (!rs.is_reserved()) { 31.7 - fail_continue(err_msg("Unable to reserved shared space at required address " INTPTR_FORMAT, requested_addr)); 31.8 + fail_continue(err_msg("Unable to reserve shared space at required address " INTPTR_FORMAT, requested_addr)); 31.9 return rs; 31.10 } 31.11 // the reserved virtual memory is for mapping class data sharing archive
32.1 --- a/src/share/vm/memory/metaspace.cpp Tue Apr 02 10:03:02 2013 +0200 32.2 +++ b/src/share/vm/memory/metaspace.cpp Wed Apr 03 09:19:02 2013 +0200 32.3 @@ -337,27 +337,16 @@ 32.4 // align up to vm allocation granularity 32.5 byte_size = align_size_up(byte_size, os::vm_allocation_granularity()); 32.6 32.7 - // This allocates memory with mmap. For DumpSharedspaces, allocate the 32.8 - // space at low memory so that other shared images don't conflict. 32.9 - // This is the same address as memory needed for UseCompressedOops but 32.10 - // compressed oops don't work with CDS (offsets in metadata are wrong), so 32.11 - // borrow the same address. 32.12 + // This allocates memory with mmap. For DumpSharedspaces, try to reserve 32.13 + // configurable address, generally at the top of the Java heap so other 32.14 + // memory addresses don't conflict. 32.15 if (DumpSharedSpaces) { 32.16 - char* shared_base = (char*)HeapBaseMinAddress; 32.17 + char* shared_base = (char*)SharedBaseAddress; 32.18 _rs = ReservedSpace(byte_size, 0, false, shared_base, 0); 32.19 if (_rs.is_reserved()) { 32.20 - assert(_rs.base() == shared_base, "should match"); 32.21 + assert(shared_base == 0 || _rs.base() == shared_base, "should match"); 32.22 } else { 32.23 - // If we are dumping the heap, then allocate a wasted block of address 32.24 - // space in order to push the heap to a lower address. This extra 32.25 - // address range allows for other (or larger) libraries to be loaded 32.26 - // without them occupying the space required for the shared spaces. 32.27 - uintx reserved = 0; 32.28 - uintx block_size = 64*1024*1024; 32.29 - while (reserved < SharedDummyBlockSize) { 32.30 - char* dummy = os::reserve_memory(block_size); 32.31 - reserved += block_size; 32.32 - } 32.33 + // Get a mmap region anywhere if the SharedBaseAddress fails. 32.34 _rs = ReservedSpace(byte_size); 32.35 } 32.36 MetaspaceShared::set_shared_rs(&_rs);
33.1 --- a/src/share/vm/prims/jvm.cpp Tue Apr 02 10:03:02 2013 +0200 33.2 +++ b/src/share/vm/prims/jvm.cpp Wed Apr 03 09:19:02 2013 +0200 33.3 @@ -1457,7 +1457,7 @@ 33.4 JVM_ENTRY(jbyteArray, JVM_GetClassAnnotations(JNIEnv *env, jclass cls)) 33.5 assert (cls != NULL, "illegal class"); 33.6 JVMWrapper("JVM_GetClassAnnotations"); 33.7 - ResourceMark rm(THREAD); 33.8 + 33.9 // Return null for arrays and primitives 33.10 if (!java_lang_Class::is_primitive(JNIHandles::resolve(cls))) { 33.11 Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve(cls)); 33.12 @@ -1470,20 +1470,15 @@ 33.13 JVM_END 33.14 33.15 33.16 -JVM_ENTRY(jbyteArray, JVM_GetFieldAnnotations(JNIEnv *env, jobject field)) 33.17 - assert(field != NULL, "illegal field"); 33.18 - JVMWrapper("JVM_GetFieldAnnotations"); 33.19 - 33.20 +static bool jvm_get_field_common(jobject field, fieldDescriptor& fd, TRAPS) { 33.21 // some of this code was adapted from from jni_FromReflectedField 33.22 33.23 - // field is a handle to a java.lang.reflect.Field object 33.24 oop reflected = JNIHandles::resolve_non_null(field); 33.25 oop mirror = java_lang_reflect_Field::clazz(reflected); 33.26 Klass* k = java_lang_Class::as_Klass(mirror); 33.27 int slot = java_lang_reflect_Field::slot(reflected); 33.28 int modifiers = java_lang_reflect_Field::modifiers(reflected); 33.29 33.30 - fieldDescriptor fd; 33.31 KlassHandle kh(THREAD, k); 33.32 intptr_t offset = InstanceKlass::cast(kh())->field_offset(slot); 33.33 33.34 @@ -1491,16 +1486,29 @@ 33.35 // for static fields we only look in the current class 33.36 if (!InstanceKlass::cast(kh())->find_local_field_from_offset(offset, true, &fd)) { 33.37 assert(false, "cannot find static field"); 33.38 - return NULL; // robustness 33.39 + return false; 33.40 } 33.41 } else { 33.42 // for instance fields we start with the current class and work 33.43 // our way up through the superclass chain 33.44 if (!InstanceKlass::cast(kh())->find_field_from_offset(offset, false, &fd)) { 33.45 assert(false, "cannot find instance field"); 33.46 - return NULL; // robustness 33.47 + return false; 33.48 } 33.49 } 33.50 + return true; 33.51 +} 33.52 + 33.53 +JVM_ENTRY(jbyteArray, JVM_GetFieldAnnotations(JNIEnv *env, jobject field)) 33.54 + // field is a handle to a java.lang.reflect.Field object 33.55 + assert(field != NULL, "illegal field"); 33.56 + JVMWrapper("JVM_GetFieldAnnotations"); 33.57 + 33.58 + fieldDescriptor fd; 33.59 + bool gotFd = jvm_get_field_common(field, fd, CHECK_NULL); 33.60 + if (!gotFd) { 33.61 + return NULL; 33.62 + } 33.63 33.64 return (jbyteArray) JNIHandles::make_local(env, Annotations::make_java_array(fd.annotations(), THREAD)); 33.65 JVM_END 33.66 @@ -1525,12 +1533,8 @@ 33.67 Klass* k = java_lang_Class::as_Klass(mirror); 33.68 33.69 Method* m = InstanceKlass::cast(k)->method_with_idnum(slot); 33.70 - if (m == NULL) { 33.71 - assert(false, "cannot find method"); 33.72 - return NULL; // robustness 33.73 - } 33.74 - 33.75 - return m; 33.76 + assert(m != NULL, "cannot find method"); 33.77 + return m; // caller has to deal with NULL in product mode 33.78 } 33.79 33.80 33.81 @@ -1539,6 +1543,10 @@ 33.82 33.83 // method is a handle to a java.lang.reflect.Method object 33.84 Method* m = jvm_get_method_common(method); 33.85 + if (m == NULL) { 33.86 + return NULL; 33.87 + } 33.88 + 33.89 return (jbyteArray) JNIHandles::make_local(env, 33.90 Annotations::make_java_array(m->annotations(), THREAD)); 33.91 JVM_END 33.92 @@ -1549,6 +1557,10 @@ 33.93 33.94 // method is a handle to a java.lang.reflect.Method object 33.95 Method* m = jvm_get_method_common(method); 33.96 + if (m == NULL) { 33.97 + return NULL; 33.98 + } 33.99 + 33.100 return (jbyteArray) JNIHandles::make_local(env, 33.101 Annotations::make_java_array(m->annotation_default(), THREAD)); 33.102 JVM_END 33.103 @@ -1559,6 +1571,10 @@ 33.104 33.105 // method is a handle to a java.lang.reflect.Method object 33.106 Method* m = jvm_get_method_common(method); 33.107 + if (m == NULL) { 33.108 + return NULL; 33.109 + } 33.110 + 33.111 return (jbyteArray) JNIHandles::make_local(env, 33.112 Annotations::make_java_array(m->parameter_annotations(), THREAD)); 33.113 JVM_END 33.114 @@ -1583,6 +1599,38 @@ 33.115 return NULL; 33.116 JVM_END 33.117 33.118 +JVM_ENTRY(jbyteArray, JVM_GetMethodTypeAnnotations(JNIEnv *env, jobject method)) 33.119 + assert (method != NULL, "illegal method"); 33.120 + JVMWrapper("JVM_GetMethodTypeAnnotations"); 33.121 + 33.122 + // method is a handle to a java.lang.reflect.Method object 33.123 + Method* m = jvm_get_method_common(method); 33.124 + if (m == NULL) { 33.125 + return NULL; 33.126 + } 33.127 + 33.128 + AnnotationArray* type_annotations = m->type_annotations(); 33.129 + if (type_annotations != NULL) { 33.130 + typeArrayOop a = Annotations::make_java_array(type_annotations, CHECK_NULL); 33.131 + return (jbyteArray) JNIHandles::make_local(env, a); 33.132 + } 33.133 + 33.134 + return NULL; 33.135 +JVM_END 33.136 + 33.137 +JVM_ENTRY(jbyteArray, JVM_GetFieldTypeAnnotations(JNIEnv *env, jobject field)) 33.138 + assert (field != NULL, "illegal field"); 33.139 + JVMWrapper("JVM_GetFieldTypeAnnotations"); 33.140 + 33.141 + fieldDescriptor fd; 33.142 + bool gotFd = jvm_get_field_common(field, fd, CHECK_NULL); 33.143 + if (!gotFd) { 33.144 + return NULL; 33.145 + } 33.146 + 33.147 + return (jbyteArray) JNIHandles::make_local(env, Annotations::make_java_array(fd.type_annotations(), THREAD)); 33.148 +JVM_END 33.149 + 33.150 static void bounds_check(constantPoolHandle cp, jint index, TRAPS) { 33.151 if (!cp->is_within_bounds(index)) { 33.152 THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), "Constant pool index out of bounds"); 33.153 @@ -1722,7 +1770,7 @@ 33.154 int i; 33.155 for (i = 0; i < methods_length; i++) { 33.156 methodHandle method(THREAD, methods->at(i)); 33.157 - if (!method->is_initializer()) { 33.158 + if (!method->is_initializer() && !method->is_overpass()) { 33.159 if (!publicOnly || method->is_public()) { 33.160 ++num_methods; 33.161 } 33.162 @@ -1736,7 +1784,7 @@ 33.163 int out_idx = 0; 33.164 for (i = 0; i < methods_length; i++) { 33.165 methodHandle method(THREAD, methods->at(i)); 33.166 - if (!method->is_initializer()) { 33.167 + if (!method->is_initializer() && !method->is_overpass()) { 33.168 if (!publicOnly || method->is_public()) { 33.169 oop m = Reflection::new_method(method, UseNewReflection, false, CHECK_NULL); 33.170 result->obj_at_put(out_idx, m);
34.1 --- a/src/share/vm/prims/jvm.h Tue Apr 02 10:03:02 2013 +0200 34.2 +++ b/src/share/vm/prims/jvm.h Wed Apr 03 09:19:02 2013 +0200 34.3 @@ -523,6 +523,14 @@ 34.4 JNIEXPORT jbyteArray JNICALL 34.5 JVM_GetClassTypeAnnotations(JNIEnv *env, jclass cls); 34.6 34.7 +// field is a handle to a java.lang.reflect.Field object 34.8 +JNIEXPORT jbyteArray JNICALL 34.9 +JVM_GetFieldTypeAnnotations(JNIEnv *env, jobject field); 34.10 + 34.11 +// method is a handle to a java.lang.reflect.Method object 34.12 +JNIEXPORT jbyteArray JNICALL 34.13 +JVM_GetMethodTypeAnnotations(JNIEnv *env, jobject method); 34.14 + 34.15 /* 34.16 * New (JDK 1.4) reflection implementation 34.17 */
35.1 --- a/src/share/vm/runtime/arguments.cpp Tue Apr 02 10:03:02 2013 +0200 35.2 +++ b/src/share/vm/runtime/arguments.cpp Wed Apr 03 09:19:02 2013 +0200 35.3 @@ -260,6 +260,7 @@ 35.4 { "CMSRevisitStackSize", JDK_Version::jdk(8), JDK_Version::jdk(9) }, 35.5 { "PrintRevisitStats", JDK_Version::jdk(8), JDK_Version::jdk(9) }, 35.6 { "UseVectoredExceptions", JDK_Version::jdk(8), JDK_Version::jdk(9) }, 35.7 + { "UseSplitVerifier", JDK_Version::jdk(8), JDK_Version::jdk(9) }, 35.8 #ifdef PRODUCT 35.9 { "DesiredMethodLimit", 35.10 JDK_Version::jdk_update(7, 2), JDK_Version::jdk(8) },
36.1 --- a/src/share/vm/runtime/globals.hpp Tue Apr 02 10:03:02 2013 +0200 36.2 +++ b/src/share/vm/runtime/globals.hpp Wed Apr 03 09:19:02 2013 +0200 36.3 @@ -679,9 +679,6 @@ 36.4 product(bool, UseCompilerSafepoints, true, \ 36.5 "Stop at safepoints in compiled code") \ 36.6 \ 36.7 - product(bool, UseSplitVerifier, true, \ 36.8 - "use split verifier with StackMapTable attributes") \ 36.9 - \ 36.10 product(bool, FailOverToOldVerifier, true, \ 36.11 "fail over to old verifier when split verifier fails") \ 36.12 \ 36.13 @@ -869,6 +866,11 @@ 36.14 diagnostic(bool, PrintNMTStatistics, false, \ 36.15 "Print native memory tracking summary data if it is on") \ 36.16 \ 36.17 + diagnostic(bool, AutoShutdownNMT, true, \ 36.18 + "Automatically shutdown native memory tracking under stress " \ 36.19 + "situation. When set to false, native memory tracking tries to " \ 36.20 + "stay alive at the expense of JVM performance") \ 36.21 + \ 36.22 diagnostic(bool, LogCompilation, false, \ 36.23 "Log compilation activity in detail to hotspot.log or LogFile") \ 36.24 \ 36.25 @@ -2913,6 +2915,10 @@ 36.26 "if non-zero, start verifying C heap after Nth call to " \ 36.27 "malloc/realloc/free") \ 36.28 \ 36.29 + diagnostic(uintx, MallocMaxTestWords, 0, \ 36.30 + "if non-zero, max # of Words that malloc/realloc can allocate " \ 36.31 + "(for testing only)") \ 36.32 + \ 36.33 product(intx, TypeProfileWidth, 2, \ 36.34 "number of receiver types to record in call/cast profile") \ 36.35 \ 36.36 @@ -3577,8 +3583,9 @@ 36.37 product(uintx, SharedMiscCodeSize, 120*K, \ 36.38 "Size of the shared miscellaneous code area (in bytes)") \ 36.39 \ 36.40 - product(uintx, SharedDummyBlockSize, 0, \ 36.41 - "Size of dummy block used to shift heap addresses (in bytes)") \ 36.42 + product(uintx, SharedBaseAddress, LP64_ONLY(32*G) \ 36.43 + NOT_LP64(LINUX_ONLY(2*G) NOT_LINUX(0)), \ 36.44 + "Address to allocate shared memory region for class data") \ 36.45 \ 36.46 diagnostic(bool, EnableInvokeDynamic, true, \ 36.47 "support JSR 292 (method handles, invokedynamic, " \
37.1 --- a/src/share/vm/runtime/os.cpp Tue Apr 02 10:03:02 2013 +0200 37.2 +++ b/src/share/vm/runtime/os.cpp Wed Apr 03 09:19:02 2013 +0200 37.3 @@ -1,5 +1,5 @@ 37.4 /* 37.5 - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. 37.6 + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 37.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 37.8 * 37.9 * This code is free software; you can redistribute it and/or modify it 37.10 @@ -80,6 +80,8 @@ 37.11 julong os::free_bytes = 0; // # of bytes freed 37.12 #endif 37.13 37.14 +static juint cur_malloc_words = 0; // current size for MallocMaxTestWords 37.15 + 37.16 void os_init_globals() { 37.17 // Called from init_globals(). 37.18 // See Threads::create_vm() in thread.cpp, and init.cpp. 37.19 @@ -570,6 +572,26 @@ 37.20 } 37.21 #endif 37.22 37.23 +// 37.24 +// This function supports testing of the malloc out of memory 37.25 +// condition without really running the system out of memory. 37.26 +// 37.27 +static u_char* testMalloc(size_t alloc_size) { 37.28 + assert(MallocMaxTestWords > 0, "sanity check"); 37.29 + 37.30 + if ((cur_malloc_words + (alloc_size / BytesPerWord)) > MallocMaxTestWords) { 37.31 + return NULL; 37.32 + } 37.33 + 37.34 + u_char* ptr = (u_char*)::malloc(alloc_size); 37.35 + 37.36 + if (ptr != NULL) { 37.37 + Atomic::add(((jint) (alloc_size / BytesPerWord)), 37.38 + (volatile jint *) &cur_malloc_words); 37.39 + } 37.40 + return ptr; 37.41 +} 37.42 + 37.43 void* os::malloc(size_t size, MEMFLAGS memflags, address caller) { 37.44 NOT_PRODUCT(inc_stat_counter(&num_mallocs, 1)); 37.45 NOT_PRODUCT(inc_stat_counter(&alloc_bytes, size)); 37.46 @@ -579,11 +601,22 @@ 37.47 // if NULL is returned the calling functions assume out of memory. 37.48 size = 1; 37.49 } 37.50 - if (size > size + space_before + space_after) { // Check for rollover. 37.51 + 37.52 + const size_t alloc_size = size + space_before + space_after; 37.53 + 37.54 + if (size > alloc_size) { // Check for rollover. 37.55 return NULL; 37.56 } 37.57 + 37.58 NOT_PRODUCT(if (MallocVerifyInterval > 0) check_heap()); 37.59 - u_char* ptr = (u_char*)::malloc(size + space_before + space_after); 37.60 + 37.61 + u_char* ptr; 37.62 + 37.63 + if (MallocMaxTestWords > 0) { 37.64 + ptr = testMalloc(alloc_size); 37.65 + } else { 37.66 + ptr = (u_char*)::malloc(alloc_size); 37.67 + } 37.68 37.69 #ifdef ASSERT 37.70 if (ptr == NULL) return NULL;
38.1 --- a/src/share/vm/services/memTracker.cpp Tue Apr 02 10:03:02 2013 +0200 38.2 +++ b/src/share/vm/services/memTracker.cpp Wed Apr 03 09:19:02 2013 +0200 38.3 @@ -68,6 +68,7 @@ 38.4 volatile jint MemTracker::_pooled_recorder_count = 0; 38.5 volatile unsigned long MemTracker::_processing_generation = 0; 38.6 volatile bool MemTracker::_worker_thread_idle = false; 38.7 +volatile bool MemTracker::_slowdown_calling_thread = false; 38.8 debug_only(intx MemTracker::_main_thread_tid = 0;) 38.9 NOT_PRODUCT(volatile jint MemTracker::_pending_recorder_count = 0;) 38.10 38.11 @@ -364,6 +365,12 @@ 38.12 } 38.13 38.14 if (thread != NULL) { 38.15 + // slow down all calling threads except NMT worker thread, so it 38.16 + // can catch up. 38.17 + if (_slowdown_calling_thread && thread != _worker_thread) { 38.18 + os::yield_all(); 38.19 + } 38.20 + 38.21 if (thread->is_Java_thread() && ((JavaThread*)thread)->is_safepoint_visible()) { 38.22 JavaThread* java_thread = (JavaThread*)thread; 38.23 JavaThreadState state = java_thread->thread_state(); 38.24 @@ -442,6 +449,7 @@ 38.25 #define MAX_SAFEPOINTS_TO_SKIP 128 38.26 #define SAFE_SEQUENCE_THRESHOLD 30 38.27 #define HIGH_GENERATION_THRESHOLD 60 38.28 +#define MAX_RECORDER_THREAD_RATIO 30 38.29 38.30 void MemTracker::sync() { 38.31 assert(_tracking_level > NMT_off, "NMT is not enabled"); 38.32 @@ -487,6 +495,13 @@ 38.33 pending_recorders = _global_recorder; 38.34 _global_recorder = NULL; 38.35 } 38.36 + 38.37 + // see if NMT has too many outstanding recorder instances, it usually 38.38 + // means that worker thread is lagging behind in processing them. 38.39 + if (!AutoShutdownNMT) { 38.40 + _slowdown_calling_thread = (MemRecorder::_instance_count > MAX_RECORDER_THREAD_RATIO * _thread_count); 38.41 + } 38.42 + 38.43 // check _worker_thread with lock to avoid racing condition 38.44 if (_worker_thread != NULL) { 38.45 _worker_thread->at_sync_point(pending_recorders, InstanceKlass::number_of_instance_classes());
39.1 --- a/src/share/vm/services/memTracker.hpp Tue Apr 02 10:03:02 2013 +0200 39.2 +++ b/src/share/vm/services/memTracker.hpp Wed Apr 03 09:19:02 2013 +0200 39.3 @@ -84,6 +84,7 @@ 39.4 static inline bool baseline() { return false; } 39.5 static inline bool has_baseline() { return false; } 39.6 39.7 + static inline void set_autoShutdown(bool value) { } 39.8 static void shutdown(ShutdownReason reason) { } 39.9 static inline bool shutdown_in_progress() { } 39.10 static bool print_memory_usage(BaselineOutputer& out, size_t unit, 39.11 @@ -238,6 +239,16 @@ 39.12 // if native memory tracking tracks callsite 39.13 static inline bool track_callsite() { return _tracking_level == NMT_detail; } 39.14 39.15 + // NMT automatically shuts itself down under extreme situation by default. 39.16 + // When the value is set to false, NMT will try its best to stay alive, 39.17 + // even it has to slow down VM. 39.18 + static inline void set_autoShutdown(bool value) { 39.19 + AutoShutdownNMT = value; 39.20 + if (AutoShutdownNMT && _slowdown_calling_thread) { 39.21 + _slowdown_calling_thread = false; 39.22 + } 39.23 + } 39.24 + 39.25 // shutdown native memory tracking capability. Native memory tracking 39.26 // can be shutdown by VM when it encounters low memory scenarios. 39.27 // Memory tracker should gracefully shutdown itself, and preserve the 39.28 @@ -507,6 +518,10 @@ 39.29 // although NMT is still procesing current generation, but 39.30 // there is not more recorder to process, set idle state 39.31 static volatile bool _worker_thread_idle; 39.32 + 39.33 + // if NMT should slow down calling thread to allow 39.34 + // worker thread to catch up 39.35 + static volatile bool _slowdown_calling_thread; 39.36 }; 39.37 39.38 #endif // !INCLUDE_NMT
40.1 --- a/src/share/vm/services/nmtDCmd.cpp Tue Apr 02 10:03:02 2013 +0200 40.2 +++ b/src/share/vm/services/nmtDCmd.cpp Wed Apr 03 09:19:02 2013 +0200 40.3 @@ -49,6 +49,9 @@ 40.4 _shutdown("shutdown", "request runtime to shutdown itself and free the " \ 40.5 "memory used by runtime.", 40.6 "BOOLEAN", false, "false"), 40.7 + _auto_shutdown("autoShutdown", "automatically shutdown itself under " \ 40.8 + "stress situation", 40.9 + "BOOLEAN", true, "true"), 40.10 #ifndef PRODUCT 40.11 _debug("debug", "print tracker statistics. Debug only, not thread safe", \ 40.12 "BOOLEAN", false, "false"), 40.13 @@ -61,6 +64,7 @@ 40.14 _dcmdparser.add_dcmd_option(&_summary_diff); 40.15 _dcmdparser.add_dcmd_option(&_detail_diff); 40.16 _dcmdparser.add_dcmd_option(&_shutdown); 40.17 + _dcmdparser.add_dcmd_option(&_auto_shutdown); 40.18 #ifndef PRODUCT 40.19 _dcmdparser.add_dcmd_option(&_debug); 40.20 #endif 40.21 @@ -84,17 +88,19 @@ 40.22 } 40.23 40.24 int nopt = 0; 40.25 - if(_summary.is_set() && _summary.value()) { ++nopt; } 40.26 - if(_detail.is_set() && _detail.value()) { ++nopt; } 40.27 - if(_baseline.is_set() && _baseline.value()) { ++nopt; } 40.28 - if(_summary_diff.is_set() && _summary_diff.value()) { ++nopt; } 40.29 - if(_detail_diff.is_set() && _detail_diff.value()) { ++nopt; } 40.30 - if(_shutdown.is_set() && _shutdown.value()) { ++nopt; } 40.31 + if (_summary.is_set() && _summary.value()) { ++nopt; } 40.32 + if (_detail.is_set() && _detail.value()) { ++nopt; } 40.33 + if (_baseline.is_set() && _baseline.value()) { ++nopt; } 40.34 + if (_summary_diff.is_set() && _summary_diff.value()) { ++nopt; } 40.35 + if (_detail_diff.is_set() && _detail_diff.value()) { ++nopt; } 40.36 + if (_shutdown.is_set() && _shutdown.value()) { ++nopt; } 40.37 + if (_auto_shutdown.is_set()) { ++nopt; } 40.38 + 40.39 #ifndef PRODUCT 40.40 - if(_debug.is_set() && _debug.value()) { ++nopt; } 40.41 + if (_debug.is_set() && _debug.value()) { ++nopt; } 40.42 #endif 40.43 40.44 - if(nopt > 1) { 40.45 + if (nopt > 1) { 40.46 output()->print_cr("At most one of the following option can be specified: " \ 40.47 "summary, detail, baseline, summary.diff, detail.diff, shutdown" 40.48 #ifndef PRODUCT 40.49 @@ -156,6 +162,8 @@ 40.50 MemTracker::shutdown(MemTracker::NMT_shutdown_user); 40.51 output()->print_cr("Shutdown is in progress, it will take a few moments to " \ 40.52 "completely shutdown"); 40.53 + } else if (_auto_shutdown.is_set()) { 40.54 + MemTracker::set_autoShutdown(_auto_shutdown.value()); 40.55 } else { 40.56 ShouldNotReachHere(); 40.57 output()->print_cr("Unknown command");
41.1 --- a/src/share/vm/services/nmtDCmd.hpp Tue Apr 02 10:03:02 2013 +0200 41.2 +++ b/src/share/vm/services/nmtDCmd.hpp Wed Apr 03 09:19:02 2013 +0200 41.3 @@ -39,6 +39,7 @@ 41.4 DCmdArgument<bool> _summary_diff; 41.5 DCmdArgument<bool> _detail_diff; 41.6 DCmdArgument<bool> _shutdown; 41.7 + DCmdArgument<bool> _auto_shutdown; 41.8 #ifndef PRODUCT 41.9 DCmdArgument<bool> _debug; 41.10 #endif
42.1 --- a/test/compiler/5091921/Test6890943.sh Tue Apr 02 10:03:02 2013 +0200 42.2 +++ b/test/compiler/5091921/Test6890943.sh Wed Apr 03 09:19:02 2013 +0200 42.3 @@ -22,26 +22,16 @@ 42.4 # questions. 42.5 # 42.6 # 42.7 - 42.8 +## some tests require path to find test source dir 42.9 if [ "${TESTSRC}" = "" ] 42.10 then 42.11 - echo "TESTSRC not set. Test cannot execute. Failed." 42.12 - exit 1 42.13 + TESTSRC=${PWD} 42.14 + echo "TESTSRC not set. Using "${TESTSRC}" as default" 42.15 fi 42.16 echo "TESTSRC=${TESTSRC}" 42.17 -if [ "${TESTJAVA}" = "" ] 42.18 -then 42.19 - echo "TESTJAVA not set. Test cannot execute. Failed." 42.20 - exit 1 42.21 -fi 42.22 -echo "TESTJAVA=${TESTJAVA}" 42.23 -if [ "${TESTCLASSES}" = "" ] 42.24 -then 42.25 - echo "TESTCLASSES not set. Test cannot execute. Failed." 42.26 - exit 1 42.27 -fi 42.28 -echo "TESTCLASSES=${TESTCLASSES}" 42.29 -echo "CLASSPATH=${CLASSPATH}" 42.30 +## Adding common setup Variables for running shell tests. 42.31 +. ${TESTSRC}/../../test_env.sh 42.32 + 42.33 42.34 set -x 42.35 42.36 @@ -50,7 +40,7 @@ 42.37 cp ${TESTSRC}/output6890943.txt . 42.38 cp ${TESTSRC}/Test6890943.sh . 42.39 42.40 -${TESTJAVA}/bin/javac -d . Test6890943.java 42.41 +${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} -d . Test6890943.java 42.42 42.43 ${TESTJAVA}/bin/java -XX:-PrintVMOptions -XX:+IgnoreUnrecognizedVMOptions ${TESTVMOPTS} Test6890943 < input6890943.txt > pretest.out 2>&1 42.44
43.1 --- a/test/compiler/5091921/Test7005594.sh Tue Apr 02 10:03:02 2013 +0200 43.2 +++ b/test/compiler/5091921/Test7005594.sh Wed Apr 03 09:19:02 2013 +0200 43.3 @@ -22,26 +22,15 @@ 43.4 # questions. 43.5 # 43.6 # 43.7 - 43.8 +## some tests require path to find test source dir 43.9 if [ "${TESTSRC}" = "" ] 43.10 then 43.11 - echo "TESTSRC not set. Test cannot execute. Failed." 43.12 - exit 1 43.13 + TESTSRC=${PWD} 43.14 + echo "TESTSRC not set. Using "${TESTSRC}" as default" 43.15 fi 43.16 echo "TESTSRC=${TESTSRC}" 43.17 -if [ "${TESTJAVA}" = "" ] 43.18 -then 43.19 - echo "TESTJAVA not set. Test cannot execute. Failed." 43.20 - exit 1 43.21 -fi 43.22 -echo "TESTJAVA=${TESTJAVA}" 43.23 -if [ "${TESTCLASSES}" = "" ] 43.24 -then 43.25 - echo "TESTCLASSES not set. Test cannot execute. Failed." 43.26 - exit 1 43.27 -fi 43.28 -echo "TESTCLASSES=${TESTCLASSES}" 43.29 -echo "CLASSPATH=${CLASSPATH}" 43.30 +## Adding common setup Variables for running shell tests. 43.31 +. ${TESTSRC}/../../test_env.sh 43.32 43.33 # Amount of physical memory in megabytes 43.34 MEM=0 43.35 @@ -87,7 +76,7 @@ 43.36 cp ${TESTSRC}/Test7005594.java . 43.37 cp ${TESTSRC}/Test7005594.sh . 43.38 43.39 -${TESTJAVA}/bin/javac -d . Test7005594.java 43.40 +${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} -d . Test7005594.java 43.41 43.42 ${TESTJAVA}/bin/java ${TESTVMOPTS} -Xms1600m -XX:+IgnoreUnrecognizedVMOptions -XX:-ZapUnusedHeapArea -Xcomp -XX:CompileOnly=Test7005594.test Test7005594 > test.out 2>&1 43.43
44.1 --- a/test/compiler/6857159/Test6857159.sh Tue Apr 02 10:03:02 2013 +0200 44.2 +++ b/test/compiler/6857159/Test6857159.sh Wed Apr 03 09:19:02 2013 +0200 44.3 @@ -22,33 +22,22 @@ 44.4 # questions. 44.5 # 44.6 # 44.7 - 44.8 +## some tests require path to find test source dir 44.9 if [ "${TESTSRC}" = "" ] 44.10 then 44.11 - echo "TESTSRC not set. Test cannot execute. Failed." 44.12 - exit 1 44.13 + TESTSRC=${PWD} 44.14 + echo "TESTSRC not set. Using "${TESTSRC}" as default" 44.15 fi 44.16 echo "TESTSRC=${TESTSRC}" 44.17 -if [ "${TESTJAVA}" = "" ] 44.18 -then 44.19 - echo "TESTJAVA not set. Test cannot execute. Failed." 44.20 - exit 1 44.21 -fi 44.22 -echo "TESTJAVA=${TESTJAVA}" 44.23 -if [ "${TESTCLASSES}" = "" ] 44.24 -then 44.25 - echo "TESTCLASSES not set. Test cannot execute. Failed." 44.26 - exit 1 44.27 -fi 44.28 -echo "TESTCLASSES=${TESTCLASSES}" 44.29 -echo "CLASSPATH=${CLASSPATH}" 44.30 +## Adding common setup Variables for running shell tests. 44.31 +. ${TESTSRC}/../../test_env.sh 44.32 44.33 set -x 44.34 44.35 cp ${TESTSRC}/Test6857159.java . 44.36 cp ${TESTSRC}/Test6857159.sh . 44.37 44.38 -${TESTJAVA}/bin/javac -d . Test6857159.java 44.39 +${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} -d . Test6857159.java 44.40 44.41 ${TESTJAVA}/bin/java ${TESTVMOPTS} -Xbatch -XX:+PrintCompilation -XX:CompileOnly=Test6857159\$ct.run Test6857159 > test.out 2>&1 44.42
45.1 --- a/test/compiler/7068051/Test7068051.sh Tue Apr 02 10:03:02 2013 +0200 45.2 +++ b/test/compiler/7068051/Test7068051.sh Wed Apr 03 09:19:02 2013 +0200 45.3 @@ -22,28 +22,24 @@ 45.4 # questions. 45.5 # 45.6 # 45.7 - 45.8 +## some tests require path to find test source dir 45.9 if [ "${TESTSRC}" = "" ] 45.10 then 45.11 - echo "TESTSRC not set. Test cannot execute. Failed." 45.12 - exit 1 45.13 + TESTSRC=${PWD} 45.14 + echo "TESTSRC not set. Using "${TESTSRC}" as default" 45.15 fi 45.16 echo "TESTSRC=${TESTSRC}" 45.17 -if [ "${TESTJAVA}" = "" ] 45.18 -then 45.19 - echo "TESTJAVA not set. Test cannot execute. Failed." 45.20 - exit 1 45.21 -fi 45.22 -echo "TESTJAVA=${TESTJAVA}" 45.23 +## Adding common setup Variables for running shell tests. 45.24 +. ${TESTSRC}/../../test_env.sh 45.25 45.26 set -x 45.27 45.28 -${TESTJAVA}/bin/jar xf ${TESTJAVA}/jre/lib/javaws.jar 45.29 -${TESTJAVA}/bin/jar cf foo.jar * 45.30 +${COMPILEJAVA}/bin/jar xf ${COMPILEJAVA}/jre/lib/javaws.jar 45.31 +${COMPILEJAVA}/bin/jar cf foo.jar * 45.32 cp ${TESTSRC}/Test7068051.java ./ 45.33 -${TESTJAVA}/bin/jar -uf0 foo.jar Test7068051.java 45.34 +${COMPILEJAVA}/bin/jar -uf0 foo.jar Test7068051.java 45.35 45.36 -${TESTJAVA}/bin/javac -d . Test7068051.java 45.37 +${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} -d . Test7068051.java 45.38 45.39 ${TESTJAVA}/bin/java ${TESTVMOPTS} -showversion -Xbatch Test7068051 foo.jar 45.40
46.1 --- a/test/compiler/7070134/Test7070134.sh Tue Apr 02 10:03:02 2013 +0200 46.2 +++ b/test/compiler/7070134/Test7070134.sh Wed Apr 03 09:19:02 2013 +0200 46.3 @@ -22,33 +22,22 @@ 46.4 # questions. 46.5 # 46.6 # 46.7 - 46.8 +## some tests require path to find test source dir 46.9 if [ "${TESTSRC}" = "" ] 46.10 then 46.11 - echo "TESTSRC not set. Test cannot execute. Failed." 46.12 - exit 1 46.13 + TESTSRC=${PWD} 46.14 + echo "TESTSRC not set. Using "${TESTSRC}" as default" 46.15 fi 46.16 echo "TESTSRC=${TESTSRC}" 46.17 -if [ "${TESTJAVA}" = "" ] 46.18 -then 46.19 - echo "TESTJAVA not set. Test cannot execute. Failed." 46.20 - exit 1 46.21 -fi 46.22 -echo "TESTJAVA=${TESTJAVA}" 46.23 -if [ "${TESTCLASSES}" = "" ] 46.24 -then 46.25 - echo "TESTCLASSES not set. Test cannot execute. Failed." 46.26 - exit 1 46.27 -fi 46.28 -echo "TESTCLASSES=${TESTCLASSES}" 46.29 -echo "CLASSPATH=${CLASSPATH}" 46.30 +## Adding common setup Variables for running shell tests. 46.31 +. ${TESTSRC}/../../test_env.sh 46.32 46.33 set -x 46.34 46.35 cp ${TESTSRC}/Stemmer.java . 46.36 cp ${TESTSRC}/words . 46.37 46.38 -${TESTJAVA}/bin/javac -d . Stemmer.java 46.39 +${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} -d . Stemmer.java 46.40 46.41 ${TESTJAVA}/bin/java ${TESTVMOPTS} -Xbatch Stemmer words > test.out 2>&1 46.42
47.1 --- a/test/compiler/7200264/Test7200264.sh Tue Apr 02 10:03:02 2013 +0200 47.2 +++ b/test/compiler/7200264/Test7200264.sh Wed Apr 03 09:19:02 2013 +0200 47.3 @@ -23,50 +23,15 @@ 47.4 # 47.5 # 47.6 47.7 +## some tests require path to find test source dir 47.8 if [ "${TESTSRC}" = "" ] 47.9 then 47.10 - echo "TESTSRC not set. Test cannot execute. Failed." 47.11 - exit 1 47.12 + TESTSRC=${PWD} 47.13 + echo "TESTSRC not set. Using "${TESTSRC}" as default" 47.14 fi 47.15 echo "TESTSRC=${TESTSRC}" 47.16 -if [ "${TESTJAVA}" = "" ] 47.17 -then 47.18 - echo "TESTJAVA not set. Test cannot execute. Failed." 47.19 - exit 1 47.20 -fi 47.21 -echo "TESTJAVA=${TESTJAVA}" 47.22 -if [ "${TESTCLASSES}" = "" ] 47.23 -then 47.24 - echo "TESTCLASSES not set. Test cannot execute. Failed." 47.25 - exit 1 47.26 -fi 47.27 -echo "TESTCLASSES=${TESTCLASSES}" 47.28 -echo "CLASSPATH=${CLASSPATH}" 47.29 - 47.30 -# set platform-dependent variables 47.31 -OS=`uname -s` 47.32 -case "$OS" in 47.33 - SunOS | Linux | Darwin ) 47.34 - NULL=/dev/null 47.35 - PS=":" 47.36 - FS="/" 47.37 - ;; 47.38 - Windows_* ) 47.39 - NULL=NUL 47.40 - PS=";" 47.41 - FS="\\" 47.42 - ;; 47.43 - CYGWIN_* ) 47.44 - NULL=/dev/null 47.45 - PS=";" 47.46 - FS="/" 47.47 - ;; 47.48 - * ) 47.49 - echo "Unrecognized system!" 47.50 - exit 1; 47.51 - ;; 47.52 -esac 47.53 - 47.54 +## Adding common setup Variables for running shell tests. 47.55 +. ${TESTSRC}/../../test_env.sh 47.56 47.57 ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -Xinternalversion | sed 's/amd64/x86/' | grep "x86" | grep "Server VM" | grep "debug" 47.58 47.59 @@ -88,7 +53,7 @@ 47.60 fi 47.61 47.62 cp ${TESTSRC}${FS}TestIntVect.java . 47.63 -${TESTJAVA}${FS}bin${FS}javac -d . TestIntVect.java 47.64 +${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} -d . TestIntVect.java 47.65 47.66 ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -Xbatch -XX:-TieredCompilation -XX:CICompilerCount=1 -XX:+PrintCompilation -XX:+TraceNewVectors TestIntVect > test.out 2>&1 47.67
48.1 --- a/test/gc/6941923/test6941923.sh Tue Apr 02 10:03:02 2013 +0200 48.2 +++ b/test/gc/6941923/test6941923.sh Wed Apr 03 09:19:02 2013 +0200 48.3 @@ -5,38 +5,25 @@ 48.4 ## @author yqi 48.5 ## @run shell test6941923.sh 48.6 ## 48.7 +## some tests require path to find test source dir 48.8 +if [ "${TESTSRC}" = "" ] 48.9 +then 48.10 + TESTSRC=${PWD} 48.11 + echo "TESTSRC not set. Using "${TESTSRC}" as default" 48.12 +fi 48.13 +echo "TESTSRC=${TESTSRC}" 48.14 +## Adding common setup Variables for running shell tests. 48.15 +. ${TESTSRC}/../../test_env.sh 48.16 48.17 ## skip on windows 48.18 OS=`uname -s` 48.19 case "$OS" in 48.20 - SunOS | Linux | Darwin ) 48.21 - NULL=/dev/null 48.22 - PS=":" 48.23 - FS="/" 48.24 - ;; 48.25 Windows_* | CYGWIN_* ) 48.26 echo "Test skipped for Windows" 48.27 exit 0 48.28 ;; 48.29 - * ) 48.30 - echo "Unrecognized system!" 48.31 - exit 1; 48.32 - ;; 48.33 esac 48.34 48.35 -if [ "${JAVA_HOME}" = "" ] 48.36 -then 48.37 - echo "JAVA_HOME not set" 48.38 - exit 0 48.39 -fi 48.40 - 48.41 -$JAVA_HOME/bin/java ${TESTVMOPTS} -version > $NULL 2>&1 48.42 - 48.43 -if [ $? != 0 ]; then 48.44 - echo "Wrong JAVA_HOME? JAVA_HOME: $JAVA_HOME" 48.45 - exit $? 48.46 -fi 48.47 - 48.48 # create a small test case 48.49 testname="Test" 48.50 if [ -e ${testname}.java ]; then 48.51 @@ -96,10 +83,10 @@ 48.52 msgfail="failed" 48.53 gclogsize="16K" 48.54 filesize=$((16*1024)) 48.55 -$JAVA_HOME/bin/javac ${testname}.java > $NULL 2>&1 48.56 +${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} ${testname}.java > $NULL 2>&1 48.57 48.58 if [ $? != 0 ]; then 48.59 - echo "$JAVA_HOME/bin/javac ${testname}.java $fail" 48.60 + echo "${COMPILEJAVA}/bin/javac ${testname}.java $fail" 48.61 exit -1 48.62 fi 48.63 48.64 @@ -119,7 +106,7 @@ 48.65 48.66 options="-Xloggc:$logfile -XX:+UseConcMarkSweepGC -XX:+PrintGC -XX:+PrintGCDetails -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=1 -XX:GCLogFileSize=$gclogsize" 48.67 echo "Test gc log rotation in same file, wait for $tts minutes ...." 48.68 -$JAVA_HOME/bin/java ${TESTVMOPTS} $options $testname $tts 48.69 +${TESTJAVA}/bin/java $options $testname $tts 48.70 if [ $? != 0 ]; then 48.71 echo "$msgfail" 48.72 exit -1 48.73 @@ -148,7 +135,7 @@ 48.74 numoffiles=3 48.75 options="-Xloggc:$logfile -XX:+UseConcMarkSweepGC -XX:+PrintGC -XX:+PrintGCDetails -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=$numoffiles -XX:GCLogFileSize=$gclogsize" 48.76 echo "Test gc log rotation in $numoffiles files, wait for $tts minutes ...." 48.77 -$JAVA_HOME/bin/java ${TESTVMOPTS} $options $testname $tts 48.78 +${TESTJAVA}/bin/java $options $testname $tts 48.79 if [ $? != 0 ]; then 48.80 echo "$msgfail" 48.81 exit -1
49.1 --- a/test/runtime/6626217/Test6626217.sh Tue Apr 02 10:03:02 2013 +0200 49.2 +++ b/test/runtime/6626217/Test6626217.sh Wed Apr 03 09:19:02 2013 +0200 49.3 @@ -27,78 +27,29 @@ 49.4 # @summary Loader-constraint table allows arrays instead of only the base-classes 49.5 # @run shell Test6626217.sh 49.6 # 49.7 - 49.8 +## some tests require path to find test source dir 49.9 if [ "${TESTSRC}" = "" ] 49.10 - then TESTSRC=. 49.11 +then 49.12 + TESTSRC=${PWD} 49.13 + echo "TESTSRC not set. Using "${TESTSRC}" as default" 49.14 fi 49.15 - 49.16 -if [ "${TESTJAVA}" = "" ] 49.17 -then 49.18 - PARENT=`dirname \`which java\`` 49.19 - TESTJAVA=`dirname ${PARENT}` 49.20 - echo "TESTJAVA not set, selecting " ${TESTJAVA} 49.21 - echo "If this is incorrect, try setting the variable manually." 49.22 -fi 49.23 - 49.24 -if [ "${TESTCLASSES}" = "" ] 49.25 -then 49.26 - echo "TESTCLASSES not set. Test cannot execute. Failed." 49.27 - exit 1 49.28 -fi 49.29 - 49.30 -# set platform-dependent variables 49.31 -OS=`uname -s` 49.32 -case "$OS" in 49.33 - SunOS | Linux | Darwin ) 49.34 - NULL=/dev/null 49.35 - PS=":" 49.36 - FS="/" 49.37 - RM=/bin/rm 49.38 - CP=/bin/cp 49.39 - MV=/bin/mv 49.40 - ;; 49.41 - Windows_* ) 49.42 - NULL=NUL 49.43 - PS=";" 49.44 - FS="\\" 49.45 - RM=rm 49.46 - CP=cp 49.47 - MV=mv 49.48 - ;; 49.49 - CYGWIN_* ) 49.50 - NULL=/dev/null 49.51 - PS=";" 49.52 - FS="/" 49.53 - RM=rm 49.54 - CP=cp 49.55 - MV=mv 49.56 - ;; 49.57 - * ) 49.58 - echo "Unrecognized system!" 49.59 - exit 1; 49.60 - ;; 49.61 -esac 49.62 - 49.63 -JEMMYPATH=${CPAPPEND} 49.64 -CLASSPATH=.${PS}${TESTCLASSES}${PS}${JEMMYPATH} ; export CLASSPATH 49.65 - 49.66 -THIS_DIR=`pwd` 49.67 +echo "TESTSRC=${TESTSRC}" 49.68 +## Adding common setup Variables for running shell tests. 49.69 +. ${TESTSRC}/../../test_env.sh 49.70 49.71 JAVA=${TESTJAVA}${FS}bin${FS}java 49.72 -JAVAC=${TESTJAVA}${FS}bin${FS}javac 49.73 - 49.74 -${JAVA} ${TESTVMOPTS} -version 49.75 +JAVAC=${COMPILEJAVA}${FS}bin${FS}javac 49.76 49.77 # Current directory is scratch directory, copy all the test source there 49.78 # (for the subsequent moves to work). 49.79 -${CP} ${TESTSRC}${FS}* ${THIS_DIR} 49.80 +${CP} ${TESTSRC}${FS}* ${THIS_DIR} 49.81 49.82 # A Clean Compile: this line will probably fail within jtreg as have a clean dir: 49.83 ${RM} -f *.class *.impl many_loader.java 49.84 49.85 # Compile all the usual suspects, including the default 'many_loader' 49.86 ${CP} many_loader1.java.foo many_loader.java 49.87 -${JAVAC} -source 1.4 -target 1.4 -Xlint *.java 49.88 +${JAVAC} ${TESTJAVACOPTS} -source 1.4 -target 1.4 -Xlint *.java 49.89 49.90 # Rename the class files, so the custom loader (and not the system loader) will find it 49.91 ${MV} from_loader2.class from_loader2.impl2 49.92 @@ -106,7 +57,7 @@ 49.93 # Compile the next version of 'many_loader' 49.94 ${MV} many_loader.class many_loader.impl1 49.95 ${CP} many_loader2.java.foo many_loader.java 49.96 -${JAVAC} -source 1.4 -target 1.4 -Xlint many_loader.java 49.97 +${JAVAC} ${TESTJAVACOPTS} -source 1.4 -target 1.4 -Xlint many_loader.java 49.98 49.99 # Rename the class file, so the custom loader (and not the system loader) will find it 49.100 ${MV} many_loader.class many_loader.impl2
50.1 --- a/test/runtime/6878713/Test6878713.sh Tue Apr 02 10:03:02 2013 +0200 50.2 +++ b/test/runtime/6878713/Test6878713.sh Wed Apr 03 09:19:02 2013 +0200 50.3 @@ -1,71 +1,137 @@ 50.4 #!/bin/sh 50.5 50.6 +# 50.7 +# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. 50.8 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 50.9 +# 50.10 +# This code is free software; you can redistribute it and/or modify it 50.11 +# under the terms of the GNU General Public License version 2 only, as 50.12 +# published by the Free Software Foundation. 50.13 +# 50.14 +# This code is distributed in the hope that it will be useful, but WITHOUT 50.15 +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 50.16 +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 50.17 +# version 2 for more details (a copy is included in the LICENSE file that 50.18 +# accompanied this code). 50.19 +# 50.20 +# You should have received a copy of the GNU General Public License version 50.21 +# 2 along with this work; if not, write to the Free Software Foundation, 50.22 +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 50.23 +# 50.24 +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 50.25 +# or visit www.oracle.com if you need additional information or have any 50.26 +# questions. 50.27 +# 50.28 + 50.29 + 50.30 + 50.31 ## 50.32 ## @test 50.33 ## @bug 6878713 50.34 +## @bug 7030610 50.35 +## @bug 7037122 50.36 +## @bug 7123945 50.37 ## @summary Verifier heap corruption, relating to backward jsrs 50.38 -## @run shell/timeout=120 Test6878713.sh 50.39 +## @run shell Test6878713.sh 50.40 ## 50.41 +## some tests require path to find test source dir 50.42 +if [ "${TESTSRC}" = "" ] 50.43 +then 50.44 + TESTSRC=${PWD} 50.45 + echo "TESTSRC not set. Using "${TESTSRC}" as default" 50.46 +fi 50.47 +echo "TESTSRC=${TESTSRC}" 50.48 +## Adding common setup Variables for running shell tests. 50.49 +. ${TESTSRC}/../../test_env.sh 50.50 50.51 -if [ "${TESTSRC}" = "" ] 50.52 -then TESTSRC=. 50.53 +TARGET_CLASS=OOMCrashClass1960_2 50.54 + 50.55 +echo "INFO: extracting the target class." 50.56 +${COMPILEJAVA}${FS}bin${FS}jar xvf \ 50.57 + ${TESTSRC}${FS}testcase.jar ${TARGET_CLASS}.class 50.58 + 50.59 +# remove any hs_err_pid that might exist here 50.60 +rm -f hs_err_pid*.log 50.61 + 50.62 +echo "INFO: checking for 32-bit versus 64-bit VM." 50.63 +${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -version 2>&1 \ 50.64 + | grep "64-Bit [^ ][^ ]* VM" > /dev/null 2>&1 50.65 +status="$?" 50.66 +if [ "$status" = 0 ]; then 50.67 + echo "INFO: testing a 64-bit VM." 50.68 + is_64_bit=true 50.69 +else 50.70 + echo "INFO: testing a 32-bit VM." 50.71 fi 50.72 50.73 -if [ "${TESTJAVA}" = "" ] 50.74 -then 50.75 - PARENT=`dirname \`which java\`` 50.76 - TESTJAVA=`dirname ${PARENT}` 50.77 - echo "TESTJAVA not set, selecting " ${TESTJAVA} 50.78 - echo "If this is incorrect, try setting the variable manually." 50.79 +if [ "$is_64_bit" = true ]; then 50.80 + # limit is 768MB in 8-byte words (1024 * 1024 * 768 / 8) == 100663296 50.81 + MALLOC_MAX=100663296 50.82 +else 50.83 + # limit is 768MB in 4-byte words (1024 * 1024 * 768 / 4) == 201326592 50.84 + MALLOC_MAX=201326592 50.85 +fi 50.86 +echo "INFO: MALLOC_MAX=$MALLOC_MAX" 50.87 + 50.88 +echo "INFO: executing the target class." 50.89 +# -XX:+PrintCommandLineFlags for debugging purposes 50.90 +# -XX:+IgnoreUnrecognizedVMOptions so test will run on a VM without 50.91 +# the new -XX:MallocMaxTestWords option 50.92 +# -XX:+UnlockDiagnosticVMOptions so we can use -XX:MallocMaxTestWords 50.93 +# -XX:MallocMaxTestWords limits malloc to $MALLOC_MAX 50.94 +${TESTJAVA}${FS}bin${FS}java \ 50.95 + -XX:+PrintCommandLineFlags \ 50.96 + -XX:+IgnoreUnrecognizedVMOptions \ 50.97 + -XX:+UnlockDiagnosticVMOptions \ 50.98 + -XX:MallocMaxTestWords=$MALLOC_MAX \ 50.99 + ${TESTVMOPTS} ${TARGET_CLASS} > test.out 2>&1 50.100 + 50.101 +echo "INFO: begin contents of test.out:" 50.102 +cat test.out 50.103 +echo "INFO: end contents of test.out." 50.104 + 50.105 +echo "INFO: checking for memory allocation error message." 50.106 +# We are looking for this specific memory allocation failure mesg so 50.107 +# we know we exercised the right allocation path with the test class: 50.108 +MESG1="Native memory allocation (malloc) failed to allocate 25696531[0-9][0-9] bytes" 50.109 +grep "$MESG1" test.out 50.110 +status="$?" 50.111 +if [ "$status" = 0 ]; then 50.112 + echo "INFO: found expected memory allocation error message." 50.113 +else 50.114 + echo "INFO: did not find expected memory allocation error message." 50.115 + 50.116 + # If we didn't find MESG1 above, then there are several scenarios: 50.117 + # 1) -XX:MallocMaxTestWords is not supported by the current VM and we 50.118 + # didn't fail TARGET_CLASS's memory allocation attempt; instead 50.119 + # we failed to find TARGET_CLASS's main() method. The TARGET_CLASS 50.120 + # is designed to provoke a memory allocation failure during class 50.121 + # loading; we actually don't care about running the class which is 50.122 + # why it doesn't have a main() method. 50.123 + # 2) we failed a memory allocation, but not the one we were looking 50.124 + # so it might be that TARGET_CLASS no longer tickles the same 50.125 + # memory allocation code path 50.126 + # 3) TARGET_CLASS reproduces the failure mode (SIGSEGV) fixed by 50.127 + # 6878713 because the test is running on a pre-fix VM. 50.128 + echo "INFO: checking for no main() method message." 50.129 + MESG2="Error: Main method not found in class" 50.130 + grep "$MESG2" test.out 50.131 + status="$?" 50.132 + if [ "$status" = 0 ]; then 50.133 + echo "INFO: found no main() method message." 50.134 + else 50.135 + echo "FAIL: did not find no main() method message." 50.136 + # status is non-zero for exit below 50.137 + 50.138 + if [ -s hs_err_pid*.log ]; then 50.139 + echo "INFO: begin contents of hs_err_pid file:" 50.140 + cat hs_err_pid*.log 50.141 + echo "INFO: end contents of hs_err_pid file." 50.142 + fi 50.143 + fi 50.144 fi 50.145 50.146 -if [ "${TESTCLASSES}" = "" ] 50.147 -then 50.148 - echo "TESTCLASSES not set. Test cannot execute. Failed." 50.149 - exit 1 50.150 +if [ "$status" = 0 ]; then 50.151 + echo "PASS: test found one of the expected messages." 50.152 fi 50.153 - 50.154 -# set platform-dependent variables 50.155 -OS=`uname -s` 50.156 -case "$OS" in 50.157 - SunOS | Linux | Darwin ) 50.158 - NULL=/dev/null 50.159 - PS=":" 50.160 - FS="/" 50.161 - ;; 50.162 - Windows_* ) 50.163 - NULL=NUL 50.164 - PS=";" 50.165 - FS="\\" 50.166 - ;; 50.167 - CYGWIN_* ) 50.168 - NULL=/dev/null 50.169 - PS=";" 50.170 - FS="/" 50.171 - ;; 50.172 - * ) 50.173 - echo "Unrecognized system!" 50.174 - exit 1; 50.175 - ;; 50.176 -esac 50.177 - 50.178 -JEMMYPATH=${CPAPPEND} 50.179 -CLASSPATH=.${PS}${TESTCLASSES}${PS}${JEMMYPATH} ; export CLASSPATH 50.180 - 50.181 -THIS_DIR=`pwd` 50.182 - 50.183 -${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -version 50.184 - 50.185 -${TESTJAVA}${FS}bin${FS}jar xvf ${TESTSRC}${FS}testcase.jar 50.186 - 50.187 -${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} OOMCrashClass1960_2 > test.out 2>&1 50.188 - 50.189 -if [ -s core -o -s "hs_*.log" ] 50.190 -then 50.191 - cat hs*.log 50.192 - echo "Test Failed" 50.193 - exit 1 50.194 -else 50.195 - echo "Test Passed" 50.196 - exit 0 50.197 -fi 50.198 +exit "$status"
51.1 --- a/test/runtime/6929067/Test6929067.sh Tue Apr 02 10:03:02 2013 +0200 51.2 +++ b/test/runtime/6929067/Test6929067.sh Wed Apr 03 09:19:02 2013 +0200 51.3 @@ -7,18 +7,15 @@ 51.4 ## @compile T.java 51.5 ## @run shell Test6929067.sh 51.6 ## 51.7 - 51.8 +set -x 51.9 if [ "${TESTSRC}" = "" ] 51.10 -then TESTSRC=. 51.11 +then 51.12 + TESTSRC=${PWD} 51.13 + echo "TESTSRC not set. Using "${TESTSRC}" as default" 51.14 fi 51.15 - 51.16 -if [ "${TESTJAVA}" = "" ] 51.17 -then 51.18 - PARENT=`dirname \`which java\`` 51.19 - TESTJAVA=`dirname ${PARENT}` 51.20 - echo "TESTJAVA not set, selecting " ${TESTJAVA} 51.21 - echo "If this is incorrect, try setting the variable manually." 51.22 -fi 51.23 +echo "TESTSRC=${TESTSRC}" 51.24 +## Adding common setup Variables for running shell tests. 51.25 +. ${TESTSRC}/../../test_env.sh 51.26 51.27 # set platform-dependent variables 51.28 OS=`uname -s` 51.29 @@ -107,7 +104,7 @@ 51.30 fi 51.31 51.32 51.33 -LD_LIBRARY_PATH=.:${TESTJAVA}/jre/lib/${ARCH}/${VMTYPE}:/usr/lib:$LD_LIBRARY_PATH 51.34 +LD_LIBRARY_PATH=.:${COMPILEJAVA}/jre/lib/${ARCH}/${VMTYPE}:/usr/lib:$LD_LIBRARY_PATH 51.35 export LD_LIBRARY_PATH 51.36 51.37 cp ${TESTSRC}${FS}invoke.c . 51.38 @@ -115,15 +112,16 @@ 51.39 # Copy the result of our @compile action: 51.40 cp ${TESTCLASSES}${FS}T.class . 51.41 51.42 -${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -fullversion 51.43 - 51.44 echo "Architecture: ${ARCH}" 51.45 echo "Compilation flag: ${COMP_FLAG}" 51.46 echo "VM type: ${VMTYPE}" 51.47 +# Note pthread may not be found thus invoke creation will fail to be created. 51.48 +# Check to ensure you have a /usr/lib/libpthread.so if you don't please look 51.49 +# for /usr/lib/`uname -m`-linux-gnu version ensure to add that path to below compilation. 51.50 51.51 gcc -DLINUX ${COMP_FLAG} -o invoke \ 51.52 - -I${TESTJAVA}/include -I${TESTJAVA}/include/linux \ 51.53 - -L${TESTJAVA}/jre/lib/${ARCH}/${VMTYPE} \ 51.54 + -I${COMPILEJAVA}/include -I${COMPILEJAVA}/include/linux \ 51.55 + -L${COMPILEJAVA}/jre/lib/${ARCH}/${VMTYPE} \ 51.56 -ljvm -lpthread invoke.c 51.57 51.58 ./invoke
52.1 --- a/test/runtime/7020373/Test7020373.sh Tue Apr 02 10:03:02 2013 +0200 52.2 +++ b/test/runtime/7020373/Test7020373.sh Wed Apr 03 09:19:02 2013 +0200 52.3 @@ -10,55 +10,15 @@ 52.4 ## 52.5 52.6 if [ "${TESTSRC}" = "" ] 52.7 -then TESTSRC=. 52.8 +then 52.9 + TESTSRC=${PWD} 52.10 + echo "TESTSRC not set. Using "${TESTSRC}" as default" 52.11 fi 52.12 +echo "TESTSRC=${TESTSRC}" 52.13 +## Adding common setup Variables for running shell tests. 52.14 +. ${TESTSRC}/../../test_env.sh 52.15 52.16 -if [ "${TESTJAVA}" = "" ] 52.17 -then 52.18 - PARENT=`dirname \`which java\`` 52.19 - TESTJAVA=`dirname ${PARENT}` 52.20 - echo "TESTJAVA not set, selecting " ${TESTJAVA} 52.21 - echo "If this is incorrect, try setting the variable manually." 52.22 -fi 52.23 - 52.24 -if [ "${TESTCLASSES}" = "" ] 52.25 -then 52.26 - echo "TESTCLASSES not set. Test cannot execute. Failed." 52.27 - exit 1 52.28 -fi 52.29 - 52.30 -# set platform-dependent variables 52.31 -OS=`uname -s` 52.32 -case "$OS" in 52.33 - SunOS | Linux | Darwin ) 52.34 - NULL=/dev/null 52.35 - PS=":" 52.36 - FS="/" 52.37 - ;; 52.38 - Windows_* ) 52.39 - NULL=NUL 52.40 - PS=";" 52.41 - FS="\\" 52.42 - ;; 52.43 - CYGWIN_* ) 52.44 - NULL=/dev/null 52.45 - PS=";" 52.46 - FS="/" 52.47 - ;; 52.48 - * ) 52.49 - echo "Unrecognized system!" 52.50 - exit 1; 52.51 - ;; 52.52 -esac 52.53 - 52.54 -JEMMYPATH=${CPAPPEND} 52.55 -CLASSPATH=.${PS}${TESTCLASSES}${PS}${JEMMYPATH} ; export CLASSPATH 52.56 - 52.57 -THIS_DIR=`pwd` 52.58 - 52.59 -${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -version 52.60 - 52.61 -${TESTJAVA}${FS}bin${FS}jar xvf ${TESTSRC}${FS}testcase.jar 52.62 +${COMPILEJAVA}${FS}bin${FS}jar xvf ${TESTSRC}${FS}testcase.jar 52.63 52.64 ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} OOMCrashClass4000_1 > test.out 2>&1 52.65
53.1 --- a/test/runtime/7051189/Xchecksig.sh Tue Apr 02 10:03:02 2013 +0200 53.2 +++ b/test/runtime/7051189/Xchecksig.sh Wed Apr 03 09:19:02 2013 +0200 53.3 @@ -29,34 +29,22 @@ 53.4 # 53.5 53.6 if [ "${TESTSRC}" = "" ] 53.7 - then TESTSRC=. 53.8 +then 53.9 + TESTSRC=${PWD} 53.10 + echo "TESTSRC not set. Using "${TESTSRC}" as default" 53.11 fi 53.12 - 53.13 -if [ "${TESTJAVA}" = "" ] 53.14 -then 53.15 - PARENT=`dirname \`which java\`` 53.16 - TESTJAVA=`dirname ${PARENT}` 53.17 - printf "TESTJAVA not set, selecting " ${TESTJAVA} 53.18 - printf " If this is incorrect, try setting the variable manually.\n" 53.19 -fi 53.20 - 53.21 +echo "TESTSRC=${TESTSRC}" 53.22 +## Adding common setup Variables for running shell tests. 53.23 +. ${TESTSRC}/../../test_env.sh 53.24 53.25 OS=`uname -s` 53.26 case "$OS" in 53.27 - SunOS | Linux | Darwin ) 53.28 - FS="/" 53.29 - ;; 53.30 Windows_* | CYGWIN_* ) 53.31 printf "Not testing libjsig.so on Windows. PASSED.\n " 53.32 exit 0 53.33 ;; 53.34 - * ) 53.35 - printf "Not testing libjsig.so on unrecognised system. PASSED.\n " 53.36 - exit 0 53.37 - ;; 53.38 esac 53.39 53.40 - 53.41 JAVA=${TESTJAVA}${FS}bin${FS}java 53.42 53.43 # LD_PRELOAD arch needs to match the binary we run, so run the java 53.44 @@ -97,7 +85,7 @@ 53.45 ;; 53.46 esac 53.47 53.48 -LIBJSIG=${TESTJAVA}${FS}jre${FS}lib${FS}${ARCH}${FS}libjsig.so 53.49 +LIBJSIG=${COMPILEJAVA}${FS}jre${FS}lib${FS}${ARCH}${FS}libjsig.so 53.50 53.51 # If libjsig and binary do not match, skip test. 53.52
54.1 --- a/test/runtime/7107135/Test7107135.sh Tue Apr 02 10:03:02 2013 +0200 54.2 +++ b/test/runtime/7107135/Test7107135.sh Wed Apr 03 09:19:02 2013 +0200 54.3 @@ -32,26 +32,19 @@ 54.4 ## 54.5 54.6 if [ "${TESTSRC}" = "" ] 54.7 -then TESTSRC=. 54.8 +then 54.9 + TESTSRC=${PWD} 54.10 + echo "TESTSRC not set. Using "${TESTSRC}" as default" 54.11 fi 54.12 - 54.13 -if [ "${TESTJAVA}" = "" ] 54.14 -then 54.15 - PARENT=`dirname \`which java\`` 54.16 - TESTJAVA=`dirname ${PARENT}` 54.17 - echo "TESTJAVA not set, selecting " ${TESTJAVA} 54.18 - echo "If this is incorrect, try setting the variable manually." 54.19 -fi 54.20 - 54.21 -BIT_FLAG="" 54.22 +echo "TESTSRC=${TESTSRC}" 54.23 +## Adding common setup Variables for running shell tests. 54.24 +. ${TESTSRC}/../../test_env.sh 54.25 54.26 # set platform-dependent variables 54.27 OS=`uname -s` 54.28 case "$OS" in 54.29 Linux) 54.30 - NULL=/dev/null 54.31 - PS=":" 54.32 - FS="/" 54.33 + echo "Testing on Linux" 54.34 ;; 54.35 *) 54.36 NULL=NUL 54.37 @@ -64,7 +57,7 @@ 54.38 54.39 ARCH=`uname -m` 54.40 54.41 -THIS_DIR=`pwd` 54.42 +THIS_DIR=. 54.43 54.44 cp ${TESTSRC}${FS}*.java ${THIS_DIR} 54.45 ${TESTJAVA}${FS}bin${FS}javac *.java
55.1 --- a/test/runtime/7110720/Test7110720.sh Tue Apr 02 10:03:02 2013 +0200 55.2 +++ b/test/runtime/7110720/Test7110720.sh Wed Apr 03 09:19:02 2013 +0200 55.3 @@ -12,22 +12,13 @@ 55.4 # 55.5 55.6 if [ "${TESTSRC}" = "" ] 55.7 - then TESTSRC=. 55.8 +then 55.9 + TESTSRC=${PWD} 55.10 + echo "TESTSRC not set. Using "${TESTSRC}" as default" 55.11 fi 55.12 - 55.13 -if [ "${TESTJAVA}" = "" ] 55.14 -then 55.15 - PARENT=`dirname \`which java\`` 55.16 - TESTJAVA=`dirname ${PARENT}` 55.17 - echo "TESTJAVA not set, selecting " ${TESTJAVA} 55.18 - echo "If this is incorrect, try setting the variable manually." 55.19 -fi 55.20 - 55.21 -if [ "${TESTCLASSES}" = "" ] 55.22 -then 55.23 - echo "TESTCLASSES not set. Test cannot execute. Failed." 55.24 - exit 1 55.25 -fi 55.26 +echo "TESTSRC=${TESTSRC}" 55.27 +## Adding common setup Variables for running shell tests. 55.28 +. ${TESTSRC}/../../test_env.sh 55.29 55.30 # Jtreg sets TESTVMOPTS which may include -d64 which is 55.31 # required to test a 64-bit JVM on some platforms.
56.1 --- a/test/runtime/7158804/Test7158804.sh Tue Apr 02 10:03:02 2013 +0200 56.2 +++ b/test/runtime/7158804/Test7158804.sh Wed Apr 03 09:19:02 2013 +0200 56.3 @@ -10,13 +10,14 @@ 56.4 ## @summary Improve config file parsing 56.5 ## @run shell Test7158804.sh 56.6 ## 56.7 - 56.8 -if [ "${TESTJAVA}" = "" ] 56.9 +if [ "${TESTSRC}" = "" ] 56.10 then 56.11 - echo "TESTJAVA not set. Test cannot execute. Failed." 56.12 - exit 1 56.13 + TESTSRC=${PWD} 56.14 + echo "TESTSRC not set. Using "${TESTSRC}" as default" 56.15 fi 56.16 -echo "TESTJAVA=${TESTJAVA}" 56.17 +echo "TESTSRC=${TESTSRC}" 56.18 +## Adding common setup Variables for running shell tests. 56.19 +. ${TESTSRC}/../../test_env.sh 56.20 56.21 rm -f .hotspotrc 56.22 echo -XX:+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa >.hotspotrc
57.1 --- a/test/runtime/7162488/Test7162488.sh Tue Apr 02 10:03:02 2013 +0200 57.2 +++ b/test/runtime/7162488/Test7162488.sh Wed Apr 03 09:19:02 2013 +0200 57.3 @@ -29,27 +29,13 @@ 57.4 # 57.5 57.6 if [ "${TESTSRC}" = "" ] 57.7 - then TESTSRC=. 57.8 +then 57.9 + TESTSRC=${PWD} 57.10 + echo "TESTSRC not set. Using "${TESTSRC}" as default" 57.11 fi 57.12 - 57.13 -if [ "${TESTJAVA}" = "" ] 57.14 -then 57.15 - PARENT=`dirname \`which java\`` 57.16 - TESTJAVA=`dirname ${PARENT}` 57.17 - printf "TESTJAVA not set, selecting " ${TESTJAVA} 57.18 - printf " If this is incorrect, try setting the variable manually.\n" 57.19 -fi 57.20 - 57.21 -# set platform-dependent variables 57.22 -OS=`uname -s` 57.23 -case "$OS" in 57.24 - Windows_* ) 57.25 - FS="\\" 57.26 - ;; 57.27 - * ) 57.28 - FS="/" 57.29 - ;; 57.30 -esac 57.31 +echo "TESTSRC=${TESTSRC}" 57.32 +## Adding common setup Variables for running shell tests. 57.33 +. ${TESTSRC}/../../test_env.sh 57.34 57.35 JAVA=${TESTJAVA}${FS}bin${FS}java 57.36
58.1 --- a/test/runtime/8007736/TestStaticIF.java Tue Apr 02 10:03:02 2013 +0200 58.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 58.3 @@ -1,44 +0,0 @@ 58.4 -/* 58.5 - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 58.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 58.7 - * 58.8 - * This code is free software; you can redistribute it and/or modify it 58.9 - * under the terms of the GNU General Public License version 2 only, as 58.10 - * published by the Free Software Foundation. 58.11 - * 58.12 - * This code is distributed in the hope that it will be useful, but WITHOUT 58.13 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 58.14 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 58.15 - * version 2 for more details (a copy is included in the LICENSE file that 58.16 - * accompanied this code). 58.17 - * 58.18 - * You should have received a copy of the GNU General Public License version 58.19 - * 2 along with this work; if not, write to the Free Software Foundation, 58.20 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 58.21 - * 58.22 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 58.23 - * or visit www.oracle.com if you need additional information or have any 58.24 - * questions. 58.25 - * 58.26 - */ 58.27 - 58.28 -/* 58.29 - * @test 58.30 - * @bug 8007736 58.31 - * @summary Test static interface method. 58.32 - * @run main/othervm -Xverify:all TestStaticIF 58.33 - */ 58.34 - 58.35 -public class TestStaticIF implements StaticMethodInInterface { 58.36 - 58.37 - public static void main(String[] args) { 58.38 - System.out.printf("main: %s%n", StaticMethodInInterface.get()); 58.39 - } 58.40 -} 58.41 - 58.42 -interface StaticMethodInInterface { 58.43 - 58.44 - public static String get() { 58.45 - return "Hello from StaticMethodInInterface.get()"; 58.46 - } 58.47 -}
59.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 59.2 +++ b/test/runtime/8010389/VMThreadDlopen.java Wed Apr 03 09:19:02 2013 +0200 59.3 @@ -0,0 +1,44 @@ 59.4 +/* 59.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 59.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 59.7 + * 59.8 + * This code is free software; you can redistribute it and/or modify it 59.9 + * under the terms of the GNU General Public License version 2 only, as 59.10 + * published by the Free Software Foundation. 59.11 + * 59.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 59.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 59.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 59.15 + * version 2 for more details (a copy is included in the LICENSE file that 59.16 + * accompanied this code). 59.17 + * 59.18 + * You should have received a copy of the GNU General Public License version 59.19 + * 2 along with this work; if not, write to the Free Software Foundation, 59.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 59.21 + * 59.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 59.23 + * or visit www.oracle.com if you need additional information or have any 59.24 + * questions. 59.25 + */ 59.26 + 59.27 +import java.io.File; 59.28 + 59.29 +/* 59.30 + * @test 59.31 + * @key regression 59.32 + * @bug 8010389 59.33 + * @run main/othervm -Djava.library.path=. VMThreadDlopen 59.34 + */ 59.35 + 59.36 +public class VMThreadDlopen { 59.37 + public static void main(String[] args) throws Exception { 59.38 + File file = new File("libbroken.so"); 59.39 + file.createNewFile(); 59.40 + try { 59.41 + System.loadLibrary("broken"); 59.42 + } catch (UnsatisfiedLinkError e) { 59.43 + e.printStackTrace(); 59.44 + // expected 59.45 + } 59.46 + } 59.47 +}
60.1 --- a/test/runtime/CommandLine/BooleanFlagWithInvalidValue.java Tue Apr 02 10:03:02 2013 +0200 60.2 +++ b/test/runtime/CommandLine/BooleanFlagWithInvalidValue.java Wed Apr 03 09:19:02 2013 +0200 60.3 @@ -33,17 +33,17 @@ 60.4 public class BooleanFlagWithInvalidValue { 60.5 public static void main(String[] args) throws Exception { 60.6 ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( 60.7 - "-XX:+UseLargePages=8", "-version"); 60.8 + "-XX:+PrintWarnings=8", "-version"); 60.9 60.10 OutputAnalyzer output = new OutputAnalyzer(pb.start()); 60.11 - output.shouldContain("Improperly specified VM option 'UseLargePages=8'"); 60.12 + output.shouldContain("Improperly specified VM option 'PrintWarnings=8'"); 60.13 output.shouldHaveExitValue(1); 60.14 60.15 pb = ProcessTools.createJavaProcessBuilder( 60.16 - "-XX:-UseLargePages=8", "-version"); 60.17 + "-XX:-PrintWarnings=8", "-version"); 60.18 60.19 output = new OutputAnalyzer(pb.start()); 60.20 - output.shouldContain("Improperly specified VM option 'UseLargePages=8'"); 60.21 + output.shouldContain("Improperly specified VM option 'PrintWarnings=8'"); 60.22 output.shouldHaveExitValue(1); 60.23 } 60.24 }
61.1 --- a/test/runtime/CommandLine/FlagWithInvalidValue.java Tue Apr 02 10:03:02 2013 +0200 61.2 +++ b/test/runtime/CommandLine/FlagWithInvalidValue.java Wed Apr 03 09:19:02 2013 +0200 61.3 @@ -33,10 +33,10 @@ 61.4 public class FlagWithInvalidValue { 61.5 public static void main(String[] args) throws Exception { 61.6 ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( 61.7 - "-XX:ObjectAlignmentInBytes=v", "-version"); 61.8 + "-XX:MaxRAMFraction=v", "-version"); 61.9 61.10 OutputAnalyzer output = new OutputAnalyzer(pb.start()); 61.11 - output.shouldContain("Improperly specified VM option 'ObjectAlignmentInBytes=v'"); 61.12 + output.shouldContain("Improperly specified VM option 'MaxRAMFraction=v'"); 61.13 output.shouldHaveExitValue(1); 61.14 } 61.15 }
62.1 --- a/test/runtime/CommandLine/NonBooleanFlagWithInvalidBooleanPrefix.java Tue Apr 02 10:03:02 2013 +0200 62.2 +++ b/test/runtime/CommandLine/NonBooleanFlagWithInvalidBooleanPrefix.java Wed Apr 03 09:19:02 2013 +0200 62.3 @@ -33,17 +33,17 @@ 62.4 public class NonBooleanFlagWithInvalidBooleanPrefix { 62.5 public static void main(String[] args) throws Exception { 62.6 ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( 62.7 - "-XX:-ObjectAlignmentInBytes=16", "-version"); 62.8 + "-XX:-MaxRAMFraction=16", "-version"); 62.9 62.10 OutputAnalyzer output = new OutputAnalyzer(pb.start()); 62.11 - output.shouldContain("Unexpected +/- setting in VM option 'ObjectAlignmentInBytes=16'"); 62.12 + output.shouldContain("Unexpected +/- setting in VM option 'MaxRAMFraction=16'"); 62.13 output.shouldHaveExitValue(1); 62.14 62.15 pb = ProcessTools.createJavaProcessBuilder( 62.16 - "-XX:+ObjectAlignmentInBytes=16", "-version"); 62.17 + "-XX:+MaxRAMFraction=16", "-version"); 62.18 62.19 output = new OutputAnalyzer(pb.start()); 62.20 - output.shouldContain("Unexpected +/- setting in VM option 'ObjectAlignmentInBytes=16'"); 62.21 + output.shouldContain("Unexpected +/- setting in VM option 'MaxRAMFraction=16'"); 62.22 output.shouldHaveExitValue(1); 62.23 62.24 }
63.1 --- a/test/runtime/NMT/BaselineWithParameter.java Tue Apr 02 10:03:02 2013 +0200 63.2 +++ b/test/runtime/NMT/BaselineWithParameter.java Wed Apr 03 09:19:02 2013 +0200 63.3 @@ -43,7 +43,7 @@ 63.4 63.5 // Run 'jcmd <pid> VM.native_memory baseline=false' 63.6 pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, "VM.native_memory", "baseline=false"}); 63.7 - pb.start(); 63.8 + pb.start().waitFor(); 63.9 63.10 // Run 'jcmd <pid> VM.native_memory summary=false' 63.11 pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, "VM.native_memory", "summary=false"});
64.1 --- a/test/runtime/NMT/PrintNMTStatistics.java Tue Apr 02 10:03:02 2013 +0200 64.2 +++ b/test/runtime/NMT/PrintNMTStatistics.java Wed Apr 03 09:19:02 2013 +0200 64.3 @@ -27,7 +27,9 @@ 64.4 * @bug 8005936 64.5 * @summary Make sure PrintNMTStatistics works on normal JVM exit 64.6 * @library /testlibrary /testlibrary/whitebox 64.7 - * @run compile PrintNMTStatistics.java 64.8 + * @build PrintNMTStatistics 64.9 + * @run main ClassFileInstaller sun.hotspot.WhiteBox 64.10 + * @run main PrintNMTStatistics 64.11 */ 64.12 64.13 import com.oracle.java.testlibrary.*; 64.14 @@ -52,13 +54,15 @@ 64.15 64.16 ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( 64.17 "-XX:+UnlockDiagnosticVMOptions", 64.18 + "-Xbootclasspath/a:.", 64.19 + "-XX:+WhiteBoxAPI", 64.20 "-XX:NativeMemoryTracking=summary", 64.21 - "+XX:+PrintNMTStatistics", 64.22 + "-XX:+PrintNMTStatistics", 64.23 "PrintNMTStatistics", 64.24 "test"); 64.25 64.26 OutputAnalyzer output = new OutputAnalyzer(pb.start()); 64.27 - output.shouldContain("Java Heap (reserved="); 64.28 + output.shouldContain("Java Heap (reserved="); 64.29 output.shouldNotContain("error"); 64.30 output.shouldNotContain("warning"); 64.31 output.shouldHaveExitValue(0);
65.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 65.2 +++ b/test/test_env.sh Wed Apr 03 09:19:02 2013 +0200 65.3 @@ -0,0 +1,193 @@ 65.4 +#!/bin/sh 65.5 +# 65.6 +# Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 65.7 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 65.8 +# 65.9 +# This code is free software; you can redistribute it and/or modify it 65.10 +# under the terms of the GNU General Public License version 2 only, as 65.11 +# published by the Free Software Foundation. 65.12 +# 65.13 +# This code is distributed in the hope that it will be useful, but WITHOUT 65.14 +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 65.15 +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 65.16 +# version 2 for more details (a copy is included in the LICENSE file that 65.17 +# accompanied this code). 65.18 +# 65.19 +# You should have received a copy of the GNU General Public License version 65.20 +# 2 along with this work; if not, write to the Free Software Foundation, 65.21 +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 65.22 +# 65.23 +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 65.24 +# or visit www.oracle.com if you need additional information or have any 65.25 +# questions. 65.26 +# 65.27 + 65.28 +# 65.29 +# This Environment script was written to capture typically used environment 65.30 +# setup for a given shell test. 65.31 +# 65.32 + 65.33 +# TESTJAVA can be a JDK or JRE. If JRE you need to set COMPILEJAVA 65.34 +if [ "${TESTJAVA}" = "" ] 65.35 +then 65.36 + echo "TESTJAVA not set. Test cannot execute. Failed." 65.37 + exit 1 65.38 +fi 65.39 +echo "TESTJAVA=${TESTJAVA}" 65.40 + 65.41 +# COMPILEJAVA requires a JDK, some shell test use javac,jar,etc 65.42 +if [ "${COMPILEJAVA}" = "" ] 65.43 +then 65.44 + echo "COMPILEJAVA not set. Using TESTJAVA as default" 65.45 + COMPILEJAVA=${TESTJAVA} 65.46 +fi 65.47 +echo "COMPILEJAVA=${COMPILEJAVA}" 65.48 + 65.49 +if [ "${TESTCLASSES}" = "" ] 65.50 +then 65.51 + echo "TESTCLASES not set. Using "." as default" 65.52 + TESTCLASSES=. 65.53 +fi 65.54 +echo "TESTCLASSES=${TESTCLASSES}" 65.55 + 65.56 +# set platform-dependent variables 65.57 +OS=`uname -s` 65.58 +case "$OS" in 65.59 + SunOS | Linux | Darwin ) 65.60 + NULL=/dev/null 65.61 + PS=":" 65.62 + FS="/" 65.63 + RM=/bin/rm 65.64 + CP=/bin/cp 65.65 + MV=/bin/mv 65.66 + ;; 65.67 + Windows_* ) 65.68 + NULL=NUL 65.69 + PS=";" 65.70 + FS="\\" 65.71 + RM=rm 65.72 + CP=cp 65.73 + MV=mv 65.74 + ;; 65.75 + CYGWIN_* ) 65.76 + NULL=/dev/null 65.77 + PS=";" 65.78 + FS="/" 65.79 + RM=rm 65.80 + CP=cp 65.81 + MV=mv 65.82 + ;; 65.83 + * ) 65.84 + echo "Unrecognized system!" 65.85 + exit 1; 65.86 + ;; 65.87 +esac 65.88 + 65.89 +export NULL PS FS RM CP MV 65.90 +echo "NULL =${NULL}" 65.91 +echo "PS =${PS}" 65.92 +echo "FS =${FS}" 65.93 +echo "RM =${RM}" 65.94 +echo "CP =${CP}" 65.95 +echo "MV =${MV}" 65.96 + 65.97 +# jtreg -classpathappend:<path> 65.98 +JEMMYPATH=${CPAPPEND} 65.99 +CLASSPATH=.${PS}${TESTCLASSES}${PS}${JEMMYPATH} ; export CLASSPATH 65.100 +echo "CLASSPATH =${CLASSPATH}" 65.101 + 65.102 +# Current directory is scratch directory 65.103 +THIS_DIR=. 65.104 +echo "THIS_DIR=${THIS_DIR}" 65.105 + 65.106 +# Check to ensure the java defined actually works 65.107 +${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -version 65.108 +if [ $? != 0 ]; then 65.109 + echo "Wrong TESTJAVA or TESTVMOPTS:" 65.110 + echo $TESTJAVA TESTVMOPTS 65.111 + exit 1 65.112 +fi 65.113 + 65.114 +${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -Xinternalversion > vm_version.out 2>&1 65.115 + 65.116 +VM_TYPE="unknown" 65.117 +grep "Server" vm_version.out > ${NULL} 65.118 +if [ $? = 0 ] 65.119 +then 65.120 + VM_TYPE="server" 65.121 +fi 65.122 +grep "Client" vm_version.out > ${NULL} 65.123 +if [ $? = 0 ] 65.124 +then 65.125 + VM_TYPE="client" 65.126 +fi 65.127 + 65.128 +VM_BITS="32" 65.129 +grep "64-Bit" vm_version.out > ${NULL} 65.130 +if [ $? = 0 ] 65.131 +then 65.132 + VM_BITS="64" 65.133 +fi 65.134 + 65.135 +VM_OS="unknown" 65.136 +grep "solaris" vm_version.out > ${NULL} 65.137 +if [ $? = 0 ] 65.138 +then 65.139 + VM_OS="solaris" 65.140 +fi 65.141 +grep "linux" vm_version.out > ${NULL} 65.142 +if [ $? = 0 ] 65.143 +then 65.144 + VM_OS="linux" 65.145 +fi 65.146 +grep "windows" vm_version.out > ${NULL} 65.147 +if [ $? = 0 ] 65.148 +then 65.149 + VM_OS="windows" 65.150 +fi 65.151 +grep "bsd" vm_version.out > ${NULL} 65.152 +if [ $? = 0 ] 65.153 +then 65.154 + VM_OS="bsd" 65.155 +fi 65.156 + 65.157 +VM_CPU="unknown" 65.158 +grep "sparc" vm_version.out > ${NULL} 65.159 +if [ $? = 0 ] 65.160 +then 65.161 + VM_CPU="sparc" 65.162 + if [ $VM_BITS = "64" ] 65.163 + then 65.164 + VM_CPU="sparcv9" 65.165 + fi 65.166 +fi 65.167 +grep "x86" vm_version.out > ${NULL} 65.168 +if [ $? = 0 ] 65.169 +then 65.170 + VM_CPU="i386" 65.171 +fi 65.172 +grep "amd64" vm_version.out > ${NULL} 65.173 +if [ $? = 0 ] 65.174 +then 65.175 + VM_CPU="amd64" 65.176 +fi 65.177 +grep "arm" vm_version.out > ${NULL} 65.178 +if [ $? = 0 ] 65.179 +then 65.180 + VM_CPU="arm" 65.181 +fi 65.182 +grep "ppc" vm_version.out > ${NULL} 65.183 +if [ $? = 0 ] 65.184 +then 65.185 + VM_CPU="ppc" 65.186 +fi 65.187 +grep "ia64" vm_version.out > ${NULL} 65.188 +if [ $? = 0 ] 65.189 +then 65.190 + VM_CPU="ia64" 65.191 +fi 65.192 +export VM_TYPE VM_BITS VM_OS VM_CPU 65.193 +echo "VM_TYPE=${VM_TYPE}" 65.194 +echo "VM_BITS=${VM_BITS}" 65.195 +echo "VM_OS=${VM_OS}" 65.196 +echo "VM_CPU=${VM_CPU}"