Merge

Fri, 09 Mar 2012 08:34:36 -0800

author
never
date
Fri, 09 Mar 2012 08:34:36 -0800
changeset 3633
d8b13355c500
parent 3632
541c4a5e7b88
parent 3628
d59a6302465a
child 3634
dfae0140457c

Merge

     1.1 --- a/.hgtags	Tue Mar 06 16:32:23 2012 -0800
     1.2 +++ b/.hgtags	Fri Mar 09 08:34:36 2012 -0800
     1.3 @@ -226,3 +226,5 @@
     1.4  931e5f39e365a0d550d79148ff87a7f9e864d2e1 hs23-b16
     1.5  3b24e7e01d20ca590d0f86b1222bb7c3f1a2aa2d jdk8-b27
     1.6  975c4105f1e2ef1190a75b77124033f1fd4290b5 hs24-b01
     1.7 +b183b0863611b85dbac16f3b08b40ba978756d19 jdk8-b28
     1.8 +030b5306d60f140e822e4a6d301744cb110ff0c8 hs24-b02
     2.1 --- a/make/Makefile	Tue Mar 06 16:32:23 2012 -0800
     2.2 +++ b/make/Makefile	Fri Mar 09 08:34:36 2012 -0800
     2.3 @@ -378,6 +378,9 @@
     2.4  $(EXPORT_LIB_DIR)/%.jar: $(GEN_DIR)/%.jar
     2.5  	$(install-file)
     2.6  
     2.7 +$(EXPORT_JRE_LIB_DIR)/%.jar: $(GEN_DIR)/%.jar
     2.8 +	$(install-file)
     2.9 +
    2.10  # Include files (jvmti.h, jvmticmlr.h, jni.h, $(JDK_INCLUDE_SUBDIR)/jni_md.h, jmm.h, jfr.h)
    2.11  $(EXPORT_INCLUDE_DIR)/%: $(GEN_DIR)/jvmtifiles/%
    2.12  	$(install-file)
     3.1 --- a/make/bsd/makefiles/defs.make	Tue Mar 06 16:32:23 2012 -0800
     3.2 +++ b/make/bsd/makefiles/defs.make	Fri Mar 09 08:34:36 2012 -0800
     3.3 @@ -144,6 +144,8 @@
     3.4  EXPORT_SERVER_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/server
     3.5  EXPORT_CLIENT_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/client
     3.6  
     3.7 +EXPORT_LIST += $(EXPORT_JRE_LIB_DIR)/wb.jar
     3.8 +
     3.9  ifndef BUILD_CLIENT_ONLY
    3.10  EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt
    3.11  EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.$(LIBRARY_SUFFIX)
     4.1 --- a/make/bsd/makefiles/vm.make	Tue Mar 06 16:32:23 2012 -0800
     4.2 +++ b/make/bsd/makefiles/vm.make	Fri Mar 09 08:34:36 2012 -0800
     4.3 @@ -1,5 +1,5 @@
     4.4  #
     4.5 -# Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
     4.6 +# Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
     4.7  # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4.8  #
     4.9  # This code is free software; you can redistribute it and/or modify it
    4.10 @@ -335,6 +335,9 @@
    4.11  # Serviceability agent
    4.12  include $(MAKEFILES_DIR)/saproc.make
    4.13  
    4.14 +# Whitebox testing API
    4.15 +include $(MAKEFILES_DIR)/wb.make
    4.16 +
    4.17  #----------------------------------------------------------------------
    4.18  
    4.19  ifeq ($(OS_VENDOR), Darwin)
    4.20 @@ -342,10 +345,10 @@
    4.21  	dsymutil $(LIBJVM)
    4.22  
    4.23  # no libjvm_db for macosx
    4.24 -build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(BUILDLIBSAPROC) dtraceCheck $(LIBJVM).dSYM
    4.25 +build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(BUILDLIBSAPROC) dtraceCheck $(LIBJVM).dSYM $(WB_JAR)
    4.26  	echo "Doing vm.make build:"
    4.27  else
    4.28 -build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) $(BUILDLIBSAPROC)
    4.29 +build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) $(BUILDLIBSAPROC) $(WB_JAR)
    4.30  endif
    4.31  
    4.32  install: install_jvm install_jsig install_saproc
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/make/bsd/makefiles/wb.make	Fri Mar 09 08:34:36 2012 -0800
     5.3 @@ -0,0 +1,46 @@
     5.4 +#
     5.5 +# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
     5.6 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     5.7 +#
     5.8 +# This code is free software; you can redistribute it and/or modify it
     5.9 +# under the terms of the GNU General Public License version 2 only, as
    5.10 +# published by the Free Software Foundation.
    5.11 +#
    5.12 +# This code is distributed in the hope that it will be useful, but WITHOUT
    5.13 +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    5.14 +# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    5.15 +# version 2 for more details (a copy is included in the LICENSE file that
    5.16 +# accompanied this code).
    5.17 +#
    5.18 +# You should have received a copy of the GNU General Public License version
    5.19 +# 2 along with this work; if not, write to the Free Software Foundation,
    5.20 +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    5.21 +#
    5.22 +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    5.23 +# or visit www.oracle.com if you need additional information or have any
    5.24 +# questions.
    5.25 +#  
    5.26 +#
    5.27 +
    5.28 +# Rules to build whitebox testing library, used by vm.make
    5.29 +WB = wb
    5.30 +
    5.31 +WBSRCDIR = $(GAMMADIR)/src/share/tools/whitebox
    5.32 +
    5.33 +WB_JAR = $(GENERATED)/$(WB).jar
    5.34 +
    5.35 +WB_JAVA_SRCS = $(shell find $(WBSRCDIR) -name '*.java')
    5.36 +WB_JAVA_CLASSDIR = $(GENERATED)/wb/classes
    5.37 +
    5.38 +WB_JAVA_CLASSES  = $(patsubst $(WBSRCDIR)/%,$(WB_JAVA_CLASSDIR)/%, \
    5.39 +	$(patsubst %.java,%.class,$(WB_JAVA_SRCS)))
    5.40 +
    5.41 +$(WB_JAVA_CLASSDIR)/%.class: $(WBSRCDIR)/%.java $(WB_JAVA_CLASSDIR)
    5.42 +	$(REMOTE) $(COMPILE.JAVAC) -nowarn -d $(WB_JAVA_CLASSDIR) $<
    5.43 +
    5.44 +$(WB_JAR): $(WB_JAVA_CLASSES)
    5.45 +	$(QUIETLY) $(REMOTE) $(RUN.JAR) cf $@ -C $(WB_JAVA_CLASSDIR)/ .
    5.46 +
    5.47 +$(WB_JAVA_CLASSDIR):
    5.48 +	$(QUIETLY) mkdir -p $@
    5.49 +
     6.1 --- a/make/hotspot_version	Tue Mar 06 16:32:23 2012 -0800
     6.2 +++ b/make/hotspot_version	Fri Mar 09 08:34:36 2012 -0800
     6.3 @@ -35,7 +35,7 @@
     6.4  
     6.5  HS_MAJOR_VER=24
     6.6  HS_MINOR_VER=0
     6.7 -HS_BUILD_NUMBER=02
     6.8 +HS_BUILD_NUMBER=03
     6.9  
    6.10  JDK_MAJOR_VER=1
    6.11  JDK_MINOR_VER=8
     7.1 --- a/make/jprt.properties	Tue Mar 06 16:32:23 2012 -0800
     7.2 +++ b/make/jprt.properties	Fri Mar 09 08:34:36 2012 -0800
     7.3 @@ -1,5 +1,5 @@
     7.4  #
     7.5 -# Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
     7.6 +# Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
     7.7  # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     7.8  #
     7.9  # This code is free software; you can redistribute it and/or modify it
    7.10 @@ -54,58 +54,72 @@
    7.11  # Define the Solaris platforms we want for the various releases
    7.12  jprt.my.solaris.sparc.jdk8=solaris_sparc_5.10
    7.13  jprt.my.solaris.sparc.jdk7=solaris_sparc_5.10
    7.14 +jprt.my.solaris.sparc.jdk7u4=${jprt.my.solaris.sparc.jdk7}
    7.15  jprt.my.solaris.sparc=${jprt.my.solaris.sparc.${jprt.tools.default.release}}
    7.16  
    7.17  jprt.my.solaris.sparcv9.jdk8=solaris_sparcv9_5.10
    7.18  jprt.my.solaris.sparcv9.jdk7=solaris_sparcv9_5.10
    7.19 +jprt.my.solaris.sparcv9.jdk7u4=${jprt.my.solaris.sparcv9.jdk7}
    7.20  jprt.my.solaris.sparcv9=${jprt.my.solaris.sparcv9.${jprt.tools.default.release}}
    7.21  
    7.22  jprt.my.solaris.i586.jdk8=solaris_i586_5.10
    7.23  jprt.my.solaris.i586.jdk7=solaris_i586_5.10
    7.24 +jprt.my.solaris.i586.jdk7u4=${jprt.my.solaris.i586.jdk7}
    7.25  jprt.my.solaris.i586=${jprt.my.solaris.i586.${jprt.tools.default.release}}
    7.26  
    7.27  jprt.my.solaris.x64.jdk8=solaris_x64_5.10
    7.28  jprt.my.solaris.x64.jdk7=solaris_x64_5.10
    7.29 +jprt.my.solaris.x64.jdk7u4=${jprt.my.solaris.x64.jdk7}
    7.30  jprt.my.solaris.x64=${jprt.my.solaris.x64.${jprt.tools.default.release}}
    7.31  
    7.32  jprt.my.linux.i586.jdk8=linux_i586_2.6
    7.33  jprt.my.linux.i586.jdk7=linux_i586_2.6
    7.34 +jprt.my.linux.i586.jdk7u4=${jprt.my.linux.i586.jdk7}
    7.35  jprt.my.linux.i586=${jprt.my.linux.i586.${jprt.tools.default.release}}
    7.36  
    7.37  jprt.my.linux.x64.jdk8=linux_x64_2.6
    7.38  jprt.my.linux.x64.jdk7=linux_x64_2.6
    7.39 +jprt.my.linux.x64.jdk7u4=${jprt.my.linux.x64.jdk7}
    7.40  jprt.my.linux.x64=${jprt.my.linux.x64.${jprt.tools.default.release}}
    7.41  
    7.42  jprt.my.linux.ppc.jdk8=linux_ppc_2.6
    7.43  jprt.my.linux.ppc.jdk7=linux_ppc_2.6
    7.44 +jprt.my.linux.ppc.jdk7u4=${jprt.my.linux.ppc.jdk7}
    7.45  jprt.my.linux.ppc=${jprt.my.linux.ppc.${jprt.tools.default.release}}
    7.46  
    7.47  jprt.my.linux.ppcv2.jdk8=linux_ppcv2_2.6
    7.48  jprt.my.linux.ppcv2.jdk7=linux_ppcv2_2.6
    7.49 +jprt.my.linux.ppcv2.jdk7u4=${jprt.my.linux.ppcv2.jdk7}
    7.50  jprt.my.linux.ppcv2=${jprt.my.linux.ppcv2.${jprt.tools.default.release}}
    7.51  
    7.52  jprt.my.linux.ppcsflt.jdk8=linux_ppcsflt_2.6
    7.53  jprt.my.linux.ppcsflt.jdk7=linux_ppcsflt_2.6
    7.54 +jprt.my.linux.ppcsflt.jdk7u4=${jprt.my.linux.ppcsflt.jdk7}
    7.55  jprt.my.linux.ppcsflt=${jprt.my.linux.ppcsflt.${jprt.tools.default.release}}
    7.56  
    7.57  jprt.my.linux.armvfp.jdk8=linux_armvfp_2.6
    7.58  jprt.my.linux.armvfp.jdk7=linux_armvfp_2.6
    7.59 +jprt.my.linux.armvfp.jdk7u4=${jprt.my.linux.armvfp.jdk7}
    7.60  jprt.my.linux.armvfp=${jprt.my.linux.armvfp.${jprt.tools.default.release}}
    7.61  
    7.62  jprt.my.linux.armsflt.jdk8=linux_armsflt_2.6
    7.63  jprt.my.linux.armsflt.jdk7=linux_armsflt_2.6
    7.64 +jprt.my.linux.armsflt.jdk7u4=${jprt.my.linux.armsflt.jdk7}
    7.65  jprt.my.linux.armsflt=${jprt.my.linux.armsflt.${jprt.tools.default.release}}
    7.66  
    7.67  jprt.my.macosx.x64.jdk8=macosx_x64_10.7
    7.68  jprt.my.macosx.x64.jdk7=macosx_x64_10.7
    7.69 +jprt.my.macosx.x64.jdk7u4=${jprt.my.macosx.x64.jdk7}
    7.70  jprt.my.macosx.x64=${jprt.my.macosx.x64.${jprt.tools.default.release}}
    7.71  
    7.72  jprt.my.windows.i586.jdk8=windows_i586_5.1
    7.73  jprt.my.windows.i586.jdk7=windows_i586_5.1
    7.74 +jprt.my.windows.i586.jdk7u4=${jprt.my.windows.i586.jdk7}
    7.75  jprt.my.windows.i586=${jprt.my.windows.i586.${jprt.tools.default.release}}
    7.76  
    7.77  jprt.my.windows.x64.jdk8=windows_x64_5.2
    7.78  jprt.my.windows.x64.jdk7=windows_x64_5.2
    7.79 +jprt.my.windows.x64.jdk7u4=${jprt.my.windows.x64.jdk7}
    7.80  jprt.my.windows.x64=${jprt.my.windows.x64.${jprt.tools.default.release}}
    7.81  
    7.82  # Standard list of jprt build targets for this source tree
    7.83 @@ -139,16 +153,7 @@
    7.84  
    7.85  jprt.build.targets.jdk8=${jprt.build.targets.all}
    7.86  jprt.build.targets.jdk7=${jprt.build.targets.all}
    7.87 -jprt.build.targets.jdk7temp=${jprt.build.targets.all}
    7.88 -jprt.build.targets.jdk7b107=${jprt.build.targets.all}
    7.89 -jprt.build.targets.jdk6=${jprt.build.targets.standard}
    7.90 -jprt.build.targets.jdk6perf=${jprt.build.targets.standard}
    7.91 -jprt.build.targets.jdk6u10=${jprt.build.targets.standard}
    7.92 -jprt.build.targets.jdk6u14=${jprt.build.targets.standard}
    7.93 -jprt.build.targets.jdk6u18=${jprt.build.targets.standard}
    7.94 -jprt.build.targets.jdk6u20=${jprt.build.targets.standard}
    7.95 -jprt.build.targets.ejdk6=${jprt.build.targets.all}
    7.96 -jprt.build.targets.ejdk7=${jprt.build.targets.all}
    7.97 +jprt.build.targets.jdk7u4=${jprt.build.targets.all}
    7.98  jprt.build.targets=${jprt.build.targets.${jprt.tools.default.release}}
    7.99  
   7.100  # Subset lists of test targets for this source tree
   7.101 @@ -474,11 +479,26 @@
   7.102    ${jprt.my.macosx.x64}-fastdebug-c2-internalvmtests, \
   7.103    ${jprt.my.windows.i586}-fastdebug-c2-internalvmtests, \
   7.104    ${jprt.my.windows.x64}-fastdebug-c2-internalvmtests
   7.105 -  
   7.106 +
   7.107 +jprt.make.rule.test.targets.standard.wbapi = \
   7.108 +  ${jprt.my.solaris.sparc}-{product|fastdebug}-c2-wbapitest, \
   7.109 +  ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-wbapitest, \
   7.110 +  ${jprt.my.solaris.i586}-{product|fastdebug}-c2-wbapitest, \
   7.111 +  ${jprt.my.solaris.x64}-{product|fastdebug}-c2-wbapitest, \
   7.112 +  ${jprt.my.linux.i586}-{product|fastdebug}-c2-wbapitest, \
   7.113 +  ${jprt.my.linux.x64}-{product|fastdebug}-c2-wbapitest, \
   7.114 +  ${jprt.my.windows.i586}-{product|fastdebug}-c2-wbapitest, \
   7.115 +  ${jprt.my.windows.x64}-{product|fastdebug}-c2-wbapitest, \
   7.116 +  ${jprt.my.solaris.sparc}-{product|fastdebug}-c1-wbapitest, \
   7.117 +  ${jprt.my.solaris.i586}-{product|fastdebug}-c1-wbapitest, \
   7.118 +  ${jprt.my.linux.i586}-{product|fastdebug}-c1-wbapitest, \
   7.119 +  ${jprt.my.windows.i586}-{product|fastdebug}-c1-wbapitest
   7.120 +
   7.121  jprt.make.rule.test.targets.standard = \
   7.122    ${jprt.make.rule.test.targets.standard.client}, \
   7.123    ${jprt.make.rule.test.targets.standard.server}, \
   7.124 -  ${jprt.make.rule.test.targets.standard.internalvmtests}
   7.125 +  ${jprt.make.rule.test.targets.standard.internalvmtests}, \
   7.126 +  ${jprt.make.rule.test.targets.standard.wbapi}
   7.127  
   7.128  jprt.make.rule.test.targets.embedded = \
   7.129    ${jprt.make.rule.test.targets.standard.client}
     8.1 --- a/make/linux/makefiles/defs.make	Tue Mar 06 16:32:23 2012 -0800
     8.2 +++ b/make/linux/makefiles/defs.make	Fri Mar 09 08:34:36 2012 -0800
     8.3 @@ -1,5 +1,5 @@
     8.4  #
     8.5 -# Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
     8.6 +# Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
     8.7  # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     8.8  #
     8.9  # This code is free software; you can redistribute it and/or modify it
    8.10 @@ -193,6 +193,8 @@
    8.11  EXPORT_SERVER_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/server
    8.12  EXPORT_CLIENT_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/client
    8.13  
    8.14 +EXPORT_LIST += $(EXPORT_JRE_LIB_DIR)/wb.jar
    8.15 +
    8.16  ifndef BUILD_CLIENT_ONLY
    8.17  EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt
    8.18  EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.$(LIBRARY_SUFFIX)
     9.1 --- a/make/linux/makefiles/vm.make	Tue Mar 06 16:32:23 2012 -0800
     9.2 +++ b/make/linux/makefiles/vm.make	Fri Mar 09 08:34:36 2012 -0800
     9.3 @@ -1,5 +1,5 @@
     9.4  #
     9.5 -# Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
     9.6 +# Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
     9.7  # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     9.8  #
     9.9  # This code is free software; you can redistribute it and/or modify it
    9.10 @@ -368,9 +368,12 @@
    9.11  # Serviceability agent
    9.12  include $(MAKEFILES_DIR)/saproc.make
    9.13  
    9.14 +# Whitebox testing API
    9.15 +include $(MAKEFILES_DIR)/wb.make
    9.16 +
    9.17  #----------------------------------------------------------------------
    9.18  
    9.19 -build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) $(BUILDLIBSAPROC)
    9.20 +build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) $(BUILDLIBSAPROC) $(WB_JAR)
    9.21  
    9.22  install: install_jvm install_jsig install_saproc
    9.23  
    10.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.2 +++ b/make/linux/makefiles/wb.make	Fri Mar 09 08:34:36 2012 -0800
    10.3 @@ -0,0 +1,46 @@
    10.4 +#
    10.5 +# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
    10.6 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    10.7 +#
    10.8 +# This code is free software; you can redistribute it and/or modify it
    10.9 +# under the terms of the GNU General Public License version 2 only, as
   10.10 +# published by the Free Software Foundation.
   10.11 +#
   10.12 +# This code is distributed in the hope that it will be useful, but WITHOUT
   10.13 +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   10.14 +# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   10.15 +# version 2 for more details (a copy is included in the LICENSE file that
   10.16 +# accompanied this code).
   10.17 +#
   10.18 +# You should have received a copy of the GNU General Public License version
   10.19 +# 2 along with this work; if not, write to the Free Software Foundation,
   10.20 +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   10.21 +#
   10.22 +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   10.23 +# or visit www.oracle.com if you need additional information or have any
   10.24 +# questions.
   10.25 +#  
   10.26 +#
   10.27 +
   10.28 +# Rules to build whitebox testing library, used by vm.make
   10.29 +WB = wb
   10.30 +
   10.31 +WBSRCDIR = $(GAMMADIR)/src/share/tools/whitebox
   10.32 +
   10.33 +WB_JAR = $(GENERATED)/$(WB).jar
   10.34 +
   10.35 +WB_JAVA_SRCS = $(shell find $(WBSRCDIR) -name '*.java')
   10.36 +WB_JAVA_CLASSDIR = $(GENERATED)/wb/classes
   10.37 +
   10.38 +WB_JAVA_CLASSES  = $(patsubst $(WBSRCDIR)/%,$(WB_JAVA_CLASSDIR)/%, \
   10.39 +	$(patsubst %.java,%.class,$(WB_JAVA_SRCS)))
   10.40 +
   10.41 +$(WB_JAVA_CLASSDIR)/%.class: $(WBSRCDIR)/%.java $(WB_JAVA_CLASSDIR)
   10.42 +	$(REMOTE) $(COMPILE.JAVAC) -nowarn -d $(WB_JAVA_CLASSDIR) $<
   10.43 +
   10.44 +$(WB_JAR): $(WB_JAVA_CLASSES)
   10.45 +	$(QUIETLY) $(REMOTE) $(RUN.JAR) cf $@ -C $(WB_JAVA_CLASSDIR)/ .
   10.46 +
   10.47 +$(WB_JAVA_CLASSDIR):
   10.48 +	$(QUIETLY) mkdir -p $@
   10.49 +
    11.1 --- a/make/solaris/makefiles/defs.make	Tue Mar 06 16:32:23 2012 -0800
    11.2 +++ b/make/solaris/makefiles/defs.make	Fri Mar 09 08:34:36 2012 -0800
    11.3 @@ -1,5 +1,5 @@
    11.4  #
    11.5 -# Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
    11.6 +# Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
    11.7  # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    11.8  #
    11.9  # This code is free software; you can redistribute it and/or modify it
   11.10 @@ -148,6 +148,8 @@
   11.11    EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.debuginfo
   11.12  endif
   11.13  
   11.14 +EXPORT_LIST += $(EXPORT_JRE_LIB_DIR)/wb.jar
   11.15 +
   11.16  EXPORT_SERVER_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/server
   11.17  EXPORT_CLIENT_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/client
   11.18  
    12.1 --- a/make/solaris/makefiles/vm.make	Tue Mar 06 16:32:23 2012 -0800
    12.2 +++ b/make/solaris/makefiles/vm.make	Fri Mar 09 08:34:36 2012 -0800
    12.3 @@ -1,5 +1,5 @@
    12.4  #
    12.5 -# Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
    12.6 +# Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
    12.7  # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    12.8  #
    12.9  # This code is free software; you can redistribute it and/or modify it
   12.10 @@ -321,9 +321,12 @@
   12.11  # Serviceability agent
   12.12  include $(MAKEFILES_DIR)/saproc.make
   12.13  
   12.14 +# Whitebox testing API
   12.15 +include $(MAKEFILES_DIR)/wb.make
   12.16 +
   12.17  #----------------------------------------------------------------------
   12.18  
   12.19 -build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) $(LIBJVM_DTRACE) $(BUILDLIBSAPROC) dtraceCheck
   12.20 +build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) $(LIBJVM_DTRACE) $(BUILDLIBSAPROC) dtraceCheck $(WB_JAR)
   12.21  
   12.22  install: install_jvm install_jsig install_saproc
   12.23  
    13.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.2 +++ b/make/solaris/makefiles/wb.make	Fri Mar 09 08:34:36 2012 -0800
    13.3 @@ -0,0 +1,46 @@
    13.4 +#
    13.5 +# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
    13.6 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    13.7 +#
    13.8 +# This code is free software; you can redistribute it and/or modify it
    13.9 +# under the terms of the GNU General Public License version 2 only, as
   13.10 +# published by the Free Software Foundation.
   13.11 +#
   13.12 +# This code is distributed in the hope that it will be useful, but WITHOUT
   13.13 +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   13.14 +# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   13.15 +# version 2 for more details (a copy is included in the LICENSE file that
   13.16 +# accompanied this code).
   13.17 +#
   13.18 +# You should have received a copy of the GNU General Public License version
   13.19 +# 2 along with this work; if not, write to the Free Software Foundation,
   13.20 +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   13.21 +#
   13.22 +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   13.23 +# or visit www.oracle.com if you need additional information or have any
   13.24 +# questions.
   13.25 +#
   13.26 +
   13.27 +# Rules to build whitebox testing library, used by vm.make
   13.28 +
   13.29 +WB = wb
   13.30 +
   13.31 +WBSRCDIR = $(GAMMADIR)/src/share/tools/whitebox
   13.32 +
   13.33 +WB_JAR = $(GENERATED)/$(WB).jar
   13.34 +
   13.35 +WB_JAVA_SRCS = $(shell find $(WBSRCDIR) -name '*.java')
   13.36 +WB_JAVA_CLASSDIR = $(GENERATED)/wb/classes
   13.37 +
   13.38 +WB_JAVA_CLASSES  = $(patsubst $(WBSRCDIR)/%,$(WB_JAVA_CLASSDIR)/%, \
   13.39 +	$(patsubst %.java,%.class,$(WB_JAVA_SRCS)))
   13.40 +
   13.41 +$(WB_JAVA_CLASSDIR)/%.class: $(WBSRCDIR)/%.java $(WB_JAVA_CLASSDIR)
   13.42 +	$(REMOTE) $(COMPILE.JAVAC) -nowarn -d $(WB_JAVA_CLASSDIR) $<
   13.43 +
   13.44 +$(WB_JAR): $(WB_JAVA_CLASSES)
   13.45 +	$(QUIETLY) $(REMOTE) $(RUN.JAR) cf $@ -C $(WB_JAVA_CLASSDIR)/ .
   13.46 +
   13.47 +$(WB_JAVA_CLASSDIR):
   13.48 +	$(QUIETLY) mkdir -p $@
   13.49 +
    14.1 --- a/make/windows/makefiles/debug.make	Tue Mar 06 16:32:23 2012 -0800
    14.2 +++ b/make/windows/makefiles/debug.make	Fri Mar 09 08:34:36 2012 -0800
    14.3 @@ -1,5 +1,5 @@
    14.4  #
    14.5 -# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
    14.6 +# Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
    14.7  # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    14.8  #
    14.9  # This code is free software; you can redistribute it and/or modify it
   14.10 @@ -33,7 +33,7 @@
   14.11  BUILD_PCH_FILE=_build_pch_file.obj
   14.12  !endif
   14.13  
   14.14 -default:: $(BUILD_PCH_FILE) $(AOUT) launcher checkAndBuildSA
   14.15 +default:: $(BUILD_PCH_FILE) $(AOUT) launcher checkAndBuildSA wb
   14.16  
   14.17  !include ../local.make
   14.18  !include compile.make
   14.19 @@ -65,3 +65,4 @@
   14.20  !include $(WorkSpace)/make/windows/makefiles/shared.make
   14.21  !include $(WorkSpace)/make/windows/makefiles/sa.make
   14.22  !include $(WorkSpace)/make/windows/makefiles/launcher.make
   14.23 +!include $(WorkSpace)/make/windows/makefiles/wb.make
    15.1 --- a/make/windows/makefiles/defs.make	Tue Mar 06 16:32:23 2012 -0800
    15.2 +++ b/make/windows/makefiles/defs.make	Fri Mar 09 08:34:36 2012 -0800
    15.3 @@ -1,5 +1,5 @@
    15.4  #
    15.5 -# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
    15.6 +# Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
    15.7  # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    15.8  #
    15.9  # This code is free software; you can redistribute it and/or modify it
   15.10 @@ -194,6 +194,8 @@
   15.11    EXPORT_LIST += $(EXPORT_KERNEL_DIR)/jvm.map
   15.12  endif
   15.13  
   15.14 +EXPORT_LIST += $(EXPORT_JRE_LIB_DIR)/wb.jar
   15.15 +
   15.16  ifeq ($(BUILD_WIN_SA), 1)
   15.17    EXPORT_LIST += $(EXPORT_JRE_BIN_DIR)/sawindbg.$(LIBRARY_SUFFIX)
   15.18    EXPORT_LIST += $(EXPORT_JRE_BIN_DIR)/sawindbg.pdb
    16.1 --- a/make/windows/makefiles/fastdebug.make	Tue Mar 06 16:32:23 2012 -0800
    16.2 +++ b/make/windows/makefiles/fastdebug.make	Fri Mar 09 08:34:36 2012 -0800
    16.3 @@ -1,5 +1,5 @@
    16.4  #
    16.5 -# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
    16.6 +# Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
    16.7  # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    16.8  #
    16.9  # This code is free software; you can redistribute it and/or modify it
   16.10 @@ -33,7 +33,7 @@
   16.11  BUILD_PCH_FILE=_build_pch_file.obj
   16.12  !endif
   16.13  
   16.14 -default:: $(BUILD_PCH_FILE) $(AOUT) launcher checkAndBuildSA
   16.15 +default:: $(BUILD_PCH_FILE) $(AOUT) launcher checkAndBuildSA wb
   16.16  
   16.17  !include ../local.make
   16.18  !include compile.make
   16.19 @@ -65,3 +65,4 @@
   16.20  !include $(WorkSpace)/make/windows/makefiles/shared.make
   16.21  !include $(WorkSpace)/make/windows/makefiles/sa.make
   16.22  !include $(WorkSpace)/make/windows/makefiles/launcher.make
   16.23 +!include $(WorkSpace)/make/windows/makefiles/wb.make
    17.1 --- a/make/windows/makefiles/product.make	Tue Mar 06 16:32:23 2012 -0800
    17.2 +++ b/make/windows/makefiles/product.make	Fri Mar 09 08:34:36 2012 -0800
    17.3 @@ -1,5 +1,5 @@
    17.4  #
    17.5 -# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
    17.6 +# Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
    17.7  # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    17.8  #
    17.9  # This code is free software; you can redistribute it and/or modify it
   17.10 @@ -32,7 +32,7 @@
   17.11  BUILD_PCH_FILE=_build_pch_file.obj
   17.12  !endif
   17.13  
   17.14 -default:: $(BUILD_PCH_FILE) $(AOUT) launcher checkAndBuildSA
   17.15 +default:: $(BUILD_PCH_FILE) $(AOUT) launcher checkAndBuildSA wb
   17.16  
   17.17  !include ../local.make
   17.18  !include compile.make
   17.19 @@ -76,3 +76,4 @@
   17.20  !include $(WorkSpace)/make/windows/makefiles/shared.make
   17.21  !include $(WorkSpace)/make/windows/makefiles/sa.make
   17.22  !include $(WorkSpace)/make/windows/makefiles/launcher.make
   17.23 +!include $(WorkSpace)/make/windows/makefiles/wb.make
    18.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.2 +++ b/make/windows/makefiles/wb.make	Fri Mar 09 08:34:36 2012 -0800
    18.3 @@ -0,0 +1,54 @@
    18.4 +#
    18.5 +# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
    18.6 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    18.7 +#
    18.8 +# This code is free software; you can redistribute it and/or modify it
    18.9 +# under the terms of the GNU General Public License version 2 only, as
   18.10 +# published by the Free Software Foundation.
   18.11 +#
   18.12 +# This code is distributed in the hope that it will be useful, but WITHOUT
   18.13 +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   18.14 +# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   18.15 +# version 2 for more details (a copy is included in the LICENSE file that
   18.16 +# accompanied this code).
   18.17 +#
   18.18 +# You should have received a copy of the GNU General Public License version
   18.19 +# 2 along with this work; if not, write to the Free Software Foundation,
   18.20 +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   18.21 +#
   18.22 +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   18.23 +# or visit www.oracle.com if you need additional information or have any
   18.24 +# questions.
   18.25 +#  
   18.26 +#
   18.27 +
   18.28 +# This makefile is used to build the whitebox testing lib
   18.29 +# and compile the tests which use it
   18.30 +
   18.31 +!include $(WorkSpace)/make/windows/makefiles/rules.make
   18.32 +
   18.33 +WBSRCDIR = $(WorkSpace)/src/share/tools/whitebox
   18.34 +
   18.35 +# turn GENERATED into a windows path to get sane dependencies
   18.36 +WB_CLASSES=$(GENERATED:/=\)\wb\classes
   18.37 +WB_JAR=$(GENERATED:/=\)\wb.jar
   18.38 +
   18.39 +# call recursive make to do wildcard expansion
   18.40 +.SUFFIXES : .java .class
   18.41 +wb_java_srcs: $(WorkSpace)\src\share\tools\whitebox\sun\hotspot\*.java $(WB_CLASSES)
   18.42 +	$(MAKE) -f $(WorkSpace)\make\windows\makefiles\$(BUILD_FLAVOR).make $(**:.java=.class)
   18.43 +
   18.44 +
   18.45 +{$(WorkSpace)\src\share\tools\whitebox\sun\hotspot}.java.class::
   18.46 +	$(COMPILE_JAVAC) -d $(WB_CLASSES) $<
   18.47 +
   18.48 +$(WB_JAR): wb_java_srcs
   18.49 +	$(RUN_JAR) cf $@ -C $(WB_CLASSES) .
   18.50 +
   18.51 +# turn $@ to a unix path because mkdir in PATH is cygwin/mks mkdir
   18.52 +$(WB_CLASSES):
   18.53 +	mkdir -p $(@:\=/)
   18.54 +
   18.55 +# main target to build wb
   18.56 +wb: $(WB_JAR)
   18.57 +
    19.1 --- a/src/cpu/sparc/vm/assembler_sparc.hpp	Tue Mar 06 16:32:23 2012 -0800
    19.2 +++ b/src/cpu/sparc/vm/assembler_sparc.hpp	Fri Mar 09 08:34:36 2012 -0800
    19.3 @@ -2221,7 +2221,7 @@
    19.4    // traps as per trap.h (SPARC ABI?)
    19.5  
    19.6    void breakpoint_trap();
    19.7 -  void breakpoint_trap(Condition c, CC cc = icc);
    19.8 +  void breakpoint_trap(Condition c, CC cc);
    19.9    void flush_windows_trap();
   19.10    void clean_windows_trap();
   19.11    void get_psr_trap();
    20.1 --- a/src/cpu/sparc/vm/cppInterpreter_sparc.cpp	Tue Mar 06 16:32:23 2012 -0800
    20.2 +++ b/src/cpu/sparc/vm/cppInterpreter_sparc.cpp	Fri Mar 09 08:34:36 2012 -0800
    20.3 @@ -1187,7 +1187,7 @@
    20.4  
    20.5    #ifdef ASSERT
    20.6      __ tst(O1);
    20.7 -    __ breakpoint_trap(Assembler::zero);
    20.8 +    __ breakpoint_trap(Assembler::zero, Assembler::ptr_cc);
    20.9    #endif // ASSERT
   20.10  
   20.11      const int entry_size            = frame::interpreter_frame_monitor_size() * wordSize;
    21.1 --- a/src/cpu/sparc/vm/sharedRuntime_sparc.cpp	Tue Mar 06 16:32:23 2012 -0800
    21.2 +++ b/src/cpu/sparc/vm/sharedRuntime_sparc.cpp	Fri Mar 09 08:34:36 2012 -0800
    21.3 @@ -3325,7 +3325,7 @@
    21.4    // make sure that the frames are aligned properly
    21.5  #ifndef _LP64
    21.6    __ btst(wordSize*2-1, SP);
    21.7 -  __ breakpoint_trap(Assembler::notZero);
    21.8 +  __ breakpoint_trap(Assembler::notZero, Assembler::ptr_cc);
    21.9  #endif
   21.10    #endif
   21.11  
   21.12 @@ -3407,7 +3407,7 @@
   21.13  #ifdef ASSERT
   21.14    // make sure that there is at least one entry in the array
   21.15    __ tst(O4array_size);
   21.16 -  __ breakpoint_trap(Assembler::zero);
   21.17 +  __ breakpoint_trap(Assembler::zero, Assembler::icc);
   21.18  #endif
   21.19  
   21.20    // Now push the new interpreter frames
    22.1 --- a/src/cpu/sparc/vm/templateInterpreter_sparc.cpp	Tue Mar 06 16:32:23 2012 -0800
    22.2 +++ b/src/cpu/sparc/vm/templateInterpreter_sparc.cpp	Fri Mar 09 08:34:36 2012 -0800
    22.3 @@ -379,7 +379,7 @@
    22.4  
    22.5  #ifdef ASSERT
    22.6      __ tst(O0);
    22.7 -    __ breakpoint_trap(Assembler::zero);
    22.8 +    __ breakpoint_trap(Assembler::zero, Assembler::ptr_cc);
    22.9  #endif // ASSERT
   22.10  
   22.11      __ bind(done);
   22.12 @@ -2050,7 +2050,7 @@
   22.13    AddressLiteral stop_at(&StopInterpreterAt);
   22.14    __ load_ptr_contents(stop_at, G4_scratch);
   22.15    __ cmp(G3_scratch, G4_scratch);
   22.16 -  __ breakpoint_trap(Assembler::equal);
   22.17 +  __ breakpoint_trap(Assembler::equal, Assembler::icc);
   22.18  }
   22.19  #endif // not PRODUCT
   22.20  #endif // !CC_INTERP
    23.1 --- a/src/os/linux/vm/os_linux.cpp	Tue Mar 06 16:32:23 2012 -0800
    23.2 +++ b/src/os/linux/vm/os_linux.cpp	Fri Mar 09 08:34:36 2012 -0800
    23.3 @@ -4690,14 +4690,12 @@
    23.4                       char *addr, size_t bytes, bool read_only,
    23.5                       bool allow_exec) {
    23.6    int prot;
    23.7 -  int flags;
    23.8 +  int flags = MAP_PRIVATE;
    23.9  
   23.10    if (read_only) {
   23.11      prot = PROT_READ;
   23.12 -    flags = MAP_SHARED;
   23.13    } else {
   23.14      prot = PROT_READ | PROT_WRITE;
   23.15 -    flags = MAP_PRIVATE;
   23.16    }
   23.17  
   23.18    if (allow_exec) {
    24.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    24.2 +++ b/src/share/tools/whitebox/sun/hotspot/WhiteBox.java	Fri Mar 09 08:34:36 2012 -0800
    24.3 @@ -0,0 +1,70 @@
    24.4 +/*
    24.5 + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
    24.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    24.7 + *
    24.8 + * This code is free software; you can redistribute it and/or modify it
    24.9 + * under the terms of the GNU General Public License version 2 only, as
   24.10 + * published by the Free Software Foundation.
   24.11 + *
   24.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   24.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   24.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   24.15 + * version 2 for more details (a copy is included in the LICENSE file that
   24.16 + * accompanied this code).
   24.17 + *
   24.18 + * You should have received a copy of the GNU General Public License version
   24.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   24.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   24.21 + *
   24.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   24.23 + * or visit www.oracle.com if you need additional information or have any
   24.24 + * questions.
   24.25 + *
   24.26 + */
   24.27 +
   24.28 +package sun.hotspot;
   24.29 +import java.security.BasicPermission;
   24.30 +
   24.31 +public class WhiteBox {
   24.32 +
   24.33 +  @SuppressWarnings("serial")
   24.34 +  public static class WhiteBoxPermission extends BasicPermission {
   24.35 +    public WhiteBoxPermission(String s) {
   24.36 +      super(s);
   24.37 +    }
   24.38 +  }
   24.39 +
   24.40 +  private WhiteBox() {}
   24.41 +  private static final WhiteBox instance = new WhiteBox();
   24.42 +  private static native void registerNatives();
   24.43 +
   24.44 +  /**
   24.45 +   * Returns the singleton WhiteBox instance.
   24.46 +   *
   24.47 +   * The returned WhiteBox object should be carefully guarded
   24.48 +   * by the caller, since it can be used to read and write data
   24.49 +   * at arbitrary memory addresses. It must never be passed to
   24.50 +   * untrusted code.
   24.51 +   */
   24.52 +  public synchronized static WhiteBox getWhiteBox() {
   24.53 +    SecurityManager sm = System.getSecurityManager();
   24.54 +    if (sm != null) {
   24.55 +      sm.checkPermission(new WhiteBoxPermission("getInstance"));
   24.56 +    }
   24.57 +    return instance;
   24.58 +  }
   24.59 +
   24.60 +  static {
   24.61 +    registerNatives();
   24.62 +  }
   24.63 +
   24.64 +  // Memory
   24.65 +  public native long getObjectAddress(Object o);
   24.66 +  public native int  getHeapOopSize();
   24.67 +
   24.68 +  // G1
   24.69 +  public native boolean g1InConcurrentMark();
   24.70 +  public native boolean g1IsHumongous(Object o);
   24.71 +  public native long    g1NumFreeRegions();
   24.72 +  public native int     g1RegionSize();
   24.73 +}
    25.1 --- a/src/share/vm/gc_implementation/g1/g1MonitoringSupport.cpp	Tue Mar 06 16:32:23 2012 -0800
    25.2 +++ b/src/share/vm/gc_implementation/g1/g1MonitoringSupport.cpp	Fri Mar 09 08:34:36 2012 -0800
    25.3 @@ -1,5 +1,5 @@
    25.4  /*
    25.5 - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
    25.6 + * Copyright (c) 2011, 2012 Oracle and/or its affiliates. All rights reserved.
    25.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    25.8   *
    25.9   * This code is free software; you can redistribute it and/or modify it
   25.10 @@ -44,7 +44,9 @@
   25.11                 G1MonitoringSupport::pad_capacity(0, 3) /* min_capacity */,
   25.12                 G1MonitoringSupport::pad_capacity(g1mm->young_gen_max(), 3),
   25.13                 G1MonitoringSupport::pad_capacity(0, 3) /* curr_capacity */) {
   25.14 -  update_all();
   25.15 +  if (UsePerfData) {
   25.16 +    update_all();
   25.17 +  }
   25.18  }
   25.19  
   25.20  G1OldGenerationCounters::G1OldGenerationCounters(G1MonitoringSupport* g1mm,
   25.21 @@ -53,7 +55,9 @@
   25.22                 G1MonitoringSupport::pad_capacity(0) /* min_capacity */,
   25.23                 G1MonitoringSupport::pad_capacity(g1mm->old_gen_max()),
   25.24                 G1MonitoringSupport::pad_capacity(0) /* curr_capacity */) {
   25.25 -  update_all();
   25.26 +  if (UsePerfData) {
   25.27 +    update_all();
   25.28 +  }
   25.29  }
   25.30  
   25.31  void G1YoungGenerationCounters::update_all() {
   25.32 @@ -149,10 +153,6 @@
   25.33      pad_capacity(0) /* max_capacity */,
   25.34      pad_capacity(0) /* init_capacity */,
   25.35      _young_collection_counters);
   25.36 -  // Given that this survivor space is not used, we update it here
   25.37 -  // once to reflect that its used space is 0 so that we don't have to
   25.38 -  // worry about updating it again later.
   25.39 -  _from_counters->update_used(0);
   25.40  
   25.41    //  name "generation.0.space.2"
   25.42    // See _old_space_counters for additional counters
   25.43 @@ -160,6 +160,13 @@
   25.44      pad_capacity(overall_reserved()) /* max_capacity */,
   25.45      pad_capacity(survivor_space_committed()) /* init_capacity */,
   25.46      _young_collection_counters);
   25.47 +
   25.48 +  if (UsePerfData) {
   25.49 +    // Given that this survivor space is not used, we update it here
   25.50 +    // once to reflect that its used space is 0 so that we don't have to
   25.51 +    // worry about updating it again later.
   25.52 +    _from_counters->update_used(0);
   25.53 +  }
   25.54  }
   25.55  
   25.56  void G1MonitoringSupport::recalculate_sizes() {
    26.1 --- a/src/share/vm/prims/jvmtiClassFileReconstituter.cpp	Tue Mar 06 16:32:23 2012 -0800
    26.2 +++ b/src/share/vm/prims/jvmtiClassFileReconstituter.cpp	Fri Mar 09 08:34:36 2012 -0800
    26.3 @@ -1,5 +1,5 @@
    26.4  /*
    26.5 - * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
    26.6 + * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
    26.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    26.8   *
    26.9   * This code is free software; you can redistribute it and/or modify it
   26.10 @@ -727,8 +727,11 @@
   26.11        case Bytecodes::_invokestatic    :  // fall through
   26.12        case Bytecodes::_invokedynamic   :  // fall through
   26.13        case Bytecodes::_invokeinterface :
   26.14 -        assert(len == 3 || (code == Bytecodes::_invokeinterface && len ==5),
   26.15 +        assert(len == 3 ||
   26.16 +               (code == Bytecodes::_invokeinterface && len == 5) ||
   26.17 +               (code == Bytecodes::_invokedynamic   && len == 5),
   26.18                 "sanity check");
   26.19 +
   26.20          int cpci = Bytes::get_native_u2(bcp+1);
   26.21          bool is_invokedynamic = (EnableInvokeDynamic && code == Bytecodes::_invokedynamic);
   26.22          if (is_invokedynamic)
    27.1 --- a/src/share/vm/prims/nativeLookup.cpp	Tue Mar 06 16:32:23 2012 -0800
    27.2 +++ b/src/share/vm/prims/nativeLookup.cpp	Fri Mar 09 08:34:36 2012 -0800
    27.3 @@ -121,6 +121,7 @@
    27.4    void JNICALL JVM_RegisterUnsafeMethods(JNIEnv *env, jclass unsafecls);
    27.5    void JNICALL JVM_RegisterMethodHandleMethods(JNIEnv *env, jclass unsafecls);
    27.6    void JNICALL JVM_RegisterPerfMethods(JNIEnv *env, jclass perfclass);
    27.7 +  void JNICALL JVM_RegisterWhiteBoxMethods(JNIEnv *env, jclass wbclass);
    27.8  }
    27.9  
   27.10  #define CC (char*)  /* cast a literal from (const char*) */
   27.11 @@ -133,7 +134,8 @@
   27.12  
   27.13    { CC"Java_sun_misc_Unsafe_registerNatives",                      NULL, FN_PTR(JVM_RegisterUnsafeMethods)       },
   27.14    { CC"Java_java_lang_invoke_MethodHandleNatives_registerNatives", NULL, FN_PTR(JVM_RegisterMethodHandleMethods) },
   27.15 -  { CC"Java_sun_misc_Perf_registerNatives",                        NULL, FN_PTR(JVM_RegisterPerfMethods)         }
   27.16 +  { CC"Java_sun_misc_Perf_registerNatives",                        NULL, FN_PTR(JVM_RegisterPerfMethods)         },
   27.17 +  { CC"Java_sun_hotspot_WhiteBox_registerNatives",                 NULL, FN_PTR(JVM_RegisterWhiteBoxMethods)     },
   27.18  };
   27.19  
   27.20  static address lookup_special_native(char* jni_name) {
    28.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    28.2 +++ b/src/share/vm/prims/whitebox.cpp	Fri Mar 09 08:34:36 2012 -0800
    28.3 @@ -0,0 +1,114 @@
    28.4 +/*
    28.5 + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
    28.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    28.7 + *
    28.8 + * This code is free software; you can redistribute it and/or modify it
    28.9 + * under the terms of the GNU General Public License version 2 only, as
   28.10 + * published by the Free Software Foundation.
   28.11 + *
   28.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   28.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   28.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   28.15 + * version 2 for more details (a copy is included in the LICENSE file that
   28.16 + * accompanied this code).
   28.17 + *
   28.18 + * You should have received a copy of the GNU General Public License version
   28.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   28.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   28.21 + *
   28.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   28.23 + * or visit www.oracle.com if you need additional information or have any
   28.24 + * questions.
   28.25 + *
   28.26 + */
   28.27 +
   28.28 +#include "precompiled.hpp"
   28.29 +
   28.30 +#include "jni.h"
   28.31 +
   28.32 +#include "memory/universe.hpp"
   28.33 +#include "oops/oop.inline.hpp"
   28.34 +#include "prims/whitebox.hpp"
   28.35 +#include "runtime/interfaceSupport.hpp"
   28.36 +#include "runtime/os.hpp"
   28.37 +#include "utilities/debug.hpp"
   28.38 +
   28.39 +#ifndef SERIALGC
   28.40 +#include "gc_implementation/g1/concurrentMark.hpp"
   28.41 +#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
   28.42 +#include "gc_implementation/g1/heapRegionRemSet.hpp"
   28.43 +#endif // !SERIALGC
   28.44 +
   28.45 +bool WhiteBox::_used = false;
   28.46 +
   28.47 +// Entry macro to transition from JNI to VM state.
   28.48 +
   28.49 +#define WB_ENTRY(result_type, header) JNI_ENTRY(result_type, header)
   28.50 +#define WB_END JNI_END
   28.51 +
   28.52 +// Definitions of functions exposed via Whitebox API
   28.53 +
   28.54 +WB_ENTRY(jlong, WB_GetObjectAddress(JNIEnv* env, jobject o, jobject obj))
   28.55 +  return (jlong)(void*)JNIHandles::resolve(obj);
   28.56 +WB_END
   28.57 +
   28.58 +WB_ENTRY(jint, WB_GetHeapOopSize(JNIEnv* env, jobject o))
   28.59 +  return heapOopSize;
   28.60 +WB_END
   28.61 +
   28.62 +#ifndef SERIALGC
   28.63 +WB_ENTRY(jboolean, WB_G1IsHumongous(JNIEnv* env, jobject o, jobject obj))
   28.64 +  G1CollectedHeap* g1 = G1CollectedHeap::heap();
   28.65 +  oop result = JNIHandles::resolve(obj);
   28.66 +  const HeapRegion* hr = g1->heap_region_containing(result);
   28.67 +  return hr->isHumongous();
   28.68 +WB_END
   28.69 +
   28.70 +WB_ENTRY(jlong, WB_G1NumFreeRegions(JNIEnv* env, jobject o))
   28.71 +  G1CollectedHeap* g1 = G1CollectedHeap::heap();
   28.72 +  size_t nr = g1->free_regions();
   28.73 +  return (jlong)nr;
   28.74 +WB_END
   28.75 +
   28.76 +WB_ENTRY(jboolean, WB_G1InConcurrentMark(JNIEnv* env, jobject o))
   28.77 +  G1CollectedHeap* g1 = G1CollectedHeap::heap();
   28.78 +  ConcurrentMark* cm = g1->concurrent_mark();
   28.79 +  return cm->concurrent_marking_in_progress();
   28.80 +WB_END
   28.81 +
   28.82 +WB_ENTRY(jint, WB_G1RegionSize(JNIEnv* env, jobject o))
   28.83 +  return (jint)HeapRegion::GrainBytes;
   28.84 +WB_END
   28.85 +#endif // !SERIALGC
   28.86 +
   28.87 +#define CC (char*)
   28.88 +
   28.89 +static JNINativeMethod methods[] = {
   28.90 +  {CC"getObjectAddress",   CC"(Ljava/lang/Object;)J", (void*)&WB_GetObjectAddress  },
   28.91 +  {CC"getHeapOopSize",     CC"()I",                   (void*)&WB_GetHeapOopSize    },
   28.92 +#ifndef SERIALGC
   28.93 +  {CC"g1InConcurrentMark", CC"()Z",                   (void*)&WB_G1InConcurrentMark},
   28.94 +  {CC"g1IsHumongous",      CC"(Ljava/lang/Object;)Z", (void*)&WB_G1IsHumongous     },
   28.95 +  {CC"g1NumFreeRegions",   CC"()J",                   (void*)&WB_G1NumFreeRegions  },
   28.96 +  {CC"g1RegionSize",       CC"()I",                   (void*)&WB_G1RegionSize      },
   28.97 +#endif // !SERIALGC
   28.98 +};
   28.99 +
  28.100 +#undef CC
  28.101 +
  28.102 +JVM_ENTRY(void, JVM_RegisterWhiteBoxMethods(JNIEnv* env, jclass wbclass))
  28.103 +  {
  28.104 +    if (WhiteBoxAPI) {
  28.105 +      // Make sure that wbclass is loaded by the null classloader
  28.106 +      instanceKlassHandle ikh = instanceKlassHandle(JNIHandles::resolve(wbclass)->klass());
  28.107 +      Handle loader(ikh->class_loader());
  28.108 +      if (loader.is_null()) {
  28.109 +        ThreadToNativeFromVM ttnfv(thread); // can't be in VM when we call JNI
  28.110 +        jint result = env->RegisterNatives(wbclass, methods, sizeof(methods)/sizeof(methods[0]));
  28.111 +        if (result == 0) {
  28.112 +          WhiteBox::set_used();
  28.113 +        }
  28.114 +      }
  28.115 +    }
  28.116 +  }
  28.117 +JVM_END
    29.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    29.2 +++ b/src/share/vm/prims/whitebox.hpp	Fri Mar 09 08:34:36 2012 -0800
    29.3 @@ -0,0 +1,36 @@
    29.4 +/*
    29.5 + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
    29.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    29.7 + *
    29.8 + * This code is free software; you can redistribute it and/or modify it
    29.9 + * under the terms of the GNU General Public License version 2 only, as
   29.10 + * published by the Free Software Foundation.
   29.11 + *
   29.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   29.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   29.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   29.15 + * version 2 for more details (a copy is included in the LICENSE file that
   29.16 + * accompanied this code).
   29.17 + *
   29.18 + * You should have received a copy of the GNU General Public License version
   29.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   29.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   29.21 + *
   29.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   29.23 + * or visit www.oracle.com if you need additional information or have any
   29.24 + * questions.
   29.25 + *
   29.26 + */
   29.27 +
   29.28 +#ifndef SHARE_VM_PRIMS_WHITEBOX_HPP
   29.29 +#define SHARE_VM_PRIMS_WHITEBOX_HPP
   29.30 +
   29.31 +class WhiteBox : public AllStatic {
   29.32 + private:
   29.33 +  static bool _used;
   29.34 + public:
   29.35 +  static bool used()     { return _used; }
   29.36 +  static void set_used() { _used = true; }
   29.37 +};
   29.38 +
   29.39 +#endif // SHARE_VM_PRIMS_WHITEBOX_HPP
    30.1 --- a/src/share/vm/runtime/arguments.cpp	Tue Mar 06 16:32:23 2012 -0800
    30.2 +++ b/src/share/vm/runtime/arguments.cpp	Fri Mar 09 08:34:36 2012 -0800
    30.3 @@ -2050,6 +2050,19 @@
    30.4      FREE_C_HEAP_ARRAY(char, altclasses_path);
    30.5    }
    30.6  
    30.7 +  if (WhiteBoxAPI) {
    30.8 +    // Append wb.jar to bootclasspath if enabled
    30.9 +    const char* wb_jar = "wb.jar";
   30.10 +    size_t wb_path_len = strlen(get_meta_index_dir()) + 1 +
   30.11 +                         strlen(wb_jar);
   30.12 +    char* wb_path = NEW_C_HEAP_ARRAY(char, wb_path_len);
   30.13 +    strcpy(wb_path, get_meta_index_dir());
   30.14 +    strcat(wb_path, wb_jar);
   30.15 +    scp.add_suffix(wb_path);
   30.16 +    scp_assembly_required = true;
   30.17 +    FREE_C_HEAP_ARRAY(char, wb_path);
   30.18 +  }
   30.19 +
   30.20    // Parse _JAVA_OPTIONS environment variable (if present) (mimics classic VM)
   30.21    result = parse_java_options_environment_variable(&scp, &scp_assembly_required);
   30.22    if (result != JNI_OK) {
    31.1 --- a/src/share/vm/runtime/globals.hpp	Tue Mar 06 16:32:23 2012 -0800
    31.2 +++ b/src/share/vm/runtime/globals.hpp	Fri Mar 09 08:34:36 2012 -0800
    31.3 @@ -3896,7 +3896,10 @@
    31.4    product(bool, UseVMInterruptibleIO, false,                                \
    31.5            "(Unstable, Solaris-specific) Thread interrupt before or with "   \
    31.6            "EINTR for I/O operations results in OS_INTRPT. The default value"\
    31.7 -          " of this flag is true for JDK 6 and earlier")
    31.8 +          " of this flag is true for JDK 6 and earlier")                    \
    31.9 +                                                                            \
   31.10 +  diagnostic(bool, WhiteBoxAPI, false,                                      \
   31.11 +          "Enable internal testing APIs")
   31.12  
   31.13  /*
   31.14   *  Macros for factoring of globals
    32.1 --- a/src/share/vm/utilities/vmError.cpp	Tue Mar 06 16:32:23 2012 -0800
    32.2 +++ b/src/share/vm/utilities/vmError.cpp	Fri Mar 09 08:34:36 2012 -0800
    32.3 @@ -25,6 +25,7 @@
    32.4  #include "precompiled.hpp"
    32.5  #include "compiler/compileBroker.hpp"
    32.6  #include "gc_interface/collectedHeap.hpp"
    32.7 +#include "prims/whitebox.hpp"
    32.8  #include "runtime/arguments.hpp"
    32.9  #include "runtime/frame.inline.hpp"
   32.10  #include "runtime/init.hpp"
   32.11 @@ -717,6 +718,13 @@
   32.12         st->cr();
   32.13       }
   32.14  
   32.15 +  STEP(215, "(printing warning if internal testing API used)" )
   32.16 +
   32.17 +     if (WhiteBox::used()) {
   32.18 +       st->print_cr("Unsupported internal testing APIs have been used.");
   32.19 +       st->cr();
   32.20 +     }
   32.21 +
   32.22    STEP(220, "(printing environment variables)" )
   32.23  
   32.24       if (_verbose) {
    33.1 --- a/test/Makefile	Tue Mar 06 16:32:23 2012 -0800
    33.2 +++ b/test/Makefile	Fri Mar 09 08:34:36 2012 -0800
    33.3 @@ -1,5 +1,5 @@
    33.4  #
    33.5 -# Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
    33.6 +# Copyright (c) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
    33.7  # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    33.8  #
    33.9  # This code is free software; you can redistribute it and/or modify it
   33.10 @@ -228,6 +228,24 @@
   33.11  
   33.12  ################################################################
   33.13  
   33.14 +# wbapitest (make sure the whitebox testing api classes work
   33.15 +
   33.16 +wbapitest: prep $(JT_HOME) $(PRODUCT_HOME) $(JTREG)
   33.17 +	$(JTREG) -a -v:fail,error               \
   33.18 +          $(JTREG_KEY_OPTION)                   \
   33.19 +          $(EXTRA_JTREG_OPTIONS)                \
   33.20 +          -r:$(ABS_TEST_OUTPUT_DIR)/JTreport    \
   33.21 +          -w:$(ABS_TEST_OUTPUT_DIR)/JTwork      \
   33.22 +          -jdk:$(PRODUCT_HOME)                  \
   33.23 +          $(JAVA_OPTIONS:%=-vmoption:%)         \
   33.24 +          $(TEST_ROOT)/sanity                   \
   33.25 +	  || $(BUNDLE_UP_FAILED)
   33.26 +	$(BUNDLE_UP)
   33.27 +
   33.28 +PHONY_LIST += wbapitest
   33.29 +
   33.30 +################################################################
   33.31 +
   33.32  # packtest
   33.33  
   33.34  # Expect JPRT to set JPRT_PACKTEST_HOME.
    34.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    34.2 +++ b/test/sanity/WBApi.java	Fri Mar 09 08:34:36 2012 -0800
    34.3 @@ -0,0 +1,13 @@
    34.4 +/*
    34.5 + * @test WBApi
    34.6 + * @summary verify that whitebox functions can be linked and executed
    34.7 + * @run compile -J-XX:+UnlockDiagnosticVMOptions -J-XX:+WhiteBoxAPI WBApi.java
    34.8 + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI WBApi
    34.9 + */
   34.10 +
   34.11 +import sun.hotspot.WhiteBox;
   34.12 +public class WBApi {
   34.13 +    public static void main(String... args) {
   34.14 +        System.out.printf("args at: %x\n",WhiteBox.getWhiteBox().getObjectAddress(args));
   34.15 +    }
   34.16 +}

mercurial