Fri, 17 Feb 2012 06:34:49 -0800
Merge
1.1 --- a/agent/src/os/linux/Makefile Fri Feb 17 13:23:29 2012 +0100 1.2 +++ b/agent/src/os/linux/Makefile Fri Feb 17 06:34:49 2012 -0800 1.3 @@ -1,5 +1,5 @@ 1.4 # 1.5 -# Copyright (c) 2002, 2009, Oracle and/or its affiliates. All rights reserved. 1.6 +# Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. 1.7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 # 1.9 # This code is free software; you can redistribute it and/or modify it 1.10 @@ -40,7 +40,7 @@ 1.11 1.12 LIBS = -lthread_db 1.13 1.14 -CFLAGS = -c -fPIC -g -D_GNU_SOURCE -D$(ARCH) $(INCLUDES) 1.15 +CFLAGS = -c -fPIC -g -D_GNU_SOURCE -D$(ARCH) $(INCLUDES) -D_FILE_OFFSET_BITS=64 1.16 1.17 LIBSA = $(ARCH)/libsaproc.so 1.18
2.1 --- a/agent/src/os/linux/libproc_impl.c Fri Feb 17 13:23:29 2012 +0100 2.2 +++ b/agent/src/os/linux/libproc_impl.c Fri Feb 17 06:34:49 2012 -0800 2.3 @@ -1,5 +1,5 @@ 2.4 /* 2.5 - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. 2.6 + * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. 2.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 2.8 * 2.9 * This code is free software; you can redistribute it and/or modify it 2.10 @@ -50,10 +50,6 @@ 2.11 char alt_path[PATH_MAX + 1]; 2.12 2.13 init_alt_root(); 2.14 - fd = open(name, O_RDONLY); 2.15 - if (fd >= 0) { 2.16 - return fd; 2.17 - } 2.18 2.19 if (alt_root_len > 0) { 2.20 strcpy(alt_path, alt_root); 2.21 @@ -73,6 +69,11 @@ 2.22 return fd; 2.23 } 2.24 } 2.25 + } else { 2.26 + fd = open(name, O_RDONLY); 2.27 + if (fd >= 0) { 2.28 + return fd; 2.29 + } 2.30 } 2.31 2.32 return -1;
3.1 --- a/make/jprt.properties Fri Feb 17 13:23:29 2012 +0100 3.2 +++ b/make/jprt.properties Fri Feb 17 06:34:49 2012 -0800 3.3 @@ -38,7 +38,9 @@ 3.4 3.5 # This tells jprt what default release we want to build 3.6 3.7 -jprt.tools.default.release=${jprt.submit.release} 3.8 +jprt.hotspot.default.release=jdk7 3.9 + 3.10 +jprt.tools.default.release=${jprt.submit.option.release?${jprt.submit.option.release}:${jprt.hotspot.default.release}} 3.11 3.12 # Disable syncing the source after builds and tests are done. 3.13 3.14 @@ -52,126 +54,46 @@ 3.15 # Define the Solaris platforms we want for the various releases 3.16 jprt.my.solaris.sparc.jdk8=solaris_sparc_5.10 3.17 jprt.my.solaris.sparc.jdk7=solaris_sparc_5.10 3.18 -jprt.my.solaris.sparc.jdk7b107=solaris_sparc_5.10 3.19 -jprt.my.solaris.sparc.jdk7temp=solaris_sparc_5.10 3.20 -jprt.my.solaris.sparc.jdk6=solaris_sparc_5.8 3.21 -jprt.my.solaris.sparc.jdk6perf=solaris_sparc_5.8 3.22 -jprt.my.solaris.sparc.jdk6u10=solaris_sparc_5.8 3.23 -jprt.my.solaris.sparc.jdk6u14=solaris_sparc_5.8 3.24 -jprt.my.solaris.sparc.jdk6u18=solaris_sparc_5.8 3.25 -jprt.my.solaris.sparc.jdk6u20=solaris_sparc_5.8 3.26 -jprt.my.solaris.sparc.ejdk7=${jprt.my.solaris.sparc.jdk7} 3.27 -jprt.my.solaris.sparc.ejdk6=${jprt.my.solaris.sparc.jdk6} 3.28 jprt.my.solaris.sparc=${jprt.my.solaris.sparc.${jprt.tools.default.release}} 3.29 3.30 jprt.my.solaris.sparcv9.jdk8=solaris_sparcv9_5.10 3.31 jprt.my.solaris.sparcv9.jdk7=solaris_sparcv9_5.10 3.32 -jprt.my.solaris.sparcv9.jdk7b107=solaris_sparcv9_5.10 3.33 -jprt.my.solaris.sparcv9.jdk7temp=solaris_sparcv9_5.10 3.34 -jprt.my.solaris.sparcv9.jdk6=solaris_sparcv9_5.8 3.35 -jprt.my.solaris.sparcv9.jdk6perf=solaris_sparcv9_5.8 3.36 -jprt.my.solaris.sparcv9.jdk6u10=solaris_sparcv9_5.8 3.37 -jprt.my.solaris.sparcv9.jdk6u14=solaris_sparcv9_5.8 3.38 -jprt.my.solaris.sparcv9.jdk6u18=solaris_sparcv9_5.8 3.39 -jprt.my.solaris.sparcv9.jdk6u20=solaris_sparcv9_5.8 3.40 -jprt.my.solaris.sparcv9.ejdk7=${jprt.my.solaris.sparcv9.jdk7} 3.41 -jprt.my.solaris.sparcv9.ejdk6=${jprt.my.solaris.sparcv9.jdk6} 3.42 jprt.my.solaris.sparcv9=${jprt.my.solaris.sparcv9.${jprt.tools.default.release}} 3.43 3.44 jprt.my.solaris.i586.jdk8=solaris_i586_5.10 3.45 jprt.my.solaris.i586.jdk7=solaris_i586_5.10 3.46 -jprt.my.solaris.i586.jdk7b107=solaris_i586_5.10 3.47 -jprt.my.solaris.i586.jdk7temp=solaris_i586_5.10 3.48 -jprt.my.solaris.i586.jdk6=solaris_i586_5.8 3.49 -jprt.my.solaris.i586.jdk6perf=solaris_i586_5.8 3.50 -jprt.my.solaris.i586.jdk6u10=solaris_i586_5.8 3.51 -jprt.my.solaris.i586.jdk6u14=solaris_i586_5.8 3.52 -jprt.my.solaris.i586.jdk6u18=solaris_i586_5.8 3.53 -jprt.my.solaris.i586.jdk6u20=solaris_i586_5.8 3.54 -jprt.my.solaris.i586.ejdk7=${jprt.my.solaris.i586.jdk7} 3.55 -jprt.my.solaris.i586.ejdk6=${jprt.my.solaris.i586.jdk6} 3.56 jprt.my.solaris.i586=${jprt.my.solaris.i586.${jprt.tools.default.release}} 3.57 3.58 jprt.my.solaris.x64.jdk8=solaris_x64_5.10 3.59 jprt.my.solaris.x64.jdk7=solaris_x64_5.10 3.60 -jprt.my.solaris.x64.jdk7b107=solaris_x64_5.10 3.61 -jprt.my.solaris.x64.jdk7temp=solaris_x64_5.10 3.62 -jprt.my.solaris.x64.jdk6=solaris_x64_5.10 3.63 -jprt.my.solaris.x64.jdk6perf=solaris_x64_5.10 3.64 -jprt.my.solaris.x64.jdk6u10=solaris_x64_5.10 3.65 -jprt.my.solaris.x64.jdk6u14=solaris_x64_5.10 3.66 -jprt.my.solaris.x64.jdk6u18=solaris_x64_5.10 3.67 -jprt.my.solaris.x64.jdk6u20=solaris_x64_5.10 3.68 -jprt.my.solaris.x64.ejdk7=${jprt.my.solaris.x64.jdk7} 3.69 -jprt.my.solaris.x64.ejdk6=${jprt.my.solaris.x64.jdk6} 3.70 jprt.my.solaris.x64=${jprt.my.solaris.x64.${jprt.tools.default.release}} 3.71 3.72 jprt.my.linux.i586.jdk8=linux_i586_2.6 3.73 jprt.my.linux.i586.jdk7=linux_i586_2.6 3.74 -jprt.my.linux.i586.jdk7b107=linux_i586_2.6 3.75 -jprt.my.linux.i586.jdk7temp=linux_i586_2.6 3.76 -jprt.my.linux.i586.jdk6=linux_i586_2.4 3.77 -jprt.my.linux.i586.jdk6perf=linux_i586_2.4 3.78 -jprt.my.linux.i586.jdk6u10=linux_i586_2.4 3.79 -jprt.my.linux.i586.jdk6u14=linux_i586_2.4 3.80 -jprt.my.linux.i586.jdk6u18=linux_i586_2.4 3.81 -jprt.my.linux.i586.jdk6u20=linux_i586_2.4 3.82 -jprt.my.linux.i586.ejdk7=linux_i586_2.6 3.83 -jprt.my.linux.i586.ejdk6=linux_i586_2.6 3.84 jprt.my.linux.i586=${jprt.my.linux.i586.${jprt.tools.default.release}} 3.85 3.86 jprt.my.linux.x64.jdk8=linux_x64_2.6 3.87 jprt.my.linux.x64.jdk7=linux_x64_2.6 3.88 -jprt.my.linux.x64.jdk7b107=linux_x64_2.6 3.89 -jprt.my.linux.x64.jdk7temp=linux_x64_2.6 3.90 -jprt.my.linux.x64.jdk6=linux_x64_2.4 3.91 -jprt.my.linux.x64.jdk6perf=linux_x64_2.4 3.92 -jprt.my.linux.x64.jdk6u10=linux_x64_2.4 3.93 -jprt.my.linux.x64.jdk6u14=linux_x64_2.4 3.94 -jprt.my.linux.x64.jdk6u18=linux_x64_2.4 3.95 -jprt.my.linux.x64.jdk6u20=linux_x64_2.4 3.96 -jprt.my.linux.x64.ejdk7=${jprt.my.linux.x64.jdk7} 3.97 -jprt.my.linux.x64.ejdk6=${jprt.my.linux.x64.jdk6} 3.98 jprt.my.linux.x64=${jprt.my.linux.x64.${jprt.tools.default.release}} 3.99 3.100 jprt.my.linux.ppc.jdk8=linux_ppc_2.6 3.101 jprt.my.linux.ppc.jdk7=linux_ppc_2.6 3.102 -jprt.my.linux.ppc.jdk7b107=linux_ppc_2.6 3.103 -jprt.my.linux.ppc.jdk7temp=linux_ppc_2.6 3.104 -jprt.my.linux.ppc.ejdk6=linux_ppc_2.6 3.105 -jprt.my.linux.ppc.ejdk7=linux_ppc_2.6 3.106 jprt.my.linux.ppc=${jprt.my.linux.ppc.${jprt.tools.default.release}} 3.107 3.108 jprt.my.linux.ppcv2.jdk8=linux_ppcv2_2.6 3.109 jprt.my.linux.ppcv2.jdk7=linux_ppcv2_2.6 3.110 -jprt.my.linux.ppcv2.jdk7b107=linux_ppcv2_2.6 3.111 -jprt.my.linux.ppcv2.jdk7temp=linux_ppcv2_2.6 3.112 -jprt.my.linux.ppcv2.ejdk6=linux_ppcv2_2.6 3.113 -jprt.my.linux.ppcv2.ejdk7=linux_ppcv2_2.6 3.114 jprt.my.linux.ppcv2=${jprt.my.linux.ppcv2.${jprt.tools.default.release}} 3.115 3.116 jprt.my.linux.ppcsflt.jdk8=linux_ppcsflt_2.6 3.117 jprt.my.linux.ppcsflt.jdk7=linux_ppcsflt_2.6 3.118 -jprt.my.linux.ppcsflt.jdk7b107=linux_ppcsflt_2.6 3.119 -jprt.my.linux.ppcsflt.jdk7temp=linux_ppcsflt_2.6 3.120 -jprt.my.linux.ppcsflt.ejdk6=linux_ppcsflt_2.6 3.121 -jprt.my.linux.ppcsflt.ejdk7=linux_ppcsflt_2.6 3.122 jprt.my.linux.ppcsflt=${jprt.my.linux.ppcsflt.${jprt.tools.default.release}} 3.123 3.124 jprt.my.linux.armvfp.jdk8=linux_armvfp_2.6 3.125 jprt.my.linux.armvfp.jdk7=linux_armvfp_2.6 3.126 -jprt.my.linux.armvfp.jdk7b107=linux_armvfp_2.6 3.127 -jprt.my.linux.armvfp.jdk7temp=linux_armvfp_2.6 3.128 -jprt.my.linux.armvfp.ejdk6=linux_armvfp_2.6 3.129 -jprt.my.linux.armvfp.ejdk7=linux_armvfp_2.6 3.130 jprt.my.linux.armvfp=${jprt.my.linux.armvfp.${jprt.tools.default.release}} 3.131 3.132 jprt.my.linux.armsflt.jdk8=linux_armsflt_2.6 3.133 jprt.my.linux.armsflt.jdk7=linux_armsflt_2.6 3.134 -jprt.my.linux.armsflt.jdk7b107=linux_armsflt_2.6 3.135 -jprt.my.linux.armsflt.jdk7temp=linux_armsflt_2.6 3.136 -jprt.my.linux.armsflt.ejdk6=linux_armsflt_2.6 3.137 -jprt.my.linux.armsflt.ejdk7=linux_armsflt_2.6 3.138 jprt.my.linux.armsflt=${jprt.my.linux.armsflt.${jprt.tools.default.release}} 3.139 3.140 jprt.my.macosx.x64.jdk8=macosx_x64_10.7 3.141 @@ -180,30 +102,10 @@ 3.142 3.143 jprt.my.windows.i586.jdk8=windows_i586_5.1 3.144 jprt.my.windows.i586.jdk7=windows_i586_5.1 3.145 -jprt.my.windows.i586.jdk7b107=windows_i586_5.0 3.146 -jprt.my.windows.i586.jdk7temp=windows_i586_5.0 3.147 -jprt.my.windows.i586.jdk6=windows_i586_5.0 3.148 -jprt.my.windows.i586.jdk6perf=windows_i586_5.0 3.149 -jprt.my.windows.i586.jdk6u10=windows_i586_5.0 3.150 -jprt.my.windows.i586.jdk6u14=windows_i586_5.0 3.151 -jprt.my.windows.i586.jdk6u18=windows_i586_5.0 3.152 -jprt.my.windows.i586.jdk6u20=windows_i586_5.0 3.153 -jprt.my.windows.i586.ejdk7=${jprt.my.windows.i586.jdk7} 3.154 -jprt.my.windows.i586.ejdk6=${jprt.my.windows.i586.jdk6} 3.155 jprt.my.windows.i586=${jprt.my.windows.i586.${jprt.tools.default.release}} 3.156 3.157 jprt.my.windows.x64.jdk8=windows_x64_5.2 3.158 jprt.my.windows.x64.jdk7=windows_x64_5.2 3.159 -jprt.my.windows.x64.jdk7b107=windows_x64_5.2 3.160 -jprt.my.windows.x64.jdk7temp=windows_x64_5.2 3.161 -jprt.my.windows.x64.jdk6=windows_x64_5.2 3.162 -jprt.my.windows.x64.jdk6perf=windows_x64_5.2 3.163 -jprt.my.windows.x64.jdk6u10=windows_x64_5.2 3.164 -jprt.my.windows.x64.jdk6u14=windows_x64_5.2 3.165 -jprt.my.windows.x64.jdk6u18=windows_x64_5.2 3.166 -jprt.my.windows.x64.jdk6u20=windows_x64_5.2 3.167 -jprt.my.windows.x64.ejdk7=${jprt.my.windows.x64.jdk7} 3.168 -jprt.my.windows.x64.ejdk6=${jprt.my.windows.x64.jdk6} 3.169 jprt.my.windows.x64=${jprt.my.windows.x64.${jprt.tools.default.release}} 3.170 3.171 # Standard list of jprt build targets for this source tree 3.172 @@ -539,16 +441,6 @@ 3.173 3.174 jprt.test.targets.jdk8=${jprt.test.targets.standard} 3.175 jprt.test.targets.jdk7=${jprt.test.targets.standard} 3.176 -jprt.test.targets.jdk7temp=${jprt.test.targets.standard} 3.177 -jprt.test.targets.jdk7b105=${jprt.test.targets.standard} 3.178 -jprt.test.targets.jdk6=${jprt.test.targets.standard} 3.179 -jprt.test.targets.jdk6perf=${jprt.test.targets.standard} 3.180 -jprt.test.targets.jdk6u10=${jprt.test.targets.standard} 3.181 -jprt.test.targets.jdk6u14=${jprt.test.targets.standard} 3.182 -jprt.test.targets.jdk6u18=${jprt.test.targets.standard} 3.183 -jprt.test.targets.jdk6u20=${jprt.test.targets.standard} 3.184 -jprt.test.targets.ejdk6=${jprt.test.targets.embedded} 3.185 -jprt.test.targets.ejdk7=${jprt.test.targets.embedded} 3.186 jprt.test.targets=${jprt.test.targets.${jprt.tools.default.release}} 3.187 3.188 # The default test/Makefile targets that should be run 3.189 @@ -593,15 +485,5 @@ 3.190 3.191 jprt.make.rule.test.targets.jdk8=${jprt.make.rule.test.targets.standard} 3.192 jprt.make.rule.test.targets.jdk7=${jprt.make.rule.test.targets.standard} 3.193 -jprt.make.rule.test.targets.jdk7temp=${jprt.make.rule.test.targets.standard} 3.194 -jprt.make.rule.test.targets.jdk7b107=${jprt.make.rule.test.targets.standard} 3.195 -jprt.make.rule.test.targets.jdk6=${jprt.make.rule.test.targets.standard} 3.196 -jprt.make.rule.test.targets.jdk6perf=${jprt.make.rule.test.targets.standard} 3.197 -jprt.make.rule.test.targets.jdk6u10=${jprt.make.rule.test.targets.standard} 3.198 -jprt.make.rule.test.targets.jdk6u14=${jprt.make.rule.test.targets.standard} 3.199 -jprt.make.rule.test.targets.jdk6u18=${jprt.make.rule.test.targets.standard} 3.200 -jprt.make.rule.test.targets.jdk6u20=${jprt.make.rule.test.targets.standard} 3.201 -jprt.make.rule.test.targets.ejdk6=${jprt.make.rule.test.targets.embedded} 3.202 -jprt.make.rule.test.targets.ejdk7=${jprt.make.rule.test.targets.embedded} 3.203 jprt.make.rule.test.targets=${jprt.make.rule.test.targets.${jprt.tools.default.release}} 3.204
4.1 --- a/make/linux/makefiles/saproc.make Fri Feb 17 13:23:29 2012 +0100 4.2 +++ b/make/linux/makefiles/saproc.make Fri Feb 17 06:34:49 2012 -0800 4.3 @@ -1,5 +1,5 @@ 4.4 # 4.5 -# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. 4.6 +# Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. 4.7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4.8 # 4.9 # This code is free software; you can redistribute it and/or modify it 4.10 @@ -75,6 +75,7 @@ 4.11 fi 4.12 @echo Making SA debugger back-end... 4.13 $(QUIETLY) $(CC) -D$(BUILDARCH) -D_GNU_SOURCE \ 4.14 + -D_FILE_OFFSET_BITS=64 \ 4.15 $(SYMFLAG) $(ARCHFLAG) $(SHARED_FLAG) $(PICFLAG) \ 4.16 -I$(SASRCDIR) \ 4.17 -I$(GENERATED) \
5.1 --- a/src/cpu/sparc/vm/globals_sparc.hpp Fri Feb 17 13:23:29 2012 +0100 5.2 +++ b/src/cpu/sparc/vm/globals_sparc.hpp Fri Feb 17 06:34:49 2012 -0800 5.3 @@ -56,14 +56,15 @@ 5.4 // Stack slots are 2X larger in LP64 than in the 32 bit VM. 5.5 define_pd_global(intx, ThreadStackSize, 1024); 5.6 define_pd_global(intx, VMThreadStackSize, 1024); 5.7 +define_pd_global(intx, StackShadowPages, 10 DEBUG_ONLY(+1)); 5.8 #else 5.9 define_pd_global(intx, ThreadStackSize, 512); 5.10 define_pd_global(intx, VMThreadStackSize, 512); 5.11 +define_pd_global(intx, StackShadowPages, 3 DEBUG_ONLY(+1)); 5.12 #endif 5.13 5.14 define_pd_global(intx, StackYellowPages, 2); 5.15 define_pd_global(intx, StackRedPages, 1); 5.16 -define_pd_global(intx, StackShadowPages, 3 DEBUG_ONLY(+1)); 5.17 5.18 define_pd_global(intx, PreInflateSpin, 40); // Determined by running design center 5.19
6.1 --- a/src/cpu/x86/vm/globals_x86.hpp Fri Feb 17 13:23:29 2012 +0100 6.2 +++ b/src/cpu/x86/vm/globals_x86.hpp Fri Feb 17 06:34:49 2012 -0800 6.3 @@ -60,7 +60,7 @@ 6.4 #ifdef AMD64 6.5 // Very large C++ stack frames using solaris-amd64 optimized builds 6.6 // due to lack of optimization caused by C++ compiler bugs 6.7 -define_pd_global(intx, StackShadowPages, SOLARIS_ONLY(20) NOT_SOLARIS(6) DEBUG_ONLY(+2)); 6.8 +define_pd_global(intx, StackShadowPages, NOT_WIN64(20) WIN64_ONLY(6) DEBUG_ONLY(+2)); 6.9 #else 6.10 define_pd_global(intx, StackShadowPages, 3 DEBUG_ONLY(+5)); 6.11 #endif // AMD64
7.1 --- a/src/cpu/x86/vm/vm_version_x86.hpp Fri Feb 17 13:23:29 2012 +0100 7.2 +++ b/src/cpu/x86/vm/vm_version_x86.hpp Fri Feb 17 06:34:49 2012 -0800 7.3 @@ -249,13 +249,18 @@ 7.4 7.5 enum { 7.6 // AMD 7.7 - CPU_FAMILY_AMD_11H = 17, 7.8 + CPU_FAMILY_AMD_11H = 0x11, 7.9 // Intel 7.10 CPU_FAMILY_INTEL_CORE = 6, 7.11 - CPU_MODEL_NEHALEM_EP = 26, 7.12 - CPU_MODEL_WESTMERE_EP = 44, 7.13 -// CPU_MODEL_IVYBRIDGE_EP = ??, TODO - get real value 7.14 - CPU_MODEL_SANDYBRIDGE_EP = 45 7.15 + CPU_MODEL_NEHALEM = 0x1e, 7.16 + CPU_MODEL_NEHALEM_EP = 0x1a, 7.17 + CPU_MODEL_NEHALEM_EX = 0x2e, 7.18 + CPU_MODEL_WESTMERE = 0x25, 7.19 + CPU_MODEL_WESTMERE_EP = 0x2c, 7.20 + CPU_MODEL_WESTMERE_EX = 0x2f, 7.21 + CPU_MODEL_SANDYBRIDGE = 0x2a, 7.22 + CPU_MODEL_SANDYBRIDGE_EP = 0x2d, 7.23 + CPU_MODEL_IVYBRIDGE_EP = 0x3a 7.24 } cpuExtendedFamily; 7.25 7.26 // cpuid information block. All info derived from executing cpuid with 7.27 @@ -325,7 +330,7 @@ 7.28 uint32_t proc_name_4, proc_name_5, proc_name_6, proc_name_7; 7.29 uint32_t proc_name_8, proc_name_9, proc_name_10,proc_name_11; 7.30 7.31 - // cpuid function 0x80000005 //AMD L1, Intel reserved 7.32 + // cpuid function 0x80000005 // AMD L1, Intel reserved 7.33 uint32_t ext_cpuid5_eax; // unused currently 7.34 uint32_t ext_cpuid5_ebx; // reserved 7.35 ExtCpuid5Ex ext_cpuid5_ecx; // L1 data cache info (AMD) 7.36 @@ -547,15 +552,15 @@ 7.37 static bool is_intel_tsc_synched_at_init() { 7.38 if (is_intel_family_core()) { 7.39 uint32_t ext_model = extended_cpu_model(); 7.40 - if (ext_model == CPU_MODEL_NEHALEM_EP || 7.41 - ext_model == CPU_MODEL_WESTMERE_EP || 7.42 -// TODO ext_model == CPU_MODEL_IVYBRIDGE_EP || 7.43 - ext_model == CPU_MODEL_SANDYBRIDGE_EP) { 7.44 - // 2-socket invtsc support. EX versions with 4 sockets are not 7.45 - // guaranteed to synchronize tscs at initialization via a double 7.46 - // handshake. The tscs can be explicitly set in software. Code 7.47 - // that uses tsc values must be prepared for them to arbitrarily 7.48 - // jump backward or forward. 7.49 + if (ext_model == CPU_MODEL_NEHALEM_EP || 7.50 + ext_model == CPU_MODEL_WESTMERE_EP || 7.51 + ext_model == CPU_MODEL_SANDYBRIDGE_EP || 7.52 + ext_model == CPU_MODEL_IVYBRIDGE_EP) { 7.53 + // <= 2-socket invariant tsc support. EX versions are usually used 7.54 + // in > 2-socket systems and likely don't synchronize tscs at 7.55 + // initialization. 7.56 + // Code that uses tsc values must be prepared for them to arbitrarily 7.57 + // jump forward or backward. 7.58 return true; 7.59 } 7.60 }
8.1 --- a/src/os/bsd/vm/decoder_machO.hpp Fri Feb 17 13:23:29 2012 +0100 8.2 +++ b/src/os/bsd/vm/decoder_machO.hpp Fri Feb 17 06:34:49 2012 -0800 8.3 @@ -1,5 +1,5 @@ 8.4 /* 8.5 - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. 8.6 + * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. 8.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 8.8 * 8.9 * This code is free software; you can redistribute it and/or modify it 8.10 @@ -29,8 +29,9 @@ 8.11 8.12 #include "utilities/decoder.hpp" 8.13 8.14 -// Just a placehold for now 8.15 -class MachODecoder: public NullDecoder { 8.16 +// Just a placehold for now, a real implementation should derive 8.17 +// from AbstractDecoder 8.18 +class MachODecoder : public NullDecoder { 8.19 public: 8.20 MachODecoder() { } 8.21 ~MachODecoder() { }
9.1 --- a/src/os/windows/vm/decoder_windows.hpp Fri Feb 17 13:23:29 2012 +0100 9.2 +++ b/src/os/windows/vm/decoder_windows.hpp Fri Feb 17 06:34:49 2012 -0800 9.3 @@ -36,7 +36,7 @@ 9.4 typedef BOOL (WINAPI *pfn_SymGetSymFromAddr64)(HANDLE, DWORD64, PDWORD64, PIMAGEHLP_SYMBOL64); 9.5 typedef DWORD (WINAPI *pfn_UndecorateSymbolName)(const char*, char*, DWORD, DWORD); 9.6 9.7 -class WindowsDecoder: public NullDecoder { 9.8 +class WindowsDecoder : public AbstractDecoder { 9.9 9.10 public: 9.11 WindowsDecoder();
10.1 --- a/src/share/vm/classfile/vmSymbols.hpp Fri Feb 17 13:23:29 2012 +0100 10.2 +++ b/src/share/vm/classfile/vmSymbols.hpp Fri Feb 17 06:34:49 2012 -0800 10.3 @@ -284,6 +284,7 @@ 10.4 template(run_method_name, "run") \ 10.5 template(exit_method_name, "exit") \ 10.6 template(add_method_name, "add") \ 10.7 + template(remove_method_name, "remove") \ 10.8 template(parent_name, "parent") \ 10.9 template(threads_name, "threads") \ 10.10 template(groups_name, "groups") \
11.1 --- a/src/share/vm/prims/jvmtiTagMap.cpp Fri Feb 17 13:23:29 2012 +0100 11.2 +++ b/src/share/vm/prims/jvmtiTagMap.cpp Fri Feb 17 06:34:49 2012 -0800 11.3 @@ -1,5 +1,5 @@ 11.4 /* 11.5 - * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. 11.6 + * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. 11.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 11.8 * 11.9 * This code is free software; you can redistribute it and/or modify it 11.10 @@ -2999,7 +2999,8 @@ 11.11 char type = field->field_type(); 11.12 if (!is_primitive_field_type(type)) { 11.13 oop fld_o = o->obj_field(field->field_offset()); 11.14 - if (fld_o != NULL) { 11.15 + // ignore any objects that aren't visible to profiler 11.16 + if (fld_o != NULL && ServiceUtil::visible_oop(fld_o)) { 11.17 // reflection code may have a reference to a klassOop. 11.18 // - see sun.reflect.UnsafeStaticFieldAccessorImpl and sun.misc.Unsafe 11.19 if (fld_o->is_klass()) {
12.1 --- a/src/share/vm/runtime/arguments.cpp Fri Feb 17 13:23:29 2012 +0100 12.2 +++ b/src/share/vm/runtime/arguments.cpp Fri Feb 17 06:34:49 2012 -0800 12.3 @@ -1370,12 +1370,9 @@ 12.4 // by ergonomics. 12.5 if (MaxHeapSize <= max_heap_for_compressed_oops()) { 12.6 #if !defined(COMPILER1) || defined(TIERED) 12.7 -// disable UseCompressedOops by default on MacOS X until 7118647 is fixed 12.8 -#ifndef __APPLE__ 12.9 if (FLAG_IS_DEFAULT(UseCompressedOops)) { 12.10 FLAG_SET_ERGO(bool, UseCompressedOops, true); 12.11 } 12.12 -#endif // !__APPLE__ 12.13 #endif 12.14 #ifdef _WIN64 12.15 if (UseLargePages && UseCompressedOops) {
13.1 --- a/src/share/vm/runtime/dtraceJSDT.cpp Fri Feb 17 13:23:29 2012 +0100 13.2 +++ b/src/share/vm/runtime/dtraceJSDT.cpp Fri Feb 17 06:34:49 2012 -0800 13.3 @@ -82,7 +82,7 @@ 13.4 13.5 int handle = pd_activate((void*)probes, 13.6 module_name, providers_count, providers); 13.7 - if (handle <= 0) { 13.8 + if (handle < 0) { 13.9 delete probes; 13.10 THROW_MSG_0(vmSymbols::java_lang_RuntimeException(), 13.11 "Unable to register DTrace probes (internal error).");
14.1 --- a/src/share/vm/runtime/thread.cpp Fri Feb 17 13:23:29 2012 +0100 14.2 +++ b/src/share/vm/runtime/thread.cpp Fri Feb 17 06:34:49 2012 -0800 14.3 @@ -3220,11 +3220,6 @@ 14.4 return status; 14.5 } 14.6 14.7 - // Must be run after init_ft which initializes ft_enabled 14.8 - if (TRACE_INITIALIZE() != JNI_OK) { 14.9 - vm_exit_during_initialization("Failed to initialize tracing backend"); 14.10 - } 14.11 - 14.12 // Should be done after the heap is fully created 14.13 main_thread->cache_global_variables(); 14.14 14.15 @@ -3366,6 +3361,7 @@ 14.16 initialize_class(vmSymbols::java_lang_ArithmeticException(), CHECK_0); 14.17 initialize_class(vmSymbols::java_lang_StackOverflowError(), CHECK_0); 14.18 initialize_class(vmSymbols::java_lang_IllegalMonitorStateException(), CHECK_0); 14.19 + initialize_class(vmSymbols::java_lang_IllegalArgumentException(), CHECK_0); 14.20 } else { 14.21 warning("java.lang.OutOfMemoryError has not been initialized"); 14.22 warning("java.lang.NullPointerException has not been initialized"); 14.23 @@ -3373,6 +3369,7 @@ 14.24 warning("java.lang.ArrayStoreException has not been initialized"); 14.25 warning("java.lang.ArithmeticException has not been initialized"); 14.26 warning("java.lang.StackOverflowError has not been initialized"); 14.27 + warning("java.lang.IllegalArgumentException has not been initialized"); 14.28 } 14.29 } 14.30 14.31 @@ -3402,6 +3399,11 @@ 14.32 14.33 quicken_jni_functions(); 14.34 14.35 + // Must be run after init_ft which initializes ft_enabled 14.36 + if (TRACE_INITIALIZE() != JNI_OK) { 14.37 + vm_exit_during_initialization("Failed to initialize tracing backend"); 14.38 + } 14.39 + 14.40 // Set flag that basic initialization has completed. Used by exceptions and various 14.41 // debug stuff, that does not work until all basic classes have been initialized. 14.42 set_init_completed();
15.1 --- a/src/share/vm/runtime/virtualspace.cpp Fri Feb 17 13:23:29 2012 +0100 15.2 +++ b/src/share/vm/runtime/virtualspace.cpp Fri Feb 17 06:34:49 2012 -0800 15.3 @@ -1,5 +1,5 @@ 15.4 /* 15.5 - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. 15.6 + * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. 15.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 15.8 * 15.9 * This code is free software; you can redistribute it and/or modify it 15.10 @@ -455,7 +455,7 @@ 15.11 15.12 void ReservedSpace::protect_noaccess_prefix(const size_t size) { 15.13 assert( (_noaccess_prefix != 0) == (UseCompressedOops && _base != NULL && 15.14 - (size_t(_base + _size) > OopEncodingHeapMax) && 15.15 + (Universe::narrow_oop_base() != NULL) && 15.16 Universe::narrow_oop_use_implicit_null_checks()), 15.17 "noaccess_prefix should be used only with non zero based compressed oops"); 15.18
16.1 --- a/src/share/vm/services/diagnosticArgument.cpp Fri Feb 17 13:23:29 2012 +0100 16.2 +++ b/src/share/vm/services/diagnosticArgument.cpp Fri Feb 17 06:34:49 2012 -0800 16.3 @@ -28,9 +28,16 @@ 16.4 #include "services/diagnosticArgument.hpp" 16.5 16.6 void GenDCmdArgument::read_value(const char* str, size_t len, TRAPS) { 16.7 - if (is_set()) { 16.8 + /* NOTE:Some argument types doesn't require a value, 16.9 + * for instance boolean arguments: "enableFeatureX". is 16.10 + * equivalent to "enableFeatureX=true". In these cases, 16.11 + * str will be null. This is perfectly valid. 16.12 + * All argument types must perform null checks on str. 16.13 + */ 16.14 + 16.15 + if (is_set() && !allow_multiple()) { 16.16 THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), 16.17 - "Duplicates in diagnostic command arguments"); 16.18 + "Duplicates in diagnostic command arguments\n"); 16.19 } 16.20 parse_value(str, len, CHECK); 16.21 set_is_set(true); 16.22 @@ -38,9 +45,9 @@ 16.23 16.24 template <> void DCmdArgument<jlong>::parse_value(const char* str, 16.25 size_t len, TRAPS) { 16.26 - if (sscanf(str, INT64_FORMAT, &_value) != 1) { 16.27 + if (str == NULL || sscanf(str, INT64_FORMAT, &_value) != 1) { 16.28 THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), 16.29 - "Integer parsing error in diagnostic command arguments"); 16.30 + "Integer parsing error in diagnostic command arguments\n"); 16.31 } 16.32 } 16.33 16.34 @@ -89,16 +96,20 @@ 16.35 16.36 template <> void DCmdArgument<char*>::parse_value(const char* str, 16.37 size_t len, TRAPS) { 16.38 - _value = NEW_C_HEAP_ARRAY(char, len+1); 16.39 - strncpy(_value, str, len); 16.40 - _value[len] = 0; 16.41 + if (str == NULL) { 16.42 + _value = NULL; 16.43 + } else { 16.44 + _value = NEW_C_HEAP_ARRAY(char, len+1); 16.45 + strncpy(_value, str, len); 16.46 + _value[len] = 0; 16.47 + } 16.48 } 16.49 16.50 template <> void DCmdArgument<char*>::init_value(TRAPS) { 16.51 - if (has_default()) { 16.52 + if (has_default() && _default_string != NULL) { 16.53 this->parse_value(_default_string, strlen(_default_string), THREAD); 16.54 if (HAS_PENDING_EXCEPTION) { 16.55 - fatal("Default string must be parsable"); 16.56 + fatal("Default string must be parsable"); 16.57 } 16.58 } else { 16.59 set_value(NULL); 16.60 @@ -111,3 +122,153 @@ 16.61 set_value(NULL); 16.62 } 16.63 } 16.64 + 16.65 +template <> void DCmdArgument<NanoTimeArgument>::parse_value(const char* str, 16.66 + size_t len, TRAPS) { 16.67 + if (str == NULL) { 16.68 + THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), 16.69 + "Integer parsing error nanotime value: syntax error"); 16.70 + } 16.71 + 16.72 + int argc = sscanf(str, INT64_FORMAT , &_value._time); 16.73 + if (argc != 1) { 16.74 + THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), 16.75 + "Integer parsing error nanotime value: syntax error"); 16.76 + } 16.77 + size_t idx = 0; 16.78 + while(idx < len && isdigit(str[idx])) { 16.79 + idx++; 16.80 + } 16.81 + if (idx == len) { 16.82 + // only accept missing unit if the value is 0 16.83 + if (_value._time != 0) { 16.84 + THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), 16.85 + "Integer parsing error nanotime value: unit required"); 16.86 + } else { 16.87 + _value._nanotime = 0; 16.88 + strcpy(_value._unit, "ns"); 16.89 + return; 16.90 + } 16.91 + } else if(len - idx > 2) { 16.92 + THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), 16.93 + "Integer parsing error nanotime value: illegal unit"); 16.94 + } else { 16.95 + strncpy(_value._unit, &str[idx], len - idx); 16.96 + /*Write an extra null termination. This is safe because _value._unit 16.97 + * is declared as char[3], and length is checked to be not larger than 16.98 + * two above. Also, this is necessary, since length might be 1, and the 16.99 + * default value already in the string is ns, which is two chars. 16.100 + */ 16.101 + _value._unit[len-idx] = '\0'; 16.102 + } 16.103 + 16.104 + if (strcmp(_value._unit, "ns") == 0) { 16.105 + _value._nanotime = _value._time; 16.106 + } else if (strcmp(_value._unit, "us") == 0) { 16.107 + _value._nanotime = _value._time * 1000; 16.108 + } else if (strcmp(_value._unit, "ms") == 0) { 16.109 + _value._nanotime = _value._time * 1000 * 1000; 16.110 + } else if (strcmp(_value._unit, "s") == 0) { 16.111 + _value._nanotime = _value._time * 1000 * 1000 * 1000; 16.112 + } else if (strcmp(_value._unit, "m") == 0) { 16.113 + _value._nanotime = _value._time * 60 * 1000 * 1000 * 1000; 16.114 + } else if (strcmp(_value._unit, "h") == 0) { 16.115 + _value._nanotime = _value._time * 60 * 60 * 1000 * 1000 * 1000; 16.116 + } else if (strcmp(_value._unit, "d") == 0) { 16.117 + _value._nanotime = _value._time * 24 * 60 * 60 * 1000 * 1000 * 1000; 16.118 + } else { 16.119 + THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), 16.120 + "Integer parsing error nanotime value: illegal unit"); 16.121 + } 16.122 +} 16.123 + 16.124 +template <> void DCmdArgument<NanoTimeArgument>::init_value(TRAPS) { 16.125 + if (has_default()) { 16.126 + this->parse_value(_default_string, strlen(_default_string), THREAD); 16.127 + if (HAS_PENDING_EXCEPTION) { 16.128 + fatal("Default string must be parsable"); 16.129 + } 16.130 + } else { 16.131 + _value._time = 0; 16.132 + _value._nanotime = 0; 16.133 + strcmp(_value._unit, "ns"); 16.134 + } 16.135 +} 16.136 + 16.137 +template <> void DCmdArgument<NanoTimeArgument>::destroy_value() { } 16.138 + 16.139 +// WARNING StringArrayArgument can only be used as an option, it cannot be 16.140 +// used as an argument with the DCmdParser 16.141 + 16.142 +template <> void DCmdArgument<StringArrayArgument*>::parse_value(const char* str, 16.143 + size_t len, TRAPS) { 16.144 + _value->add(str,len); 16.145 +} 16.146 + 16.147 +template <> void DCmdArgument<StringArrayArgument*>::init_value(TRAPS) { 16.148 + _value = new StringArrayArgument(); 16.149 + _allow_multiple = true; 16.150 + if (has_default()) { 16.151 + fatal("StringArrayArgument cannot have default value"); 16.152 + } 16.153 +} 16.154 + 16.155 +template <> void DCmdArgument<StringArrayArgument*>::destroy_value() { 16.156 + if (_value != NULL) { 16.157 + delete _value; 16.158 + set_value(NULL); 16.159 + } 16.160 +} 16.161 + 16.162 +template <> void DCmdArgument<MemorySizeArgument>::parse_value(const char* str, 16.163 + size_t len, TRAPS) { 16.164 + if (str == NULL) { 16.165 + THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), 16.166 + "Integer parsing error nanotime value: syntax error"); 16.167 + } 16.168 + 16.169 + if (*str == '-') { 16.170 + THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), 16.171 + "Parsing error memory size value: negative values not allowed"); 16.172 + } 16.173 + int res = sscanf(str, UINT64_FORMAT "%c", &_value._val, &_value._multiplier); 16.174 + if (res == 2) { 16.175 + switch (_value._multiplier) { 16.176 + case 'k': case 'K': 16.177 + _value._size = _value._val * 1024; 16.178 + break; 16.179 + case 'm': case 'M': 16.180 + _value._size = _value._val * 1024 * 1024; 16.181 + break; 16.182 + case 'g': case 'G': 16.183 + _value._size = _value._val * 1024 * 1024 * 1024; 16.184 + break; 16.185 + default: 16.186 + _value._size = _value._val; 16.187 + _value._multiplier = ' '; 16.188 + //default case should be to break with no error, since user 16.189 + //can write size in bytes, or might have a delimiter and next arg 16.190 + break; 16.191 + } 16.192 + } else if (res == 1) { 16.193 + _value._size = _value._val; 16.194 + } else { 16.195 + THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), 16.196 + "Parsing error memory size value: invalid value"); 16.197 + } 16.198 +} 16.199 + 16.200 +template <> void DCmdArgument<MemorySizeArgument>::init_value(TRAPS) { 16.201 + if (has_default()) { 16.202 + this->parse_value(_default_string, strlen(_default_string), THREAD); 16.203 + if (HAS_PENDING_EXCEPTION) { 16.204 + fatal("Default string must be parsable"); 16.205 + } 16.206 + } else { 16.207 + _value._size = 0; 16.208 + _value._val = 0; 16.209 + _value._multiplier = ' '; 16.210 + } 16.211 +} 16.212 + 16.213 +template <> void DCmdArgument<MemorySizeArgument>::destroy_value() { }
17.1 --- a/src/share/vm/services/diagnosticArgument.hpp Fri Feb 17 13:23:29 2012 +0100 17.2 +++ b/src/share/vm/services/diagnosticArgument.hpp Fri Feb 17 06:34:49 2012 -0800 17.3 @@ -1,5 +1,5 @@ 17.4 /* 17.5 - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. 17.6 + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. 17.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 17.8 * 17.9 * This code is free software; you can redistribute it and/or modify it 17.10 @@ -31,6 +31,49 @@ 17.11 #include "runtime/thread.hpp" 17.12 #include "utilities/exceptions.hpp" 17.13 17.14 +class StringArrayArgument : public CHeapObj { 17.15 +private: 17.16 + GrowableArray<char*>* _array; 17.17 +public: 17.18 + StringArrayArgument() { 17.19 + _array = new(ResourceObj::C_HEAP)GrowableArray<char *>(32, true); 17.20 + assert(_array != NULL, "Sanity check"); 17.21 + } 17.22 + void add(const char* str, size_t len) { 17.23 + if (str != NULL) { 17.24 + char* ptr = NEW_C_HEAP_ARRAY(char, len+1); 17.25 + strncpy(ptr, str, len); 17.26 + ptr[len] = 0; 17.27 + _array->append(ptr); 17.28 + } 17.29 + } 17.30 + GrowableArray<char*>* array() { 17.31 + return _array; 17.32 + } 17.33 + ~StringArrayArgument() { 17.34 + for (int i=0; i<_array->length(); i++) { 17.35 + if(_array->at(i) != NULL) { // Safety check 17.36 + FREE_C_HEAP_ARRAY(char, _array->at(i)); 17.37 + } 17.38 + } 17.39 + delete _array; 17.40 + } 17.41 +}; 17.42 + 17.43 +class NanoTimeArgument { 17.44 +public: 17.45 + jlong _nanotime; 17.46 + jlong _time; 17.47 + char _unit[3]; 17.48 +}; 17.49 + 17.50 +class MemorySizeArgument { 17.51 +public: 17.52 + u8 _size; 17.53 + u8 _val; 17.54 + char _multiplier; 17.55 +}; 17.56 + 17.57 class GenDCmdArgument : public ResourceObj { 17.58 protected: 17.59 GenDCmdArgument* _next; 17.60 @@ -40,6 +83,7 @@ 17.61 const char* _default_string; 17.62 bool _is_set; 17.63 bool _is_mandatory; 17.64 + bool _allow_multiple; 17.65 GenDCmdArgument(const char* name, const char* description, const char* type, 17.66 const char* default_string, bool mandatory) { 17.67 _name = name; 17.68 @@ -48,6 +92,7 @@ 17.69 _default_string = default_string; 17.70 _is_mandatory = mandatory; 17.71 _is_set = false; 17.72 + _allow_multiple = false; 17.73 }; 17.74 public: 17.75 const char* name() { return _name; } 17.76 @@ -56,6 +101,7 @@ 17.77 const char* default_string() { return _default_string; } 17.78 bool is_set() { return _is_set; } 17.79 void set_is_set(bool b) { _is_set = b; } 17.80 + bool allow_multiple() { return _allow_multiple; } 17.81 bool is_mandatory() { return _is_mandatory; } 17.82 bool has_value() { return _is_set || _default_string != NULL; } 17.83 bool has_default() { return _default_string != NULL; }
18.1 --- a/src/share/vm/services/diagnosticFramework.cpp Fri Feb 17 13:23:29 2012 +0100 18.2 +++ b/src/share/vm/services/diagnosticFramework.cpp Fri Feb 17 06:34:49 2012 -0800 18.3 @@ -1,5 +1,5 @@ 18.4 /* 18.5 - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. 18.6 + * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. 18.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 18.8 * 18.9 * This code is free software; you can redistribute it and/or modify it 18.10 @@ -61,7 +61,7 @@ 18.11 bool DCmdArgIter::next(TRAPS) { 18.12 if (_len == 0) return false; 18.13 // skipping spaces 18.14 - while (_cursor < _len - 1 && isspace(_buffer[_cursor])) { 18.15 + while (_cursor < _len - 1 && _buffer[_cursor] == _delim) { 18.16 _cursor++; 18.17 } 18.18 // handling end of command line
19.1 --- a/src/share/vm/services/diagnosticFramework.hpp Fri Feb 17 13:23:29 2012 +0100 19.2 +++ b/src/share/vm/services/diagnosticFramework.hpp Fri Feb 17 06:34:49 2012 -0800 19.3 @@ -1,5 +1,5 @@ 19.4 /* 19.5 - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. 19.6 + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. 19.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 19.8 * 19.9 * This code is free software; you can redistribute it and/or modify it 19.10 @@ -195,6 +195,7 @@ 19.11 DCmdParser() { 19.12 _options = NULL; 19.13 _arguments_list = NULL; 19.14 + _delim = ' '; 19.15 } 19.16 void add_dcmd_option(GenDCmdArgument* arg); 19.17 void add_dcmd_argument(GenDCmdArgument* arg);
20.1 --- a/src/share/vm/services/gcNotifier.cpp Fri Feb 17 13:23:29 2012 +0100 20.2 +++ b/src/share/vm/services/gcNotifier.cpp Fri Feb 17 06:34:49 2012 -0800 20.3 @@ -1,5 +1,5 @@ 20.4 /* 20.5 - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. 20.6 + * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. 20.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 20.8 * 20.9 * This code is free software; you can redistribute it and/or modify it 20.10 @@ -180,17 +180,43 @@ 20.11 } 20.12 20.13 void GCNotifier::sendNotification(TRAPS) { 20.14 + GCNotifier::sendNotificationInternal(THREAD); 20.15 + // Clearing pending exception to avoid premature termination of 20.16 + // the service thread 20.17 + if (HAS_PENDING_EXCEPTION) { 20.18 + CLEAR_PENDING_EXCEPTION; 20.19 + } 20.20 +} 20.21 + 20.22 +class NotificationMark : public StackObj { 20.23 + // This class is used in GCNotifier::sendNotificationInternal to ensure that 20.24 + // the GCNotificationRequest object is properly cleaned up, whatever path 20.25 + // is used to exit the method. 20.26 + GCNotificationRequest* _request; 20.27 +public: 20.28 + NotificationMark(GCNotificationRequest* r) { 20.29 + _request = r; 20.30 + } 20.31 + ~NotificationMark() { 20.32 + assert(_request != NULL, "Sanity check"); 20.33 + delete _request; 20.34 + } 20.35 +}; 20.36 + 20.37 +void GCNotifier::sendNotificationInternal(TRAPS) { 20.38 ResourceMark rm(THREAD); 20.39 + HandleMark hm(THREAD); 20.40 GCNotificationRequest *request = getRequest(); 20.41 - if(request != NULL) { 20.42 - Handle objGcInfo = createGcInfo(request->gcManager,request->gcStatInfo,THREAD); 20.43 + if (request != NULL) { 20.44 + NotificationMark nm(request); 20.45 + Handle objGcInfo = createGcInfo(request->gcManager, request->gcStatInfo, THREAD); 20.46 20.47 Handle objName = java_lang_String::create_from_platform_dependent_str(request->gcManager->name(), CHECK); 20.48 Handle objAction = java_lang_String::create_from_platform_dependent_str(request->gcAction, CHECK); 20.49 Handle objCause = java_lang_String::create_from_platform_dependent_str(request->gcCause, CHECK); 20.50 20.51 klassOop k = Management::sun_management_GarbageCollectorImpl_klass(CHECK); 20.52 - instanceKlassHandle gc_mbean_klass (THREAD, k); 20.53 + instanceKlassHandle gc_mbean_klass(THREAD, k); 20.54 20.55 instanceOop gc_mbean = request->gcManager->get_memory_manager_instance(THREAD); 20.56 instanceHandle gc_mbean_h(THREAD, gc_mbean); 20.57 @@ -213,11 +239,6 @@ 20.58 vmSymbols::createGCNotification_signature(), 20.59 &args, 20.60 CHECK); 20.61 - if (HAS_PENDING_EXCEPTION) { 20.62 - CLEAR_PENDING_EXCEPTION; 20.63 - } 20.64 - 20.65 - delete request; 20.66 } 20.67 } 20.68
21.1 --- a/src/share/vm/services/gcNotifier.hpp Fri Feb 17 13:23:29 2012 +0100 21.2 +++ b/src/share/vm/services/gcNotifier.hpp Fri Feb 17 06:34:49 2012 -0800 21.3 @@ -1,5 +1,5 @@ 21.4 /* 21.5 - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. 21.6 + * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. 21.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 21.8 * 21.9 * This code is free software; you can redistribute it and/or modify it 21.10 @@ -60,6 +60,7 @@ 21.11 static GCNotificationRequest *last_request; 21.12 static void addRequest(GCNotificationRequest *request); 21.13 static GCNotificationRequest *getRequest(); 21.14 + static void sendNotificationInternal(TRAPS); 21.15 public: 21.16 static void pushNotification(GCMemoryManager *manager, const char *action, const char *cause); 21.17 static bool has_event();
22.1 --- a/src/share/vm/utilities/decoder.cpp Fri Feb 17 13:23:29 2012 +0100 22.2 +++ b/src/share/vm/utilities/decoder.cpp Fri Feb 17 06:34:49 2012 -0800 22.3 @@ -25,7 +25,9 @@ 22.4 #include "precompiled.hpp" 22.5 #include "prims/jvm.h" 22.6 #include "runtime/mutexLocker.hpp" 22.7 +#include "runtime/os.hpp" 22.8 #include "utilities/decoder.hpp" 22.9 +#include "utilities/vmError.hpp" 22.10 22.11 #if defined(_WINDOWS) 22.12 #include "decoder_windows.hpp" 22.13 @@ -35,74 +37,94 @@ 22.14 #include "decoder_elf.hpp" 22.15 #endif 22.16 22.17 -NullDecoder* Decoder::_decoder = NULL; 22.18 -NullDecoder Decoder::_do_nothing_decoder; 22.19 -Mutex* Decoder::_decoder_lock = new Mutex(Mutex::safepoint, 22.20 - "DecoderLock"); 22.21 +AbstractDecoder* Decoder::_shared_decoder = NULL; 22.22 +AbstractDecoder* Decoder::_error_handler_decoder = NULL; 22.23 +NullDecoder Decoder::_do_nothing_decoder; 22.24 +Mutex* Decoder::_shared_decoder_lock = new Mutex(Mutex::native, 22.25 + "SharedDecoderLock"); 22.26 22.27 -// _decoder_lock should already acquired before enter this method 22.28 -NullDecoder* Decoder::get_decoder() { 22.29 - assert(_decoder_lock != NULL && _decoder_lock->owned_by_self(), 22.30 +AbstractDecoder* Decoder::get_shared_instance() { 22.31 + assert(_shared_decoder_lock != NULL && _shared_decoder_lock->owned_by_self(), 22.32 "Require DecoderLock to enter"); 22.33 22.34 - if (_decoder != NULL) { 22.35 - return _decoder; 22.36 + if (_shared_decoder == NULL) { 22.37 + _shared_decoder = create_decoder(); 22.38 } 22.39 + return _shared_decoder; 22.40 +} 22.41 22.42 - // Decoder is a secondary service. Although, it is good to have, 22.43 - // but we can live without it. 22.44 +AbstractDecoder* Decoder::get_error_handler_instance() { 22.45 + if (_error_handler_decoder == NULL) { 22.46 + _error_handler_decoder = create_decoder(); 22.47 + } 22.48 + return _error_handler_decoder; 22.49 +} 22.50 + 22.51 + 22.52 +AbstractDecoder* Decoder::create_decoder() { 22.53 + AbstractDecoder* decoder; 22.54 #if defined(_WINDOWS) 22.55 - _decoder = new (std::nothrow) WindowsDecoder(); 22.56 + decoder = new (std::nothrow) WindowsDecoder(); 22.57 #elif defined (__APPLE__) 22.58 - _decoder = new (std::nothrow)MachODecoder(); 22.59 + decoder = new (std::nothrow)MachODecoder(); 22.60 #else 22.61 - _decoder = new (std::nothrow)ElfDecoder(); 22.62 + decoder = new (std::nothrow)ElfDecoder(); 22.63 #endif 22.64 22.65 - if (_decoder == NULL || _decoder->has_error()) { 22.66 - if (_decoder != NULL) { 22.67 - delete _decoder; 22.68 + if (decoder == NULL || decoder->has_error()) { 22.69 + if (decoder != NULL) { 22.70 + delete decoder; 22.71 } 22.72 - _decoder = &_do_nothing_decoder; 22.73 + decoder = &_do_nothing_decoder; 22.74 } 22.75 - return _decoder; 22.76 + return decoder; 22.77 } 22.78 22.79 bool Decoder::decode(address addr, char* buf, int buflen, int* offset, const char* modulepath) { 22.80 - assert(_decoder_lock != NULL, "Just check"); 22.81 - MutexLockerEx locker(_decoder_lock, true); 22.82 - NullDecoder* decoder = get_decoder(); 22.83 + assert(_shared_decoder_lock != NULL, "Just check"); 22.84 + bool error_handling_thread = os::current_thread_id() == VMError::first_error_tid; 22.85 + MutexLockerEx locker(error_handling_thread ? NULL : _shared_decoder_lock, true); 22.86 + AbstractDecoder* decoder = error_handling_thread ? 22.87 + get_error_handler_instance(): get_shared_instance(); 22.88 assert(decoder != NULL, "null decoder"); 22.89 22.90 return decoder->decode(addr, buf, buflen, offset, modulepath); 22.91 } 22.92 22.93 bool Decoder::demangle(const char* symbol, char* buf, int buflen) { 22.94 - assert(_decoder_lock != NULL, "Just check"); 22.95 - MutexLockerEx locker(_decoder_lock, true); 22.96 - NullDecoder* decoder = get_decoder(); 22.97 + assert(_shared_decoder_lock != NULL, "Just check"); 22.98 + bool error_handling_thread = os::current_thread_id() == VMError::first_error_tid; 22.99 + MutexLockerEx locker(error_handling_thread ? NULL : _shared_decoder_lock, true); 22.100 + AbstractDecoder* decoder = error_handling_thread ? 22.101 + get_error_handler_instance(): get_shared_instance(); 22.102 assert(decoder != NULL, "null decoder"); 22.103 return decoder->demangle(symbol, buf, buflen); 22.104 } 22.105 22.106 bool Decoder::can_decode_C_frame_in_vm() { 22.107 - assert(_decoder_lock != NULL, "Just check"); 22.108 - MutexLockerEx locker(_decoder_lock, true); 22.109 - NullDecoder* decoder = get_decoder(); 22.110 + assert(_shared_decoder_lock != NULL, "Just check"); 22.111 + bool error_handling_thread = os::current_thread_id() == VMError::first_error_tid; 22.112 + MutexLockerEx locker(error_handling_thread ? NULL : _shared_decoder_lock, true); 22.113 + AbstractDecoder* decoder = error_handling_thread ? 22.114 + get_error_handler_instance(): get_shared_instance(); 22.115 assert(decoder != NULL, "null decoder"); 22.116 return decoder->can_decode_C_frame_in_vm(); 22.117 } 22.118 22.119 -// shutdown real decoder and replace it with 22.120 -// _do_nothing_decoder 22.121 +/* 22.122 + * Shutdown shared decoder and replace it with 22.123 + * _do_nothing_decoder. Do nothing with error handler 22.124 + * instance, since the JVM is going down. 22.125 + */ 22.126 void Decoder::shutdown() { 22.127 - assert(_decoder_lock != NULL, "Just check"); 22.128 - MutexLockerEx locker(_decoder_lock, true); 22.129 + assert(_shared_decoder_lock != NULL, "Just check"); 22.130 + MutexLockerEx locker(_shared_decoder_lock, true); 22.131 22.132 - if (_decoder != NULL && _decoder != &_do_nothing_decoder) { 22.133 - delete _decoder; 22.134 + if (_shared_decoder != NULL && 22.135 + _shared_decoder != &_do_nothing_decoder) { 22.136 + delete _shared_decoder; 22.137 } 22.138 22.139 - _decoder = &_do_nothing_decoder; 22.140 + _shared_decoder = &_do_nothing_decoder; 22.141 } 22.142
23.1 --- a/src/share/vm/utilities/decoder.hpp Fri Feb 17 13:23:29 2012 +0100 23.2 +++ b/src/share/vm/utilities/decoder.hpp Fri Feb 17 06:34:49 2012 -0800 23.3 @@ -1,5 +1,5 @@ 23.4 /* 23.5 - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. 23.6 + * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. 23.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 23.8 * 23.9 * This code is free software; you can redistribute it and/or modify it 23.10 @@ -29,7 +29,7 @@ 23.11 #include "memory/allocation.hpp" 23.12 #include "runtime/mutex.hpp" 23.13 23.14 -class NullDecoder: public CHeapObj { 23.15 +class AbstractDecoder : public CHeapObj { 23.16 public: 23.17 // status code for decoding native C frame 23.18 enum decoder_status { 23.19 @@ -43,6 +43,34 @@ 23.20 helper_init_error // SymInitialize failed (Windows only) 23.21 }; 23.22 23.23 + // decode an pc address to corresponding function name and an offset from the beginning of 23.24 + // the function 23.25 + virtual bool decode(address pc, char* buf, int buflen, int* offset, 23.26 + const char* modulepath = NULL) = 0; 23.27 + // demangle a C++ symbol 23.28 + virtual bool demangle(const char* symbol, char* buf, int buflen) = 0; 23.29 + // if the decoder can decode symbols in vm 23.30 + virtual bool can_decode_C_frame_in_vm() const = 0; 23.31 + 23.32 + virtual decoder_status status() const { 23.33 + return _decoder_status; 23.34 + } 23.35 + 23.36 + virtual bool has_error() const { 23.37 + return is_error(_decoder_status); 23.38 + } 23.39 + 23.40 + static bool is_error(decoder_status status) { 23.41 + return (status > 0); 23.42 + } 23.43 + 23.44 +protected: 23.45 + decoder_status _decoder_status; 23.46 +}; 23.47 + 23.48 +// Do nothing decoder 23.49 +class NullDecoder : public AbstractDecoder { 23.50 +public: 23.51 NullDecoder() { 23.52 _decoder_status = not_available; 23.53 } 23.54 @@ -61,40 +89,34 @@ 23.55 virtual bool can_decode_C_frame_in_vm() const { 23.56 return false; 23.57 } 23.58 - 23.59 - virtual decoder_status status() const { 23.60 - return _decoder_status; 23.61 - } 23.62 - 23.63 - virtual bool has_error() const { 23.64 - return is_error(_decoder_status); 23.65 - } 23.66 - 23.67 - static bool is_error(decoder_status status) { 23.68 - return (status > 0); 23.69 - } 23.70 - 23.71 -protected: 23.72 - decoder_status _decoder_status; 23.73 }; 23.74 23.75 23.76 -class Decoder: AllStatic { 23.77 +class Decoder : AllStatic { 23.78 public: 23.79 static bool decode(address pc, char* buf, int buflen, int* offset, const char* modulepath = NULL); 23.80 static bool demangle(const char* symbol, char* buf, int buflen); 23.81 static bool can_decode_C_frame_in_vm(); 23.82 23.83 + // shutdown shared instance 23.84 static void shutdown(); 23.85 protected: 23.86 - static NullDecoder* get_decoder(); 23.87 + // shared decoder instance, _shared_instance_lock is needed 23.88 + static AbstractDecoder* get_shared_instance(); 23.89 + // a private instance for error handler. Error handler can be 23.90 + // triggered almost everywhere, including signal handler, where 23.91 + // no lock can be taken. So the shared decoder can not be used 23.92 + // in this scenario. 23.93 + static AbstractDecoder* get_error_handler_instance(); 23.94 23.95 + static AbstractDecoder* create_decoder(); 23.96 private: 23.97 - static NullDecoder* _decoder; 23.98 - static NullDecoder _do_nothing_decoder; 23.99 + static AbstractDecoder* _shared_decoder; 23.100 + static AbstractDecoder* _error_handler_decoder; 23.101 + static NullDecoder _do_nothing_decoder; 23.102 23.103 protected: 23.104 - static Mutex* _decoder_lock; 23.105 + static Mutex* _shared_decoder_lock; 23.106 }; 23.107 23.108 #endif // SHARE_VM_UTILITIES_DECODER_HPP
24.1 --- a/src/share/vm/utilities/decoder_elf.hpp Fri Feb 17 13:23:29 2012 +0100 24.2 +++ b/src/share/vm/utilities/decoder_elf.hpp Fri Feb 17 06:34:49 2012 -0800 24.3 @@ -1,5 +1,5 @@ 24.4 /* 24.5 - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. 24.6 + * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. 24.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 24.8 * 24.9 * This code is free software; you can redistribute it and/or modify it 24.10 @@ -30,7 +30,7 @@ 24.11 #include "utilities/decoder.hpp" 24.12 #include "utilities/elfFile.hpp" 24.13 24.14 -class ElfDecoder: public NullDecoder { 24.15 +class ElfDecoder : public AbstractDecoder { 24.16 24.17 public: 24.18 ElfDecoder() {
25.1 --- a/src/share/vm/utilities/preserveException.cpp Fri Feb 17 13:23:29 2012 +0100 25.2 +++ b/src/share/vm/utilities/preserveException.cpp Fri Feb 17 06:34:49 2012 -0800 25.3 @@ -32,9 +32,9 @@ 25.4 thread = Thread::current(); 25.5 _thread = thread; 25.6 _preserved_exception_oop = Handle(thread, _thread->pending_exception()); 25.7 - _thread->clear_pending_exception(); // Needed to avoid infinite recursion 25.8 _preserved_exception_line = _thread->exception_line(); 25.9 _preserved_exception_file = _thread->exception_file(); 25.10 + _thread->clear_pending_exception(); // Needed to avoid infinite recursion 25.11 } 25.12 25.13
26.1 --- a/src/share/vm/utilities/vmError.hpp Fri Feb 17 13:23:29 2012 +0100 26.2 +++ b/src/share/vm/utilities/vmError.hpp Fri Feb 17 06:34:49 2012 -0800 26.3 @@ -27,11 +27,12 @@ 26.4 26.5 #include "utilities/globalDefinitions.hpp" 26.6 26.7 - 26.8 +class Decoder; 26.9 class VM_ReportJavaOutOfMemory; 26.10 26.11 class VMError : public StackObj { 26.12 friend class VM_ReportJavaOutOfMemory; 26.13 + friend class Decoder; 26.14 26.15 enum ErrorType { 26.16 internal_error = 0xe0000000,