# HG changeset patch # User rottenha # Date 1297096830 28800 # Node ID 704d4d037c845e759ef976a42fb70a8d51191afd # Parent d5bd38a11ccdfb2fca9a8699bbca642b4a9bf5ed# Parent 77eb272084d95b72a3ceb10322c1763401e17f90 Merge diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/LowMemoryDetectorThread.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/LowMemoryDetectorThread.java Fri Feb 04 16:29:41 2011 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -package sun.jvm.hotspot.runtime; - -import java.io.*; - -import sun.jvm.hotspot.debugger.*; -import sun.jvm.hotspot.types.*; - -public class LowMemoryDetectorThread extends JavaThread { - public LowMemoryDetectorThread(Address addr) { - super(addr); - } - - public boolean isJavaThread() { return false; } - public boolean isHiddenFromExternalView() { return true; } - public boolean isLowMemoryDetectorThread() { return true; } - -} diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ServiceThread.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ServiceThread.java Mon Feb 07 08:40:30 2011 -0800 @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2003, 2011 Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +package sun.jvm.hotspot.runtime; + +import java.io.*; + +import sun.jvm.hotspot.debugger.*; +import sun.jvm.hotspot.types.*; + +public class ServiceThread extends JavaThread { + public ServiceThread(Address addr) { + super(addr); + } + + public boolean isJavaThread() { return false; } + public boolean isHiddenFromExternalView() { return true; } + public boolean isServiceThread() { return true; } + +} diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Thread.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Thread.java Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Thread.java Mon Feb 07 08:40:30 2011 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -111,7 +111,7 @@ public boolean isJvmtiAgentThread() { return false; } public boolean isWatcherThread() { return false; } public boolean isConcurrentMarkSweepThread() { return false; } - public boolean isLowMemoryDetectorThread() { return false; } + public boolean isServiceThread() { return false; } /** Memory operations */ public void oopsDo(AddressVisitor oopVisitor) { diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java Mon Feb 07 08:40:30 2011 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -107,14 +107,14 @@ // for now, use JavaThread itself. fix it later with appropriate class if needed virtualConstructor.addMapping("SurrogateLockerThread", JavaThread.class); virtualConstructor.addMapping("JvmtiAgentThread", JvmtiAgentThread.class); - virtualConstructor.addMapping("LowMemoryDetectorThread", LowMemoryDetectorThread.class); + virtualConstructor.addMapping("ServiceThread", ServiceThread.class); } public Threads() { } /** NOTE: this returns objects of type JavaThread, CompilerThread, - JvmtiAgentThread, and LowMemoryDetectorThread. + JvmtiAgentThread, and ServiceThread. The latter four are subclasses of the former. Most operations (fetching the top frame, etc.) are only allowed to be performed on a "pure" JavaThread. For this reason, {@link @@ -143,7 +143,7 @@ return thread; } catch (Exception e) { throw new RuntimeException("Unable to deduce type of thread from address " + threadAddr + - " (expected type JavaThread, CompilerThread, LowMemoryDetectorThread, JvmtiAgentThread, or SurrogateLockerThread)", e); + " (expected type JavaThread, CompilerThread, ServiceThread, JvmtiAgentThread, or SurrogateLockerThread)", e); } } diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/make/Makefile --- a/hotspot/make/Makefile Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/make/Makefile Mon Feb 07 08:40:30 2011 -0800 @@ -73,6 +73,7 @@ include defs.make endif +include $(GAMMADIR)/make/closed.make ifneq ($(ALT_OUTPUTDIR),) ALT_OUT=ALT_OUTPUTDIR=$(ALT_OUTPUTDIR) @@ -361,7 +362,7 @@ $(EXPORT_INCLUDE_DIR)/%: $(HS_SRC_DIR)/share/vm/prims/% $(install-file) -$(EXPORT_INCLUDE_DIR)/$(JDK_INCLUDE_SUBDIR)/jni_md.h: $(HS_SRC_DIR)/cpu/$(HS_ARCH)/vm/jni_$(HS_ARCH).h +$(EXPORT_INCLUDE_DIR)/$(JDK_INCLUDE_SUBDIR)/jni_md.h: $(HS_JNI_ARCH_SRC) $(install-file) $(EXPORT_INCLUDE_DIR)/%: $(HS_SRC_DIR)/share/vm/services/% diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/make/closed.make --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hotspot/make/closed.make Mon Feb 07 08:40:30 2011 -0800 @@ -0,0 +1,59 @@ +# +# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# +# + +# Support for setting HS_CLOSED_PATH, required GAMMADIR and SRCARCH + +CLOSED_DIR_EXISTS := $(shell \ + if [ -d $(GAMMADIR)/src/closed ] ; then \ + echo true; \ + else \ + echo false; \ + fi) + +CLOSED_SRCARCH_DIR_EXISTS := $(shell \ + if [ -d $(GAMMADIR)/src/closed/cpu/$(SRCARCH)/vm ] ; then \ + echo true; \ + else \ + echo false; \ + fi) + +ifeq ($(CLOSED_SRCARCH_DIR_EXISTS), true) + HS_CLOSED_PATH=closed/ +endif + +# Support for setting HS_JNI_ARCH_SRC, requires HS_SRC_DIR and HS_ARCH + +CLOSED_HS_ARCH_DIR_EXISTS := $(shell \ + if [ -d $(HS_SRC_DIR)/closed/cpu/$(HS_ARCH)/vm ] ; then \ + echo true; \ + else \ + echo false; \ + fi) + +ifeq ($(CLOSED_HS_ARCH_DIR_EXISTS), true) + HS_JNI_ARCH_SRC=$(HS_SRC_DIR)/closed/cpu/$(HS_ARCH)/vm/jni_$(HS_ARCH).h +else + HS_JNI_ARCH_SRC=$(HS_SRC_DIR)/cpu/$(HS_ARCH)/vm/jni_$(HS_ARCH).h +endif + diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/make/jprt.properties --- a/hotspot/make/jprt.properties Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/make/jprt.properties Mon Feb 07 08:40:30 2011 -0800 @@ -44,6 +44,11 @@ jprt.sync.push=false +# Note: we want both embedded releases and regular releases to build and test +# all platforms so that regressions are not introduced (eg. change to +# common code by SE breaks PPC/ARM; change to common code by SE-E breaks +# sparc etc. + # Define the Solaris platforms we want for the various releases jprt.my.solaris.sparc.jdk7=solaris_sparc_5.10 @@ -55,6 +60,8 @@ jprt.my.solaris.sparc.jdk6u14=solaris_sparc_5.8 jprt.my.solaris.sparc.jdk6u18=solaris_sparc_5.8 jprt.my.solaris.sparc.jdk6u20=solaris_sparc_5.8 +jprt.my.solaris.sparc.ejdk7=${jprt.my.solaris.sparc.jdk7} +jprt.my.solaris.sparc.ejdk6=${jprt.my.solaris.sparc.jdk6} jprt.my.solaris.sparc=${jprt.my.solaris.sparc.${jprt.tools.default.release}} jprt.my.solaris.sparcv9.jdk7=solaris_sparcv9_5.10 @@ -66,6 +73,8 @@ jprt.my.solaris.sparcv9.jdk6u14=solaris_sparcv9_5.8 jprt.my.solaris.sparcv9.jdk6u18=solaris_sparcv9_5.8 jprt.my.solaris.sparcv9.jdk6u20=solaris_sparcv9_5.8 +jprt.my.solaris.sparcv9.ejdk7=${jprt.my.solaris.sparcv9.jdk7} +jprt.my.solaris.sparcv9.ejdk6=${jprt.my.solaris.sparcv9.jdk6} jprt.my.solaris.sparcv9=${jprt.my.solaris.sparcv9.${jprt.tools.default.release}} jprt.my.solaris.i586.jdk7=solaris_i586_5.10 @@ -77,6 +86,8 @@ jprt.my.solaris.i586.jdk6u14=solaris_i586_5.8 jprt.my.solaris.i586.jdk6u18=solaris_i586_5.8 jprt.my.solaris.i586.jdk6u20=solaris_i586_5.8 +jprt.my.solaris.i586.ejdk7=${jprt.my.solaris.i586.jdk7} +jprt.my.solaris.i586.ejdk6=${jprt.my.solaris.i586.jdk6} jprt.my.solaris.i586=${jprt.my.solaris.i586.${jprt.tools.default.release}} jprt.my.solaris.x64.jdk7=solaris_x64_5.10 @@ -88,6 +99,8 @@ jprt.my.solaris.x64.jdk6u14=solaris_x64_5.10 jprt.my.solaris.x64.jdk6u18=solaris_x64_5.10 jprt.my.solaris.x64.jdk6u20=solaris_x64_5.10 +jprt.my.solaris.x64.ejdk7=${jprt.my.solaris.x64.jdk7} +jprt.my.solaris.x64.ejdk6=${jprt.my.solaris.x64.jdk6} jprt.my.solaris.x64=${jprt.my.solaris.x64.${jprt.tools.default.release}} jprt.my.linux.i586.jdk7=linux_i586_2.6 @@ -99,6 +112,8 @@ jprt.my.linux.i586.jdk6u14=linux_i586_2.4 jprt.my.linux.i586.jdk6u18=linux_i586_2.4 jprt.my.linux.i586.jdk6u20=linux_i586_2.4 +jprt.my.linux.i586.ejdk7=linux_i586_2.6 +jprt.my.linux.i586.ejdk6=linux_i586_2.6 jprt.my.linux.i586=${jprt.my.linux.i586.${jprt.tools.default.release}} jprt.my.linux.x64.jdk7=linux_x64_2.6 @@ -110,8 +125,45 @@ jprt.my.linux.x64.jdk6u14=linux_x64_2.4 jprt.my.linux.x64.jdk6u18=linux_x64_2.4 jprt.my.linux.x64.jdk6u20=linux_x64_2.4 +jprt.my.linux.x64.ejdk7=${jprt.my.linux.x64.jdk7} +jprt.my.linux.x64.ejdk6=${jprt.my.linux.x64.jdk6} jprt.my.linux.x64=${jprt.my.linux.x64.${jprt.tools.default.release}} +jprt.my.linux.ppc.jdk7=linux_ppc_2.6 +jprt.my.linux.ppc.jdk7b107=linux_ppc_2.6 +jprt.my.linux.ppc.jdk7temp=linux_ppc_2.6 +jprt.my.linux.ppc.ejdk6=linux_ppc_2.6 +jprt.my.linux.ppc.ejdk7=linux_ppc_2.6 +jprt.my.linux.ppc=${jprt.my.linux.ppc.${jprt.tools.default.release}} + +jprt.my.linux.ppcv2.jdk7=linux_ppcv2_2.6 +jprt.my.linux.ppcv2.jdk7b107=linux_ppcv2_2.6 +jprt.my.linux.ppcv2.jdk7temp=linux_ppcv2_2.6 +jprt.my.linux.ppcv2.ejdk6=linux_ppcv2_2.6 +jprt.my.linux.ppcv2.ejdk7=linux_ppcv2_2.6 +jprt.my.linux.ppcv2=${jprt.my.linux.ppcv2.${jprt.tools.default.release}} + +jprt.my.linux.ppcsflt.jdk7=linux_ppcsflt_2.6 +jprt.my.linux.ppcsflt.jdk7b107=linux_ppcsflt_2.6 +jprt.my.linux.ppcsflt.jdk7temp=linux_ppcsflt_2.6 +jprt.my.linux.ppcsflt.ejdk6=linux_ppcsflt_2.6 +jprt.my.linux.ppcsflt.ejdk7=linux_ppcsflt_2.6 +jprt.my.linux.ppcsflt=${jprt.my.linux.ppcsflt.${jprt.tools.default.release}} + +jprt.my.linux.armvfp.jdk7=linux_armvfp_2.6 +jprt.my.linux.armvfp.jdk7b107=linux_armvfp_2.6 +jprt.my.linux.armvfp.jdk7temp=linux_armvfp_2.6 +jprt.my.linux.armvfp.ejdk6=linux_armvfp_2.6 +jprt.my.linux.armvfp.ejdk7=linux_armvfp_2.6 +jprt.my.linux.armvfp=${jprt.my.linux.armvfp.${jprt.tools.default.release}} + +jprt.my.linux.armsflt.jdk7=linux_armsflt_2.6 +jprt.my.linux.armsflt.jdk7b107=linux_armsflt_2.6 +jprt.my.linux.armsflt.jdk7temp=linux_armsflt_2.6 +jprt.my.linux.armsflt.ejdk6=linux_armsflt_2.6 +jprt.my.linux.armsflt.ejdk7=linux_armsflt_2.6 +jprt.my.linux.armsflt=${jprt.my.linux.armsflt.${jprt.tools.default.release}} + jprt.my.windows.i586.jdk7=windows_i586_5.1 jprt.my.windows.i586.jdk7b107=windows_i586_5.0 jprt.my.windows.i586.jdk7temp=windows_i586_5.0 @@ -121,6 +173,8 @@ jprt.my.windows.i586.jdk6u14=windows_i586_5.0 jprt.my.windows.i586.jdk6u18=windows_i586_5.0 jprt.my.windows.i586.jdk6u20=windows_i586_5.0 +jprt.my.windows.i586.ejdk7=${jprt.my.windows.i586.jdk7} +jprt.my.windows.i586.ejdk6=${jprt.my.windows.i586.jdk6} jprt.my.windows.i586=${jprt.my.windows.i586.${jprt.tools.default.release}} jprt.my.windows.x64.jdk7=windows_x64_5.2 @@ -132,11 +186,13 @@ jprt.my.windows.x64.jdk6u14=windows_x64_5.2 jprt.my.windows.x64.jdk6u18=windows_x64_5.2 jprt.my.windows.x64.jdk6u20=windows_x64_5.2 +jprt.my.windows.x64.ejdk7=${jprt.my.windows.x64.jdk7} +jprt.my.windows.x64.ejdk6=${jprt.my.windows.x64.jdk6} jprt.my.windows.x64=${jprt.my.windows.x64.${jprt.tools.default.release}} # Standard list of jprt build targets for this source tree -jprt.build.targets= \ +jprt.build.targets.standard= \ ${jprt.my.solaris.sparc}-{product|fastdebug|debug}, \ ${jprt.my.solaris.sparcv9}-{product|fastdebug|debug}, \ ${jprt.my.solaris.i586}-{product|fastdebug|debug}, \ @@ -146,6 +202,30 @@ ${jprt.my.windows.i586}-{product|fastdebug|debug}, \ ${jprt.my.windows.x64}-{product|fastdebug|debug} +jprt.build.targets.embedded= \ + ${jprt.my.linux.i586}-{product|fastdebug|debug}, \ + ${jprt.my.linux.ppc}-{product|fastdebug}, \ + ${jprt.my.linux.ppcv2}-{product|fastdebug}, \ + ${jprt.my.linux.ppcsflt}-{product|fastdebug}, \ + ${jprt.my.linux.armvfp}-{product|fastdebug}, \ + ${jprt.my.linux.armsflt}-{product|fastdebug} + +jprt.build.targets.all=${jprt.build.targets.standard}, \ + ${jprt.build.targets.embedded} + +jprt.build.targets.jdk7=${jprt.build.targets.all} +jprt.build.targets.jdk7temp=${jprt.build.targets.all} +jprt.build.targets.jdk7b107=${jprt.build.targets.all} +jprt.build.targets.jdk6=${jprt.build.targets.standard} +jprt.build.targets.jdk6perf=${jprt.build.targets.standard} +jprt.build.targets.jdk6u10=${jprt.build.targets.standard} +jprt.build.targets.jdk6u14=${jprt.build.targets.standard} +jprt.build.targets.jdk6u18=${jprt.build.targets.standard} +jprt.build.targets.jdk6u20=${jprt.build.targets.standard} +jprt.build.targets.ejdk6=${jprt.build.targets.all} +jprt.build.targets.ejdk7=${jprt.build.targets.all} +jprt.build.targets=${jprt.build.targets.${jprt.tools.default.release}} + # Subset lists of test targets for this source tree jprt.my.solaris.sparc.test.targets= \ @@ -372,9 +452,14 @@ ${jprt.my.windows.x64}-product-c2-jbb_G1, \ ${jprt.my.windows.x64}-product-c2-jbb_ParOldGC -# The complete list of test targets for jprt +# Testing for actual embedded builds is different to standard +jprt.my.linux.i586.test.targets.embedded = \ + linux_i586_2.6-product-c1-scimark -jprt.test.targets = \ +# The complete list of test targets for jprt +# Note: no PPC or ARM tests at this stage + +jprt.test.targets.standard = \ ${jprt.my.solaris.sparc.test.targets}, \ ${jprt.my.solaris.sparcv9.test.targets}, \ ${jprt.my.solaris.i586.test.targets}, \ @@ -384,15 +469,41 @@ ${jprt.my.windows.i586.test.targets}, \ ${jprt.my.windows.x64.test.targets} +jprt.test.targets.embedded= \ + ${jprt.my.linux.i586.test.targets.embedded}, \ + ${jprt.my.solaris.sparc.test.targets}, \ + ${jprt.my.solaris.sparcv9.test.targets}, \ + ${jprt.my.solaris.i586.test.targets}, \ + ${jprt.my.solaris.x64.test.targets}, \ + ${jprt.my.linux.x64.test.targets}, \ + ${jprt.my.windows.i586.test.targets}, \ + ${jprt.my.windows.x64.test.targets} + + +jprt.test.targets.jdk7=${jprt.test.targets.standard} +jprt.test.targets.jdk7temp=${jprt.test.targets.standard} +jprt.test.targets.jdk7b105=${jprt.test.targets.standard} +jprt.test.targets.jdk6=${jprt.test.targets.standard} +jprt.test.targets.jdk6perf=${jprt.test.targets.standard} +jprt.test.targets.jdk6u10=${jprt.test.targets.standard} +jprt.test.targets.jdk6u14=${jprt.test.targets.standard} +jprt.test.targets.jdk6u18=${jprt.test.targets.standard} +jprt.test.targets.jdk6u20=${jprt.test.targets.standard} +jprt.test.targets.ejdk6=${jprt.test.targets.embedded} +jprt.test.targets.ejdk7=${jprt.test.targets.embedded} +jprt.test.targets=${jprt.test.targets.${jprt.tools.default.release}} + # The default test/Makefile targets that should be run #jprt.make.rule.test.targets=*-product-*-packtest -jprt.make.rule.test.targets = \ +jprt.make.rule.test.targets.standard.client = \ ${jprt.my.solaris.sparc}-*-c1-clienttest, \ ${jprt.my.solaris.i586}-*-c1-clienttest, \ ${jprt.my.linux.i586}-*-c1-clienttest, \ - ${jprt.my.windows.i586}-*-c1-clienttest, \ + ${jprt.my.windows.i586}-*-c1-clienttest + +jprt.make.rule.test.targets.standard.server = \ ${jprt.my.solaris.sparc}-*-c2-servertest, \ ${jprt.my.solaris.sparcv9}-*-c2-servertest, \ ${jprt.my.solaris.i586}-*-c2-servertest, \ @@ -402,3 +513,23 @@ ${jprt.my.windows.i586}-*-c2-servertest, \ ${jprt.my.windows.x64}-*-c2-servertest +jprt.make.rule.test.targets.standard = \ + ${jprt.make.rule.test.targets.standard.client}, \ + ${jprt.make.rule.test.targets.standard.server} + +jprt.make.rule.test.targets.embedded = \ + ${jprt.make.rule.test.targets.standard.client} + +jprt.make.rule.test.targets.jdk7=${jprt.make.rule.test.targets.standard} +jprt.make.rule.test.targets.jdk7temp=${jprt.make.rule.test.targets.standard} +jprt.make.rule.test.targets.jdk7b107=${jprt.make.rule.test.targets.standard} +jprt.make.rule.test.targets.jdk6=${jprt.make.rule.test.targets.standard} +jprt.make.rule.test.targets.jdk6perf=${jprt.make.rule.test.targets.standard} +jprt.make.rule.test.targets.jdk6u10=${jprt.make.rule.test.targets.standard} +jprt.make.rule.test.targets.jdk6u14=${jprt.make.rule.test.targets.standard} +jprt.make.rule.test.targets.jdk6u18=${jprt.make.rule.test.targets.standard} +jprt.make.rule.test.targets.jdk6u20=${jprt.make.rule.test.targets.standard} +jprt.make.rule.test.targets.ejdk6=${jprt.make.rule.test.targets.embedded} +jprt.make.rule.test.targets.ejdk7=${jprt.make.rule.test.targets.embedded} +jprt.make.rule.test.targets=${jprt.make.rule.test.targets.${jprt.tools.default.release}} + diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/make/linux/Makefile --- a/hotspot/make/linux/Makefile Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/make/linux/Makefile Mon Feb 07 08:40:30 2011 -0800 @@ -208,7 +208,7 @@ TARGETS_SHARK = $(addsuffix shark,$(TARGETS)) BUILDTREE_MAKE = $(GAMMADIR)/make/$(OSNAME)/makefiles/buildtree.make -BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OSNAME) ARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) +BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OSNAME) SRCARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) BUILDTREE_VARS += HOTSPOT_RELEASE_VERSION=$(HOTSPOT_RELEASE_VERSION) HOTSPOT_BUILD_VERSION=$(HOTSPOT_BUILD_VERSION) JRE_RELEASE_VERSION=$(JRE_RELEASE_VERSION) BUILDTREE = $(MAKE) -f $(BUILDTREE_MAKE) $(BUILDTREE_VARS) diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/make/linux/makefiles/adlc.make --- a/hotspot/make/linux/makefiles/adlc.make Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/make/linux/makefiles/adlc.make Mon Feb 07 08:40:30 2011 -0800 @@ -39,8 +39,8 @@ SOURCE.AD = $(OUTDIR)/$(OS)_$(Platform_arch_model).ad -SOURCES.AD = $(GAMMADIR)/src/cpu/$(ARCH)/vm/$(Platform_arch_model).ad \ - $(GAMMADIR)/src/os_cpu/$(OS)_$(ARCH)/vm/$(OS)_$(Platform_arch_model).ad +SOURCES.AD = $(GAMMADIR)/src/$(HS_CLOSED_PATH)cpu/$(ARCH)/vm/$(Platform_arch_model).ad \ + $(GAMMADIR)/src/$(HS_CLOSED_PATH)os_cpu/$(OS)_$(ARCH)/vm/$(OS)_$(Platform_arch_model).ad EXEC = $(OUTDIR)/adlc diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/make/linux/makefiles/arm.make --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hotspot/make/linux/makefiles/arm.make Mon Feb 07 08:40:30 2011 -0800 @@ -0,0 +1,10 @@ +# +# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. +# ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. +# + +Obj_Files += linux_arm.o + +LIBS += $(EXT_LIBS_PATH)/sflt_glibc.a + +CFLAGS += -DVM_LITTLE_ENDIAN diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/make/linux/makefiles/buildtree.make --- a/hotspot/make/linux/makefiles/buildtree.make Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/make/linux/makefiles/buildtree.make Mon Feb 07 08:40:30 2011 -0800 @@ -24,7 +24,7 @@ # Usage: # -# $(MAKE) -f buildtree.make ARCH=arch BUILDARCH=buildarch LIBARCH=libarch +# $(MAKE) -f buildtree.make SRCARCH=srcarch BUILDARCH=buildarch LIBARCH=libarch # GAMMADIR=dir OS_FAMILY=os VARIANT=variant # # The macros ARCH, GAMMADIR, OS_FAMILY and VARIANT must be defined in the @@ -56,6 +56,8 @@ # having to read the dependency files for the vm. include $(GAMMADIR)/make/scm.make +include $(GAMMADIR)/make/closed.make + # 'gmake MAKE_VERBOSE=y' or 'gmake QUIETLY=' gives all the gory details. QUIETLY$(MAKE_VERBOSE) = @ @@ -127,7 +129,7 @@ env.sh env.csh jdkpath.sh .dbxrc test_gamma BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OS_FAMILY) \ - ARCH=$(ARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT) + SRCARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT) # Define variables to be set in flags.make. # Default values are set in make/defs.make. @@ -146,12 +148,6 @@ # Define HOTSPOT_VM_DISTRO based on settings in make/openjdk_distro # or make/hotspot_distro. ifndef HOTSPOT_VM_DISTRO - CLOSED_DIR_EXISTS := $(shell \ - if [ -d $(GAMMADIR)/src/closed ] ; then \ - echo true; \ - else \ - echo false; \ - fi) ifeq ($(CLOSED_DIR_EXISTS), true) include $(GAMMADIR)/make/hotspot_distro else @@ -187,7 +183,7 @@ echo; \ echo "GAMMADIR = $(GAMMADIR)"; \ echo "SYSDEFS = \$$(Platform_sysdefs)"; \ - echo "SRCARCH = $(ARCH)"; \ + echo "SRCARCH = $(SRCARCH)"; \ echo "BUILDARCH = $(BUILDARCH)"; \ echo "LIBARCH = $(LIBARCH)"; \ echo "TARGET = $(TARGET)"; \ @@ -208,16 +204,16 @@ echo; \ echo "Src_Dirs_V = \\"; \ sed 's/$$/ \\/;s|$(GAMMADIR)|$$(GAMMADIR)|' ../shared_dirs.lst; \ - echo "\$$(GAMMADIR)/src/cpu/$(ARCH)/vm \\"; \ + echo "\$$(GAMMADIR)/src/$(HS_CLOSED_PATH)cpu/$(SRCARCH)/vm \\"; \ echo "\$$(GAMMADIR)/src/os/$(OS_FAMILY)/vm \\"; \ - echo "\$$(GAMMADIR)/src/os_cpu/$(OS_FAMILY)_$(ARCH)/vm"; \ + echo "\$$(GAMMADIR)/src/$(HS_CLOSED_PATH)os_cpu/$(OS_FAMILY)_$(SRCARCH)/vm"; \ echo; \ echo "Src_Dirs_I = \\"; \ echo "\$$(GAMMADIR)/src/share/vm \\"; \ echo "\$$(GAMMADIR)/src/share/vm/prims \\"; \ - echo "\$$(GAMMADIR)/src/cpu/$(ARCH)/vm \\"; \ + echo "\$$(GAMMADIR)/src/$(HS_CLOSED_PATH)cpu/$(SRCARCH)/vm \\"; \ echo "\$$(GAMMADIR)/src/os/$(OS_FAMILY)/vm \\"; \ - echo "\$$(GAMMADIR)/src/os_cpu/$(OS_FAMILY)_$(ARCH)/vm"; \ + echo "\$$(GAMMADIR)/src/$(HS_CLOSED_PATH)os_cpu/$(OS_FAMILY)_$(SRCARCH)/vm"; \ [ -n "$(CFLAGS_BROWSE)" ] && \ echo && echo "CFLAGS_BROWSE = $(CFLAGS_BROWSE)"; \ [ -n "$(HOTSPOT_EXTRA_SYSDEFS)" ] && \ diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/make/linux/makefiles/gcc.make --- a/hotspot/make/linux/makefiles/gcc.make Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/make/linux/makefiles/gcc.make Mon Feb 07 08:40:30 2011 -0800 @@ -75,6 +75,11 @@ CFLAGS += -fno-exceptions CFLAGS += -D_REENTRANT CFLAGS += -fcheck-new +# version 4 and above support fvisibility=hidden (matches jni_x86.h file) +# except 4.1.2 gives pointless warnings that can't be disabled (afaik) +ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0" +CFLAGS += -fvisibility=hidden +endif ARCHFLAG = $(ARCHFLAG/$(BUILDARCH)) ARCHFLAG/i486 = -m32 -march=i586 diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/make/linux/makefiles/mapfile-vers-debug --- a/hotspot/make/linux/makefiles/mapfile-vers-debug Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/make/linux/makefiles/mapfile-vers-debug Mon Feb 07 08:40:30 2011 -0800 @@ -262,14 +262,6 @@ JVM_SetField; JVM_SetPrimitiveField; - # Needed for dropping VM into JDK 1.3.x, 1.4 - _JVM_native_threads; - jdk_sem_init; - jdk_sem_post; - jdk_sem_wait; - jdk_pthread_sigmask; - jdk_waitpid; - # debug JVM JVM_AccessVMBooleanFlag; JVM_AccessVMIntFlag; diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/make/linux/makefiles/mapfile-vers-product --- a/hotspot/make/linux/makefiles/mapfile-vers-product Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/make/linux/makefiles/mapfile-vers-product Mon Feb 07 08:40:30 2011 -0800 @@ -262,14 +262,6 @@ JVM_SetField; JVM_SetPrimitiveField; - # Needed for dropping VM into JDK 1.3.x, 1.4 - _JVM_native_threads; - jdk_sem_init; - jdk_sem_post; - jdk_sem_wait; - jdk_pthread_sigmask; - jdk_waitpid; - # miscellaneous functions jio_fprintf; jio_printf; diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/make/linux/makefiles/ppc.make --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hotspot/make/linux/makefiles/ppc.make Mon Feb 07 08:40:30 2011 -0800 @@ -0,0 +1,11 @@ +# +# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. +# ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. +# + +# The copied fdlibm routines in sharedRuntimeTrig.o must not be optimized +OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/NOOPT) + +# Must also specify if CPU is big endian +CFLAGS += -DVM_BIG_ENDIAN + diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/make/linux/makefiles/rules.make --- a/hotspot/make/linux/makefiles/rules.make Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/make/linux/makefiles/rules.make Mon Feb 07 08:40:30 2011 -0800 @@ -146,6 +146,8 @@ include $(GAMMADIR)/make/pic.make endif +include $(GAMMADIR)/make/closed.make + # The non-PIC object files are only generated for 32 bit platforms. ifdef LP64 %.o: %.cpp diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/make/linux/makefiles/top.make --- a/hotspot/make/linux/makefiles/top.make Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/make/linux/makefiles/top.make Mon Feb 07 08:40:30 2011 -0800 @@ -39,6 +39,8 @@ # Instead, use "gmake" (or "gnumake") from the command line. --Rose #MAKE = gmake +include $(GAMMADIR)/make/closed.make + TOPDIR = $(shell echo `pwd`) GENERATED = $(TOPDIR)/../generated VM = $(GAMMADIR)/src/share/vm @@ -57,7 +59,7 @@ AD_Dir = $(GENERATED)/adfiles ADLC = $(AD_Dir)/adlc -AD_Spec = $(GAMMADIR)/src/cpu/$(Platform_arch)/vm/$(Platform_arch_model).ad +AD_Spec = $(GAMMADIR)/src/$(HS_CLOSED_PATH)cpu/$(Platform_arch)/vm/$(Platform_arch_model).ad AD_Src = $(GAMMADIR)/src/share/vm/adlc AD_Names = ad_$(Platform_arch_model).hpp ad_$(Platform_arch_model).cpp AD_Files = $(AD_Names:%=$(AD_Dir)/%) diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/make/linux/makefiles/vm.make --- a/hotspot/make/linux/makefiles/vm.make Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/make/linux/makefiles/vm.make Mon Feb 07 08:40:30 2011 -0800 @@ -121,8 +121,8 @@ 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 \)) CORE_PATHS += $(GAMMADIR)/src/os/$(Platform_os_family)/vm -CORE_PATHS += $(GAMMADIR)/src/cpu/$(Platform_arch)/vm -CORE_PATHS += $(GAMMADIR)/src/os_cpu/$(Platform_os_arch)/vm +CORE_PATHS += $(GAMMADIR)/src/$(HS_CLOSED_PATH)cpu/$(Platform_arch)/vm +CORE_PATHS += $(GAMMADIR)/src/$(HS_CLOSED_PATH)os_cpu/$(Platform_os_arch)/vm CORE_PATHS += $(GENERATED)/jvmtifiles COMPILER1_PATHS := $(GAMMADIR)/src/share/vm/c1 diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/make/linux/platform_arm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hotspot/make/linux/platform_arm Mon Feb 07 08:40:30 2011 -0800 @@ -0,0 +1,17 @@ +os_family = linux + +arch = arm + +arch_model = arm + +os_arch = linux_arm + +os_arch_model = linux_arm + +lib_arch = arm + +compiler = gcc + +gnu_dis_arch = arm + +sysdefs = -DLINUX -D_GNU_SOURCE -DARM diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/make/linux/platform_ppc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hotspot/make/linux/platform_ppc Mon Feb 07 08:40:30 2011 -0800 @@ -0,0 +1,17 @@ +os_family = linux + +arch = ppc + +arch_model = ppc + +os_arch = linux_ppc + +os_arch_model = linux_ppc + +lib_arch = ppc + +compiler = gcc + +gnu_dis_arch = ppc + +sysdefs = -DLINUX -D_GNU_SOURCE -DPPC diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/cpu/sparc/vm/jni_sparc.h --- a/hotspot/src/cpu/sparc/vm/jni_sparc.h Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/cpu/sparc/vm/jni_sparc.h Mon Feb 07 08:40:30 2011 -0800 @@ -23,8 +23,13 @@ * questions. */ -#define JNIEXPORT -#define JNIIMPORT +#if defined(__GNUC__) && (__GNUC__ >= 4) + #define JNIEXPORT __attribute__((visibility("default"))) + #define JNIIMPORT __attribute__((visibility("default"))) +#else + #define JNIEXPORT + #define JNIIMPORT +#endif #define JNICALL typedef int jint; diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/cpu/x86/vm/jni_x86.h --- a/hotspot/src/cpu/x86/vm/jni_x86.h Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/cpu/x86/vm/jni_x86.h Mon Feb 07 08:40:30 2011 -0800 @@ -27,10 +27,16 @@ #define _JAVASOFT_JNI_MD_H_ #if defined(SOLARIS) || defined(LINUX) + +#if defined(__GNUC__) && (__GNUC__ > 4) || (__GNUC__ == 4) && (__GNUC_MINOR__ > 2) + #define JNIEXPORT __attribute__((visibility("default"))) + #define JNIIMPORT __attribute__((visibility("default"))) +#else #define JNIEXPORT #define JNIIMPORT +#endif + #define JNICALL - typedef int jint; #ifdef _LP64 diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/cpu/zero/vm/jni_zero.h --- a/hotspot/src/cpu/zero/vm/jni_zero.h Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/cpu/zero/vm/jni_zero.h Mon Feb 07 08:40:30 2011 -0800 @@ -24,8 +24,14 @@ * questions. */ -#define JNIEXPORT -#define JNIIMPORT + +#if defined(__GNUC__) && (__GNUC__ >= 4) + #define JNIEXPORT __attribute__((visibility("default"))) + #define JNIIMPORT __attribute__((visibility("default"))) +#else + #define JNIEXPORT + #define JNIIMPORT +#endif #define JNICALL typedef int jint; diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/os/linux/vm/jvm_linux.cpp --- a/hotspot/src/os/linux/vm/jvm_linux.cpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/os/linux/vm/jvm_linux.cpp Mon Feb 07 08:40:30 2011 -0800 @@ -29,11 +29,6 @@ #include -/* - * FIXME: This is temporary hack to keep Linux Runtime.exec() - * code happy. See $JDK/src/linux/native/java/lang/UnixProcess_md.c - */ -int _JVM_native_threads = 1; // sun.misc.Signal /////////////////////////////////////////////////////////// // Signal code is mostly copied from classic vm, signals_md.c 1.4 98/08/23 diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/os/linux/vm/osThread_linux.cpp --- a/hotspot/src/os/linux/vm/osThread_linux.cpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/os/linux/vm/osThread_linux.cpp Mon Feb 07 08:40:30 2011 -0800 @@ -39,6 +39,12 @@ #ifdef TARGET_ARCH_zero # include "assembler_zero.inline.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "assembler_arm.inline.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "assembler_ppc.inline.hpp" +#endif void OSThread::pd_initialize() { diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/os/linux/vm/os_linux.cpp --- a/hotspot/src/os/linux/vm/os_linux.cpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/os/linux/vm/os_linux.cpp Mon Feb 07 08:40:30 2011 -0800 @@ -76,6 +76,14 @@ # include "assembler_zero.inline.hpp" # include "nativeInst_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "assembler_arm.inline.hpp" +# include "nativeInst_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "assembler_ppc.inline.hpp" +# include "nativeInst_ppc.hpp" +#endif #ifdef COMPILER1 #include "c1/c1_Runtime1.hpp" #endif @@ -2509,8 +2517,10 @@ return end; } -extern "C" void numa_warn(int number, char *where, ...) { } -extern "C" void numa_error(char *where) { } +// Something to do with the numa-aware allocator needs these symbols +extern "C" JNIEXPORT void numa_warn(int number, char *where, ...) { } +extern "C" JNIEXPORT void numa_error(char *where) { } +extern "C" JNIEXPORT int fork1() { return fork(); } // If we are running with libnuma version > 2, then we should @@ -3483,7 +3493,7 @@ // Note that the VM will print warnings if it detects conflicting signal // handlers, unless invoked with the option "-XX:+AllowUserSignalHandlers". // -extern "C" int +extern "C" JNIEXPORT int JVM_handle_linux_signal(int signo, siginfo_t* siginfo, void* ucontext, int abort_if_unrecognized); @@ -4678,44 +4688,6 @@ } } -extern "C" { - -/** - * NOTE: the following code is to keep the green threads code - * in the libjava.so happy. Once the green threads is removed, - * these code will no longer be needed. - */ -int -jdk_waitpid(pid_t pid, int* status, int options) { - return waitpid(pid, status, options); -} - -int -fork1() { - return fork(); -} - -int -jdk_sem_init(sem_t *sem, int pshared, unsigned int value) { - return sem_init(sem, pshared, value); -} - -int -jdk_sem_post(sem_t *sem) { - return sem_post(sem); -} - -int -jdk_sem_wait(sem_t *sem) { - return sem_wait(sem); -} - -int -jdk_pthread_sigmask(int how , const sigset_t* newmask, sigset_t* oldmask) { - return pthread_sigmask(how , newmask, oldmask); -} - -} // Refer to the comments in os_solaris.cpp park-unpark. // diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/os/linux/vm/os_linux.inline.hpp --- a/hotspot/src/os/linux/vm/os_linux.inline.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/os/linux/vm/os_linux.inline.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -39,6 +39,14 @@ # include "atomic_linux_zero.inline.hpp" # include "orderAccess_linux_zero.inline.hpp" #endif +#ifdef TARGET_OS_ARCH_linux_arm +# include "atomic_linux_arm.inline.hpp" +# include "orderAccess_linux_arm.inline.hpp" +#endif +#ifdef TARGET_OS_ARCH_linux_ppc +# include "atomic_linux_ppc.inline.hpp" +# include "orderAccess_linux_ppc.inline.hpp" +#endif // System includes diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/os/linux/vm/thread_linux.inline.hpp --- a/hotspot/src/os/linux/vm/thread_linux.inline.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/os/linux/vm/thread_linux.inline.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -44,6 +44,16 @@ # include "orderAccess_linux_zero.inline.hpp" # include "prefetch_linux_zero.inline.hpp" #endif +#ifdef TARGET_OS_ARCH_linux_arm +# include "atomic_linux_arm.inline.hpp" +# include "orderAccess_linux_arm.inline.hpp" +# include "prefetch_linux_arm.inline.hpp" +#endif +#ifdef TARGET_OS_ARCH_linux_ppc +# include "atomic_linux_ppc.inline.hpp" +# include "orderAccess_linux_ppc.inline.hpp" +# include "prefetch_linux_ppc.inline.hpp" +#endif // Contains inlined functions for class Thread and ThreadLocalStorage diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/os/solaris/vm/os_solaris.cpp --- a/hotspot/src/os/solaris/vm/os_solaris.cpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/os/solaris/vm/os_solaris.cpp Mon Feb 07 08:40:30 2011 -0800 @@ -4221,7 +4221,9 @@ // Note that the VM will print warnings if it detects conflicting signal // handlers, unless invoked with the option "-XX:+AllowUserSignalHandlers". // -extern "C" int JVM_handle_solaris_signal(int signo, siginfo_t* siginfo, void* ucontext, int abort_if_unrecognized); +extern "C" JNIEXPORT int +JVM_handle_solaris_signal(int signo, siginfo_t* siginfo, void* ucontext, + int abort_if_unrecognized); void signalHandler(int sig, siginfo_t* info, void* ucVoid) { diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp --- a/hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp Mon Feb 07 08:40:30 2011 -0800 @@ -542,7 +542,7 @@ return false; } -extern "C" int +extern "C" JNIEXPORT int JVM_handle_linux_signal(int sig, siginfo_t* info, void* ucVoid, diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp --- a/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp Mon Feb 07 08:40:30 2011 -0800 @@ -216,7 +216,7 @@ extern "C" void FetchNResume () ; #endif // AMD64 -extern "C" int +extern "C" JNIEXPORT int JVM_handle_linux_signal(int sig, siginfo_t* info, void* ucVoid, diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp --- a/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp Mon Feb 07 08:40:30 2011 -0800 @@ -116,7 +116,7 @@ ShouldNotCallThis(); } -extern "C" int +extern "C" JNIEXPORT int JVM_handle_linux_signal(int sig, siginfo_t* info, void* ucVoid, diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp --- a/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp Mon Feb 07 08:40:30 2011 -0800 @@ -317,9 +317,9 @@ extern "C" void FetchNPFI () ; extern "C" void FetchNResume () ; -extern "C" int JVM_handle_solaris_signal(int signo, siginfo_t* siginfo, void* ucontext, int abort_if_unrecognized); - -int JVM_handle_solaris_signal(int sig, siginfo_t* info, void* ucVoid, int abort_if_unrecognized) { +extern "C" JNIEXPORT int +JVM_handle_solaris_signal(int sig, siginfo_t* info, void* ucVoid, + int abort_if_unrecognized) { ucontext_t* uc = (ucontext_t*) ucVoid; Thread* t = ThreadLocalStorage::get_thread_slow(); diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp --- a/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp Mon Feb 07 08:40:30 2011 -0800 @@ -365,8 +365,6 @@ } -extern "C" int JVM_handle_solaris_signal(int signo, siginfo_t* siginfo, void* ucontext, int abort_if_unrecognized); - extern "C" void Fetch32PFI () ; extern "C" void Fetch32Resume () ; #ifdef AMD64 @@ -374,7 +372,9 @@ extern "C" void FetchNResume () ; #endif // AMD64 -int JVM_handle_solaris_signal(int sig, siginfo_t* info, void* ucVoid, int abort_if_unrecognized) { +extern "C" JNIEXPORT int +JVM_handle_solaris_signal(int sig, siginfo_t* info, void* ucVoid, + int abort_if_unrecognized) { ucontext_t* uc = (ucontext_t*) ucVoid; #ifndef AMD64 diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/asm/assembler.cpp --- a/hotspot/src/share/vm/asm/assembler.cpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/asm/assembler.cpp Mon Feb 07 08:40:30 2011 -0800 @@ -37,6 +37,12 @@ #ifdef TARGET_ARCH_zero # include "assembler_zero.inline.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "assembler_arm.inline.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "assembler_ppc.inline.hpp" +#endif // Implementation of AbstractAssembler diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/asm/assembler.hpp --- a/hotspot/src/share/vm/asm/assembler.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/asm/assembler.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -43,6 +43,14 @@ # include "register_zero.hpp" # include "vm_version_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "register_arm.hpp" +# include "vm_version_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "register_ppc.hpp" +# include "vm_version_ppc.hpp" +#endif // This file contains platform-independent assembler declarations. @@ -395,6 +403,12 @@ #ifdef TARGET_ARCH_zero # include "assembler_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "assembler_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "assembler_ppc.hpp" +#endif #endif // SHARE_VM_ASM_ASSEMBLER_HPP diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/asm/codeBuffer.hpp --- a/hotspot/src/share/vm/asm/codeBuffer.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/asm/codeBuffer.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -566,6 +566,12 @@ #ifdef TARGET_ARCH_zero # include "codeBuffer_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "codeBuffer_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "codeBuffer_ppc.hpp" +#endif }; diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/c1/c1_Defs.hpp --- a/hotspot/src/share/vm/c1/c1_Defs.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/c1/c1_Defs.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -35,6 +35,12 @@ #ifdef TARGET_ARCH_zero # include "register_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "register_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "register_ppc.hpp" +#endif // set frame size and return address offset to these values in blobs // (if the compiled frame uses ebp as link pointer on IA; otherwise, @@ -50,6 +56,12 @@ #ifdef TARGET_ARCH_sparc # include "c1_Defs_sparc.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "c1_Defs_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "c1_Defs_ppc.hpp" +#endif // native word offsets from memory address diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/c1/c1_FpuStackSim.hpp --- a/hotspot/src/share/vm/c1/c1_FpuStackSim.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/c1/c1_FpuStackSim.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -38,6 +38,12 @@ #ifdef TARGET_ARCH_sparc # include "c1_FpuStackSim_sparc.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "c1_FpuStackSim_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "c1_FpuStackSim_ppc.hpp" +#endif #endif // SHARE_VM_C1_C1_FPUSTACKSIM_HPP diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/c1/c1_FrameMap.cpp --- a/hotspot/src/share/vm/c1/c1_FrameMap.cpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/c1/c1_FrameMap.cpp Mon Feb 07 08:40:30 2011 -0800 @@ -35,6 +35,12 @@ #ifdef TARGET_ARCH_zero # include "vmreg_zero.inline.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "vmreg_arm.inline.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "vmreg_ppc.inline.hpp" +#endif diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/c1/c1_FrameMap.hpp --- a/hotspot/src/share/vm/c1/c1_FrameMap.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/c1/c1_FrameMap.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -88,6 +88,12 @@ #ifdef TARGET_ARCH_sparc # include "c1_FrameMap_sparc.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "c1_FrameMap_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "c1_FrameMap_ppc.hpp" +#endif friend class LIR_OprDesc; diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/c1/c1_Instruction.hpp --- a/hotspot/src/share/vm/c1/c1_Instruction.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/c1/c1_Instruction.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -316,6 +316,8 @@ return res; } + static const int no_bci = -99; + enum InstructionFlag { NeedsNullCheckFlag = 0, CanTrapFlag, diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/c1/c1_LIRAssembler.cpp --- a/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp Mon Feb 07 08:40:30 2011 -0800 @@ -42,6 +42,14 @@ # include "nativeInst_zero.hpp" # include "vmreg_zero.inline.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "nativeInst_arm.hpp" +# include "vmreg_arm.inline.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "nativeInst_ppc.hpp" +# include "vmreg_ppc.inline.hpp" +#endif void LIR_Assembler::patching_epilog(PatchingStub* patch, LIR_PatchCode patch_code, Register obj, CodeEmitInfo* info) { diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/c1/c1_LIRAssembler.hpp --- a/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -252,6 +252,12 @@ #ifdef TARGET_ARCH_sparc # include "c1_LIRAssembler_sparc.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "c1_LIRAssembler_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "c1_LIRAssembler_ppc.hpp" +#endif }; diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/c1/c1_LinearScan.cpp --- a/hotspot/src/share/vm/c1/c1_LinearScan.cpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/c1/c1_LinearScan.cpp Mon Feb 07 08:40:30 2011 -0800 @@ -41,6 +41,12 @@ #ifdef TARGET_ARCH_zero # include "vmreg_zero.inline.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "vmreg_arm.inline.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "vmreg_ppc.inline.hpp" +#endif #ifndef PRODUCT diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/c1/c1_LinearScan.hpp --- a/hotspot/src/share/vm/c1/c1_LinearScan.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/c1/c1_LinearScan.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -972,6 +972,12 @@ #ifdef TARGET_ARCH_sparc # include "c1_LinearScan_sparc.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "c1_LinearScan_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "c1_LinearScan_ppc.hpp" +#endif #endif // SHARE_VM_C1_C1_LINEARSCAN_HPP diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/c1/c1_MacroAssembler.hpp --- a/hotspot/src/share/vm/c1/c1_MacroAssembler.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/c1/c1_MacroAssembler.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -35,6 +35,12 @@ #ifdef TARGET_ARCH_zero # include "assembler_zero.inline.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "assembler_arm.inline.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "assembler_ppc.inline.hpp" +#endif class CodeEmitInfo; @@ -61,6 +67,12 @@ #ifdef TARGET_ARCH_sparc # include "c1_MacroAssembler_sparc.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "c1_MacroAssembler_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "c1_MacroAssembler_ppc.hpp" +#endif }; diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/c1/c1_globals.hpp --- a/hotspot/src/share/vm/c1/c1_globals.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/c1/c1_globals.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -32,6 +32,12 @@ #ifdef TARGET_ARCH_sparc # include "c1_globals_sparc.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "c1_globals_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "c1_globals_ppc.hpp" +#endif #ifdef TARGET_OS_FAMILY_linux # include "c1_globals_linux.hpp" #endif diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/classfile/classFileStream.hpp --- a/hotspot/src/share/vm/classfile/classFileStream.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/classfile/classFileStream.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -35,6 +35,12 @@ #ifdef TARGET_ARCH_zero # include "bytes_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "bytes_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "bytes_ppc.hpp" +#endif // Input stream for reading .class file // diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/classfile/stackMapTable.hpp --- a/hotspot/src/share/vm/classfile/stackMapTable.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/classfile/stackMapTable.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -39,6 +39,12 @@ #ifdef TARGET_ARCH_zero # include "bytes_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "bytes_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "bytes_ppc.hpp" +#endif class StackMapReader; diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/classfile/verifier.cpp --- a/hotspot/src/share/vm/classfile/verifier.cpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/classfile/verifier.cpp Mon Feb 07 08:40:30 2011 -0800 @@ -51,6 +51,12 @@ #ifdef TARGET_ARCH_zero # include "bytes_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "bytes_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "bytes_ppc.hpp" +#endif #define NOFAILOVER_MAJOR_VERSION 51 diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/code/codeBlob.cpp --- a/hotspot/src/share/vm/code/codeBlob.cpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/code/codeBlob.cpp Mon Feb 07 08:40:30 2011 -0800 @@ -48,6 +48,12 @@ #ifdef TARGET_ARCH_zero # include "nativeInst_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "nativeInst_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "nativeInst_ppc.hpp" +#endif #ifdef COMPILER1 #include "c1/c1_Runtime1.hpp" #endif diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/code/compiledIC.hpp --- a/hotspot/src/share/vm/code/compiledIC.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/code/compiledIC.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -38,6 +38,12 @@ #ifdef TARGET_ARCH_zero # include "nativeInst_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "nativeInst_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "nativeInst_ppc.hpp" +#endif //----------------------------------------------------------------------------- // The CompiledIC represents a compiled inline cache. diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/code/icBuffer.cpp --- a/hotspot/src/share/vm/code/icBuffer.cpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/code/icBuffer.cpp Mon Feb 07 08:40:30 2011 -0800 @@ -46,6 +46,12 @@ #ifdef TARGET_ARCH_zero # include "assembler_zero.inline.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "assembler_arm.inline.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "assembler_ppc.inline.hpp" +#endif DEF_STUB_INTERFACE(ICStub); diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/code/nmethod.cpp --- a/hotspot/src/share/vm/code/nmethod.cpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/code/nmethod.cpp Mon Feb 07 08:40:30 2011 -0800 @@ -34,6 +34,7 @@ #include "interpreter/bytecode.hpp" #include "oops/methodDataOop.hpp" #include "prims/jvmtiRedefineClassesTrace.hpp" +#include "prims/jvmtiImpl.hpp" #include "runtime/sharedRuntime.hpp" #include "runtime/sweeper.hpp" #include "utilities/dtrace.hpp" @@ -1533,7 +1534,10 @@ } if (JvmtiExport::should_post_compiled_method_load()) { - JvmtiExport::post_compiled_method_load(this); + // Let the Service thread (which is a real Java thread) post the event + MutexLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag); + JvmtiDeferredEventQueue::enqueue( + JvmtiDeferredEvent::compiled_method_load_event(this)); } } @@ -1566,8 +1570,17 @@ // ref will have been cleared. if (_jmethod_id != NULL && JvmtiExport::should_post_compiled_method_unload()) { assert(!unload_reported(), "already unloaded"); - HandleMark hm; - JvmtiExport::post_compiled_method_unload(_jmethod_id, insts_begin()); + JvmtiDeferredEvent event = + JvmtiDeferredEvent::compiled_method_unload_event( + _jmethod_id, insts_begin()); + if (SafepointSynchronize::is_at_safepoint()) { + // Don't want to take the queueing lock. Add it as pending and + // it will get enqueued later. + JvmtiDeferredEventQueue::add_pending_event(event); + } else { + MutexLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag); + JvmtiDeferredEventQueue::enqueue(event); + } } // The JVMTI CompiledMethodUnload event can be enabled or disabled at diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/code/nmethod.hpp --- a/hotspot/src/share/vm/code/nmethod.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/code/nmethod.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -696,10 +696,11 @@ class nmethodLocker : public StackObj { nmethod* _nm; + public: + static void lock_nmethod(nmethod* nm); // note: nm can be NULL static void unlock_nmethod(nmethod* nm); // (ditto) - public: nmethodLocker(address pc); // derive nm from pc nmethodLocker(nmethod *nm) { _nm = nm; lock_nmethod(_nm); } nmethodLocker() { _nm = NULL; } diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/code/relocInfo.cpp --- a/hotspot/src/share/vm/code/relocInfo.cpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/code/relocInfo.cpp Mon Feb 07 08:40:30 2011 -0800 @@ -41,6 +41,14 @@ # include "assembler_zero.inline.hpp" # include "nativeInst_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "assembler_arm.inline.hpp" +# include "nativeInst_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "assembler_ppc.inline.hpp" +# include "nativeInst_ppc.hpp" +#endif const RelocationHolder RelocationHolder::none; // its type is relocInfo::none diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/code/relocInfo.hpp --- a/hotspot/src/share/vm/code/relocInfo.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/code/relocInfo.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -430,6 +430,12 @@ #ifdef TARGET_ARCH_zero # include "relocInfo_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "relocInfo_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "relocInfo_ppc.hpp" +#endif protected: diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/code/vmreg.hpp --- a/hotspot/src/share/vm/code/vmreg.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/code/vmreg.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -36,6 +36,12 @@ #ifdef TARGET_ARCH_zero # include "register_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "register_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "register_ppc.hpp" +#endif #ifdef COMPILER2 #include "opto/adlcVMDeps.hpp" #include "utilities/ostream.hpp" @@ -51,6 +57,12 @@ #ifdef TARGET_ARCH_MODEL_zero # include "adfiles/adGlobals_zero.hpp" #endif +#ifdef TARGET_ARCH_MODEL_arm +# include "adfiles/adGlobals_arm.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_ppc +# include "adfiles/adGlobals_ppc.hpp" +#endif #endif //------------------------------VMReg------------------------------------------ @@ -164,6 +176,12 @@ #ifdef TARGET_ARCH_zero # include "vmreg_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "vmreg_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "vmreg_ppc.hpp" +#endif }; diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/compiler/disassembler.cpp --- a/hotspot/src/share/vm/compiler/disassembler.cpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/compiler/disassembler.cpp Mon Feb 07 08:40:30 2011 -0800 @@ -41,6 +41,12 @@ #ifdef TARGET_ARCH_zero # include "depChecker_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "depChecker_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "depChecker_ppc.hpp" +#endif #ifdef SHARK #include "shark/sharkEntry.hpp" #endif diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/compiler/disassembler.hpp --- a/hotspot/src/share/vm/compiler/disassembler.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/compiler/disassembler.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -70,6 +70,12 @@ #ifdef TARGET_ARCH_zero # include "disassembler_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "disassembler_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "disassembler_ppc.hpp" +#endif public: diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/interpreter/abstractInterpreter.hpp --- a/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -41,6 +41,12 @@ #ifdef TARGET_ARCH_MODEL_zero # include "interp_masm_zero.hpp" #endif +#ifdef TARGET_ARCH_MODEL_arm +# include "interp_masm_arm.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_ppc +# include "interp_masm_ppc.hpp" +#endif #ifdef TARGET_OS_FAMILY_linux # include "thread_linux.inline.hpp" #endif diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/interpreter/bytecode.hpp --- a/hotspot/src/share/vm/interpreter/bytecode.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/interpreter/bytecode.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -37,6 +37,12 @@ #ifdef TARGET_ARCH_zero # include "bytes_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "bytes_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "bytes_ppc.hpp" +#endif class ciBytecodeStream; diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp --- a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp Mon Feb 07 08:40:30 2011 -0800 @@ -59,6 +59,12 @@ #ifdef TARGET_OS_ARCH_windows_x86 # include "orderAccess_windows_x86.inline.hpp" #endif +#ifdef TARGET_OS_ARCH_linux_arm +# include "orderAccess_linux_arm.inline.hpp" +#endif +#ifdef TARGET_OS_ARCH_linux_ppc +# include "orderAccess_linux_ppc.inline.hpp" +#endif // no precompiled headers diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp --- a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -41,6 +41,12 @@ #ifdef TARGET_ARCH_zero # include "bytes_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "bytes_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "bytes_ppc.hpp" +#endif #ifdef CC_INTERP @@ -587,6 +593,12 @@ #ifdef TARGET_ARCH_zero # include "bytecodeInterpreter_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "bytecodeInterpreter_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "bytecodeInterpreter_ppc.hpp" +#endif }; // BytecodeInterpreter diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp --- a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -52,6 +52,12 @@ #ifdef TARGET_ARCH_zero # include "bytecodeInterpreter_zero.inline.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "bytecodeInterpreter_arm.inline.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "bytecodeInterpreter_ppc.inline.hpp" +#endif #endif // CC_INTERP diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/interpreter/bytecodeStream.hpp --- a/hotspot/src/share/vm/interpreter/bytecodeStream.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/interpreter/bytecodeStream.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -37,6 +37,12 @@ #ifdef TARGET_ARCH_zero # include "bytes_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "bytes_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "bytes_ppc.hpp" +#endif // A BytecodeStream is used for fast iteration over the bytecodes // of a methodOop. diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/interpreter/bytecodes.cpp --- a/hotspot/src/share/vm/interpreter/bytecodes.cpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/interpreter/bytecodes.cpp Mon Feb 07 08:40:30 2011 -0800 @@ -35,6 +35,12 @@ #ifdef TARGET_ARCH_zero # include "bytes_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "bytes_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "bytes_ppc.hpp" +#endif #if defined(WIN32) && (defined(_MSC_VER) && (_MSC_VER < 1600)) diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/interpreter/bytecodes.hpp --- a/hotspot/src/share/vm/interpreter/bytecodes.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/interpreter/bytecodes.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -294,6 +294,12 @@ #ifdef TARGET_ARCH_zero # include "bytecodes_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "bytecodes_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "bytecodes_ppc.hpp" +#endif number_of_codes diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/interpreter/cppInterpreter.hpp --- a/hotspot/src/share/vm/interpreter/cppInterpreter.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/interpreter/cppInterpreter.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -90,6 +90,12 @@ #ifdef TARGET_ARCH_zero # include "cppInterpreter_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "cppInterpreter_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "cppInterpreter_ppc.hpp" +#endif }; diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/interpreter/cppInterpreterGenerator.hpp --- a/hotspot/src/share/vm/interpreter/cppInterpreterGenerator.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/interpreter/cppInterpreterGenerator.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -53,6 +53,12 @@ #ifdef TARGET_ARCH_zero # include "cppInterpreterGenerator_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "cppInterpreterGenerator_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "cppInterpreterGenerator_ppc.hpp" +#endif }; diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/interpreter/interpreter.hpp --- a/hotspot/src/share/vm/interpreter/interpreter.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/interpreter/interpreter.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -152,6 +152,12 @@ #ifdef TARGET_ARCH_zero # include "interpreter_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "interpreter_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "interpreter_ppc.hpp" +#endif }; diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/interpreter/interpreterGenerator.hpp --- a/hotspot/src/share/vm/interpreter/interpreterGenerator.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/interpreter/interpreterGenerator.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -50,6 +50,12 @@ #ifdef TARGET_ARCH_zero # include "interpreterGenerator_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "interpreterGenerator_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "interpreterGenerator_ppc.hpp" +#endif }; diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/interpreter/interpreterRuntime.cpp --- a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp Mon Feb 07 08:40:30 2011 -0800 @@ -65,6 +65,12 @@ #ifdef TARGET_ARCH_zero # include "vm_version_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "vm_version_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "vm_version_ppc.hpp" +#endif #ifdef COMPILER2 #include "opto/runtime.hpp" #endif @@ -1178,9 +1184,7 @@ handler_index = _fingerprints->length() - 1; } } - } else { - CHECK_UNHANDLED_OOPS_ONLY(Thread::current()->clear_unhandled_oops()); - } + // Set handler under SignatureHandlerLibrary_lock if (handler_index < 0) { // use generic signature handler method->set_signature_handler(Interpreter::slow_signature_handler()); @@ -1188,21 +1192,29 @@ // set handler method->set_signature_handler(_handlers->at(handler_index)); } + } else { + CHECK_UNHANDLED_OOPS_ONLY(Thread::current()->clear_unhandled_oops()); + // use generic signature handler + method->set_signature_handler(Interpreter::slow_signature_handler()); + } } #ifdef ASSERT - int handler_index, fingerprint_index; + int handler_index = -1; + int fingerprint_index = -2; { // '_handlers' and '_fingerprints' are 'GrowableArray's and are NOT synchronized // in any way if accessed from multiple threads. To avoid races with another // thread which may change the arrays in the above, mutex protected block, we // have to protect this read access here with the same mutex as well! MutexLocker mu(SignatureHandlerLibrary_lock); + if (_handlers != NULL) { handler_index = _handlers->find(method->signature_handler()); fingerprint_index = _fingerprints->find(Fingerprinter(method).fingerprint()); } + } assert(method->signature_handler() == Interpreter::slow_signature_handler() || handler_index == fingerprint_index, "sanity check"); -#endif +#endif // ASSERT } diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/interpreter/interpreterRuntime.hpp --- a/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -157,6 +157,12 @@ #ifdef TARGET_ARCH_zero # include "interpreterRT_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "interpreterRT_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "interpreterRT_ppc.hpp" +#endif // Interpreter's frequency counter overflow diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/interpreter/templateInterpreter.hpp --- a/hotspot/src/share/vm/interpreter/templateInterpreter.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/interpreter/templateInterpreter.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -192,6 +192,12 @@ #ifdef TARGET_ARCH_zero # include "templateInterpreter_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "templateInterpreter_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "templateInterpreter_ppc.hpp" +#endif }; diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp --- a/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -96,6 +96,12 @@ #ifdef TARGET_ARCH_zero # include "templateInterpreterGenerator_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "templateInterpreterGenerator_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "templateInterpreterGenerator_ppc.hpp" +#endif }; diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/interpreter/templateTable.hpp --- a/hotspot/src/share/vm/interpreter/templateTable.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/interpreter/templateTable.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -40,6 +40,12 @@ #ifdef TARGET_ARCH_MODEL_zero # include "interp_masm_zero.hpp" #endif +#ifdef TARGET_ARCH_MODEL_arm +# include "interp_masm_arm.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_ppc +# include "interp_masm_ppc.hpp" +#endif #ifndef CC_INTERP // All the necessary definitions used for (bytecode) template generation. Instead of @@ -364,6 +370,12 @@ #ifdef TARGET_ARCH_MODEL_zero # include "templateTable_zero.hpp" #endif +#ifdef TARGET_ARCH_MODEL_arm +# include "templateTable_arm.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_ppc +# include "templateTable_ppc.hpp" +#endif }; #endif /* !CC_INTERP */ diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/oops/constantPoolOop.hpp --- a/hotspot/src/share/vm/oops/constantPoolOop.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/oops/constantPoolOop.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -39,6 +39,12 @@ #ifdef TARGET_ARCH_zero # include "bytes_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "bytes_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "bytes_ppc.hpp" +#endif // A constantPool is an array containing class constants as described in the // class file. diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/oops/oop.inline.hpp --- a/hotspot/src/share/vm/oops/oop.inline.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/oops/oop.inline.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -52,6 +52,12 @@ #ifdef TARGET_ARCH_zero # include "bytes_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "bytes_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "bytes_ppc.hpp" +#endif // Implementation of all inlined member functions defined in oop.hpp // We need a separate file to avoid circular references diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/oops/typeArrayOop.hpp --- a/hotspot/src/share/vm/oops/typeArrayOop.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/oops/typeArrayOop.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -45,6 +45,12 @@ #ifdef TARGET_OS_ARCH_windows_x86 # include "orderAccess_windows_x86.inline.hpp" #endif +#ifdef TARGET_OS_ARCH_linux_arm +# include "orderAccess_linux_arm.inline.hpp" +#endif +#ifdef TARGET_OS_ARCH_linux_ppc +# include "orderAccess_linux_ppc.inline.hpp" +#endif // A typeArrayOop is an array containing basic types (non oop elements). // It is used for arrays of {characters, singles, doubles, bytes, shorts, integers, longs} diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/opto/buildOopMap.cpp --- a/hotspot/src/share/vm/opto/buildOopMap.cpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/opto/buildOopMap.cpp Mon Feb 07 08:40:30 2011 -0800 @@ -41,6 +41,12 @@ #ifdef TARGET_ARCH_zero # include "vmreg_zero.inline.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "vmreg_arm.inline.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "vmreg_ppc.inline.hpp" +#endif // The functions in this file builds OopMaps after all scheduling is done. // diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/opto/c2_globals.hpp --- a/hotspot/src/share/vm/opto/c2_globals.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/opto/c2_globals.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -32,6 +32,9 @@ #ifdef TARGET_ARCH_sparc # include "c2_globals_sparc.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "c2_globals_arm.hpp" +#endif #ifdef TARGET_OS_FAMILY_linux # include "c2_globals_linux.hpp" #endif diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/opto/c2compiler.cpp --- a/hotspot/src/share/vm/opto/c2compiler.cpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/opto/c2compiler.cpp Mon Feb 07 08:40:30 2011 -0800 @@ -37,6 +37,12 @@ #ifdef TARGET_ARCH_MODEL_zero # include "adfiles/ad_zero.hpp" #endif +#ifdef TARGET_ARCH_MODEL_arm +# include "adfiles/ad_arm.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_ppc +# include "adfiles/ad_ppc.hpp" +#endif volatile int C2Compiler::_runtimes = uninitialized; diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/opto/compile.cpp --- a/hotspot/src/share/vm/opto/compile.cpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/opto/compile.cpp Mon Feb 07 08:40:30 2011 -0800 @@ -74,6 +74,12 @@ #ifdef TARGET_ARCH_MODEL_zero # include "adfiles/ad_zero.hpp" #endif +#ifdef TARGET_ARCH_MODEL_arm +# include "adfiles/ad_arm.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_ppc +# include "adfiles/ad_ppc.hpp" +#endif // -------------------- Compile::mach_constant_base_node ----------------------- diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/opto/gcm.cpp --- a/hotspot/src/share/vm/opto/gcm.cpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/opto/gcm.cpp Mon Feb 07 08:40:30 2011 -0800 @@ -47,6 +47,12 @@ #ifdef TARGET_ARCH_MODEL_zero # include "adfiles/ad_zero.hpp" #endif +#ifdef TARGET_ARCH_MODEL_arm +# include "adfiles/ad_arm.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_ppc +# include "adfiles/ad_ppc.hpp" +#endif // Portions of code courtesy of Clifford Click diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/opto/locknode.hpp --- a/hotspot/src/share/vm/opto/locknode.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/opto/locknode.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -40,6 +40,12 @@ #ifdef TARGET_ARCH_MODEL_zero # include "adfiles/ad_zero.hpp" #endif +#ifdef TARGET_ARCH_MODEL_arm +# include "adfiles/ad_arm.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_ppc +# include "adfiles/ad_ppc.hpp" +#endif //------------------------------BoxLockNode------------------------------------ class BoxLockNode : public Node { diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/opto/output.hpp --- a/hotspot/src/share/vm/opto/output.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/opto/output.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -39,6 +39,12 @@ #ifdef TARGET_ARCH_MODEL_zero # include "adfiles/ad_zero.hpp" #endif +#ifdef TARGET_ARCH_MODEL_arm +# include "adfiles/ad_arm.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_ppc +# include "adfiles/ad_ppc.hpp" +#endif class Arena; class Bundle; diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/opto/regmask.cpp --- a/hotspot/src/share/vm/opto/regmask.cpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/opto/regmask.cpp Mon Feb 07 08:40:30 2011 -0800 @@ -37,6 +37,12 @@ #ifdef TARGET_ARCH_MODEL_zero # include "adfiles/ad_zero.hpp" #endif +#ifdef TARGET_ARCH_MODEL_arm +# include "adfiles/ad_arm.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_ppc +# include "adfiles/ad_ppc.hpp" +#endif #define RM_SIZE _RM_SIZE /* a constant private to the class RegMask */ diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/opto/regmask.hpp --- a/hotspot/src/share/vm/opto/regmask.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/opto/regmask.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -40,6 +40,12 @@ #ifdef TARGET_ARCH_MODEL_zero # include "adfiles/adGlobals_zero.hpp" #endif +#ifdef TARGET_ARCH_MODEL_arm +# include "adfiles/adGlobals_arm.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_ppc +# include "adfiles/adGlobals_ppc.hpp" +#endif // Some fun naming (textual) substitutions: // diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/opto/runtime.cpp --- a/hotspot/src/share/vm/opto/runtime.cpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/opto/runtime.cpp Mon Feb 07 08:40:30 2011 -0800 @@ -80,6 +80,12 @@ #ifdef TARGET_ARCH_MODEL_zero # include "adfiles/ad_zero.hpp" #endif +#ifdef TARGET_ARCH_MODEL_arm +# include "adfiles/ad_arm.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_ppc +# include "adfiles/ad_ppc.hpp" +#endif // For debugging purposes: diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/prims/forte.cpp --- a/hotspot/src/share/vm/prims/forte.cpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/prims/forte.cpp Mon Feb 07 08:40:30 2011 -0800 @@ -520,6 +520,7 @@ // method_id - jmethodID of the method being executed extern "C" { +JNIEXPORT void AsyncGetCallTrace(ASGCT_CallTrace *trace, jint depth, void* ucontext) { // This is if'd out because we no longer use thread suspension. diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/prims/jniCheck.cpp --- a/hotspot/src/share/vm/prims/jniCheck.cpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/prims/jniCheck.cpp Mon Feb 07 08:40:30 2011 -0800 @@ -45,6 +45,12 @@ #ifdef TARGET_ARCH_zero # include "jniTypes_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "jniTypes_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "jniTypes_ppc.hpp" +#endif // Heap objects are allowed to be directly referenced only in VM code, diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/prims/jni_md.h --- a/hotspot/src/share/vm/prims/jni_md.h Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/prims/jni_md.h Mon Feb 07 08:40:30 2011 -0800 @@ -33,6 +33,12 @@ #ifdef TARGET_ARCH_zero # include "jni_zero.h" #endif +#ifdef TARGET_ARCH_arm +# include "jni_arm.h" +#endif +#ifdef TARGET_ARCH_ppc +# include "jni_ppc.h" +#endif /* diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/prims/jvm.cpp --- a/hotspot/src/share/vm/prims/jvm.cpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/prims/jvm.cpp Mon Feb 07 08:40:30 2011 -0800 @@ -2585,7 +2585,7 @@ } -int jio_printf(const char *fmt, ...) { +JNIEXPORT int jio_printf(const char *fmt, ...) { int len; va_list args; va_start(args, fmt); diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/prims/jvm.h --- a/hotspot/src/share/vm/prims/jvm.h Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/prims/jvm.h Mon Feb 07 08:40:30 2011 -0800 @@ -1417,16 +1417,16 @@ * BE CAREFUL! The following functions do not implement the * full feature set of standard C printf formats. */ -int +JNIEXPORT int jio_vsnprintf(char *str, size_t count, const char *fmt, va_list args); -int +JNIEXPORT int jio_snprintf(char *str, size_t count, const char *fmt, ...); -int +JNIEXPORT int jio_fprintf(FILE *, const char *fmt, ...); -int +JNIEXPORT int jio_vfprintf(FILE *, const char *fmt, va_list args); diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp --- a/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp Mon Feb 07 08:40:30 2011 -0800 @@ -36,6 +36,12 @@ #ifdef TARGET_ARCH_zero # include "bytes_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "bytes_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "bytes_ppc.hpp" +#endif // FIXME: add Deprecated, LVT, LVTT attributes // FIXME: fix Synthetic attribute // FIXME: per Serguei, add error return handling for constantPoolOopDesc::copy_cpool_bytes() diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/prims/jvmtiExport.cpp --- a/hotspot/src/share/vm/prims/jvmtiExport.cpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/prims/jvmtiExport.cpp Mon Feb 07 08:40:30 2011 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -750,15 +750,12 @@ // pending CompiledMethodUnload support // -bool JvmtiExport::_have_pending_compiled_method_unload_events; -GrowableArray* JvmtiExport::_pending_compiled_method_unload_method_ids; -GrowableArray* JvmtiExport::_pending_compiled_method_unload_code_begins; -JavaThread* JvmtiExport::_current_poster; - -void JvmtiExport::post_compiled_method_unload_internal(JavaThread* self, jmethodID method, const void *code_begin) { +void JvmtiExport::post_compiled_method_unload( + jmethodID method, const void *code_begin) { + JavaThread* thread = JavaThread::current(); EVT_TRIG_TRACE(JVMTI_EVENT_COMPILED_METHOD_UNLOAD, ("JVMTI [%s] method compile unload event triggered", - JvmtiTrace::safe_get_thread_name(self))); + JvmtiTrace::safe_get_thread_name(thread))); // post the event for each environment that has this event enabled. JvmtiEnvIterator it; @@ -767,12 +764,12 @@ EVT_TRACE(JVMTI_EVENT_COMPILED_METHOD_UNLOAD, ("JVMTI [%s] class compile method unload event sent jmethodID " PTR_FORMAT, - JvmtiTrace::safe_get_thread_name(self), method)); + JvmtiTrace::safe_get_thread_name(thread), method)); - ResourceMark rm(self); + ResourceMark rm(thread); - JvmtiEventMark jem(self); - JvmtiJavaThreadEventTransition jet(self); + JvmtiEventMark jem(thread); + JvmtiJavaThreadEventTransition jet(thread); jvmtiEventCompiledMethodUnload callback = env->callbacks()->CompiledMethodUnload; if (callback != NULL) { (*callback)(env->jvmti_external(), method, code_begin); @@ -781,90 +778,6 @@ } } -// post any pending CompiledMethodUnload events - -void JvmtiExport::post_pending_compiled_method_unload_events() { - JavaThread* self = JavaThread::current(); - assert(!self->owns_locks(), "can't hold locks"); - - // Indicates if this is the first activiation of this function. - // In theory the profiler's callback could call back into VM and provoke - // another CompiledMethodLoad event to be posted from this thread. As the - // stack rewinds we need to ensure that the original activation does the - // completion and notifies any waiters. - bool first_activation = false; - - // the jmethodID (may not be valid) to be used for a single event - jmethodID method; - const void *code_begin; - - // grab the monitor and check if another thread is already posting - // events. If there is another thread posting events then we wait - // until it completes. (In theory we could check the pending events to - // see if any of the addresses overlap with the event that we want to - // post but as it will happen so rarely we just block any thread waiting - // to post a CompiledMethodLoad or DynamicCodeGenerated event until all - // pending CompiledMethodUnload events have been posted). - // - // If another thread isn't posting we examine the list of pending jmethodIDs. - // If the list is empty then we are done. If it's not empty then this thread - // (self) becomes the pending event poster and we remove the top (last) - // event from the list. Note that this means we remove the newest event first - // but as they are all CompiledMethodUnload events the order doesn't matter. - // Once we have removed a jmethodID then we exit the monitor. Any other thread - // wanting to post a CompiledMethodLoad or DynamicCodeGenerated event will - // be forced to wait on the monitor. - { - MutexLocker mu(JvmtiPendingEvent_lock); - if (_current_poster != self) { - while (_current_poster != NULL) { - JvmtiPendingEvent_lock->wait(); - } - } - if ((_pending_compiled_method_unload_method_ids == NULL) || - (_pending_compiled_method_unload_method_ids->length() == 0)) { - return; - } - if (_current_poster == NULL) { - _current_poster = self; - first_activation = true; - } else { - // re-entrant - guarantee(_current_poster == self, "checking"); - } - method = _pending_compiled_method_unload_method_ids->pop(); - code_begin = _pending_compiled_method_unload_code_begins->pop(); - } - - // This thread is the pending event poster so it first posts the CompiledMethodUnload - // event for the jmethodID that has been removed from the list. Once posted it - // re-grabs the monitor and checks the list again. If the list is empty then and this - // is the first activation of the function then we reset the _have_pending_events - // flag, cleanup _current_poster to indicate that no thread is now servicing the - // pending events list, and finally notify any thread that might be waiting. - for (;;) { - post_compiled_method_unload_internal(self, method, code_begin); - - // event posted, now re-grab monitor and get the next event - // If there's no next event then we are done. If this is the first - // activiation of this function by this thread notify any waiters - // so that they can post. - { - MutexLocker ml(JvmtiPendingEvent_lock); - if (_pending_compiled_method_unload_method_ids->length() == 0) { - if (first_activation) { - _have_pending_compiled_method_unload_events = false; - _current_poster = NULL; - JvmtiPendingEvent_lock->notify_all(); - } - return; - } - method = _pending_compiled_method_unload_method_ids->pop(); - code_begin = _pending_compiled_method_unload_code_begins->pop(); - } - } -} - /////////////////////////////////////////////////////////////// // // JvmtiExport @@ -1830,16 +1743,7 @@ } void JvmtiExport::post_compiled_method_load(nmethod *nm) { - // If there are pending CompiledMethodUnload events then these are - // posted before this CompiledMethodLoad event. We "lock" the nmethod and - // maintain a handle to the methodOop to ensure that the nmethod isn't - // flushed or unloaded while posting the events. JavaThread* thread = JavaThread::current(); - if (have_pending_compiled_method_unload_events()) { - methodHandle mh(thread, nm->method()); - nmethodLocker nml(nm); - post_pending_compiled_method_unload_events(); - } EVT_TRIG_TRACE(JVMTI_EVENT_COMPILED_METHOD_LOAD, ("JVMTI [%s] method compile load event triggered", @@ -1854,8 +1758,8 @@ JvmtiTrace::safe_get_thread_name(thread), (nm->method() == NULL) ? "NULL" : nm->method()->klass_name()->as_C_string(), (nm->method() == NULL) ? "NULL" : nm->method()->name()->as_C_string())); - ResourceMark rm(thread); + HandleMark hm(thread); // Add inlining information jvmtiCompiledMethodLoadInlineRecord* inlinerecord = create_inline_record(nm); @@ -1899,28 +1803,6 @@ } } -// used at a safepoint to post a CompiledMethodUnload event -void JvmtiExport::post_compiled_method_unload(jmethodID mid, const void *code_begin) { - if (SafepointSynchronize::is_at_safepoint()) { - // Class unloading can cause nmethod unloading which is reported - // by the VMThread. These must be batched to be processed later. - if (_pending_compiled_method_unload_method_ids == NULL) { - // create list lazily - _pending_compiled_method_unload_method_ids = new (ResourceObj::C_HEAP) GrowableArray(10,true); - _pending_compiled_method_unload_code_begins = new (ResourceObj::C_HEAP) GrowableArray(10,true); - } - _pending_compiled_method_unload_method_ids->append(mid); - _pending_compiled_method_unload_code_begins->append(code_begin); - _have_pending_compiled_method_unload_events = true; - } else { - // Unloading caused by the sweeper can be reported synchronously. - if (have_pending_compiled_method_unload_events()) { - post_pending_compiled_method_unload_events(); - } - post_compiled_method_unload_internal(JavaThread::current(), mid, code_begin); - } -} - void JvmtiExport::post_dynamic_code_generated_internal(const char *name, const void *code_begin, const void *code_end) { JavaThread* thread = JavaThread::current(); EVT_TRIG_TRACE(JVMTI_EVENT_DYNAMIC_CODE_GENERATED, @@ -1953,9 +1835,9 @@ return; } - if (have_pending_compiled_method_unload_events()) { - post_pending_compiled_method_unload_events(); - } + // Blocks until everything now in the queue has been posted + JvmtiDeferredEventQueue::flush_queue(Thread::current()); + post_dynamic_code_generated_internal(name, code_begin, code_end); } diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/prims/jvmtiExport.hpp --- a/hotspot/src/share/vm/prims/jvmtiExport.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/prims/jvmtiExport.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -141,25 +141,6 @@ private: - // CompiledMethodUnload events are reported from the VM thread so they - // are collected in lists (of jmethodID/addresses) and the events are posted later - // from threads posting CompieldMethodLoad or DynamicCodeGenerated events. - static bool _have_pending_compiled_method_unload_events; - static GrowableArray* _pending_compiled_method_unload_method_ids; - static GrowableArray* _pending_compiled_method_unload_code_begins; - static JavaThread* _current_poster; - - // tests if there are CompiledMethodUnload events pending - inline static bool have_pending_compiled_method_unload_events() { - return _have_pending_compiled_method_unload_events; - } - - // posts any pending CompiledMethodUnload events. - static void post_pending_compiled_method_unload_events(); - - // Perform the actual notification to interested JvmtiEnvs. - static void post_compiled_method_unload_internal(JavaThread* self, jmethodID mid, const void* code_begin); - // posts a DynamicCodeGenerated event (internal/private implementation). // The public post_dynamic_code_generated* functions make use of the // internal implementation. @@ -256,7 +237,7 @@ // single stepping management methods static void at_single_stepping_point(JavaThread *thread, methodOop method, address location) KERNEL_RETURN; static void expose_single_stepping(JavaThread *thread) KERNEL_RETURN; - static bool hide_single_stepping(JavaThread *thread) KERNEL_RETURN_(return false;); + static bool hide_single_stepping(JavaThread *thread) KERNEL_RETURN_(false); // Methods that notify the debugger that something interesting has happened in the VM. static void post_vm_start (); @@ -271,20 +252,20 @@ static oop jni_GetField_probe (JavaThread *thread, jobject jobj, oop obj, klassOop klass, jfieldID fieldID, bool is_static) - KERNEL_RETURN_(return NULL;); + KERNEL_RETURN_(NULL); static oop jni_GetField_probe_nh (JavaThread *thread, jobject jobj, oop obj, klassOop klass, jfieldID fieldID, bool is_static) - KERNEL_RETURN_(return NULL;); + KERNEL_RETURN_(NULL); static void post_field_access_by_jni (JavaThread *thread, oop obj, klassOop klass, jfieldID fieldID, bool is_static) KERNEL_RETURN; static void post_field_access (JavaThread *thread, methodOop method, address location, KlassHandle field_klass, Handle object, jfieldID field) KERNEL_RETURN; static oop jni_SetField_probe (JavaThread *thread, jobject jobj, oop obj, klassOop klass, jfieldID fieldID, bool is_static, char sig_type, - jvalue *value) KERNEL_RETURN_(return NULL;); + jvalue *value) KERNEL_RETURN_(NULL); static oop jni_SetField_probe_nh (JavaThread *thread, jobject jobj, oop obj, klassOop klass, jfieldID fieldID, bool is_static, char sig_type, - jvalue *value) KERNEL_RETURN_(return NULL;); + jvalue *value) KERNEL_RETURN_(NULL); static void post_field_modification_by_jni(JavaThread *thread, oop obj, klassOop klass, jfieldID fieldID, bool is_static, char sig_type, jvalue *value); diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/prims/jvmtiImpl.cpp --- a/hotspot/src/share/vm/prims/jvmtiImpl.cpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/prims/jvmtiImpl.cpp Mon Feb 07 08:40:30 2011 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,11 +32,13 @@ #include "prims/jvmtiEventController.inline.hpp" #include "prims/jvmtiImpl.hpp" #include "prims/jvmtiRedefineClasses.hpp" +#include "runtime/atomic.hpp" #include "runtime/deoptimization.hpp" #include "runtime/handles.hpp" #include "runtime/handles.inline.hpp" #include "runtime/interfaceSupport.hpp" #include "runtime/javaCalls.hpp" +#include "runtime/serviceThread.hpp" #include "runtime/signature.hpp" #include "runtime/vframe.hpp" #include "runtime/vframe_hp.hpp" @@ -910,3 +912,207 @@ tty->print_cr("]"); #endif } + +#ifndef KERNEL + +JvmtiDeferredEvent JvmtiDeferredEvent::compiled_method_load_event( + nmethod* nm) { + JvmtiDeferredEvent event = JvmtiDeferredEvent(TYPE_COMPILED_METHOD_LOAD); + event.set_compiled_method_load(nm); + nmethodLocker::lock_nmethod(nm); // will be unlocked when posted + return event; +} + +JvmtiDeferredEvent JvmtiDeferredEvent::compiled_method_unload_event( + jmethodID id, const void* code) { + JvmtiDeferredEvent event = JvmtiDeferredEvent(TYPE_COMPILED_METHOD_UNLOAD); + event.set_compiled_method_unload(id, code); + return event; +} + +void JvmtiDeferredEvent::post() { + switch(_type) { + case TYPE_COMPILED_METHOD_LOAD: + JvmtiExport::post_compiled_method_load(compiled_method_load()); + nmethodLocker::unlock_nmethod(compiled_method_load()); + break; + case TYPE_COMPILED_METHOD_UNLOAD: + JvmtiExport::post_compiled_method_unload( + compiled_method_unload_method_id(), + compiled_method_unload_code_begin()); + break; + case TYPE_FLUSH: + JvmtiDeferredEventQueue::flush_complete(flush_state_addr()); + break; + default: + ShouldNotReachHere(); + } +} + +JvmtiDeferredEventQueue::QueueNode* JvmtiDeferredEventQueue::_queue_tail = NULL; +JvmtiDeferredEventQueue::QueueNode* JvmtiDeferredEventQueue::_queue_head = NULL; + +volatile JvmtiDeferredEventQueue::QueueNode* + JvmtiDeferredEventQueue::_pending_list = NULL; + +bool JvmtiDeferredEventQueue::has_events() { + assert(Service_lock->owned_by_self(), "Must own Service_lock"); + return _queue_head != NULL || _pending_list != NULL; +} + +void JvmtiDeferredEventQueue::enqueue(const JvmtiDeferredEvent& event) { + assert(Service_lock->owned_by_self(), "Must own Service_lock"); + + process_pending_events(); + + // Events get added to the end of the queue (and are pulled off the front). + QueueNode* node = new QueueNode(event); + if (_queue_tail == NULL) { + _queue_tail = _queue_head = node; + } else { + assert(_queue_tail->next() == NULL, "Must be the last element in the list"); + _queue_tail->set_next(node); + _queue_tail = node; + } + + Service_lock->notify_all(); + assert((_queue_head == NULL) == (_queue_tail == NULL), + "Inconsistent queue markers"); +} + +JvmtiDeferredEvent JvmtiDeferredEventQueue::dequeue() { + assert(Service_lock->owned_by_self(), "Must own Service_lock"); + + process_pending_events(); + + assert(_queue_head != NULL, "Nothing to dequeue"); + + if (_queue_head == NULL) { + // Just in case this happens in product; it shouldn't but let's not crash + return JvmtiDeferredEvent(); + } + + QueueNode* node = _queue_head; + _queue_head = _queue_head->next(); + if (_queue_head == NULL) { + _queue_tail = NULL; + } + + assert((_queue_head == NULL) == (_queue_tail == NULL), + "Inconsistent queue markers"); + + JvmtiDeferredEvent event = node->event(); + delete node; + return event; +} + +void JvmtiDeferredEventQueue::add_pending_event( + const JvmtiDeferredEvent& event) { + + QueueNode* node = new QueueNode(event); + + bool success = false; + QueueNode* prev_value = (QueueNode*)_pending_list; + do { + node->set_next(prev_value); + prev_value = (QueueNode*)Atomic::cmpxchg_ptr( + (void*)node, (volatile void*)&_pending_list, (void*)node->next()); + } while (prev_value != node->next()); +} + +// This method transfers any events that were added by someone NOT holding +// the lock into the mainline queue. +void JvmtiDeferredEventQueue::process_pending_events() { + assert(Service_lock->owned_by_self(), "Must own Service_lock"); + + if (_pending_list != NULL) { + QueueNode* head = + (QueueNode*)Atomic::xchg_ptr(NULL, (volatile void*)&_pending_list); + + assert((_queue_head == NULL) == (_queue_tail == NULL), + "Inconsistent queue markers"); + + if (head != NULL) { + // Since we've treated the pending list as a stack (with newer + // events at the beginning), we need to join the bottom of the stack + // with the 'tail' of the queue in order to get the events in the + // right order. We do this by reversing the pending list and appending + // it to the queue. + + QueueNode* new_tail = head; + QueueNode* new_head = NULL; + + // This reverses the list + QueueNode* prev = new_tail; + QueueNode* node = new_tail->next(); + new_tail->set_next(NULL); + while (node != NULL) { + QueueNode* next = node->next(); + node->set_next(prev); + prev = node; + node = next; + } + new_head = prev; + + // Now append the new list to the queue + if (_queue_tail != NULL) { + _queue_tail->set_next(new_head); + } else { // _queue_head == NULL + _queue_head = new_head; + } + _queue_tail = new_tail; + } + } +} + +enum { + // Random - used for debugging + FLUSHING = 0x50403020, + FLUSHED = 0x09080706 +}; + +void JvmtiDeferredEventQueue::flush_queue(Thread* thread) { + + volatile int flush_state = FLUSHING; + + JvmtiDeferredEvent flush(JvmtiDeferredEvent::TYPE_FLUSH); + flush.set_flush_state_addr((int*)&flush_state); + + if (ServiceThread::is_service_thread(thread)) { + // If we are the service thread we have to post all preceding events + // Use the flush event as a token to indicate when we can stop + JvmtiDeferredEvent event; + { + MutexLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag); + enqueue(flush); + event = dequeue(); + } + while (!event.is_flush_event() || + event.flush_state_addr() != &flush_state) { + event.post(); + { + MutexLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag); + event = dequeue(); + } + } + } else { + // Wake up the service thread so it will process events. When it gets + // to the flush event it will set 'flush_complete' and notify us. + MutexLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag); + enqueue(flush); + while (flush_state != FLUSHED) { + assert(flush_state == FLUSHING || flush_state == FLUSHED, + "only valid values for this"); + Service_lock->wait(Mutex::_no_safepoint_check_flag); + } + } +} + +void JvmtiDeferredEventQueue::flush_complete(int* state_addr) { + assert(state_addr != NULL && *state_addr == FLUSHING, "must be"); + MutexLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag); + *state_addr = FLUSHED; + Service_lock->notify_all(); +} + +#endif // ndef KERNEL diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/prims/jvmtiImpl.hpp --- a/hotspot/src/share/vm/prims/jvmtiImpl.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/prims/jvmtiImpl.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -433,6 +433,149 @@ #endif // !JVMTI_KERNEL +/** + * When a thread (such as the compiler thread or VM thread) cannot post a + * JVMTI event itself because the event needs to be posted from a Java + * thread, then it can defer the event to the Service thread for posting. + * The information needed to post the event is encapsulated into this class + * and then enqueued onto the JvmtiDeferredEventQueue, where the Service + * thread will pick it up and post it. + * + * This is currently only used for posting compiled-method-load and unload + * events, which we don't want posted from the compiler thread. + */ +class JvmtiDeferredEvent VALUE_OBJ_CLASS_SPEC { + friend class JvmtiDeferredEventQueue; + private: + typedef enum { + TYPE_NONE, + TYPE_COMPILED_METHOD_LOAD, + TYPE_COMPILED_METHOD_UNLOAD, + TYPE_FLUSH // pseudo-event used to implement flush_queue() + } Type; + + Type _type; + union { + nmethod* compiled_method_load; + struct { + jmethodID method_id; + const void* code_begin; + } compiled_method_unload; + int* flush_state_addr; + } _event_data; + + JvmtiDeferredEvent(Type t) : _type(t) {} + + void set_compiled_method_load(nmethod* nm) { + assert(_type == TYPE_COMPILED_METHOD_LOAD, "must be"); + _event_data.compiled_method_load = nm; + } + + nmethod* compiled_method_load() const { + assert(_type == TYPE_COMPILED_METHOD_LOAD, "must be"); + return _event_data.compiled_method_load; + } + + void set_compiled_method_unload(jmethodID id, const void* code) { + assert(_type == TYPE_COMPILED_METHOD_UNLOAD, "must be"); + _event_data.compiled_method_unload.method_id = id; + _event_data.compiled_method_unload.code_begin = code; + } + + jmethodID compiled_method_unload_method_id() const { + assert(_type == TYPE_COMPILED_METHOD_UNLOAD, "must be"); + return _event_data.compiled_method_unload.method_id; + } + + const void* compiled_method_unload_code_begin() const { + assert(_type == TYPE_COMPILED_METHOD_UNLOAD, "must be"); + return _event_data.compiled_method_unload.code_begin; + } + + bool is_flush_event() const { return _type == TYPE_FLUSH; } + + int* flush_state_addr() const { + assert(is_flush_event(), "must be"); + return _event_data.flush_state_addr; + } + + void set_flush_state_addr(int* flag) { + assert(is_flush_event(), "must be"); + _event_data.flush_state_addr = flag; + } + + public: + + JvmtiDeferredEvent() : _type(TYPE_NONE) {} + + // Factory methods + static JvmtiDeferredEvent compiled_method_load_event(nmethod* nm) + KERNEL_RETURN_(JvmtiDeferredEvent()); + static JvmtiDeferredEvent compiled_method_unload_event( + jmethodID id, const void* code) KERNEL_RETURN_(JvmtiDeferredEvent()); + + // Actually posts the event. + void post() KERNEL_RETURN; +}; + +/** + * Events enqueued on this queue wake up the Service thread which dequeues + * and posts the events. The Service_lock is required to be held + * when operating on the queue (except for the "pending" events). + */ +class JvmtiDeferredEventQueue : AllStatic { + friend class JvmtiDeferredEvent; + private: + class QueueNode : public CHeapObj { + private: + JvmtiDeferredEvent _event; + QueueNode* _next; + + public: + QueueNode(const JvmtiDeferredEvent& event) + : _event(event), _next(NULL) {} + + const JvmtiDeferredEvent& event() const { return _event; } + QueueNode* next() const { return _next; } + + void set_next(QueueNode* next) { _next = next; } + }; + + static QueueNode* _queue_head; // Hold Service_lock to access + static QueueNode* _queue_tail; // Hold Service_lock to access + static volatile QueueNode* _pending_list; // Uses CAS for read/update + + // Transfers events from the _pending_list to the _queue. + static void process_pending_events() KERNEL_RETURN; + + static void flush_complete(int* flush_state) KERNEL_RETURN; + + public: + // Must be holding Service_lock when calling these + static bool has_events() KERNEL_RETURN_(false); + static void enqueue(const JvmtiDeferredEvent& event) KERNEL_RETURN; + static JvmtiDeferredEvent dequeue() KERNEL_RETURN_(JvmtiDeferredEvent()); + + // This call blocks until all events enqueued prior to this call + // have been posted. The Service_lock is acquired and waited upon. + // + // Implemented by creating a "flush" event and placing it in the queue. + // When the flush event is "posted" it will call flush_complete(), which + // will release the caller. + // + // Can be called by any thread (maybe even the service thread itself). + // Not necessary for the caller to be a JavaThread. + static void flush_queue(Thread* current) KERNEL_RETURN; + + // Used to enqueue events without using a lock, for times (such as during + // safepoint) when we can't or don't want to lock the Service_lock. + // + // Events will be held off to the side until there's a call to + // dequeue(), enqueue(), or process_pending_events() (all of which require + // the holding of the Service_lock), and will be enqueued at that time. + static void add_pending_event(const JvmtiDeferredEvent&) KERNEL_RETURN; +}; + // Utility macro that checks for NULL pointers: #define NULL_CHECK(X, Y) if ((X) == NULL) { return (Y); } diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/runtime/deoptimization.cpp --- a/hotspot/src/share/vm/runtime/deoptimization.cpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/runtime/deoptimization.cpp Mon Feb 07 08:40:30 2011 -0800 @@ -59,6 +59,12 @@ #ifdef TARGET_ARCH_zero # include "vmreg_zero.inline.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "vmreg_arm.inline.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "vmreg_ppc.inline.hpp" +#endif #ifdef COMPILER2 #ifdef TARGET_ARCH_MODEL_x86_32 # include "adfiles/ad_x86_32.hpp" @@ -72,6 +78,12 @@ #ifdef TARGET_ARCH_MODEL_zero # include "adfiles/ad_zero.hpp" #endif +#ifdef TARGET_ARCH_MODEL_arm +# include "adfiles/ad_arm.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_ppc +# include "adfiles/ad_ppc.hpp" +#endif #endif bool DeoptimizationMarker::_is_active = false; diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/runtime/dtraceJSDT.hpp --- a/hotspot/src/share/vm/runtime/dtraceJSDT.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/runtime/dtraceJSDT.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -35,6 +35,12 @@ #ifdef TARGET_ARCH_zero # include "nativeInst_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "nativeInst_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "nativeInst_ppc.hpp" +#endif class RegisteredProbes; typedef jlong OpaqueProbes; diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/runtime/fprofiler.hpp --- a/hotspot/src/share/vm/runtime/fprofiler.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/runtime/fprofiler.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -231,13 +231,13 @@ static void engage(JavaThread* mainThread, bool fullProfile) KERNEL_RETURN ; static void disengage() KERNEL_RETURN ; static void print(int unused) KERNEL_RETURN ; - static bool is_active() KERNEL_RETURN_(return false;) ; + static bool is_active() KERNEL_RETURN_(false) ; // This is NULL if each thread has its own thread profiler, // else this is the single thread profiler used by all threads. // In particular it makes a difference during garbage collection, // where you only want to traverse each thread profiler once. - static ThreadProfiler* get_thread_profiler() KERNEL_RETURN_(return NULL;); + static ThreadProfiler* get_thread_profiler() KERNEL_RETURN_(NULL); // Garbage Collection Support static void oops_do(OopClosure* f) KERNEL_RETURN ; @@ -246,13 +246,13 @@ // Returns the start address for a given pc // NULL is returned if the PCRecorder is inactive - static address bucket_start_for(address pc) KERNEL_RETURN_(return NULL;); + static address bucket_start_for(address pc) KERNEL_RETURN_(NULL); enum { MillisecsPerTick = 10 }; // ms per profiling ticks // Returns the number of ticks recorded for the bucket // pc belongs to. - static int bucket_count_for(address pc) KERNEL_RETURN_(return 0;); + static int bucket_count_for(address pc) KERNEL_RETURN_(0); #ifndef FPROF_KERNEL diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/runtime/frame.cpp --- a/hotspot/src/share/vm/runtime/frame.cpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/runtime/frame.cpp Mon Feb 07 08:40:30 2011 -0800 @@ -52,6 +52,12 @@ #ifdef TARGET_ARCH_zero # include "nativeInst_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "nativeInst_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "nativeInst_ppc.hpp" +#endif RegisterMap::RegisterMap(JavaThread *thread, bool update_map) { _thread = thread; diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/runtime/frame.hpp --- a/hotspot/src/share/vm/runtime/frame.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/runtime/frame.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -44,6 +44,12 @@ #ifdef TARGET_ARCH_MODEL_zero # include "adfiles/adGlobals_zero.hpp" #endif +#ifdef TARGET_ARCH_MODEL_arm +# include "adfiles/adGlobals_arm.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_ppc +# include "adfiles/adGlobals_ppc.hpp" +#endif #endif #ifdef ZERO #ifdef TARGET_ARCH_zero @@ -457,6 +463,12 @@ #ifdef TARGET_ARCH_zero # include "frame_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "frame_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "frame_ppc.hpp" +#endif }; diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/runtime/frame.inline.hpp --- a/hotspot/src/share/vm/runtime/frame.inline.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/runtime/frame.inline.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -40,6 +40,12 @@ #ifdef TARGET_ARCH_zero # include "jniTypes_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "jniTypes_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "jniTypes_ppc.hpp" +#endif #ifdef ZERO #ifdef TARGET_ARCH_zero # include "entryFrame_zero.hpp" @@ -88,6 +94,12 @@ #ifdef TARGET_ARCH_zero # include "frame_zero.inline.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "frame_arm.inline.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "frame_ppc.inline.hpp" +#endif #endif // SHARE_VM_RUNTIME_FRAME_INLINE_HPP diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/runtime/globals.hpp --- a/hotspot/src/share/vm/runtime/globals.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/runtime/globals.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -35,6 +35,12 @@ #ifdef TARGET_ARCH_zero # include "globals_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "globals_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "globals_ppc.hpp" +#endif #ifdef TARGET_OS_FAMILY_linux # include "globals_linux.hpp" #endif @@ -62,6 +68,12 @@ #ifdef TARGET_OS_ARCH_windows_x86 # include "globals_windows_x86.hpp" #endif +#ifdef TARGET_OS_ARCH_linux_arm +# include "globals_linux_arm.hpp" +#endif +#ifdef TARGET_OS_ARCH_linux_ppc +# include "globals_linux_ppc.hpp" +#endif #ifdef COMPILER1 #ifdef TARGET_ARCH_x86 # include "c1_globals_x86.hpp" @@ -69,6 +81,12 @@ #ifdef TARGET_ARCH_sparc # include "c1_globals_sparc.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "c1_globals_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "c1_globals_ppc.hpp" +#endif #ifdef TARGET_OS_FAMILY_linux # include "c1_globals_linux.hpp" #endif @@ -86,6 +104,9 @@ #ifdef TARGET_ARCH_sparc # include "c2_globals_sparc.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "c2_globals_arm.hpp" +#endif #ifdef TARGET_OS_FAMILY_linux # include "c2_globals_linux.hpp" #endif @@ -410,7 +431,14 @@ product_pd(bool, UseMembar, \ "(Unstable) Issues membars on thread state transitions") \ \ - /* Temporary: See 6948537 */ \ + /* Temp PPC Flag to allow disabling the use of lwsync on ppc platforms \ + * that don't support it. This will be replaced by processor detection \ + * logic. \ + */ \ + product(bool, UsePPCLWSYNC, true, \ + "Use lwsync instruction if true, else use slower sync") \ + \ + /* Temporary: See 6948537 */ \ experimental(bool, UseMemSetInBOT, true, \ "(Unstable) uses memset in BOT updates in GC code") \ \ @@ -1926,6 +1954,9 @@ product(bool, PrintRevisitStats, false, \ "Print revisit (klass and MDO) stack related information") \ \ + EMBEDDED_ONLY(product(bool, LowMemoryProtection, true, \ + "Enable LowMemoryProtection")) \ + \ product_pd(bool, NeverActAsServerClassMachine, \ "Never act like a server-class machine") \ \ @@ -2630,6 +2661,25 @@ product(bool, UseStringCache, false, \ "Enable String cache capabilities on String.java") \ \ + /* byte strings */ \ + product(bool, UseCompressedStrings, false, \ + "Enable byte-valued strings") \ + \ + product(bool, SpecialStringCompress, true, \ + "special version of string compress") \ + \ + product(bool, SpecialStringInflate, true, \ + "special version of string inflate") \ + \ + product(bool, SpecialStringCompareToCC, true, \ + "special version of string compareToCC") \ + \ + product(bool, SpecialStringIndexOfCC, true, \ + "special version of string indexOfCC") \ + \ + product(bool, SpecialStringEqualsCC, true, \ + "special version of string equalsCC") \ + \ /* statistics */ \ develop(bool, CountCompiledCalls, false, \ "counts method invocations") \ @@ -2851,9 +2901,13 @@ "Max. no. of lines in the stack trace for Java exceptions " \ "(0 means all)") \ \ - develop(intx, GuaranteedSafepointInterval, 1000, \ + NOT_EMBEDDED(develop(intx, GuaranteedSafepointInterval, 1000, \ "Guarantee a safepoint (at least) every so many milliseconds " \ - "(0 means none)") \ + "(0 means none)")) \ + \ + EMBEDDED_ONLY(product(intx, GuaranteedSafepointInterval, 0, \ + "Guarantee a safepoint (at least) every so many milliseconds " \ + "(0 means none)")) \ \ product(intx, SafepointTimeoutDelay, 10000, \ "Delay in milliseconds for option SafepointTimeout") \ @@ -3543,9 +3597,13 @@ \ /* flags for performance data collection */ \ \ - product(bool, UsePerfData, true, \ + NOT_EMBEDDED(product(bool, UsePerfData, true, \ "Flag to disable jvmstat instrumentation for performance testing" \ - "and problem isolation purposes.") \ + "and problem isolation purposes.")) \ + \ + EMBEDDED_ONLY(product(bool, UsePerfData, false, \ + "Flag to disable jvmstat instrumentation for performance testing" \ + "and problem isolation purposes.")) \ \ product(bool, PerfDataSaveToFile, false, \ "Save PerfData memory to hsperfdata_ file on exit") \ diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/runtime/icache.hpp --- a/hotspot/src/share/vm/runtime/icache.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/runtime/icache.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -77,6 +77,12 @@ #ifdef TARGET_ARCH_zero # include "icache_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "icache_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "icache_ppc.hpp" +#endif diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/runtime/java.cpp --- a/hotspot/src/share/vm/runtime/java.cpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/runtime/java.cpp Mon Feb 07 08:40:30 2011 -0800 @@ -70,6 +70,12 @@ #ifdef TARGET_ARCH_zero # include "vm_version_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "vm_version_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "vm_version_ppc.hpp" +#endif #ifdef TARGET_OS_FAMILY_linux # include "thread_linux.inline.hpp" #endif diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/runtime/javaCalls.hpp --- a/hotspot/src/share/vm/runtime/javaCalls.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/runtime/javaCalls.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -39,6 +39,12 @@ #ifdef TARGET_ARCH_zero # include "jniTypes_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "jniTypes_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "jniTypes_ppc.hpp" +#endif #ifdef TARGET_OS_FAMILY_linux # include "thread_linux.inline.hpp" #endif diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/runtime/javaFrameAnchor.hpp --- a/hotspot/src/share/vm/runtime/javaFrameAnchor.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/runtime/javaFrameAnchor.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -44,6 +44,12 @@ #ifdef TARGET_OS_ARCH_windows_x86 # include "orderAccess_windows_x86.inline.hpp" #endif +#ifdef TARGET_OS_ARCH_linux_arm +# include "orderAccess_linux_arm.inline.hpp" +#endif +#ifdef TARGET_OS_ARCH_linux_ppc +# include "orderAccess_linux_ppc.inline.hpp" +#endif // // An object for encapsulating the machine/os dependent part of a JavaThread frame state // @@ -102,6 +108,12 @@ #ifdef TARGET_ARCH_zero # include "javaFrameAnchor_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "javaFrameAnchor_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "javaFrameAnchor_ppc.hpp" +#endif public: diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/runtime/mutexLocker.cpp --- a/hotspot/src/share/vm/runtime/mutexLocker.cpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/runtime/mutexLocker.cpp Mon Feb 07 08:40:30 2011 -0800 @@ -129,7 +129,7 @@ Monitor* GCTaskManager_lock = NULL; Mutex* Management_lock = NULL; -Monitor* LowMemory_lock = NULL; +Monitor* Service_lock = NULL; #define MAX_NUM_MUTEX 128 static Monitor * _mutex_array[MAX_NUM_MUTEX]; @@ -203,7 +203,7 @@ def(Patching_lock , Mutex , special, true ); // used for safepointing and code patching. def(ObjAllocPost_lock , Monitor, special, false); - def(LowMemory_lock , Monitor, special, true ); // used for low memory detection + def(Service_lock , Monitor, special, true ); // used for service thread operations def(JmethodIdCreation_lock , Mutex , leaf, true ); // used for creating jmethodIDs. def(SystemDictionary_lock , Monitor, leaf, true ); // lookups done by VM thread diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/runtime/mutexLocker.hpp --- a/hotspot/src/share/vm/runtime/mutexLocker.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/runtime/mutexLocker.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -131,7 +131,7 @@ extern Mutex* HotCardCache_lock; // protects the hot card cache extern Mutex* Management_lock; // a lock used to serialize JVM management -extern Monitor* LowMemory_lock; // a lock used for low memory detection +extern Monitor* Service_lock; // a lock used for service thread operation // A MutexLocker provides mutual exclusion with respect to a given mutex // for the scope which contains the locker. The lock is an OS lock, not diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/runtime/os.hpp --- a/hotspot/src/share/vm/runtime/os.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/runtime/os.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -676,6 +676,12 @@ #ifdef TARGET_OS_ARCH_windows_x86 # include "os_windows_x86.hpp" #endif +#ifdef TARGET_OS_ARCH_linux_arm +# include "os_linux_arm.hpp" +#endif +#ifdef TARGET_OS_ARCH_linux_ppc +# include "os_linux_ppc.hpp" +#endif // debugging support (mostly used by debug.cpp but also fatal error handler) diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/runtime/registerMap.hpp --- a/hotspot/src/share/vm/runtime/registerMap.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/runtime/registerMap.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -36,6 +36,12 @@ #ifdef TARGET_ARCH_zero # include "register_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "register_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "register_ppc.hpp" +#endif class JavaThread; @@ -138,6 +144,12 @@ #ifdef TARGET_ARCH_zero # include "registerMap_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "registerMap_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "registerMap_ppc.hpp" +#endif }; diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/runtime/relocator.hpp --- a/hotspot/src/share/vm/runtime/relocator.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/runtime/relocator.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -36,6 +36,12 @@ #ifdef TARGET_ARCH_zero # include "bytes_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "bytes_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "bytes_ppc.hpp" +#endif // This code has been converted from the 1.1E java virtual machine // Thanks to the JavaTopics group for using the code diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/runtime/safepoint.cpp --- a/hotspot/src/share/vm/runtime/safepoint.cpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/runtime/safepoint.cpp Mon Feb 07 08:40:30 2011 -0800 @@ -61,6 +61,14 @@ # include "nativeInst_zero.hpp" # include "vmreg_zero.inline.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "nativeInst_arm.hpp" +# include "vmreg_arm.inline.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "nativeInst_ppc.hpp" +# include "vmreg_ppc.inline.hpp" +#endif #ifdef TARGET_OS_FAMILY_linux # include "thread_linux.inline.hpp" #endif diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/runtime/serviceThread.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hotspot/src/share/vm/runtime/serviceThread.cpp Mon Feb 07 08:40:30 2011 -0800 @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#include "precompiled.hpp" +#include "runtime/interfaceSupport.hpp" +#include "runtime/javaCalls.hpp" +#include "runtime/serviceThread.hpp" +#include "runtime/mutexLocker.hpp" +#include "prims/jvmtiImpl.hpp" + +ServiceThread* ServiceThread::_instance = NULL; + +void ServiceThread::initialize() { + EXCEPTION_MARK; + + instanceKlassHandle klass (THREAD, SystemDictionary::Thread_klass()); + instanceHandle thread_oop = klass->allocate_instance_handle(CHECK); + + const char* name = JDK_Version::is_gte_jdk17x_version() ? + "Service Thread" : "Low Memory Detector"; + + Handle string = java_lang_String::create_from_str(name, CHECK); + + // Initialize thread_oop to put it into the system threadGroup + Handle thread_group (THREAD, Universe::system_thread_group()); + JavaValue result(T_VOID); + JavaCalls::call_special(&result, thread_oop, + klass, + vmSymbols::object_initializer_name(), + vmSymbols::threadgroup_string_void_signature(), + thread_group, + string, + CHECK); + + { + MutexLocker mu(Threads_lock); + ServiceThread* thread = new ServiceThread(&service_thread_entry); + + // At this point it may be possible that no osthread was created for the + // JavaThread due to lack of memory. We would have to throw an exception + // in that case. However, since this must work and we do not allow + // exceptions anyway, check and abort if this fails. + if (thread == NULL || thread->osthread() == NULL) { + vm_exit_during_initialization("java.lang.OutOfMemoryError", + "unable to create new native thread"); + } + + java_lang_Thread::set_thread(thread_oop(), thread); + java_lang_Thread::set_priority(thread_oop(), NearMaxPriority); + java_lang_Thread::set_daemon(thread_oop()); + thread->set_threadObj(thread_oop()); + + Threads::add(thread); + Thread::start(thread); + + _instance = thread; + } +} + +void ServiceThread::service_thread_entry(JavaThread* jt, TRAPS) { + while (true) { + bool sensors_changed = false; + bool has_jvmti_events = false; + JvmtiDeferredEvent jvmti_event; + { + // Need state transition ThreadBlockInVM so that this thread + // will be handled by safepoint correctly when this thread is + // notified at a safepoint. + + // This ThreadBlockInVM object is not also considered to be + // suspend-equivalent because ServiceThread is not visible to + // external suspension. + + ThreadBlockInVM tbivm(jt); + + MutexLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag); + while (!(sensors_changed = LowMemoryDetector::has_pending_requests()) && + !(has_jvmti_events = JvmtiDeferredEventQueue::has_events())) { + // wait until one of the sensors has pending requests, or there is a + // pending JVMTI event to post + Service_lock->wait(Mutex::_no_safepoint_check_flag); + } + + if (has_jvmti_events) { + jvmti_event = JvmtiDeferredEventQueue::dequeue(); + } + } + + if (has_jvmti_events) { + jvmti_event.post(); + } + + if (sensors_changed) { + LowMemoryDetector::process_sensor_changes(jt); + } + } +} + +bool ServiceThread::is_service_thread(Thread* thread) { + return thread == _instance; +} diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/runtime/serviceThread.hpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hotspot/src/share/vm/runtime/serviceThread.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#ifndef SHARE_VM_RUNTIME_SERVICETHREAD_HPP +#define SHARE_VM_RUNTIME_SERVICETHREAD_HPP + +#include "runtime/thread.hpp" + +// A JavaThread for low memory detection support and JVMTI +// compiled-method-load events. +class ServiceThread : public JavaThread { + friend class VMStructs; + private: + + static ServiceThread* _instance; + + static void service_thread_entry(JavaThread* thread, TRAPS); + ServiceThread(ThreadFunction entry_point) : JavaThread(entry_point) {}; + + public: + static void initialize(); + + // Hide this thread from external view. + bool is_hidden_from_external_view() const { return true; } + + // Returns true if the passed thread is the service thread. + static bool is_service_thread(Thread* thread); +}; + +#endif // SHARE_VM_RUNTIME_SERVICETHREAD_HPP diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/runtime/sharedRuntime.cpp --- a/hotspot/src/share/vm/runtime/sharedRuntime.cpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/runtime/sharedRuntime.cpp Mon Feb 07 08:40:30 2011 -0800 @@ -68,6 +68,14 @@ # include "nativeInst_zero.hpp" # include "vmreg_zero.inline.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "nativeInst_arm.hpp" +# include "vmreg_arm.inline.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "nativeInst_ppc.hpp" +# include "vmreg_ppc.inline.hpp" +#endif #ifdef COMPILER1 #include "c1/c1_Runtime1.hpp" #endif @@ -2618,6 +2626,7 @@ int jlsLen = java_lang_String::length(src); jchar* jlsPos = (jlsLen == 0) ? NULL : jlsValue->char_at_addr(jlsOffset); + assert(typeArrayKlass::cast(jlsValue->klass())->element_type() == T_CHAR, "compressed string"); (void) UNICODE::as_utf8(jlsPos, jlsLen, (char *)dst, max_dtrace_string_size); } #endif // ndef HAVE_DTRACE_H diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/runtime/stackValueCollection.cpp --- a/hotspot/src/share/vm/runtime/stackValueCollection.cpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/runtime/stackValueCollection.cpp Mon Feb 07 08:40:30 2011 -0800 @@ -33,6 +33,12 @@ #ifdef TARGET_ARCH_zero # include "jniTypes_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "jniTypes_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "jniTypes_ppc.hpp" +#endif jint StackValueCollection::int_at(int slot) const { intptr_t val = at(slot)->get_int(); diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/runtime/statSampler.cpp --- a/hotspot/src/share/vm/runtime/statSampler.cpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/runtime/statSampler.cpp Mon Feb 07 08:40:30 2011 -0800 @@ -42,6 +42,12 @@ #ifdef TARGET_ARCH_zero # include "vm_version_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "vm_version_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "vm_version_ppc.hpp" +#endif // -------------------------------------------------------- // StatSamplerTask diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/runtime/stubCodeGenerator.cpp --- a/hotspot/src/share/vm/runtime/stubCodeGenerator.cpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/runtime/stubCodeGenerator.cpp Mon Feb 07 08:40:30 2011 -0800 @@ -36,6 +36,12 @@ #ifdef TARGET_ARCH_zero # include "assembler_zero.inline.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "assembler_arm.inline.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "assembler_ppc.inline.hpp" +#endif // Implementation of StubCodeDesc diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/runtime/stubRoutines.hpp --- a/hotspot/src/share/vm/runtime/stubRoutines.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/runtime/stubRoutines.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -40,6 +40,12 @@ #ifdef TARGET_ARCH_zero # include "nativeInst_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "nativeInst_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "nativeInst_ppc.hpp" +#endif // StubRoutines provides entry points to assembly routines used by // compiled code and the run-time system. Platform-specific entry @@ -105,6 +111,12 @@ #ifdef TARGET_ARCH_MODEL_zero # include "stubRoutines_zero.hpp" #endif +#ifdef TARGET_ARCH_MODEL_arm +# include "stubRoutines_arm.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_ppc +# include "stubRoutines_ppc.hpp" +#endif static jint _verify_oop_count; diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/runtime/thread.hpp --- a/hotspot/src/share/vm/runtime/thread.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/runtime/thread.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -1598,6 +1598,12 @@ #ifdef TARGET_OS_ARCH_windows_x86 # include "thread_windows_x86.hpp" #endif +#ifdef TARGET_OS_ARCH_linux_arm +# include "thread_linux_arm.hpp" +#endif +#ifdef TARGET_OS_ARCH_linux_ppc +# include "thread_linux_ppc.hpp" +#endif public: @@ -1674,16 +1680,6 @@ return cur_sp > low_addr ? cur_sp - low_addr : 0; } -// A JavaThread for low memory detection support -class LowMemoryDetectorThread : public JavaThread { - friend class VMStructs; -public: - LowMemoryDetectorThread(ThreadFunction entry_point) : JavaThread(entry_point) {}; - - // Hide this thread from external view. - bool is_hidden_from_external_view() const { return true; } -}; - // A thread used for Compilation. class CompilerThread : public JavaThread { friend class VMStructs; diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/runtime/threadLocalStorage.hpp --- a/hotspot/src/share/vm/runtime/threadLocalStorage.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/runtime/threadLocalStorage.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -62,6 +62,12 @@ #ifdef TARGET_OS_ARCH_windows_x86 # include "threadLS_windows_x86.hpp" #endif +#ifdef TARGET_OS_ARCH_linux_arm +# include "threadLS_linux_arm.hpp" +#endif +#ifdef TARGET_OS_ARCH_linux_ppc +# include "threadLS_linux_ppc.hpp" +#endif public: diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/runtime/vmStructs.cpp --- a/hotspot/src/share/vm/runtime/vmStructs.cpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/runtime/vmStructs.cpp Mon Feb 07 08:40:30 2011 -0800 @@ -93,6 +93,7 @@ #include "runtime/java.hpp" #include "runtime/javaCalls.hpp" #include "runtime/perfMemory.hpp" +#include "runtime/serviceThread.hpp" #include "runtime/sharedRuntime.hpp" #include "runtime/stubRoutines.hpp" #include "runtime/virtualspace.hpp" @@ -108,6 +109,12 @@ #ifdef TARGET_ARCH_zero # include "vmStructs_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "vmStructs_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "vmStructs_ppc.hpp" +#endif #ifdef TARGET_OS_FAMILY_linux # include "thread_linux.inline.hpp" #endif @@ -135,6 +142,12 @@ #ifdef TARGET_OS_ARCH_windows_x86 # include "vmStructs_windows_x86.hpp" #endif +#ifdef TARGET_OS_ARCH_linux_arm +# include "vmStructs_linux_arm.hpp" +#endif +#ifdef TARGET_OS_ARCH_linux_ppc +# include "vmStructs_linux_ppc.hpp" +#endif #ifndef SERIALGC #include "gc_implementation/concurrentMarkSweep/cmsPermGen.hpp" #include "gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp" @@ -166,6 +179,12 @@ #ifdef TARGET_ARCH_MODEL_zero # include "adfiles/adGlobals_zero.hpp" #endif +#ifdef TARGET_ARCH_MODEL_arm +# include "adfiles/adGlobals_arm.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_ppc +# include "adfiles/adGlobals_ppc.hpp" +#endif #endif // Note: the cross-product of (c1, c2, product, nonproduct, ...), @@ -1232,7 +1251,7 @@ declare_type(WatcherThread, Thread) \ declare_type(JavaThread, Thread) \ declare_type(JvmtiAgentThread, JavaThread) \ - declare_type(LowMemoryDetectorThread, JavaThread) \ + declare_type(ServiceThread, JavaThread) \ declare_type(CompilerThread, JavaThread) \ declare_toplevel_type(OSThread) \ declare_toplevel_type(JavaFrameAnchor) \ diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/runtime/vm_version.cpp --- a/hotspot/src/share/vm/runtime/vm_version.cpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/runtime/vm_version.cpp Mon Feb 07 08:40:30 2011 -0800 @@ -35,6 +35,12 @@ #ifdef TARGET_ARCH_zero # include "vm_version_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "vm_version_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "vm_version_ppc.hpp" +#endif const char* Abstract_VM_Version::_s_vm_release = Abstract_VM_Version::vm_release(); const char* Abstract_VM_Version::_s_internal_vm_info_string = Abstract_VM_Version::internal_vm_info_string(); @@ -220,8 +226,21 @@ #endif #endif + #ifndef FLOAT_ARCH + #if defined(__SOFTFP__) + #define FLOAT_ARCH "-sflt" + #elif defined(E500V2) + #define FLOAT_ARCH "-e500v2" + #elif defined(ARM) + #define FLOAT_ARCH "-vfp" + #elif defined(PPC) + #define FLOAT_ARCH "-hflt" + #else + #define FLOAT_ARCH "" + #endif + #endif - return VMNAME " (" VM_RELEASE ") for " OS "-" CPU + return VMNAME " (" VM_RELEASE ") for " OS "-" CPU FLOAT_ARCH " JRE (" JRE_RELEASE_VERSION "), built on " __DATE__ " " __TIME__ " by " XSTR(HOTSPOT_BUILD_USER) " with " HOTSPOT_BUILD_COMPILER; } diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/services/attachListener.hpp --- a/hotspot/src/share/vm/services/attachListener.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/services/attachListener.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -59,10 +59,10 @@ static void detachall() KERNEL_RETURN; // indicates if the Attach Listener needs to be created at startup - static bool init_at_startup() KERNEL_RETURN_(return false;); + static bool init_at_startup() KERNEL_RETURN_(false); // indicates if we have a trigger to start the Attach Listener - static bool is_init_trigger() KERNEL_RETURN_(return false;); + static bool is_init_trigger() KERNEL_RETURN_(false); #ifdef SERVICES_KERNEL static bool is_attach_supported() { return false; } diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/services/lowMemoryDetector.cpp --- a/hotspot/src/share/vm/services/lowMemoryDetector.cpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/services/lowMemoryDetector.cpp Mon Feb 07 08:40:30 2011 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,55 +34,11 @@ #include "services/lowMemoryDetector.hpp" #include "services/management.hpp" -LowMemoryDetectorThread* LowMemoryDetector::_detector_thread = NULL; volatile bool LowMemoryDetector::_enabled_for_collected_pools = false; volatile jint LowMemoryDetector::_disabled_count = 0; -void LowMemoryDetector::initialize() { - EXCEPTION_MARK; - - instanceKlassHandle klass (THREAD, SystemDictionary::Thread_klass()); - instanceHandle thread_oop = klass->allocate_instance_handle(CHECK); - - const char thread_name[] = "Low Memory Detector"; - Handle string = java_lang_String::create_from_str(thread_name, CHECK); - - // Initialize thread_oop to put it into the system threadGroup - Handle thread_group (THREAD, Universe::system_thread_group()); - JavaValue result(T_VOID); - JavaCalls::call_special(&result, thread_oop, - klass, - vmSymbols::object_initializer_name(), - vmSymbols::threadgroup_string_void_signature(), - thread_group, - string, - CHECK); - - { - MutexLocker mu(Threads_lock); - _detector_thread = new LowMemoryDetectorThread(&low_memory_detector_thread_entry); - - // At this point it may be possible that no osthread was created for the - // JavaThread due to lack of memory. We would have to throw an exception - // in that case. However, since this must work and we do not allow - // exceptions anyway, check and abort if this fails. - if (_detector_thread == NULL || _detector_thread->osthread() == NULL) { - vm_exit_during_initialization("java.lang.OutOfMemoryError", - "unable to create new native thread"); - } - - java_lang_Thread::set_thread(thread_oop(), _detector_thread); - java_lang_Thread::set_priority(thread_oop(), NearMaxPriority); - java_lang_Thread::set_daemon(thread_oop()); - _detector_thread->set_threadObj(thread_oop()); - - Threads::add(_detector_thread); - Thread::start(_detector_thread); - } -} - bool LowMemoryDetector::has_pending_requests() { - assert(LowMemory_lock->owned_by_self(), "Must own LowMemory_lock"); + assert(Service_lock->owned_by_self(), "Must own Service_lock"); bool has_requests = false; int num_memory_pools = MemoryService::num_memory_pools(); for (int i = 0; i < num_memory_pools; i++) { @@ -100,47 +56,21 @@ return has_requests; } -void LowMemoryDetector::low_memory_detector_thread_entry(JavaThread* jt, TRAPS) { - while (true) { - bool sensors_changed = false; - - { - // _no_safepoint_check_flag is used here as LowMemory_lock is a - // special lock and the VMThread may acquire this lock at safepoint. - // Need state transition ThreadBlockInVM so that this thread - // will be handled by safepoint correctly when this thread is - // notified at a safepoint. - - // This ThreadBlockInVM object is not also considered to be - // suspend-equivalent because LowMemoryDetector threads are - // not visible to external suspension. - - ThreadBlockInVM tbivm(jt); +void LowMemoryDetector::process_sensor_changes(TRAPS) { + ResourceMark rm(THREAD); + HandleMark hm(THREAD); - MutexLockerEx ml(LowMemory_lock, Mutex::_no_safepoint_check_flag); - while (!(sensors_changed = has_pending_requests())) { - // wait until one of the sensors has pending requests - LowMemory_lock->wait(Mutex::_no_safepoint_check_flag); - } + // No need to hold Service_lock to call out to Java + int num_memory_pools = MemoryService::num_memory_pools(); + for (int i = 0; i < num_memory_pools; i++) { + MemoryPool* pool = MemoryService::get_memory_pool(i); + SensorInfo* sensor = pool->usage_sensor(); + SensorInfo* gc_sensor = pool->gc_usage_sensor(); + if (sensor != NULL && sensor->has_pending_requests()) { + sensor->process_pending_requests(CHECK); } - - { - ResourceMark rm(THREAD); - HandleMark hm(THREAD); - - // No need to hold LowMemory_lock to call out to Java - int num_memory_pools = MemoryService::num_memory_pools(); - for (int i = 0; i < num_memory_pools; i++) { - MemoryPool* pool = MemoryService::get_memory_pool(i); - SensorInfo* sensor = pool->usage_sensor(); - SensorInfo* gc_sensor = pool->gc_usage_sensor(); - if (sensor != NULL && sensor->has_pending_requests()) { - sensor->process_pending_requests(CHECK); - } - if (gc_sensor != NULL && gc_sensor->has_pending_requests()) { - gc_sensor->process_pending_requests(CHECK); - } - } + if (gc_sensor != NULL && gc_sensor->has_pending_requests()) { + gc_sensor->process_pending_requests(CHECK); } } } @@ -148,7 +78,7 @@ // This method could be called from any Java threads // and also VMThread. void LowMemoryDetector::detect_low_memory() { - MutexLockerEx ml(LowMemory_lock, Mutex::_no_safepoint_check_flag); + MutexLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag); bool has_pending_requests = false; int num_memory_pools = MemoryService::num_memory_pools(); @@ -166,7 +96,7 @@ } if (has_pending_requests) { - LowMemory_lock->notify_all(); + Service_lock->notify_all(); } } @@ -181,14 +111,14 @@ } { - MutexLockerEx ml(LowMemory_lock, Mutex::_no_safepoint_check_flag); + MutexLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag); MemoryUsage usage = pool->get_memory_usage(); sensor->set_gauge_sensor_level(usage, pool->usage_threshold()); if (sensor->has_pending_requests()) { // notify sensor state update - LowMemory_lock->notify_all(); + Service_lock->notify_all(); } } } @@ -203,14 +133,14 @@ } { - MutexLockerEx ml(LowMemory_lock, Mutex::_no_safepoint_check_flag); + MutexLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag); MemoryUsage usage = pool->get_last_collection_usage(); sensor->set_counter_sensor_level(usage, pool->gc_usage_threshold()); if (sensor->has_pending_requests()) { // notify sensor state update - LowMemory_lock->notify_all(); + Service_lock->notify_all(); } } } @@ -384,8 +314,8 @@ } { - // Holds LowMemory_lock and update the sensor state - MutexLockerEx ml(LowMemory_lock, Mutex::_no_safepoint_check_flag); + // Holds Service_lock and update the sensor state + MutexLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag); _sensor_on = true; _sensor_count += count; _pending_trigger_count = _pending_trigger_count - count; @@ -410,8 +340,8 @@ } { - // Holds LowMemory_lock and update the sensor state - MutexLockerEx ml(LowMemory_lock, Mutex::_no_safepoint_check_flag); + // Holds Service_lock and update the sensor state + MutexLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag); _sensor_on = false; _pending_clear_count = 0; _pending_trigger_count = _pending_trigger_count - count; diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/services/lowMemoryDetector.hpp --- a/hotspot/src/share/vm/services/lowMemoryDetector.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/services/lowMemoryDetector.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -58,8 +58,8 @@ // // May need to deal with hysteresis effect. // +// Memory detection code runs in the Service thread (serviceThread.hpp). -class LowMemoryDetectorThread; class OopClosure; class MemoryPool; @@ -211,23 +211,22 @@ }; class LowMemoryDetector : public AllStatic { -friend class LowMemoryDetectorDisabler; + friend class LowMemoryDetectorDisabler; + friend class ServiceThread; private: // true if any collected heap has low memory detection enabled static volatile bool _enabled_for_collected_pools; // > 0 if temporary disabed static volatile jint _disabled_count; - static LowMemoryDetectorThread* _detector_thread; - static void low_memory_detector_thread_entry(JavaThread* thread, TRAPS); static void check_memory_usage(); static bool has_pending_requests(); static bool temporary_disabled() { return _disabled_count > 0; } static void disable() { Atomic::inc(&_disabled_count); } static void enable() { Atomic::dec(&_disabled_count); } + static void process_sensor_changes(TRAPS); public: - static void initialize(); static void detect_low_memory(); static void detect_low_memory(MemoryPool* pool); static void detect_after_gc_memory(MemoryPool* pool); @@ -275,7 +274,6 @@ } } } - }; class LowMemoryDetectorDisabler: public StackObj { diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/services/management.cpp --- a/hotspot/src/share/vm/services/management.cpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/services/management.cpp Mon Feb 07 08:40:30 2011 -0800 @@ -38,6 +38,7 @@ #include "runtime/javaCalls.hpp" #include "runtime/jniHandles.hpp" #include "runtime/os.hpp" +#include "runtime/serviceThread.hpp" #include "services/classLoadingService.hpp" #include "services/heapDumper.hpp" #include "services/lowMemoryDetector.hpp" @@ -112,8 +113,8 @@ } void Management::initialize(TRAPS) { - // Start the low memory detector thread - LowMemoryDetector::initialize(); + // Start the service thread + ServiceThread::initialize(); if (ManagementServer) { ResourceMark rm(THREAD); diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/utilities/copy.hpp --- a/hotspot/src/share/vm/utilities/copy.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/utilities/copy.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -331,6 +331,12 @@ #ifdef TARGET_ARCH_zero # include "copy_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "copy_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "copy_ppc.hpp" +#endif }; diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/utilities/elfSymbolTable.cpp --- a/hotspot/src/share/vm/utilities/elfSymbolTable.cpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/utilities/elfSymbolTable.cpp Mon Feb 07 08:40:30 2011 -0800 @@ -39,13 +39,14 @@ // try to load the string table long cur_offset = ftell(file); if (cur_offset != -1) { - m_symbols = (Elf_Sym*)NEW_C_HEAP_ARRAY(char, shdr.sh_size); + // call malloc so we can back up if memory allocation fails. + m_symbols = (Elf_Sym*)os::malloc(shdr.sh_size); if (m_symbols) { if (fseek(file, shdr.sh_offset, SEEK_SET) || fread((void*)m_symbols, shdr.sh_size, 1, file) != 1 || fseek(file, cur_offset, SEEK_SET)) { m_status = Decoder::file_invalid; - FREE_C_HEAP_ARRAY(char, m_symbols); + os::free(m_symbols); m_symbols = NULL; } } @@ -59,7 +60,7 @@ ElfSymbolTable::~ElfSymbolTable() { if (m_symbols != NULL) { - FREE_C_HEAP_ARRAY(char, m_symbols); + os::free(m_symbols); } if (m_next != NULL) { diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/utilities/globalDefinitions.hpp --- a/hotspot/src/share/vm/utilities/globalDefinitions.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/utilities/globalDefinitions.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -328,6 +328,12 @@ #ifdef TARGET_ARCH_zero # include "globalDefinitions_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "globalDefinitions_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "globalDefinitions_ppc.hpp" +#endif // The byte alignment to be used by Arena::Amalloc. See bugid 4169348. diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/utilities/macros.hpp --- a/hotspot/src/share/vm/utilities/macros.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/utilities/macros.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -46,7 +46,7 @@ #define SERVICES_KERNEL #define KERNEL_RETURN {} -#define KERNEL_RETURN_(code) { code } +#define KERNEL_RETURN_(code) { return code; } #else // KERNEL diff -r d5bd38a11ccd -r 704d4d037c84 hotspot/src/share/vm/utilities/taskqueue.hpp --- a/hotspot/src/share/vm/utilities/taskqueue.hpp Fri Feb 04 16:29:41 2011 -0800 +++ b/hotspot/src/share/vm/utilities/taskqueue.hpp Mon Feb 07 08:40:30 2011 -0800 @@ -47,6 +47,12 @@ #ifdef TARGET_OS_ARCH_windows_x86 # include "orderAccess_windows_x86.inline.hpp" #endif +#ifdef TARGET_OS_ARCH_linux_arm +# include "orderAccess_linux_arm.inline.hpp" +#endif +#ifdef TARGET_OS_ARCH_linux_ppc +# include "orderAccess_linux_ppc.inline.hpp" +#endif // Simple TaskQueue stats that are collected by default in debug builds.