Fri, 11 Feb 2011 15:31:58 -0800
Merge
agent/src/share/classes/sun/jvm/hotspot/runtime/LowMemoryDetectorThread.java | file | annotate | diff | comparison | revisions |
1.1 --- a/agent/src/share/classes/sun/jvm/hotspot/runtime/LowMemoryDetectorThread.java Fri Feb 11 14:30:27 2011 -0800 1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 1.3 @@ -1,41 +0,0 @@ 1.4 -/* 1.5 - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. 1.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.7 - * 1.8 - * This code is free software; you can redistribute it and/or modify it 1.9 - * under the terms of the GNU General Public License version 2 only, as 1.10 - * published by the Free Software Foundation. 1.11 - * 1.12 - * This code is distributed in the hope that it will be useful, but WITHOUT 1.13 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1.14 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1.15 - * version 2 for more details (a copy is included in the LICENSE file that 1.16 - * accompanied this code). 1.17 - * 1.18 - * You should have received a copy of the GNU General Public License version 1.19 - * 2 along with this work; if not, write to the Free Software Foundation, 1.20 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1.21 - * 1.22 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 1.23 - * or visit www.oracle.com if you need additional information or have any 1.24 - * questions. 1.25 - * 1.26 - */ 1.27 - 1.28 -package sun.jvm.hotspot.runtime; 1.29 - 1.30 -import java.io.*; 1.31 - 1.32 -import sun.jvm.hotspot.debugger.*; 1.33 -import sun.jvm.hotspot.types.*; 1.34 - 1.35 -public class LowMemoryDetectorThread extends JavaThread { 1.36 - public LowMemoryDetectorThread(Address addr) { 1.37 - super(addr); 1.38 - } 1.39 - 1.40 - public boolean isJavaThread() { return false; } 1.41 - public boolean isHiddenFromExternalView() { return true; } 1.42 - public boolean isLowMemoryDetectorThread() { return true; } 1.43 - 1.44 -}
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/agent/src/share/classes/sun/jvm/hotspot/runtime/ServiceThread.java Fri Feb 11 15:31:58 2011 -0800 2.3 @@ -0,0 +1,41 @@ 2.4 +/* 2.5 + * Copyright (c) 2003, 2011 Oracle and/or its affiliates. All rights reserved. 2.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 2.7 + * 2.8 + * This code is free software; you can redistribute it and/or modify it 2.9 + * under the terms of the GNU General Public License version 2 only, as 2.10 + * published by the Free Software Foundation. 2.11 + * 2.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 2.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 2.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 2.15 + * version 2 for more details (a copy is included in the LICENSE file that 2.16 + * accompanied this code). 2.17 + * 2.18 + * You should have received a copy of the GNU General Public License version 2.19 + * 2 along with this work; if not, write to the Free Software Foundation, 2.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2.21 + * 2.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2.23 + * or visit www.oracle.com if you need additional information or have any 2.24 + * questions. 2.25 + * 2.26 + */ 2.27 + 2.28 +package sun.jvm.hotspot.runtime; 2.29 + 2.30 +import java.io.*; 2.31 + 2.32 +import sun.jvm.hotspot.debugger.*; 2.33 +import sun.jvm.hotspot.types.*; 2.34 + 2.35 +public class ServiceThread extends JavaThread { 2.36 + public ServiceThread(Address addr) { 2.37 + super(addr); 2.38 + } 2.39 + 2.40 + public boolean isJavaThread() { return false; } 2.41 + public boolean isHiddenFromExternalView() { return true; } 2.42 + public boolean isServiceThread() { return true; } 2.43 + 2.44 +}
3.1 --- a/agent/src/share/classes/sun/jvm/hotspot/runtime/Thread.java Fri Feb 11 14:30:27 2011 -0800 3.2 +++ b/agent/src/share/classes/sun/jvm/hotspot/runtime/Thread.java Fri Feb 11 15:31:58 2011 -0800 3.3 @@ -1,5 +1,5 @@ 3.4 /* 3.5 - * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved. 3.6 + * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. 3.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3.8 * 3.9 * This code is free software; you can redistribute it and/or modify it 3.10 @@ -111,7 +111,7 @@ 3.11 public boolean isJvmtiAgentThread() { return false; } 3.12 public boolean isWatcherThread() { return false; } 3.13 public boolean isConcurrentMarkSweepThread() { return false; } 3.14 - public boolean isLowMemoryDetectorThread() { return false; } 3.15 + public boolean isServiceThread() { return false; } 3.16 3.17 /** Memory operations */ 3.18 public void oopsDo(AddressVisitor oopVisitor) {
4.1 --- a/agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java Fri Feb 11 14:30:27 2011 -0800 4.2 +++ b/agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java Fri Feb 11 15:31:58 2011 -0800 4.3 @@ -1,5 +1,5 @@ 4.4 /* 4.5 - * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved. 4.6 + * Copyright (c) 2000, 2011, 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 @@ -107,14 +107,14 @@ 4.11 // for now, use JavaThread itself. fix it later with appropriate class if needed 4.12 virtualConstructor.addMapping("SurrogateLockerThread", JavaThread.class); 4.13 virtualConstructor.addMapping("JvmtiAgentThread", JvmtiAgentThread.class); 4.14 - virtualConstructor.addMapping("LowMemoryDetectorThread", LowMemoryDetectorThread.class); 4.15 + virtualConstructor.addMapping("ServiceThread", ServiceThread.class); 4.16 } 4.17 4.18 public Threads() { 4.19 } 4.20 4.21 /** NOTE: this returns objects of type JavaThread, CompilerThread, 4.22 - JvmtiAgentThread, and LowMemoryDetectorThread. 4.23 + JvmtiAgentThread, and ServiceThread. 4.24 The latter four are subclasses of the former. Most operations 4.25 (fetching the top frame, etc.) are only allowed to be performed on 4.26 a "pure" JavaThread. For this reason, {@link 4.27 @@ -143,7 +143,7 @@ 4.28 return thread; 4.29 } catch (Exception e) { 4.30 throw new RuntimeException("Unable to deduce type of thread from address " + threadAddr + 4.31 - " (expected type JavaThread, CompilerThread, LowMemoryDetectorThread, JvmtiAgentThread, or SurrogateLockerThread)", e); 4.32 + " (expected type JavaThread, CompilerThread, ServiceThread, JvmtiAgentThread, or SurrogateLockerThread)", e); 4.33 } 4.34 } 4.35
5.1 --- a/make/Makefile Fri Feb 11 14:30:27 2011 -0800 5.2 +++ b/make/Makefile Fri Feb 11 15:31:58 2011 -0800 5.3 @@ -73,6 +73,7 @@ 5.4 include defs.make 5.5 endif 5.6 5.7 +include $(GAMMADIR)/make/altsrc.make 5.8 5.9 ifneq ($(ALT_OUTPUTDIR),) 5.10 ALT_OUT=ALT_OUTPUTDIR=$(ALT_OUTPUTDIR) 5.11 @@ -361,7 +362,8 @@ 5.12 $(EXPORT_INCLUDE_DIR)/%: $(HS_SRC_DIR)/share/vm/prims/% 5.13 $(install-file) 5.14 5.15 -$(EXPORT_INCLUDE_DIR)/$(JDK_INCLUDE_SUBDIR)/jni_md.h: $(HS_SRC_DIR)/cpu/$(HS_ARCH)/vm/jni_$(HS_ARCH).h 5.16 +HS_JNI_ARCH_SRC=$(call altsrc-replace,$(HS_COMMON_SRC)/cpu/$(HS_ARCH)/vm/jni_$(HS_ARCH).h) 5.17 +$(EXPORT_INCLUDE_DIR)/$(JDK_INCLUDE_SUBDIR)/jni_md.h: $(HS_JNI_ARCH_SRC) 5.18 $(install-file) 5.19 5.20 $(EXPORT_INCLUDE_DIR)/%: $(HS_SRC_DIR)/share/vm/services/%
6.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 6.2 +++ b/make/altsrc.make Fri Feb 11 15:31:58 2011 -0800 6.3 @@ -0,0 +1,92 @@ 6.4 +# 6.5 +# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. 6.6 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 6.7 +# 6.8 +# This code is free software; you can redistribute it and/or modify it 6.9 +# under the terms of the GNU General Public License version 2 only, as 6.10 +# published by the Free Software Foundation. 6.11 +# 6.12 +# This code is distributed in the hope that it will be useful, but WITHOUT 6.13 +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 6.14 +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 6.15 +# version 2 for more details (a copy is included in the LICENSE file that 6.16 +# accompanied this code). 6.17 +# 6.18 +# You should have received a copy of the GNU General Public License version 6.19 +# 2 along with this work; if not, write to the Free Software Foundation, 6.20 +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 6.21 +# 6.22 +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 6.23 +# or visit www.oracle.com if you need additional information or have any 6.24 +# questions. 6.25 +# 6.26 +# 6.27 + 6.28 +# This file defines variables and macros which are used in the makefiles to 6.29 +# allow distributions to augment or replace common hotspot code with 6.30 +# distribution-specific source files. 6.31 + 6.32 +# Requires: GAMMADIR 6.33 +# Provides: 6.34 +# variables: HS_COMMON_SRC, HS_ALT_SRC, HS_COMMON_SRC_REL, and HS_ALT_SRC_REL 6.35 +# functions: altsrc-equiv, if-has-altsrc, altsrc, altsrc-replace 6.36 + 6.37 +HS_COMMON_SRC_REL=src 6.38 + 6.39 +# This needs to be changed to a more generic location, but we keep it as this 6.40 +# for now for compatibility 6.41 +HS_ALT_SRC_REL=src/closed 6.42 + 6.43 +HS_COMMON_SRC=$(GAMMADIR)/$(HS_COMMON_SRC_REL) 6.44 +HS_ALT_SRC=$(GAMMADIR)/$(HS_ALT_SRC_REL) 6.45 + 6.46 + 6.47 +## altsrc-equiv 6.48 +# 6.49 +# Convert a common source path to an alternative source path 6.50 +# 6.51 +# Parameter: An absolute path into the common sources 6.52 +# Result: The matching path to the alternate-source location 6.53 +# 6.54 +altsrc-equiv=$(subst $(HS_COMMON_SRC)/,$(HS_ALT_SRC)/,$(1)) 6.55 + 6.56 + 6.57 +## if-has-altsrc 6.58 +# 6.59 +# Conditional macro to test for the existence of an alternate source path 6.60 +# 6.61 +# Parameter: An absolute path into the common sources 6.62 +# Parameter: Result if the alternative-source location exists 6.63 +# Parameter: Result if the alternative-source location does not exist 6.64 +# Result: expands to parameter 2 or 3 depending on existence of alternate source 6.65 +# 6.66 +if-has-altsrc=$(if $(wildcard $(call altsrc-equiv,$(1))),$(2),$(3)) 6.67 + 6.68 + 6.69 +## altsrc 6.70 +# 6.71 +# Converts common source path to alternate source path if the alternate 6.72 +# path exists, otherwise evaluates to nul (empty string) 6.73 +# 6.74 +# Parameter: An absolute path into the common sources 6.75 +# Result: The equivalent path to the alternate-source location, if such a 6.76 +# location exists on the filesystem. Otherwise it expands to empty. 6.77 +# 6.78 +altsrc=$(call if-has-altsrc,$(1),$(call altsrc-equiv,$(1))) 6.79 + 6.80 +## commonsrc 6.81 +# 6.82 +# Returns parameter. 6.83 +# 6.84 +commonsrc=$(1) 6.85 + 6.86 + 6.87 +## altsrc-replace 6.88 +# 6.89 +# Converts a common source path to an alternate source path if the alternate 6.90 +# source path exists. Otherwise it evaluates to the input common source path. 6.91 +# 6.92 +# Parameter: An absolute path into the common sources 6.93 +# Result: A path to either the common or alternate sources 6.94 +# 6.95 +altsrc-replace=$(call if-has-altsrc,$(1),$(call altsrc-equiv,$(1)),$(1))
7.1 --- a/make/jprt.properties Fri Feb 11 14:30:27 2011 -0800 7.2 +++ b/make/jprt.properties Fri Feb 11 15:31:58 2011 -0800 7.3 @@ -44,6 +44,11 @@ 7.4 7.5 jprt.sync.push=false 7.6 7.7 +# Note: we want both embedded releases and regular releases to build and test 7.8 +# all platforms so that regressions are not introduced (eg. change to 7.9 +# common code by SE breaks PPC/ARM; change to common code by SE-E breaks 7.10 +# sparc etc. 7.11 + 7.12 # Define the Solaris platforms we want for the various releases 7.13 7.14 jprt.my.solaris.sparc.jdk7=solaris_sparc_5.10 7.15 @@ -55,6 +60,8 @@ 7.16 jprt.my.solaris.sparc.jdk6u14=solaris_sparc_5.8 7.17 jprt.my.solaris.sparc.jdk6u18=solaris_sparc_5.8 7.18 jprt.my.solaris.sparc.jdk6u20=solaris_sparc_5.8 7.19 +jprt.my.solaris.sparc.ejdk7=${jprt.my.solaris.sparc.jdk7} 7.20 +jprt.my.solaris.sparc.ejdk6=${jprt.my.solaris.sparc.jdk6} 7.21 jprt.my.solaris.sparc=${jprt.my.solaris.sparc.${jprt.tools.default.release}} 7.22 7.23 jprt.my.solaris.sparcv9.jdk7=solaris_sparcv9_5.10 7.24 @@ -66,6 +73,8 @@ 7.25 jprt.my.solaris.sparcv9.jdk6u14=solaris_sparcv9_5.8 7.26 jprt.my.solaris.sparcv9.jdk6u18=solaris_sparcv9_5.8 7.27 jprt.my.solaris.sparcv9.jdk6u20=solaris_sparcv9_5.8 7.28 +jprt.my.solaris.sparcv9.ejdk7=${jprt.my.solaris.sparcv9.jdk7} 7.29 +jprt.my.solaris.sparcv9.ejdk6=${jprt.my.solaris.sparcv9.jdk6} 7.30 jprt.my.solaris.sparcv9=${jprt.my.solaris.sparcv9.${jprt.tools.default.release}} 7.31 7.32 jprt.my.solaris.i586.jdk7=solaris_i586_5.10 7.33 @@ -77,6 +86,8 @@ 7.34 jprt.my.solaris.i586.jdk6u14=solaris_i586_5.8 7.35 jprt.my.solaris.i586.jdk6u18=solaris_i586_5.8 7.36 jprt.my.solaris.i586.jdk6u20=solaris_i586_5.8 7.37 +jprt.my.solaris.i586.ejdk7=${jprt.my.solaris.i586.jdk7} 7.38 +jprt.my.solaris.i586.ejdk6=${jprt.my.solaris.i586.jdk6} 7.39 jprt.my.solaris.i586=${jprt.my.solaris.i586.${jprt.tools.default.release}} 7.40 7.41 jprt.my.solaris.x64.jdk7=solaris_x64_5.10 7.42 @@ -88,6 +99,8 @@ 7.43 jprt.my.solaris.x64.jdk6u14=solaris_x64_5.10 7.44 jprt.my.solaris.x64.jdk6u18=solaris_x64_5.10 7.45 jprt.my.solaris.x64.jdk6u20=solaris_x64_5.10 7.46 +jprt.my.solaris.x64.ejdk7=${jprt.my.solaris.x64.jdk7} 7.47 +jprt.my.solaris.x64.ejdk6=${jprt.my.solaris.x64.jdk6} 7.48 jprt.my.solaris.x64=${jprt.my.solaris.x64.${jprt.tools.default.release}} 7.49 7.50 jprt.my.linux.i586.jdk7=linux_i586_2.6 7.51 @@ -99,6 +112,8 @@ 7.52 jprt.my.linux.i586.jdk6u14=linux_i586_2.4 7.53 jprt.my.linux.i586.jdk6u18=linux_i586_2.4 7.54 jprt.my.linux.i586.jdk6u20=linux_i586_2.4 7.55 +jprt.my.linux.i586.ejdk7=linux_i586_2.6 7.56 +jprt.my.linux.i586.ejdk6=linux_i586_2.6 7.57 jprt.my.linux.i586=${jprt.my.linux.i586.${jprt.tools.default.release}} 7.58 7.59 jprt.my.linux.x64.jdk7=linux_x64_2.6 7.60 @@ -110,8 +125,45 @@ 7.61 jprt.my.linux.x64.jdk6u14=linux_x64_2.4 7.62 jprt.my.linux.x64.jdk6u18=linux_x64_2.4 7.63 jprt.my.linux.x64.jdk6u20=linux_x64_2.4 7.64 +jprt.my.linux.x64.ejdk7=${jprt.my.linux.x64.jdk7} 7.65 +jprt.my.linux.x64.ejdk6=${jprt.my.linux.x64.jdk6} 7.66 jprt.my.linux.x64=${jprt.my.linux.x64.${jprt.tools.default.release}} 7.67 7.68 +jprt.my.linux.ppc.jdk7=linux_ppc_2.6 7.69 +jprt.my.linux.ppc.jdk7b107=linux_ppc_2.6 7.70 +jprt.my.linux.ppc.jdk7temp=linux_ppc_2.6 7.71 +jprt.my.linux.ppc.ejdk6=linux_ppc_2.6 7.72 +jprt.my.linux.ppc.ejdk7=linux_ppc_2.6 7.73 +jprt.my.linux.ppc=${jprt.my.linux.ppc.${jprt.tools.default.release}} 7.74 + 7.75 +jprt.my.linux.ppcv2.jdk7=linux_ppcv2_2.6 7.76 +jprt.my.linux.ppcv2.jdk7b107=linux_ppcv2_2.6 7.77 +jprt.my.linux.ppcv2.jdk7temp=linux_ppcv2_2.6 7.78 +jprt.my.linux.ppcv2.ejdk6=linux_ppcv2_2.6 7.79 +jprt.my.linux.ppcv2.ejdk7=linux_ppcv2_2.6 7.80 +jprt.my.linux.ppcv2=${jprt.my.linux.ppcv2.${jprt.tools.default.release}} 7.81 + 7.82 +jprt.my.linux.ppcsflt.jdk7=linux_ppcsflt_2.6 7.83 +jprt.my.linux.ppcsflt.jdk7b107=linux_ppcsflt_2.6 7.84 +jprt.my.linux.ppcsflt.jdk7temp=linux_ppcsflt_2.6 7.85 +jprt.my.linux.ppcsflt.ejdk6=linux_ppcsflt_2.6 7.86 +jprt.my.linux.ppcsflt.ejdk7=linux_ppcsflt_2.6 7.87 +jprt.my.linux.ppcsflt=${jprt.my.linux.ppcsflt.${jprt.tools.default.release}} 7.88 + 7.89 +jprt.my.linux.armvfp.jdk7=linux_armvfp_2.6 7.90 +jprt.my.linux.armvfp.jdk7b107=linux_armvfp_2.6 7.91 +jprt.my.linux.armvfp.jdk7temp=linux_armvfp_2.6 7.92 +jprt.my.linux.armvfp.ejdk6=linux_armvfp_2.6 7.93 +jprt.my.linux.armvfp.ejdk7=linux_armvfp_2.6 7.94 +jprt.my.linux.armvfp=${jprt.my.linux.armvfp.${jprt.tools.default.release}} 7.95 + 7.96 +jprt.my.linux.armsflt.jdk7=linux_armsflt_2.6 7.97 +jprt.my.linux.armsflt.jdk7b107=linux_armsflt_2.6 7.98 +jprt.my.linux.armsflt.jdk7temp=linux_armsflt_2.6 7.99 +jprt.my.linux.armsflt.ejdk6=linux_armsflt_2.6 7.100 +jprt.my.linux.armsflt.ejdk7=linux_armsflt_2.6 7.101 +jprt.my.linux.armsflt=${jprt.my.linux.armsflt.${jprt.tools.default.release}} 7.102 + 7.103 jprt.my.windows.i586.jdk7=windows_i586_5.1 7.104 jprt.my.windows.i586.jdk7b107=windows_i586_5.0 7.105 jprt.my.windows.i586.jdk7temp=windows_i586_5.0 7.106 @@ -121,6 +173,8 @@ 7.107 jprt.my.windows.i586.jdk6u14=windows_i586_5.0 7.108 jprt.my.windows.i586.jdk6u18=windows_i586_5.0 7.109 jprt.my.windows.i586.jdk6u20=windows_i586_5.0 7.110 +jprt.my.windows.i586.ejdk7=${jprt.my.windows.i586.jdk7} 7.111 +jprt.my.windows.i586.ejdk6=${jprt.my.windows.i586.jdk6} 7.112 jprt.my.windows.i586=${jprt.my.windows.i586.${jprt.tools.default.release}} 7.113 7.114 jprt.my.windows.x64.jdk7=windows_x64_5.2 7.115 @@ -132,11 +186,13 @@ 7.116 jprt.my.windows.x64.jdk6u14=windows_x64_5.2 7.117 jprt.my.windows.x64.jdk6u18=windows_x64_5.2 7.118 jprt.my.windows.x64.jdk6u20=windows_x64_5.2 7.119 +jprt.my.windows.x64.ejdk7=${jprt.my.windows.x64.jdk7} 7.120 +jprt.my.windows.x64.ejdk6=${jprt.my.windows.x64.jdk6} 7.121 jprt.my.windows.x64=${jprt.my.windows.x64.${jprt.tools.default.release}} 7.122 7.123 # Standard list of jprt build targets for this source tree 7.124 7.125 -jprt.build.targets= \ 7.126 +jprt.build.targets.standard= \ 7.127 ${jprt.my.solaris.sparc}-{product|fastdebug|debug}, \ 7.128 ${jprt.my.solaris.sparcv9}-{product|fastdebug|debug}, \ 7.129 ${jprt.my.solaris.i586}-{product|fastdebug|debug}, \ 7.130 @@ -146,6 +202,30 @@ 7.131 ${jprt.my.windows.i586}-{product|fastdebug|debug}, \ 7.132 ${jprt.my.windows.x64}-{product|fastdebug|debug} 7.133 7.134 +jprt.build.targets.embedded= \ 7.135 + ${jprt.my.linux.i586}-{product|fastdebug|debug}, \ 7.136 + ${jprt.my.linux.ppc}-{product|fastdebug}, \ 7.137 + ${jprt.my.linux.ppcv2}-{product|fastdebug}, \ 7.138 + ${jprt.my.linux.ppcsflt}-{product|fastdebug}, \ 7.139 + ${jprt.my.linux.armvfp}-{product|fastdebug}, \ 7.140 + ${jprt.my.linux.armsflt}-{product|fastdebug} 7.141 + 7.142 +jprt.build.targets.all=${jprt.build.targets.standard}, \ 7.143 + ${jprt.build.targets.embedded} 7.144 + 7.145 +jprt.build.targets.jdk7=${jprt.build.targets.all} 7.146 +jprt.build.targets.jdk7temp=${jprt.build.targets.all} 7.147 +jprt.build.targets.jdk7b107=${jprt.build.targets.all} 7.148 +jprt.build.targets.jdk6=${jprt.build.targets.standard} 7.149 +jprt.build.targets.jdk6perf=${jprt.build.targets.standard} 7.150 +jprt.build.targets.jdk6u10=${jprt.build.targets.standard} 7.151 +jprt.build.targets.jdk6u14=${jprt.build.targets.standard} 7.152 +jprt.build.targets.jdk6u18=${jprt.build.targets.standard} 7.153 +jprt.build.targets.jdk6u20=${jprt.build.targets.standard} 7.154 +jprt.build.targets.ejdk6=${jprt.build.targets.all} 7.155 +jprt.build.targets.ejdk7=${jprt.build.targets.all} 7.156 +jprt.build.targets=${jprt.build.targets.${jprt.tools.default.release}} 7.157 + 7.158 # Subset lists of test targets for this source tree 7.159 7.160 jprt.my.solaris.sparc.test.targets= \ 7.161 @@ -372,9 +452,14 @@ 7.162 ${jprt.my.windows.x64}-product-c2-jbb_G1, \ 7.163 ${jprt.my.windows.x64}-product-c2-jbb_ParOldGC 7.164 7.165 +# Testing for actual embedded builds is different to standard 7.166 +jprt.my.linux.i586.test.targets.embedded = \ 7.167 + linux_i586_2.6-product-c1-scimark 7.168 + 7.169 # The complete list of test targets for jprt 7.170 +# Note: no PPC or ARM tests at this stage 7.171 7.172 -jprt.test.targets = \ 7.173 +jprt.test.targets.standard = \ 7.174 ${jprt.my.solaris.sparc.test.targets}, \ 7.175 ${jprt.my.solaris.sparcv9.test.targets}, \ 7.176 ${jprt.my.solaris.i586.test.targets}, \ 7.177 @@ -384,15 +469,41 @@ 7.178 ${jprt.my.windows.i586.test.targets}, \ 7.179 ${jprt.my.windows.x64.test.targets} 7.180 7.181 +jprt.test.targets.embedded= \ 7.182 + ${jprt.my.linux.i586.test.targets.embedded}, \ 7.183 + ${jprt.my.solaris.sparc.test.targets}, \ 7.184 + ${jprt.my.solaris.sparcv9.test.targets}, \ 7.185 + ${jprt.my.solaris.i586.test.targets}, \ 7.186 + ${jprt.my.solaris.x64.test.targets}, \ 7.187 + ${jprt.my.linux.x64.test.targets}, \ 7.188 + ${jprt.my.windows.i586.test.targets}, \ 7.189 + ${jprt.my.windows.x64.test.targets} 7.190 + 7.191 + 7.192 +jprt.test.targets.jdk7=${jprt.test.targets.standard} 7.193 +jprt.test.targets.jdk7temp=${jprt.test.targets.standard} 7.194 +jprt.test.targets.jdk7b105=${jprt.test.targets.standard} 7.195 +jprt.test.targets.jdk6=${jprt.test.targets.standard} 7.196 +jprt.test.targets.jdk6perf=${jprt.test.targets.standard} 7.197 +jprt.test.targets.jdk6u10=${jprt.test.targets.standard} 7.198 +jprt.test.targets.jdk6u14=${jprt.test.targets.standard} 7.199 +jprt.test.targets.jdk6u18=${jprt.test.targets.standard} 7.200 +jprt.test.targets.jdk6u20=${jprt.test.targets.standard} 7.201 +jprt.test.targets.ejdk6=${jprt.test.targets.embedded} 7.202 +jprt.test.targets.ejdk7=${jprt.test.targets.embedded} 7.203 +jprt.test.targets=${jprt.test.targets.${jprt.tools.default.release}} 7.204 + 7.205 # The default test/Makefile targets that should be run 7.206 7.207 #jprt.make.rule.test.targets=*-product-*-packtest 7.208 7.209 -jprt.make.rule.test.targets = \ 7.210 +jprt.make.rule.test.targets.standard.client = \ 7.211 ${jprt.my.solaris.sparc}-*-c1-clienttest, \ 7.212 ${jprt.my.solaris.i586}-*-c1-clienttest, \ 7.213 ${jprt.my.linux.i586}-*-c1-clienttest, \ 7.214 - ${jprt.my.windows.i586}-*-c1-clienttest, \ 7.215 + ${jprt.my.windows.i586}-*-c1-clienttest 7.216 + 7.217 +jprt.make.rule.test.targets.standard.server = \ 7.218 ${jprt.my.solaris.sparc}-*-c2-servertest, \ 7.219 ${jprt.my.solaris.sparcv9}-*-c2-servertest, \ 7.220 ${jprt.my.solaris.i586}-*-c2-servertest, \ 7.221 @@ -402,3 +513,23 @@ 7.222 ${jprt.my.windows.i586}-*-c2-servertest, \ 7.223 ${jprt.my.windows.x64}-*-c2-servertest 7.224 7.225 +jprt.make.rule.test.targets.standard = \ 7.226 + ${jprt.make.rule.test.targets.standard.client}, \ 7.227 + ${jprt.make.rule.test.targets.standard.server} 7.228 + 7.229 +jprt.make.rule.test.targets.embedded = \ 7.230 + ${jprt.make.rule.test.targets.standard.client} 7.231 + 7.232 +jprt.make.rule.test.targets.jdk7=${jprt.make.rule.test.targets.standard} 7.233 +jprt.make.rule.test.targets.jdk7temp=${jprt.make.rule.test.targets.standard} 7.234 +jprt.make.rule.test.targets.jdk7b107=${jprt.make.rule.test.targets.standard} 7.235 +jprt.make.rule.test.targets.jdk6=${jprt.make.rule.test.targets.standard} 7.236 +jprt.make.rule.test.targets.jdk6perf=${jprt.make.rule.test.targets.standard} 7.237 +jprt.make.rule.test.targets.jdk6u10=${jprt.make.rule.test.targets.standard} 7.238 +jprt.make.rule.test.targets.jdk6u14=${jprt.make.rule.test.targets.standard} 7.239 +jprt.make.rule.test.targets.jdk6u18=${jprt.make.rule.test.targets.standard} 7.240 +jprt.make.rule.test.targets.jdk6u20=${jprt.make.rule.test.targets.standard} 7.241 +jprt.make.rule.test.targets.ejdk6=${jprt.make.rule.test.targets.embedded} 7.242 +jprt.make.rule.test.targets.ejdk7=${jprt.make.rule.test.targets.embedded} 7.243 +jprt.make.rule.test.targets=${jprt.make.rule.test.targets.${jprt.tools.default.release}} 7.244 +
8.1 --- a/make/linux/Makefile Fri Feb 11 14:30:27 2011 -0800 8.2 +++ b/make/linux/Makefile Fri Feb 11 15:31:58 2011 -0800 8.3 @@ -208,7 +208,7 @@ 8.4 TARGETS_SHARK = $(addsuffix shark,$(TARGETS)) 8.5 8.6 BUILDTREE_MAKE = $(GAMMADIR)/make/$(OSNAME)/makefiles/buildtree.make 8.7 -BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OSNAME) ARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) 8.8 +BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OSNAME) SRCARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) 8.9 BUILDTREE_VARS += HOTSPOT_RELEASE_VERSION=$(HOTSPOT_RELEASE_VERSION) HOTSPOT_BUILD_VERSION=$(HOTSPOT_BUILD_VERSION) JRE_RELEASE_VERSION=$(JRE_RELEASE_VERSION) 8.10 8.11 BUILDTREE = $(MAKE) -f $(BUILDTREE_MAKE) $(BUILDTREE_VARS)
9.1 --- a/make/linux/makefiles/adlc.make Fri Feb 11 14:30:27 2011 -0800 9.2 +++ b/make/linux/makefiles/adlc.make Fri Feb 11 15:31:58 2011 -0800 9.3 @@ -1,5 +1,5 @@ 9.4 # 9.5 -# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. 9.6 +# Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. 9.7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 9.8 # 9.9 # This code is free software; you can redistribute it and/or modify it 9.10 @@ -39,8 +39,9 @@ 9.11 9.12 SOURCE.AD = $(OUTDIR)/$(OS)_$(Platform_arch_model).ad 9.13 9.14 -SOURCES.AD = $(GAMMADIR)/src/cpu/$(ARCH)/vm/$(Platform_arch_model).ad \ 9.15 - $(GAMMADIR)/src/os_cpu/$(OS)_$(ARCH)/vm/$(OS)_$(Platform_arch_model).ad 9.16 +SOURCES.AD = \ 9.17 + $(call altsrc-replace,$(HS_COMMON_SRC)/cpu/$(ARCH)/vm/$(Platform_arch_model).ad) \ 9.18 + $(call altsrc-replace,$(HS_COMMON_SRC)/os_cpu/$(OS)_$(ARCH)/vm/$(OS)_$(Platform_arch_model).ad) 9.19 9.20 EXEC = $(OUTDIR)/adlc 9.21
10.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 10.2 +++ b/make/linux/makefiles/arm.make Fri Feb 11 15:31:58 2011 -0800 10.3 @@ -0,0 +1,10 @@ 10.4 +# 10.5 +# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. 10.6 +# ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. 10.7 +# 10.8 + 10.9 +Obj_Files += linux_arm.o 10.10 + 10.11 +LIBS += $(EXT_LIBS_PATH)/sflt_glibc.a 10.12 + 10.13 +CFLAGS += -DVM_LITTLE_ENDIAN
11.1 --- a/make/linux/makefiles/buildtree.make Fri Feb 11 14:30:27 2011 -0800 11.2 +++ b/make/linux/makefiles/buildtree.make Fri Feb 11 15:31:58 2011 -0800 11.3 @@ -1,5 +1,5 @@ 11.4 # 11.5 -# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. 11.6 +# Copyright (c) 2005, 2011, 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 @@ -24,7 +24,7 @@ 11.11 11.12 # Usage: 11.13 # 11.14 -# $(MAKE) -f buildtree.make ARCH=arch BUILDARCH=buildarch LIBARCH=libarch 11.15 +# $(MAKE) -f buildtree.make SRCARCH=srcarch BUILDARCH=buildarch LIBARCH=libarch 11.16 # GAMMADIR=dir OS_FAMILY=os VARIANT=variant 11.17 # 11.18 # The macros ARCH, GAMMADIR, OS_FAMILY and VARIANT must be defined in the 11.19 @@ -56,6 +56,8 @@ 11.20 # having to read the dependency files for the vm. 11.21 11.22 include $(GAMMADIR)/make/scm.make 11.23 +include $(GAMMADIR)/make/altsrc.make 11.24 + 11.25 11.26 # 'gmake MAKE_VERBOSE=y' or 'gmake QUIETLY=' gives all the gory details. 11.27 QUIETLY$(MAKE_VERBOSE) = @ 11.28 @@ -127,7 +129,7 @@ 11.29 env.sh env.csh jdkpath.sh .dbxrc test_gamma 11.30 11.31 BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OS_FAMILY) \ 11.32 - ARCH=$(ARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT) 11.33 + SRCARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT) 11.34 11.35 # Define variables to be set in flags.make. 11.36 # Default values are set in make/defs.make. 11.37 @@ -146,13 +148,7 @@ 11.38 # Define HOTSPOT_VM_DISTRO based on settings in make/openjdk_distro 11.39 # or make/hotspot_distro. 11.40 ifndef HOTSPOT_VM_DISTRO 11.41 - CLOSED_DIR_EXISTS := $(shell \ 11.42 - if [ -d $(GAMMADIR)/src/closed ] ; then \ 11.43 - echo true; \ 11.44 - else \ 11.45 - echo false; \ 11.46 - fi) 11.47 - ifeq ($(CLOSED_DIR_EXISTS), true) 11.48 + ifeq ($(call if-has-altsrc,$(HS_COMMON_SRC)/,true,false),true) 11.49 include $(GAMMADIR)/make/hotspot_distro 11.50 else 11.51 include $(GAMMADIR)/make/openjdk_distro 11.52 @@ -177,6 +173,11 @@ 11.53 $(SIMPLE_DIRS): 11.54 $(QUIETLY) mkdir -p $@ 11.55 11.56 +# Convenience macro which takes a source relative path, applies $(1) to the 11.57 +# absolute path, and then replaces $(GAMMADIR) in the result with a 11.58 +# literal "$(GAMMADIR)/" suitable for inclusion in a Makefile. 11.59 +gamma-path=$(subst $(GAMMADIR),\$$(GAMMADIR),$(call $(1),$(HS_COMMON_SRC)/$(2))) 11.60 + 11.61 flags.make: $(BUILDTREE_MAKE) ../shared_dirs.lst 11.62 @echo Creating $@ ... 11.63 $(QUIETLY) ( \ 11.64 @@ -187,7 +188,7 @@ 11.65 echo; \ 11.66 echo "GAMMADIR = $(GAMMADIR)"; \ 11.67 echo "SYSDEFS = \$$(Platform_sysdefs)"; \ 11.68 - echo "SRCARCH = $(ARCH)"; \ 11.69 + echo "SRCARCH = $(SRCARCH)"; \ 11.70 echo "BUILDARCH = $(BUILDARCH)"; \ 11.71 echo "LIBARCH = $(LIBARCH)"; \ 11.72 echo "TARGET = $(TARGET)"; \ 11.73 @@ -208,16 +209,28 @@ 11.74 echo; \ 11.75 echo "Src_Dirs_V = \\"; \ 11.76 sed 's/$$/ \\/;s|$(GAMMADIR)|$$(GAMMADIR)|' ../shared_dirs.lst; \ 11.77 - echo "\$$(GAMMADIR)/src/cpu/$(ARCH)/vm \\"; \ 11.78 - echo "\$$(GAMMADIR)/src/os/$(OS_FAMILY)/vm \\"; \ 11.79 - echo "\$$(GAMMADIR)/src/os_cpu/$(OS_FAMILY)_$(ARCH)/vm"; \ 11.80 + echo "$(call gamma-path,altsrc,cpu/$(SRCARCH)/vm) \\"; \ 11.81 + echo "$(call gamma-path,commonsrc,cpu/$(SRCARCH)/vm) \\"; \ 11.82 + echo "$(call gamma-path,altsrc,os_cpu/$(OS_FAMILY)_$(SRCARCH)/vm) \\"; \ 11.83 + echo "$(call gamma-path,commonsrc,os_cpu/$(OS_FAMILY)_$(SRCARCH)/vm) \\"; \ 11.84 + echo "$(call gamma-path,altsrc,os/$(OS_FAMILY)/vm) \\"; \ 11.85 + echo "$(call gamma-path,commonsrc,os/$(OS_FAMILY)/vm) \\"; \ 11.86 + echo "$(call gamma-path,altsrc,os/posix/vm) \\"; \ 11.87 + echo "$(call gamma-path,commonsrc,os/posix/vm)"; \ 11.88 echo; \ 11.89 echo "Src_Dirs_I = \\"; \ 11.90 - echo "\$$(GAMMADIR)/src/share/vm \\"; \ 11.91 - echo "\$$(GAMMADIR)/src/share/vm/prims \\"; \ 11.92 - echo "\$$(GAMMADIR)/src/cpu/$(ARCH)/vm \\"; \ 11.93 - echo "\$$(GAMMADIR)/src/os/$(OS_FAMILY)/vm \\"; \ 11.94 - echo "\$$(GAMMADIR)/src/os_cpu/$(OS_FAMILY)_$(ARCH)/vm"; \ 11.95 + echo "$(call gamma-path,altsrc,share/vm/prims) \\"; \ 11.96 + echo "$(call gamma-path,commonsrc,share/vm/prims) \\"; \ 11.97 + echo "$(call gamma-path,altsrc,share/vm) \\"; \ 11.98 + echo "$(call gamma-path,commonsrc,share/vm) \\"; \ 11.99 + echo "$(call gamma-path,altsrc,cpu/$(SRCARCH)/vm) \\"; \ 11.100 + echo "$(call gamma-path,commonsrc,cpu/$(SRCARCH)/vm) \\"; \ 11.101 + echo "$(call gamma-path,altsrc,os_cpu/$(OS_FAMILY)_$(SRCARCH)/vm) \\"; \ 11.102 + echo "$(call gamma-path,commonsrc,os_cpu/$(OS_FAMILY)_$(SRCARCH)/vm) \\"; \ 11.103 + echo "$(call gamma-path,altsrc,os/$(OS_FAMILY)/vm) \\"; \ 11.104 + echo "$(call gamma-path,commonsrc,os/$(OS_FAMILY)/vm) \\"; \ 11.105 + echo "$(call gamma-path,altsrc,os/posix/vm) \\"; \ 11.106 + echo "$(call gamma-path,commonsrc,os/posix/vm)"; \ 11.107 [ -n "$(CFLAGS_BROWSE)" ] && \ 11.108 echo && echo "CFLAGS_BROWSE = $(CFLAGS_BROWSE)"; \ 11.109 [ -n "$(HOTSPOT_EXTRA_SYSDEFS)" ] && \ 11.110 @@ -241,9 +254,14 @@ 11.111 11.112 ../shared_dirs.lst: $(BUILDTREE_MAKE) $(GAMMADIR)/src/share/vm 11.113 @echo Creating directory list $@ 11.114 - $(QUIETLY) find $(GAMMADIR)/src/share/vm/* -prune \ 11.115 + $(QUIETLY) if [ -d $(HS_ALT_SRC)/share/vm ]; then \ 11.116 + find $(HS_ALT_SRC)/share/vm/* -prune \ 11.117 + -type d \! \( $(TOPLEVEL_EXCLUDE_DIRS) \) -exec find {} \ 11.118 + \( $(ALWAYS_EXCLUDE_DIRS) \) -prune -o -type d -print \; > $@; \ 11.119 + fi; 11.120 + $(QUIETLY) find $(HS_COMMON_SRC)/share/vm/* -prune \ 11.121 -type d \! \( $(TOPLEVEL_EXCLUDE_DIRS) \) -exec find {} \ 11.122 - \( $(ALWAYS_EXCLUDE_DIRS) \) -prune -o -type d -print \; > $@ 11.123 + \( $(ALWAYS_EXCLUDE_DIRS) \) -prune -o -type d -print \; >> $@ 11.124 11.125 Makefile: $(BUILDTREE_MAKE) 11.126 @echo Creating $@ ...
12.1 --- a/make/linux/makefiles/gcc.make Fri Feb 11 14:30:27 2011 -0800 12.2 +++ b/make/linux/makefiles/gcc.make Fri Feb 11 15:31:58 2011 -0800 12.3 @@ -75,6 +75,11 @@ 12.4 CFLAGS += -fno-exceptions 12.5 CFLAGS += -D_REENTRANT 12.6 CFLAGS += -fcheck-new 12.7 +# version 4 and above support fvisibility=hidden (matches jni_x86.h file) 12.8 +# except 4.1.2 gives pointless warnings that can't be disabled (afaik) 12.9 +ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0" 12.10 +CFLAGS += -fvisibility=hidden 12.11 +endif 12.12 12.13 ARCHFLAG = $(ARCHFLAG/$(BUILDARCH)) 12.14 ARCHFLAG/i486 = -m32 -march=i586
13.1 --- a/make/linux/makefiles/mapfile-vers-debug Fri Feb 11 14:30:27 2011 -0800 13.2 +++ b/make/linux/makefiles/mapfile-vers-debug Fri Feb 11 15:31:58 2011 -0800 13.3 @@ -262,14 +262,6 @@ 13.4 JVM_SetField; 13.5 JVM_SetPrimitiveField; 13.6 13.7 - # Needed for dropping VM into JDK 1.3.x, 1.4 13.8 - _JVM_native_threads; 13.9 - jdk_sem_init; 13.10 - jdk_sem_post; 13.11 - jdk_sem_wait; 13.12 - jdk_pthread_sigmask; 13.13 - jdk_waitpid; 13.14 - 13.15 # debug JVM 13.16 JVM_AccessVMBooleanFlag; 13.17 JVM_AccessVMIntFlag;
14.1 --- a/make/linux/makefiles/mapfile-vers-product Fri Feb 11 14:30:27 2011 -0800 14.2 +++ b/make/linux/makefiles/mapfile-vers-product Fri Feb 11 15:31:58 2011 -0800 14.3 @@ -262,14 +262,6 @@ 14.4 JVM_SetField; 14.5 JVM_SetPrimitiveField; 14.6 14.7 - # Needed for dropping VM into JDK 1.3.x, 1.4 14.8 - _JVM_native_threads; 14.9 - jdk_sem_init; 14.10 - jdk_sem_post; 14.11 - jdk_sem_wait; 14.12 - jdk_pthread_sigmask; 14.13 - jdk_waitpid; 14.14 - 14.15 # miscellaneous functions 14.16 jio_fprintf; 14.17 jio_printf;
15.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 15.2 +++ b/make/linux/makefiles/ppc.make Fri Feb 11 15:31:58 2011 -0800 15.3 @@ -0,0 +1,11 @@ 15.4 +# 15.5 +# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. 15.6 +# ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. 15.7 +# 15.8 + 15.9 +# The copied fdlibm routines in sharedRuntimeTrig.o must not be optimized 15.10 +OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/NOOPT) 15.11 + 15.12 +# Must also specify if CPU is big endian 15.13 +CFLAGS += -DVM_BIG_ENDIAN 15.14 +
16.1 --- a/make/linux/makefiles/rules.make Fri Feb 11 14:30:27 2011 -0800 16.2 +++ b/make/linux/makefiles/rules.make Fri Feb 11 15:31:58 2011 -0800 16.3 @@ -1,5 +1,5 @@ 16.4 # 16.5 -# Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. 16.6 +# Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. 16.7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 16.8 # 16.9 # This code is free software; you can redistribute it and/or modify it 16.10 @@ -146,6 +146,8 @@ 16.11 include $(GAMMADIR)/make/pic.make 16.12 endif 16.13 16.14 +include $(GAMMADIR)/make/altsrc.make 16.15 + 16.16 # The non-PIC object files are only generated for 32 bit platforms. 16.17 ifdef LP64 16.18 %.o: %.cpp
17.1 --- a/make/linux/makefiles/top.make Fri Feb 11 14:30:27 2011 -0800 17.2 +++ b/make/linux/makefiles/top.make Fri Feb 11 15:31:58 2011 -0800 17.3 @@ -39,6 +39,8 @@ 17.4 # Instead, use "gmake" (or "gnumake") from the command line. --Rose 17.5 #MAKE = gmake 17.6 17.7 +include $(GAMMADIR)/make/altsrc.make 17.8 + 17.9 TOPDIR = $(shell echo `pwd`) 17.10 GENERATED = $(TOPDIR)/../generated 17.11 VM = $(GAMMADIR)/src/share/vm 17.12 @@ -57,8 +59,8 @@ 17.13 17.14 AD_Dir = $(GENERATED)/adfiles 17.15 ADLC = $(AD_Dir)/adlc 17.16 -AD_Spec = $(GAMMADIR)/src/cpu/$(Platform_arch)/vm/$(Platform_arch_model).ad 17.17 -AD_Src = $(GAMMADIR)/src/share/vm/adlc 17.18 +AD_Spec = $(call altsrc-replace,$(HS_COMMON_SRC)/cpu/$(Platform_arch)/vm/$(Platform_arch_model).ad) 17.19 +AD_Src = $(call altsrc-replace,$(HS_COMMON_SRC)/share/vm/adlc) 17.20 AD_Names = ad_$(Platform_arch_model).hpp ad_$(Platform_arch_model).cpp 17.21 AD_Files = $(AD_Names:%=$(AD_Dir)/%) 17.22
18.1 --- a/make/linux/makefiles/vm.make Fri Feb 11 14:30:27 2011 -0800 18.2 +++ b/make/linux/makefiles/vm.make Fri Feb 11 15:31:58 2011 -0800 18.3 @@ -28,6 +28,7 @@ 18.4 # Common build rules. 18.5 MAKEFILES_DIR=$(GAMMADIR)/make/$(Platform_os_family)/makefiles 18.6 include $(MAKEFILES_DIR)/rules.make 18.7 +include $(GAMMADIR)/make/altsrc.make 18.8 18.9 default: build 18.10 18.11 @@ -119,17 +120,27 @@ 18.12 LIBJVM = lib$(JVM).so 18.13 LIBJVM_G = lib$(JVM)$(G_SUFFIX).so 18.14 18.15 -CORE_PATHS := $(shell find $(GAMMADIR)/src/share/vm/* -type d \! \( -name adlc -o -name c1 -o -name gc_implementation -o -name opto -o -name shark -o -name libadt \)) 18.16 -CORE_PATHS += $(GAMMADIR)/src/os/$(Platform_os_family)/vm 18.17 -CORE_PATHS += $(GAMMADIR)/src/cpu/$(Platform_arch)/vm 18.18 -CORE_PATHS += $(GAMMADIR)/src/os_cpu/$(Platform_os_arch)/vm 18.19 -CORE_PATHS += $(GENERATED)/jvmtifiles 18.20 +SPECIAL_PATHS:=adlc c1 gc_implementation opto shark libadt 18.21 18.22 -COMPILER1_PATHS := $(GAMMADIR)/src/share/vm/c1 18.23 +SOURCE_PATHS=\ 18.24 + $(shell find $(HS_COMMON_SRC)/share/vm/* -type d \! \ 18.25 + \( -name DUMMY $(foreach dir,$(SPECIAL_PATHS),-o -name $(dir)) \)) 18.26 +SOURCE_PATHS+=$(HS_COMMON_SRC)/os/$(Platform_os_family)/vm 18.27 +SOURCE_PATHS+=$(HS_COMMON_SRC)/os/posix/vm 18.28 +SOURCE_PATHS+=$(HS_COMMON_SRC)/cpu/$(Platform_arch)/vm 18.29 +SOURCE_PATHS+=$(HS_COMMON_SRC)/os_cpu/$(Platform_os_arch)/vm 18.30 18.31 -COMPILER2_PATHS := $(GAMMADIR)/src/share/vm/opto 18.32 -COMPILER2_PATHS += $(GAMMADIR)/src/share/vm/libadt 18.33 -COMPILER2_PATHS += $(GENERATED)/adfiles 18.34 +CORE_PATHS=$(foreach path,$(SOURCE_PATHS),$(call altsrc,$(path)) $(path)) 18.35 +CORE_PATHS+=$(GENERATED)/jvmtifiles 18.36 + 18.37 +COMPILER1_PATHS := $(call altsrc,$(HS_COMMON_SRC)/share/vm/c1) 18.38 +COMPILER1_PATHS += $(HS_COMMON_SRC)/share/vm/c1 18.39 + 18.40 +COMPILER2_PATHS := $(call altsrc,$(HS_COMMON_SRC)/share/vm/opto) 18.41 +COMPILER2_PATHS += $(call altsrc,$(HS_COMMON_SRC)/share/vm/libadt) 18.42 +COMPILER2_PATHS += $(HS_COMMON_SRC)/share/vm/opto 18.43 +COMPILER2_PATHS += $(HS_COMMON_SRC)/share/vm/libadt 18.44 +COMPILER2_PATHS += $(GENERATED)/adfiles 18.45 18.46 # Include dirs per type. 18.47 Src_Dirs/CORE := $(CORE_PATHS)
19.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 19.2 +++ b/make/linux/platform_arm Fri Feb 11 15:31:58 2011 -0800 19.3 @@ -0,0 +1,17 @@ 19.4 +os_family = linux 19.5 + 19.6 +arch = arm 19.7 + 19.8 +arch_model = arm 19.9 + 19.10 +os_arch = linux_arm 19.11 + 19.12 +os_arch_model = linux_arm 19.13 + 19.14 +lib_arch = arm 19.15 + 19.16 +compiler = gcc 19.17 + 19.18 +gnu_dis_arch = arm 19.19 + 19.20 +sysdefs = -DLINUX -D_GNU_SOURCE -DARM
20.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 20.2 +++ b/make/linux/platform_ppc Fri Feb 11 15:31:58 2011 -0800 20.3 @@ -0,0 +1,17 @@ 20.4 +os_family = linux 20.5 + 20.6 +arch = ppc 20.7 + 20.8 +arch_model = ppc 20.9 + 20.10 +os_arch = linux_ppc 20.11 + 20.12 +os_arch_model = linux_ppc 20.13 + 20.14 +lib_arch = ppc 20.15 + 20.16 +compiler = gcc 20.17 + 20.18 +gnu_dis_arch = ppc 20.19 + 20.20 +sysdefs = -DLINUX -D_GNU_SOURCE -DPPC
21.1 --- a/make/solaris/makefiles/adlc.make Fri Feb 11 14:30:27 2011 -0800 21.2 +++ b/make/solaris/makefiles/adlc.make Fri Feb 11 15:31:58 2011 -0800 21.3 @@ -27,6 +27,7 @@ 21.4 # It knows how to compile, link, and run the adlc. 21.5 21.6 include $(GAMMADIR)/make/$(Platform_os_family)/makefiles/rules.make 21.7 +include $(GAMMADIR)/make/altsrc.make 21.8 21.9 # ######################################################################### 21.10 21.11 @@ -39,8 +40,9 @@ 21.12 21.13 SOURCE.AD = $(OUTDIR)/$(OS)_$(Platform_arch_model).ad 21.14 21.15 -SOURCES.AD = $(GAMMADIR)/src/cpu/$(ARCH)/vm/$(Platform_arch_model).ad \ 21.16 - $(GAMMADIR)/src/os_cpu/$(OS)_$(ARCH)/vm/$(OS)_$(Platform_arch_model).ad 21.17 +SOURCES.AD = \ 21.18 + $(call altsrc-replace,$(HS_COMMON_SRC)/cpu/$(ARCH)/vm/$(Platform_arch_model).ad) \ 21.19 + $(call altsrc-replace,$(HS_COMMON_SRC)/os_cpu/$(OS)_$(ARCH)/vm/$(OS)_$(Platform_arch_model).ad) 21.20 21.21 EXEC = $(OUTDIR)/adlc 21.22
22.1 --- a/make/solaris/makefiles/buildtree.make Fri Feb 11 14:30:27 2011 -0800 22.2 +++ b/make/solaris/makefiles/buildtree.make Fri Feb 11 15:31:58 2011 -0800 22.3 @@ -56,6 +56,7 @@ 22.4 # having to read the dependency files for the vm. 22.5 22.6 include $(GAMMADIR)/make/scm.make 22.7 +include $(GAMMADIR)/make/altsrc.make 22.8 22.9 # 'gmake MAKE_VERBOSE=y' or 'gmake QUIETLY=' gives all the gory details. 22.10 QUIETLY$(MAKE_VERBOSE) = @ 22.11 @@ -139,13 +140,7 @@ 22.12 # Define HOTSPOT_VM_DISTRO based on settings in make/openjdk_distro 22.13 # or make/hotspot_distro. 22.14 ifndef HOTSPOT_VM_DISTRO 22.15 - CLOSED_DIR_EXISTS := $(shell \ 22.16 - if [ -d $(GAMMADIR)/src/closed ] ; then \ 22.17 - echo true; \ 22.18 - else \ 22.19 - echo false; \ 22.20 - fi) 22.21 - ifeq ($(CLOSED_DIR_EXISTS), true) 22.22 + ifeq ($(call if-has-altsrc,$(HS_COMMON_SRC)/,true,false),true) 22.23 include $(GAMMADIR)/make/hotspot_distro 22.24 else 22.25 include $(GAMMADIR)/make/openjdk_distro 22.26 @@ -170,6 +165,11 @@ 22.27 $(SIMPLE_DIRS): 22.28 $(QUIETLY) mkdir -p $@ 22.29 22.30 +# Convenience macro which takes a source relative path, applies $(1) to the 22.31 +# absolute path, and then replaces $(GAMMADIR) in the result with a 22.32 +# literal "$(GAMMADIR)/" suitable for inclusion in a Makefile. 22.33 +gamma-path=$(subst $(GAMMADIR),\$$(GAMMADIR),$(call $(1),$(HS_COMMON_SRC)/$(2))) 22.34 + 22.35 flags.make: $(BUILDTREE_MAKE) ../shared_dirs.lst 22.36 @echo Creating $@ ... 22.37 $(QUIETLY) ( \ 22.38 @@ -202,16 +202,28 @@ 22.39 echo; \ 22.40 echo "Src_Dirs_V = \\"; \ 22.41 sed 's/$$/ \\/;s|$(GAMMADIR)|$$(GAMMADIR)|' ../shared_dirs.lst; \ 22.42 - echo "\$$(GAMMADIR)/src/cpu/$(ARCH)/vm \\"; \ 22.43 - echo "\$$(GAMMADIR)/src/os/$(OS_FAMILY)/vm \\"; \ 22.44 - echo "\$$(GAMMADIR)/src/os_cpu/$(OS_FAMILY)_$(ARCH)/vm"; \ 22.45 + echo "$(call gamma-path,altsrc,cpu/$(ARCH)/vm) \\"; \ 22.46 + echo "$(call gamma-path,commonsrc,cpu/$(ARCH)/vm) \\"; \ 22.47 + echo "$(call gamma-path,altsrc,os_cpu/$(OS_FAMILY)_$(ARCH)/vm) \\"; \ 22.48 + echo "$(call gamma-path,commonsrc,os_cpu/$(OS_FAMILY)_$(ARCH)/vm) \\"; \ 22.49 + echo "$(call gamma-path,altsrc,os/$(OS_FAMILY)/vm) \\"; \ 22.50 + echo "$(call gamma-path,commonsrc,os/$(OS_FAMILY)/vm) \\"; \ 22.51 + echo "$(call gamma-path,altsrc,os/posix/vm) \\"; \ 22.52 + echo "$(call gamma-path,commonsrc,os/posix/vm)"; \ 22.53 echo; \ 22.54 echo "Src_Dirs_I = \\"; \ 22.55 - echo "\$$(GAMMADIR)/src/share/vm \\"; \ 22.56 - echo "\$$(GAMMADIR)/src/share/vm/prims \\"; \ 22.57 - echo "\$$(GAMMADIR)/src/cpu/$(ARCH)/vm \\"; \ 22.58 - echo "\$$(GAMMADIR)/src/os/$(OS_FAMILY)/vm \\"; \ 22.59 - echo "\$$(GAMMADIR)/src/os_cpu/$(OS_FAMILY)_$(ARCH)/vm"; \ 22.60 + echo "$(call gamma-path,altsrc,share/vm/prims) \\"; \ 22.61 + echo "$(call gamma-path,commonsrc,share/vm/prims) \\"; \ 22.62 + echo "$(call gamma-path,altsrc,share/vm) \\"; \ 22.63 + echo "$(call gamma-path,commonsrc,share/vm) \\"; \ 22.64 + echo "$(call gamma-path,altsrc,cpu/$(ARCH)/vm) \\"; \ 22.65 + echo "$(call gamma-path,commonsrc,cpu/$(ARCH)/vm) \\"; \ 22.66 + echo "$(call gamma-path,altsrc,os_cpu/$(OS_FAMILY)_$(ARCH)/vm) \\"; \ 22.67 + echo "$(call gamma-path,commonsrc,os_cpu/$(OS_FAMILY)_$(ARCH)/vm) \\"; \ 22.68 + echo "$(call gamma-path,altsrc,os/$(OS_FAMILY)/vm) \\"; \ 22.69 + echo "$(call gamma-path,commonsrc,os/$(OS_FAMILY)/vm) \\"; \ 22.70 + echo "$(call gamma-path,altsrc,os/posix/vm) \\"; \ 22.71 + echo "$(call gamma-path,commonsrc,os/posix/vm)"; \ 22.72 [ -n "$(CFLAGS_BROWSE)" ] && \ 22.73 echo && echo "CFLAGS_BROWSE = $(CFLAGS_BROWSE)"; \ 22.74 [ -n "$(HOTSPOT_EXTRA_SYSDEFS)" ] && \ 22.75 @@ -235,9 +247,14 @@ 22.76 22.77 ../shared_dirs.lst: $(BUILDTREE_MAKE) $(GAMMADIR)/src/share/vm 22.78 @echo Creating directory list $@ 22.79 - $(QUIETLY) find $(GAMMADIR)/src/share/vm/* -prune \ 22.80 + $(QUIETLY) if [ -d $(HS_ALT_SRC)/share/vm ]; then \ 22.81 + find $(HS_ALT_SRC)/share/vm/* -prune \ 22.82 + -type d \! \( $(TOPLEVEL_EXCLUDE_DIRS) \) -exec find {} \ 22.83 + \( $(ALWAYS_EXCLUDE_DIRS) \) -prune -o -type d -print \; > $@; \ 22.84 + fi; 22.85 + $(QUIETLY) find $(HS_COMMON_SRC)/share/vm/* -prune \ 22.86 -type d \! \( $(TOPLEVEL_EXCLUDE_DIRS) \) -exec find {} \ 22.87 - \( $(ALWAYS_EXCLUDE_DIRS) \) -prune -o -type d -print \; > $@ 22.88 + \( $(ALWAYS_EXCLUDE_DIRS) \) -prune -o -type d -print \; >> $@ 22.89 22.90 Makefile: $(BUILDTREE_MAKE) 22.91 @echo Creating $@ ...
23.1 --- a/make/solaris/makefiles/rules.make Fri Feb 11 14:30:27 2011 -0800 23.2 +++ b/make/solaris/makefiles/rules.make Fri Feb 11 15:31:58 2011 -0800 23.3 @@ -146,6 +146,8 @@ 23.4 include $(GAMMADIR)/make/pic.make 23.5 endif 23.6 23.7 +include $(GAMMADIR)/make/altsrc.make 23.8 + 23.9 # Sun compiler for 64 bit Solaris does not support building non-PIC object files. 23.10 ifdef LP64 23.11 %.o: %.cpp
24.1 --- a/make/solaris/makefiles/top.make Fri Feb 11 14:30:27 2011 -0800 24.2 +++ b/make/solaris/makefiles/top.make Fri Feb 11 15:31:58 2011 -0800 24.3 @@ -39,6 +39,8 @@ 24.4 # Instead, use "gmake" (or "gnumake") from the command line. --Rose 24.5 #MAKE = gmake 24.6 24.7 +include $(GAMMADIR)/make/altsrc.make 24.8 + 24.9 GENERATED = ../generated 24.10 VM = $(GAMMADIR)/src/share/vm 24.11 Plat_File = $(Platform_file) 24.12 @@ -48,8 +50,8 @@ 24.13 24.14 AD_Dir = $(GENERATED)/adfiles 24.15 ADLC = $(AD_Dir)/adlc 24.16 -AD_Spec = $(GAMMADIR)/src/cpu/$(Platform_arch)/vm/$(Platform_arch_model).ad 24.17 -AD_Src = $(GAMMADIR)/src/share/vm/adlc 24.18 +AD_Spec = $(call altsrc-replace,$(HS_COMMON_SRC)/cpu/$(Platform_arch)/vm/$(Platform_arch_model).ad) 24.19 +AD_Src = $(call altsrc-replace,$(HS_COMMON_SRC)/share/vm/adlc) 24.20 AD_Names = ad_$(Platform_arch_model).hpp ad_$(Platform_arch_model).cpp 24.21 AD_Files = $(AD_Names:%=$(AD_Dir)/%) 24.22
25.1 --- a/make/solaris/makefiles/vm.make Fri Feb 11 14:30:27 2011 -0800 25.2 +++ b/make/solaris/makefiles/vm.make Fri Feb 11 15:31:58 2011 -0800 25.3 @@ -28,6 +28,7 @@ 25.4 # Common build rules. 25.5 MAKEFILES_DIR=$(GAMMADIR)/make/$(Platform_os_family)/makefiles 25.6 include $(MAKEFILES_DIR)/rules.make 25.7 +include $(GAMMADIR)/make/altsrc.make 25.8 25.9 default: build 25.10 25.11 @@ -139,16 +140,26 @@ 25.12 LIBJVM = lib$(JVM).so 25.13 LIBJVM_G = lib$(JVM)$(G_SUFFIX).so 25.14 25.15 -CORE_PATHS := $(shell find $(GAMMADIR)/src/share/vm/* -type d \! \( -name adlc -o -name c1 -o -name gc_implementation -o -name opto -o -name shark -o -name libadt \)) 25.16 -CORE_PATHS += $(GAMMADIR)/src/os/$(Platform_os_family)/vm 25.17 -CORE_PATHS += $(GAMMADIR)/src/cpu/$(Platform_arch)/vm 25.18 -CORE_PATHS += $(GAMMADIR)/src/os_cpu/$(Platform_os_arch)/vm 25.19 -CORE_PATHS += $(GENERATED)/jvmtifiles 25.20 +SPECIAL_PATHS:=adlc c1 dist gc_implementation opto shark libadt 25.21 25.22 -COMPILER1_PATHS := $(GAMMADIR)/src/share/vm/c1 25.23 +SOURCE_PATHS=\ 25.24 + $(shell find $(HS_COMMON_SRC)/share/vm/* -type d \! \ 25.25 + \( -name DUMMY $(foreach dir,$(SPECIAL_PATHS),-o -name $(dir)) \)) 25.26 +SOURCE_PATHS+=$(HS_COMMON_SRC)/os/$(Platform_os_family)/vm 25.27 +SOURCE_PATHS+=$(HS_COMMON_SRC)/os/posix/vm 25.28 +SOURCE_PATHS+=$(HS_COMMON_SRC)/cpu/$(Platform_arch)/vm 25.29 +SOURCE_PATHS+=$(HS_COMMON_SRC)/os_cpu/$(Platform_os_arch)/vm 25.30 25.31 -COMPILER2_PATHS := $(GAMMADIR)/src/share/vm/opto 25.32 -COMPILER2_PATHS += $(GAMMADIR)/src/share/vm/libadt 25.33 +CORE_PATHS=$(foreach path,$(SOURCE_PATHS),$(call altsrc,$(path)) $(path)) 25.34 +CORE_PATHS+=$(GENERATED)/jvmtifiles 25.35 + 25.36 +COMPILER1_PATHS := $(call altsrc,$(HS_COMMON_SRC)/share/vm/c1) 25.37 +COMPILER1_PATHS += $(HS_COMMON_SRC)/share/vm/c1 25.38 + 25.39 +COMPILER2_PATHS := $(call altsrc,$(HS_COMMON_SRC)/share/vm/opto) 25.40 +COMPILER2_PATHS += $(call altsrc,$(HS_COMMON_SRC)/share/vm/libadt) 25.41 +COMPILER2_PATHS += $(HS_COMMON_SRC)/share/vm/opto 25.42 +COMPILER2_PATHS += $(HS_COMMON_SRC)/share/vm/libadt 25.43 COMPILER2_PATHS += $(GENERATED)/adfiles 25.44 25.45 # Include dirs per type.
26.1 --- a/make/windows/create_obj_files.sh Fri Feb 11 14:30:27 2011 -0800 26.2 +++ b/make/windows/create_obj_files.sh Fri Feb 11 15:31:58 2011 -0800 26.3 @@ -51,21 +51,48 @@ 26.4 WorkSpace=$4 26.5 GENERATED=$5 26.6 26.7 -BASE_PATHS="` $FIND ${WorkSpace}/src/share/vm ! -name vm -prune -type d \! \( -name adlc -o -name c1 -o -name gc_implementation -o -name opto -o -name shark -o -name libadt \)`" 26.8 -BASE_PATHS="${BASE_PATHS} ${WorkSpace}/src/share/vm/gc_implementation/shared" 26.9 -BASE_PATHS="${BASE_PATHS} ${WorkSpace}/src/os/${Platform_os_family}/vm" 26.10 -BASE_PATHS="${BASE_PATHS} ${WorkSpace}/src/cpu/${Platform_arch}/vm" 26.11 -BASE_PATHS="${BASE_PATHS} ${WorkSpace}/src/os_cpu/${Platform_os_arch}/vm" 26.12 +COMMONSRC_REL=src 26.13 +ALTSRC_REL=src/closed # Change this to pick up alt sources from somewhere else 26.14 + 26.15 +COMMONSRC=${WorkSpace}/${COMMONSRC_REL} 26.16 +ALTSRC=${WorkSpace}/${ALTSRC_REL} 26.17 + 26.18 +BASE_PATHS="`if [ -d ${ALTSRC}/share/vm ]; then $FIND ${ALTSRC}/share/vm ! -name vm -prune -type d \! \( -name adlc -o -name c1 -o -name gc_implementation -o -name opto -o -name shark -o -name libadt \); fi`" 26.19 +BASE_PATHS="${BASE_PATHS} ` $FIND ${COMMONSRC}/share/vm ! -name vm -prune -type d \! \( -name adlc -o -name c1 -o -name gc_implementation -o -name opto -o -name shark -o -name libadt \)`" 26.20 + 26.21 +for sd in \ 26.22 + share/vm/gc_implementation/shared \ 26.23 + os/${Platform_os_family}/vm \ 26.24 + cpu/${Platform_arch}/vm \ 26.25 + os_cpu/${Platform_os_arch}/vm; do 26.26 + if [ -d "${ALTSRC}/${sd}" ]; then 26.27 + BASE_PATHS="${BASE_PATHS} ${ALTSRC}/${sd}" 26.28 + fi 26.29 + BASE_PATHS="${BASE_PATHS} ${COMMONSRC}/${sd}" 26.30 +done 26.31 + 26.32 BASE_PATHS="${BASE_PATHS} ${GENERATED}/jvmtifiles" 26.33 26.34 CORE_PATHS="${BASE_PATHS}" 26.35 # shared is already in BASE_PATHS. Should add vm/memory but that one is also in BASE_PATHS. 26.36 -CORE_PATHS="${CORE_PATHS} `$FIND ${WorkSpace}/src/share/vm/gc_implementation ! -name gc_implementation -prune -type d \! -name shared`" 26.37 +if [ -d "${ALTSRC}/share/vm/gc_implementation" ]; then 26.38 + CORE_PATHS="${CORE_PATHS} `$FIND ${ALTSRC}/share/vm/gc_implementation ! -name gc_implementation -prune -type d \! -name shared`" 26.39 +fi 26.40 +CORE_PATHS="${CORE_PATHS} `$FIND ${COMMONSRC}/share/vm/gc_implementation ! -name gc_implementation -prune -type d \! -name shared`" 26.41 26.42 -COMPILER1_PATHS="${WorkSpace}/src/share/vm/c1" 26.43 +if [ -d "${ALTSRC}/share/vm/c1" ]; then 26.44 + COMPILER1_PATHS="${ALTSRC}/share/vm/c1" 26.45 +fi 26.46 +COMPILER1_PATHS="${COMPILER1_PATHS} ${COMMONSRC}/share/vm/c1" 26.47 26.48 -COMPILER2_PATHS="${WorkSpace}/src/share/vm/opto" 26.49 -COMPILER2_PATHS="${COMPILER2_PATHS} ${WorkSpace}/src/share/vm/libadt" 26.50 +if [ -d "${ALTSRC}/share/vm/opto" ]; then 26.51 + COMPILER2_PATHS="${ALTSRC}/share/vm/opto" 26.52 +fi 26.53 +COMPILER2_PATHS="${COMPILER2_PATHS} ${COMMONSRC}/share/vm/opto" 26.54 +if [ -d "${ALTSRC}/share/vm/libadt" ]; then 26.55 + COMPILER2_PATHS="${COMPILER2_PATHS} ${ALTSRC}/share/vm/libadt" 26.56 +fi 26.57 +COMPILER2_PATHS="${COMPILER2_PATHS} ${COMMONSRC}/share/vm/libadt" 26.58 COMPILER2_PATHS="${COMPILER2_PATHS} ${GENERATED}/adfiles" 26.59 26.60 # Include dirs per type.
27.1 --- a/make/windows/makefiles/vm.make Fri Feb 11 14:30:27 2011 -0800 27.2 +++ b/make/windows/makefiles/vm.make Fri Feb 11 15:31:58 2011 -0800 27.3 @@ -27,6 +27,9 @@ 27.4 27.5 !include ..\generated\objfiles.make 27.6 27.7 +COMMONSRC=$(WorkSpace)\src 27.8 +ALTSRC=$(WorkSpace)\src\closed 27.9 + 27.10 !ifdef RELEASE 27.11 !ifdef DEVELOP 27.12 CPP_FLAGS=$(CPP_FLAGS) /D "DEBUG" 27.13 @@ -111,13 +114,30 @@ 27.14 /export:JVM_GetThreadStateValues \ 27.15 /export:JVM_InitAgentProperties 27.16 27.17 -CPP_INCLUDE_DIRS=\ 27.18 - /I "..\generated" \ 27.19 - /I "$(WorkSpace)\src\share\vm" \ 27.20 - /I "$(WorkSpace)\src\share\vm\prims" \ 27.21 - /I "$(WorkSpace)\src\os\windows\vm" \ 27.22 - /I "$(WorkSpace)\src\os_cpu\windows_$(Platform_arch)\vm" \ 27.23 - /I "$(WorkSpace)\src\cpu\$(Platform_arch)\vm" 27.24 +CPP_INCLUDE_DIRS=/I "..\generated" 27.25 + 27.26 +!if exists($(ALTSRC)\share\vm) 27.27 +CPP_INCLUDE_DIRS=$(CPP_INCLUDE_DIRS) /I "$(ALTSRC)\share\vm" 27.28 +!endif 27.29 + 27.30 +!if exists($(ALTSRC)\os\windows\vm) 27.31 +CPP_INCLUDE_DIRS=$(CPP_INCLUDE_DIRS) /I "$(ALTSRC)\os\windows\vm" 27.32 +!endif 27.33 + 27.34 +!if exists($(ALTSRC)\os_cpu\windows_$(Platform_arch)\vm) 27.35 +CPP_INCLUDE_DIRS=$(CPP_INCLUDE_DIRS) /I "$(ALTSRC)\os_cpu\windows_$(Platform_arch)\vm" 27.36 +!endif 27.37 + 27.38 +!if exists($(ALTSRC)\cpu\$(Platform_arch)\vm) 27.39 +CPP_INCLUDE_DIRS=$(CPP_INCLUDE_DIRS) /I "$(ALTSRC)\cpu\$(Platform_arch)\vm" 27.40 +!endif 27.41 + 27.42 +CPP_INCLUDE_DIRS=$(CPP_INCLUDE_DIRS) \ 27.43 + /I "$(COMMONSRC)\share\vm" \ 27.44 + /I "$(COMMONSRC)\share\vm\prims" \ 27.45 + /I "$(COMMONSRC)\os\windows\vm" \ 27.46 + /I "$(COMMONSRC)\os_cpu\windows_$(Platform_arch)\vm" \ 27.47 + /I "$(COMMONSRC)\cpu\$(Platform_arch)\vm" 27.48 27.49 CPP_DONT_USE_PCH=/D DONT_USE_PRECOMPILED_HEADER 27.50 27.51 @@ -127,7 +147,7 @@ 27.52 CPP_USE_PCH=$(CPP_DONT_USE_PCH) 27.53 !endif 27.54 27.55 -# Where to find the source code for the virtual machine 27.56 +# Where to find the source code for the virtual machine (is this used?) 27.57 VM_PATH=../generated 27.58 VM_PATH=$(VM_PATH);../generated/adfiles 27.59 VM_PATH=$(VM_PATH);../generated/jvmtifiles 27.60 @@ -188,81 +208,157 @@ 27.61 $(CPP) $(CPP_FLAGS) $(CPP_DONT_USE_PCH) /c ..\generated\jvmtifiles\bytecodeInterpreterWithChecks.cpp 27.62 27.63 # Default rules for the Virtual Machine 27.64 -{$(WorkSpace)\src\share\vm\c1}.cpp.obj:: 27.65 +{$(COMMONSRC)\share\vm\c1}.cpp.obj:: 27.66 $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< 27.67 27.68 -{$(WorkSpace)\src\share\vm\compiler}.cpp.obj:: 27.69 +{$(COMMONSRC)\share\vm\compiler}.cpp.obj:: 27.70 $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< 27.71 27.72 -{$(WorkSpace)\src\share\vm\code}.cpp.obj:: 27.73 +{$(COMMONSRC)\share\vm\code}.cpp.obj:: 27.74 $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< 27.75 27.76 -{$(WorkSpace)\src\share\vm\interpreter}.cpp.obj:: 27.77 +{$(COMMONSRC)\share\vm\interpreter}.cpp.obj:: 27.78 $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< 27.79 27.80 -{$(WorkSpace)\src\share\vm\ci}.cpp.obj:: 27.81 +{$(COMMONSRC)\share\vm\ci}.cpp.obj:: 27.82 $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< 27.83 27.84 -{$(WorkSpace)\src\share\vm\classfile}.cpp.obj:: 27.85 +{$(COMMONSRC)\share\vm\classfile}.cpp.obj:: 27.86 $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< 27.87 27.88 -{$(WorkSpace)\src\share\vm\gc_implementation\parallelScavenge}.cpp.obj:: 27.89 +{$(COMMONSRC)\share\vm\gc_implementation\parallelScavenge}.cpp.obj:: 27.90 $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< 27.91 27.92 -{$(WorkSpace)\src\share\vm\gc_implementation\shared}.cpp.obj:: 27.93 +{$(COMMONSRC)\share\vm\gc_implementation\shared}.cpp.obj:: 27.94 $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< 27.95 27.96 -{$(WorkSpace)\src\share\vm\gc_implementation\parNew}.cpp.obj:: 27.97 +{$(COMMONSRC)\share\vm\gc_implementation\parNew}.cpp.obj:: 27.98 $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< 27.99 27.100 -{$(WorkSpace)\src\share\vm\gc_implementation\concurrentMarkSweep}.cpp.obj:: 27.101 +{$(COMMONSRC)\share\vm\gc_implementation\concurrentMarkSweep}.cpp.obj:: 27.102 $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< 27.103 27.104 -{$(WorkSpace)\src\share\vm\gc_implementation\g1}.cpp.obj:: 27.105 +{$(COMMONSRC)\share\vm\gc_implementation\g1}.cpp.obj:: 27.106 $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< 27.107 27.108 -{$(WorkSpace)\src\share\vm\gc_interface}.cpp.obj:: 27.109 +{$(COMMONSRC)\share\vm\gc_interface}.cpp.obj:: 27.110 $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< 27.111 27.112 -{$(WorkSpace)\src\share\vm\asm}.cpp.obj:: 27.113 +{$(COMMONSRC)\share\vm\asm}.cpp.obj:: 27.114 $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< 27.115 27.116 -{$(WorkSpace)\src\share\vm\memory}.cpp.obj:: 27.117 +{$(COMMONSRC)\share\vm\memory}.cpp.obj:: 27.118 $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< 27.119 27.120 -{$(WorkSpace)\src\share\vm\oops}.cpp.obj:: 27.121 +{$(COMMONSRC)\share\vm\oops}.cpp.obj:: 27.122 $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< 27.123 27.124 -{$(WorkSpace)\src\share\vm\prims}.cpp.obj:: 27.125 +{$(COMMONSRC)\share\vm\prims}.cpp.obj:: 27.126 $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< 27.127 27.128 -{$(WorkSpace)\src\share\vm\runtime}.cpp.obj:: 27.129 +{$(COMMONSRC)\share\vm\runtime}.cpp.obj:: 27.130 $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< 27.131 27.132 -{$(WorkSpace)\src\share\vm\services}.cpp.obj:: 27.133 +{$(COMMONSRC)\share\vm\services}.cpp.obj:: 27.134 $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< 27.135 27.136 -{$(WorkSpace)\src\share\vm\utilities}.cpp.obj:: 27.137 +{$(COMMONSRC)\share\vm\utilities}.cpp.obj:: 27.138 $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< 27.139 27.140 -{$(WorkSpace)\src\share\vm\libadt}.cpp.obj:: 27.141 +{$(COMMONSRC)\share\vm\libadt}.cpp.obj:: 27.142 $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< 27.143 27.144 -{$(WorkSpace)\src\share\vm\opto}.cpp.obj:: 27.145 +{$(COMMONSRC)\share\vm\opto}.cpp.obj:: 27.146 $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< 27.147 27.148 -{$(WorkSpace)\src\os\windows\vm}.cpp.obj:: 27.149 +{$(COMMONSRC)\os\windows\vm}.cpp.obj:: 27.150 $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< 27.151 27.152 # This guy should remain a single colon rule because 27.153 # otherwise we can't specify the output filename. 27.154 -{$(WorkSpace)\src\os\windows\vm}.rc.res: 27.155 +{$(COMMONSRC)\os\windows\vm}.rc.res: 27.156 @$(RC) $(RC_FLAGS) /fo"$@" $< 27.157 27.158 -{$(WorkSpace)\src\cpu\$(Platform_arch)\vm}.cpp.obj:: 27.159 +{$(COMMONSRC)\cpu\$(Platform_arch)\vm}.cpp.obj:: 27.160 $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< 27.161 27.162 -{$(WorkSpace)\src\os_cpu\windows_$(Platform_arch)\vm}.cpp.obj:: 27.163 +{$(COMMONSRC)\os_cpu\windows_$(Platform_arch)\vm}.cpp.obj:: 27.164 + $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< 27.165 + 27.166 +{$(ALTSRC)\share\vm\c1}.cpp.obj:: 27.167 + $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< 27.168 + 27.169 +{$(ALTSRC)\share\vm\compiler}.cpp.obj:: 27.170 + $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< 27.171 + 27.172 +{$(ALTSRC)\share\vm\code}.cpp.obj:: 27.173 + $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< 27.174 + 27.175 +{$(ALTSRC)\share\vm\interpreter}.cpp.obj:: 27.176 + $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< 27.177 + 27.178 +{$(ALTSRC)\share\vm\ci}.cpp.obj:: 27.179 + $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< 27.180 + 27.181 +{$(ALTSRC)\share\vm\classfile}.cpp.obj:: 27.182 + $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< 27.183 + 27.184 +{$(ALTSRC)\share\vm\gc_implementation\parallelScavenge}.cpp.obj:: 27.185 + $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< 27.186 + 27.187 +{$(ALTSRC)\share\vm\gc_implementation\shared}.cpp.obj:: 27.188 + $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< 27.189 + 27.190 +{$(ALTSRC)\share\vm\gc_implementation\parNew}.cpp.obj:: 27.191 + $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< 27.192 + 27.193 +{$(ALTSRC)\share\vm\gc_implementation\concurrentMarkSweep}.cpp.obj:: 27.194 + $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< 27.195 + 27.196 +{$(ALTSRC)\share\vm\gc_implementation\g1}.cpp.obj:: 27.197 + $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< 27.198 + 27.199 +{$(ALTSRC)\share\vm\gc_interface}.cpp.obj:: 27.200 + $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< 27.201 + 27.202 +{$(ALTSRC)\share\vm\asm}.cpp.obj:: 27.203 + $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< 27.204 + 27.205 +{$(ALTSRC)\share\vm\memory}.cpp.obj:: 27.206 + $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< 27.207 + 27.208 +{$(ALTSRC)\share\vm\oops}.cpp.obj:: 27.209 + $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< 27.210 + 27.211 +{$(ALTSRC)\share\vm\prims}.cpp.obj:: 27.212 + $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< 27.213 + 27.214 +{$(ALTSRC)\share\vm\runtime}.cpp.obj:: 27.215 + $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< 27.216 + 27.217 +{$(ALTSRC)\share\vm\services}.cpp.obj:: 27.218 + $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< 27.219 + 27.220 +{$(ALTSRC)\share\vm\utilities}.cpp.obj:: 27.221 + $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< 27.222 + 27.223 +{$(ALTSRC)\share\vm\libadt}.cpp.obj:: 27.224 + $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< 27.225 + 27.226 +{$(ALTSRC)\share\vm\opto}.cpp.obj:: 27.227 + $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< 27.228 + 27.229 +{$(ALTSRC)\os\windows\vm}.cpp.obj:: 27.230 + $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< 27.231 + 27.232 +# otherwise we can't specify the output filename. 27.233 +{$(ALTSRC)\os\windows\vm}.rc.res: 27.234 + @$(RC) $(RC_FLAGS) /fo"$@" $< 27.235 + 27.236 +{$(ALTSRC)\cpu\$(Platform_arch)\vm}.cpp.obj:: 27.237 + $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< 27.238 + 27.239 +{$(ALTSRC)\os_cpu\windows_$(Platform_arch)\vm}.cpp.obj:: 27.240 $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< 27.241 27.242 {..\generated\incls}.cpp.obj::
28.1 --- a/src/cpu/sparc/vm/jni_sparc.h Fri Feb 11 14:30:27 2011 -0800 28.2 +++ b/src/cpu/sparc/vm/jni_sparc.h Fri Feb 11 15:31:58 2011 -0800 28.3 @@ -23,8 +23,13 @@ 28.4 * questions. 28.5 */ 28.6 28.7 -#define JNIEXPORT 28.8 -#define JNIIMPORT 28.9 +#if defined(__GNUC__) && (__GNUC__ >= 4) 28.10 + #define JNIEXPORT __attribute__((visibility("default"))) 28.11 + #define JNIIMPORT __attribute__((visibility("default"))) 28.12 +#else 28.13 + #define JNIEXPORT 28.14 + #define JNIIMPORT 28.15 +#endif 28.16 #define JNICALL 28.17 28.18 typedef int jint;
29.1 --- a/src/cpu/x86/vm/jni_x86.h Fri Feb 11 14:30:27 2011 -0800 29.2 +++ b/src/cpu/x86/vm/jni_x86.h Fri Feb 11 15:31:58 2011 -0800 29.3 @@ -27,10 +27,16 @@ 29.4 #define _JAVASOFT_JNI_MD_H_ 29.5 29.6 #if defined(SOLARIS) || defined(LINUX) 29.7 + 29.8 +#if defined(__GNUC__) && (__GNUC__ > 4) || (__GNUC__ == 4) && (__GNUC_MINOR__ > 2) 29.9 + #define JNIEXPORT __attribute__((visibility("default"))) 29.10 + #define JNIIMPORT __attribute__((visibility("default"))) 29.11 +#else 29.12 #define JNIEXPORT 29.13 #define JNIIMPORT 29.14 +#endif 29.15 + 29.16 #define JNICALL 29.17 - 29.18 typedef int jint; 29.19 29.20 #ifdef _LP64
30.1 --- a/src/cpu/zero/vm/jni_zero.h Fri Feb 11 14:30:27 2011 -0800 30.2 +++ b/src/cpu/zero/vm/jni_zero.h Fri Feb 11 15:31:58 2011 -0800 30.3 @@ -24,8 +24,14 @@ 30.4 * questions. 30.5 */ 30.6 30.7 -#define JNIEXPORT 30.8 -#define JNIIMPORT 30.9 + 30.10 +#if defined(__GNUC__) && (__GNUC__ >= 4) 30.11 + #define JNIEXPORT __attribute__((visibility("default"))) 30.12 + #define JNIIMPORT __attribute__((visibility("default"))) 30.13 +#else 30.14 + #define JNIEXPORT 30.15 + #define JNIIMPORT 30.16 +#endif 30.17 #define JNICALL 30.18 30.19 typedef int jint;
31.1 --- a/src/os/linux/vm/jvm_linux.cpp Fri Feb 11 14:30:27 2011 -0800 31.2 +++ b/src/os/linux/vm/jvm_linux.cpp Fri Feb 11 15:31:58 2011 -0800 31.3 @@ -29,11 +29,6 @@ 31.4 31.5 #include <signal.h> 31.6 31.7 -/* 31.8 - * FIXME: This is temporary hack to keep Linux Runtime.exec() 31.9 - * code happy. See $JDK/src/linux/native/java/lang/UnixProcess_md.c 31.10 - */ 31.11 -int _JVM_native_threads = 1; 31.12 31.13 // sun.misc.Signal /////////////////////////////////////////////////////////// 31.14 // Signal code is mostly copied from classic vm, signals_md.c 1.4 98/08/23
32.1 --- a/src/os/linux/vm/osThread_linux.cpp Fri Feb 11 14:30:27 2011 -0800 32.2 +++ b/src/os/linux/vm/osThread_linux.cpp Fri Feb 11 15:31:58 2011 -0800 32.3 @@ -39,6 +39,12 @@ 32.4 #ifdef TARGET_ARCH_zero 32.5 # include "assembler_zero.inline.hpp" 32.6 #endif 32.7 +#ifdef TARGET_ARCH_arm 32.8 +# include "assembler_arm.inline.hpp" 32.9 +#endif 32.10 +#ifdef TARGET_ARCH_ppc 32.11 +# include "assembler_ppc.inline.hpp" 32.12 +#endif 32.13 32.14 32.15 void OSThread::pd_initialize() {
33.1 --- a/src/os/linux/vm/os_linux.cpp Fri Feb 11 14:30:27 2011 -0800 33.2 +++ b/src/os/linux/vm/os_linux.cpp Fri Feb 11 15:31:58 2011 -0800 33.3 @@ -1,5 +1,5 @@ 33.4 /* 33.5 - * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. 33.6 + * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. 33.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 33.8 * 33.9 * This code is free software; you can redistribute it and/or modify it 33.10 @@ -76,6 +76,14 @@ 33.11 # include "assembler_zero.inline.hpp" 33.12 # include "nativeInst_zero.hpp" 33.13 #endif 33.14 +#ifdef TARGET_ARCH_arm 33.15 +# include "assembler_arm.inline.hpp" 33.16 +# include "nativeInst_arm.hpp" 33.17 +#endif 33.18 +#ifdef TARGET_ARCH_ppc 33.19 +# include "assembler_ppc.inline.hpp" 33.20 +# include "nativeInst_ppc.hpp" 33.21 +#endif 33.22 #ifdef COMPILER1 33.23 #include "c1/c1_Runtime1.hpp" 33.24 #endif 33.25 @@ -123,6 +131,7 @@ 33.26 #define ALL_64_BITS CONST64(0xFFFFFFFFFFFFFFFF) 33.27 #define SEC_IN_NANOSECS 1000000000LL 33.28 33.29 +#define LARGEPAGES_BIT (1 << 6) 33.30 //////////////////////////////////////////////////////////////////////////////// 33.31 // global variables 33.32 julong os::Linux::_physical_memory = 0; 33.33 @@ -2509,8 +2518,10 @@ 33.34 return end; 33.35 } 33.36 33.37 -extern "C" void numa_warn(int number, char *where, ...) { } 33.38 -extern "C" void numa_error(char *where) { } 33.39 +// Something to do with the numa-aware allocator needs these symbols 33.40 +extern "C" JNIEXPORT void numa_warn(int number, char *where, ...) { } 33.41 +extern "C" JNIEXPORT void numa_error(char *where) { } 33.42 +extern "C" JNIEXPORT int fork1() { return fork(); } 33.43 33.44 33.45 // If we are running with libnuma version > 2, then we should 33.46 @@ -2807,6 +2818,43 @@ 33.47 return linux_mprotect(addr, size, PROT_READ|PROT_WRITE); 33.48 } 33.49 33.50 +/* 33.51 +* Set the coredump_filter bits to include largepages in core dump (bit 6) 33.52 +* 33.53 +* From the coredump_filter documentation: 33.54 +* 33.55 +* - (bit 0) anonymous private memory 33.56 +* - (bit 1) anonymous shared memory 33.57 +* - (bit 2) file-backed private memory 33.58 +* - (bit 3) file-backed shared memory 33.59 +* - (bit 4) ELF header pages in file-backed private memory areas (it is 33.60 +* effective only if the bit 2 is cleared) 33.61 +* - (bit 5) hugetlb private memory 33.62 +* - (bit 6) hugetlb shared memory 33.63 +*/ 33.64 +static void set_coredump_filter(void) { 33.65 + FILE *f; 33.66 + long cdm; 33.67 + 33.68 + if ((f = fopen("/proc/self/coredump_filter", "r+")) == NULL) { 33.69 + return; 33.70 + } 33.71 + 33.72 + if (fscanf(f, "%lx", &cdm) != 1) { 33.73 + fclose(f); 33.74 + return; 33.75 + } 33.76 + 33.77 + rewind(f); 33.78 + 33.79 + if ((cdm & LARGEPAGES_BIT) == 0) { 33.80 + cdm |= LARGEPAGES_BIT; 33.81 + fprintf(f, "%#lx", cdm); 33.82 + } 33.83 + 33.84 + fclose(f); 33.85 +} 33.86 + 33.87 // Large page support 33.88 33.89 static size_t _large_page_size = 0; 33.90 @@ -2864,6 +2912,8 @@ 33.91 _page_sizes[2] = 0; 33.92 } 33.93 33.94 + set_coredump_filter(); 33.95 + 33.96 // Large page support is available on 2.6 or newer kernel, some vendors 33.97 // (e.g. Redhat) have backported it to their 2.4 based distributions. 33.98 // We optimistically assume the support is available. If later it turns out 33.99 @@ -3483,7 +3533,7 @@ 33.100 // Note that the VM will print warnings if it detects conflicting signal 33.101 // handlers, unless invoked with the option "-XX:+AllowUserSignalHandlers". 33.102 // 33.103 -extern "C" int 33.104 +extern "C" JNIEXPORT int 33.105 JVM_handle_linux_signal(int signo, siginfo_t* siginfo, 33.106 void* ucontext, int abort_if_unrecognized); 33.107 33.108 @@ -4678,44 +4728,6 @@ 33.109 } 33.110 } 33.111 33.112 -extern "C" { 33.113 - 33.114 -/** 33.115 - * NOTE: the following code is to keep the green threads code 33.116 - * in the libjava.so happy. Once the green threads is removed, 33.117 - * these code will no longer be needed. 33.118 - */ 33.119 -int 33.120 -jdk_waitpid(pid_t pid, int* status, int options) { 33.121 - return waitpid(pid, status, options); 33.122 -} 33.123 - 33.124 -int 33.125 -fork1() { 33.126 - return fork(); 33.127 -} 33.128 - 33.129 -int 33.130 -jdk_sem_init(sem_t *sem, int pshared, unsigned int value) { 33.131 - return sem_init(sem, pshared, value); 33.132 -} 33.133 - 33.134 -int 33.135 -jdk_sem_post(sem_t *sem) { 33.136 - return sem_post(sem); 33.137 -} 33.138 - 33.139 -int 33.140 -jdk_sem_wait(sem_t *sem) { 33.141 - return sem_wait(sem); 33.142 -} 33.143 - 33.144 -int 33.145 -jdk_pthread_sigmask(int how , const sigset_t* newmask, sigset_t* oldmask) { 33.146 - return pthread_sigmask(how , newmask, oldmask); 33.147 -} 33.148 - 33.149 -} 33.150 33.151 // Refer to the comments in os_solaris.cpp park-unpark. 33.152 //
34.1 --- a/src/os/linux/vm/os_linux.inline.hpp Fri Feb 11 14:30:27 2011 -0800 34.2 +++ b/src/os/linux/vm/os_linux.inline.hpp Fri Feb 11 15:31:58 2011 -0800 34.3 @@ -39,6 +39,14 @@ 34.4 # include "atomic_linux_zero.inline.hpp" 34.5 # include "orderAccess_linux_zero.inline.hpp" 34.6 #endif 34.7 +#ifdef TARGET_OS_ARCH_linux_arm 34.8 +# include "atomic_linux_arm.inline.hpp" 34.9 +# include "orderAccess_linux_arm.inline.hpp" 34.10 +#endif 34.11 +#ifdef TARGET_OS_ARCH_linux_ppc 34.12 +# include "atomic_linux_ppc.inline.hpp" 34.13 +# include "orderAccess_linux_ppc.inline.hpp" 34.14 +#endif 34.15 34.16 // System includes 34.17
35.1 --- a/src/os/linux/vm/thread_linux.inline.hpp Fri Feb 11 14:30:27 2011 -0800 35.2 +++ b/src/os/linux/vm/thread_linux.inline.hpp Fri Feb 11 15:31:58 2011 -0800 35.3 @@ -44,6 +44,16 @@ 35.4 # include "orderAccess_linux_zero.inline.hpp" 35.5 # include "prefetch_linux_zero.inline.hpp" 35.6 #endif 35.7 +#ifdef TARGET_OS_ARCH_linux_arm 35.8 +# include "atomic_linux_arm.inline.hpp" 35.9 +# include "orderAccess_linux_arm.inline.hpp" 35.10 +# include "prefetch_linux_arm.inline.hpp" 35.11 +#endif 35.12 +#ifdef TARGET_OS_ARCH_linux_ppc 35.13 +# include "atomic_linux_ppc.inline.hpp" 35.14 +# include "orderAccess_linux_ppc.inline.hpp" 35.15 +# include "prefetch_linux_ppc.inline.hpp" 35.16 +#endif 35.17 35.18 // Contains inlined functions for class Thread and ThreadLocalStorage 35.19
36.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 36.2 +++ b/src/os/posix/vm/os_posix.cpp Fri Feb 11 15:31:58 2011 -0800 36.3 @@ -0,0 +1,61 @@ 36.4 +/* 36.5 +* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. 36.6 +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 36.7 +* 36.8 +* This code is free software; you can redistribute it and/or modify it 36.9 +* under the terms of the GNU General Public License version 2 only, as 36.10 +* published by the Free Software Foundation. 36.11 +* 36.12 +* This code is distributed in the hope that it will be useful, but WITHOUT 36.13 +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 36.14 +* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 36.15 +* version 2 for more details (a copy is included in the LICENSE file that 36.16 +* accompanied this code). 36.17 +* 36.18 +* You should have received a copy of the GNU General Public License version 36.19 +* 2 along with this work; if not, write to the Free Software Foundation, 36.20 +* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 36.21 +* 36.22 +* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 36.23 +* or visit www.oracle.com if you need additional information or have any 36.24 +* questions. 36.25 +* 36.26 +*/ 36.27 + 36.28 +#include "prims/jvm.h" 36.29 +#include "runtime/os.hpp" 36.30 +#include "utilities/vmError.hpp" 36.31 + 36.32 +#include <unistd.h> 36.33 +#include <sys/resource.h> 36.34 + 36.35 +// Check core dump limit and report possible place where core can be found 36.36 +void os::check_or_create_dump(void* exceptionRecord, void* contextRecord, char* buffer, size_t bufferSize) { 36.37 + struct rlimit rlim; 36.38 + static char cwd[O_BUFLEN]; 36.39 + bool success; 36.40 + 36.41 + get_current_directory(cwd, sizeof(cwd)); 36.42 + 36.43 + if (getrlimit(RLIMIT_CORE, &rlim) != 0) { 36.44 + jio_snprintf(buffer, bufferSize, "%s/core or core.%d (may not exist)", cwd, current_process_id()); 36.45 + success = true; 36.46 + } else { 36.47 + switch(rlim.rlim_cur) { 36.48 + case RLIM_INFINITY: 36.49 + jio_snprintf(buffer, bufferSize, "%s/core or core.%d", cwd, current_process_id()); 36.50 + success = true; 36.51 + break; 36.52 + case 0: 36.53 + jio_snprintf(buffer, bufferSize, "Core dumps have been disabled. To enable core dumping, try \"ulimit -c unlimited\" before starting Java again"); 36.54 + success = false; 36.55 + break; 36.56 + default: 36.57 + jio_snprintf(buffer, bufferSize, "%s/core or core.%d (max size %lu kB). To ensure a full core dump, try \"ulimit -c unlimited\" before starting Java again", cwd, current_process_id(), (unsigned long)(rlim.rlim_cur >> 10)); 36.58 + success = true; 36.59 + break; 36.60 + } 36.61 + } 36.62 + VMError::report_coredump_status(buffer, success); 36.63 +} 36.64 +
37.1 --- a/src/os/solaris/vm/os_solaris.cpp Fri Feb 11 14:30:27 2011 -0800 37.2 +++ b/src/os/solaris/vm/os_solaris.cpp Fri Feb 11 15:31:58 2011 -0800 37.3 @@ -4221,7 +4221,9 @@ 37.4 // Note that the VM will print warnings if it detects conflicting signal 37.5 // handlers, unless invoked with the option "-XX:+AllowUserSignalHandlers". 37.6 // 37.7 -extern "C" int JVM_handle_solaris_signal(int signo, siginfo_t* siginfo, void* ucontext, int abort_if_unrecognized); 37.8 +extern "C" JNIEXPORT int 37.9 +JVM_handle_solaris_signal(int signo, siginfo_t* siginfo, void* ucontext, 37.10 + int abort_if_unrecognized); 37.11 37.12 37.13 void signalHandler(int sig, siginfo_t* info, void* ucVoid) {
38.1 --- a/src/os/windows/vm/os_windows.cpp Fri Feb 11 14:30:27 2011 -0800 38.2 +++ b/src/os/windows/vm/os_windows.cpp Fri Feb 11 15:31:58 2011 -0800 38.3 @@ -1,5 +1,5 @@ 38.4 /* 38.5 - * CopyrighT (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 38.6 + * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. 38.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 38.8 * 38.9 * This code is free software; you can redistribute it and/or modify it 38.10 @@ -915,6 +915,85 @@ 38.11 } 38.12 } 38.13 38.14 + 38.15 +static BOOL (WINAPI *_MiniDumpWriteDump) ( HANDLE, DWORD, HANDLE, MINIDUMP_TYPE, PMINIDUMP_EXCEPTION_INFORMATION, 38.16 + PMINIDUMP_USER_STREAM_INFORMATION, PMINIDUMP_CALLBACK_INFORMATION); 38.17 + 38.18 +void os::check_or_create_dump(void* exceptionRecord, void* contextRecord, char* buffer, size_t bufferSize) { 38.19 + HINSTANCE dbghelp; 38.20 + EXCEPTION_POINTERS ep; 38.21 + MINIDUMP_EXCEPTION_INFORMATION mei; 38.22 + HANDLE hProcess = GetCurrentProcess(); 38.23 + DWORD processId = GetCurrentProcessId(); 38.24 + HANDLE dumpFile; 38.25 + MINIDUMP_TYPE dumpType; 38.26 + static const char* cwd; 38.27 + 38.28 + // If running on a client version of Windows and user has not explicitly enabled dumping 38.29 + if (!os::win32::is_windows_server() && !CreateMinidumpOnCrash) { 38.30 + VMError::report_coredump_status("Minidumps are not enabled by default on client versions of Windows", false); 38.31 + return; 38.32 + // If running on a server version of Windows and user has explictly disabled dumping 38.33 + } else if (os::win32::is_windows_server() && !FLAG_IS_DEFAULT(CreateMinidumpOnCrash) && !CreateMinidumpOnCrash) { 38.34 + VMError::report_coredump_status("Minidump has been disabled from the command line", false); 38.35 + return; 38.36 + } 38.37 + 38.38 + dbghelp = LoadLibrary("DBGHELP.DLL"); 38.39 + 38.40 + if (dbghelp == NULL) { 38.41 + VMError::report_coredump_status("Failed to load dbghelp.dll", false); 38.42 + return; 38.43 + } 38.44 + 38.45 + _MiniDumpWriteDump = CAST_TO_FN_PTR( 38.46 + BOOL(WINAPI *)( HANDLE, DWORD, HANDLE, MINIDUMP_TYPE, PMINIDUMP_EXCEPTION_INFORMATION, 38.47 + PMINIDUMP_USER_STREAM_INFORMATION, PMINIDUMP_CALLBACK_INFORMATION), 38.48 + GetProcAddress(dbghelp, "MiniDumpWriteDump")); 38.49 + 38.50 + if (_MiniDumpWriteDump == NULL) { 38.51 + VMError::report_coredump_status("Failed to find MiniDumpWriteDump() in module dbghelp.dll", false); 38.52 + return; 38.53 + } 38.54 + 38.55 + dumpType = (MINIDUMP_TYPE)(MiniDumpWithFullMemory | MiniDumpWithHandleData); 38.56 + 38.57 +// Older versions of dbghelp.h doesn't contain all the dumptypes we want, dbghelp.h with 38.58 +// API_VERSION_NUMBER 11 or higher contains the ones we want though 38.59 +#if API_VERSION_NUMBER >= 11 38.60 + dumpType = (MINIDUMP_TYPE)(dumpType | MiniDumpWithFullMemoryInfo | MiniDumpWithThreadInfo | 38.61 + MiniDumpWithUnloadedModules); 38.62 +#endif 38.63 + 38.64 + cwd = get_current_directory(NULL, 0); 38.65 + jio_snprintf(buffer, bufferSize, "%s\\hs_err_pid%u.mdmp",cwd, current_process_id()); 38.66 + dumpFile = CreateFile(buffer, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); 38.67 + 38.68 + if (dumpFile == INVALID_HANDLE_VALUE) { 38.69 + VMError::report_coredump_status("Failed to create file for dumping", false); 38.70 + return; 38.71 + } 38.72 + 38.73 + ep.ContextRecord = (PCONTEXT) contextRecord; 38.74 + ep.ExceptionRecord = (PEXCEPTION_RECORD) exceptionRecord; 38.75 + 38.76 + mei.ThreadId = GetCurrentThreadId(); 38.77 + mei.ExceptionPointers = &ep; 38.78 + 38.79 + // Older versions of dbghelp.dll (the one shipped with Win2003 for example) may not support all 38.80 + // the dump types we really want. If first call fails, lets fall back to just use MiniDumpWithFullMemory then. 38.81 + if (_MiniDumpWriteDump(hProcess, processId, dumpFile, dumpType, &mei, NULL, NULL) == false && 38.82 + _MiniDumpWriteDump(hProcess, processId, dumpFile, (MINIDUMP_TYPE)MiniDumpWithFullMemory, &mei, NULL, NULL) == false) { 38.83 + VMError::report_coredump_status("Call to MiniDumpWriteDump() failed", false); 38.84 + } else { 38.85 + VMError::report_coredump_status(buffer, true); 38.86 + } 38.87 + 38.88 + CloseHandle(dumpFile); 38.89 +} 38.90 + 38.91 + 38.92 + 38.93 void os::abort(bool dump_core) 38.94 { 38.95 os::shutdown(); 38.96 @@ -3274,7 +3353,7 @@ 38.97 38.98 bool os::win32::_is_nt = false; 38.99 bool os::win32::_is_windows_2003 = false; 38.100 - 38.101 +bool os::win32::_is_windows_server = false; 38.102 38.103 void os::win32::initialize_system_info() { 38.104 SYSTEM_INFO si; 38.105 @@ -3293,9 +3372,9 @@ 38.106 GlobalMemoryStatusEx(&ms); 38.107 _physical_memory = ms.ullTotalPhys; 38.108 38.109 - OSVERSIONINFO oi; 38.110 - oi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); 38.111 - GetVersionEx(&oi); 38.112 + OSVERSIONINFOEX oi; 38.113 + oi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); 38.114 + GetVersionEx((OSVERSIONINFO*)&oi); 38.115 switch(oi.dwPlatformId) { 38.116 case VER_PLATFORM_WIN32_WINDOWS: _is_nt = false; break; 38.117 case VER_PLATFORM_WIN32_NT: 38.118 @@ -3305,6 +3384,10 @@ 38.119 if (os_vers == 5002) { 38.120 _is_windows_2003 = true; 38.121 } 38.122 + if (oi.wProductType == VER_NT_DOMAIN_CONTROLLER || 38.123 + oi.wProductType == VER_NT_SERVER) { 38.124 + _is_windows_server = true; 38.125 + } 38.126 } 38.127 break; 38.128 default: fatal("Unknown platform");
39.1 --- a/src/os/windows/vm/os_windows.hpp Fri Feb 11 14:30:27 2011 -0800 39.2 +++ b/src/os/windows/vm/os_windows.hpp Fri Feb 11 15:31:58 2011 -0800 39.3 @@ -1,5 +1,5 @@ 39.4 /* 39.5 - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 39.6 + * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. 39.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 39.8 * 39.9 * This code is free software; you can redistribute it and/or modify it 39.10 @@ -38,6 +38,7 @@ 39.11 static size_t _default_stack_size; 39.12 static bool _is_nt; 39.13 static bool _is_windows_2003; 39.14 + static bool _is_windows_server; 39.15 39.16 public: 39.17 // Windows-specific interface: 39.18 @@ -64,6 +65,9 @@ 39.19 // Tells whether the platform is NT or Windown95 39.20 static bool is_nt() { return _is_nt; } 39.21 39.22 + // Tells whether this is a server version of Windows 39.23 + static bool is_windows_server() { return _is_windows_server; } 39.24 + 39.25 // Tells whether the platform is Windows 2003 39.26 static bool is_windows_2003() { return _is_windows_2003; } 39.27
40.1 --- a/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp Fri Feb 11 14:30:27 2011 -0800 40.2 +++ b/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp Fri Feb 11 15:31:58 2011 -0800 40.3 @@ -542,7 +542,7 @@ 40.4 return false; 40.5 } 40.6 40.7 -extern "C" int 40.8 +extern "C" JNIEXPORT int 40.9 JVM_handle_linux_signal(int sig, 40.10 siginfo_t* info, 40.11 void* ucVoid,
41.1 --- a/src/os_cpu/linux_x86/vm/os_linux_x86.cpp Fri Feb 11 14:30:27 2011 -0800 41.2 +++ b/src/os_cpu/linux_x86/vm/os_linux_x86.cpp Fri Feb 11 15:31:58 2011 -0800 41.3 @@ -216,7 +216,7 @@ 41.4 extern "C" void FetchNResume () ; 41.5 #endif // AMD64 41.6 41.7 -extern "C" int 41.8 +extern "C" JNIEXPORT int 41.9 JVM_handle_linux_signal(int sig, 41.10 siginfo_t* info, 41.11 void* ucVoid,
42.1 --- a/src/os_cpu/linux_zero/vm/os_linux_zero.cpp Fri Feb 11 14:30:27 2011 -0800 42.2 +++ b/src/os_cpu/linux_zero/vm/os_linux_zero.cpp Fri Feb 11 15:31:58 2011 -0800 42.3 @@ -116,7 +116,7 @@ 42.4 ShouldNotCallThis(); 42.5 } 42.6 42.7 -extern "C" int 42.8 +extern "C" JNIEXPORT int 42.9 JVM_handle_linux_signal(int sig, 42.10 siginfo_t* info, 42.11 void* ucVoid,
43.1 --- a/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp Fri Feb 11 14:30:27 2011 -0800 43.2 +++ b/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp Fri Feb 11 15:31:58 2011 -0800 43.3 @@ -317,9 +317,9 @@ 43.4 extern "C" void FetchNPFI () ; 43.5 extern "C" void FetchNResume () ; 43.6 43.7 -extern "C" int JVM_handle_solaris_signal(int signo, siginfo_t* siginfo, void* ucontext, int abort_if_unrecognized); 43.8 - 43.9 -int JVM_handle_solaris_signal(int sig, siginfo_t* info, void* ucVoid, int abort_if_unrecognized) { 43.10 +extern "C" JNIEXPORT int 43.11 +JVM_handle_solaris_signal(int sig, siginfo_t* info, void* ucVoid, 43.12 + int abort_if_unrecognized) { 43.13 ucontext_t* uc = (ucontext_t*) ucVoid; 43.14 43.15 Thread* t = ThreadLocalStorage::get_thread_slow();
44.1 --- a/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp Fri Feb 11 14:30:27 2011 -0800 44.2 +++ b/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp Fri Feb 11 15:31:58 2011 -0800 44.3 @@ -365,8 +365,6 @@ 44.4 44.5 } 44.6 44.7 -extern "C" int JVM_handle_solaris_signal(int signo, siginfo_t* siginfo, void* ucontext, int abort_if_unrecognized); 44.8 - 44.9 extern "C" void Fetch32PFI () ; 44.10 extern "C" void Fetch32Resume () ; 44.11 #ifdef AMD64 44.12 @@ -374,7 +372,9 @@ 44.13 extern "C" void FetchNResume () ; 44.14 #endif // AMD64 44.15 44.16 -int JVM_handle_solaris_signal(int sig, siginfo_t* info, void* ucVoid, int abort_if_unrecognized) { 44.17 +extern "C" JNIEXPORT int 44.18 +JVM_handle_solaris_signal(int sig, siginfo_t* info, void* ucVoid, 44.19 + int abort_if_unrecognized) { 44.20 ucontext_t* uc = (ucontext_t*) ucVoid; 44.21 44.22 #ifndef AMD64
45.1 --- a/src/share/vm/asm/assembler.cpp Fri Feb 11 14:30:27 2011 -0800 45.2 +++ b/src/share/vm/asm/assembler.cpp Fri Feb 11 15:31:58 2011 -0800 45.3 @@ -37,6 +37,12 @@ 45.4 #ifdef TARGET_ARCH_zero 45.5 # include "assembler_zero.inline.hpp" 45.6 #endif 45.7 +#ifdef TARGET_ARCH_arm 45.8 +# include "assembler_arm.inline.hpp" 45.9 +#endif 45.10 +#ifdef TARGET_ARCH_ppc 45.11 +# include "assembler_ppc.inline.hpp" 45.12 +#endif 45.13 45.14 45.15 // Implementation of AbstractAssembler
46.1 --- a/src/share/vm/asm/assembler.hpp Fri Feb 11 14:30:27 2011 -0800 46.2 +++ b/src/share/vm/asm/assembler.hpp Fri Feb 11 15:31:58 2011 -0800 46.3 @@ -43,6 +43,14 @@ 46.4 # include "register_zero.hpp" 46.5 # include "vm_version_zero.hpp" 46.6 #endif 46.7 +#ifdef TARGET_ARCH_arm 46.8 +# include "register_arm.hpp" 46.9 +# include "vm_version_arm.hpp" 46.10 +#endif 46.11 +#ifdef TARGET_ARCH_ppc 46.12 +# include "register_ppc.hpp" 46.13 +# include "vm_version_ppc.hpp" 46.14 +#endif 46.15 46.16 // This file contains platform-independent assembler declarations. 46.17 46.18 @@ -395,6 +403,12 @@ 46.19 #ifdef TARGET_ARCH_zero 46.20 # include "assembler_zero.hpp" 46.21 #endif 46.22 +#ifdef TARGET_ARCH_arm 46.23 +# include "assembler_arm.hpp" 46.24 +#endif 46.25 +#ifdef TARGET_ARCH_ppc 46.26 +# include "assembler_ppc.hpp" 46.27 +#endif 46.28 46.29 46.30 #endif // SHARE_VM_ASM_ASSEMBLER_HPP
47.1 --- a/src/share/vm/asm/codeBuffer.hpp Fri Feb 11 14:30:27 2011 -0800 47.2 +++ b/src/share/vm/asm/codeBuffer.hpp Fri Feb 11 15:31:58 2011 -0800 47.3 @@ -566,6 +566,12 @@ 47.4 #ifdef TARGET_ARCH_zero 47.5 # include "codeBuffer_zero.hpp" 47.6 #endif 47.7 +#ifdef TARGET_ARCH_arm 47.8 +# include "codeBuffer_arm.hpp" 47.9 +#endif 47.10 +#ifdef TARGET_ARCH_ppc 47.11 +# include "codeBuffer_ppc.hpp" 47.12 +#endif 47.13 47.14 }; 47.15
48.1 --- a/src/share/vm/c1/c1_Defs.hpp Fri Feb 11 14:30:27 2011 -0800 48.2 +++ b/src/share/vm/c1/c1_Defs.hpp Fri Feb 11 15:31:58 2011 -0800 48.3 @@ -35,6 +35,12 @@ 48.4 #ifdef TARGET_ARCH_zero 48.5 # include "register_zero.hpp" 48.6 #endif 48.7 +#ifdef TARGET_ARCH_arm 48.8 +# include "register_arm.hpp" 48.9 +#endif 48.10 +#ifdef TARGET_ARCH_ppc 48.11 +# include "register_ppc.hpp" 48.12 +#endif 48.13 48.14 // set frame size and return address offset to these values in blobs 48.15 // (if the compiled frame uses ebp as link pointer on IA; otherwise, 48.16 @@ -50,6 +56,12 @@ 48.17 #ifdef TARGET_ARCH_sparc 48.18 # include "c1_Defs_sparc.hpp" 48.19 #endif 48.20 +#ifdef TARGET_ARCH_arm 48.21 +# include "c1_Defs_arm.hpp" 48.22 +#endif 48.23 +#ifdef TARGET_ARCH_ppc 48.24 +# include "c1_Defs_ppc.hpp" 48.25 +#endif 48.26 48.27 48.28 // native word offsets from memory address
49.1 --- a/src/share/vm/c1/c1_FpuStackSim.hpp Fri Feb 11 14:30:27 2011 -0800 49.2 +++ b/src/share/vm/c1/c1_FpuStackSim.hpp Fri Feb 11 15:31:58 2011 -0800 49.3 @@ -38,6 +38,12 @@ 49.4 #ifdef TARGET_ARCH_sparc 49.5 # include "c1_FpuStackSim_sparc.hpp" 49.6 #endif 49.7 +#ifdef TARGET_ARCH_arm 49.8 +# include "c1_FpuStackSim_arm.hpp" 49.9 +#endif 49.10 +#ifdef TARGET_ARCH_ppc 49.11 +# include "c1_FpuStackSim_ppc.hpp" 49.12 +#endif 49.13 49.14 49.15 #endif // SHARE_VM_C1_C1_FPUSTACKSIM_HPP
50.1 --- a/src/share/vm/c1/c1_FrameMap.cpp Fri Feb 11 14:30:27 2011 -0800 50.2 +++ b/src/share/vm/c1/c1_FrameMap.cpp Fri Feb 11 15:31:58 2011 -0800 50.3 @@ -35,6 +35,12 @@ 50.4 #ifdef TARGET_ARCH_zero 50.5 # include "vmreg_zero.inline.hpp" 50.6 #endif 50.7 +#ifdef TARGET_ARCH_arm 50.8 +# include "vmreg_arm.inline.hpp" 50.9 +#endif 50.10 +#ifdef TARGET_ARCH_ppc 50.11 +# include "vmreg_ppc.inline.hpp" 50.12 +#endif 50.13 50.14 50.15
51.1 --- a/src/share/vm/c1/c1_FrameMap.hpp Fri Feb 11 14:30:27 2011 -0800 51.2 +++ b/src/share/vm/c1/c1_FrameMap.hpp Fri Feb 11 15:31:58 2011 -0800 51.3 @@ -88,6 +88,12 @@ 51.4 #ifdef TARGET_ARCH_sparc 51.5 # include "c1_FrameMap_sparc.hpp" 51.6 #endif 51.7 +#ifdef TARGET_ARCH_arm 51.8 +# include "c1_FrameMap_arm.hpp" 51.9 +#endif 51.10 +#ifdef TARGET_ARCH_ppc 51.11 +# include "c1_FrameMap_ppc.hpp" 51.12 +#endif 51.13 51.14 51.15 friend class LIR_OprDesc;
52.1 --- a/src/share/vm/c1/c1_Instruction.hpp Fri Feb 11 14:30:27 2011 -0800 52.2 +++ b/src/share/vm/c1/c1_Instruction.hpp Fri Feb 11 15:31:58 2011 -0800 52.3 @@ -316,6 +316,8 @@ 52.4 return res; 52.5 } 52.6 52.7 + static const int no_bci = -99; 52.8 + 52.9 enum InstructionFlag { 52.10 NeedsNullCheckFlag = 0, 52.11 CanTrapFlag,
53.1 --- a/src/share/vm/c1/c1_LIRAssembler.cpp Fri Feb 11 14:30:27 2011 -0800 53.2 +++ b/src/share/vm/c1/c1_LIRAssembler.cpp Fri Feb 11 15:31:58 2011 -0800 53.3 @@ -42,6 +42,14 @@ 53.4 # include "nativeInst_zero.hpp" 53.5 # include "vmreg_zero.inline.hpp" 53.6 #endif 53.7 +#ifdef TARGET_ARCH_arm 53.8 +# include "nativeInst_arm.hpp" 53.9 +# include "vmreg_arm.inline.hpp" 53.10 +#endif 53.11 +#ifdef TARGET_ARCH_ppc 53.12 +# include "nativeInst_ppc.hpp" 53.13 +# include "vmreg_ppc.inline.hpp" 53.14 +#endif 53.15 53.16 53.17 void LIR_Assembler::patching_epilog(PatchingStub* patch, LIR_PatchCode patch_code, Register obj, CodeEmitInfo* info) {
54.1 --- a/src/share/vm/c1/c1_LIRAssembler.hpp Fri Feb 11 14:30:27 2011 -0800 54.2 +++ b/src/share/vm/c1/c1_LIRAssembler.hpp Fri Feb 11 15:31:58 2011 -0800 54.3 @@ -252,6 +252,12 @@ 54.4 #ifdef TARGET_ARCH_sparc 54.5 # include "c1_LIRAssembler_sparc.hpp" 54.6 #endif 54.7 +#ifdef TARGET_ARCH_arm 54.8 +# include "c1_LIRAssembler_arm.hpp" 54.9 +#endif 54.10 +#ifdef TARGET_ARCH_ppc 54.11 +# include "c1_LIRAssembler_ppc.hpp" 54.12 +#endif 54.13 54.14 }; 54.15
55.1 --- a/src/share/vm/c1/c1_LinearScan.cpp Fri Feb 11 14:30:27 2011 -0800 55.2 +++ b/src/share/vm/c1/c1_LinearScan.cpp Fri Feb 11 15:31:58 2011 -0800 55.3 @@ -41,6 +41,12 @@ 55.4 #ifdef TARGET_ARCH_zero 55.5 # include "vmreg_zero.inline.hpp" 55.6 #endif 55.7 +#ifdef TARGET_ARCH_arm 55.8 +# include "vmreg_arm.inline.hpp" 55.9 +#endif 55.10 +#ifdef TARGET_ARCH_ppc 55.11 +# include "vmreg_ppc.inline.hpp" 55.12 +#endif 55.13 55.14 55.15 #ifndef PRODUCT
56.1 --- a/src/share/vm/c1/c1_LinearScan.hpp Fri Feb 11 14:30:27 2011 -0800 56.2 +++ b/src/share/vm/c1/c1_LinearScan.hpp Fri Feb 11 15:31:58 2011 -0800 56.3 @@ -972,6 +972,12 @@ 56.4 #ifdef TARGET_ARCH_sparc 56.5 # include "c1_LinearScan_sparc.hpp" 56.6 #endif 56.7 +#ifdef TARGET_ARCH_arm 56.8 +# include "c1_LinearScan_arm.hpp" 56.9 +#endif 56.10 +#ifdef TARGET_ARCH_ppc 56.11 +# include "c1_LinearScan_ppc.hpp" 56.12 +#endif 56.13 56.14 56.15 #endif // SHARE_VM_C1_C1_LINEARSCAN_HPP
57.1 --- a/src/share/vm/c1/c1_MacroAssembler.hpp Fri Feb 11 14:30:27 2011 -0800 57.2 +++ b/src/share/vm/c1/c1_MacroAssembler.hpp Fri Feb 11 15:31:58 2011 -0800 57.3 @@ -35,6 +35,12 @@ 57.4 #ifdef TARGET_ARCH_zero 57.5 # include "assembler_zero.inline.hpp" 57.6 #endif 57.7 +#ifdef TARGET_ARCH_arm 57.8 +# include "assembler_arm.inline.hpp" 57.9 +#endif 57.10 +#ifdef TARGET_ARCH_ppc 57.11 +# include "assembler_ppc.inline.hpp" 57.12 +#endif 57.13 57.14 class CodeEmitInfo; 57.15 57.16 @@ -61,6 +67,12 @@ 57.17 #ifdef TARGET_ARCH_sparc 57.18 # include "c1_MacroAssembler_sparc.hpp" 57.19 #endif 57.20 +#ifdef TARGET_ARCH_arm 57.21 +# include "c1_MacroAssembler_arm.hpp" 57.22 +#endif 57.23 +#ifdef TARGET_ARCH_ppc 57.24 +# include "c1_MacroAssembler_ppc.hpp" 57.25 +#endif 57.26 57.27 }; 57.28
58.1 --- a/src/share/vm/c1/c1_globals.hpp Fri Feb 11 14:30:27 2011 -0800 58.2 +++ b/src/share/vm/c1/c1_globals.hpp Fri Feb 11 15:31:58 2011 -0800 58.3 @@ -32,6 +32,12 @@ 58.4 #ifdef TARGET_ARCH_sparc 58.5 # include "c1_globals_sparc.hpp" 58.6 #endif 58.7 +#ifdef TARGET_ARCH_arm 58.8 +# include "c1_globals_arm.hpp" 58.9 +#endif 58.10 +#ifdef TARGET_ARCH_ppc 58.11 +# include "c1_globals_ppc.hpp" 58.12 +#endif 58.13 #ifdef TARGET_OS_FAMILY_linux 58.14 # include "c1_globals_linux.hpp" 58.15 #endif
59.1 --- a/src/share/vm/classfile/classFileStream.hpp Fri Feb 11 14:30:27 2011 -0800 59.2 +++ b/src/share/vm/classfile/classFileStream.hpp Fri Feb 11 15:31:58 2011 -0800 59.3 @@ -35,6 +35,12 @@ 59.4 #ifdef TARGET_ARCH_zero 59.5 # include "bytes_zero.hpp" 59.6 #endif 59.7 +#ifdef TARGET_ARCH_arm 59.8 +# include "bytes_arm.hpp" 59.9 +#endif 59.10 +#ifdef TARGET_ARCH_ppc 59.11 +# include "bytes_ppc.hpp" 59.12 +#endif 59.13 59.14 // Input stream for reading .class file 59.15 //
60.1 --- a/src/share/vm/classfile/stackMapTable.hpp Fri Feb 11 14:30:27 2011 -0800 60.2 +++ b/src/share/vm/classfile/stackMapTable.hpp Fri Feb 11 15:31:58 2011 -0800 60.3 @@ -39,6 +39,12 @@ 60.4 #ifdef TARGET_ARCH_zero 60.5 # include "bytes_zero.hpp" 60.6 #endif 60.7 +#ifdef TARGET_ARCH_arm 60.8 +# include "bytes_arm.hpp" 60.9 +#endif 60.10 +#ifdef TARGET_ARCH_ppc 60.11 +# include "bytes_ppc.hpp" 60.12 +#endif 60.13 60.14 class StackMapReader; 60.15
61.1 --- a/src/share/vm/classfile/verifier.cpp Fri Feb 11 14:30:27 2011 -0800 61.2 +++ b/src/share/vm/classfile/verifier.cpp Fri Feb 11 15:31:58 2011 -0800 61.3 @@ -51,6 +51,12 @@ 61.4 #ifdef TARGET_ARCH_zero 61.5 # include "bytes_zero.hpp" 61.6 #endif 61.7 +#ifdef TARGET_ARCH_arm 61.8 +# include "bytes_arm.hpp" 61.9 +#endif 61.10 +#ifdef TARGET_ARCH_ppc 61.11 +# include "bytes_ppc.hpp" 61.12 +#endif 61.13 61.14 #define NOFAILOVER_MAJOR_VERSION 51 61.15
62.1 --- a/src/share/vm/classfile/vmSymbols.hpp Fri Feb 11 14:30:27 2011 -0800 62.2 +++ b/src/share/vm/classfile/vmSymbols.hpp Fri Feb 11 15:31:58 2011 -0800 62.3 @@ -108,7 +108,6 @@ 62.4 template(java_lang_AssertionStatusDirectives, "java/lang/AssertionStatusDirectives") \ 62.5 template(sun_jkernel_DownloadManager, "sun/jkernel/DownloadManager") \ 62.6 template(getBootClassPathEntryForClass_name, "getBootClassPathEntryForClass") \ 62.7 - template(setBootClassLoaderHook_name, "setBootClassLoaderHook") \ 62.8 template(sun_misc_PostVMInitHook, "sun/misc/PostVMInitHook") \ 62.9 \ 62.10 /* class file format tags */ \
63.1 --- a/src/share/vm/code/codeBlob.cpp Fri Feb 11 14:30:27 2011 -0800 63.2 +++ b/src/share/vm/code/codeBlob.cpp Fri Feb 11 15:31:58 2011 -0800 63.3 @@ -48,6 +48,12 @@ 63.4 #ifdef TARGET_ARCH_zero 63.5 # include "nativeInst_zero.hpp" 63.6 #endif 63.7 +#ifdef TARGET_ARCH_arm 63.8 +# include "nativeInst_arm.hpp" 63.9 +#endif 63.10 +#ifdef TARGET_ARCH_ppc 63.11 +# include "nativeInst_ppc.hpp" 63.12 +#endif 63.13 #ifdef COMPILER1 63.14 #include "c1/c1_Runtime1.hpp" 63.15 #endif
64.1 --- a/src/share/vm/code/compiledIC.hpp Fri Feb 11 14:30:27 2011 -0800 64.2 +++ b/src/share/vm/code/compiledIC.hpp Fri Feb 11 15:31:58 2011 -0800 64.3 @@ -38,6 +38,12 @@ 64.4 #ifdef TARGET_ARCH_zero 64.5 # include "nativeInst_zero.hpp" 64.6 #endif 64.7 +#ifdef TARGET_ARCH_arm 64.8 +# include "nativeInst_arm.hpp" 64.9 +#endif 64.10 +#ifdef TARGET_ARCH_ppc 64.11 +# include "nativeInst_ppc.hpp" 64.12 +#endif 64.13 64.14 //----------------------------------------------------------------------------- 64.15 // The CompiledIC represents a compiled inline cache.
65.1 --- a/src/share/vm/code/icBuffer.cpp Fri Feb 11 14:30:27 2011 -0800 65.2 +++ b/src/share/vm/code/icBuffer.cpp Fri Feb 11 15:31:58 2011 -0800 65.3 @@ -46,6 +46,12 @@ 65.4 #ifdef TARGET_ARCH_zero 65.5 # include "assembler_zero.inline.hpp" 65.6 #endif 65.7 +#ifdef TARGET_ARCH_arm 65.8 +# include "assembler_arm.inline.hpp" 65.9 +#endif 65.10 +#ifdef TARGET_ARCH_ppc 65.11 +# include "assembler_ppc.inline.hpp" 65.12 +#endif 65.13 65.14 65.15 DEF_STUB_INTERFACE(ICStub);
66.1 --- a/src/share/vm/code/nmethod.cpp Fri Feb 11 14:30:27 2011 -0800 66.2 +++ b/src/share/vm/code/nmethod.cpp Fri Feb 11 15:31:58 2011 -0800 66.3 @@ -34,6 +34,7 @@ 66.4 #include "interpreter/bytecode.hpp" 66.5 #include "oops/methodDataOop.hpp" 66.6 #include "prims/jvmtiRedefineClassesTrace.hpp" 66.7 +#include "prims/jvmtiImpl.hpp" 66.8 #include "runtime/sharedRuntime.hpp" 66.9 #include "runtime/sweeper.hpp" 66.10 #include "utilities/dtrace.hpp" 66.11 @@ -1533,7 +1534,10 @@ 66.12 } 66.13 66.14 if (JvmtiExport::should_post_compiled_method_load()) { 66.15 - JvmtiExport::post_compiled_method_load(this); 66.16 + // Let the Service thread (which is a real Java thread) post the event 66.17 + MutexLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag); 66.18 + JvmtiDeferredEventQueue::enqueue( 66.19 + JvmtiDeferredEvent::compiled_method_load_event(this)); 66.20 } 66.21 } 66.22 66.23 @@ -1566,8 +1570,17 @@ 66.24 // ref will have been cleared. 66.25 if (_jmethod_id != NULL && JvmtiExport::should_post_compiled_method_unload()) { 66.26 assert(!unload_reported(), "already unloaded"); 66.27 - HandleMark hm; 66.28 - JvmtiExport::post_compiled_method_unload(_jmethod_id, insts_begin()); 66.29 + JvmtiDeferredEvent event = 66.30 + JvmtiDeferredEvent::compiled_method_unload_event( 66.31 + _jmethod_id, insts_begin()); 66.32 + if (SafepointSynchronize::is_at_safepoint()) { 66.33 + // Don't want to take the queueing lock. Add it as pending and 66.34 + // it will get enqueued later. 66.35 + JvmtiDeferredEventQueue::add_pending_event(event); 66.36 + } else { 66.37 + MutexLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag); 66.38 + JvmtiDeferredEventQueue::enqueue(event); 66.39 + } 66.40 } 66.41 66.42 // The JVMTI CompiledMethodUnload event can be enabled or disabled at
67.1 --- a/src/share/vm/code/nmethod.hpp Fri Feb 11 14:30:27 2011 -0800 67.2 +++ b/src/share/vm/code/nmethod.hpp Fri Feb 11 15:31:58 2011 -0800 67.3 @@ -1,5 +1,5 @@ 67.4 /* 67.5 - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 67.6 + * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. 67.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 67.8 * 67.9 * This code is free software; you can redistribute it and/or modify it 67.10 @@ -696,10 +696,11 @@ 67.11 class nmethodLocker : public StackObj { 67.12 nmethod* _nm; 67.13 67.14 + public: 67.15 + 67.16 static void lock_nmethod(nmethod* nm); // note: nm can be NULL 67.17 static void unlock_nmethod(nmethod* nm); // (ditto) 67.18 67.19 - public: 67.20 nmethodLocker(address pc); // derive nm from pc 67.21 nmethodLocker(nmethod *nm) { _nm = nm; lock_nmethod(_nm); } 67.22 nmethodLocker() { _nm = NULL; }
68.1 --- a/src/share/vm/code/relocInfo.cpp Fri Feb 11 14:30:27 2011 -0800 68.2 +++ b/src/share/vm/code/relocInfo.cpp Fri Feb 11 15:31:58 2011 -0800 68.3 @@ -41,6 +41,14 @@ 68.4 # include "assembler_zero.inline.hpp" 68.5 # include "nativeInst_zero.hpp" 68.6 #endif 68.7 +#ifdef TARGET_ARCH_arm 68.8 +# include "assembler_arm.inline.hpp" 68.9 +# include "nativeInst_arm.hpp" 68.10 +#endif 68.11 +#ifdef TARGET_ARCH_ppc 68.12 +# include "assembler_ppc.inline.hpp" 68.13 +# include "nativeInst_ppc.hpp" 68.14 +#endif 68.15 68.16 68.17 const RelocationHolder RelocationHolder::none; // its type is relocInfo::none
69.1 --- a/src/share/vm/code/relocInfo.hpp Fri Feb 11 14:30:27 2011 -0800 69.2 +++ b/src/share/vm/code/relocInfo.hpp Fri Feb 11 15:31:58 2011 -0800 69.3 @@ -430,6 +430,12 @@ 69.4 #ifdef TARGET_ARCH_zero 69.5 # include "relocInfo_zero.hpp" 69.6 #endif 69.7 +#ifdef TARGET_ARCH_arm 69.8 +# include "relocInfo_arm.hpp" 69.9 +#endif 69.10 +#ifdef TARGET_ARCH_ppc 69.11 +# include "relocInfo_ppc.hpp" 69.12 +#endif 69.13 69.14 69.15 protected:
70.1 --- a/src/share/vm/code/vmreg.hpp Fri Feb 11 14:30:27 2011 -0800 70.2 +++ b/src/share/vm/code/vmreg.hpp Fri Feb 11 15:31:58 2011 -0800 70.3 @@ -36,6 +36,12 @@ 70.4 #ifdef TARGET_ARCH_zero 70.5 # include "register_zero.hpp" 70.6 #endif 70.7 +#ifdef TARGET_ARCH_arm 70.8 +# include "register_arm.hpp" 70.9 +#endif 70.10 +#ifdef TARGET_ARCH_ppc 70.11 +# include "register_ppc.hpp" 70.12 +#endif 70.13 #ifdef COMPILER2 70.14 #include "opto/adlcVMDeps.hpp" 70.15 #include "utilities/ostream.hpp" 70.16 @@ -51,6 +57,12 @@ 70.17 #ifdef TARGET_ARCH_MODEL_zero 70.18 # include "adfiles/adGlobals_zero.hpp" 70.19 #endif 70.20 +#ifdef TARGET_ARCH_MODEL_arm 70.21 +# include "adfiles/adGlobals_arm.hpp" 70.22 +#endif 70.23 +#ifdef TARGET_ARCH_MODEL_ppc 70.24 +# include "adfiles/adGlobals_ppc.hpp" 70.25 +#endif 70.26 #endif 70.27 70.28 //------------------------------VMReg------------------------------------------ 70.29 @@ -164,6 +176,12 @@ 70.30 #ifdef TARGET_ARCH_zero 70.31 # include "vmreg_zero.hpp" 70.32 #endif 70.33 +#ifdef TARGET_ARCH_arm 70.34 +# include "vmreg_arm.hpp" 70.35 +#endif 70.36 +#ifdef TARGET_ARCH_ppc 70.37 +# include "vmreg_ppc.hpp" 70.38 +#endif 70.39 70.40 70.41 };
71.1 --- a/src/share/vm/compiler/compileBroker.cpp Fri Feb 11 14:30:27 2011 -0800 71.2 +++ b/src/share/vm/compiler/compileBroker.cpp Fri Feb 11 15:31:58 2011 -0800 71.3 @@ -1,5 +1,5 @@ 71.4 /* 71.5 - * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. 71.6 + * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. 71.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 71.8 * 71.9 * This code is free software; you can redistribute it and/or modify it 71.10 @@ -1210,7 +1210,17 @@ 71.11 // Should the current thread be blocked until this compilation request 71.12 // has been fulfilled? 71.13 bool CompileBroker::is_compile_blocking(methodHandle method, int osr_bci) { 71.14 - return !BackgroundCompilation; 71.15 + if (!BackgroundCompilation) { 71.16 + Symbol* class_name = method->method_holder()->klass_part()->name(); 71.17 + if (class_name->starts_with("java/lang/ref/Reference", 23)) { 71.18 + // The reference handler thread can dead lock with the GC if compilation is blocking, 71.19 + // so we avoid blocking compiles for anything in the java.lang.ref.Reference class, 71.20 + // including inner classes such as ReferenceHandler. 71.21 + return false; 71.22 + } 71.23 + return true; 71.24 + } 71.25 + return false; 71.26 } 71.27 71.28
72.1 --- a/src/share/vm/compiler/disassembler.cpp Fri Feb 11 14:30:27 2011 -0800 72.2 +++ b/src/share/vm/compiler/disassembler.cpp Fri Feb 11 15:31:58 2011 -0800 72.3 @@ -41,6 +41,12 @@ 72.4 #ifdef TARGET_ARCH_zero 72.5 # include "depChecker_zero.hpp" 72.6 #endif 72.7 +#ifdef TARGET_ARCH_arm 72.8 +# include "depChecker_arm.hpp" 72.9 +#endif 72.10 +#ifdef TARGET_ARCH_ppc 72.11 +# include "depChecker_ppc.hpp" 72.12 +#endif 72.13 #ifdef SHARK 72.14 #include "shark/sharkEntry.hpp" 72.15 #endif
73.1 --- a/src/share/vm/compiler/disassembler.hpp Fri Feb 11 14:30:27 2011 -0800 73.2 +++ b/src/share/vm/compiler/disassembler.hpp Fri Feb 11 15:31:58 2011 -0800 73.3 @@ -70,6 +70,12 @@ 73.4 #ifdef TARGET_ARCH_zero 73.5 # include "disassembler_zero.hpp" 73.6 #endif 73.7 +#ifdef TARGET_ARCH_arm 73.8 +# include "disassembler_arm.hpp" 73.9 +#endif 73.10 +#ifdef TARGET_ARCH_ppc 73.11 +# include "disassembler_ppc.hpp" 73.12 +#endif 73.13 73.14 73.15 public:
74.1 --- a/src/share/vm/gc_implementation/g1/concurrentG1Refine.cpp Fri Feb 11 14:30:27 2011 -0800 74.2 +++ b/src/share/vm/gc_implementation/g1/concurrentG1Refine.cpp Fri Feb 11 15:31:58 2011 -0800 74.3 @@ -1,5 +1,5 @@ 74.4 /* 74.5 - * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. 74.6 + * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. 74.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 74.8 * 74.9 * This code is free software; you can redistribute it and/or modify it 74.10 @@ -99,7 +99,7 @@ 74.11 if (G1ConcRSLogCacheSize > 0) { 74.12 _g1h = G1CollectedHeap::heap(); 74.13 _max_n_card_counts = 74.14 - (unsigned) (_g1h->g1_reserved_obj_bytes() >> CardTableModRefBS::card_shift); 74.15 + (unsigned) (_g1h->max_capacity() >> CardTableModRefBS::card_shift); 74.16 74.17 size_t max_card_num = ((size_t)1 << (sizeof(unsigned)*BitsPerByte-1)) - 1; 74.18 guarantee(_max_n_card_counts < max_card_num, "card_num representation");
75.1 --- a/src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp Fri Feb 11 14:30:27 2011 -0800 75.2 +++ b/src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp Fri Feb 11 15:31:58 2011 -0800 75.3 @@ -251,6 +251,14 @@ 75.4 75.5 // Now do the remainder of the cleanup operation. 75.6 _cm->completeCleanup(); 75.7 + // Notify anyone who's waiting that there are no more free 75.8 + // regions coming. We have to do this before we join the STS, 75.9 + // otherwise we might deadlock: a GC worker could be blocked 75.10 + // waiting for the notification whereas this thread will be 75.11 + // blocked for the pause to finish while it's trying to join 75.12 + // the STS, which is conditional on the GC workers finishing. 75.13 + g1h->reset_free_regions_coming(); 75.14 + 75.15 _sts.join(); 75.16 g1_policy->record_concurrent_mark_cleanup_completed(); 75.17 _sts.leave(); 75.18 @@ -262,9 +270,6 @@ 75.19 gclog_or_tty->print_cr("[GC concurrent-cleanup-end, %1.7lf]", 75.20 cleanup_end_sec - cleanup_start_sec); 75.21 } 75.22 - 75.23 - // We're done: no more free regions coming. 75.24 - g1h->reset_free_regions_coming(); 75.25 } 75.26 guarantee(cm()->cleanup_list_is_empty(), 75.27 "at this point there should be no regions on the cleanup list");
76.1 --- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Fri Feb 11 14:30:27 2011 -0800 76.2 +++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Fri Feb 11 15:31:58 2011 -0800 76.3 @@ -546,8 +546,11 @@ 76.4 res = new_region_try_secondary_free_list(word_size); 76.5 } 76.6 if (res == NULL && do_expand) { 76.7 - expand(word_size * HeapWordSize); 76.8 - res = _free_list.remove_head_or_null(); 76.9 + if (expand(word_size * HeapWordSize)) { 76.10 + // The expansion succeeded and so we should have at least one 76.11 + // region on the free list. 76.12 + res = _free_list.remove_head(); 76.13 + } 76.14 } 76.15 if (res != NULL) { 76.16 if (G1PrintHeapRegions) { 76.17 @@ -631,9 +634,22 @@ 76.18 if (first == -1) { 76.19 // The only thing we can do now is attempt expansion. 76.20 if (fs + x_size >= num_regions) { 76.21 - expand((num_regions - fs) * HeapRegion::GrainBytes); 76.22 - first = humongous_obj_allocate_find_first(num_regions, word_size); 76.23 - assert(first != -1, "this should have worked"); 76.24 + // If the number of regions we're trying to allocate for this 76.25 + // object is at most the number of regions in the free suffix, 76.26 + // then the call to humongous_obj_allocate_find_first() above 76.27 + // should have succeeded and we wouldn't be here. 76.28 + // 76.29 + // We should only be trying to expand when the free suffix is 76.30 + // not sufficient for the object _and_ we have some expansion 76.31 + // room available. 76.32 + assert(num_regions > fs, "earlier allocation should have succeeded"); 76.33 + 76.34 + if (expand((num_regions - fs) * HeapRegion::GrainBytes)) { 76.35 + first = humongous_obj_allocate_find_first(num_regions, word_size); 76.36 + // If the expansion was successful then the allocation 76.37 + // should have been successful. 76.38 + assert(first != -1, "this should have worked"); 76.39 + } 76.40 } 76.41 } 76.42 76.43 @@ -1647,16 +1663,17 @@ 76.44 if (capacity_after_gc < minimum_desired_capacity) { 76.45 // Don't expand unless it's significant 76.46 size_t expand_bytes = minimum_desired_capacity - capacity_after_gc; 76.47 - expand(expand_bytes); 76.48 - if (PrintGC && Verbose) { 76.49 - gclog_or_tty->print_cr(" " 76.50 - " expanding:" 76.51 - " max_heap_size: %6.1fK" 76.52 - " minimum_desired_capacity: %6.1fK" 76.53 - " expand_bytes: %6.1fK", 76.54 - (double) max_heap_size / (double) K, 76.55 - (double) minimum_desired_capacity / (double) K, 76.56 - (double) expand_bytes / (double) K); 76.57 + if (expand(expand_bytes)) { 76.58 + if (PrintGC && Verbose) { 76.59 + gclog_or_tty->print_cr(" " 76.60 + " expanding:" 76.61 + " max_heap_size: %6.1fK" 76.62 + " minimum_desired_capacity: %6.1fK" 76.63 + " expand_bytes: %6.1fK", 76.64 + (double) max_heap_size / (double) K, 76.65 + (double) minimum_desired_capacity / (double) K, 76.66 + (double) expand_bytes / (double) K); 76.67 + } 76.68 } 76.69 76.70 // No expansion, now see if we want to shrink 76.71 @@ -1757,66 +1774,84 @@ 76.72 76.73 verify_region_sets_optional(); 76.74 76.75 - size_t expand_bytes = word_size * HeapWordSize; 76.76 - if (expand_bytes < MinHeapDeltaBytes) { 76.77 - expand_bytes = MinHeapDeltaBytes; 76.78 - } 76.79 - expand(expand_bytes); 76.80 - 76.81 - verify_region_sets_optional(); 76.82 - 76.83 - return attempt_allocation_at_safepoint(word_size, 76.84 - false /* expect_null_cur_alloc_region */); 76.85 + size_t expand_bytes = MAX2(word_size * HeapWordSize, MinHeapDeltaBytes); 76.86 + if (expand(expand_bytes)) { 76.87 + verify_region_sets_optional(); 76.88 + return attempt_allocation_at_safepoint(word_size, 76.89 + false /* expect_null_cur_alloc_region */); 76.90 + } 76.91 + return NULL; 76.92 } 76.93 76.94 -// FIXME: both this and shrink could probably be more efficient by 76.95 -// doing one "VirtualSpace::expand_by" call rather than several. 76.96 -void G1CollectedHeap::expand(size_t expand_bytes) { 76.97 +bool G1CollectedHeap::expand(size_t expand_bytes) { 76.98 size_t old_mem_size = _g1_storage.committed_size(); 76.99 - // We expand by a minimum of 1K. 76.100 - expand_bytes = MAX2(expand_bytes, (size_t)K); 76.101 - size_t aligned_expand_bytes = 76.102 - ReservedSpace::page_align_size_up(expand_bytes); 76.103 + size_t aligned_expand_bytes = ReservedSpace::page_align_size_up(expand_bytes); 76.104 aligned_expand_bytes = align_size_up(aligned_expand_bytes, 76.105 HeapRegion::GrainBytes); 76.106 - expand_bytes = aligned_expand_bytes; 76.107 - while (expand_bytes > 0) { 76.108 - HeapWord* base = (HeapWord*)_g1_storage.high(); 76.109 - // Commit more storage. 76.110 - bool successful = _g1_storage.expand_by(HeapRegion::GrainBytes); 76.111 - if (!successful) { 76.112 - expand_bytes = 0; 76.113 - } else { 76.114 - expand_bytes -= HeapRegion::GrainBytes; 76.115 - // Expand the committed region. 76.116 - HeapWord* high = (HeapWord*) _g1_storage.high(); 76.117 - _g1_committed.set_end(high); 76.118 + 76.119 + if (Verbose && PrintGC) { 76.120 + gclog_or_tty->print("Expanding garbage-first heap from %ldK by %ldK", 76.121 + old_mem_size/K, aligned_expand_bytes/K); 76.122 + } 76.123 + 76.124 + HeapWord* old_end = (HeapWord*)_g1_storage.high(); 76.125 + bool successful = _g1_storage.expand_by(aligned_expand_bytes); 76.126 + if (successful) { 76.127 + HeapWord* new_end = (HeapWord*)_g1_storage.high(); 76.128 + 76.129 + // Expand the committed region. 76.130 + _g1_committed.set_end(new_end); 76.131 + 76.132 + // Tell the cardtable about the expansion. 76.133 + Universe::heap()->barrier_set()->resize_covered_region(_g1_committed); 76.134 + 76.135 + // And the offset table as well. 76.136 + _bot_shared->resize(_g1_committed.word_size()); 76.137 + 76.138 + expand_bytes = aligned_expand_bytes; 76.139 + HeapWord* base = old_end; 76.140 + 76.141 + // Create the heap regions for [old_end, new_end) 76.142 + while (expand_bytes > 0) { 76.143 + HeapWord* high = base + HeapRegion::GrainWords; 76.144 + 76.145 // Create a new HeapRegion. 76.146 MemRegion mr(base, high); 76.147 bool is_zeroed = !_g1_max_committed.contains(base); 76.148 HeapRegion* hr = new HeapRegion(_bot_shared, mr, is_zeroed); 76.149 76.150 - // Now update max_committed if necessary. 76.151 - _g1_max_committed.set_end(MAX2(_g1_max_committed.end(), high)); 76.152 - 76.153 // Add it to the HeapRegionSeq. 76.154 _hrs->insert(hr); 76.155 _free_list.add_as_tail(hr); 76.156 + 76.157 // And we used up an expansion region to create it. 76.158 _expansion_regions--; 76.159 - // Tell the cardtable about it. 76.160 - Universe::heap()->barrier_set()->resize_covered_region(_g1_committed); 76.161 - // And the offset table as well. 76.162 - _bot_shared->resize(_g1_committed.word_size()); 76.163 + 76.164 + expand_bytes -= HeapRegion::GrainBytes; 76.165 + base += HeapRegion::GrainWords; 76.166 + } 76.167 + assert(base == new_end, "sanity"); 76.168 + 76.169 + // Now update max_committed if necessary. 76.170 + _g1_max_committed.set_end(MAX2(_g1_max_committed.end(), new_end)); 76.171 + 76.172 + } else { 76.173 + // The expansion of the virtual storage space was unsuccessful. 76.174 + // Let's see if it was because we ran out of swap. 76.175 + if (G1ExitOnExpansionFailure && 76.176 + _g1_storage.uncommitted_size() >= aligned_expand_bytes) { 76.177 + // We had head room... 76.178 + vm_exit_out_of_memory(aligned_expand_bytes, "G1 heap expansion"); 76.179 } 76.180 } 76.181 76.182 if (Verbose && PrintGC) { 76.183 size_t new_mem_size = _g1_storage.committed_size(); 76.184 - gclog_or_tty->print_cr("Expanding garbage-first heap from %ldK by %ldK to %ldK", 76.185 - old_mem_size/K, aligned_expand_bytes/K, 76.186 + gclog_or_tty->print_cr("...%s, expanded to %ldK", 76.187 + (successful ? "Successful" : "Failed"), 76.188 new_mem_size/K); 76.189 } 76.190 + return successful; 76.191 } 76.192 76.193 void G1CollectedHeap::shrink_helper(size_t shrink_bytes) 76.194 @@ -2088,7 +2123,10 @@ 76.195 HeapRegionRemSet::init_heap(max_regions()); 76.196 76.197 // Now expand into the initial heap size. 76.198 - expand(init_byte_size); 76.199 + if (!expand(init_byte_size)) { 76.200 + vm_exit_during_initialization("Failed to allocate initial heap."); 76.201 + return JNI_ENOMEM; 76.202 + } 76.203 76.204 // Perform any initialization actions delegated to the policy. 76.205 g1_policy()->init(); 76.206 @@ -2744,7 +2782,7 @@ 76.207 } 76.208 76.209 size_t G1CollectedHeap::max_capacity() const { 76.210 - return g1_reserved_obj_bytes(); 76.211 + return _g1_reserved.byte_size(); 76.212 } 76.213 76.214 jlong G1CollectedHeap::millis_since_last_gc() { 76.215 @@ -3538,7 +3576,12 @@ 76.216 size_t expand_bytes = g1_policy()->expansion_amount(); 76.217 if (expand_bytes > 0) { 76.218 size_t bytes_before = capacity(); 76.219 - expand(expand_bytes); 76.220 + if (!expand(expand_bytes)) { 76.221 + // We failed to expand the heap so let's verify that 76.222 + // committed/uncommitted amount match the backing store 76.223 + assert(capacity() == _g1_storage.committed_size(), "committed size mismatch"); 76.224 + assert(max_capacity() == _g1_storage.reserved_size(), "reserved size mismatch"); 76.225 + } 76.226 } 76.227 } 76.228 76.229 @@ -3762,7 +3805,7 @@ 76.230 76.231 if (alloc_region == NULL) { 76.232 // we will get a new GC alloc region 76.233 - alloc_region = new_gc_alloc_region(ap, 0); 76.234 + alloc_region = new_gc_alloc_region(ap, HeapRegion::GrainWords); 76.235 } else { 76.236 // the region was retained from the last collection 76.237 ++_gc_alloc_region_counts[ap]; 76.238 @@ -5311,7 +5354,7 @@ 76.239 76.240 size_t G1CollectedHeap::max_regions() { 76.241 return 76.242 - (size_t)align_size_up(g1_reserved_obj_bytes(), HeapRegion::GrainBytes) / 76.243 + (size_t)align_size_up(max_capacity(), HeapRegion::GrainBytes) / 76.244 HeapRegion::GrainBytes; 76.245 } 76.246
77.1 --- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp Fri Feb 11 14:30:27 2011 -0800 77.2 +++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp Fri Feb 11 15:31:58 2011 -0800 77.3 @@ -619,8 +619,10 @@ 77.4 77.5 public: 77.6 // Expand the garbage-first heap by at least the given size (in bytes!). 77.7 + // Returns true if the heap was expanded by the requested amount; 77.8 + // false otherwise. 77.9 // (Rounds up to a HeapRegion boundary.) 77.10 - virtual void expand(size_t expand_bytes); 77.11 + bool expand(size_t expand_bytes); 77.12 77.13 // Do anything common to GC's. 77.14 virtual void gc_prologue(bool full); 77.15 @@ -981,9 +983,6 @@ 77.16 // Reference Processing accessor 77.17 ReferenceProcessor* ref_processor() { return _ref_processor; } 77.18 77.19 - // Reserved (g1 only; super method includes perm), capacity and the used 77.20 - // portion in bytes. 77.21 - size_t g1_reserved_obj_bytes() const { return _g1_reserved.byte_size(); } 77.22 virtual size_t capacity() const; 77.23 virtual size_t used() const; 77.24 // This should be called when we're not holding the heap lock. The
78.1 --- a/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp Fri Feb 11 14:30:27 2011 -0800 78.2 +++ b/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp Fri Feb 11 15:31:58 2011 -0800 78.3 @@ -2011,7 +2011,7 @@ 78.4 // space, whichever is smaller, bounded below by a minimum 78.5 // expansion (unless that's all that's left.) 78.6 const size_t min_expand_bytes = 1*M; 78.7 - size_t reserved_bytes = _g1->g1_reserved_obj_bytes(); 78.8 + size_t reserved_bytes = _g1->max_capacity(); 78.9 size_t committed_bytes = _g1->capacity(); 78.10 size_t uncommitted_bytes = reserved_bytes - committed_bytes; 78.11 size_t expand_bytes;
79.1 --- a/src/share/vm/gc_implementation/g1/g1RemSet.cpp Fri Feb 11 14:30:27 2011 -0800 79.2 +++ b/src/share/vm/gc_implementation/g1/g1RemSet.cpp Fri Feb 11 15:31:58 2011 -0800 79.3 @@ -1,5 +1,5 @@ 79.4 /* 79.5 - * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. 79.6 + * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. 79.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 79.8 * 79.9 * This code is free software; you can redistribute it and/or modify it 79.10 @@ -735,7 +735,7 @@ 79.11 MemRegion dirtyRegion(start, end); 79.12 79.13 #if CARD_REPEAT_HISTO 79.14 - init_ct_freq_table(_g1->g1_reserved_obj_bytes()); 79.15 + init_ct_freq_table(_g1->max_capacity()); 79.16 ct_freq_note_card(_ct_bs->index_for(start)); 79.17 #endif 79.18
80.1 --- a/src/share/vm/gc_implementation/g1/g1_globals.hpp Fri Feb 11 14:30:27 2011 -0800 80.2 +++ b/src/share/vm/gc_implementation/g1/g1_globals.hpp Fri Feb 11 15:31:58 2011 -0800 80.3 @@ -301,9 +301,13 @@ 80.4 develop(uintx, G1StressConcRegionFreeingDelayMillis, 0, \ 80.5 "Artificial delay during concurrent region freeing") \ 80.6 \ 80.7 - develop(bool, ReduceInitialCardMarksForG1, false, \ 80.8 + develop(bool, ReduceInitialCardMarksForG1, false, \ 80.9 "When ReduceInitialCardMarks is true, this flag setting " \ 80.10 - " controls whether G1 allows the RICM optimization") 80.11 + " controls whether G1 allows the RICM optimization") \ 80.12 + \ 80.13 + develop(bool, G1ExitOnExpansionFailure, false, \ 80.14 + "Raise a fatal VM exit out of memory failure in the event " \ 80.15 + " that heap expansion fails due to running out of swap.") 80.16 80.17 G1_FLAGS(DECLARE_DEVELOPER_FLAG, DECLARE_PD_DEVELOPER_FLAG, DECLARE_PRODUCT_FLAG, DECLARE_PD_PRODUCT_FLAG, DECLARE_DIAGNOSTIC_FLAG, DECLARE_EXPERIMENTAL_FLAG, DECLARE_NOTPRODUCT_FLAG, DECLARE_MANAGEABLE_FLAG, DECLARE_PRODUCT_RW_FLAG) 80.18
81.1 --- a/src/share/vm/gc_implementation/shared/allocationStats.hpp Fri Feb 11 14:30:27 2011 -0800 81.2 +++ b/src/share/vm/gc_implementation/shared/allocationStats.hpp Fri Feb 11 15:31:58 2011 -0800 81.3 @@ -116,10 +116,8 @@ 81.4 _demand_rate_estimate.sample(rate); 81.5 float new_rate = _demand_rate_estimate.padded_average(); 81.6 ssize_t old_desired = _desired; 81.7 - _desired = (ssize_t)(new_rate * (inter_sweep_estimate 81.8 - + CMSExtrapolateSweep 81.9 - ? intra_sweep_estimate 81.10 - : 0.0)); 81.11 + float delta_ise = (CMSExtrapolateSweep ? intra_sweep_estimate : 0.0); 81.12 + _desired = (ssize_t)(new_rate * (inter_sweep_estimate + delta_ise)); 81.13 if (PrintFLSStatistics > 1) { 81.14 gclog_or_tty->print_cr("demand: %d, old_rate: %f, current_rate: %f, new_rate: %f, old_desired: %d, new_desired: %d", 81.15 demand, old_rate, rate, new_rate, old_desired, _desired);
82.1 --- a/src/share/vm/gc_implementation/shared/gcUtil.cpp Fri Feb 11 14:30:27 2011 -0800 82.2 +++ b/src/share/vm/gc_implementation/shared/gcUtil.cpp Fri Feb 11 15:31:58 2011 -0800 82.3 @@ -106,8 +106,8 @@ 82.4 } 82.5 82.6 LinearLeastSquareFit::LinearLeastSquareFit(unsigned weight) : 82.7 - _sum_x(0), _sum_y(0), _sum_xy(0), 82.8 - _mean_x(weight), _mean_y(weight) {} 82.9 + _sum_x(0), _sum_x_squared(0), _sum_y(0), _sum_xy(0), 82.10 + _intercept(0), _slope(0), _mean_x(weight), _mean_y(weight) {} 82.11 82.12 void LinearLeastSquareFit::update(double x, double y) { 82.13 _sum_x = _sum_x + x;
83.1 --- a/src/share/vm/interpreter/abstractInterpreter.hpp Fri Feb 11 14:30:27 2011 -0800 83.2 +++ b/src/share/vm/interpreter/abstractInterpreter.hpp Fri Feb 11 15:31:58 2011 -0800 83.3 @@ -41,6 +41,12 @@ 83.4 #ifdef TARGET_ARCH_MODEL_zero 83.5 # include "interp_masm_zero.hpp" 83.6 #endif 83.7 +#ifdef TARGET_ARCH_MODEL_arm 83.8 +# include "interp_masm_arm.hpp" 83.9 +#endif 83.10 +#ifdef TARGET_ARCH_MODEL_ppc 83.11 +# include "interp_masm_ppc.hpp" 83.12 +#endif 83.13 #ifdef TARGET_OS_FAMILY_linux 83.14 # include "thread_linux.inline.hpp" 83.15 #endif
84.1 --- a/src/share/vm/interpreter/bytecode.hpp Fri Feb 11 14:30:27 2011 -0800 84.2 +++ b/src/share/vm/interpreter/bytecode.hpp Fri Feb 11 15:31:58 2011 -0800 84.3 @@ -37,6 +37,12 @@ 84.4 #ifdef TARGET_ARCH_zero 84.5 # include "bytes_zero.hpp" 84.6 #endif 84.7 +#ifdef TARGET_ARCH_arm 84.8 +# include "bytes_arm.hpp" 84.9 +#endif 84.10 +#ifdef TARGET_ARCH_ppc 84.11 +# include "bytes_ppc.hpp" 84.12 +#endif 84.13 84.14 class ciBytecodeStream; 84.15
85.1 --- a/src/share/vm/interpreter/bytecodeInterpreter.cpp Fri Feb 11 14:30:27 2011 -0800 85.2 +++ b/src/share/vm/interpreter/bytecodeInterpreter.cpp Fri Feb 11 15:31:58 2011 -0800 85.3 @@ -59,6 +59,12 @@ 85.4 #ifdef TARGET_OS_ARCH_windows_x86 85.5 # include "orderAccess_windows_x86.inline.hpp" 85.6 #endif 85.7 +#ifdef TARGET_OS_ARCH_linux_arm 85.8 +# include "orderAccess_linux_arm.inline.hpp" 85.9 +#endif 85.10 +#ifdef TARGET_OS_ARCH_linux_ppc 85.11 +# include "orderAccess_linux_ppc.inline.hpp" 85.12 +#endif 85.13 85.14 85.15 // no precompiled headers
86.1 --- a/src/share/vm/interpreter/bytecodeInterpreter.hpp Fri Feb 11 14:30:27 2011 -0800 86.2 +++ b/src/share/vm/interpreter/bytecodeInterpreter.hpp Fri Feb 11 15:31:58 2011 -0800 86.3 @@ -41,6 +41,12 @@ 86.4 #ifdef TARGET_ARCH_zero 86.5 # include "bytes_zero.hpp" 86.6 #endif 86.7 +#ifdef TARGET_ARCH_arm 86.8 +# include "bytes_arm.hpp" 86.9 +#endif 86.10 +#ifdef TARGET_ARCH_ppc 86.11 +# include "bytes_ppc.hpp" 86.12 +#endif 86.13 86.14 #ifdef CC_INTERP 86.15 86.16 @@ -587,6 +593,12 @@ 86.17 #ifdef TARGET_ARCH_zero 86.18 # include "bytecodeInterpreter_zero.hpp" 86.19 #endif 86.20 +#ifdef TARGET_ARCH_arm 86.21 +# include "bytecodeInterpreter_arm.hpp" 86.22 +#endif 86.23 +#ifdef TARGET_ARCH_ppc 86.24 +# include "bytecodeInterpreter_ppc.hpp" 86.25 +#endif 86.26 86.27 86.28 }; // BytecodeInterpreter
87.1 --- a/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp Fri Feb 11 14:30:27 2011 -0800 87.2 +++ b/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp Fri Feb 11 15:31:58 2011 -0800 87.3 @@ -52,6 +52,12 @@ 87.4 #ifdef TARGET_ARCH_zero 87.5 # include "bytecodeInterpreter_zero.inline.hpp" 87.6 #endif 87.7 +#ifdef TARGET_ARCH_arm 87.8 +# include "bytecodeInterpreter_arm.inline.hpp" 87.9 +#endif 87.10 +#ifdef TARGET_ARCH_ppc 87.11 +# include "bytecodeInterpreter_ppc.inline.hpp" 87.12 +#endif 87.13 87.14 #endif // CC_INTERP 87.15
88.1 --- a/src/share/vm/interpreter/bytecodeStream.hpp Fri Feb 11 14:30:27 2011 -0800 88.2 +++ b/src/share/vm/interpreter/bytecodeStream.hpp Fri Feb 11 15:31:58 2011 -0800 88.3 @@ -37,6 +37,12 @@ 88.4 #ifdef TARGET_ARCH_zero 88.5 # include "bytes_zero.hpp" 88.6 #endif 88.7 +#ifdef TARGET_ARCH_arm 88.8 +# include "bytes_arm.hpp" 88.9 +#endif 88.10 +#ifdef TARGET_ARCH_ppc 88.11 +# include "bytes_ppc.hpp" 88.12 +#endif 88.13 88.14 // A BytecodeStream is used for fast iteration over the bytecodes 88.15 // of a methodOop.
89.1 --- a/src/share/vm/interpreter/bytecodes.cpp Fri Feb 11 14:30:27 2011 -0800 89.2 +++ b/src/share/vm/interpreter/bytecodes.cpp Fri Feb 11 15:31:58 2011 -0800 89.3 @@ -35,6 +35,12 @@ 89.4 #ifdef TARGET_ARCH_zero 89.5 # include "bytes_zero.hpp" 89.6 #endif 89.7 +#ifdef TARGET_ARCH_arm 89.8 +# include "bytes_arm.hpp" 89.9 +#endif 89.10 +#ifdef TARGET_ARCH_ppc 89.11 +# include "bytes_ppc.hpp" 89.12 +#endif 89.13 89.14 89.15 #if defined(WIN32) && (defined(_MSC_VER) && (_MSC_VER < 1600))
90.1 --- a/src/share/vm/interpreter/bytecodes.hpp Fri Feb 11 14:30:27 2011 -0800 90.2 +++ b/src/share/vm/interpreter/bytecodes.hpp Fri Feb 11 15:31:58 2011 -0800 90.3 @@ -294,6 +294,12 @@ 90.4 #ifdef TARGET_ARCH_zero 90.5 # include "bytecodes_zero.hpp" 90.6 #endif 90.7 +#ifdef TARGET_ARCH_arm 90.8 +# include "bytecodes_arm.hpp" 90.9 +#endif 90.10 +#ifdef TARGET_ARCH_ppc 90.11 +# include "bytecodes_ppc.hpp" 90.12 +#endif 90.13 90.14 90.15 number_of_codes
91.1 --- a/src/share/vm/interpreter/cppInterpreter.hpp Fri Feb 11 14:30:27 2011 -0800 91.2 +++ b/src/share/vm/interpreter/cppInterpreter.hpp Fri Feb 11 15:31:58 2011 -0800 91.3 @@ -90,6 +90,12 @@ 91.4 #ifdef TARGET_ARCH_zero 91.5 # include "cppInterpreter_zero.hpp" 91.6 #endif 91.7 +#ifdef TARGET_ARCH_arm 91.8 +# include "cppInterpreter_arm.hpp" 91.9 +#endif 91.10 +#ifdef TARGET_ARCH_ppc 91.11 +# include "cppInterpreter_ppc.hpp" 91.12 +#endif 91.13 91.14 91.15 };
92.1 --- a/src/share/vm/interpreter/cppInterpreterGenerator.hpp Fri Feb 11 14:30:27 2011 -0800 92.2 +++ b/src/share/vm/interpreter/cppInterpreterGenerator.hpp Fri Feb 11 15:31:58 2011 -0800 92.3 @@ -53,6 +53,12 @@ 92.4 #ifdef TARGET_ARCH_zero 92.5 # include "cppInterpreterGenerator_zero.hpp" 92.6 #endif 92.7 +#ifdef TARGET_ARCH_arm 92.8 +# include "cppInterpreterGenerator_arm.hpp" 92.9 +#endif 92.10 +#ifdef TARGET_ARCH_ppc 92.11 +# include "cppInterpreterGenerator_ppc.hpp" 92.12 +#endif 92.13 92.14 }; 92.15
93.1 --- a/src/share/vm/interpreter/interpreter.hpp Fri Feb 11 14:30:27 2011 -0800 93.2 +++ b/src/share/vm/interpreter/interpreter.hpp Fri Feb 11 15:31:58 2011 -0800 93.3 @@ -152,6 +152,12 @@ 93.4 #ifdef TARGET_ARCH_zero 93.5 # include "interpreter_zero.hpp" 93.6 #endif 93.7 +#ifdef TARGET_ARCH_arm 93.8 +# include "interpreter_arm.hpp" 93.9 +#endif 93.10 +#ifdef TARGET_ARCH_ppc 93.11 +# include "interpreter_ppc.hpp" 93.12 +#endif 93.13 93.14 }; 93.15
94.1 --- a/src/share/vm/interpreter/interpreterGenerator.hpp Fri Feb 11 14:30:27 2011 -0800 94.2 +++ b/src/share/vm/interpreter/interpreterGenerator.hpp Fri Feb 11 15:31:58 2011 -0800 94.3 @@ -50,6 +50,12 @@ 94.4 #ifdef TARGET_ARCH_zero 94.5 # include "interpreterGenerator_zero.hpp" 94.6 #endif 94.7 +#ifdef TARGET_ARCH_arm 94.8 +# include "interpreterGenerator_arm.hpp" 94.9 +#endif 94.10 +#ifdef TARGET_ARCH_ppc 94.11 +# include "interpreterGenerator_ppc.hpp" 94.12 +#endif 94.13 94.14 94.15 };
95.1 --- a/src/share/vm/interpreter/interpreterRuntime.cpp Fri Feb 11 14:30:27 2011 -0800 95.2 +++ b/src/share/vm/interpreter/interpreterRuntime.cpp Fri Feb 11 15:31:58 2011 -0800 95.3 @@ -65,6 +65,12 @@ 95.4 #ifdef TARGET_ARCH_zero 95.5 # include "vm_version_zero.hpp" 95.6 #endif 95.7 +#ifdef TARGET_ARCH_arm 95.8 +# include "vm_version_arm.hpp" 95.9 +#endif 95.10 +#ifdef TARGET_ARCH_ppc 95.11 +# include "vm_version_ppc.hpp" 95.12 +#endif 95.13 #ifdef COMPILER2 95.14 #include "opto/runtime.hpp" 95.15 #endif 95.16 @@ -1178,9 +1184,7 @@ 95.17 handler_index = _fingerprints->length() - 1; 95.18 } 95.19 } 95.20 - } else { 95.21 - CHECK_UNHANDLED_OOPS_ONLY(Thread::current()->clear_unhandled_oops()); 95.22 - } 95.23 + // Set handler under SignatureHandlerLibrary_lock 95.24 if (handler_index < 0) { 95.25 // use generic signature handler 95.26 method->set_signature_handler(Interpreter::slow_signature_handler()); 95.27 @@ -1188,21 +1192,29 @@ 95.28 // set handler 95.29 method->set_signature_handler(_handlers->at(handler_index)); 95.30 } 95.31 + } else { 95.32 + CHECK_UNHANDLED_OOPS_ONLY(Thread::current()->clear_unhandled_oops()); 95.33 + // use generic signature handler 95.34 + method->set_signature_handler(Interpreter::slow_signature_handler()); 95.35 + } 95.36 } 95.37 #ifdef ASSERT 95.38 - int handler_index, fingerprint_index; 95.39 + int handler_index = -1; 95.40 + int fingerprint_index = -2; 95.41 { 95.42 // '_handlers' and '_fingerprints' are 'GrowableArray's and are NOT synchronized 95.43 // in any way if accessed from multiple threads. To avoid races with another 95.44 // thread which may change the arrays in the above, mutex protected block, we 95.45 // have to protect this read access here with the same mutex as well! 95.46 MutexLocker mu(SignatureHandlerLibrary_lock); 95.47 + if (_handlers != NULL) { 95.48 handler_index = _handlers->find(method->signature_handler()); 95.49 fingerprint_index = _fingerprints->find(Fingerprinter(method).fingerprint()); 95.50 } 95.51 + } 95.52 assert(method->signature_handler() == Interpreter::slow_signature_handler() || 95.53 handler_index == fingerprint_index, "sanity check"); 95.54 -#endif 95.55 +#endif // ASSERT 95.56 } 95.57 95.58
96.1 --- a/src/share/vm/interpreter/interpreterRuntime.hpp Fri Feb 11 14:30:27 2011 -0800 96.2 +++ b/src/share/vm/interpreter/interpreterRuntime.hpp Fri Feb 11 15:31:58 2011 -0800 96.3 @@ -157,6 +157,12 @@ 96.4 #ifdef TARGET_ARCH_zero 96.5 # include "interpreterRT_zero.hpp" 96.6 #endif 96.7 +#ifdef TARGET_ARCH_arm 96.8 +# include "interpreterRT_arm.hpp" 96.9 +#endif 96.10 +#ifdef TARGET_ARCH_ppc 96.11 +# include "interpreterRT_ppc.hpp" 96.12 +#endif 96.13 96.14 96.15 // Interpreter's frequency counter overflow
97.1 --- a/src/share/vm/interpreter/templateInterpreter.hpp Fri Feb 11 14:30:27 2011 -0800 97.2 +++ b/src/share/vm/interpreter/templateInterpreter.hpp Fri Feb 11 15:31:58 2011 -0800 97.3 @@ -192,6 +192,12 @@ 97.4 #ifdef TARGET_ARCH_zero 97.5 # include "templateInterpreter_zero.hpp" 97.6 #endif 97.7 +#ifdef TARGET_ARCH_arm 97.8 +# include "templateInterpreter_arm.hpp" 97.9 +#endif 97.10 +#ifdef TARGET_ARCH_ppc 97.11 +# include "templateInterpreter_ppc.hpp" 97.12 +#endif 97.13 97.14 97.15 };
98.1 --- a/src/share/vm/interpreter/templateInterpreterGenerator.hpp Fri Feb 11 14:30:27 2011 -0800 98.2 +++ b/src/share/vm/interpreter/templateInterpreterGenerator.hpp Fri Feb 11 15:31:58 2011 -0800 98.3 @@ -96,6 +96,12 @@ 98.4 #ifdef TARGET_ARCH_zero 98.5 # include "templateInterpreterGenerator_zero.hpp" 98.6 #endif 98.7 +#ifdef TARGET_ARCH_arm 98.8 +# include "templateInterpreterGenerator_arm.hpp" 98.9 +#endif 98.10 +#ifdef TARGET_ARCH_ppc 98.11 +# include "templateInterpreterGenerator_ppc.hpp" 98.12 +#endif 98.13 98.14 98.15 };
99.1 --- a/src/share/vm/interpreter/templateTable.hpp Fri Feb 11 14:30:27 2011 -0800 99.2 +++ b/src/share/vm/interpreter/templateTable.hpp Fri Feb 11 15:31:58 2011 -0800 99.3 @@ -40,6 +40,12 @@ 99.4 #ifdef TARGET_ARCH_MODEL_zero 99.5 # include "interp_masm_zero.hpp" 99.6 #endif 99.7 +#ifdef TARGET_ARCH_MODEL_arm 99.8 +# include "interp_masm_arm.hpp" 99.9 +#endif 99.10 +#ifdef TARGET_ARCH_MODEL_ppc 99.11 +# include "interp_masm_ppc.hpp" 99.12 +#endif 99.13 99.14 #ifndef CC_INTERP 99.15 // All the necessary definitions used for (bytecode) template generation. Instead of 99.16 @@ -364,6 +370,12 @@ 99.17 #ifdef TARGET_ARCH_MODEL_zero 99.18 # include "templateTable_zero.hpp" 99.19 #endif 99.20 +#ifdef TARGET_ARCH_MODEL_arm 99.21 +# include "templateTable_arm.hpp" 99.22 +#endif 99.23 +#ifdef TARGET_ARCH_MODEL_ppc 99.24 +# include "templateTable_ppc.hpp" 99.25 +#endif 99.26 99.27 }; 99.28 #endif /* !CC_INTERP */
100.1 --- a/src/share/vm/oops/constantPoolOop.hpp Fri Feb 11 14:30:27 2011 -0800 100.2 +++ b/src/share/vm/oops/constantPoolOop.hpp Fri Feb 11 15:31:58 2011 -0800 100.3 @@ -39,6 +39,12 @@ 100.4 #ifdef TARGET_ARCH_zero 100.5 # include "bytes_zero.hpp" 100.6 #endif 100.7 +#ifdef TARGET_ARCH_arm 100.8 +# include "bytes_arm.hpp" 100.9 +#endif 100.10 +#ifdef TARGET_ARCH_ppc 100.11 +# include "bytes_ppc.hpp" 100.12 +#endif 100.13 100.14 // A constantPool is an array containing class constants as described in the 100.15 // class file.
101.1 --- a/src/share/vm/oops/oop.inline.hpp Fri Feb 11 14:30:27 2011 -0800 101.2 +++ b/src/share/vm/oops/oop.inline.hpp Fri Feb 11 15:31:58 2011 -0800 101.3 @@ -52,6 +52,12 @@ 101.4 #ifdef TARGET_ARCH_zero 101.5 # include "bytes_zero.hpp" 101.6 #endif 101.7 +#ifdef TARGET_ARCH_arm 101.8 +# include "bytes_arm.hpp" 101.9 +#endif 101.10 +#ifdef TARGET_ARCH_ppc 101.11 +# include "bytes_ppc.hpp" 101.12 +#endif 101.13 101.14 // Implementation of all inlined member functions defined in oop.hpp 101.15 // We need a separate file to avoid circular references
102.1 --- a/src/share/vm/oops/typeArrayOop.hpp Fri Feb 11 14:30:27 2011 -0800 102.2 +++ b/src/share/vm/oops/typeArrayOop.hpp Fri Feb 11 15:31:58 2011 -0800 102.3 @@ -45,6 +45,12 @@ 102.4 #ifdef TARGET_OS_ARCH_windows_x86 102.5 # include "orderAccess_windows_x86.inline.hpp" 102.6 #endif 102.7 +#ifdef TARGET_OS_ARCH_linux_arm 102.8 +# include "orderAccess_linux_arm.inline.hpp" 102.9 +#endif 102.10 +#ifdef TARGET_OS_ARCH_linux_ppc 102.11 +# include "orderAccess_linux_ppc.inline.hpp" 102.12 +#endif 102.13 102.14 // A typeArrayOop is an array containing basic types (non oop elements). 102.15 // It is used for arrays of {characters, singles, doubles, bytes, shorts, integers, longs}
103.1 --- a/src/share/vm/opto/buildOopMap.cpp Fri Feb 11 14:30:27 2011 -0800 103.2 +++ b/src/share/vm/opto/buildOopMap.cpp Fri Feb 11 15:31:58 2011 -0800 103.3 @@ -41,6 +41,12 @@ 103.4 #ifdef TARGET_ARCH_zero 103.5 # include "vmreg_zero.inline.hpp" 103.6 #endif 103.7 +#ifdef TARGET_ARCH_arm 103.8 +# include "vmreg_arm.inline.hpp" 103.9 +#endif 103.10 +#ifdef TARGET_ARCH_ppc 103.11 +# include "vmreg_ppc.inline.hpp" 103.12 +#endif 103.13 103.14 // The functions in this file builds OopMaps after all scheduling is done. 103.15 //
104.1 --- a/src/share/vm/opto/c2_globals.hpp Fri Feb 11 14:30:27 2011 -0800 104.2 +++ b/src/share/vm/opto/c2_globals.hpp Fri Feb 11 15:31:58 2011 -0800 104.3 @@ -32,6 +32,9 @@ 104.4 #ifdef TARGET_ARCH_sparc 104.5 # include "c2_globals_sparc.hpp" 104.6 #endif 104.7 +#ifdef TARGET_ARCH_arm 104.8 +# include "c2_globals_arm.hpp" 104.9 +#endif 104.10 #ifdef TARGET_OS_FAMILY_linux 104.11 # include "c2_globals_linux.hpp" 104.12 #endif
105.1 --- a/src/share/vm/opto/c2compiler.cpp Fri Feb 11 14:30:27 2011 -0800 105.2 +++ b/src/share/vm/opto/c2compiler.cpp Fri Feb 11 15:31:58 2011 -0800 105.3 @@ -37,6 +37,12 @@ 105.4 #ifdef TARGET_ARCH_MODEL_zero 105.5 # include "adfiles/ad_zero.hpp" 105.6 #endif 105.7 +#ifdef TARGET_ARCH_MODEL_arm 105.8 +# include "adfiles/ad_arm.hpp" 105.9 +#endif 105.10 +#ifdef TARGET_ARCH_MODEL_ppc 105.11 +# include "adfiles/ad_ppc.hpp" 105.12 +#endif 105.13 105.14 105.15 volatile int C2Compiler::_runtimes = uninitialized;
106.1 --- a/src/share/vm/opto/compile.cpp Fri Feb 11 14:30:27 2011 -0800 106.2 +++ b/src/share/vm/opto/compile.cpp Fri Feb 11 15:31:58 2011 -0800 106.3 @@ -74,6 +74,12 @@ 106.4 #ifdef TARGET_ARCH_MODEL_zero 106.5 # include "adfiles/ad_zero.hpp" 106.6 #endif 106.7 +#ifdef TARGET_ARCH_MODEL_arm 106.8 +# include "adfiles/ad_arm.hpp" 106.9 +#endif 106.10 +#ifdef TARGET_ARCH_MODEL_ppc 106.11 +# include "adfiles/ad_ppc.hpp" 106.12 +#endif 106.13 106.14 106.15 // -------------------- Compile::mach_constant_base_node -----------------------
107.1 --- a/src/share/vm/opto/gcm.cpp Fri Feb 11 14:30:27 2011 -0800 107.2 +++ b/src/share/vm/opto/gcm.cpp Fri Feb 11 15:31:58 2011 -0800 107.3 @@ -47,6 +47,12 @@ 107.4 #ifdef TARGET_ARCH_MODEL_zero 107.5 # include "adfiles/ad_zero.hpp" 107.6 #endif 107.7 +#ifdef TARGET_ARCH_MODEL_arm 107.8 +# include "adfiles/ad_arm.hpp" 107.9 +#endif 107.10 +#ifdef TARGET_ARCH_MODEL_ppc 107.11 +# include "adfiles/ad_ppc.hpp" 107.12 +#endif 107.13 107.14 // Portions of code courtesy of Clifford Click 107.15
108.1 --- a/src/share/vm/opto/locknode.hpp Fri Feb 11 14:30:27 2011 -0800 108.2 +++ b/src/share/vm/opto/locknode.hpp Fri Feb 11 15:31:58 2011 -0800 108.3 @@ -40,6 +40,12 @@ 108.4 #ifdef TARGET_ARCH_MODEL_zero 108.5 # include "adfiles/ad_zero.hpp" 108.6 #endif 108.7 +#ifdef TARGET_ARCH_MODEL_arm 108.8 +# include "adfiles/ad_arm.hpp" 108.9 +#endif 108.10 +#ifdef TARGET_ARCH_MODEL_ppc 108.11 +# include "adfiles/ad_ppc.hpp" 108.12 +#endif 108.13 108.14 //------------------------------BoxLockNode------------------------------------ 108.15 class BoxLockNode : public Node {
109.1 --- a/src/share/vm/opto/output.hpp Fri Feb 11 14:30:27 2011 -0800 109.2 +++ b/src/share/vm/opto/output.hpp Fri Feb 11 15:31:58 2011 -0800 109.3 @@ -39,6 +39,12 @@ 109.4 #ifdef TARGET_ARCH_MODEL_zero 109.5 # include "adfiles/ad_zero.hpp" 109.6 #endif 109.7 +#ifdef TARGET_ARCH_MODEL_arm 109.8 +# include "adfiles/ad_arm.hpp" 109.9 +#endif 109.10 +#ifdef TARGET_ARCH_MODEL_ppc 109.11 +# include "adfiles/ad_ppc.hpp" 109.12 +#endif 109.13 109.14 class Arena; 109.15 class Bundle;
110.1 --- a/src/share/vm/opto/regmask.cpp Fri Feb 11 14:30:27 2011 -0800 110.2 +++ b/src/share/vm/opto/regmask.cpp Fri Feb 11 15:31:58 2011 -0800 110.3 @@ -37,6 +37,12 @@ 110.4 #ifdef TARGET_ARCH_MODEL_zero 110.5 # include "adfiles/ad_zero.hpp" 110.6 #endif 110.7 +#ifdef TARGET_ARCH_MODEL_arm 110.8 +# include "adfiles/ad_arm.hpp" 110.9 +#endif 110.10 +#ifdef TARGET_ARCH_MODEL_ppc 110.11 +# include "adfiles/ad_ppc.hpp" 110.12 +#endif 110.13 110.14 #define RM_SIZE _RM_SIZE /* a constant private to the class RegMask */ 110.15
111.1 --- a/src/share/vm/opto/regmask.hpp Fri Feb 11 14:30:27 2011 -0800 111.2 +++ b/src/share/vm/opto/regmask.hpp Fri Feb 11 15:31:58 2011 -0800 111.3 @@ -40,6 +40,12 @@ 111.4 #ifdef TARGET_ARCH_MODEL_zero 111.5 # include "adfiles/adGlobals_zero.hpp" 111.6 #endif 111.7 +#ifdef TARGET_ARCH_MODEL_arm 111.8 +# include "adfiles/adGlobals_arm.hpp" 111.9 +#endif 111.10 +#ifdef TARGET_ARCH_MODEL_ppc 111.11 +# include "adfiles/adGlobals_ppc.hpp" 111.12 +#endif 111.13 111.14 // Some fun naming (textual) substitutions: 111.15 //
112.1 --- a/src/share/vm/opto/runtime.cpp Fri Feb 11 14:30:27 2011 -0800 112.2 +++ b/src/share/vm/opto/runtime.cpp Fri Feb 11 15:31:58 2011 -0800 112.3 @@ -80,6 +80,12 @@ 112.4 #ifdef TARGET_ARCH_MODEL_zero 112.5 # include "adfiles/ad_zero.hpp" 112.6 #endif 112.7 +#ifdef TARGET_ARCH_MODEL_arm 112.8 +# include "adfiles/ad_arm.hpp" 112.9 +#endif 112.10 +#ifdef TARGET_ARCH_MODEL_ppc 112.11 +# include "adfiles/ad_ppc.hpp" 112.12 +#endif 112.13 112.14 112.15 // For debugging purposes:
113.1 --- a/src/share/vm/prims/forte.cpp Fri Feb 11 14:30:27 2011 -0800 113.2 +++ b/src/share/vm/prims/forte.cpp Fri Feb 11 15:31:58 2011 -0800 113.3 @@ -520,6 +520,7 @@ 113.4 // method_id - jmethodID of the method being executed 113.5 113.6 extern "C" { 113.7 +JNIEXPORT 113.8 void AsyncGetCallTrace(ASGCT_CallTrace *trace, jint depth, void* ucontext) { 113.9 113.10 // This is if'd out because we no longer use thread suspension.
114.1 --- a/src/share/vm/prims/jniCheck.cpp Fri Feb 11 14:30:27 2011 -0800 114.2 +++ b/src/share/vm/prims/jniCheck.cpp Fri Feb 11 15:31:58 2011 -0800 114.3 @@ -45,6 +45,12 @@ 114.4 #ifdef TARGET_ARCH_zero 114.5 # include "jniTypes_zero.hpp" 114.6 #endif 114.7 +#ifdef TARGET_ARCH_arm 114.8 +# include "jniTypes_arm.hpp" 114.9 +#endif 114.10 +#ifdef TARGET_ARCH_ppc 114.11 +# include "jniTypes_ppc.hpp" 114.12 +#endif 114.13 114.14 114.15 // Heap objects are allowed to be directly referenced only in VM code,
115.1 --- a/src/share/vm/prims/jni_md.h Fri Feb 11 14:30:27 2011 -0800 115.2 +++ b/src/share/vm/prims/jni_md.h Fri Feb 11 15:31:58 2011 -0800 115.3 @@ -33,6 +33,12 @@ 115.4 #ifdef TARGET_ARCH_zero 115.5 # include "jni_zero.h" 115.6 #endif 115.7 +#ifdef TARGET_ARCH_arm 115.8 +# include "jni_arm.h" 115.9 +#endif 115.10 +#ifdef TARGET_ARCH_ppc 115.11 +# include "jni_ppc.h" 115.12 +#endif 115.13 115.14 115.15 /*
116.1 --- a/src/share/vm/prims/jvm.cpp Fri Feb 11 14:30:27 2011 -0800 116.2 +++ b/src/share/vm/prims/jvm.cpp Fri Feb 11 15:31:58 2011 -0800 116.3 @@ -2585,7 +2585,7 @@ 116.4 } 116.5 116.6 116.7 -int jio_printf(const char *fmt, ...) { 116.8 +JNIEXPORT int jio_printf(const char *fmt, ...) { 116.9 int len; 116.10 va_list args; 116.11 va_start(args, fmt);
117.1 --- a/src/share/vm/prims/jvm.h Fri Feb 11 14:30:27 2011 -0800 117.2 +++ b/src/share/vm/prims/jvm.h Fri Feb 11 15:31:58 2011 -0800 117.3 @@ -1417,16 +1417,16 @@ 117.4 * BE CAREFUL! The following functions do not implement the 117.5 * full feature set of standard C printf formats. 117.6 */ 117.7 -int 117.8 +JNIEXPORT int 117.9 jio_vsnprintf(char *str, size_t count, const char *fmt, va_list args); 117.10 117.11 -int 117.12 +JNIEXPORT int 117.13 jio_snprintf(char *str, size_t count, const char *fmt, ...); 117.14 117.15 -int 117.16 +JNIEXPORT int 117.17 jio_fprintf(FILE *, const char *fmt, ...); 117.18 117.19 -int 117.20 +JNIEXPORT int 117.21 jio_vfprintf(FILE *, const char *fmt, va_list args); 117.22 117.23
118.1 --- a/src/share/vm/prims/jvmtiClassFileReconstituter.cpp Fri Feb 11 14:30:27 2011 -0800 118.2 +++ b/src/share/vm/prims/jvmtiClassFileReconstituter.cpp Fri Feb 11 15:31:58 2011 -0800 118.3 @@ -36,6 +36,12 @@ 118.4 #ifdef TARGET_ARCH_zero 118.5 # include "bytes_zero.hpp" 118.6 #endif 118.7 +#ifdef TARGET_ARCH_arm 118.8 +# include "bytes_arm.hpp" 118.9 +#endif 118.10 +#ifdef TARGET_ARCH_ppc 118.11 +# include "bytes_ppc.hpp" 118.12 +#endif 118.13 // FIXME: add Deprecated, LVT, LVTT attributes 118.14 // FIXME: fix Synthetic attribute 118.15 // FIXME: per Serguei, add error return handling for constantPoolOopDesc::copy_cpool_bytes()
119.1 --- a/src/share/vm/prims/jvmtiExport.cpp Fri Feb 11 14:30:27 2011 -0800 119.2 +++ b/src/share/vm/prims/jvmtiExport.cpp Fri Feb 11 15:31:58 2011 -0800 119.3 @@ -1,5 +1,5 @@ 119.4 /* 119.5 - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. 119.6 + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. 119.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 119.8 * 119.9 * This code is free software; you can redistribute it and/or modify it 119.10 @@ -750,15 +750,12 @@ 119.11 // pending CompiledMethodUnload support 119.12 // 119.13 119.14 -bool JvmtiExport::_have_pending_compiled_method_unload_events; 119.15 -GrowableArray<jmethodID>* JvmtiExport::_pending_compiled_method_unload_method_ids; 119.16 -GrowableArray<const void *>* JvmtiExport::_pending_compiled_method_unload_code_begins; 119.17 -JavaThread* JvmtiExport::_current_poster; 119.18 - 119.19 -void JvmtiExport::post_compiled_method_unload_internal(JavaThread* self, jmethodID method, const void *code_begin) { 119.20 +void JvmtiExport::post_compiled_method_unload( 119.21 + jmethodID method, const void *code_begin) { 119.22 + JavaThread* thread = JavaThread::current(); 119.23 EVT_TRIG_TRACE(JVMTI_EVENT_COMPILED_METHOD_UNLOAD, 119.24 ("JVMTI [%s] method compile unload event triggered", 119.25 - JvmtiTrace::safe_get_thread_name(self))); 119.26 + JvmtiTrace::safe_get_thread_name(thread))); 119.27 119.28 // post the event for each environment that has this event enabled. 119.29 JvmtiEnvIterator it; 119.30 @@ -767,12 +764,12 @@ 119.31 119.32 EVT_TRACE(JVMTI_EVENT_COMPILED_METHOD_UNLOAD, 119.33 ("JVMTI [%s] class compile method unload event sent jmethodID " PTR_FORMAT, 119.34 - JvmtiTrace::safe_get_thread_name(self), method)); 119.35 + JvmtiTrace::safe_get_thread_name(thread), method)); 119.36 119.37 - ResourceMark rm(self); 119.38 + ResourceMark rm(thread); 119.39 119.40 - JvmtiEventMark jem(self); 119.41 - JvmtiJavaThreadEventTransition jet(self); 119.42 + JvmtiEventMark jem(thread); 119.43 + JvmtiJavaThreadEventTransition jet(thread); 119.44 jvmtiEventCompiledMethodUnload callback = env->callbacks()->CompiledMethodUnload; 119.45 if (callback != NULL) { 119.46 (*callback)(env->jvmti_external(), method, code_begin); 119.47 @@ -781,90 +778,6 @@ 119.48 } 119.49 } 119.50 119.51 -// post any pending CompiledMethodUnload events 119.52 - 119.53 -void JvmtiExport::post_pending_compiled_method_unload_events() { 119.54 - JavaThread* self = JavaThread::current(); 119.55 - assert(!self->owns_locks(), "can't hold locks"); 119.56 - 119.57 - // Indicates if this is the first activiation of this function. 119.58 - // In theory the profiler's callback could call back into VM and provoke 119.59 - // another CompiledMethodLoad event to be posted from this thread. As the 119.60 - // stack rewinds we need to ensure that the original activation does the 119.61 - // completion and notifies any waiters. 119.62 - bool first_activation = false; 119.63 - 119.64 - // the jmethodID (may not be valid) to be used for a single event 119.65 - jmethodID method; 119.66 - const void *code_begin; 119.67 - 119.68 - // grab the monitor and check if another thread is already posting 119.69 - // events. If there is another thread posting events then we wait 119.70 - // until it completes. (In theory we could check the pending events to 119.71 - // see if any of the addresses overlap with the event that we want to 119.72 - // post but as it will happen so rarely we just block any thread waiting 119.73 - // to post a CompiledMethodLoad or DynamicCodeGenerated event until all 119.74 - // pending CompiledMethodUnload events have been posted). 119.75 - // 119.76 - // If another thread isn't posting we examine the list of pending jmethodIDs. 119.77 - // If the list is empty then we are done. If it's not empty then this thread 119.78 - // (self) becomes the pending event poster and we remove the top (last) 119.79 - // event from the list. Note that this means we remove the newest event first 119.80 - // but as they are all CompiledMethodUnload events the order doesn't matter. 119.81 - // Once we have removed a jmethodID then we exit the monitor. Any other thread 119.82 - // wanting to post a CompiledMethodLoad or DynamicCodeGenerated event will 119.83 - // be forced to wait on the monitor. 119.84 - { 119.85 - MutexLocker mu(JvmtiPendingEvent_lock); 119.86 - if (_current_poster != self) { 119.87 - while (_current_poster != NULL) { 119.88 - JvmtiPendingEvent_lock->wait(); 119.89 - } 119.90 - } 119.91 - if ((_pending_compiled_method_unload_method_ids == NULL) || 119.92 - (_pending_compiled_method_unload_method_ids->length() == 0)) { 119.93 - return; 119.94 - } 119.95 - if (_current_poster == NULL) { 119.96 - _current_poster = self; 119.97 - first_activation = true; 119.98 - } else { 119.99 - // re-entrant 119.100 - guarantee(_current_poster == self, "checking"); 119.101 - } 119.102 - method = _pending_compiled_method_unload_method_ids->pop(); 119.103 - code_begin = _pending_compiled_method_unload_code_begins->pop(); 119.104 - } 119.105 - 119.106 - // This thread is the pending event poster so it first posts the CompiledMethodUnload 119.107 - // event for the jmethodID that has been removed from the list. Once posted it 119.108 - // re-grabs the monitor and checks the list again. If the list is empty then and this 119.109 - // is the first activation of the function then we reset the _have_pending_events 119.110 - // flag, cleanup _current_poster to indicate that no thread is now servicing the 119.111 - // pending events list, and finally notify any thread that might be waiting. 119.112 - for (;;) { 119.113 - post_compiled_method_unload_internal(self, method, code_begin); 119.114 - 119.115 - // event posted, now re-grab monitor and get the next event 119.116 - // If there's no next event then we are done. If this is the first 119.117 - // activiation of this function by this thread notify any waiters 119.118 - // so that they can post. 119.119 - { 119.120 - MutexLocker ml(JvmtiPendingEvent_lock); 119.121 - if (_pending_compiled_method_unload_method_ids->length() == 0) { 119.122 - if (first_activation) { 119.123 - _have_pending_compiled_method_unload_events = false; 119.124 - _current_poster = NULL; 119.125 - JvmtiPendingEvent_lock->notify_all(); 119.126 - } 119.127 - return; 119.128 - } 119.129 - method = _pending_compiled_method_unload_method_ids->pop(); 119.130 - code_begin = _pending_compiled_method_unload_code_begins->pop(); 119.131 - } 119.132 - } 119.133 -} 119.134 - 119.135 /////////////////////////////////////////////////////////////// 119.136 // 119.137 // JvmtiExport 119.138 @@ -1830,16 +1743,7 @@ 119.139 } 119.140 119.141 void JvmtiExport::post_compiled_method_load(nmethod *nm) { 119.142 - // If there are pending CompiledMethodUnload events then these are 119.143 - // posted before this CompiledMethodLoad event. We "lock" the nmethod and 119.144 - // maintain a handle to the methodOop to ensure that the nmethod isn't 119.145 - // flushed or unloaded while posting the events. 119.146 JavaThread* thread = JavaThread::current(); 119.147 - if (have_pending_compiled_method_unload_events()) { 119.148 - methodHandle mh(thread, nm->method()); 119.149 - nmethodLocker nml(nm); 119.150 - post_pending_compiled_method_unload_events(); 119.151 - } 119.152 119.153 EVT_TRIG_TRACE(JVMTI_EVENT_COMPILED_METHOD_LOAD, 119.154 ("JVMTI [%s] method compile load event triggered", 119.155 @@ -1854,8 +1758,8 @@ 119.156 JvmtiTrace::safe_get_thread_name(thread), 119.157 (nm->method() == NULL) ? "NULL" : nm->method()->klass_name()->as_C_string(), 119.158 (nm->method() == NULL) ? "NULL" : nm->method()->name()->as_C_string())); 119.159 - 119.160 ResourceMark rm(thread); 119.161 + HandleMark hm(thread); 119.162 119.163 // Add inlining information 119.164 jvmtiCompiledMethodLoadInlineRecord* inlinerecord = create_inline_record(nm); 119.165 @@ -1899,28 +1803,6 @@ 119.166 } 119.167 } 119.168 119.169 -// used at a safepoint to post a CompiledMethodUnload event 119.170 -void JvmtiExport::post_compiled_method_unload(jmethodID mid, const void *code_begin) { 119.171 - if (SafepointSynchronize::is_at_safepoint()) { 119.172 - // Class unloading can cause nmethod unloading which is reported 119.173 - // by the VMThread. These must be batched to be processed later. 119.174 - if (_pending_compiled_method_unload_method_ids == NULL) { 119.175 - // create list lazily 119.176 - _pending_compiled_method_unload_method_ids = new (ResourceObj::C_HEAP) GrowableArray<jmethodID>(10,true); 119.177 - _pending_compiled_method_unload_code_begins = new (ResourceObj::C_HEAP) GrowableArray<const void *>(10,true); 119.178 - } 119.179 - _pending_compiled_method_unload_method_ids->append(mid); 119.180 - _pending_compiled_method_unload_code_begins->append(code_begin); 119.181 - _have_pending_compiled_method_unload_events = true; 119.182 - } else { 119.183 - // Unloading caused by the sweeper can be reported synchronously. 119.184 - if (have_pending_compiled_method_unload_events()) { 119.185 - post_pending_compiled_method_unload_events(); 119.186 - } 119.187 - post_compiled_method_unload_internal(JavaThread::current(), mid, code_begin); 119.188 - } 119.189 -} 119.190 - 119.191 void JvmtiExport::post_dynamic_code_generated_internal(const char *name, const void *code_begin, const void *code_end) { 119.192 JavaThread* thread = JavaThread::current(); 119.193 EVT_TRIG_TRACE(JVMTI_EVENT_DYNAMIC_CODE_GENERATED, 119.194 @@ -1953,9 +1835,9 @@ 119.195 return; 119.196 } 119.197 119.198 - if (have_pending_compiled_method_unload_events()) { 119.199 - post_pending_compiled_method_unload_events(); 119.200 - } 119.201 + // Blocks until everything now in the queue has been posted 119.202 + JvmtiDeferredEventQueue::flush_queue(Thread::current()); 119.203 + 119.204 post_dynamic_code_generated_internal(name, code_begin, code_end); 119.205 } 119.206
120.1 --- a/src/share/vm/prims/jvmtiExport.hpp Fri Feb 11 14:30:27 2011 -0800 120.2 +++ b/src/share/vm/prims/jvmtiExport.hpp Fri Feb 11 15:31:58 2011 -0800 120.3 @@ -1,5 +1,5 @@ 120.4 /* 120.5 - * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. 120.6 + * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved. 120.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 120.8 * 120.9 * This code is free software; you can redistribute it and/or modify it 120.10 @@ -141,25 +141,6 @@ 120.11 120.12 120.13 private: 120.14 - // CompiledMethodUnload events are reported from the VM thread so they 120.15 - // are collected in lists (of jmethodID/addresses) and the events are posted later 120.16 - // from threads posting CompieldMethodLoad or DynamicCodeGenerated events. 120.17 - static bool _have_pending_compiled_method_unload_events; 120.18 - static GrowableArray<jmethodID>* _pending_compiled_method_unload_method_ids; 120.19 - static GrowableArray<const void *>* _pending_compiled_method_unload_code_begins; 120.20 - static JavaThread* _current_poster; 120.21 - 120.22 - // tests if there are CompiledMethodUnload events pending 120.23 - inline static bool have_pending_compiled_method_unload_events() { 120.24 - return _have_pending_compiled_method_unload_events; 120.25 - } 120.26 - 120.27 - // posts any pending CompiledMethodUnload events. 120.28 - static void post_pending_compiled_method_unload_events(); 120.29 - 120.30 - // Perform the actual notification to interested JvmtiEnvs. 120.31 - static void post_compiled_method_unload_internal(JavaThread* self, jmethodID mid, const void* code_begin); 120.32 - 120.33 // posts a DynamicCodeGenerated event (internal/private implementation). 120.34 // The public post_dynamic_code_generated* functions make use of the 120.35 // internal implementation. 120.36 @@ -256,7 +237,7 @@ 120.37 // single stepping management methods 120.38 static void at_single_stepping_point(JavaThread *thread, methodOop method, address location) KERNEL_RETURN; 120.39 static void expose_single_stepping(JavaThread *thread) KERNEL_RETURN; 120.40 - static bool hide_single_stepping(JavaThread *thread) KERNEL_RETURN_(return false;); 120.41 + static bool hide_single_stepping(JavaThread *thread) KERNEL_RETURN_(false); 120.42 120.43 // Methods that notify the debugger that something interesting has happened in the VM. 120.44 static void post_vm_start (); 120.45 @@ -271,20 +252,20 @@ 120.46 120.47 static oop jni_GetField_probe (JavaThread *thread, jobject jobj, 120.48 oop obj, klassOop klass, jfieldID fieldID, bool is_static) 120.49 - KERNEL_RETURN_(return NULL;); 120.50 + KERNEL_RETURN_(NULL); 120.51 static oop jni_GetField_probe_nh (JavaThread *thread, jobject jobj, 120.52 oop obj, klassOop klass, jfieldID fieldID, bool is_static) 120.53 - KERNEL_RETURN_(return NULL;); 120.54 + KERNEL_RETURN_(NULL); 120.55 static void post_field_access_by_jni (JavaThread *thread, oop obj, 120.56 klassOop klass, jfieldID fieldID, bool is_static) KERNEL_RETURN; 120.57 static void post_field_access (JavaThread *thread, methodOop method, 120.58 address location, KlassHandle field_klass, Handle object, jfieldID field) KERNEL_RETURN; 120.59 static oop jni_SetField_probe (JavaThread *thread, jobject jobj, 120.60 oop obj, klassOop klass, jfieldID fieldID, bool is_static, char sig_type, 120.61 - jvalue *value) KERNEL_RETURN_(return NULL;); 120.62 + jvalue *value) KERNEL_RETURN_(NULL); 120.63 static oop jni_SetField_probe_nh (JavaThread *thread, jobject jobj, 120.64 oop obj, klassOop klass, jfieldID fieldID, bool is_static, char sig_type, 120.65 - jvalue *value) KERNEL_RETURN_(return NULL;); 120.66 + jvalue *value) KERNEL_RETURN_(NULL); 120.67 static void post_field_modification_by_jni(JavaThread *thread, oop obj, 120.68 klassOop klass, jfieldID fieldID, bool is_static, char sig_type, 120.69 jvalue *value);
121.1 --- a/src/share/vm/prims/jvmtiImpl.cpp Fri Feb 11 14:30:27 2011 -0800 121.2 +++ b/src/share/vm/prims/jvmtiImpl.cpp Fri Feb 11 15:31:58 2011 -0800 121.3 @@ -1,5 +1,5 @@ 121.4 /* 121.5 - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. 121.6 + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. 121.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 121.8 * 121.9 * This code is free software; you can redistribute it and/or modify it 121.10 @@ -32,11 +32,13 @@ 121.11 #include "prims/jvmtiEventController.inline.hpp" 121.12 #include "prims/jvmtiImpl.hpp" 121.13 #include "prims/jvmtiRedefineClasses.hpp" 121.14 +#include "runtime/atomic.hpp" 121.15 #include "runtime/deoptimization.hpp" 121.16 #include "runtime/handles.hpp" 121.17 #include "runtime/handles.inline.hpp" 121.18 #include "runtime/interfaceSupport.hpp" 121.19 #include "runtime/javaCalls.hpp" 121.20 +#include "runtime/serviceThread.hpp" 121.21 #include "runtime/signature.hpp" 121.22 #include "runtime/vframe.hpp" 121.23 #include "runtime/vframe_hp.hpp" 121.24 @@ -910,3 +912,207 @@ 121.25 tty->print_cr("]"); 121.26 #endif 121.27 } 121.28 + 121.29 +#ifndef KERNEL 121.30 + 121.31 +JvmtiDeferredEvent JvmtiDeferredEvent::compiled_method_load_event( 121.32 + nmethod* nm) { 121.33 + JvmtiDeferredEvent event = JvmtiDeferredEvent(TYPE_COMPILED_METHOD_LOAD); 121.34 + event.set_compiled_method_load(nm); 121.35 + nmethodLocker::lock_nmethod(nm); // will be unlocked when posted 121.36 + return event; 121.37 +} 121.38 + 121.39 +JvmtiDeferredEvent JvmtiDeferredEvent::compiled_method_unload_event( 121.40 + jmethodID id, const void* code) { 121.41 + JvmtiDeferredEvent event = JvmtiDeferredEvent(TYPE_COMPILED_METHOD_UNLOAD); 121.42 + event.set_compiled_method_unload(id, code); 121.43 + return event; 121.44 +} 121.45 + 121.46 +void JvmtiDeferredEvent::post() { 121.47 + switch(_type) { 121.48 + case TYPE_COMPILED_METHOD_LOAD: 121.49 + JvmtiExport::post_compiled_method_load(compiled_method_load()); 121.50 + nmethodLocker::unlock_nmethod(compiled_method_load()); 121.51 + break; 121.52 + case TYPE_COMPILED_METHOD_UNLOAD: 121.53 + JvmtiExport::post_compiled_method_unload( 121.54 + compiled_method_unload_method_id(), 121.55 + compiled_method_unload_code_begin()); 121.56 + break; 121.57 + case TYPE_FLUSH: 121.58 + JvmtiDeferredEventQueue::flush_complete(flush_state_addr()); 121.59 + break; 121.60 + default: 121.61 + ShouldNotReachHere(); 121.62 + } 121.63 +} 121.64 + 121.65 +JvmtiDeferredEventQueue::QueueNode* JvmtiDeferredEventQueue::_queue_tail = NULL; 121.66 +JvmtiDeferredEventQueue::QueueNode* JvmtiDeferredEventQueue::_queue_head = NULL; 121.67 + 121.68 +volatile JvmtiDeferredEventQueue::QueueNode* 121.69 + JvmtiDeferredEventQueue::_pending_list = NULL; 121.70 + 121.71 +bool JvmtiDeferredEventQueue::has_events() { 121.72 + assert(Service_lock->owned_by_self(), "Must own Service_lock"); 121.73 + return _queue_head != NULL || _pending_list != NULL; 121.74 +} 121.75 + 121.76 +void JvmtiDeferredEventQueue::enqueue(const JvmtiDeferredEvent& event) { 121.77 + assert(Service_lock->owned_by_self(), "Must own Service_lock"); 121.78 + 121.79 + process_pending_events(); 121.80 + 121.81 + // Events get added to the end of the queue (and are pulled off the front). 121.82 + QueueNode* node = new QueueNode(event); 121.83 + if (_queue_tail == NULL) { 121.84 + _queue_tail = _queue_head = node; 121.85 + } else { 121.86 + assert(_queue_tail->next() == NULL, "Must be the last element in the list"); 121.87 + _queue_tail->set_next(node); 121.88 + _queue_tail = node; 121.89 + } 121.90 + 121.91 + Service_lock->notify_all(); 121.92 + assert((_queue_head == NULL) == (_queue_tail == NULL), 121.93 + "Inconsistent queue markers"); 121.94 +} 121.95 + 121.96 +JvmtiDeferredEvent JvmtiDeferredEventQueue::dequeue() { 121.97 + assert(Service_lock->owned_by_self(), "Must own Service_lock"); 121.98 + 121.99 + process_pending_events(); 121.100 + 121.101 + assert(_queue_head != NULL, "Nothing to dequeue"); 121.102 + 121.103 + if (_queue_head == NULL) { 121.104 + // Just in case this happens in product; it shouldn't but let's not crash 121.105 + return JvmtiDeferredEvent(); 121.106 + } 121.107 + 121.108 + QueueNode* node = _queue_head; 121.109 + _queue_head = _queue_head->next(); 121.110 + if (_queue_head == NULL) { 121.111 + _queue_tail = NULL; 121.112 + } 121.113 + 121.114 + assert((_queue_head == NULL) == (_queue_tail == NULL), 121.115 + "Inconsistent queue markers"); 121.116 + 121.117 + JvmtiDeferredEvent event = node->event(); 121.118 + delete node; 121.119 + return event; 121.120 +} 121.121 + 121.122 +void JvmtiDeferredEventQueue::add_pending_event( 121.123 + const JvmtiDeferredEvent& event) { 121.124 + 121.125 + QueueNode* node = new QueueNode(event); 121.126 + 121.127 + bool success = false; 121.128 + QueueNode* prev_value = (QueueNode*)_pending_list; 121.129 + do { 121.130 + node->set_next(prev_value); 121.131 + prev_value = (QueueNode*)Atomic::cmpxchg_ptr( 121.132 + (void*)node, (volatile void*)&_pending_list, (void*)node->next()); 121.133 + } while (prev_value != node->next()); 121.134 +} 121.135 + 121.136 +// This method transfers any events that were added by someone NOT holding 121.137 +// the lock into the mainline queue. 121.138 +void JvmtiDeferredEventQueue::process_pending_events() { 121.139 + assert(Service_lock->owned_by_self(), "Must own Service_lock"); 121.140 + 121.141 + if (_pending_list != NULL) { 121.142 + QueueNode* head = 121.143 + (QueueNode*)Atomic::xchg_ptr(NULL, (volatile void*)&_pending_list); 121.144 + 121.145 + assert((_queue_head == NULL) == (_queue_tail == NULL), 121.146 + "Inconsistent queue markers"); 121.147 + 121.148 + if (head != NULL) { 121.149 + // Since we've treated the pending list as a stack (with newer 121.150 + // events at the beginning), we need to join the bottom of the stack 121.151 + // with the 'tail' of the queue in order to get the events in the 121.152 + // right order. We do this by reversing the pending list and appending 121.153 + // it to the queue. 121.154 + 121.155 + QueueNode* new_tail = head; 121.156 + QueueNode* new_head = NULL; 121.157 + 121.158 + // This reverses the list 121.159 + QueueNode* prev = new_tail; 121.160 + QueueNode* node = new_tail->next(); 121.161 + new_tail->set_next(NULL); 121.162 + while (node != NULL) { 121.163 + QueueNode* next = node->next(); 121.164 + node->set_next(prev); 121.165 + prev = node; 121.166 + node = next; 121.167 + } 121.168 + new_head = prev; 121.169 + 121.170 + // Now append the new list to the queue 121.171 + if (_queue_tail != NULL) { 121.172 + _queue_tail->set_next(new_head); 121.173 + } else { // _queue_head == NULL 121.174 + _queue_head = new_head; 121.175 + } 121.176 + _queue_tail = new_tail; 121.177 + } 121.178 + } 121.179 +} 121.180 + 121.181 +enum { 121.182 + // Random - used for debugging 121.183 + FLUSHING = 0x50403020, 121.184 + FLUSHED = 0x09080706 121.185 +}; 121.186 + 121.187 +void JvmtiDeferredEventQueue::flush_queue(Thread* thread) { 121.188 + 121.189 + volatile int flush_state = FLUSHING; 121.190 + 121.191 + JvmtiDeferredEvent flush(JvmtiDeferredEvent::TYPE_FLUSH); 121.192 + flush.set_flush_state_addr((int*)&flush_state); 121.193 + 121.194 + if (ServiceThread::is_service_thread(thread)) { 121.195 + // If we are the service thread we have to post all preceding events 121.196 + // Use the flush event as a token to indicate when we can stop 121.197 + JvmtiDeferredEvent event; 121.198 + { 121.199 + MutexLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag); 121.200 + enqueue(flush); 121.201 + event = dequeue(); 121.202 + } 121.203 + while (!event.is_flush_event() || 121.204 + event.flush_state_addr() != &flush_state) { 121.205 + event.post(); 121.206 + { 121.207 + MutexLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag); 121.208 + event = dequeue(); 121.209 + } 121.210 + } 121.211 + } else { 121.212 + // Wake up the service thread so it will process events. When it gets 121.213 + // to the flush event it will set 'flush_complete' and notify us. 121.214 + MutexLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag); 121.215 + enqueue(flush); 121.216 + while (flush_state != FLUSHED) { 121.217 + assert(flush_state == FLUSHING || flush_state == FLUSHED, 121.218 + "only valid values for this"); 121.219 + Service_lock->wait(Mutex::_no_safepoint_check_flag); 121.220 + } 121.221 + } 121.222 +} 121.223 + 121.224 +void JvmtiDeferredEventQueue::flush_complete(int* state_addr) { 121.225 + assert(state_addr != NULL && *state_addr == FLUSHING, "must be"); 121.226 + MutexLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag); 121.227 + *state_addr = FLUSHED; 121.228 + Service_lock->notify_all(); 121.229 +} 121.230 + 121.231 +#endif // ndef KERNEL
122.1 --- a/src/share/vm/prims/jvmtiImpl.hpp Fri Feb 11 14:30:27 2011 -0800 122.2 +++ b/src/share/vm/prims/jvmtiImpl.hpp Fri Feb 11 15:31:58 2011 -0800 122.3 @@ -1,5 +1,5 @@ 122.4 /* 122.5 - * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. 122.6 + * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. 122.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 122.8 * 122.9 * This code is free software; you can redistribute it and/or modify it 122.10 @@ -433,6 +433,149 @@ 122.11 122.12 #endif // !JVMTI_KERNEL 122.13 122.14 +/** 122.15 + * When a thread (such as the compiler thread or VM thread) cannot post a 122.16 + * JVMTI event itself because the event needs to be posted from a Java 122.17 + * thread, then it can defer the event to the Service thread for posting. 122.18 + * The information needed to post the event is encapsulated into this class 122.19 + * and then enqueued onto the JvmtiDeferredEventQueue, where the Service 122.20 + * thread will pick it up and post it. 122.21 + * 122.22 + * This is currently only used for posting compiled-method-load and unload 122.23 + * events, which we don't want posted from the compiler thread. 122.24 + */ 122.25 +class JvmtiDeferredEvent VALUE_OBJ_CLASS_SPEC { 122.26 + friend class JvmtiDeferredEventQueue; 122.27 + private: 122.28 + typedef enum { 122.29 + TYPE_NONE, 122.30 + TYPE_COMPILED_METHOD_LOAD, 122.31 + TYPE_COMPILED_METHOD_UNLOAD, 122.32 + TYPE_FLUSH // pseudo-event used to implement flush_queue() 122.33 + } Type; 122.34 + 122.35 + Type _type; 122.36 + union { 122.37 + nmethod* compiled_method_load; 122.38 + struct { 122.39 + jmethodID method_id; 122.40 + const void* code_begin; 122.41 + } compiled_method_unload; 122.42 + int* flush_state_addr; 122.43 + } _event_data; 122.44 + 122.45 + JvmtiDeferredEvent(Type t) : _type(t) {} 122.46 + 122.47 + void set_compiled_method_load(nmethod* nm) { 122.48 + assert(_type == TYPE_COMPILED_METHOD_LOAD, "must be"); 122.49 + _event_data.compiled_method_load = nm; 122.50 + } 122.51 + 122.52 + nmethod* compiled_method_load() const { 122.53 + assert(_type == TYPE_COMPILED_METHOD_LOAD, "must be"); 122.54 + return _event_data.compiled_method_load; 122.55 + } 122.56 + 122.57 + void set_compiled_method_unload(jmethodID id, const void* code) { 122.58 + assert(_type == TYPE_COMPILED_METHOD_UNLOAD, "must be"); 122.59 + _event_data.compiled_method_unload.method_id = id; 122.60 + _event_data.compiled_method_unload.code_begin = code; 122.61 + } 122.62 + 122.63 + jmethodID compiled_method_unload_method_id() const { 122.64 + assert(_type == TYPE_COMPILED_METHOD_UNLOAD, "must be"); 122.65 + return _event_data.compiled_method_unload.method_id; 122.66 + } 122.67 + 122.68 + const void* compiled_method_unload_code_begin() const { 122.69 + assert(_type == TYPE_COMPILED_METHOD_UNLOAD, "must be"); 122.70 + return _event_data.compiled_method_unload.code_begin; 122.71 + } 122.72 + 122.73 + bool is_flush_event() const { return _type == TYPE_FLUSH; } 122.74 + 122.75 + int* flush_state_addr() const { 122.76 + assert(is_flush_event(), "must be"); 122.77 + return _event_data.flush_state_addr; 122.78 + } 122.79 + 122.80 + void set_flush_state_addr(int* flag) { 122.81 + assert(is_flush_event(), "must be"); 122.82 + _event_data.flush_state_addr = flag; 122.83 + } 122.84 + 122.85 + public: 122.86 + 122.87 + JvmtiDeferredEvent() : _type(TYPE_NONE) {} 122.88 + 122.89 + // Factory methods 122.90 + static JvmtiDeferredEvent compiled_method_load_event(nmethod* nm) 122.91 + KERNEL_RETURN_(JvmtiDeferredEvent()); 122.92 + static JvmtiDeferredEvent compiled_method_unload_event( 122.93 + jmethodID id, const void* code) KERNEL_RETURN_(JvmtiDeferredEvent()); 122.94 + 122.95 + // Actually posts the event. 122.96 + void post() KERNEL_RETURN; 122.97 +}; 122.98 + 122.99 +/** 122.100 + * Events enqueued on this queue wake up the Service thread which dequeues 122.101 + * and posts the events. The Service_lock is required to be held 122.102 + * when operating on the queue (except for the "pending" events). 122.103 + */ 122.104 +class JvmtiDeferredEventQueue : AllStatic { 122.105 + friend class JvmtiDeferredEvent; 122.106 + private: 122.107 + class QueueNode : public CHeapObj { 122.108 + private: 122.109 + JvmtiDeferredEvent _event; 122.110 + QueueNode* _next; 122.111 + 122.112 + public: 122.113 + QueueNode(const JvmtiDeferredEvent& event) 122.114 + : _event(event), _next(NULL) {} 122.115 + 122.116 + const JvmtiDeferredEvent& event() const { return _event; } 122.117 + QueueNode* next() const { return _next; } 122.118 + 122.119 + void set_next(QueueNode* next) { _next = next; } 122.120 + }; 122.121 + 122.122 + static QueueNode* _queue_head; // Hold Service_lock to access 122.123 + static QueueNode* _queue_tail; // Hold Service_lock to access 122.124 + static volatile QueueNode* _pending_list; // Uses CAS for read/update 122.125 + 122.126 + // Transfers events from the _pending_list to the _queue. 122.127 + static void process_pending_events() KERNEL_RETURN; 122.128 + 122.129 + static void flush_complete(int* flush_state) KERNEL_RETURN; 122.130 + 122.131 + public: 122.132 + // Must be holding Service_lock when calling these 122.133 + static bool has_events() KERNEL_RETURN_(false); 122.134 + static void enqueue(const JvmtiDeferredEvent& event) KERNEL_RETURN; 122.135 + static JvmtiDeferredEvent dequeue() KERNEL_RETURN_(JvmtiDeferredEvent()); 122.136 + 122.137 + // This call blocks until all events enqueued prior to this call 122.138 + // have been posted. The Service_lock is acquired and waited upon. 122.139 + // 122.140 + // Implemented by creating a "flush" event and placing it in the queue. 122.141 + // When the flush event is "posted" it will call flush_complete(), which 122.142 + // will release the caller. 122.143 + // 122.144 + // Can be called by any thread (maybe even the service thread itself). 122.145 + // Not necessary for the caller to be a JavaThread. 122.146 + static void flush_queue(Thread* current) KERNEL_RETURN; 122.147 + 122.148 + // Used to enqueue events without using a lock, for times (such as during 122.149 + // safepoint) when we can't or don't want to lock the Service_lock. 122.150 + // 122.151 + // Events will be held off to the side until there's a call to 122.152 + // dequeue(), enqueue(), or process_pending_events() (all of which require 122.153 + // the holding of the Service_lock), and will be enqueued at that time. 122.154 + static void add_pending_event(const JvmtiDeferredEvent&) KERNEL_RETURN; 122.155 +}; 122.156 + 122.157 // Utility macro that checks for NULL pointers: 122.158 #define NULL_CHECK(X, Y) if ((X) == NULL) { return (Y); } 122.159
123.1 --- a/src/share/vm/runtime/deoptimization.cpp Fri Feb 11 14:30:27 2011 -0800 123.2 +++ b/src/share/vm/runtime/deoptimization.cpp Fri Feb 11 15:31:58 2011 -0800 123.3 @@ -59,6 +59,12 @@ 123.4 #ifdef TARGET_ARCH_zero 123.5 # include "vmreg_zero.inline.hpp" 123.6 #endif 123.7 +#ifdef TARGET_ARCH_arm 123.8 +# include "vmreg_arm.inline.hpp" 123.9 +#endif 123.10 +#ifdef TARGET_ARCH_ppc 123.11 +# include "vmreg_ppc.inline.hpp" 123.12 +#endif 123.13 #ifdef COMPILER2 123.14 #ifdef TARGET_ARCH_MODEL_x86_32 123.15 # include "adfiles/ad_x86_32.hpp" 123.16 @@ -72,6 +78,12 @@ 123.17 #ifdef TARGET_ARCH_MODEL_zero 123.18 # include "adfiles/ad_zero.hpp" 123.19 #endif 123.20 +#ifdef TARGET_ARCH_MODEL_arm 123.21 +# include "adfiles/ad_arm.hpp" 123.22 +#endif 123.23 +#ifdef TARGET_ARCH_MODEL_ppc 123.24 +# include "adfiles/ad_ppc.hpp" 123.25 +#endif 123.26 #endif 123.27 123.28 bool DeoptimizationMarker::_is_active = false;
124.1 --- a/src/share/vm/runtime/dtraceJSDT.hpp Fri Feb 11 14:30:27 2011 -0800 124.2 +++ b/src/share/vm/runtime/dtraceJSDT.hpp Fri Feb 11 15:31:58 2011 -0800 124.3 @@ -35,6 +35,12 @@ 124.4 #ifdef TARGET_ARCH_zero 124.5 # include "nativeInst_zero.hpp" 124.6 #endif 124.7 +#ifdef TARGET_ARCH_arm 124.8 +# include "nativeInst_arm.hpp" 124.9 +#endif 124.10 +#ifdef TARGET_ARCH_ppc 124.11 +# include "nativeInst_ppc.hpp" 124.12 +#endif 124.13 124.14 class RegisteredProbes; 124.15 typedef jlong OpaqueProbes;
125.1 --- a/src/share/vm/runtime/fprofiler.hpp Fri Feb 11 14:30:27 2011 -0800 125.2 +++ b/src/share/vm/runtime/fprofiler.hpp Fri Feb 11 15:31:58 2011 -0800 125.3 @@ -231,13 +231,13 @@ 125.4 static void engage(JavaThread* mainThread, bool fullProfile) KERNEL_RETURN ; 125.5 static void disengage() KERNEL_RETURN ; 125.6 static void print(int unused) KERNEL_RETURN ; 125.7 - static bool is_active() KERNEL_RETURN_(return false;) ; 125.8 + static bool is_active() KERNEL_RETURN_(false) ; 125.9 125.10 // This is NULL if each thread has its own thread profiler, 125.11 // else this is the single thread profiler used by all threads. 125.12 // In particular it makes a difference during garbage collection, 125.13 // where you only want to traverse each thread profiler once. 125.14 - static ThreadProfiler* get_thread_profiler() KERNEL_RETURN_(return NULL;); 125.15 + static ThreadProfiler* get_thread_profiler() KERNEL_RETURN_(NULL); 125.16 125.17 // Garbage Collection Support 125.18 static void oops_do(OopClosure* f) KERNEL_RETURN ; 125.19 @@ -246,13 +246,13 @@ 125.20 125.21 // Returns the start address for a given pc 125.22 // NULL is returned if the PCRecorder is inactive 125.23 - static address bucket_start_for(address pc) KERNEL_RETURN_(return NULL;); 125.24 + static address bucket_start_for(address pc) KERNEL_RETURN_(NULL); 125.25 125.26 enum { MillisecsPerTick = 10 }; // ms per profiling ticks 125.27 125.28 // Returns the number of ticks recorded for the bucket 125.29 // pc belongs to. 125.30 - static int bucket_count_for(address pc) KERNEL_RETURN_(return 0;); 125.31 + static int bucket_count_for(address pc) KERNEL_RETURN_(0); 125.32 125.33 #ifndef FPROF_KERNEL 125.34
126.1 --- a/src/share/vm/runtime/frame.cpp Fri Feb 11 14:30:27 2011 -0800 126.2 +++ b/src/share/vm/runtime/frame.cpp Fri Feb 11 15:31:58 2011 -0800 126.3 @@ -52,6 +52,12 @@ 126.4 #ifdef TARGET_ARCH_zero 126.5 # include "nativeInst_zero.hpp" 126.6 #endif 126.7 +#ifdef TARGET_ARCH_arm 126.8 +# include "nativeInst_arm.hpp" 126.9 +#endif 126.10 +#ifdef TARGET_ARCH_ppc 126.11 +# include "nativeInst_ppc.hpp" 126.12 +#endif 126.13 126.14 RegisterMap::RegisterMap(JavaThread *thread, bool update_map) { 126.15 _thread = thread;
127.1 --- a/src/share/vm/runtime/frame.hpp Fri Feb 11 14:30:27 2011 -0800 127.2 +++ b/src/share/vm/runtime/frame.hpp Fri Feb 11 15:31:58 2011 -0800 127.3 @@ -44,6 +44,12 @@ 127.4 #ifdef TARGET_ARCH_MODEL_zero 127.5 # include "adfiles/adGlobals_zero.hpp" 127.6 #endif 127.7 +#ifdef TARGET_ARCH_MODEL_arm 127.8 +# include "adfiles/adGlobals_arm.hpp" 127.9 +#endif 127.10 +#ifdef TARGET_ARCH_MODEL_ppc 127.11 +# include "adfiles/adGlobals_ppc.hpp" 127.12 +#endif 127.13 #endif 127.14 #ifdef ZERO 127.15 #ifdef TARGET_ARCH_zero 127.16 @@ -457,6 +463,12 @@ 127.17 #ifdef TARGET_ARCH_zero 127.18 # include "frame_zero.hpp" 127.19 #endif 127.20 +#ifdef TARGET_ARCH_arm 127.21 +# include "frame_arm.hpp" 127.22 +#endif 127.23 +#ifdef TARGET_ARCH_ppc 127.24 +# include "frame_ppc.hpp" 127.25 +#endif 127.26 127.27 }; 127.28
128.1 --- a/src/share/vm/runtime/frame.inline.hpp Fri Feb 11 14:30:27 2011 -0800 128.2 +++ b/src/share/vm/runtime/frame.inline.hpp Fri Feb 11 15:31:58 2011 -0800 128.3 @@ -40,6 +40,12 @@ 128.4 #ifdef TARGET_ARCH_zero 128.5 # include "jniTypes_zero.hpp" 128.6 #endif 128.7 +#ifdef TARGET_ARCH_arm 128.8 +# include "jniTypes_arm.hpp" 128.9 +#endif 128.10 +#ifdef TARGET_ARCH_ppc 128.11 +# include "jniTypes_ppc.hpp" 128.12 +#endif 128.13 #ifdef ZERO 128.14 #ifdef TARGET_ARCH_zero 128.15 # include "entryFrame_zero.hpp" 128.16 @@ -88,6 +94,12 @@ 128.17 #ifdef TARGET_ARCH_zero 128.18 # include "frame_zero.inline.hpp" 128.19 #endif 128.20 +#ifdef TARGET_ARCH_arm 128.21 +# include "frame_arm.inline.hpp" 128.22 +#endif 128.23 +#ifdef TARGET_ARCH_ppc 128.24 +# include "frame_ppc.inline.hpp" 128.25 +#endif 128.26 128.27 128.28 #endif // SHARE_VM_RUNTIME_FRAME_INLINE_HPP
129.1 --- a/src/share/vm/runtime/globals.hpp Fri Feb 11 14:30:27 2011 -0800 129.2 +++ b/src/share/vm/runtime/globals.hpp Fri Feb 11 15:31:58 2011 -0800 129.3 @@ -1,5 +1,5 @@ 129.4 /* 129.5 - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 129.6 + * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. 129.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 129.8 * 129.9 * This code is free software; you can redistribute it and/or modify it 129.10 @@ -35,6 +35,12 @@ 129.11 #ifdef TARGET_ARCH_zero 129.12 # include "globals_zero.hpp" 129.13 #endif 129.14 +#ifdef TARGET_ARCH_arm 129.15 +# include "globals_arm.hpp" 129.16 +#endif 129.17 +#ifdef TARGET_ARCH_ppc 129.18 +# include "globals_ppc.hpp" 129.19 +#endif 129.20 #ifdef TARGET_OS_FAMILY_linux 129.21 # include "globals_linux.hpp" 129.22 #endif 129.23 @@ -62,6 +68,12 @@ 129.24 #ifdef TARGET_OS_ARCH_windows_x86 129.25 # include "globals_windows_x86.hpp" 129.26 #endif 129.27 +#ifdef TARGET_OS_ARCH_linux_arm 129.28 +# include "globals_linux_arm.hpp" 129.29 +#endif 129.30 +#ifdef TARGET_OS_ARCH_linux_ppc 129.31 +# include "globals_linux_ppc.hpp" 129.32 +#endif 129.33 #ifdef COMPILER1 129.34 #ifdef TARGET_ARCH_x86 129.35 # include "c1_globals_x86.hpp" 129.36 @@ -69,6 +81,12 @@ 129.37 #ifdef TARGET_ARCH_sparc 129.38 # include "c1_globals_sparc.hpp" 129.39 #endif 129.40 +#ifdef TARGET_ARCH_arm 129.41 +# include "c1_globals_arm.hpp" 129.42 +#endif 129.43 +#ifdef TARGET_ARCH_ppc 129.44 +# include "c1_globals_ppc.hpp" 129.45 +#endif 129.46 #ifdef TARGET_OS_FAMILY_linux 129.47 # include "c1_globals_linux.hpp" 129.48 #endif 129.49 @@ -86,6 +104,9 @@ 129.50 #ifdef TARGET_ARCH_sparc 129.51 # include "c2_globals_sparc.hpp" 129.52 #endif 129.53 +#ifdef TARGET_ARCH_arm 129.54 +# include "c2_globals_arm.hpp" 129.55 +#endif 129.56 #ifdef TARGET_OS_FAMILY_linux 129.57 # include "c2_globals_linux.hpp" 129.58 #endif 129.59 @@ -410,7 +431,14 @@ 129.60 product_pd(bool, UseMembar, \ 129.61 "(Unstable) Issues membars on thread state transitions") \ 129.62 \ 129.63 - /* Temporary: See 6948537 */ \ 129.64 + /* Temp PPC Flag to allow disabling the use of lwsync on ppc platforms \ 129.65 + * that don't support it. This will be replaced by processor detection \ 129.66 + * logic. \ 129.67 + */ \ 129.68 + product(bool, UsePPCLWSYNC, true, \ 129.69 + "Use lwsync instruction if true, else use slower sync") \ 129.70 + \ 129.71 + /* Temporary: See 6948537 */ \ 129.72 experimental(bool, UseMemSetInBOT, true, \ 129.73 "(Unstable) uses memset in BOT updates in GC code") \ 129.74 \ 129.75 @@ -762,6 +790,9 @@ 129.76 product(bool, ShowMessageBoxOnError, false, \ 129.77 "Keep process alive on VM fatal error") \ 129.78 \ 129.79 + product(bool, CreateMinidumpOnCrash, false, \ 129.80 + "Create minidump on VM fatal error") \ 129.81 + \ 129.82 product_pd(bool, UseOSErrorReporting, \ 129.83 "Let VM fatal error propagate to the OS (ie. WER on Windows)") \ 129.84 \ 129.85 @@ -1926,6 +1957,9 @@ 129.86 product(bool, PrintRevisitStats, false, \ 129.87 "Print revisit (klass and MDO) stack related information") \ 129.88 \ 129.89 + EMBEDDED_ONLY(product(bool, LowMemoryProtection, true, \ 129.90 + "Enable LowMemoryProtection")) \ 129.91 + \ 129.92 product_pd(bool, NeverActAsServerClassMachine, \ 129.93 "Never act like a server-class machine") \ 129.94 \ 129.95 @@ -2630,6 +2664,25 @@ 129.96 product(bool, UseStringCache, false, \ 129.97 "Enable String cache capabilities on String.java") \ 129.98 \ 129.99 + /* byte strings */ \ 129.100 + product(bool, UseCompressedStrings, false, \ 129.101 + "Enable byte-valued strings") \ 129.102 + \ 129.103 + product(bool, SpecialStringCompress, true, \ 129.104 + "special version of string compress") \ 129.105 + \ 129.106 + product(bool, SpecialStringInflate, true, \ 129.107 + "special version of string inflate") \ 129.108 + \ 129.109 + product(bool, SpecialStringCompareToCC, true, \ 129.110 + "special version of string compareToCC") \ 129.111 + \ 129.112 + product(bool, SpecialStringIndexOfCC, true, \ 129.113 + "special version of string indexOfCC") \ 129.114 + \ 129.115 + product(bool, SpecialStringEqualsCC, true, \ 129.116 + "special version of string equalsCC") \ 129.117 + \ 129.118 /* statistics */ \ 129.119 develop(bool, CountCompiledCalls, false, \ 129.120 "counts method invocations") \ 129.121 @@ -2851,9 +2904,13 @@ 129.122 "Max. no. of lines in the stack trace for Java exceptions " \ 129.123 "(0 means all)") \ 129.124 \ 129.125 - develop(intx, GuaranteedSafepointInterval, 1000, \ 129.126 + NOT_EMBEDDED(develop(intx, GuaranteedSafepointInterval, 1000, \ 129.127 "Guarantee a safepoint (at least) every so many milliseconds " \ 129.128 - "(0 means none)") \ 129.129 + "(0 means none)")) \ 129.130 + \ 129.131 + EMBEDDED_ONLY(product(intx, GuaranteedSafepointInterval, 0, \ 129.132 + "Guarantee a safepoint (at least) every so many milliseconds " \ 129.133 + "(0 means none)")) \ 129.134 \ 129.135 product(intx, SafepointTimeoutDelay, 10000, \ 129.136 "Delay in milliseconds for option SafepointTimeout") \ 129.137 @@ -3543,9 +3600,13 @@ 129.138 \ 129.139 /* flags for performance data collection */ \ 129.140 \ 129.141 - product(bool, UsePerfData, true, \ 129.142 + NOT_EMBEDDED(product(bool, UsePerfData, true, \ 129.143 "Flag to disable jvmstat instrumentation for performance testing" \ 129.144 - "and problem isolation purposes.") \ 129.145 + "and problem isolation purposes.")) \ 129.146 + \ 129.147 + EMBEDDED_ONLY(product(bool, UsePerfData, false, \ 129.148 + "Flag to disable jvmstat instrumentation for performance testing" \ 129.149 + "and problem isolation purposes.")) \ 129.150 \ 129.151 product(bool, PerfDataSaveToFile, false, \ 129.152 "Save PerfData memory to hsperfdata_<pid> file on exit") \ 129.153 @@ -3597,6 +3658,12 @@ 129.154 manageable(bool, PrintConcurrentLocks, false, \ 129.155 "Print java.util.concurrent locks in thread dump") \ 129.156 \ 129.157 + diagnostic(bool, TransmitErrorReport, false, \ 129.158 + "Enable error report transmission on erroneous termination") \ 129.159 + \ 129.160 + diagnostic(ccstr, ErrorReportServer, NULL, \ 129.161 + "Override built-in error report server address") \ 129.162 + \ 129.163 /* Shared spaces */ \ 129.164 \ 129.165 product(bool, UseSharedSpaces, true, \
130.1 --- a/src/share/vm/runtime/icache.hpp Fri Feb 11 14:30:27 2011 -0800 130.2 +++ b/src/share/vm/runtime/icache.hpp Fri Feb 11 15:31:58 2011 -0800 130.3 @@ -77,6 +77,12 @@ 130.4 #ifdef TARGET_ARCH_zero 130.5 # include "icache_zero.hpp" 130.6 #endif 130.7 +#ifdef TARGET_ARCH_arm 130.8 +# include "icache_arm.hpp" 130.9 +#endif 130.10 +#ifdef TARGET_ARCH_ppc 130.11 +# include "icache_ppc.hpp" 130.12 +#endif 130.13 130.14 130.15
131.1 --- a/src/share/vm/runtime/java.cpp Fri Feb 11 14:30:27 2011 -0800 131.2 +++ b/src/share/vm/runtime/java.cpp Fri Feb 11 15:31:58 2011 -0800 131.3 @@ -70,6 +70,12 @@ 131.4 #ifdef TARGET_ARCH_zero 131.5 # include "vm_version_zero.hpp" 131.6 #endif 131.7 +#ifdef TARGET_ARCH_arm 131.8 +# include "vm_version_arm.hpp" 131.9 +#endif 131.10 +#ifdef TARGET_ARCH_ppc 131.11 +# include "vm_version_ppc.hpp" 131.12 +#endif 131.13 #ifdef TARGET_OS_FAMILY_linux 131.14 # include "thread_linux.inline.hpp" 131.15 #endif
132.1 --- a/src/share/vm/runtime/javaCalls.hpp Fri Feb 11 14:30:27 2011 -0800 132.2 +++ b/src/share/vm/runtime/javaCalls.hpp Fri Feb 11 15:31:58 2011 -0800 132.3 @@ -39,6 +39,12 @@ 132.4 #ifdef TARGET_ARCH_zero 132.5 # include "jniTypes_zero.hpp" 132.6 #endif 132.7 +#ifdef TARGET_ARCH_arm 132.8 +# include "jniTypes_arm.hpp" 132.9 +#endif 132.10 +#ifdef TARGET_ARCH_ppc 132.11 +# include "jniTypes_ppc.hpp" 132.12 +#endif 132.13 #ifdef TARGET_OS_FAMILY_linux 132.14 # include "thread_linux.inline.hpp" 132.15 #endif
133.1 --- a/src/share/vm/runtime/javaFrameAnchor.hpp Fri Feb 11 14:30:27 2011 -0800 133.2 +++ b/src/share/vm/runtime/javaFrameAnchor.hpp Fri Feb 11 15:31:58 2011 -0800 133.3 @@ -44,6 +44,12 @@ 133.4 #ifdef TARGET_OS_ARCH_windows_x86 133.5 # include "orderAccess_windows_x86.inline.hpp" 133.6 #endif 133.7 +#ifdef TARGET_OS_ARCH_linux_arm 133.8 +# include "orderAccess_linux_arm.inline.hpp" 133.9 +#endif 133.10 +#ifdef TARGET_OS_ARCH_linux_ppc 133.11 +# include "orderAccess_linux_ppc.inline.hpp" 133.12 +#endif 133.13 // 133.14 // An object for encapsulating the machine/os dependent part of a JavaThread frame state 133.15 // 133.16 @@ -102,6 +108,12 @@ 133.17 #ifdef TARGET_ARCH_zero 133.18 # include "javaFrameAnchor_zero.hpp" 133.19 #endif 133.20 +#ifdef TARGET_ARCH_arm 133.21 +# include "javaFrameAnchor_arm.hpp" 133.22 +#endif 133.23 +#ifdef TARGET_ARCH_ppc 133.24 +# include "javaFrameAnchor_ppc.hpp" 133.25 +#endif 133.26 133.27 133.28 public:
134.1 --- a/src/share/vm/runtime/mutexLocker.cpp Fri Feb 11 14:30:27 2011 -0800 134.2 +++ b/src/share/vm/runtime/mutexLocker.cpp Fri Feb 11 15:31:58 2011 -0800 134.3 @@ -129,7 +129,7 @@ 134.4 Monitor* GCTaskManager_lock = NULL; 134.5 134.6 Mutex* Management_lock = NULL; 134.7 -Monitor* LowMemory_lock = NULL; 134.8 +Monitor* Service_lock = NULL; 134.9 134.10 #define MAX_NUM_MUTEX 128 134.11 static Monitor * _mutex_array[MAX_NUM_MUTEX]; 134.12 @@ -203,7 +203,7 @@ 134.13 134.14 def(Patching_lock , Mutex , special, true ); // used for safepointing and code patching. 134.15 def(ObjAllocPost_lock , Monitor, special, false); 134.16 - def(LowMemory_lock , Monitor, special, true ); // used for low memory detection 134.17 + def(Service_lock , Monitor, special, true ); // used for service thread operations 134.18 def(JmethodIdCreation_lock , Mutex , leaf, true ); // used for creating jmethodIDs. 134.19 134.20 def(SystemDictionary_lock , Monitor, leaf, true ); // lookups done by VM thread
135.1 --- a/src/share/vm/runtime/mutexLocker.hpp Fri Feb 11 14:30:27 2011 -0800 135.2 +++ b/src/share/vm/runtime/mutexLocker.hpp Fri Feb 11 15:31:58 2011 -0800 135.3 @@ -131,7 +131,7 @@ 135.4 extern Mutex* HotCardCache_lock; // protects the hot card cache 135.5 135.6 extern Mutex* Management_lock; // a lock used to serialize JVM management 135.7 -extern Monitor* LowMemory_lock; // a lock used for low memory detection 135.8 +extern Monitor* Service_lock; // a lock used for service thread operation 135.9 135.10 // A MutexLocker provides mutual exclusion with respect to a given mutex 135.11 // for the scope which contains the locker. The lock is an OS lock, not
136.1 --- a/src/share/vm/runtime/os.hpp Fri Feb 11 14:30:27 2011 -0800 136.2 +++ b/src/share/vm/runtime/os.hpp Fri Feb 11 15:31:58 2011 -0800 136.3 @@ -1,5 +1,5 @@ 136.4 /* 136.5 - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 136.6 + * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. 136.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 136.8 * 136.9 * This code is free software; you can redistribute it and/or modify it 136.10 @@ -614,6 +614,9 @@ 136.11 // Structured OS Exception support 136.12 static void os_exception_wrapper(java_call_t f, JavaValue* value, methodHandle* method, JavaCallArguments* args, Thread* thread); 136.13 136.14 + // On Windows this will create an actual minidump, on Linux/Solaris it will simply check core dump limits 136.15 + static void check_or_create_dump(void* exceptionRecord, void* contextRecord, char* buffer, size_t bufferSize); 136.16 + 136.17 // JVMTI & JVM monitoring and management support 136.18 // The thread_cpu_time() and current_thread_cpu_time() are only 136.19 // supported if is_thread_cpu_time_supported() returns true. 136.20 @@ -676,6 +679,12 @@ 136.21 #ifdef TARGET_OS_ARCH_windows_x86 136.22 # include "os_windows_x86.hpp" 136.23 #endif 136.24 +#ifdef TARGET_OS_ARCH_linux_arm 136.25 +# include "os_linux_arm.hpp" 136.26 +#endif 136.27 +#ifdef TARGET_OS_ARCH_linux_ppc 136.28 +# include "os_linux_ppc.hpp" 136.29 +#endif 136.30 136.31 136.32 // debugging support (mostly used by debug.cpp but also fatal error handler)
137.1 --- a/src/share/vm/runtime/registerMap.hpp Fri Feb 11 14:30:27 2011 -0800 137.2 +++ b/src/share/vm/runtime/registerMap.hpp Fri Feb 11 15:31:58 2011 -0800 137.3 @@ -36,6 +36,12 @@ 137.4 #ifdef TARGET_ARCH_zero 137.5 # include "register_zero.hpp" 137.6 #endif 137.7 +#ifdef TARGET_ARCH_arm 137.8 +# include "register_arm.hpp" 137.9 +#endif 137.10 +#ifdef TARGET_ARCH_ppc 137.11 +# include "register_ppc.hpp" 137.12 +#endif 137.13 137.14 class JavaThread; 137.15 137.16 @@ -138,6 +144,12 @@ 137.17 #ifdef TARGET_ARCH_zero 137.18 # include "registerMap_zero.hpp" 137.19 #endif 137.20 +#ifdef TARGET_ARCH_arm 137.21 +# include "registerMap_arm.hpp" 137.22 +#endif 137.23 +#ifdef TARGET_ARCH_ppc 137.24 +# include "registerMap_ppc.hpp" 137.25 +#endif 137.26 137.27 }; 137.28
138.1 --- a/src/share/vm/runtime/relocator.hpp Fri Feb 11 14:30:27 2011 -0800 138.2 +++ b/src/share/vm/runtime/relocator.hpp Fri Feb 11 15:31:58 2011 -0800 138.3 @@ -36,6 +36,12 @@ 138.4 #ifdef TARGET_ARCH_zero 138.5 # include "bytes_zero.hpp" 138.6 #endif 138.7 +#ifdef TARGET_ARCH_arm 138.8 +# include "bytes_arm.hpp" 138.9 +#endif 138.10 +#ifdef TARGET_ARCH_ppc 138.11 +# include "bytes_ppc.hpp" 138.12 +#endif 138.13 138.14 // This code has been converted from the 1.1E java virtual machine 138.15 // Thanks to the JavaTopics group for using the code
139.1 --- a/src/share/vm/runtime/safepoint.cpp Fri Feb 11 14:30:27 2011 -0800 139.2 +++ b/src/share/vm/runtime/safepoint.cpp Fri Feb 11 15:31:58 2011 -0800 139.3 @@ -61,6 +61,14 @@ 139.4 # include "nativeInst_zero.hpp" 139.5 # include "vmreg_zero.inline.hpp" 139.6 #endif 139.7 +#ifdef TARGET_ARCH_arm 139.8 +# include "nativeInst_arm.hpp" 139.9 +# include "vmreg_arm.inline.hpp" 139.10 +#endif 139.11 +#ifdef TARGET_ARCH_ppc 139.12 +# include "nativeInst_ppc.hpp" 139.13 +# include "vmreg_ppc.inline.hpp" 139.14 +#endif 139.15 #ifdef TARGET_OS_FAMILY_linux 139.16 # include "thread_linux.inline.hpp" 139.17 #endif
140.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 140.2 +++ b/src/share/vm/runtime/serviceThread.cpp Fri Feb 11 15:31:58 2011 -0800 140.3 @@ -0,0 +1,122 @@ 140.4 +/* 140.5 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. 140.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 140.7 + * 140.8 + * This code is free software; you can redistribute it and/or modify it 140.9 + * under the terms of the GNU General Public License version 2 only, as 140.10 + * published by the Free Software Foundation. 140.11 + * 140.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 140.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 140.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 140.15 + * version 2 for more details (a copy is included in the LICENSE file that 140.16 + * accompanied this code). 140.17 + * 140.18 + * You should have received a copy of the GNU General Public License version 140.19 + * 2 along with this work; if not, write to the Free Software Foundation, 140.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 140.21 + * 140.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 140.23 + * or visit www.oracle.com if you need additional information or have any 140.24 + * questions. 140.25 + * 140.26 + */ 140.27 + 140.28 +#include "precompiled.hpp" 140.29 +#include "runtime/interfaceSupport.hpp" 140.30 +#include "runtime/javaCalls.hpp" 140.31 +#include "runtime/serviceThread.hpp" 140.32 +#include "runtime/mutexLocker.hpp" 140.33 +#include "prims/jvmtiImpl.hpp" 140.34 + 140.35 +ServiceThread* ServiceThread::_instance = NULL; 140.36 + 140.37 +void ServiceThread::initialize() { 140.38 + EXCEPTION_MARK; 140.39 + 140.40 + instanceKlassHandle klass (THREAD, SystemDictionary::Thread_klass()); 140.41 + instanceHandle thread_oop = klass->allocate_instance_handle(CHECK); 140.42 + 140.43 + const char* name = JDK_Version::is_gte_jdk17x_version() ? 140.44 + "Service Thread" : "Low Memory Detector"; 140.45 + 140.46 + Handle string = java_lang_String::create_from_str(name, CHECK); 140.47 + 140.48 + // Initialize thread_oop to put it into the system threadGroup 140.49 + Handle thread_group (THREAD, Universe::system_thread_group()); 140.50 + JavaValue result(T_VOID); 140.51 + JavaCalls::call_special(&result, thread_oop, 140.52 + klass, 140.53 + vmSymbols::object_initializer_name(), 140.54 + vmSymbols::threadgroup_string_void_signature(), 140.55 + thread_group, 140.56 + string, 140.57 + CHECK); 140.58 + 140.59 + { 140.60 + MutexLocker mu(Threads_lock); 140.61 + ServiceThread* thread = new ServiceThread(&service_thread_entry); 140.62 + 140.63 + // At this point it may be possible that no osthread was created for the 140.64 + // JavaThread due to lack of memory. We would have to throw an exception 140.65 + // in that case. However, since this must work and we do not allow 140.66 + // exceptions anyway, check and abort if this fails. 140.67 + if (thread == NULL || thread->osthread() == NULL) { 140.68 + vm_exit_during_initialization("java.lang.OutOfMemoryError", 140.69 + "unable to create new native thread"); 140.70 + } 140.71 + 140.72 + java_lang_Thread::set_thread(thread_oop(), thread); 140.73 + java_lang_Thread::set_priority(thread_oop(), NearMaxPriority); 140.74 + java_lang_Thread::set_daemon(thread_oop()); 140.75 + thread->set_threadObj(thread_oop()); 140.76 + 140.77 + Threads::add(thread); 140.78 + Thread::start(thread); 140.79 + 140.80 + _instance = thread; 140.81 + } 140.82 +} 140.83 + 140.84 +void ServiceThread::service_thread_entry(JavaThread* jt, TRAPS) { 140.85 + while (true) { 140.86 + bool sensors_changed = false; 140.87 + bool has_jvmti_events = false; 140.88 + JvmtiDeferredEvent jvmti_event; 140.89 + { 140.90 + // Need state transition ThreadBlockInVM so that this thread 140.91 + // will be handled by safepoint correctly when this thread is 140.92 + // notified at a safepoint. 140.93 + 140.94 + // This ThreadBlockInVM object is not also considered to be 140.95 + // suspend-equivalent because ServiceThread is not visible to 140.96 + // external suspension. 140.97 + 140.98 + ThreadBlockInVM tbivm(jt); 140.99 + 140.100 + MutexLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag); 140.101 + while (!(sensors_changed = LowMemoryDetector::has_pending_requests()) && 140.102 + !(has_jvmti_events = JvmtiDeferredEventQueue::has_events())) { 140.103 + // wait until one of the sensors has pending requests, or there is a 140.104 + // pending JVMTI event to post 140.105 + Service_lock->wait(Mutex::_no_safepoint_check_flag); 140.106 + } 140.107 + 140.108 + if (has_jvmti_events) { 140.109 + jvmti_event = JvmtiDeferredEventQueue::dequeue(); 140.110 + } 140.111 + } 140.112 + 140.113 + if (has_jvmti_events) { 140.114 + jvmti_event.post(); 140.115 + } 140.116 + 140.117 + if (sensors_changed) { 140.118 + LowMemoryDetector::process_sensor_changes(jt); 140.119 + } 140.120 + } 140.121 +} 140.122 + 140.123 +bool ServiceThread::is_service_thread(Thread* thread) { 140.124 + return thread == _instance; 140.125 +}
141.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 141.2 +++ b/src/share/vm/runtime/serviceThread.hpp Fri Feb 11 15:31:58 2011 -0800 141.3 @@ -0,0 +1,51 @@ 141.4 +/* 141.5 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. 141.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 141.7 + * 141.8 + * This code is free software; you can redistribute it and/or modify it 141.9 + * under the terms of the GNU General Public License version 2 only, as 141.10 + * published by the Free Software Foundation. 141.11 + * 141.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 141.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 141.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 141.15 + * version 2 for more details (a copy is included in the LICENSE file that 141.16 + * accompanied this code). 141.17 + * 141.18 + * You should have received a copy of the GNU General Public License version 141.19 + * 2 along with this work; if not, write to the Free Software Foundation, 141.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 141.21 + * 141.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 141.23 + * or visit www.oracle.com if you need additional information or have any 141.24 + * questions. 141.25 + * 141.26 + */ 141.27 + 141.28 +#ifndef SHARE_VM_RUNTIME_SERVICETHREAD_HPP 141.29 +#define SHARE_VM_RUNTIME_SERVICETHREAD_HPP 141.30 + 141.31 +#include "runtime/thread.hpp" 141.32 + 141.33 +// A JavaThread for low memory detection support and JVMTI 141.34 +// compiled-method-load events. 141.35 +class ServiceThread : public JavaThread { 141.36 + friend class VMStructs; 141.37 + private: 141.38 + 141.39 + static ServiceThread* _instance; 141.40 + 141.41 + static void service_thread_entry(JavaThread* thread, TRAPS); 141.42 + ServiceThread(ThreadFunction entry_point) : JavaThread(entry_point) {}; 141.43 + 141.44 + public: 141.45 + static void initialize(); 141.46 + 141.47 + // Hide this thread from external view. 141.48 + bool is_hidden_from_external_view() const { return true; } 141.49 + 141.50 + // Returns true if the passed thread is the service thread. 141.51 + static bool is_service_thread(Thread* thread); 141.52 +}; 141.53 + 141.54 +#endif // SHARE_VM_RUNTIME_SERVICETHREAD_HPP
142.1 --- a/src/share/vm/runtime/sharedRuntime.cpp Fri Feb 11 14:30:27 2011 -0800 142.2 +++ b/src/share/vm/runtime/sharedRuntime.cpp Fri Feb 11 15:31:58 2011 -0800 142.3 @@ -68,6 +68,14 @@ 142.4 # include "nativeInst_zero.hpp" 142.5 # include "vmreg_zero.inline.hpp" 142.6 #endif 142.7 +#ifdef TARGET_ARCH_arm 142.8 +# include "nativeInst_arm.hpp" 142.9 +# include "vmreg_arm.inline.hpp" 142.10 +#endif 142.11 +#ifdef TARGET_ARCH_ppc 142.12 +# include "nativeInst_ppc.hpp" 142.13 +# include "vmreg_ppc.inline.hpp" 142.14 +#endif 142.15 #ifdef COMPILER1 142.16 #include "c1/c1_Runtime1.hpp" 142.17 #endif 142.18 @@ -2618,6 +2626,7 @@ 142.19 int jlsLen = java_lang_String::length(src); 142.20 jchar* jlsPos = (jlsLen == 0) ? NULL : 142.21 jlsValue->char_at_addr(jlsOffset); 142.22 + assert(typeArrayKlass::cast(jlsValue->klass())->element_type() == T_CHAR, "compressed string"); 142.23 (void) UNICODE::as_utf8(jlsPos, jlsLen, (char *)dst, max_dtrace_string_size); 142.24 } 142.25 #endif // ndef HAVE_DTRACE_H
143.1 --- a/src/share/vm/runtime/stackValueCollection.cpp Fri Feb 11 14:30:27 2011 -0800 143.2 +++ b/src/share/vm/runtime/stackValueCollection.cpp Fri Feb 11 15:31:58 2011 -0800 143.3 @@ -33,6 +33,12 @@ 143.4 #ifdef TARGET_ARCH_zero 143.5 # include "jniTypes_zero.hpp" 143.6 #endif 143.7 +#ifdef TARGET_ARCH_arm 143.8 +# include "jniTypes_arm.hpp" 143.9 +#endif 143.10 +#ifdef TARGET_ARCH_ppc 143.11 +# include "jniTypes_ppc.hpp" 143.12 +#endif 143.13 143.14 jint StackValueCollection::int_at(int slot) const { 143.15 intptr_t val = at(slot)->get_int();
144.1 --- a/src/share/vm/runtime/statSampler.cpp Fri Feb 11 14:30:27 2011 -0800 144.2 +++ b/src/share/vm/runtime/statSampler.cpp Fri Feb 11 15:31:58 2011 -0800 144.3 @@ -42,6 +42,12 @@ 144.4 #ifdef TARGET_ARCH_zero 144.5 # include "vm_version_zero.hpp" 144.6 #endif 144.7 +#ifdef TARGET_ARCH_arm 144.8 +# include "vm_version_arm.hpp" 144.9 +#endif 144.10 +#ifdef TARGET_ARCH_ppc 144.11 +# include "vm_version_ppc.hpp" 144.12 +#endif 144.13 144.14 // -------------------------------------------------------- 144.15 // StatSamplerTask
145.1 --- a/src/share/vm/runtime/stubCodeGenerator.cpp Fri Feb 11 14:30:27 2011 -0800 145.2 +++ b/src/share/vm/runtime/stubCodeGenerator.cpp Fri Feb 11 15:31:58 2011 -0800 145.3 @@ -36,6 +36,12 @@ 145.4 #ifdef TARGET_ARCH_zero 145.5 # include "assembler_zero.inline.hpp" 145.6 #endif 145.7 +#ifdef TARGET_ARCH_arm 145.8 +# include "assembler_arm.inline.hpp" 145.9 +#endif 145.10 +#ifdef TARGET_ARCH_ppc 145.11 +# include "assembler_ppc.inline.hpp" 145.12 +#endif 145.13 145.14 145.15 // Implementation of StubCodeDesc
146.1 --- a/src/share/vm/runtime/stubRoutines.hpp Fri Feb 11 14:30:27 2011 -0800 146.2 +++ b/src/share/vm/runtime/stubRoutines.hpp Fri Feb 11 15:31:58 2011 -0800 146.3 @@ -40,6 +40,12 @@ 146.4 #ifdef TARGET_ARCH_zero 146.5 # include "nativeInst_zero.hpp" 146.6 #endif 146.7 +#ifdef TARGET_ARCH_arm 146.8 +# include "nativeInst_arm.hpp" 146.9 +#endif 146.10 +#ifdef TARGET_ARCH_ppc 146.11 +# include "nativeInst_ppc.hpp" 146.12 +#endif 146.13 146.14 // StubRoutines provides entry points to assembly routines used by 146.15 // compiled code and the run-time system. Platform-specific entry 146.16 @@ -105,6 +111,12 @@ 146.17 #ifdef TARGET_ARCH_MODEL_zero 146.18 # include "stubRoutines_zero.hpp" 146.19 #endif 146.20 +#ifdef TARGET_ARCH_MODEL_arm 146.21 +# include "stubRoutines_arm.hpp" 146.22 +#endif 146.23 +#ifdef TARGET_ARCH_MODEL_ppc 146.24 +# include "stubRoutines_ppc.hpp" 146.25 +#endif 146.26 146.27 146.28 static jint _verify_oop_count;
147.1 --- a/src/share/vm/runtime/thread.cpp Fri Feb 11 14:30:27 2011 -0800 147.2 +++ b/src/share/vm/runtime/thread.cpp Fri Feb 11 15:31:58 2011 -0800 147.3 @@ -962,22 +962,6 @@ 147.4 vmSymbols::void_method_signature(), CHECK); 147.5 } 147.6 147.7 -#ifdef KERNEL 147.8 -static void set_jkernel_boot_classloader_hook(TRAPS) { 147.9 - klassOop k = SystemDictionary::sun_jkernel_DownloadManager_klass(); 147.10 - instanceKlassHandle klass (THREAD, k); 147.11 - 147.12 - if (k == NULL) { 147.13 - // sun.jkernel.DownloadManager may not present in the JDK; just return 147.14 - return; 147.15 - } 147.16 - 147.17 - JavaValue result(T_VOID); 147.18 - JavaCalls::call_static(&result, klass, vmSymbols::setBootClassLoaderHook_name(), 147.19 - vmSymbols::void_method_signature(), CHECK); 147.20 -} 147.21 -#endif // KERNEL 147.22 - 147.23 // General purpose hook into Java code, run once when the VM is initialized. 147.24 // The Java library method itself may be changed independently from the VM. 147.25 static void call_postVMInitHook(TRAPS) { 147.26 @@ -1611,7 +1595,15 @@ 147.27 uncaught_exception, // Arg 2 147.28 THREAD); 147.29 } 147.30 - CLEAR_PENDING_EXCEPTION; 147.31 + if (HAS_PENDING_EXCEPTION) { 147.32 + ResourceMark rm(this); 147.33 + jio_fprintf(defaultStream::error_stream(), 147.34 + "\nException: %s thrown from the UncaughtExceptionHandler" 147.35 + " in thread \"%s\"\n", 147.36 + Klass::cast(pending_exception()->klass())->external_name(), 147.37 + get_thread_name()); 147.38 + CLEAR_PENDING_EXCEPTION; 147.39 + } 147.40 } 147.41 } 147.42 147.43 @@ -3284,12 +3276,6 @@ 147.44 vm_exit_during_initialization(Handle(THREAD, PENDING_EXCEPTION)); 147.45 } 147.46 147.47 -#ifdef KERNEL 147.48 - if (JDK_Version::is_gte_jdk17x_version()) { 147.49 - set_jkernel_boot_classloader_hook(THREAD); 147.50 - } 147.51 -#endif // KERNEL 147.52 - 147.53 #ifndef SERIALGC 147.54 // Support for ConcurrentMarkSweep. This should be cleaned up 147.55 // and better encapsulated. The ugly nested if test would go away
148.1 --- a/src/share/vm/runtime/thread.hpp Fri Feb 11 14:30:27 2011 -0800 148.2 +++ b/src/share/vm/runtime/thread.hpp Fri Feb 11 15:31:58 2011 -0800 148.3 @@ -1598,6 +1598,12 @@ 148.4 #ifdef TARGET_OS_ARCH_windows_x86 148.5 # include "thread_windows_x86.hpp" 148.6 #endif 148.7 +#ifdef TARGET_OS_ARCH_linux_arm 148.8 +# include "thread_linux_arm.hpp" 148.9 +#endif 148.10 +#ifdef TARGET_OS_ARCH_linux_ppc 148.11 +# include "thread_linux_ppc.hpp" 148.12 +#endif 148.13 148.14 148.15 public: 148.16 @@ -1674,16 +1680,6 @@ 148.17 return cur_sp > low_addr ? cur_sp - low_addr : 0; 148.18 } 148.19 148.20 -// A JavaThread for low memory detection support 148.21 -class LowMemoryDetectorThread : public JavaThread { 148.22 - friend class VMStructs; 148.23 -public: 148.24 - LowMemoryDetectorThread(ThreadFunction entry_point) : JavaThread(entry_point) {}; 148.25 - 148.26 - // Hide this thread from external view. 148.27 - bool is_hidden_from_external_view() const { return true; } 148.28 -}; 148.29 - 148.30 // A thread used for Compilation. 148.31 class CompilerThread : public JavaThread { 148.32 friend class VMStructs;
149.1 --- a/src/share/vm/runtime/threadLocalStorage.hpp Fri Feb 11 14:30:27 2011 -0800 149.2 +++ b/src/share/vm/runtime/threadLocalStorage.hpp Fri Feb 11 15:31:58 2011 -0800 149.3 @@ -62,6 +62,12 @@ 149.4 #ifdef TARGET_OS_ARCH_windows_x86 149.5 # include "threadLS_windows_x86.hpp" 149.6 #endif 149.7 +#ifdef TARGET_OS_ARCH_linux_arm 149.8 +# include "threadLS_linux_arm.hpp" 149.9 +#endif 149.10 +#ifdef TARGET_OS_ARCH_linux_ppc 149.11 +# include "threadLS_linux_ppc.hpp" 149.12 +#endif 149.13 149.14 149.15 public:
150.1 --- a/src/share/vm/runtime/vmStructs.cpp Fri Feb 11 14:30:27 2011 -0800 150.2 +++ b/src/share/vm/runtime/vmStructs.cpp Fri Feb 11 15:31:58 2011 -0800 150.3 @@ -93,6 +93,7 @@ 150.4 #include "runtime/java.hpp" 150.5 #include "runtime/javaCalls.hpp" 150.6 #include "runtime/perfMemory.hpp" 150.7 +#include "runtime/serviceThread.hpp" 150.8 #include "runtime/sharedRuntime.hpp" 150.9 #include "runtime/stubRoutines.hpp" 150.10 #include "runtime/virtualspace.hpp" 150.11 @@ -108,6 +109,12 @@ 150.12 #ifdef TARGET_ARCH_zero 150.13 # include "vmStructs_zero.hpp" 150.14 #endif 150.15 +#ifdef TARGET_ARCH_arm 150.16 +# include "vmStructs_arm.hpp" 150.17 +#endif 150.18 +#ifdef TARGET_ARCH_ppc 150.19 +# include "vmStructs_ppc.hpp" 150.20 +#endif 150.21 #ifdef TARGET_OS_FAMILY_linux 150.22 # include "thread_linux.inline.hpp" 150.23 #endif 150.24 @@ -135,6 +142,12 @@ 150.25 #ifdef TARGET_OS_ARCH_windows_x86 150.26 # include "vmStructs_windows_x86.hpp" 150.27 #endif 150.28 +#ifdef TARGET_OS_ARCH_linux_arm 150.29 +# include "vmStructs_linux_arm.hpp" 150.30 +#endif 150.31 +#ifdef TARGET_OS_ARCH_linux_ppc 150.32 +# include "vmStructs_linux_ppc.hpp" 150.33 +#endif 150.34 #ifndef SERIALGC 150.35 #include "gc_implementation/concurrentMarkSweep/cmsPermGen.hpp" 150.36 #include "gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp" 150.37 @@ -166,6 +179,12 @@ 150.38 #ifdef TARGET_ARCH_MODEL_zero 150.39 # include "adfiles/adGlobals_zero.hpp" 150.40 #endif 150.41 +#ifdef TARGET_ARCH_MODEL_arm 150.42 +# include "adfiles/adGlobals_arm.hpp" 150.43 +#endif 150.44 +#ifdef TARGET_ARCH_MODEL_ppc 150.45 +# include "adfiles/adGlobals_ppc.hpp" 150.46 +#endif 150.47 #endif 150.48 150.49 // Note: the cross-product of (c1, c2, product, nonproduct, ...), 150.50 @@ -1232,7 +1251,7 @@ 150.51 declare_type(WatcherThread, Thread) \ 150.52 declare_type(JavaThread, Thread) \ 150.53 declare_type(JvmtiAgentThread, JavaThread) \ 150.54 - declare_type(LowMemoryDetectorThread, JavaThread) \ 150.55 + declare_type(ServiceThread, JavaThread) \ 150.56 declare_type(CompilerThread, JavaThread) \ 150.57 declare_toplevel_type(OSThread) \ 150.58 declare_toplevel_type(JavaFrameAnchor) \
151.1 --- a/src/share/vm/runtime/vm_version.cpp Fri Feb 11 14:30:27 2011 -0800 151.2 +++ b/src/share/vm/runtime/vm_version.cpp Fri Feb 11 15:31:58 2011 -0800 151.3 @@ -35,6 +35,12 @@ 151.4 #ifdef TARGET_ARCH_zero 151.5 # include "vm_version_zero.hpp" 151.6 #endif 151.7 +#ifdef TARGET_ARCH_arm 151.8 +# include "vm_version_arm.hpp" 151.9 +#endif 151.10 +#ifdef TARGET_ARCH_ppc 151.11 +# include "vm_version_ppc.hpp" 151.12 +#endif 151.13 151.14 const char* Abstract_VM_Version::_s_vm_release = Abstract_VM_Version::vm_release(); 151.15 const char* Abstract_VM_Version::_s_internal_vm_info_string = Abstract_VM_Version::internal_vm_info_string(); 151.16 @@ -220,12 +226,29 @@ 151.17 #endif 151.18 #endif 151.19 151.20 + #ifndef FLOAT_ARCH 151.21 + #if defined(__SOFTFP__) 151.22 + #define FLOAT_ARCH "-sflt" 151.23 + #elif defined(E500V2) 151.24 + #define FLOAT_ARCH "-e500v2" 151.25 + #elif defined(ARM) 151.26 + #define FLOAT_ARCH "-vfp" 151.27 + #elif defined(PPC) 151.28 + #define FLOAT_ARCH "-hflt" 151.29 + #else 151.30 + #define FLOAT_ARCH "" 151.31 + #endif 151.32 + #endif 151.33 151.34 - return VMNAME " (" VM_RELEASE ") for " OS "-" CPU 151.35 + return VMNAME " (" VM_RELEASE ") for " OS "-" CPU FLOAT_ARCH 151.36 " JRE (" JRE_RELEASE_VERSION "), built on " __DATE__ " " __TIME__ 151.37 " by " XSTR(HOTSPOT_BUILD_USER) " with " HOTSPOT_BUILD_COMPILER; 151.38 } 151.39 151.40 +const char *Abstract_VM_Version::vm_build_user() { 151.41 + return HOTSPOT_BUILD_USER; 151.42 +} 151.43 + 151.44 unsigned int Abstract_VM_Version::jvm_version() { 151.45 return ((Abstract_VM_Version::vm_major_version() & 0xFF) << 24) | 151.46 ((Abstract_VM_Version::vm_minor_version() & 0xFF) << 16) |
152.1 --- a/src/share/vm/runtime/vm_version.hpp Fri Feb 11 14:30:27 2011 -0800 152.2 +++ b/src/share/vm/runtime/vm_version.hpp Fri Feb 11 15:31:58 2011 -0800 152.3 @@ -59,6 +59,7 @@ 152.4 static const char* vm_info_string(); 152.5 static const char* vm_release(); 152.6 static const char* vm_platform_string(); 152.7 + static const char* vm_build_user(); 152.8 152.9 static int vm_major_version() { assert(_initialized, "not initialized"); return _vm_major_version; } 152.10 static int vm_minor_version() { assert(_initialized, "not initialized"); return _vm_minor_version; }
153.1 --- a/src/share/vm/services/attachListener.hpp Fri Feb 11 14:30:27 2011 -0800 153.2 +++ b/src/share/vm/services/attachListener.hpp Fri Feb 11 15:31:58 2011 -0800 153.3 @@ -59,10 +59,10 @@ 153.4 static void detachall() KERNEL_RETURN; 153.5 153.6 // indicates if the Attach Listener needs to be created at startup 153.7 - static bool init_at_startup() KERNEL_RETURN_(return false;); 153.8 + static bool init_at_startup() KERNEL_RETURN_(false); 153.9 153.10 // indicates if we have a trigger to start the Attach Listener 153.11 - static bool is_init_trigger() KERNEL_RETURN_(return false;); 153.12 + static bool is_init_trigger() KERNEL_RETURN_(false); 153.13 153.14 #ifdef SERVICES_KERNEL 153.15 static bool is_attach_supported() { return false; }
154.1 --- a/src/share/vm/services/lowMemoryDetector.cpp Fri Feb 11 14:30:27 2011 -0800 154.2 +++ b/src/share/vm/services/lowMemoryDetector.cpp Fri Feb 11 15:31:58 2011 -0800 154.3 @@ -1,5 +1,5 @@ 154.4 /* 154.5 - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. 154.6 + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. 154.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 154.8 * 154.9 * This code is free software; you can redistribute it and/or modify it 154.10 @@ -34,55 +34,11 @@ 154.11 #include "services/lowMemoryDetector.hpp" 154.12 #include "services/management.hpp" 154.13 154.14 -LowMemoryDetectorThread* LowMemoryDetector::_detector_thread = NULL; 154.15 volatile bool LowMemoryDetector::_enabled_for_collected_pools = false; 154.16 volatile jint LowMemoryDetector::_disabled_count = 0; 154.17 154.18 -void LowMemoryDetector::initialize() { 154.19 - EXCEPTION_MARK; 154.20 - 154.21 - instanceKlassHandle klass (THREAD, SystemDictionary::Thread_klass()); 154.22 - instanceHandle thread_oop = klass->allocate_instance_handle(CHECK); 154.23 - 154.24 - const char thread_name[] = "Low Memory Detector"; 154.25 - Handle string = java_lang_String::create_from_str(thread_name, CHECK); 154.26 - 154.27 - // Initialize thread_oop to put it into the system threadGroup 154.28 - Handle thread_group (THREAD, Universe::system_thread_group()); 154.29 - JavaValue result(T_VOID); 154.30 - JavaCalls::call_special(&result, thread_oop, 154.31 - klass, 154.32 - vmSymbols::object_initializer_name(), 154.33 - vmSymbols::threadgroup_string_void_signature(), 154.34 - thread_group, 154.35 - string, 154.36 - CHECK); 154.37 - 154.38 - { 154.39 - MutexLocker mu(Threads_lock); 154.40 - _detector_thread = new LowMemoryDetectorThread(&low_memory_detector_thread_entry); 154.41 - 154.42 - // At this point it may be possible that no osthread was created for the 154.43 - // JavaThread due to lack of memory. We would have to throw an exception 154.44 - // in that case. However, since this must work and we do not allow 154.45 - // exceptions anyway, check and abort if this fails. 154.46 - if (_detector_thread == NULL || _detector_thread->osthread() == NULL) { 154.47 - vm_exit_during_initialization("java.lang.OutOfMemoryError", 154.48 - "unable to create new native thread"); 154.49 - } 154.50 - 154.51 - java_lang_Thread::set_thread(thread_oop(), _detector_thread); 154.52 - java_lang_Thread::set_priority(thread_oop(), NearMaxPriority); 154.53 - java_lang_Thread::set_daemon(thread_oop()); 154.54 - _detector_thread->set_threadObj(thread_oop()); 154.55 - 154.56 - Threads::add(_detector_thread); 154.57 - Thread::start(_detector_thread); 154.58 - } 154.59 -} 154.60 - 154.61 bool LowMemoryDetector::has_pending_requests() { 154.62 - assert(LowMemory_lock->owned_by_self(), "Must own LowMemory_lock"); 154.63 + assert(Service_lock->owned_by_self(), "Must own Service_lock"); 154.64 bool has_requests = false; 154.65 int num_memory_pools = MemoryService::num_memory_pools(); 154.66 for (int i = 0; i < num_memory_pools; i++) { 154.67 @@ -100,47 +56,21 @@ 154.68 return has_requests; 154.69 } 154.70 154.71 -void LowMemoryDetector::low_memory_detector_thread_entry(JavaThread* jt, TRAPS) { 154.72 - while (true) { 154.73 - bool sensors_changed = false; 154.74 +void LowMemoryDetector::process_sensor_changes(TRAPS) { 154.75 + ResourceMark rm(THREAD); 154.76 + HandleMark hm(THREAD); 154.77 154.78 - { 154.79 - // _no_safepoint_check_flag is used here as LowMemory_lock is a 154.80 - // special lock and the VMThread may acquire this lock at safepoint. 154.81 - // Need state transition ThreadBlockInVM so that this thread 154.82 - // will be handled by safepoint correctly when this thread is 154.83 - // notified at a safepoint. 154.84 - 154.85 - // This ThreadBlockInVM object is not also considered to be 154.86 - // suspend-equivalent because LowMemoryDetector threads are 154.87 - // not visible to external suspension. 154.88 - 154.89 - ThreadBlockInVM tbivm(jt); 154.90 - 154.91 - MutexLockerEx ml(LowMemory_lock, Mutex::_no_safepoint_check_flag); 154.92 - while (!(sensors_changed = has_pending_requests())) { 154.93 - // wait until one of the sensors has pending requests 154.94 - LowMemory_lock->wait(Mutex::_no_safepoint_check_flag); 154.95 - } 154.96 + // No need to hold Service_lock to call out to Java 154.97 + int num_memory_pools = MemoryService::num_memory_pools(); 154.98 + for (int i = 0; i < num_memory_pools; i++) { 154.99 + MemoryPool* pool = MemoryService::get_memory_pool(i); 154.100 + SensorInfo* sensor = pool->usage_sensor(); 154.101 + SensorInfo* gc_sensor = pool->gc_usage_sensor(); 154.102 + if (sensor != NULL && sensor->has_pending_requests()) { 154.103 + sensor->process_pending_requests(CHECK); 154.104 } 154.105 - 154.106 - { 154.107 - ResourceMark rm(THREAD); 154.108 - HandleMark hm(THREAD); 154.109 - 154.110 - // No need to hold LowMemory_lock to call out to Java 154.111 - int num_memory_pools = MemoryService::num_memory_pools(); 154.112 - for (int i = 0; i < num_memory_pools; i++) { 154.113 - MemoryPool* pool = MemoryService::get_memory_pool(i); 154.114 - SensorInfo* sensor = pool->usage_sensor(); 154.115 - SensorInfo* gc_sensor = pool->gc_usage_sensor(); 154.116 - if (sensor != NULL && sensor->has_pending_requests()) { 154.117 - sensor->process_pending_requests(CHECK); 154.118 - } 154.119 - if (gc_sensor != NULL && gc_sensor->has_pending_requests()) { 154.120 - gc_sensor->process_pending_requests(CHECK); 154.121 - } 154.122 - } 154.123 + if (gc_sensor != NULL && gc_sensor->has_pending_requests()) { 154.124 + gc_sensor->process_pending_requests(CHECK); 154.125 } 154.126 } 154.127 } 154.128 @@ -148,7 +78,7 @@ 154.129 // This method could be called from any Java threads 154.130 // and also VMThread. 154.131 void LowMemoryDetector::detect_low_memory() { 154.132 - MutexLockerEx ml(LowMemory_lock, Mutex::_no_safepoint_check_flag); 154.133 + MutexLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag); 154.134 154.135 bool has_pending_requests = false; 154.136 int num_memory_pools = MemoryService::num_memory_pools(); 154.137 @@ -166,7 +96,7 @@ 154.138 } 154.139 154.140 if (has_pending_requests) { 154.141 - LowMemory_lock->notify_all(); 154.142 + Service_lock->notify_all(); 154.143 } 154.144 } 154.145 154.146 @@ -181,14 +111,14 @@ 154.147 } 154.148 154.149 { 154.150 - MutexLockerEx ml(LowMemory_lock, Mutex::_no_safepoint_check_flag); 154.151 + MutexLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag); 154.152 154.153 MemoryUsage usage = pool->get_memory_usage(); 154.154 sensor->set_gauge_sensor_level(usage, 154.155 pool->usage_threshold()); 154.156 if (sensor->has_pending_requests()) { 154.157 // notify sensor state update 154.158 - LowMemory_lock->notify_all(); 154.159 + Service_lock->notify_all(); 154.160 } 154.161 } 154.162 } 154.163 @@ -203,14 +133,14 @@ 154.164 } 154.165 154.166 { 154.167 - MutexLockerEx ml(LowMemory_lock, Mutex::_no_safepoint_check_flag); 154.168 + MutexLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag); 154.169 154.170 MemoryUsage usage = pool->get_last_collection_usage(); 154.171 sensor->set_counter_sensor_level(usage, pool->gc_usage_threshold()); 154.172 154.173 if (sensor->has_pending_requests()) { 154.174 // notify sensor state update 154.175 - LowMemory_lock->notify_all(); 154.176 + Service_lock->notify_all(); 154.177 } 154.178 } 154.179 } 154.180 @@ -384,8 +314,8 @@ 154.181 } 154.182 154.183 { 154.184 - // Holds LowMemory_lock and update the sensor state 154.185 - MutexLockerEx ml(LowMemory_lock, Mutex::_no_safepoint_check_flag); 154.186 + // Holds Service_lock and update the sensor state 154.187 + MutexLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag); 154.188 _sensor_on = true; 154.189 _sensor_count += count; 154.190 _pending_trigger_count = _pending_trigger_count - count; 154.191 @@ -410,8 +340,8 @@ 154.192 } 154.193 154.194 { 154.195 - // Holds LowMemory_lock and update the sensor state 154.196 - MutexLockerEx ml(LowMemory_lock, Mutex::_no_safepoint_check_flag); 154.197 + // Holds Service_lock and update the sensor state 154.198 + MutexLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag); 154.199 _sensor_on = false; 154.200 _pending_clear_count = 0; 154.201 _pending_trigger_count = _pending_trigger_count - count;
155.1 --- a/src/share/vm/services/lowMemoryDetector.hpp Fri Feb 11 14:30:27 2011 -0800 155.2 +++ b/src/share/vm/services/lowMemoryDetector.hpp Fri Feb 11 15:31:58 2011 -0800 155.3 @@ -1,5 +1,5 @@ 155.4 /* 155.5 - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. 155.6 + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. 155.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 155.8 * 155.9 * This code is free software; you can redistribute it and/or modify it 155.10 @@ -58,8 +58,8 @@ 155.11 // 155.12 // May need to deal with hysteresis effect. 155.13 // 155.14 +// Memory detection code runs in the Service thread (serviceThread.hpp). 155.15 155.16 -class LowMemoryDetectorThread; 155.17 class OopClosure; 155.18 class MemoryPool; 155.19 155.20 @@ -211,23 +211,22 @@ 155.21 }; 155.22 155.23 class LowMemoryDetector : public AllStatic { 155.24 -friend class LowMemoryDetectorDisabler; 155.25 + friend class LowMemoryDetectorDisabler; 155.26 + friend class ServiceThread; 155.27 private: 155.28 // true if any collected heap has low memory detection enabled 155.29 static volatile bool _enabled_for_collected_pools; 155.30 // > 0 if temporary disabed 155.31 static volatile jint _disabled_count; 155.32 155.33 - static LowMemoryDetectorThread* _detector_thread; 155.34 - static void low_memory_detector_thread_entry(JavaThread* thread, TRAPS); 155.35 static void check_memory_usage(); 155.36 static bool has_pending_requests(); 155.37 static bool temporary_disabled() { return _disabled_count > 0; } 155.38 static void disable() { Atomic::inc(&_disabled_count); } 155.39 static void enable() { Atomic::dec(&_disabled_count); } 155.40 + static void process_sensor_changes(TRAPS); 155.41 155.42 public: 155.43 - static void initialize(); 155.44 static void detect_low_memory(); 155.45 static void detect_low_memory(MemoryPool* pool); 155.46 static void detect_after_gc_memory(MemoryPool* pool); 155.47 @@ -275,7 +274,6 @@ 155.48 } 155.49 } 155.50 } 155.51 - 155.52 }; 155.53 155.54 class LowMemoryDetectorDisabler: public StackObj {
156.1 --- a/src/share/vm/services/management.cpp Fri Feb 11 14:30:27 2011 -0800 156.2 +++ b/src/share/vm/services/management.cpp Fri Feb 11 15:31:58 2011 -0800 156.3 @@ -38,6 +38,7 @@ 156.4 #include "runtime/javaCalls.hpp" 156.5 #include "runtime/jniHandles.hpp" 156.6 #include "runtime/os.hpp" 156.7 +#include "runtime/serviceThread.hpp" 156.8 #include "services/classLoadingService.hpp" 156.9 #include "services/heapDumper.hpp" 156.10 #include "services/lowMemoryDetector.hpp" 156.11 @@ -112,8 +113,8 @@ 156.12 } 156.13 156.14 void Management::initialize(TRAPS) { 156.15 - // Start the low memory detector thread 156.16 - LowMemoryDetector::initialize(); 156.17 + // Start the service thread 156.18 + ServiceThread::initialize(); 156.19 156.20 if (ManagementServer) { 156.21 ResourceMark rm(THREAD);
157.1 --- a/src/share/vm/utilities/copy.hpp Fri Feb 11 14:30:27 2011 -0800 157.2 +++ b/src/share/vm/utilities/copy.hpp Fri Feb 11 15:31:58 2011 -0800 157.3 @@ -331,6 +331,12 @@ 157.4 #ifdef TARGET_ARCH_zero 157.5 # include "copy_zero.hpp" 157.6 #endif 157.7 +#ifdef TARGET_ARCH_arm 157.8 +# include "copy_arm.hpp" 157.9 +#endif 157.10 +#ifdef TARGET_ARCH_ppc 157.11 +# include "copy_ppc.hpp" 157.12 +#endif 157.13 157.14 }; 157.15
158.1 --- a/src/share/vm/utilities/elfSymbolTable.cpp Fri Feb 11 14:30:27 2011 -0800 158.2 +++ b/src/share/vm/utilities/elfSymbolTable.cpp Fri Feb 11 15:31:58 2011 -0800 158.3 @@ -39,13 +39,14 @@ 158.4 // try to load the string table 158.5 long cur_offset = ftell(file); 158.6 if (cur_offset != -1) { 158.7 - m_symbols = (Elf_Sym*)NEW_C_HEAP_ARRAY(char, shdr.sh_size); 158.8 + // call malloc so we can back up if memory allocation fails. 158.9 + m_symbols = (Elf_Sym*)os::malloc(shdr.sh_size); 158.10 if (m_symbols) { 158.11 if (fseek(file, shdr.sh_offset, SEEK_SET) || 158.12 fread((void*)m_symbols, shdr.sh_size, 1, file) != 1 || 158.13 fseek(file, cur_offset, SEEK_SET)) { 158.14 m_status = Decoder::file_invalid; 158.15 - FREE_C_HEAP_ARRAY(char, m_symbols); 158.16 + os::free(m_symbols); 158.17 m_symbols = NULL; 158.18 } 158.19 } 158.20 @@ -59,7 +60,7 @@ 158.21 158.22 ElfSymbolTable::~ElfSymbolTable() { 158.23 if (m_symbols != NULL) { 158.24 - FREE_C_HEAP_ARRAY(char, m_symbols); 158.25 + os::free(m_symbols); 158.26 } 158.27 158.28 if (m_next != NULL) {
159.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 159.2 +++ b/src/share/vm/utilities/errorReporter.cpp Fri Feb 11 15:31:58 2011 -0800 159.3 @@ -0,0 +1,32 @@ 159.4 +/* 159.5 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. 159.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 159.7 + * 159.8 + * This code is free software; you can redistribute it and/or modify it 159.9 + * under the terms of the GNU General Public License version 2 only, as 159.10 + * published by the Free Software Foundation. 159.11 + * 159.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 159.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 159.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 159.15 + * version 2 for more details (a copy is included in the LICENSE file that 159.16 + * accompanied this code). 159.17 + * 159.18 + * You should have received a copy of the GNU General Public License version 159.19 + * 2 along with this work; if not, write to the Free Software Foundation, 159.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 159.21 + * 159.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 159.23 + * or visit www.oracle.com if you need additional information or have any 159.24 + * questions. 159.25 + * 159.26 + */ 159.27 + 159.28 +#include "precompiled.hpp" 159.29 +#include "utilities/errorReporter.hpp" 159.30 + 159.31 +ErrorReporter::ErrorReporter() {} 159.32 + 159.33 +void ErrorReporter::call(FILE* fd, char* buffer, int length) { 159.34 +} 159.35 +
160.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 160.2 +++ b/src/share/vm/utilities/errorReporter.hpp Fri Feb 11 15:31:58 2011 -0800 160.3 @@ -0,0 +1,39 @@ 160.4 +/* 160.5 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. 160.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 160.7 + * 160.8 + * This code is free software; you can redistribute it and/or modify it 160.9 + * under the terms of the GNU General Public License version 2 only, as 160.10 + * published by the Free Software Foundation. 160.11 + * 160.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 160.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 160.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 160.15 + * version 2 for more details (a copy is included in the LICENSE file that 160.16 + * accompanied this code). 160.17 + * 160.18 + * You should have received a copy of the GNU General Public License version 160.19 + * 2 along with this work; if not, write to the Free Software Foundation, 160.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 160.21 + * 160.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 160.23 + * or visit www.oracle.com if you need additional information or have any 160.24 + * questions. 160.25 + * 160.26 + */ 160.27 + 160.28 +#ifndef SHARE_VM_UTILITIES_ERRORREPORTER_HPP 160.29 +#define SHARE_VM_UTILITIES_ERRORREPORTER_HPP 160.30 + 160.31 +#include "utilities/globalDefinitions.hpp" 160.32 + 160.33 +class ErrorReporter : public StackObj { 160.34 + 160.35 +public: 160.36 + ErrorReporter(); 160.37 + ~ErrorReporter(){}; 160.38 + 160.39 + void call(FILE* fd, char *buffer, int length); 160.40 +}; 160.41 + 160.42 +#endif // ndef SHARE_VM_UTILITIES_ERRORREPORTER_HPP
161.1 --- a/src/share/vm/utilities/globalDefinitions.hpp Fri Feb 11 14:30:27 2011 -0800 161.2 +++ b/src/share/vm/utilities/globalDefinitions.hpp Fri Feb 11 15:31:58 2011 -0800 161.3 @@ -328,6 +328,12 @@ 161.4 #ifdef TARGET_ARCH_zero 161.5 # include "globalDefinitions_zero.hpp" 161.6 #endif 161.7 +#ifdef TARGET_ARCH_arm 161.8 +# include "globalDefinitions_arm.hpp" 161.9 +#endif 161.10 +#ifdef TARGET_ARCH_ppc 161.11 +# include "globalDefinitions_ppc.hpp" 161.12 +#endif 161.13 161.14 161.15 // The byte alignment to be used by Arena::Amalloc. See bugid 4169348.
162.1 --- a/src/share/vm/utilities/macros.hpp Fri Feb 11 14:30:27 2011 -0800 162.2 +++ b/src/share/vm/utilities/macros.hpp Fri Feb 11 15:31:58 2011 -0800 162.3 @@ -46,7 +46,7 @@ 162.4 #define SERVICES_KERNEL 162.5 162.6 #define KERNEL_RETURN {} 162.7 -#define KERNEL_RETURN_(code) { code } 162.8 +#define KERNEL_RETURN_(code) { return code; } 162.9 162.10 #else // KERNEL 162.11
163.1 --- a/src/share/vm/utilities/ostream.cpp Fri Feb 11 14:30:27 2011 -0800 163.2 +++ b/src/share/vm/utilities/ostream.cpp Fri Feb 11 15:31:58 2011 -0800 163.3 @@ -314,6 +314,11 @@ 163.4 _need_close = true; 163.5 } 163.6 163.7 +fileStream::fileStream(const char* file_name, const char* opentype) { 163.8 + _file = fopen(file_name, opentype); 163.9 + _need_close = true; 163.10 +} 163.11 + 163.12 void fileStream::write(const char* s, size_t len) { 163.13 if (_file != NULL) { 163.14 // Make an unused local variable to avoid warning from gcc 4.x compiler. 163.15 @@ -322,6 +327,25 @@ 163.16 update_position(s, len); 163.17 } 163.18 163.19 +long fileStream::fileSize() { 163.20 + long size = -1; 163.21 + if (_file != NULL) { 163.22 + long pos = ::ftell(_file); 163.23 + if (::fseek(_file, 0, SEEK_END) == 0) { 163.24 + size = ::ftell(_file); 163.25 + } 163.26 + ::fseek(_file, pos, SEEK_SET); 163.27 + } 163.28 + return size; 163.29 +} 163.30 + 163.31 +char* fileStream::readln(char *data, int count ) { 163.32 + char * ret = ::fgets(data, count, _file); 163.33 + //Get rid of annoying \n char 163.34 + data[::strlen(data)-1] = '\0'; 163.35 + return ret; 163.36 +} 163.37 + 163.38 fileStream::~fileStream() { 163.39 if (_file != NULL) { 163.40 if (_need_close) fclose(_file);
164.1 --- a/src/share/vm/utilities/ostream.hpp Fri Feb 11 14:30:27 2011 -0800 164.2 +++ b/src/share/vm/utilities/ostream.hpp Fri Feb 11 15:31:58 2011 -0800 164.3 @@ -159,10 +159,17 @@ 164.4 bool _need_close; 164.5 public: 164.6 fileStream(const char* file_name); 164.7 + fileStream(const char* file_name, const char* opentype); 164.8 fileStream(FILE* file) { _file = file; _need_close = false; } 164.9 ~fileStream(); 164.10 bool is_open() const { return _file != NULL; } 164.11 + void set_need_close(bool b) { _need_close = b;} 164.12 virtual void write(const char* c, size_t len); 164.13 + size_t read(void *data, size_t size, size_t count) { return ::fread(data, size, count, _file); } 164.14 + char* readln(char *data, int count); 164.15 + int eof() { return feof(_file); } 164.16 + long fileSize(); 164.17 + void rewind() { ::rewind(_file); } 164.18 void flush(); 164.19 }; 164.20
165.1 --- a/src/share/vm/utilities/taskqueue.hpp Fri Feb 11 14:30:27 2011 -0800 165.2 +++ b/src/share/vm/utilities/taskqueue.hpp Fri Feb 11 15:31:58 2011 -0800 165.3 @@ -47,6 +47,12 @@ 165.4 #ifdef TARGET_OS_ARCH_windows_x86 165.5 # include "orderAccess_windows_x86.inline.hpp" 165.6 #endif 165.7 +#ifdef TARGET_OS_ARCH_linux_arm 165.8 +# include "orderAccess_linux_arm.inline.hpp" 165.9 +#endif 165.10 +#ifdef TARGET_OS_ARCH_linux_ppc 165.11 +# include "orderAccess_linux_ppc.inline.hpp" 165.12 +#endif 165.13 165.14 // Simple TaskQueue stats that are collected by default in debug builds. 165.15
166.1 --- a/src/share/vm/utilities/vmError.cpp Fri Feb 11 14:30:27 2011 -0800 166.2 +++ b/src/share/vm/utilities/vmError.cpp Fri Feb 11 15:31:58 2011 -0800 166.3 @@ -1,5 +1,5 @@ 166.4 /* 166.5 - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. 166.6 + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. 166.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 166.8 * 166.9 * This code is free software; you can redistribute it and/or modify it 166.10 @@ -35,6 +35,7 @@ 166.11 #include "utilities/debug.hpp" 166.12 #include "utilities/decoder.hpp" 166.13 #include "utilities/defaultStream.hpp" 166.14 +#include "utilities/errorReporter.hpp" 166.15 #include "utilities/top.hpp" 166.16 #include "utilities/vmError.hpp" 166.17 166.18 @@ -200,6 +201,15 @@ 166.19 out->print_raw_cr("#"); 166.20 } 166.21 166.22 +bool VMError::coredump_status; 166.23 +char VMError::coredump_message[O_BUFLEN]; 166.24 + 166.25 +void VMError::report_coredump_status(const char* message, bool status) { 166.26 + coredump_status = status; 166.27 + strncpy(coredump_message, message, sizeof(coredump_message)); 166.28 + coredump_message[sizeof(coredump_message)-1] = 0; 166.29 +} 166.30 + 166.31 166.32 // Return a string to describe the error 166.33 char* VMError::error_string(char* buf, int buflen) { 166.34 @@ -453,6 +463,15 @@ 166.35 st->cr(); 166.36 st->print_cr("#"); 166.37 } 166.38 + STEP(63, "(printing core file information)") 166.39 + st->print("# "); 166.40 + if (coredump_status) { 166.41 + st->print("Core dump written. Default location: %s", coredump_message); 166.42 + } else { 166.43 + st->print("Failed to write core dump. %s", coredump_message); 166.44 + } 166.45 + st->print_cr(""); 166.46 + st->print_cr("#"); 166.47 166.48 STEP(65, "(printing bug submit message)") 166.49 166.50 @@ -769,6 +788,7 @@ 166.51 // then save detailed information in log file (verbose = true). 166.52 static bool out_done = false; // done printing to standard out 166.53 static bool log_done = false; // done saving error log 166.54 + static bool transmit_report_done = false; // done error reporting 166.55 static fdStream log; // error log 166.56 166.57 if (SuppressFatalErrorMessage) { 166.58 @@ -790,6 +810,9 @@ 166.59 ShowMessageBoxOnError = false; 166.60 } 166.61 166.62 + // Write a minidump on Windows, check core dump limits on Linux/Solaris 166.63 + os::check_or_create_dump(_siginfo, _context, buffer, sizeof(buffer)); 166.64 + 166.65 // reset signal handlers or exception filter; make sure recursive crashes 166.66 // are handled properly. 166.67 reset_signal_handlers(); 166.68 @@ -859,7 +882,7 @@ 166.69 bool copy_ok = 166.70 Arguments::copy_expand_pid(ErrorFile, strlen(ErrorFile), buffer, sizeof(buffer)); 166.71 if (copy_ok) { 166.72 - fd = open(buffer, O_WRONLY | O_CREAT | O_TRUNC, 0666); 166.73 + fd = open(buffer, O_RDWR | O_CREAT | O_TRUNC, 0666); 166.74 } 166.75 } 166.76 166.77 @@ -870,7 +893,7 @@ 166.78 // so use the default name in the current directory 166.79 jio_snprintf(&buffer[len], sizeof(buffer)-len, "%shs_err_pid%u.log", 166.80 os::file_separator(), os::current_process_id()); 166.81 - fd = open(buffer, O_WRONLY | O_CREAT | O_TRUNC, 0666); 166.82 + fd = open(buffer, O_RDWR | O_CREAT | O_TRUNC, 0666); 166.83 } 166.84 166.85 if (fd == -1) { 166.86 @@ -879,7 +902,7 @@ 166.87 if (tmpdir != NULL && tmpdir[0] != '\0') { 166.88 jio_snprintf(buffer, sizeof(buffer), "%s%shs_err_pid%u.log", 166.89 tmpdir, os::file_separator(), os::current_process_id()); 166.90 - fd = open(buffer, O_WRONLY | O_CREAT | O_TRUNC, 0666); 166.91 + fd = open(buffer, O_RDWR | O_CREAT | O_TRUNC, 0666); 166.92 } 166.93 } 166.94 166.95 @@ -892,6 +915,9 @@ 166.96 } else { 166.97 out.print_raw_cr("# Can not save log file, dump to screen.."); 166.98 log.set_fd(defaultStream::output_fd()); 166.99 + /* Error reporting currently needs dumpfile. 166.100 + * Maybe implement direct streaming in the future.*/ 166.101 + transmit_report_done = true; 166.102 } 166.103 } 166.104 166.105 @@ -900,6 +926,16 @@ 166.106 first_error->_current_step = 0; // reset current_step 166.107 first_error->_current_step_info = ""; // reset current_step string 166.108 166.109 + // Run error reporting to determine whether or not to report the crash. 166.110 + if (!transmit_report_done && should_report_bug(first_error->_id)) { 166.111 + transmit_report_done = true; 166.112 + FILE* hs_err = ::fdopen(log.fd(), "r"); 166.113 + if (NULL != hs_err) { 166.114 + ErrorReporter er; 166.115 + er.call(hs_err, buffer, O_BUFLEN); 166.116 + } 166.117 + } 166.118 + 166.119 if (log.fd() != defaultStream::output_fd()) { 166.120 close(log.fd()); 166.121 }
167.1 --- a/src/share/vm/utilities/vmError.hpp Fri Feb 11 14:30:27 2011 -0800 167.2 +++ b/src/share/vm/utilities/vmError.hpp Fri Feb 11 15:31:58 2011 -0800 167.3 @@ -1,5 +1,5 @@ 167.4 /* 167.5 - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. 167.6 + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. 167.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 167.8 * 167.9 * This code is free software; you can redistribute it and/or modify it 167.10 @@ -67,6 +67,14 @@ 167.11 static VMError* volatile first_error; 167.12 static volatile jlong first_error_tid; 167.13 167.14 + // Core dump status, false if we have been unable to write a core/minidump for some reason 167.15 + static bool coredump_status; 167.16 + 167.17 + // When coredump_status is set to true this will contain the name/path to the core/minidump, 167.18 + // if coredump_status if false, this will (hopefully) contain a useful error explaining why 167.19 + // no core/minidump has been written to disk 167.20 + static char coredump_message[O_BUFLEN]; 167.21 + 167.22 // used by reporting about OOM 167.23 size_t _size; 167.24 167.25 @@ -106,6 +114,9 @@ 167.26 // return a string to describe the error 167.27 char *error_string(char* buf, int buflen); 167.28 167.29 + // Report status of core/minidump 167.30 + static void report_coredump_status(const char* message, bool status); 167.31 + 167.32 // main error reporting function 167.33 void report_and_die(); 167.34