Merge jdk8u45-b01

Fri, 12 Dec 2014 14:39:40 -0800

author
asaha
date
Fri, 12 Dec 2014 14:39:40 -0800
changeset 7717
41c3c456e326
parent 7716
d6a05415f1f4
parent 7497
4b41145051ab
child 7718
01850e3a5b06

Merge

.hgtags file | annotate | diff | comparison | revisions
make/hotspot_version file | annotate | diff | comparison | revisions
make/jprt.properties file | annotate | diff | comparison | revisions
src/share/vm/code/dependencies.cpp file | annotate | diff | comparison | revisions
src/share/vm/oops/instanceKlass.cpp file | annotate | diff | comparison | revisions
src/share/vm/oops/instanceKlass.hpp file | annotate | diff | comparison | revisions
src/share/vm/runtime/arguments.cpp file | annotate | diff | comparison | revisions
     1.1 --- a/.hgtags	Mon Dec 01 19:09:54 2014 -0800
     1.2 +++ b/.hgtags	Fri Dec 12 14:39:40 2014 -0800
     1.3 @@ -571,4 +571,8 @@
     1.4  3a8a0fd171c5876023112941b1c7254262f9adfc hs25.40-b19
     1.5  aa2442f89230dc46147c721812f3b3bd4c612e83 hs25.40-b20
     1.6  5ea68fb91139081304357f9b937f32c5fdfeca6d jdk8u40-b16
     1.7 +6bf89bfe8185747a57193efb6cec1f17ccc80414 hs25.40-b21
     1.8 +fc1f9b67fd8c5d5cd94ecc03569d93e7ce7fb574 jdk8u40-b17
     1.9 +bc5a90a4db47f1c497d7894434c42325f595cd02 hs25.40-b22
    1.10 +31d3306aad29e39929418ed43f28212a5f5306a3 jdk8u40-b18
    1.11  b95f13f05f553309cd74d6ccf8fcedb259c6716c jdk8u45-b00
     2.1 --- a/make/aix/makefiles/adjust-mflags.sh	Mon Dec 01 19:09:54 2014 -0800
     2.2 +++ b/make/aix/makefiles/adjust-mflags.sh	Fri Dec 12 14:39:40 2014 -0800
     2.3 @@ -1,6 +1,6 @@
     2.4  #! /bin/sh
     2.5  #
     2.6 -# Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
     2.7 +# Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
     2.8  # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     2.9  #
    2.10  # This code is free software; you can redistribute it and/or modify it
    2.11 @@ -64,7 +64,7 @@
    2.12  	echo "$MFLAGS" \
    2.13  	| sed '
    2.14  		s/^-/ -/
    2.15 -		s/ -\([^ 	][^ 	]*\)j/ -\1 -j/
    2.16 +		s/ -\([^ 	I][^ 	I]*\)j/ -\1 -j/
    2.17  		s/ -j[0-9][0-9]*/ -j/
    2.18  		s/ -j\([^ 	]\)/ -j -\1/
    2.19  		s/ -j/ -j'${HOTSPOT_BUILD_JOBS:-${default_build_jobs}}'/
     3.1 --- a/make/bsd/makefiles/adjust-mflags.sh	Mon Dec 01 19:09:54 2014 -0800
     3.2 +++ b/make/bsd/makefiles/adjust-mflags.sh	Fri Dec 12 14:39:40 2014 -0800
     3.3 @@ -64,7 +64,7 @@
     3.4  	echo "$MFLAGS" \
     3.5  	| sed '
     3.6  		s/^-/ -/
     3.7 -		s/ -\([^ 	][^ 	]*\)j/ -\1 -j/
     3.8 +		s/ -\([^ 	I][^ 	I]*\)j/ -\1 -j/
     3.9  		s/ -j[0-9][0-9]*/ -j/
    3.10  		s/ -j\([^ 	]\)/ -j -\1/
    3.11  		s/ -j/ -j'${HOTSPOT_BUILD_JOBS:-${default_build_jobs}}'/
     4.1 --- a/make/jprt.properties	Mon Dec 01 19:09:54 2014 -0800
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,407 +0,0 @@
     4.4 -#
     4.5 -# Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
     4.6 -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4.7 -#
     4.8 -# This code is free software; you can redistribute it and/or modify it
     4.9 -# under the terms of the GNU General Public License version 2 only, as
    4.10 -# published by the Free Software Foundation.
    4.11 -#
    4.12 -# This code is distributed in the hope that it will be useful, but WITHOUT
    4.13 -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    4.14 -# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    4.15 -# version 2 for more details (a copy is included in the LICENSE file that
    4.16 -# accompanied this code).
    4.17 -#
    4.18 -# You should have received a copy of the GNU General Public License version
    4.19 -# 2 along with this work; if not, write to the Free Software Foundation,
    4.20 -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    4.21 -#
    4.22 -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    4.23 -# or visit www.oracle.com if you need additional information or have any
    4.24 -# questions.
    4.25 -#
    4.26 -#
    4.27 -
    4.28 -# Properties for jprt
    4.29 -
    4.30 -# All build result bundles are full jdks.
    4.31 -jprt.need.sibling.build=false
    4.32 -
    4.33 -# At submit time, the release supplied will be in jprt.submit.release
    4.34 -#    and will be one of the official release names defined in jprt.
    4.35 -#    jprt supports property value expansion using ${property.name} syntax.
    4.36 -
    4.37 -# This tells jprt what default release we want to build
    4.38 -
    4.39 -jprt.hotspot.default.release=jdk8u40
    4.40 -
    4.41 -jprt.tools.default.release=${jprt.submit.option.release?${jprt.submit.option.release}:${jprt.hotspot.default.release}}
    4.42 -
    4.43 -# Disable syncing the source after builds and tests are done.
    4.44 -
    4.45 -jprt.sync.push=false
    4.46 -
    4.47 -# Note: we want both embedded releases and regular releases to build and test
    4.48 -#       all platforms so that regressions are not introduced (eg. change to
    4.49 -#       common code by SE breaks PPC/ARM; change to common code by SE-E breaks
    4.50 -#       sparc etc.
    4.51 -
    4.52 -# Define the Solaris platforms we want for the various releases
    4.53 -jprt.my.solaris.sparcv9.jdk8u40=solaris_sparcv9_5.10
    4.54 -jprt.my.solaris.sparcv9.jdk7=solaris_sparcv9_5.10
    4.55 -jprt.my.solaris.sparcv9.jdk7u8=${jprt.my.solaris.sparcv9.jdk7}
    4.56 -jprt.my.solaris.sparcv9=${jprt.my.solaris.sparcv9.${jprt.tools.default.release}}
    4.57 -
    4.58 -jprt.my.solaris.x64.jdk8u40=solaris_x64_5.10
    4.59 -jprt.my.solaris.x64.jdk7=solaris_x64_5.10
    4.60 -jprt.my.solaris.x64.jdk7u8=${jprt.my.solaris.x64.jdk7}
    4.61 -jprt.my.solaris.x64=${jprt.my.solaris.x64.${jprt.tools.default.release}}
    4.62 -
    4.63 -jprt.my.linux.i586.jdk8u40=linux_i586_2.6
    4.64 -jprt.my.linux.i586.jdk7=linux_i586_2.6
    4.65 -jprt.my.linux.i586.jdk7u8=${jprt.my.linux.i586.jdk7}
    4.66 -jprt.my.linux.i586=${jprt.my.linux.i586.${jprt.tools.default.release}}
    4.67 -
    4.68 -jprt.my.linux.x64.jdk8u40=linux_x64_2.6
    4.69 -jprt.my.linux.x64.jdk7=linux_x64_2.6
    4.70 -jprt.my.linux.x64.jdk7u8=${jprt.my.linux.x64.jdk7}
    4.71 -jprt.my.linux.x64=${jprt.my.linux.x64.${jprt.tools.default.release}}
    4.72 -
    4.73 -jprt.my.linux.ppc.jdk8u40=linux_ppc_2.6
    4.74 -jprt.my.linux.ppc.jdk7=linux_ppc_2.6
    4.75 -jprt.my.linux.ppc.jdk7u8=${jprt.my.linux.ppc.jdk7}
    4.76 -jprt.my.linux.ppc=${jprt.my.linux.ppc.${jprt.tools.default.release}}
    4.77 -
    4.78 -jprt.my.linux.ppcv2.jdk8u40=linux_ppcv2_2.6
    4.79 -jprt.my.linux.ppcv2.jdk7=linux_ppcv2_2.6
    4.80 -jprt.my.linux.ppcv2.jdk7u8=${jprt.my.linux.ppcv2.jdk7}
    4.81 -jprt.my.linux.ppcv2=${jprt.my.linux.ppcv2.${jprt.tools.default.release}}
    4.82 -
    4.83 -jprt.my.linux.armvfpsflt.jdk8u40=linux_armvfpsflt_2.6
    4.84 -jprt.my.linux.armvfpsflt=${jprt.my.linux.armvfpsflt.${jprt.tools.default.release}}
    4.85 -
    4.86 -jprt.my.linux.armvfphflt.jdk8u40=linux_armvfphflt_2.6
    4.87 -jprt.my.linux.armvfphflt=${jprt.my.linux.armvfphflt.${jprt.tools.default.release}}
    4.88 -
    4.89 -# The ARM GP vfp-sflt build is not currently supported
    4.90 -#jprt.my.linux.armvs.jdk8u40=linux_armvs_2.6
    4.91 -#jprt.my.linux.armvs=${jprt.my.linux.armvs.${jprt.tools.default.release}}
    4.92 -
    4.93 -jprt.my.linux.armvh.jdk8u40=linux_armvh_2.6
    4.94 -jprt.my.linux.armvh=${jprt.my.linux.armvh.${jprt.tools.default.release}}
    4.95 -
    4.96 -jprt.my.linux.armsflt.jdk8u40=linux_armsflt_2.6
    4.97 -jprt.my.linux.armsflt.jdk7=linux_armsflt_2.6
    4.98 -jprt.my.linux.armsflt.jdk7u8=${jprt.my.linux.armsflt.jdk7}
    4.99 -jprt.my.linux.armsflt=${jprt.my.linux.armsflt.${jprt.tools.default.release}}
   4.100 -
   4.101 -jprt.my.macosx.x64.jdk8u40=macosx_x64_10.7
   4.102 -jprt.my.macosx.x64.jdk7=macosx_x64_10.7
   4.103 -jprt.my.macosx.x64.jdk7u8=${jprt.my.macosx.x64.jdk7}
   4.104 -jprt.my.macosx.x64=${jprt.my.macosx.x64.${jprt.tools.default.release}}
   4.105 -
   4.106 -jprt.my.windows.i586.jdk8u40=windows_i586_6.1
   4.107 -jprt.my.windows.i586.jdk7=windows_i586_6.1
   4.108 -jprt.my.windows.i586.jdk7u8=${jprt.my.windows.i586.jdk7}
   4.109 -jprt.my.windows.i586=${jprt.my.windows.i586.${jprt.tools.default.release}}
   4.110 -
   4.111 -jprt.my.windows.x64.jdk8u40=windows_x64_6.1
   4.112 -jprt.my.windows.x64.jdk7=windows_x64_6.1
   4.113 -jprt.my.windows.x64.jdk7u8=${jprt.my.windows.x64.jdk7}
   4.114 -jprt.my.windows.x64=${jprt.my.windows.x64.${jprt.tools.default.release}}
   4.115 -
   4.116 -# Standard list of jprt build targets for this source tree
   4.117 -
   4.118 -jprt.build.targets.standard= \
   4.119 -    ${jprt.my.solaris.sparcv9}-{product|fastdebug}, \
   4.120 -    ${jprt.my.solaris.x64}-{product|fastdebug}, \
   4.121 -    ${jprt.my.linux.i586}-{product|fastdebug}, \
   4.122 -    ${jprt.my.linux.x64}-{product|fastdebug}, \
   4.123 -    ${jprt.my.macosx.x64}-{product|fastdebug}, \
   4.124 -    ${jprt.my.windows.i586}-{product|fastdebug}, \
   4.125 -    ${jprt.my.windows.x64}-{product|fastdebug}, \
   4.126 -    ${jprt.my.linux.armvh}-{product|fastdebug}
   4.127 -
   4.128 -jprt.build.targets.open= \
   4.129 -    ${jprt.my.solaris.x64}-{debugOpen}, \
   4.130 -    ${jprt.my.linux.x64}-{productOpen}
   4.131 -
   4.132 -jprt.build.targets.embedded= \
   4.133 -    ${jprt.my.linux.i586}-{productEmb|fastdebugEmb}, \
   4.134 -    ${jprt.my.linux.ppc}-{productEmb|fastdebugEmb}, \
   4.135 -    ${jprt.my.linux.ppcv2}-{productEmb|fastdebugEmb}, \
   4.136 -    ${jprt.my.linux.armvfpsflt}-{productEmb|fastdebugEmb}, \
   4.137 -    ${jprt.my.linux.armvfphflt}-{productEmb|fastdebugEmb}, \
   4.138 -    ${jprt.my.linux.armsflt}-{productEmb|fastdebugEmb}
   4.139 -
   4.140 -jprt.build.targets.all=${jprt.build.targets.standard}, \
   4.141 -    ${jprt.build.targets.embedded}, ${jprt.build.targets.open}
   4.142 -
   4.143 -jprt.build.targets.jdk8u40=${jprt.build.targets.all}
   4.144 -jprt.build.targets.jdk7=${jprt.build.targets.all}
   4.145 -jprt.build.targets.jdk7u8=${jprt.build.targets.all}
   4.146 -jprt.build.targets=${jprt.build.targets.${jprt.tools.default.release}}
   4.147 -
   4.148 -# Subset lists of test targets for this source tree
   4.149 -
   4.150 -jprt.my.solaris.sparcv9.test.targets= \
   4.151 -    ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-jvm98, \
   4.152 -    ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-jvm98_nontiered, \
   4.153 -    ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-scimark, \
   4.154 -    ${jprt.my.solaris.sparcv9}-product-c2-runThese, \
   4.155 -    ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCBasher_SerialGC, \
   4.156 -    ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCBasher_ParallelGC, \
   4.157 -    ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCBasher_ParNewGC, \
   4.158 -    ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCBasher_CMS, \
   4.159 -    ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCBasher_G1, \
   4.160 -    ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCBasher_ParOldGC, \
   4.161 -    ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCOld_SerialGC, \
   4.162 -    ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCOld_ParallelGC, \
   4.163 -    ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCOld_ParNewGC, \
   4.164 -    ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCOld_CMS, \
   4.165 -    ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCOld_G1, \
   4.166 -    ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCOld_ParOldGC, \
   4.167 -    ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-jbb_default_nontiered, \
   4.168 -    ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-jbb_SerialGC, \
   4.169 -    ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-jbb_ParallelGC, \
   4.170 -    ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-jbb_CMS, \
   4.171 -    ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-jbb_G1, \
   4.172 -    ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-jbb_ParOldGC
   4.173 -
   4.174 -jprt.my.solaris.x64.test.targets= \
   4.175 -    ${jprt.my.solaris.x64}-{product|fastdebug}-c2-jvm98, \
   4.176 -    ${jprt.my.solaris.x64}-{product|fastdebug}-c2-jvm98_nontiered, \
   4.177 -    ${jprt.my.solaris.x64}-{product|fastdebug}-c2-scimark, \
   4.178 -    ${jprt.my.solaris.x64}-product-c2-runThese, \
   4.179 -    ${jprt.my.solaris.x64}-product-c2-runThese_Xcomp, \
   4.180 -    ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCBasher_SerialGC, \
   4.181 -    ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCBasher_ParallelGC, \
   4.182 -    ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCBasher_ParNewGC, \
   4.183 -    ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCBasher_CMS, \
   4.184 -    ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCBasher_G1, \
   4.185 -    ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCBasher_ParOldGC, \
   4.186 -    ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCOld_SerialGC, \
   4.187 -    ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCOld_ParallelGC, \
   4.188 -    ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCOld_ParNewGC, \
   4.189 -    ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCOld_CMS, \
   4.190 -    ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCOld_G1, \
   4.191 -    ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCOld_ParOldGC, \
   4.192 -    ${jprt.my.solaris.x64}-{product|fastdebug}-c2-jbb_default_nontiered, \
   4.193 -    ${jprt.my.solaris.x64}-{product|fastdebug}-c2-jbb_SerialGC, \
   4.194 -    ${jprt.my.solaris.x64}-{product|fastdebug}-c2-jbb_ParallelGC, \
   4.195 -    ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCOld_CMS, \
   4.196 -    ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCOld_G1, \
   4.197 -    ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCOld_ParOldGC
   4.198 -
   4.199 -jprt.my.linux.i586.test.targets = \
   4.200 -    ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-jvm98, \
   4.201 -    ${jprt.my.linux.i586}-{product|fastdebug}-c2-jvm98_nontiered, \
   4.202 -    ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-scimark, \
   4.203 -    ${jprt.my.linux.i586}-product-c1-runThese_Xcomp, \
   4.204 -    ${jprt.my.linux.i586}-fastdebug-c1-runThese_Xshare, \
   4.205 -    ${jprt.my.linux.i586}-fastdebug-c2-runThese_Xcomp, \
   4.206 -    ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-GCBasher_SerialGC, \
   4.207 -    ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-GCBasher_ParallelGC, \
   4.208 -    ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-GCBasher_ParNewGC, \
   4.209 -    ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-GCBasher_CMS, \
   4.210 -    ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-GCBasher_G1, \
   4.211 -    ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-GCBasher_ParOldGC, \
   4.212 -    ${jprt.my.linux.i586}-product-{c1|c2}-GCOld_SerialGC, \
   4.213 -    ${jprt.my.linux.i586}-product-{c1|c2}-GCOld_ParallelGC, \
   4.214 -    ${jprt.my.linux.i586}-product-{c1|c2}-GCOld_ParNewGC, \
   4.215 -    ${jprt.my.linux.i586}-product-{c1|c2}-GCOld_CMS, \
   4.216 -    ${jprt.my.linux.i586}-product-{c1|c2}-GCOld_G1, \
   4.217 -    ${jprt.my.linux.i586}-product-{c1|c2}-GCOld_ParOldGC, \
   4.218 -    ${jprt.my.linux.i586}-{product|fastdebug}-c1-jbb_SerialGC, \
   4.219 -    ${jprt.my.linux.i586}-{product|fastdebug}-c2-jbb_default_nontiered, \
   4.220 -    ${jprt.my.linux.i586}-{product|fastdebug}-c1-jbb_ParallelGC, \
   4.221 -    ${jprt.my.linux.i586}-{product|fastdebug}-c1-jbb_CMS, \
   4.222 -    ${jprt.my.linux.i586}-{product|fastdebug}-c1-jbb_G1, \
   4.223 -    ${jprt.my.linux.i586}-{product|fastdebug}-c1-jbb_ParOldGC
   4.224 -
   4.225 -jprt.my.linux.x64.test.targets = \
   4.226 -    ${jprt.my.linux.x64}-{product|fastdebug}-c2-jvm98, \
   4.227 -    ${jprt.my.linux.x64}-{product|fastdebug}-c2-jvm98_nontiered, \
   4.228 -    ${jprt.my.linux.x64}-{product|fastdebug}-c2-scimark, \
   4.229 -    ${jprt.my.linux.x64}-{product|fastdebug}-c2-GCBasher_SerialGC, \
   4.230 -    ${jprt.my.linux.x64}-{product|fastdebug}-c2-GCBasher_ParallelGC, \
   4.231 -    ${jprt.my.linux.x64}-{product|fastdebug}-c2-GCBasher_ParNewGC, \
   4.232 -    ${jprt.my.linux.x64}-{product|fastdebug}-c2-GCBasher_CMS, \
   4.233 -    ${jprt.my.linux.x64}-{product|fastdebug}-c2-GCBasher_G1, \
   4.234 -    ${jprt.my.linux.x64}-{product|fastdebug}-c2-GCBasher_ParOldGC, \
   4.235 -    ${jprt.my.linux.x64}-{product|fastdebug}-c2-GCOld_SerialGC, \
   4.236 -    ${jprt.my.linux.x64}-{product|fastdebug}-c2-GCOld_ParallelGC, \
   4.237 -    ${jprt.my.linux.x64}-{product|fastdebug}-c2-GCOld_ParNewGC, \
   4.238 -    ${jprt.my.linux.x64}-{product|fastdebug}-c2-GCOld_CMS, \
   4.239 -    ${jprt.my.linux.x64}-{product|fastdebug}-c2-GCOld_G1, \
   4.240 -    ${jprt.my.linux.x64}-{product|fastdebug}-c2-GCOld_ParOldGC, \
   4.241 -    ${jprt.my.linux.x64}-{product|fastdebug}-c2-jbb_default_nontiered, \
   4.242 -    ${jprt.my.linux.x64}-{product|fastdebug}-c2-jbb_ParallelGC, \
   4.243 -    ${jprt.my.linux.x64}-{product|fastdebug}-c2-jbb_G1, \
   4.244 -    ${jprt.my.linux.x64}-{product|fastdebug}-c2-jbb_ParOldGC
   4.245 -
   4.246 -jprt.my.macosx.x64.test.targets = \
   4.247 -    ${jprt.my.macosx.x64}-{product|fastdebug}-c2-jvm98, \
   4.248 -    ${jprt.my.macosx.x64}-{product|fastdebug}-c2-jvm98_nontiered, \
   4.249 -    ${jprt.my.macosx.x64}-{product|fastdebug}-c2-scimark, \
   4.250 -    ${jprt.my.macosx.x64}-{product|fastdebug}-c2-GCBasher_SerialGC, \
   4.251 -    ${jprt.my.macosx.x64}-{product|fastdebug}-c2-GCBasher_ParallelGC, \
   4.252 -    ${jprt.my.macosx.x64}-{product|fastdebug}-c2-GCBasher_ParNewGC, \
   4.253 -    ${jprt.my.macosx.x64}-{product|fastdebug}-c2-GCBasher_CMS, \
   4.254 -    ${jprt.my.macosx.x64}-{product|fastdebug}-c2-GCBasher_G1, \
   4.255 -    ${jprt.my.macosx.x64}-{product|fastdebug}-c2-GCBasher_ParOldGC, \
   4.256 -    ${jprt.my.macosx.x64}-{product|fastdebug}-c2-GCOld_SerialGC, \
   4.257 -    ${jprt.my.macosx.x64}-{product|fastdebug}-c2-GCOld_ParallelGC, \
   4.258 -    ${jprt.my.macosx.x64}-{product|fastdebug}-c2-GCOld_ParNewGC, \
   4.259 -    ${jprt.my.macosx.x64}-{product|fastdebug}-c2-GCOld_CMS, \
   4.260 -    ${jprt.my.macosx.x64}-{product|fastdebug}-c2-GCOld_G1, \
   4.261 -    ${jprt.my.macosx.x64}-{product|fastdebug}-c2-GCOld_ParOldGC, \
   4.262 -    ${jprt.my.macosx.x64}-{product|fastdebug}-c2-jbb_default_nontiered, \
   4.263 -    ${jprt.my.macosx.x64}-{product|fastdebug}-c2-jbb_ParallelGC, \
   4.264 -    ${jprt.my.macosx.x64}-{product|fastdebug}-c2-jbb_G1, \
   4.265 -    ${jprt.my.macosx.x64}-{product|fastdebug}-c2-jbb_ParOldGC
   4.266 -
   4.267 -jprt.my.windows.i586.test.targets = \
   4.268 -    ${jprt.my.windows.i586}-{product|fastdebug}-{c1|c2}-jvm98, \
   4.269 -    ${jprt.my.windows.i586}-{product|fastdebug}-c2-jvm98_nontiered, \
   4.270 -    ${jprt.my.windows.i586}-{product|fastdebug}-{c1|c2}-scimark, \
   4.271 -    ${jprt.my.windows.i586}-product-{c1|c2}-runThese, \
   4.272 -    ${jprt.my.windows.i586}-product-{c1|c2}-runThese_Xcomp, \
   4.273 -    ${jprt.my.windows.i586}-fastdebug-c1-runThese_Xshare, \
   4.274 -    ${jprt.my.windows.i586}-{product|fastdebug}-{c1|c2}-GCBasher_SerialGC, \
   4.275 -    ${jprt.my.windows.i586}-{product|fastdebug}-{c1|c2}-GCBasher_ParallelGC, \
   4.276 -    ${jprt.my.windows.i586}-{product|fastdebug}-{c1|c2}-GCBasher_ParNewGC, \
   4.277 -    ${jprt.my.windows.i586}-{product|fastdebug}-{c1|c2}-GCBasher_CMS, \
   4.278 -    ${jprt.my.windows.i586}-{product|fastdebug}-{c1|c2}-GCBasher_G1, \
   4.279 -    ${jprt.my.windows.i586}-{product|fastdebug}-{c1|c2}-GCBasher_ParOldGC, \
   4.280 -    ${jprt.my.windows.i586}-product-{c1|c2}-GCOld_SerialGC, \
   4.281 -    ${jprt.my.windows.i586}-product-{c1|c2}-GCOld_ParallelGC, \
   4.282 -    ${jprt.my.windows.i586}-product-{c1|c2}-GCOld_ParNewGC, \
   4.283 -    ${jprt.my.windows.i586}-product-{c1|c2}-GCOld_CMS, \
   4.284 -    ${jprt.my.windows.i586}-product-{c1|c2}-GCOld_G1, \
   4.285 -    ${jprt.my.windows.i586}-product-{c1|c2}-GCOld_ParOldGC, \
   4.286 -    ${jprt.my.windows.i586}-{product|fastdebug}-{c1|c2}-jbb_default, \
   4.287 -    ${jprt.my.windows.i586}-{product|fastdebug}-c2-jbb_default_nontiered, \
   4.288 -    ${jprt.my.windows.i586}-product-{c1|c2}-jbb_ParallelGC, \
   4.289 -    ${jprt.my.windows.i586}-product-{c1|c2}-jbb_CMS, \
   4.290 -    ${jprt.my.windows.i586}-product-{c1|c2}-jbb_G1, \
   4.291 -    ${jprt.my.windows.i586}-product-{c1|c2}-jbb_ParOldGC
   4.292 -
   4.293 -jprt.my.windows.x64.test.targets = \
   4.294 -    ${jprt.my.windows.x64}-{product|fastdebug}-c2-jvm98, \
   4.295 -    ${jprt.my.windows.x64}-{product|fastdebug}-c2-jvm98_nontiered, \
   4.296 -    ${jprt.my.windows.x64}-{product|fastdebug}-c2-scimark, \
   4.297 -    ${jprt.my.windows.x64}-product-c2-runThese, \
   4.298 -    ${jprt.my.windows.x64}-product-c2-runThese_Xcomp, \
   4.299 -    ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCBasher_SerialGC, \
   4.300 -    ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCBasher_ParallelGC, \
   4.301 -    ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCBasher_ParNewGC, \
   4.302 -    ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCBasher_CMS, \
   4.303 -    ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCBasher_G1, \
   4.304 -    ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCBasher_ParOldGC, \
   4.305 -    ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCOld_SerialGC, \
   4.306 -    ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCOld_ParallelGC, \
   4.307 -    ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCOld_ParNewGC, \
   4.308 -    ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCOld_CMS, \
   4.309 -    ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCOld_G1, \
   4.310 -    ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCOld_ParOldGC, \
   4.311 -    ${jprt.my.windows.x64}-{product|fastdebug}-c2-jbb_default, \
   4.312 -    ${jprt.my.windows.x64}-{product|fastdebug}-c2-jbb_default_nontiered, \
   4.313 -    ${jprt.my.windows.x64}-product-c2-jbb_CMS, \
   4.314 -    ${jprt.my.windows.x64}-product-c2-jbb_ParallelGC, \
   4.315 -    ${jprt.my.windows.x64}-product-c2-jbb_G1, \
   4.316 -    ${jprt.my.windows.x64}-product-c2-jbb_ParOldGC
   4.317 -
   4.318 -# Some basic "smoke" tests for OpenJDK builds
   4.319 -jprt.test.targets.open = \
   4.320 -    ${jprt.my.solaris.x64}-{productOpen|fastdebugOpen}-c2-jvm98, \
   4.321 -    ${jprt.my.linux.x64}-{productOpen|fastdebugOpen}-c2-jvm98
   4.322 -
   4.323 -# Testing for actual embedded builds is different to standard
   4.324 -jprt.my.linux.i586.test.targets.embedded = \
   4.325 -    linux_i586_2.6-product-c1-scimark
   4.326 -
   4.327 -# The complete list of test targets for jprt
   4.328 -# Note: no PPC or ARM tests at this stage
   4.329 -
   4.330 -jprt.test.targets.standard = \
   4.331 -  ${jprt.my.linux.i586.test.targets.embedded}, \
   4.332 -  ${jprt.my.solaris.sparcv9.test.targets}, \
   4.333 -  ${jprt.my.solaris.x64.test.targets}, \
   4.334 -  ${jprt.my.linux.i586.test.targets}, \
   4.335 -  ${jprt.my.linux.x64.test.targets}, \
   4.336 -  ${jprt.my.macosx.x64.test.targets}, \
   4.337 -  ${jprt.my.windows.i586.test.targets}, \
   4.338 -  ${jprt.my.windows.x64.test.targets}, \
   4.339 -  ${jprt.test.targets.open}
   4.340 -
   4.341 -jprt.test.targets.embedded= 		\
   4.342 -  ${jprt.my.linux.i586.test.targets.embedded}, \
   4.343 -  ${jprt.my.solaris.sparcv9.test.targets}, \
   4.344 -  ${jprt.my.solaris.x64.test.targets}, \
   4.345 -  ${jprt.my.linux.x64.test.targets}, \
   4.346 -  ${jprt.my.windows.i586.test.targets}, \
   4.347 -  ${jprt.my.windows.x64.test.targets}
   4.348 -
   4.349 -jprt.test.targets.jdk8u40=${jprt.test.targets.standard}
   4.350 -jprt.test.targets.jdk7=${jprt.test.targets.standard}
   4.351 -jprt.test.targets.jdk7u8=${jprt.test.targets.jdk7}
   4.352 -jprt.test.targets=${jprt.test.targets.${jprt.tools.default.release}}
   4.353 -
   4.354 -# The default test/Makefile targets that should be run
   4.355 -
   4.356 -#jprt.make.rule.test.targets=*-product-*-packtest
   4.357 -
   4.358 -jprt.make.rule.test.targets.standard.client = \
   4.359 -  ${jprt.my.linux.i586}-*-c1-clienttest, \
   4.360 -  ${jprt.my.windows.i586}-*-c1-clienttest
   4.361 -
   4.362 -jprt.make.rule.test.targets.standard.server = \
   4.363 -  ${jprt.my.solaris.sparcv9}-*-c2-servertest, \
   4.364 -  ${jprt.my.solaris.x64}-*-c2-servertest, \
   4.365 -  ${jprt.my.linux.i586}-*-c2-servertest, \
   4.366 -  ${jprt.my.linux.x64}-*-c2-servertest, \
   4.367 -  ${jprt.my.macosx.x64}-*-c2-servertest, \
   4.368 -  ${jprt.my.windows.i586}-*-c2-servertest, \
   4.369 -  ${jprt.my.windows.x64}-*-c2-servertest
   4.370 -
   4.371 -jprt.make.rule.test.targets.standard.internalvmtests = \
   4.372 -  ${jprt.my.solaris.sparcv9}-fastdebug-c2-internalvmtests, \
   4.373 -  ${jprt.my.solaris.x64}-fastdebug-c2-internalvmtests, \
   4.374 -  ${jprt.my.linux.i586}-fastdebug-c2-internalvmtests, \
   4.375 -  ${jprt.my.linux.x64}-fastdebug-c2-internalvmtests, \
   4.376 -  ${jprt.my.macosx.x64}-fastdebug-c2-internalvmtests, \
   4.377 -  ${jprt.my.windows.i586}-fastdebug-c2-internalvmtests, \
   4.378 -  ${jprt.my.windows.x64}-fastdebug-c2-internalvmtests
   4.379 -
   4.380 -jprt.make.rule.test.targets.standard.reg.group = \
   4.381 -  ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GROUP, \
   4.382 -  ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GROUP, \
   4.383 -  ${jprt.my.linux.i586}-{product|fastdebug}-c2-GROUP, \
   4.384 -  ${jprt.my.linux.x64}-{product|fastdebug}-c2-GROUP, \
   4.385 -  ${jprt.my.windows.i586}-{product|fastdebug}-c2-GROUP, \
   4.386 -  ${jprt.my.windows.x64}-{product|fastdebug}-c2-GROUP, \
   4.387 -  ${jprt.my.linux.i586}-{product|fastdebug}-c1-GROUP, \
   4.388 -  ${jprt.my.windows.i586}-{product|fastdebug}-c1-GROUP
   4.389 -
   4.390 -jprt.make.rule.test.targets.standard = \
   4.391 -  ${jprt.make.rule.test.targets.standard.client}, \
   4.392 -  ${jprt.make.rule.test.targets.standard.server}, \
   4.393 -  ${jprt.make.rule.test.targets.standard.internalvmtests}, \
   4.394 -  ${jprt.make.rule.test.targets.standard.reg.group:GROUP=hotspot_wbapitest}, \
   4.395 -  ${jprt.make.rule.test.targets.standard.reg.group:GROUP=hotspot_compiler}, \
   4.396 -  ${jprt.make.rule.test.targets.standard.reg.group:GROUP=hotspot_gc}, \
   4.397 -  ${jprt.make.rule.test.targets.standard.reg.group:GROUP=hotspot_runtime}, \
   4.398 -  ${jprt.make.rule.test.targets.standard.reg.group:GROUP=hotspot_serviceability}
   4.399 -
   4.400 -jprt.make.rule.test.targets.embedded = \
   4.401 -  ${jprt.make.rule.test.targets.standard.client}
   4.402 -
   4.403 -jprt.make.rule.test.targets.jdk8u40=${jprt.make.rule.test.targets.standard}
   4.404 -jprt.make.rule.test.targets.jdk7=${jprt.make.rule.test.targets.standard}
   4.405 -jprt.make.rule.test.targets.jdk7u8=${jprt.make.rule.test.targets.jdk7}
   4.406 -jprt.make.rule.test.targets=${jprt.make.rule.test.targets.${jprt.tools.default.release}}
   4.407 -
   4.408 -# 7155453: Work-around to prevent popups on OSX from blocking test completion
   4.409 -# but the work-around is added to all platforms to be consistent
   4.410 -jprt.jbb.options=-Djava.awt.headless=true
     5.1 --- a/make/linux/makefiles/adjust-mflags.sh	Mon Dec 01 19:09:54 2014 -0800
     5.2 +++ b/make/linux/makefiles/adjust-mflags.sh	Fri Dec 12 14:39:40 2014 -0800
     5.3 @@ -64,7 +64,7 @@
     5.4  	echo "$MFLAGS" \
     5.5  	| sed '
     5.6  		s/^-/ -/
     5.7 -		s/ -\([^ 	][^ 	]*\)j/ -\1 -j/
     5.8 +		s/ -\([^ 	I][^ 	I]*\)j/ -\1 -j/
     5.9  		s/ -j[0-9][0-9]*/ -j/
    5.10  		s/ -j\([^ 	]\)/ -j -\1/
    5.11  		s/ -j/ -j'${HOTSPOT_BUILD_JOBS:-${default_build_jobs}}'/
     6.1 --- a/make/solaris/makefiles/adjust-mflags.sh	Mon Dec 01 19:09:54 2014 -0800
     6.2 +++ b/make/solaris/makefiles/adjust-mflags.sh	Fri Dec 12 14:39:40 2014 -0800
     6.3 @@ -64,7 +64,7 @@
     6.4  	echo "$MFLAGS" \
     6.5  	| sed '
     6.6  		s/^-/ -/
     6.7 -		s/ -\([^ 	][^ 	]*\)j/ -\1 -j/
     6.8 +		s/ -\([^ 	I][^ 	I]*\)j/ -\1 -j/
     6.9  		s/ -j[0-9][0-9]*/ -j/
    6.10  		s/ -j\([^ 	]\)/ -j -\1/
    6.11  		s/ -j/ -j'${HOTSPOT_BUILD_JOBS:-${default_build_jobs}}'/
     7.1 --- a/src/share/vm/ci/ciMethod.cpp	Mon Dec 01 19:09:54 2014 -0800
     7.2 +++ b/src/share/vm/ci/ciMethod.cpp	Fri Dec 12 14:39:40 2014 -0800
     7.3 @@ -68,7 +68,10 @@
     7.4  // ciMethod::ciMethod
     7.5  //
     7.6  // Loaded method.
     7.7 -ciMethod::ciMethod(methodHandle h_m) : ciMetadata(h_m()) {
     7.8 +ciMethod::ciMethod(methodHandle h_m, ciInstanceKlass* holder) :
     7.9 +  ciMetadata(h_m()),
    7.10 +  _holder(holder)
    7.11 +{
    7.12    assert(h_m() != NULL, "no null method");
    7.13  
    7.14    // These fields are always filled in in loaded methods.
    7.15 @@ -124,7 +127,6 @@
    7.16    // generating _signature may allow GC and therefore move m.
    7.17    // These fields are always filled in.
    7.18    _name = env->get_symbol(h_m()->name());
    7.19 -  _holder = env->get_instance_klass(h_m()->method_holder());
    7.20    ciSymbol* sig_symbol = env->get_symbol(h_m()->signature());
    7.21    constantPoolHandle cpool = h_m()->constants();
    7.22    _signature = new (env->arena()) ciSignature(_holder, cpool, sig_symbol);
     8.1 --- a/src/share/vm/ci/ciMethod.hpp	Mon Dec 01 19:09:54 2014 -0800
     8.2 +++ b/src/share/vm/ci/ciMethod.hpp	Fri Dec 12 14:39:40 2014 -0800
     8.3 @@ -90,7 +90,7 @@
     8.4    BCEscapeAnalyzer*   _bcea;
     8.5  #endif
     8.6  
     8.7 -  ciMethod(methodHandle h_m);
     8.8 +  ciMethod(methodHandle h_m, ciInstanceKlass* holder);
     8.9    ciMethod(ciInstanceKlass* holder, ciSymbol* name, ciSymbol* signature, ciInstanceKlass* accessor);
    8.10  
    8.11    Method* get_Method() const {
     9.1 --- a/src/share/vm/ci/ciObjectFactory.cpp	Mon Dec 01 19:09:54 2014 -0800
     9.2 +++ b/src/share/vm/ci/ciObjectFactory.cpp	Fri Dec 12 14:39:40 2014 -0800
     9.3 @@ -239,7 +239,7 @@
     9.4  ciObject* ciObjectFactory::get(oop key) {
     9.5    ASSERT_IN_VM;
     9.6  
     9.7 -  assert(key == NULL || Universe::heap()->is_in_reserved(key), "must be");
     9.8 +  assert(Universe::heap()->is_in_reserved(key), "must be");
     9.9  
    9.10    NonPermObject* &bucket = find_non_perm(key);
    9.11    if (bucket != NULL) {
    9.12 @@ -260,10 +260,10 @@
    9.13  }
    9.14  
    9.15  // ------------------------------------------------------------------
    9.16 -// ciObjectFactory::get
    9.17 +// ciObjectFactory::get_metadata
    9.18  //
    9.19 -// Get the ciObject corresponding to some oop.  If the ciObject has
    9.20 -// already been created, it is returned.  Otherwise, a new ciObject
    9.21 +// Get the ciMetadata corresponding to some Metadata. If the ciMetadata has
    9.22 +// already been created, it is returned. Otherwise, a new ciMetadata
    9.23  // is created.
    9.24  ciMetadata* ciObjectFactory::get_metadata(Metadata* key) {
    9.25    ASSERT_IN_VM;
    9.26 @@ -290,9 +290,9 @@
    9.27    }
    9.28  #endif
    9.29    if (!is_found_at(index, key, _ci_metadata)) {
    9.30 -    // The ciObject does not yet exist.  Create it and insert it
    9.31 +    // The ciMetadata does not yet exist. Create it and insert it
    9.32      // into the cache.
    9.33 -    ciMetadata* new_object = create_new_object(key);
    9.34 +    ciMetadata* new_object = create_new_metadata(key);
    9.35      init_ident_of(new_object);
    9.36      assert(new_object->is_metadata(), "must be");
    9.37  
    9.38 @@ -344,15 +344,28 @@
    9.39  }
    9.40  
    9.41  // ------------------------------------------------------------------
    9.42 -// ciObjectFactory::create_new_object
    9.43 +// ciObjectFactory::create_new_metadata
    9.44  //
    9.45 -// Create a new ciObject from a Metadata*.
    9.46 +// Create a new ciMetadata from a Metadata*.
    9.47  //
    9.48 -// Implementation note: this functionality could be virtual behavior
    9.49 -// of the oop itself.  For now, we explicitly marshal the object.
    9.50 -ciMetadata* ciObjectFactory::create_new_object(Metadata* o) {
    9.51 +// Implementation note: in order to keep Metadata live, an auxiliary ciObject
    9.52 +// is used, which points to it's holder.
    9.53 +ciMetadata* ciObjectFactory::create_new_metadata(Metadata* o) {
    9.54    EXCEPTION_CONTEXT;
    9.55  
    9.56 +  // Hold metadata from unloading by keeping it's holder alive.
    9.57 +  if (_initialized && o->is_klass()) {
    9.58 +    Klass* holder = ((Klass*)o);
    9.59 +    if (holder->oop_is_instance() && InstanceKlass::cast(holder)->is_anonymous()) {
    9.60 +      // Though ciInstanceKlass records class loader oop, it's not enough to keep
    9.61 +      // VM anonymous classes alive (loader == NULL). Klass holder should be used instead.
    9.62 +      // It is enough to record a ciObject, since cached elements are never removed
    9.63 +      // during ciObjectFactory lifetime. ciObjectFactory itself is created for
    9.64 +      // every compilation and lives for the whole duration of the compilation.
    9.65 +      ciObject* h = get(holder->klass_holder());
    9.66 +    }
    9.67 +  }
    9.68 +
    9.69    if (o->is_klass()) {
    9.70      KlassHandle h_k(THREAD, (Klass*)o);
    9.71      Klass* k = (Klass*)o;
    9.72 @@ -365,14 +378,16 @@
    9.73      }
    9.74    } else if (o->is_method()) {
    9.75      methodHandle h_m(THREAD, (Method*)o);
    9.76 -    return new (arena()) ciMethod(h_m);
    9.77 +    ciEnv *env = CURRENT_THREAD_ENV;
    9.78 +    ciInstanceKlass* holder = env->get_instance_klass(h_m()->method_holder());
    9.79 +    return new (arena()) ciMethod(h_m, holder);
    9.80    } else if (o->is_methodData()) {
    9.81      // Hold methodHandle alive - might not be necessary ???
    9.82      methodHandle h_m(THREAD, ((MethodData*)o)->method());
    9.83      return new (arena()) ciMethodData((MethodData*)o);
    9.84    }
    9.85  
    9.86 -  // The oop is of some type not supported by the compiler interface.
    9.87 +  // The Metadata* is of some type not supported by the compiler interface.
    9.88    ShouldNotReachHere();
    9.89    return NULL;
    9.90  }
    9.91 @@ -701,7 +716,7 @@
    9.92  // If there is no entry in the cache corresponding to this oop, return
    9.93  // the null tail of the bucket into which the oop should be inserted.
    9.94  ciObjectFactory::NonPermObject* &ciObjectFactory::find_non_perm(oop key) {
    9.95 -  assert(Universe::heap()->is_in_reserved_or_null(key), "must be");
    9.96 +  assert(Universe::heap()->is_in_reserved(key), "must be");
    9.97    ciMetadata* klass = get_metadata(key->klass());
    9.98    NonPermObject* *bp = &_non_perm_bucket[(unsigned) klass->hash() % NON_PERM_BUCKETS];
    9.99    for (NonPermObject* p; (p = (*bp)) != NULL; bp = &p->next()) {
    10.1 --- a/src/share/vm/ci/ciObjectFactory.hpp	Mon Dec 01 19:09:54 2014 -0800
    10.2 +++ b/src/share/vm/ci/ciObjectFactory.hpp	Fri Dec 12 14:39:40 2014 -0800
    10.3 @@ -73,7 +73,7 @@
    10.4    void insert(int index, ciMetadata* obj, GrowableArray<ciMetadata*>* objects);
    10.5  
    10.6    ciObject* create_new_object(oop o);
    10.7 -  ciMetadata* create_new_object(Metadata* o);
    10.8 +  ciMetadata* create_new_metadata(Metadata* o);
    10.9  
   10.10    void ensure_metadata_alive(ciMetadata* m);
   10.11  
    11.1 --- a/src/share/vm/ci/ciTypeFlow.cpp	Mon Dec 01 19:09:54 2014 -0800
    11.2 +++ b/src/share/vm/ci/ciTypeFlow.cpp	Fri Dec 12 14:39:40 2014 -0800
    11.3 @@ -35,6 +35,7 @@
    11.4  #include "interpreter/bytecode.hpp"
    11.5  #include "interpreter/bytecodes.hpp"
    11.6  #include "memory/allocation.inline.hpp"
    11.7 +#include "opto/compile.hpp"
    11.8  #include "runtime/deoptimization.hpp"
    11.9  #include "utilities/growableArray.hpp"
   11.10  
   11.11 @@ -2646,7 +2647,7 @@
   11.12        assert (!blk->has_pre_order(), "");
   11.13        blk->set_next_pre_order();
   11.14  
   11.15 -      if (_next_pre_order >= MaxNodeLimit / 2) {
   11.16 +      if (_next_pre_order >= (int)Compile::current()->max_node_limit() / 2) {
   11.17          // Too many basic blocks.  Bail out.
   11.18          // This can happen when try/finally constructs are nested to depth N,
   11.19          // and there is O(2**N) cloning of jsr bodies.  See bug 4697245!
    12.1 --- a/src/share/vm/classfile/classLoaderExt.hpp	Mon Dec 01 19:09:54 2014 -0800
    12.2 +++ b/src/share/vm/classfile/classLoaderExt.hpp	Fri Dec 12 14:39:40 2014 -0800
    12.3 @@ -63,6 +63,9 @@
    12.4                                     ClassPathEntry* new_entry) {
    12.5      ClassLoader::add_to_list(new_entry);
    12.6    }
    12.7 +  static void append_boot_classpath(ClassPathEntry* new_entry) {
    12.8 +    ClassLoader::add_to_list(new_entry);
    12.9 +  }
   12.10    static void setup_search_paths() {}
   12.11  
   12.12    static void init_lookup_cache(TRAPS) {}
    13.1 --- a/src/share/vm/classfile/javaClasses.cpp	Mon Dec 01 19:09:54 2014 -0800
    13.2 +++ b/src/share/vm/classfile/javaClasses.cpp	Fri Dec 12 14:39:40 2014 -0800
    13.3 @@ -41,6 +41,7 @@
    13.4  #include "oops/method.hpp"
    13.5  #include "oops/symbol.hpp"
    13.6  #include "oops/typeArrayOop.hpp"
    13.7 +#include "prims/jvmtiRedefineClassesTrace.hpp"
    13.8  #include "runtime/fieldDescriptor.hpp"
    13.9  #include "runtime/handles.inline.hpp"
   13.10  #include "runtime/interfaceSupport.hpp"
   13.11 @@ -2775,12 +2776,35 @@
   13.12    return (Metadata*)mname->address_field(_vmtarget_offset);
   13.13  }
   13.14  
   13.15 +bool java_lang_invoke_MemberName::is_method(oop mname) {
   13.16 +  assert(is_instance(mname), "must be MemberName");
   13.17 +  return (flags(mname) & (MN_IS_METHOD | MN_IS_CONSTRUCTOR)) > 0;
   13.18 +}
   13.19 +
   13.20  #if INCLUDE_JVMTI
   13.21  // Can be executed on VM thread only
   13.22 -void java_lang_invoke_MemberName::adjust_vmtarget(oop mname, Metadata* ref) {
   13.23 -  assert((is_instance(mname) && (flags(mname) & (MN_IS_METHOD | MN_IS_CONSTRUCTOR)) > 0), "wrong type");
   13.24 +void java_lang_invoke_MemberName::adjust_vmtarget(oop mname, Method* old_method,
   13.25 +                                                  Method* new_method, bool* trace_name_printed) {
   13.26 +  assert(is_method(mname), "wrong type");
   13.27    assert(Thread::current()->is_VM_thread(), "not VM thread");
   13.28 -  mname->address_field_put(_vmtarget_offset, (address)ref);
   13.29 +
   13.30 +  Method* target = (Method*)mname->address_field(_vmtarget_offset);
   13.31 +  if (target == old_method) {
   13.32 +    mname->address_field_put(_vmtarget_offset, (address)new_method);
   13.33 +
   13.34 +    if (RC_TRACE_IN_RANGE(0x00100000, 0x00400000)) {
   13.35 +      if (!(*trace_name_printed)) {
   13.36 +        // RC_TRACE_MESG macro has an embedded ResourceMark
   13.37 +        RC_TRACE_MESG(("adjust: name=%s",
   13.38 +                       old_method->method_holder()->external_name()));
   13.39 +        *trace_name_printed = true;
   13.40 +      }
   13.41 +      // RC_TRACE macro has an embedded ResourceMark
   13.42 +      RC_TRACE(0x00400000, ("MemberName method update: %s(%s)",
   13.43 +                            new_method->name()->as_C_string(),
   13.44 +                            new_method->signature()->as_C_string()));
   13.45 +    }
   13.46 +  }
   13.47  }
   13.48  #endif // INCLUDE_JVMTI
   13.49  
    14.1 --- a/src/share/vm/classfile/javaClasses.hpp	Mon Dec 01 19:09:54 2014 -0800
    14.2 +++ b/src/share/vm/classfile/javaClasses.hpp	Fri Dec 12 14:39:40 2014 -0800
    14.3 @@ -1096,7 +1096,8 @@
    14.4    static Metadata*      vmtarget(oop mname);
    14.5    static void       set_vmtarget(oop mname, Metadata* target);
    14.6  #if INCLUDE_JVMTI
    14.7 -  static void       adjust_vmtarget(oop mname, Metadata* target);
    14.8 +  static void       adjust_vmtarget(oop mname, Method* old_method, Method* new_method,
    14.9 +                                    bool* trace_name_printed);
   14.10  #endif // INCLUDE_JVMTI
   14.11  
   14.12    static intptr_t       vmindex(oop mname);
   14.13 @@ -1110,6 +1111,8 @@
   14.14      return obj != NULL && is_subclass(obj->klass());
   14.15    }
   14.16  
   14.17 +  static bool is_method(oop obj);
   14.18 +
   14.19    // Relevant integer codes (keep these in synch. with MethodHandleNatives.Constants):
   14.20    enum {
   14.21      MN_IS_METHOD            = 0x00010000, // method (not constructor)
    15.1 --- a/src/share/vm/code/dependencies.cpp	Mon Dec 01 19:09:54 2014 -0800
    15.2 +++ b/src/share/vm/code/dependencies.cpp	Fri Dec 12 14:39:40 2014 -0800
    15.3 @@ -879,6 +879,8 @@
    15.4    bool is_witness(Klass* k) {
    15.5      if (doing_subtype_search()) {
    15.6        return Dependencies::is_concrete_klass(k);
    15.7 +    } else if (!k->oop_is_instance()) {
    15.8 +      return false; // no methods to find in an array type
    15.9      } else {
   15.10        // Search class hierarchy first.
   15.11        Method* m = InstanceKlass::cast(k)->find_instance_method(_name, _signature);
   15.12 @@ -1094,7 +1096,7 @@
   15.13    Klass* chain;       // scratch variable
   15.14  #define ADD_SUBCLASS_CHAIN(k)                     {  \
   15.15      assert(chaini < CHAINMAX, "oob");                \
   15.16 -    chain = InstanceKlass::cast(k)->subklass();      \
   15.17 +    chain = k->subklass();                           \
   15.18      if (chain != NULL)  chains[chaini++] = chain;    }
   15.19  
   15.20    // Look for non-abstract subclasses.
   15.21 @@ -1105,35 +1107,37 @@
   15.22    // (Their subclasses are additional indirect implementors.
   15.23    // See InstanceKlass::add_implementor.)
   15.24    // (Note:  nof_implementors is always zero for non-interfaces.)
   15.25 -  int nof_impls = InstanceKlass::cast(context_type)->nof_implementors();
   15.26 -  if (nof_impls > 1) {
   15.27 -    // Avoid this case: *I.m > { A.m, C }; B.m > C
   15.28 -    // Here, I.m has 2 concrete implementations, but m appears unique
   15.29 -    // as A.m, because the search misses B.m when checking C.
   15.30 -    // The inherited method B.m was getting missed by the walker
   15.31 -    // when interface 'I' was the starting point.
   15.32 -    // %%% Until this is fixed more systematically, bail out.
   15.33 -    // (Old CHA had the same limitation.)
   15.34 -    return context_type;
   15.35 -  }
   15.36 -  if (nof_impls > 0) {
   15.37 -    Klass* impl = InstanceKlass::cast(context_type)->implementor();
   15.38 -    assert(impl != NULL, "just checking");
   15.39 -    // If impl is the same as the context_type, then more than one
   15.40 -    // implementor has seen. No exact info in this case.
   15.41 -    if (impl == context_type) {
   15.42 -      return context_type;  // report an inexact witness to this sad affair
   15.43 +  if (top_level_call) {
   15.44 +    int nof_impls = InstanceKlass::cast(context_type)->nof_implementors();
   15.45 +    if (nof_impls > 1) {
   15.46 +      // Avoid this case: *I.m > { A.m, C }; B.m > C
   15.47 +      // Here, I.m has 2 concrete implementations, but m appears unique
   15.48 +      // as A.m, because the search misses B.m when checking C.
   15.49 +      // The inherited method B.m was getting missed by the walker
   15.50 +      // when interface 'I' was the starting point.
   15.51 +      // %%% Until this is fixed more systematically, bail out.
   15.52 +      // (Old CHA had the same limitation.)
   15.53 +      return context_type;
   15.54      }
   15.55 -    if (do_counts)
   15.56 -      { NOT_PRODUCT(deps_find_witness_steps++); }
   15.57 -    if (is_participant(impl)) {
   15.58 -      if (!participants_hide_witnesses) {
   15.59 +    if (nof_impls > 0) {
   15.60 +      Klass* impl = InstanceKlass::cast(context_type)->implementor();
   15.61 +      assert(impl != NULL, "just checking");
   15.62 +      // If impl is the same as the context_type, then more than one
   15.63 +      // implementor has seen. No exact info in this case.
   15.64 +      if (impl == context_type) {
   15.65 +        return context_type;  // report an inexact witness to this sad affair
   15.66 +      }
   15.67 +      if (do_counts)
   15.68 +        { NOT_PRODUCT(deps_find_witness_steps++); }
   15.69 +      if (is_participant(impl)) {
   15.70 +        if (!participants_hide_witnesses) {
   15.71 +          ADD_SUBCLASS_CHAIN(impl);
   15.72 +        }
   15.73 +      } else if (is_witness(impl) && !ignore_witness(impl)) {
   15.74 +        return impl;
   15.75 +      } else {
   15.76          ADD_SUBCLASS_CHAIN(impl);
   15.77        }
   15.78 -    } else if (is_witness(impl) && !ignore_witness(impl)) {
   15.79 -      return impl;
   15.80 -    } else {
   15.81 -      ADD_SUBCLASS_CHAIN(impl);
   15.82      }
   15.83    }
   15.84  
    16.1 --- a/src/share/vm/compiler/compileBroker.cpp	Mon Dec 01 19:09:54 2014 -0800
    16.2 +++ b/src/share/vm/compiler/compileBroker.cpp	Fri Dec 12 14:39:40 2014 -0800
    16.3 @@ -1845,7 +1845,7 @@
    16.4                       os::file_separator(), thread_id, os::current_process_id());
    16.5        }
    16.6  
    16.7 -      fp = fopen(file_name, "at");
    16.8 +      fp = fopen(file_name, "wt");
    16.9        if (fp != NULL) {
   16.10          if (LogCompilation && Verbose) {
   16.11            tty->print_cr("Opening compilation log %s", file_name);
    17.1 --- a/src/share/vm/compiler/compileLog.cpp	Mon Dec 01 19:09:54 2014 -0800
    17.2 +++ b/src/share/vm/compiler/compileLog.cpp	Fri Dec 12 14:39:40 2014 -0800
    17.3 @@ -55,8 +55,10 @@
    17.4  }
    17.5  
    17.6  CompileLog::~CompileLog() {
    17.7 -  delete _out;
    17.8 +  delete _out; // Close fd in fileStream::~fileStream()
    17.9    _out = NULL;
   17.10 +  // Remove partial file after merging in CompileLog::finish_log_on_error
   17.11 +  unlink(_file);
   17.12    FREE_C_HEAP_ARRAY(char, _identities, mtCompiler);
   17.13    FREE_C_HEAP_ARRAY(char, _file, mtCompiler);
   17.14  }
   17.15 @@ -268,10 +270,9 @@
   17.16        }
   17.17        file->print_raw_cr("</compilation_log>");
   17.18        close(partial_fd);
   17.19 -      unlink(partial_file);
   17.20      }
   17.21      CompileLog* next_log = log->_next;
   17.22 -    delete log;
   17.23 +    delete log; // Removes partial file
   17.24      log = next_log;
   17.25    }
   17.26    _first = NULL;
    18.1 --- a/src/share/vm/oops/instanceKlass.cpp	Mon Dec 01 19:09:54 2014 -0800
    18.2 +++ b/src/share/vm/oops/instanceKlass.cpp	Fri Dec 12 14:39:40 2014 -0800
    18.3 @@ -2957,28 +2957,27 @@
    18.4    return NULL;
    18.5  }
    18.6  
    18.7 -void InstanceKlass::add_member_name(int index, Handle mem_name) {
    18.8 +bool InstanceKlass::add_member_name(Handle mem_name) {
    18.9    jweak mem_name_wref = JNIHandles::make_weak_global(mem_name);
   18.10    MutexLocker ml(MemberNameTable_lock);
   18.11 -  assert(0 <= index && index < idnum_allocated_count(), "index is out of bounds");
   18.12    DEBUG_ONLY(No_Safepoint_Verifier nsv);
   18.13  
   18.14 +  // Check if method has been redefined while taking out MemberNameTable_lock, if so
   18.15 +  // return false.  We cannot cache obsolete methods. They will crash when the function
   18.16 +  // is called!
   18.17 +  Method* method = (Method*)java_lang_invoke_MemberName::vmtarget(mem_name());
   18.18 +  if (method->is_obsolete()) {
   18.19 +    return false;
   18.20 +  } else if (method->is_old()) {
   18.21 +    // Replace method with redefined version
   18.22 +    java_lang_invoke_MemberName::set_vmtarget(mem_name(), method_with_idnum(method->method_idnum()));
   18.23 +  }
   18.24 +
   18.25    if (_member_names == NULL) {
   18.26      _member_names = new (ResourceObj::C_HEAP, mtClass) MemberNameTable(idnum_allocated_count());
   18.27    }
   18.28 -  _member_names->add_member_name(index, mem_name_wref);
   18.29 -}
   18.30 -
   18.31 -oop InstanceKlass::get_member_name(int index) {
   18.32 -  MutexLocker ml(MemberNameTable_lock);
   18.33 -  assert(0 <= index && index < idnum_allocated_count(), "index is out of bounds");
   18.34 -  DEBUG_ONLY(No_Safepoint_Verifier nsv);
   18.35 -
   18.36 -  if (_member_names == NULL) {
   18.37 -    return NULL;
   18.38 -  }
   18.39 -  oop mem_name =_member_names->get_member_name(index);
   18.40 -  return mem_name;
   18.41 +  _member_names->add_member_name(mem_name_wref);
   18.42 +  return true;
   18.43  }
   18.44  
   18.45  // -----------------------------------------------------------------------------------------------------
    19.1 --- a/src/share/vm/oops/instanceKlass.hpp	Mon Dec 01 19:09:54 2014 -0800
    19.2 +++ b/src/share/vm/oops/instanceKlass.hpp	Fri Dec 12 14:39:40 2014 -0800
    19.3 @@ -1097,8 +1097,7 @@
    19.4    // JSR-292 support
    19.5    MemberNameTable* member_names() { return _member_names; }
    19.6    void set_member_names(MemberNameTable* member_names) { _member_names = member_names; }
    19.7 -  void add_member_name(int index, Handle member_name);
    19.8 -  oop  get_member_name(int index);
    19.9 +  bool add_member_name(Handle member_name);
   19.10  
   19.11  public:
   19.12    // JVMTI support
    20.1 --- a/src/share/vm/opto/c2_globals.hpp	Mon Dec 01 19:09:54 2014 -0800
    20.2 +++ b/src/share/vm/opto/c2_globals.hpp	Fri Dec 12 14:39:40 2014 -0800
    20.3 @@ -647,7 +647,7 @@
    20.4    develop(bool, AlwaysIncrementalInline, false,                             \
    20.5            "do all inlining incrementally")                                  \
    20.6                                                                              \
    20.7 -  product(intx, LiveNodeCountInliningCutoff, 20000,                         \
    20.8 +  product(intx, LiveNodeCountInliningCutoff, 40000,                         \
    20.9            "max number of live nodes in a method")                           \
   20.10                                                                              \
   20.11    diagnostic(bool, OptimizeExpensiveOps, true,                              \
    21.1 --- a/src/share/vm/opto/compile.cpp	Mon Dec 01 19:09:54 2014 -0800
    21.2 +++ b/src/share/vm/opto/compile.cpp	Fri Dec 12 14:39:40 2014 -0800
    21.3 @@ -679,7 +679,8 @@
    21.4                    _inlining_incrementally(false),
    21.5                    _print_inlining_list(NULL),
    21.6                    _print_inlining_idx(0),
    21.7 -                  _interpreter_frame_size(0) {
    21.8 +                  _interpreter_frame_size(0),
    21.9 +                  _max_node_limit(MaxNodeLimit) {
   21.10    C = this;
   21.11  
   21.12    CompileWrapper cw(this);
   21.13 @@ -990,7 +991,8 @@
   21.14      _print_inlining_list(NULL),
   21.15      _print_inlining_idx(0),
   21.16      _allowed_reasons(0),
   21.17 -    _interpreter_frame_size(0) {
   21.18 +    _interpreter_frame_size(0),
   21.19 +    _max_node_limit(MaxNodeLimit) {
   21.20    C = this;
   21.21  
   21.22  #ifndef PRODUCT
   21.23 @@ -1100,6 +1102,7 @@
   21.24    set_do_count_invocations(false);
   21.25    set_do_method_data_update(false);
   21.26    set_rtm_state(NoRTM); // No RTM lock eliding by default
   21.27 +  method_has_option_value("MaxNodeLimit", _max_node_limit);
   21.28  #if INCLUDE_RTM_OPT
   21.29    if (UseRTMLocking && has_method() && (method()->method_data_or_null() != NULL)) {
   21.30      int rtm_state = method()->method_data()->rtm_state();
    22.1 --- a/src/share/vm/opto/compile.hpp	Mon Dec 01 19:09:54 2014 -0800
    22.2 +++ b/src/share/vm/opto/compile.hpp	Fri Dec 12 14:39:40 2014 -0800
    22.3 @@ -290,6 +290,7 @@
    22.4    int                   _freq_inline_size;      // Max hot method inline size for this compilation
    22.5    int                   _fixed_slots;           // count of frame slots not allocated by the register
    22.6                                                  // allocator i.e. locks, original deopt pc, etc.
    22.7 +  uintx                 _max_node_limit;        // Max unique node count during a single compilation.
    22.8    // For deopt
    22.9    int                   _orig_pc_slot;
   22.10    int                   _orig_pc_slot_offset_in_bytes;
   22.11 @@ -594,6 +595,9 @@
   22.12    void          set_rtm_state(RTMState s)        { _rtm_state = s; }
   22.13    bool              use_rtm() const              { return (_rtm_state & NoRTM) == 0; }
   22.14    bool          profile_rtm() const              { return _rtm_state == ProfileRTM; }
   22.15 +  uint              max_node_limit() const       { return (uint)_max_node_limit; }
   22.16 +  void          set_max_node_limit(uint n)       { _max_node_limit = n; }
   22.17 +
   22.18    // check the CompilerOracle for special behaviours for this compile
   22.19    bool          method_has_option(const char * option) {
   22.20      return method() != NULL && method()->has_option(option);
   22.21 @@ -723,7 +727,7 @@
   22.22      record_method_not_compilable(reason, true);
   22.23    }
   22.24    bool check_node_count(uint margin, const char* reason) {
   22.25 -    if (live_nodes() + margin > (uint)MaxNodeLimit) {
   22.26 +    if (live_nodes() + margin > max_node_limit()) {
   22.27        record_method_not_compilable(reason);
   22.28        return true;
   22.29      } else {
    23.1 --- a/src/share/vm/opto/connode.cpp	Mon Dec 01 19:09:54 2014 -0800
    23.2 +++ b/src/share/vm/opto/connode.cpp	Fri Dec 12 14:39:40 2014 -0800
    23.3 @@ -441,6 +441,101 @@
    23.4    return this;
    23.5  }
    23.6  
    23.7 +uint CastIINode::size_of() const {
    23.8 +  return sizeof(*this);
    23.9 +}
   23.10 +
   23.11 +uint CastIINode::cmp(const Node &n) const {
   23.12 +  return TypeNode::cmp(n) && ((CastIINode&)n)._carry_dependency == _carry_dependency;
   23.13 +}
   23.14 +
   23.15 +Node *CastIINode::Identity(PhaseTransform *phase) {
   23.16 +  if (_carry_dependency) {
   23.17 +    return this;
   23.18 +  }
   23.19 +  return ConstraintCastNode::Identity(phase);
   23.20 +}
   23.21 +
   23.22 +const Type *CastIINode::Value(PhaseTransform *phase) const {
   23.23 +  const Type *res = ConstraintCastNode::Value(phase);
   23.24 +
   23.25 +  // Try to improve the type of the CastII if we recognize a CmpI/If
   23.26 +  // pattern.
   23.27 +  if (_carry_dependency) {
   23.28 +    if (in(0) != NULL && (in(0)->is_IfFalse() || in(0)->is_IfTrue())) {
   23.29 +      Node* proj = in(0);
   23.30 +      if (proj->in(0)->in(1)->is_Bool()) {
   23.31 +        Node* b = proj->in(0)->in(1);
   23.32 +        if (b->in(1)->Opcode() == Op_CmpI) {
   23.33 +          Node* cmp = b->in(1);
   23.34 +          if (cmp->in(1) == in(1) && phase->type(cmp->in(2))->isa_int()) {
   23.35 +            const TypeInt* in2_t = phase->type(cmp->in(2))->is_int();
   23.36 +            const Type* t = TypeInt::INT;
   23.37 +            BoolTest test = b->as_Bool()->_test;
   23.38 +            if (proj->is_IfFalse()) {
   23.39 +              test = test.negate();
   23.40 +            }
   23.41 +            BoolTest::mask m = test._test;
   23.42 +            jlong lo_long = min_jint;
   23.43 +            jlong hi_long = max_jint;
   23.44 +            if (m == BoolTest::le || m == BoolTest::lt) {
   23.45 +              hi_long = in2_t->_hi;
   23.46 +              if (m == BoolTest::lt) {
   23.47 +                hi_long -= 1;
   23.48 +              }
   23.49 +            } else if (m == BoolTest::ge || m == BoolTest::gt) {
   23.50 +              lo_long = in2_t->_lo;
   23.51 +              if (m == BoolTest::gt) {
   23.52 +                lo_long += 1;
   23.53 +              }
   23.54 +            } else if (m == BoolTest::eq) {
   23.55 +              lo_long = in2_t->_lo;
   23.56 +              hi_long = in2_t->_hi;
   23.57 +            } else if (m == BoolTest::ne) {
   23.58 +              // can't do any better
   23.59 +            } else {
   23.60 +              stringStream ss;
   23.61 +              test.dump_on(&ss);
   23.62 +              fatal(err_msg_res("unexpected comparison %s", ss.as_string()));
   23.63 +            }
   23.64 +            int lo_int = (int)lo_long;
   23.65 +            int hi_int = (int)hi_long;
   23.66 +
   23.67 +            if (lo_long != (jlong)lo_int) {
   23.68 +              lo_int = min_jint;
   23.69 +            }
   23.70 +            if (hi_long != (jlong)hi_int) {
   23.71 +              hi_int = max_jint;
   23.72 +            }
   23.73 +
   23.74 +            t = TypeInt::make(lo_int, hi_int, Type::WidenMax);
   23.75 +
   23.76 +            res = res->filter_speculative(t);
   23.77 +
   23.78 +            return res;
   23.79 +          }
   23.80 +        }
   23.81 +      }
   23.82 +    }
   23.83 +  }
   23.84 +  return res;
   23.85 +}
   23.86 +
   23.87 +Node *CastIINode::Ideal_DU_postCCP(PhaseCCP *ccp) {
   23.88 +  if (_carry_dependency) {
   23.89 +    return NULL;
   23.90 +  }
   23.91 +  return ConstraintCastNode::Ideal_DU_postCCP(ccp);
   23.92 +}
   23.93 +
   23.94 +#ifndef PRODUCT
   23.95 +void CastIINode::dump_spec(outputStream *st) const {
   23.96 +  TypeNode::dump_spec(st);
   23.97 +  if (_carry_dependency) {
   23.98 +    st->print(" carry dependency");
   23.99 +  }
  23.100 +}
  23.101 +#endif
  23.102  
  23.103  //=============================================================================
  23.104  
    24.1 --- a/src/share/vm/opto/connode.hpp	Mon Dec 01 19:09:54 2014 -0800
    24.2 +++ b/src/share/vm/opto/connode.hpp	Fri Dec 12 14:39:40 2014 -0800
    24.3 @@ -241,10 +241,25 @@
    24.4  //------------------------------CastIINode-------------------------------------
    24.5  // cast integer to integer (different range)
    24.6  class CastIINode: public ConstraintCastNode {
    24.7 +  private:
    24.8 +  // Can this node be removed post CCP or does it carry a required dependency?
    24.9 +  const bool _carry_dependency;
   24.10 +
   24.11 +  protected:
   24.12 +  virtual uint cmp( const Node &n ) const;
   24.13 +  virtual uint size_of() const;
   24.14 +
   24.15  public:
   24.16 -  CastIINode (Node *n, const Type *t ): ConstraintCastNode(n,t) {}
   24.17 +  CastIINode(Node *n, const Type *t, bool carry_dependency = false)
   24.18 +    : ConstraintCastNode(n,t), _carry_dependency(carry_dependency) {}
   24.19    virtual int Opcode() const;
   24.20    virtual uint ideal_reg() const { return Op_RegI; }
   24.21 +  virtual Node *Identity( PhaseTransform *phase );
   24.22 +  virtual const Type *Value( PhaseTransform *phase ) const;
   24.23 +  virtual Node *Ideal_DU_postCCP( PhaseCCP * );
   24.24 +#ifndef PRODUCT
   24.25 +  virtual void dump_spec(outputStream *st) const;
   24.26 +#endif
   24.27  };
   24.28  
   24.29  //------------------------------CastPPNode-------------------------------------
    25.1 --- a/src/share/vm/opto/doCall.cpp	Mon Dec 01 19:09:54 2014 -0800
    25.2 +++ b/src/share/vm/opto/doCall.cpp	Fri Dec 12 14:39:40 2014 -0800
    25.3 @@ -410,6 +410,11 @@
    25.4    ciInstanceKlass* klass = ciEnv::get_instance_klass_for_declared_method_holder(holder);
    25.5    assert(declared_signature != NULL, "cannot be null");
    25.6  
    25.7 +  // Bump max node limit for JSR292 users
    25.8 +  if (bc() == Bytecodes::_invokedynamic || orig_callee->is_method_handle_intrinsic()) {
    25.9 +    C->set_max_node_limit(3*MaxNodeLimit);
   25.10 +  }
   25.11 +
   25.12    // uncommon-trap when callee is unloaded, uninitialized or will not link
   25.13    // bailout when too many arguments for register representation
   25.14    if (!will_link || can_not_compile_call_site(orig_callee, klass)) {
    26.1 --- a/src/share/vm/opto/escape.cpp	Mon Dec 01 19:09:54 2014 -0800
    26.2 +++ b/src/share/vm/opto/escape.cpp	Fri Dec 12 14:39:40 2014 -0800
    26.3 @@ -1106,6 +1106,9 @@
    26.4            // Each 4 iterations calculate how much time it will take
    26.5            // to complete graph construction.
    26.6            time.stop();
    26.7 +          // Poll for requests from shutdown mechanism to quiesce compiler
    26.8 +          // because Connection graph construction may take long time.
    26.9 +          CompileBroker::maybe_block();
   26.10            double stop_time = time.seconds();
   26.11            double time_per_iter = (stop_time - start_time) / (double)SAMPLE_SIZE;
   26.12            double time_until_end = time_per_iter * (double)(java_objects_length - next);
   26.13 @@ -2409,7 +2412,7 @@
   26.14        }
   26.15      }
   26.16    }
   26.17 -  if ((int) (C->live_nodes() + 2*NodeLimitFudgeFactor) > MaxNodeLimit) {
   26.18 +  if (C->live_nodes() + 2*NodeLimitFudgeFactor > C->max_node_limit()) {
   26.19      if (C->do_escape_analysis() == true && !C->failing()) {
   26.20        // Retry compilation without escape analysis.
   26.21        // If this is the first failure, the sentinel string will "stick"
    27.1 --- a/src/share/vm/opto/ifg.cpp	Mon Dec 01 19:09:54 2014 -0800
    27.2 +++ b/src/share/vm/opto/ifg.cpp	Fri Dec 12 14:39:40 2014 -0800
    27.3 @@ -541,17 +541,37 @@
    27.4            if( !n->is_Proj() ||
    27.5                // Could also be a flags-projection of a dead ADD or such.
    27.6                (_lrg_map.live_range_id(def) && !liveout.member(_lrg_map.live_range_id(def)))) {
    27.7 -            block->remove_node(j - 1);
    27.8 -            if (lrgs(r)._def == n) {
    27.9 -              lrgs(r)._def = 0;
   27.10 +            bool remove = true;
   27.11 +            if (n->is_MachProj()) {
   27.12 +              // Don't remove KILL projections if their "defining" nodes have
   27.13 +              // memory effects (have SCMemProj projection node) -
   27.14 +              // they are not dead even when their result is not used.
   27.15 +              // For example, compareAndSwapL (and other CAS) and EncodeISOArray nodes.
   27.16 +              // The method add_input_to_liveout() keeps such nodes alive (put them on liveout list)
   27.17 +              // when it sees SCMemProj node in a block. Unfortunately SCMemProj node could be placed
   27.18 +              // in block in such order that KILL MachProj nodes are processed first.
   27.19 +              uint cnt = def->outcnt();
   27.20 +              for (uint i = 0; i < cnt; i++) {
   27.21 +                Node* proj = def->raw_out(i);
   27.22 +                if (proj->Opcode() == Op_SCMemProj) {
   27.23 +                  remove = false;
   27.24 +                  break;
   27.25 +                }
   27.26 +              }
   27.27              }
   27.28 -            n->disconnect_inputs(NULL, C);
   27.29 -            _cfg.unmap_node_from_block(n);
   27.30 -            n->replace_by(C->top());
   27.31 -            // Since yanking a Node from block, high pressure moves up one
   27.32 -            hrp_index[0]--;
   27.33 -            hrp_index[1]--;
   27.34 -            continue;
   27.35 +            if (remove) {
   27.36 +              block->remove_node(j - 1);
   27.37 +              if (lrgs(r)._def == n) {
   27.38 +                lrgs(r)._def = 0;
   27.39 +              }
   27.40 +              n->disconnect_inputs(NULL, C);
   27.41 +              _cfg.unmap_node_from_block(n);
   27.42 +              n->replace_by(C->top());
   27.43 +              // Since yanking a Node from block, high pressure moves up one
   27.44 +              hrp_index[0]--;
   27.45 +              hrp_index[1]--;
   27.46 +              continue;
   27.47 +            }
   27.48            }
   27.49  
   27.50            // Fat-projections kill many registers which cannot be used to
    28.1 --- a/src/share/vm/opto/loopTransform.cpp	Mon Dec 01 19:09:54 2014 -0800
    28.2 +++ b/src/share/vm/opto/loopTransform.cpp	Fri Dec 12 14:39:40 2014 -0800
    28.3 @@ -269,10 +269,9 @@
    28.4  bool IdealLoopTree::policy_peeling( PhaseIdealLoop *phase ) const {
    28.5    Node *test = ((IdealLoopTree*)this)->tail();
    28.6    int  body_size = ((IdealLoopTree*)this)->_body.size();
    28.7 -  int  live_node_count = phase->C->live_nodes();
    28.8    // Peeling does loop cloning which can result in O(N^2) node construction
    28.9    if( body_size > 255 /* Prevent overflow for large body_size */
   28.10 -      || (body_size * body_size + live_node_count > MaxNodeLimit) ) {
   28.11 +      || (body_size * body_size + phase->C->live_nodes()) > phase->C->max_node_limit() ) {
   28.12      return false;           // too large to safely clone
   28.13    }
   28.14    while( test != _head ) {      // Scan till run off top of loop
   28.15 @@ -601,7 +600,7 @@
   28.16      return false;
   28.17    if (new_body_size > unroll_limit ||
   28.18        // Unrolling can result in a large amount of node construction
   28.19 -      new_body_size >= MaxNodeLimit - (uint) phase->C->live_nodes()) {
   28.20 +      new_body_size >= phase->C->max_node_limit() - phase->C->live_nodes()) {
   28.21      return false;
   28.22    }
   28.23  
   28.24 @@ -882,6 +881,20 @@
   28.25    return n;
   28.26  }
   28.27  
   28.28 +bool PhaseIdealLoop::cast_incr_before_loop(Node* incr, Node* ctrl, Node* loop) {
   28.29 +  Node* castii = new (C) CastIINode(incr, TypeInt::INT, true);
   28.30 +  castii->set_req(0, ctrl);
   28.31 +  register_new_node(castii, ctrl);
   28.32 +  for (DUIterator_Fast imax, i = incr->fast_outs(imax); i < imax; i++) {
   28.33 +    Node* n = incr->fast_out(i);
   28.34 +    if (n->is_Phi() && n->in(0) == loop) {
   28.35 +      int nrep = n->replace_edge(incr, castii);
   28.36 +      return true;
   28.37 +    }
   28.38 +  }
   28.39 +  return false;
   28.40 +}
   28.41 +
   28.42  //------------------------------insert_pre_post_loops--------------------------
   28.43  // Insert pre and post loops.  If peel_only is set, the pre-loop can not have
   28.44  // more iterations added.  It acts as a 'peel' only, no lower-bound RCE, no
   28.45 @@ -1080,6 +1093,24 @@
   28.46      }
   28.47    }
   28.48  
   28.49 +  // Nodes inside the loop may be control dependent on a predicate
   28.50 +  // that was moved before the preloop. If the back branch of the main
   28.51 +  // or post loops becomes dead, those nodes won't be dependent on the
   28.52 +  // test that guards that loop nest anymore which could lead to an
   28.53 +  // incorrect array access because it executes independently of the
   28.54 +  // test that was guarding the loop nest. We add a special CastII on
   28.55 +  // the if branch that enters the loop, between the input induction
   28.56 +  // variable value and the induction variable Phi to preserve correct
   28.57 +  // dependencies.
   28.58 +
   28.59 +  // CastII for the post loop:
   28.60 +  bool inserted = cast_incr_before_loop(zer_opaq->in(1), zer_taken, post_head);
   28.61 +  assert(inserted, "no castII inserted");
   28.62 +
   28.63 +  // CastII for the main loop:
   28.64 +  inserted = cast_incr_before_loop(pre_incr, min_taken, main_head);
   28.65 +  assert(inserted, "no castII inserted");
   28.66 +
   28.67    // Step B4: Shorten the pre-loop to run only 1 iteration (for now).
   28.68    // RCE and alignment may change this later.
   28.69    Node *cmp_end = pre_end->cmp_node();
   28.70 @@ -2287,8 +2318,8 @@
   28.71  
   28.72    // Skip next optimizations if running low on nodes. Note that
   28.73    // policy_unswitching and policy_maximally_unroll have this check.
   28.74 -  uint nodes_left = MaxNodeLimit - (uint) phase->C->live_nodes();
   28.75 -  if ((2 * _body.size()) > nodes_left) {
   28.76 +  int nodes_left = phase->C->max_node_limit() - phase->C->live_nodes();
   28.77 +  if ((int)(2 * _body.size()) > nodes_left) {
   28.78      return true;
   28.79    }
   28.80  
    29.1 --- a/src/share/vm/opto/loopUnswitch.cpp	Mon Dec 01 19:09:54 2014 -0800
    29.2 +++ b/src/share/vm/opto/loopUnswitch.cpp	Fri Dec 12 14:39:40 2014 -0800
    29.3 @@ -59,8 +59,8 @@
    29.4    if (!_head->is_Loop()) {
    29.5      return false;
    29.6    }
    29.7 -  uint nodes_left = MaxNodeLimit - phase->C->live_nodes();
    29.8 -  if (2 * _body.size() > nodes_left) {
    29.9 +  int nodes_left = phase->C->max_node_limit() - phase->C->live_nodes();
   29.10 +  if ((int)(2 * _body.size()) > nodes_left) {
   29.11      return false; // Too speculative if running low on nodes.
   29.12    }
   29.13    LoopNode* head = _head->as_Loop();
    30.1 --- a/src/share/vm/opto/loopnode.hpp	Mon Dec 01 19:09:54 2014 -0800
    30.2 +++ b/src/share/vm/opto/loopnode.hpp	Fri Dec 12 14:39:40 2014 -0800
    30.3 @@ -602,6 +602,8 @@
    30.4      return ctrl;
    30.5    }
    30.6  
    30.7 +  bool cast_incr_before_loop(Node* incr, Node* ctrl, Node* loop);
    30.8 +
    30.9  public:
   30.10    bool has_node( Node* n ) const {
   30.11      guarantee(n != NULL, "No Node.");
    31.1 --- a/src/share/vm/opto/loopopts.cpp	Mon Dec 01 19:09:54 2014 -0800
    31.2 +++ b/src/share/vm/opto/loopopts.cpp	Fri Dec 12 14:39:40 2014 -0800
    31.3 @@ -734,7 +734,7 @@
    31.4    for (DUIterator_Fast imax, i = region->fast_outs(imax); i < imax; i++) {
    31.5      weight += region->fast_out(i)->outcnt();
    31.6    }
    31.7 -  int nodes_left = MaxNodeLimit - C->live_nodes();
    31.8 +  int nodes_left = C->max_node_limit() - C->live_nodes();
    31.9    if (weight * 8 > nodes_left) {
   31.10  #ifndef PRODUCT
   31.11      if (PrintOpto)
    32.1 --- a/src/share/vm/opto/memnode.cpp	Mon Dec 01 19:09:54 2014 -0800
    32.2 +++ b/src/share/vm/opto/memnode.cpp	Fri Dec 12 14:39:40 2014 -0800
    32.3 @@ -1255,6 +1255,16 @@
    32.4                result = new (phase->C) ConvI2LNode(phase->transform(result));
    32.5              }
    32.6  #endif
    32.7 +            // Boxing/unboxing can be done from signed & unsigned loads (e.g. LoadUB -> ... -> LoadB pair).
    32.8 +            // Need to preserve unboxing load type if it is unsigned.
    32.9 +            switch(this->Opcode()) {
   32.10 +              case Op_LoadUB:
   32.11 +                result = new (phase->C) AndINode(phase->transform(result), phase->intcon(0xFF));
   32.12 +                break;
   32.13 +              case Op_LoadUS:
   32.14 +                result = new (phase->C) AndINode(phase->transform(result), phase->intcon(0xFFFF));
   32.15 +                break;
   32.16 +            }
   32.17              return result;
   32.18            }
   32.19          }
    33.1 --- a/src/share/vm/opto/node.cpp	Mon Dec 01 19:09:54 2014 -0800
    33.2 +++ b/src/share/vm/opto/node.cpp	Fri Dec 12 14:39:40 2014 -0800
    33.3 @@ -69,7 +69,7 @@
    33.4    Compile::set_debug_idx(new_debug_idx);
    33.5    set_debug_idx( new_debug_idx );
    33.6    assert(Compile::current()->unique() < (INT_MAX - 1), "Node limit exceeded INT_MAX");
    33.7 -  assert(Compile::current()->live_nodes() < (uint)MaxNodeLimit, "Live Node limit exceeded limit");
    33.8 +  assert(Compile::current()->live_nodes() < Compile::current()->max_node_limit(), "Live Node limit exceeded limit");
    33.9    if (BreakAtNode != 0 && (_debug_idx == BreakAtNode || (int)_idx == BreakAtNode)) {
   33.10      tty->print_cr("BreakAtNode: _idx=%d _debug_idx=%d", _idx, _debug_idx);
   33.11      BREAKPOINT;
   33.12 @@ -326,7 +326,7 @@
   33.13  Node::Node(uint req)
   33.14    : _idx(IDX_INIT(req))
   33.15  {
   33.16 -  assert( req < (uint)(MaxNodeLimit - NodeLimitFudgeFactor), "Input limit exceeded" );
   33.17 +  assert( req < Compile::current()->max_node_limit() - NodeLimitFudgeFactor, "Input limit exceeded" );
   33.18    debug_only( verify_construction() );
   33.19    NOT_PRODUCT(nodes_created++);
   33.20    if (req == 0) {
    34.1 --- a/src/share/vm/opto/phaseX.cpp	Mon Dec 01 19:09:54 2014 -0800
    34.2 +++ b/src/share/vm/opto/phaseX.cpp	Fri Dec 12 14:39:40 2014 -0800
    34.3 @@ -1340,15 +1340,27 @@
    34.4        }
    34.5      }
    34.6  
    34.7 -    if( use->is_Cmp() ) {       // Enable CMP/BOOL optimization
    34.8 +    uint use_op = use->Opcode();
    34.9 +    if(use->is_Cmp()) {       // Enable CMP/BOOL optimization
   34.10        add_users_to_worklist(use); // Put Bool on worklist
   34.11 -      // Look for the 'is_x2logic' pattern: "x ? : 0 : 1" and put the
   34.12 -      // phi merging either 0 or 1 onto the worklist
   34.13        if (use->outcnt() > 0) {
   34.14          Node* bol = use->raw_out(0);
   34.15          if (bol->outcnt() > 0) {
   34.16            Node* iff = bol->raw_out(0);
   34.17 -          if (iff->outcnt() == 2) {
   34.18 +          if (use_op == Op_CmpI &&
   34.19 +              iff->is_CountedLoopEnd()) {
   34.20 +            CountedLoopEndNode* cle = iff->as_CountedLoopEnd();
   34.21 +            if (cle->limit() == n && cle->phi() != NULL) {
   34.22 +              // If an opaque node feeds into the limit condition of a
   34.23 +              // CountedLoop, we need to process the Phi node for the
   34.24 +              // induction variable when the opaque node is removed:
   34.25 +              // the range of values taken by the Phi is now known and
   34.26 +              // so its type is also known.
   34.27 +              _worklist.push(cle->phi());
   34.28 +            }
   34.29 +          } else if (iff->outcnt() == 2) {
   34.30 +            // Look for the 'is_x2logic' pattern: "x ? : 0 : 1" and put the
   34.31 +            // phi merging either 0 or 1 onto the worklist
   34.32              Node* ifproj0 = iff->raw_out(0);
   34.33              Node* ifproj1 = iff->raw_out(1);
   34.34              if (ifproj0->outcnt() > 0 && ifproj1->outcnt() > 0) {
   34.35 @@ -1360,9 +1372,26 @@
   34.36            }
   34.37          }
   34.38        }
   34.39 +      if (use_op == Op_CmpI) {
   34.40 +        Node* in1 = use->in(1);
   34.41 +        for (uint i = 0; i < in1->outcnt(); i++) {
   34.42 +          if (in1->raw_out(i)->Opcode() == Op_CastII) {
   34.43 +            Node* castii = in1->raw_out(i);
   34.44 +            if (castii->in(0) != NULL && castii->in(0)->in(0) != NULL && castii->in(0)->in(0)->is_If()) {
   34.45 +              Node* ifnode = castii->in(0)->in(0);
   34.46 +              if (ifnode->in(1) != NULL && ifnode->in(1)->is_Bool() && ifnode->in(1)->in(1) == use) {
   34.47 +                // Reprocess a CastII node that may depend on an
   34.48 +                // opaque node value when the opaque node is
   34.49 +                // removed. In case it carries a dependency we can do
   34.50 +                // a better job of computing its type.
   34.51 +                _worklist.push(castii);
   34.52 +              }
   34.53 +            }
   34.54 +          }
   34.55 +        }
   34.56 +      }
   34.57      }
   34.58  
   34.59 -    uint use_op = use->Opcode();
   34.60      // If changed Cast input, check Phi users for simple cycles
   34.61      if( use->is_ConstraintCast() || use->is_CheckCastPP() ) {
   34.62        for (DUIterator_Fast i2max, i2 = use->fast_outs(i2max); i2 < i2max; i2++) {
    35.1 --- a/src/share/vm/opto/subnode.cpp	Mon Dec 01 19:09:54 2014 -0800
    35.2 +++ b/src/share/vm/opto/subnode.cpp	Fri Dec 12 14:39:40 2014 -0800
    35.3 @@ -1147,12 +1147,10 @@
    35.4  
    35.5  //------------------------------dump_spec-------------------------------------
    35.6  // Print special per-node info
    35.7 -#ifndef PRODUCT
    35.8  void BoolTest::dump_on(outputStream *st) const {
    35.9    const char *msg[] = {"eq","gt","of","lt","ne","le","nof","ge"};
   35.10    st->print("%s", msg[_test]);
   35.11  }
   35.12 -#endif
   35.13  
   35.14  //=============================================================================
   35.15  uint BoolNode::hash() const { return (Node::hash() << 3)|(_test._test+1); }
    36.1 --- a/src/share/vm/opto/subnode.hpp	Mon Dec 01 19:09:54 2014 -0800
    36.2 +++ b/src/share/vm/opto/subnode.hpp	Fri Dec 12 14:39:40 2014 -0800
    36.3 @@ -275,9 +275,7 @@
    36.4    mask commute( ) const { return mask("032147658"[_test]-'0'); }
    36.5    mask negate( ) const { return mask(_test^4); }
    36.6    bool is_canonical( ) const { return (_test == BoolTest::ne || _test == BoolTest::lt || _test == BoolTest::le || _test == BoolTest::overflow); }
    36.7 -#ifndef PRODUCT
    36.8    void dump_on(outputStream *st) const;
    36.9 -#endif
   36.10  };
   36.11  
   36.12  //------------------------------BoolNode---------------------------------------
    37.1 --- a/src/share/vm/prims/jvm.cpp	Mon Dec 01 19:09:54 2014 -0800
    37.2 +++ b/src/share/vm/prims/jvm.cpp	Fri Dec 12 14:39:40 2014 -0800
    37.3 @@ -603,13 +603,14 @@
    37.4  
    37.5    // Make shallow object copy
    37.6    const int size = obj->size();
    37.7 -  oop new_obj = NULL;
    37.8 +  oop new_obj_oop = NULL;
    37.9    if (obj->is_array()) {
   37.10      const int length = ((arrayOop)obj())->length();
   37.11 -    new_obj = CollectedHeap::array_allocate(klass, size, length, CHECK_NULL);
   37.12 +    new_obj_oop = CollectedHeap::array_allocate(klass, size, length, CHECK_NULL);
   37.13    } else {
   37.14 -    new_obj = CollectedHeap::obj_allocate(klass, size, CHECK_NULL);
   37.15 +    new_obj_oop = CollectedHeap::obj_allocate(klass, size, CHECK_NULL);
   37.16    }
   37.17 +
   37.18    // 4839641 (4840070): We must do an oop-atomic copy, because if another thread
   37.19    // is modifying a reference field in the clonee, a non-oop-atomic copy might
   37.20    // be suspended in the middle of copying the pointer and end up with parts
   37.21 @@ -620,24 +621,41 @@
   37.22    // The same is true of StubRoutines::object_copy and the various oop_copy
   37.23    // variants, and of the code generated by the inline_native_clone intrinsic.
   37.24    assert(MinObjAlignmentInBytes >= BytesPerLong, "objects misaligned");
   37.25 -  Copy::conjoint_jlongs_atomic((jlong*)obj(), (jlong*)new_obj,
   37.26 +  Copy::conjoint_jlongs_atomic((jlong*)obj(), (jlong*)new_obj_oop,
   37.27                                 (size_t)align_object_size(size) / HeapWordsPerLong);
   37.28    // Clear the header
   37.29 -  new_obj->init_mark();
   37.30 +  new_obj_oop->init_mark();
   37.31  
   37.32    // Store check (mark entire object and let gc sort it out)
   37.33    BarrierSet* bs = Universe::heap()->barrier_set();
   37.34    assert(bs->has_write_region_opt(), "Barrier set does not have write_region");
   37.35 -  bs->write_region(MemRegion((HeapWord*)new_obj, size));
   37.36 +  bs->write_region(MemRegion((HeapWord*)new_obj_oop, size));
   37.37 +
   37.38 +  Handle new_obj(THREAD, new_obj_oop);
   37.39 +  // Special handling for MemberNames.  Since they contain Method* metadata, they
   37.40 +  // must be registered so that RedefineClasses can fix metadata contained in them.
   37.41 +  if (java_lang_invoke_MemberName::is_instance(new_obj()) &&
   37.42 +      java_lang_invoke_MemberName::is_method(new_obj())) {
   37.43 +    Method* method = (Method*)java_lang_invoke_MemberName::vmtarget(new_obj());
   37.44 +    // MemberName may be unresolved, so doesn't need registration until resolved.
   37.45 +    if (method != NULL) {
   37.46 +      methodHandle m(THREAD, method);
   37.47 +      // This can safepoint and redefine method, so need both new_obj and method
   37.48 +      // in a handle, for two different reasons.  new_obj can move, method can be
   37.49 +      // deleted if nothing is using it on the stack.
   37.50 +      m->method_holder()->add_member_name(new_obj());
   37.51 +    }
   37.52 +  }
   37.53  
   37.54    // Caution: this involves a java upcall, so the clone should be
   37.55    // "gc-robust" by this stage.
   37.56    if (klass->has_finalizer()) {
   37.57      assert(obj->is_instance(), "should be instanceOop");
   37.58 -    new_obj = InstanceKlass::register_finalizer(instanceOop(new_obj), CHECK_NULL);
   37.59 +    new_obj_oop = InstanceKlass::register_finalizer(instanceOop(new_obj()), CHECK_NULL);
   37.60 +    new_obj = Handle(THREAD, new_obj_oop);
   37.61    }
   37.62  
   37.63 -  return JNIHandles::make_local(env, oop(new_obj));
   37.64 +  return JNIHandles::make_local(env, new_obj());
   37.65  JVM_END
   37.66  
   37.67  // java.lang.Compiler ////////////////////////////////////////////////////
   37.68 @@ -4526,7 +4544,7 @@
   37.69  
   37.70  JVM_ENTRY(void, JVM_GetVersionInfo(JNIEnv* env, jvm_version_info* info, size_t info_size))
   37.71  {
   37.72 -  memset(info, 0, sizeof(info_size));
   37.73 +  memset(info, 0, info_size);
   37.74  
   37.75    info->jvm_version = Abstract_VM_Version::jvm_version();
   37.76    info->update_version = 0;          /* 0 in HotSpot Express VM */
    38.1 --- a/src/share/vm/prims/jvmtiEnv.cpp	Mon Dec 01 19:09:54 2014 -0800
    38.2 +++ b/src/share/vm/prims/jvmtiEnv.cpp	Fri Dec 12 14:39:40 2014 -0800
    38.3 @@ -23,6 +23,7 @@
    38.4   */
    38.5  
    38.6  #include "precompiled.hpp"
    38.7 +#include "classfile/classLoaderExt.hpp"
    38.8  #include "classfile/systemDictionary.hpp"
    38.9  #include "classfile/vmSymbols.hpp"
   38.10  #include "interpreter/bytecodeStream.hpp"
   38.11 @@ -475,7 +476,7 @@
   38.12      if (TraceClassLoading) {
   38.13        tty->print_cr("[Opened %s]", zip_entry->name());
   38.14      }
   38.15 -    ClassLoader::add_to_list(zip_entry);
   38.16 +    ClassLoaderExt::append_boot_classpath(zip_entry);
   38.17      return JVMTI_ERROR_NONE;
   38.18    } else {
   38.19      return JVMTI_ERROR_WRONG_PHASE;
    39.1 --- a/src/share/vm/prims/methodHandles.cpp	Mon Dec 01 19:09:54 2014 -0800
    39.2 +++ b/src/share/vm/prims/methodHandles.cpp	Fri Dec 12 14:39:40 2014 -0800
    39.3 @@ -29,7 +29,6 @@
    39.4  #include "interpreter/oopMapCache.hpp"
    39.5  #include "memory/allocation.inline.hpp"
    39.6  #include "memory/oopFactory.hpp"
    39.7 -#include "prims/jvmtiRedefineClassesTrace.hpp"
    39.8  #include "prims/methodHandles.hpp"
    39.9  #include "runtime/compilationPolicy.hpp"
   39.10  #include "runtime/javaCalls.hpp"
   39.11 @@ -271,9 +270,12 @@
   39.12    // This is done eagerly, since it is readily available without
   39.13    // constructing any new objects.
   39.14    // TO DO: maybe intern mname_oop
   39.15 -  m->method_holder()->add_member_name(m->method_idnum(), mname);
   39.16 -
   39.17 -  return mname();
   39.18 +  if (m->method_holder()->add_member_name(mname)) {
   39.19 +    return mname();
   39.20 +  } else {
   39.21 +    // Redefinition caused this to fail.  Return NULL (and an exception?)
   39.22 +    return NULL;
   39.23 +  }
   39.24  }
   39.25  
   39.26  oop MethodHandles::init_field_MemberName(Handle mname, fieldDescriptor& fd, bool is_setter) {
   39.27 @@ -946,63 +948,27 @@
   39.28    }
   39.29  }
   39.30  
   39.31 -void MemberNameTable::add_member_name(int index, jweak mem_name_wref) {
   39.32 +void MemberNameTable::add_member_name(jweak mem_name_wref) {
   39.33    assert_locked_or_safepoint(MemberNameTable_lock);
   39.34 -  this->at_put_grow(index, mem_name_wref);
   39.35 -}
   39.36 -
   39.37 -// Return a member name oop or NULL.
   39.38 -oop MemberNameTable::get_member_name(int index) {
   39.39 -  assert_locked_or_safepoint(MemberNameTable_lock);
   39.40 -
   39.41 -  jweak ref = this->at(index);
   39.42 -  oop mem_name = JNIHandles::resolve(ref);
   39.43 -  return mem_name;
   39.44 +  this->push(mem_name_wref);
   39.45  }
   39.46  
   39.47  #if INCLUDE_JVMTI
   39.48 -oop MemberNameTable::find_member_name_by_method(Method* old_method) {
   39.49 -  assert_locked_or_safepoint(MemberNameTable_lock);
   39.50 -  oop found = NULL;
   39.51 -  int len = this->length();
   39.52 -
   39.53 -  for (int idx = 0; idx < len; idx++) {
   39.54 -    oop mem_name = JNIHandles::resolve(this->at(idx));
   39.55 -    if (mem_name == NULL) {
   39.56 -      continue;
   39.57 -    }
   39.58 -    Method* method = (Method*)java_lang_invoke_MemberName::vmtarget(mem_name);
   39.59 -    if (method == old_method) {
   39.60 -      found = mem_name;
   39.61 -      break;
   39.62 -    }
   39.63 -  }
   39.64 -  return found;
   39.65 -}
   39.66 -
   39.67 -// It is called at safepoint only
   39.68 +// It is called at safepoint only for RedefineClasses
   39.69  void MemberNameTable::adjust_method_entries(Method** old_methods, Method** new_methods,
   39.70                                              int methods_length, bool *trace_name_printed) {
   39.71    assert(SafepointSynchronize::is_at_safepoint(), "only called at safepoint");
   39.72 -  // search the MemberNameTable for uses of either obsolete or EMCP methods
   39.73 +  // For each redefined method
   39.74    for (int j = 0; j < methods_length; j++) {
   39.75      Method* old_method = old_methods[j];
   39.76      Method* new_method = new_methods[j];
   39.77 -    oop mem_name = find_member_name_by_method(old_method);
   39.78 -    if (mem_name != NULL) {
   39.79 -      java_lang_invoke_MemberName::adjust_vmtarget(mem_name, new_method);
   39.80  
   39.81 -      if (RC_TRACE_IN_RANGE(0x00100000, 0x00400000)) {
   39.82 -        if (!(*trace_name_printed)) {
   39.83 -          // RC_TRACE_MESG macro has an embedded ResourceMark
   39.84 -          RC_TRACE_MESG(("adjust: name=%s",
   39.85 -                         old_method->method_holder()->external_name()));
   39.86 -          *trace_name_printed = true;
   39.87 -        }
   39.88 -        // RC_TRACE macro has an embedded ResourceMark
   39.89 -        RC_TRACE(0x00400000, ("MemberName method update: %s(%s)",
   39.90 -                              new_method->name()->as_C_string(),
   39.91 -                              new_method->signature()->as_C_string()));
   39.92 +    // search the MemberNameTable for uses of either obsolete or EMCP methods
   39.93 +    for (int idx = 0; idx < length(); idx++) {
   39.94 +      oop mem_name = JNIHandles::resolve(this->at(idx));
   39.95 +      if (mem_name != NULL) {
   39.96 +        java_lang_invoke_MemberName::adjust_vmtarget(mem_name, old_method, new_method,
   39.97 +                                                     trace_name_printed);
   39.98        }
   39.99      }
  39.100    }
    40.1 --- a/src/share/vm/prims/methodHandles.hpp	Mon Dec 01 19:09:54 2014 -0800
    40.2 +++ b/src/share/vm/prims/methodHandles.hpp	Fri Dec 12 14:39:40 2014 -0800
    40.3 @@ -1,5 +1,5 @@
    40.4  /*
    40.5 - * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
    40.6 + * Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
    40.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    40.8   *
    40.9   * This code is free software; you can redistribute it and/or modify it
   40.10 @@ -236,18 +236,14 @@
   40.11   public:
   40.12    MemberNameTable(int methods_cnt);
   40.13    ~MemberNameTable();
   40.14 -  void add_member_name(int index, jweak mem_name_ref);
   40.15 -  oop  get_member_name(int index);
   40.16 +  void add_member_name(jweak mem_name_ref);
   40.17  
   40.18  #if INCLUDE_JVMTI
   40.19 - public:
   40.20    // RedefineClasses() API support:
   40.21    // If a MemberName refers to old_method then update it
   40.22    // to refer to new_method.
   40.23    void adjust_method_entries(Method** old_methods, Method** new_methods,
   40.24                               int methods_length, bool *trace_name_printed);
   40.25 - private:
   40.26 -  oop find_member_name_by_method(Method* old_method);
   40.27  #endif // INCLUDE_JVMTI
   40.28  };
   40.29  
    41.1 --- a/src/share/vm/prims/whitebox.cpp	Mon Dec 01 19:09:54 2014 -0800
    41.2 +++ b/src/share/vm/prims/whitebox.cpp	Fri Dec 12 14:39:40 2014 -0800
    41.3 @@ -56,6 +56,7 @@
    41.4  #endif // INCLUDE_NMT
    41.5  
    41.6  #include "compiler/compileBroker.hpp"
    41.7 +#include "jvmtifiles/jvmtiEnv.hpp"
    41.8  #include "runtime/compilationPolicy.hpp"
    41.9  
   41.10  PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
   41.11 @@ -126,6 +127,29 @@
   41.12    return result;
   41.13  WB_END
   41.14  
   41.15 +WB_ENTRY(void, WB_AddToBootstrapClassLoaderSearch(JNIEnv* env, jobject o, jstring segment)) {
   41.16 +#if INCLUDE_JVMTI
   41.17 +  ResourceMark rm;
   41.18 +  const char* seg = java_lang_String::as_utf8_string(JNIHandles::resolve_non_null(segment));
   41.19 +  JvmtiEnv* jvmti_env = JvmtiEnv::create_a_jvmti(JVMTI_VERSION);
   41.20 +  jvmtiError err = jvmti_env->AddToBootstrapClassLoaderSearch(seg);
   41.21 +  assert(err == JVMTI_ERROR_NONE, "must not fail");
   41.22 +#endif
   41.23 +}
   41.24 +WB_END
   41.25 +
   41.26 +WB_ENTRY(void, WB_AddToSystemClassLoaderSearch(JNIEnv* env, jobject o, jstring segment)) {
   41.27 +#if INCLUDE_JVMTI
   41.28 +  ResourceMark rm;
   41.29 +  const char* seg = java_lang_String::as_utf8_string(JNIHandles::resolve_non_null(segment));
   41.30 +  JvmtiEnv* jvmti_env = JvmtiEnv::create_a_jvmti(JVMTI_VERSION);
   41.31 +  jvmtiError err = jvmti_env->AddToSystemClassLoaderSearch(seg);
   41.32 +  assert(err == JVMTI_ERROR_NONE, "must not fail");
   41.33 +#endif
   41.34 +}
   41.35 +WB_END
   41.36 +
   41.37 +
   41.38  WB_ENTRY(jlong, WB_GetCompressedOopsMaxHeapSize(JNIEnv* env, jobject o)) {
   41.39    return (jlong)Arguments::max_heap_for_compressed_oops();
   41.40  }
   41.41 @@ -958,6 +982,10 @@
   41.42        CC"(Ljava/lang/String;[Lsun/hotspot/parser/DiagnosticCommand;)[Ljava/lang/Object;",
   41.43        (void*) &WB_ParseCommandLine
   41.44    },
   41.45 +  {CC"addToBootstrapClassLoaderSearch", CC"(Ljava/lang/String;)V",
   41.46 +                                                      (void*)&WB_AddToBootstrapClassLoaderSearch},
   41.47 +  {CC"addToSystemClassLoaderSearch",    CC"(Ljava/lang/String;)V",
   41.48 +                                                      (void*)&WB_AddToSystemClassLoaderSearch},
   41.49    {CC"getCompressedOopsMaxHeapSize", CC"()J",
   41.50        (void*)&WB_GetCompressedOopsMaxHeapSize},
   41.51    {CC"printHeapSizes",     CC"()V",                   (void*)&WB_PrintHeapSizes    },
    42.1 --- a/src/share/vm/runtime/arguments.cpp	Mon Dec 01 19:09:54 2014 -0800
    42.2 +++ b/src/share/vm/runtime/arguments.cpp	Fri Dec 12 14:39:40 2014 -0800
    42.3 @@ -3543,7 +3543,7 @@
    42.4  
    42.5    if (nonEmptyDirs > 0) {
    42.6      jio_fprintf(defaultStream::output_stream(),
    42.7 -      "Endorsed standards override mechanism and extension mechanism"
    42.8 +      "Endorsed standards override mechanism and extension mechanism "
    42.9        "will not be supported in a future release.\n"
   42.10        "Refer to JEP 220 for details (http://openjdk.java.net/jeps/220).\n");
   42.11      return false;
    43.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    43.2 +++ b/test/compiler/EliminateAutoBox/UnsignedLoads.java	Fri Dec 12 14:39:40 2014 -0800
    43.3 @@ -0,0 +1,63 @@
    43.4 +/*
    43.5 + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
    43.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    43.7 + *
    43.8 + * This code is free software; you can redistribute it and/or modify it
    43.9 + * under the terms of the GNU General Public License version 2 only, as
   43.10 + * published by the Free Software Foundation.  Oracle designates this
   43.11 + * particular file as subject to the "Classpath" exception as provided
   43.12 + * by Oracle in the LICENSE file that accompanied this code.
   43.13 + *
   43.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
   43.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   43.16 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   43.17 + * version 2 for more details (a copy is included in the LICENSE file that
   43.18 + * accompanied this code).
   43.19 + *
   43.20 + * You should have received a copy of the GNU General Public License version
   43.21 + * 2 along with this work; if not, write to the Free Software Foundation,
   43.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   43.23 + *
   43.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   43.25 + * or visit www.oracle.com if you need additional information or have any
   43.26 + * questions.
   43.27 + */
   43.28 +
   43.29 +/*
   43.30 + * @test
   43.31 + * @library /testlibrary
   43.32 + * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox
   43.33 + *                   -XX:CompileOnly=::valueOf,::byteValue,::shortValue,::testUnsignedByte,::testUnsignedShort
   43.34 + *                   UnsignedLoads
   43.35 + */
   43.36 +import static com.oracle.java.testlibrary.Asserts.assertEQ;
   43.37 +
   43.38 +public class UnsignedLoads {
   43.39 +    public static int testUnsignedByte() {
   43.40 +        byte[] bytes = new byte[] {-1};
   43.41 +        int res = 0;
   43.42 +        for (int i = 0; i < 100000; i++) {
   43.43 +            for (Byte b : bytes) {
   43.44 +                res = b & 0xff;
   43.45 +            }
   43.46 +        }
   43.47 +        return res;
   43.48 +    }
   43.49 +
   43.50 +    public static int testUnsignedShort() {
   43.51 +        int res = 0;
   43.52 +        short[] shorts = new short[] {-1};
   43.53 +        for (int i = 0; i < 100000; i++) {
   43.54 +            for (Short s : shorts) {
   43.55 +                res = s & 0xffff;
   43.56 +            }
   43.57 +        }
   43.58 +        return res;
   43.59 +    }
   43.60 +
   43.61 +    public static void main(String[] args) {
   43.62 +        assertEQ(testUnsignedByte(),    255);
   43.63 +        assertEQ(testUnsignedShort(), 65535);
   43.64 +        System.out.println("TEST PASSED");
   43.65 +    }
   43.66 +}
    44.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    44.2 +++ b/test/compiler/dependencies/MonomorphicObjectCall/TestMonomorphicObjectCall.java	Fri Dec 12 14:39:40 2014 -0800
    44.3 @@ -0,0 +1,73 @@
    44.4 +/*
    44.5 + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
    44.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44.7 + *
    44.8 + * This code is free software; you can redistribute it and/or modify it
    44.9 + * under the terms of the GNU General Public License version 2 only, as
   44.10 + * published by the Free Software Foundation.
   44.11 + *
   44.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   44.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   44.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   44.15 + * version 2 for more details (a copy is included in the LICENSE file that
   44.16 + * accompanied this code).
   44.17 + *
   44.18 + * You should have received a copy of the GNU General Public License version
   44.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   44.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   44.21 + *
   44.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   44.23 + * or visit www.oracle.com if you need additional information or have any
   44.24 + * questions.
   44.25 + */
   44.26 +
   44.27 +import java.io.File;
   44.28 +import java.util.ArrayList;
   44.29 +import java.util.Collections;
   44.30 +
   44.31 +import com.oracle.java.testlibrary.*;
   44.32 +
   44.33 +/*
   44.34 + * @test
   44.35 + * @bug 8050079
   44.36 + * @summary Compiles a monomorphic call to finalizeObject() on a modified java.lang.Object to test C1 CHA.
   44.37 + * @library /testlibrary
   44.38 + * @compile -XDignore.symbol.file java/lang/Object.java TestMonomorphicObjectCall.java
   44.39 + * @run main TestMonomorphicObjectCall
   44.40 + */
   44.41 +public class TestMonomorphicObjectCall {
   44.42 +    final static String testClasses = System.getProperty("test.classes") + File.separator;
   44.43 +
   44.44 +    private static void callFinalize(Object object) throws Throwable {
   44.45 +        // Call modified version of java.lang.Object::finalize() that is
   44.46 +        // not overridden by any subclass. C1 CHA should mark the call site
   44.47 +        // as monomorphic and inline the method.
   44.48 +        object.finalizeObject();
   44.49 +    }
   44.50 +
   44.51 +    public static void main(String[] args) throws Throwable {
   44.52 +        if (args.length == 0) {
   44.53 +            // Execute new instance with modified java.lang.Object
   44.54 +            executeTestJvm();
   44.55 +        } else {
   44.56 +            // Trigger compilation of 'callFinalize'
   44.57 +            callFinalize(new Object());
   44.58 +        }
   44.59 +    }
   44.60 +
   44.61 +    public static void executeTestJvm() throws Throwable {
   44.62 +        // Execute test with modified version of java.lang.Object
   44.63 +        // in -Xbootclasspath.
   44.64 +        String[] vmOpts = new String[] {
   44.65 +                "-Xbootclasspath/p:" + testClasses,
   44.66 +                "-Xcomp",
   44.67 +                "-XX:-VerifyDependencies",
   44.68 +                "-XX:CompileOnly=TestMonomorphicObjectCall::callFinalize",
   44.69 +                "-XX:CompileOnly=Object::finalizeObject",
   44.70 +                "-XX:TieredStopAtLevel=1",
   44.71 +                TestMonomorphicObjectCall.class.getName(),
   44.72 +                "true"};
   44.73 +        OutputAnalyzer output = ProcessTools.executeTestJvm(vmOpts);
   44.74 +        output.shouldHaveExitValue(0);
   44.75 +    }
   44.76 +}
    45.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    45.2 +++ b/test/compiler/dependencies/MonomorphicObjectCall/java/lang/Object.java	Fri Dec 12 14:39:40 2014 -0800
    45.3 @@ -0,0 +1,87 @@
    45.4 +/*
    45.5 + * Copyright (c) 1994, 2014, Oracle and/or its affiliates. All rights reserved.
    45.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    45.7 + *
    45.8 + * This code is free software; you can redistribute it and/or modify it
    45.9 + * under the terms of the GNU General Public License version 2 only, as
   45.10 + * published by the Free Software Foundation.  Oracle designates this
   45.11 + * particular file as subject to the "Classpath" exception as provided
   45.12 + * by Oracle in the LICENSE file that accompanied this code.
   45.13 + *
   45.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
   45.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   45.16 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   45.17 + * version 2 for more details (a copy is included in the LICENSE file that
   45.18 + * accompanied this code).
   45.19 + *
   45.20 + * You should have received a copy of the GNU General Public License version
   45.21 + * 2 along with this work; if not, write to the Free Software Foundation,
   45.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   45.23 + *
   45.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   45.25 + * or visit www.oracle.com if you need additional information or have any
   45.26 + * questions.
   45.27 + */
   45.28 +
   45.29 +package java.lang;
   45.30 +
   45.31 +/**
   45.32 + * Slightly modified version of java.lang.Object that replaces
   45.33 + * finalize() by finalizeObject() to avoid overriding in subclasses.
   45.34 + */
   45.35 +public class Object {
   45.36 +
   45.37 +    private static native void registerNatives();
   45.38 +    static {
   45.39 +        registerNatives();
   45.40 +    }
   45.41 +
   45.42 +    public final native Class<?> getClass();
   45.43 +
   45.44 +    public native int hashCode();
   45.45 +
   45.46 +    public boolean equals(Object obj) {
   45.47 +        return (this == obj);
   45.48 +    }
   45.49 +
   45.50 +    protected native Object clone() throws CloneNotSupportedException;
   45.51 +
   45.52 +    public String toString() {
   45.53 +        return getClass().getName() + "@" + Integer.toHexString(hashCode());
   45.54 +    }
   45.55 +
   45.56 +    public final native void notify();
   45.57 +
   45.58 +    public final native void notifyAll();
   45.59 +
   45.60 +    public final native void wait(long timeout) throws InterruptedException;
   45.61 +
   45.62 +    public final void wait(long timeout, int nanos) throws InterruptedException {
   45.63 +        if (timeout < 0) {
   45.64 +            throw new IllegalArgumentException("timeout value is negative");
   45.65 +        }
   45.66 +
   45.67 +        if (nanos < 0 || nanos > 999999) {
   45.68 +            throw new IllegalArgumentException(
   45.69 +                                "nanosecond timeout value out of range");
   45.70 +        }
   45.71 +
   45.72 +        if (nanos >= 500000 || (nanos != 0 && timeout == 0)) {
   45.73 +            timeout++;
   45.74 +        }
   45.75 +
   45.76 +        wait(timeout);
   45.77 +    }
   45.78 +
   45.79 +    public final void wait() throws InterruptedException {
   45.80 +        wait(0);
   45.81 +    }
   45.82 +
   45.83 +    /**
   45.84 +     * Replaces original finalize() method and is therefore not
   45.85 +     * overridden by any subclasses of Object.
   45.86 +     * @throws Throwable
   45.87 +     */
   45.88 +    // protected void finalize() throws Throwable { }
   45.89 +    public void finalizeObject() throws Throwable { }
   45.90 +}
    46.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    46.2 +++ b/test/compiler/jsr292/RedefineMethodUsedByMultipleMethodHandles.java	Fri Dec 12 14:39:40 2014 -0800
    46.3 @@ -0,0 +1,174 @@
    46.4 +/*
    46.5 + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
    46.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    46.7 + *
    46.8 + * This code is free software; you can redistribute it and/or modify it
    46.9 + * under the terms of the GNU General Public License version 2 only, as
   46.10 + * published by the Free Software Foundation.
   46.11 + *
   46.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   46.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   46.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   46.15 + * version 2 for more details (a copy is included in the LICENSE file that
   46.16 + * accompanied this code).
   46.17 + *
   46.18 + * You should have received a copy of the GNU General Public License version
   46.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   46.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   46.21 + *
   46.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   46.23 + * or visit www.oracle.com if you need additional information or have any
   46.24 + * questions.
   46.25 + */
   46.26 +
   46.27 +/**
   46.28 + * @test
   46.29 + * @bug 8042235
   46.30 + * @summary redefining method used by multiple MethodHandles crashes VM
   46.31 + * @compile -XDignore.symbol.file RedefineMethodUsedByMultipleMethodHandles.java
   46.32 + * @run main RedefineMethodUsedByMultipleMethodHandles
   46.33 + */
   46.34 +
   46.35 +import java.io.*;
   46.36 +import java.lang.instrument.*;
   46.37 +import java.lang.invoke.*;
   46.38 +import java.lang.invoke.MethodHandles.Lookup;
   46.39 +import java.lang.management.*;
   46.40 +import java.lang.reflect.*;
   46.41 +import java.nio.file.*;
   46.42 +import java.security.*;
   46.43 +import java.util.jar.*;
   46.44 +
   46.45 +import javax.tools.*;
   46.46 +
   46.47 +import jdk.internal.org.objectweb.asm.*;
   46.48 +
   46.49 +public class RedefineMethodUsedByMultipleMethodHandles {
   46.50 +
   46.51 +    static class Foo {
   46.52 +        public static Object getName() {
   46.53 +            return "foo";
   46.54 +        }
   46.55 +    }
   46.56 +
   46.57 +    public static void main(String[] args) throws Throwable {
   46.58 +
   46.59 +        Lookup lookup = MethodHandles.lookup();
   46.60 +        Method fooMethod = Foo.class.getDeclaredMethod("getName");
   46.61 +
   46.62 +        // fooMH2 displaces fooMH1 from the MemberNamesTable
   46.63 +        MethodHandle fooMH1 = lookup.unreflect(fooMethod);
   46.64 +        MethodHandle fooMH2 = lookup.unreflect(fooMethod);
   46.65 +
   46.66 +        System.out.println("fooMH1.invoke = " + fooMH1.invokeExact());
   46.67 +        System.out.println("fooMH2.invoke = " + fooMH2.invokeExact());
   46.68 +
   46.69 +        // Redefining Foo.getName() causes vmtarget to be updated
   46.70 +        // in fooMH2 but not fooMH1
   46.71 +        redefineFoo();
   46.72 +
   46.73 +        // Full GC causes fooMH1.vmtarget to be deallocated
   46.74 +        System.gc();
   46.75 +
   46.76 +        // Calling fooMH1.vmtarget crashes the VM
   46.77 +        System.out.println("fooMH1.invoke = " + fooMH1.invokeExact());
   46.78 +    }
   46.79 +
   46.80 +    /**
   46.81 +     * Adds the class file bytes for {@code c} to {@code jar}.
   46.82 +     */
   46.83 +    static void add(JarOutputStream jar, Class<?> c) throws IOException {
   46.84 +        String classAsPath = c.getName().replace('.', '/') + ".class";
   46.85 +        jar.putNextEntry(new JarEntry(classAsPath));
   46.86 +        InputStream stream = c.getClassLoader().getResourceAsStream(classAsPath);
   46.87 +
   46.88 +        int b;
   46.89 +        while ((b = stream.read()) != -1) {
   46.90 +            jar.write(b);
   46.91 +        }
   46.92 +    }
   46.93 +
   46.94 +    static void redefineFoo() throws Exception {
   46.95 +        Manifest manifest = new Manifest();
   46.96 +        manifest.getMainAttributes().put(Attributes.Name.MANIFEST_VERSION, "1.0");
   46.97 +        Attributes mainAttrs = manifest.getMainAttributes();
   46.98 +        mainAttrs.putValue("Agent-Class", FooAgent.class.getName());
   46.99 +        mainAttrs.putValue("Can-Redefine-Classes", "true");
  46.100 +        mainAttrs.putValue("Can-Retransform-Classes", "true");
  46.101 +
  46.102 +        Path jar = Files.createTempFile("myagent", ".jar");
  46.103 +        try {
  46.104 +            JarOutputStream jarStream = new JarOutputStream(new FileOutputStream(jar.toFile()), manifest);
  46.105 +            add(jarStream, FooAgent.class);
  46.106 +            add(jarStream, FooTransformer.class);
  46.107 +            jarStream.close();
  46.108 +            runAgent(jar);
  46.109 +        } finally {
  46.110 +            Files.deleteIfExists(jar);
  46.111 +        }
  46.112 +    }
  46.113 +
  46.114 +    public static void runAgent(Path agent) throws Exception {
  46.115 +        String vmName = ManagementFactory.getRuntimeMXBean().getName();
  46.116 +        int p = vmName.indexOf('@');
  46.117 +        assert p != -1 : "VM name not in <pid>@<host> format: " + vmName;
  46.118 +        String pid = vmName.substring(0, p);
  46.119 +        ClassLoader cl = ToolProvider.getSystemToolClassLoader();
  46.120 +        Class<?> c = Class.forName("com.sun.tools.attach.VirtualMachine", true, cl);
  46.121 +        Method attach = c.getDeclaredMethod("attach", String.class);
  46.122 +        Method loadAgent = c.getDeclaredMethod("loadAgent", String.class);
  46.123 +        Method detach = c.getDeclaredMethod("detach");
  46.124 +        Object vm = attach.invoke(null, pid);
  46.125 +        loadAgent.invoke(vm, agent.toString());
  46.126 +        detach.invoke(vm);
  46.127 +    }
  46.128 +
  46.129 +    public static class FooAgent {
  46.130 +
  46.131 +        public static void agentmain(@SuppressWarnings("unused") String args, Instrumentation inst) throws Exception {
  46.132 +            assert inst.isRedefineClassesSupported();
  46.133 +            assert inst.isRetransformClassesSupported();
  46.134 +            inst.addTransformer(new FooTransformer(), true);
  46.135 +            Class<?>[] classes = inst.getAllLoadedClasses();
  46.136 +            for (int i = 0; i < classes.length; i++) {
  46.137 +                Class<?> c = classes[i];
  46.138 +                if (c == Foo.class) {
  46.139 +                    inst.retransformClasses(new Class[]{c});
  46.140 +                }
  46.141 +            }
  46.142 +        }
  46.143 +    }
  46.144 +
  46.145 +    static class FooTransformer implements ClassFileTransformer {
  46.146 +
  46.147 +        @Override
  46.148 +        public byte[] transform(ClassLoader cl, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws IllegalClassFormatException {
  46.149 +            if (Foo.class.equals(classBeingRedefined)) {
  46.150 +                System.out.println("redefining " + classBeingRedefined);
  46.151 +                ClassReader cr = new ClassReader(classfileBuffer);
  46.152 +                ClassWriter cw = new ClassWriter(cr, ClassWriter.COMPUTE_FRAMES);
  46.153 +                ClassVisitor adapter = new ClassVisitor(Opcodes.ASM5, cw) {
  46.154 +                    @Override
  46.155 +                    public MethodVisitor visitMethod(int access, String base, String desc, String signature, String[] exceptions) {
  46.156 +                        MethodVisitor mv = cv.visitMethod(access, base, desc, signature, exceptions);
  46.157 +                        if (mv != null) {
  46.158 +                            mv = new MethodVisitor(Opcodes.ASM5, mv) {
  46.159 +                                @Override
  46.160 +                                public void visitLdcInsn(Object cst) {
  46.161 +                                    System.out.println("replacing \"" + cst + "\" with \"bar\"");
  46.162 +                                    mv.visitLdcInsn("bar");
  46.163 +                                }
  46.164 +                            };
  46.165 +                        }
  46.166 +                        return mv;
  46.167 +                    }
  46.168 +                };
  46.169 +
  46.170 +                cr.accept(adapter, ClassReader.SKIP_FRAMES);
  46.171 +                cw.visitEnd();
  46.172 +                return cw.toByteArray();
  46.173 +            }
  46.174 +            return classfileBuffer;
  46.175 +        }
  46.176 +    }
  46.177 +}
    47.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    47.2 +++ b/test/compiler/loopopts/TestDeadBackbranchArrayAccess.java	Fri Dec 12 14:39:40 2014 -0800
    47.3 @@ -0,0 +1,58 @@
    47.4 +/*
    47.5 + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
    47.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    47.7 + *
    47.8 + * This code is free software; you can redistribute it and/or modify it
    47.9 + * under the terms of the GNU General Public License version 2 only, as
   47.10 + * published by the Free Software Foundation.
   47.11 + *
   47.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   47.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   47.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   47.15 + * version 2 for more details (a copy is included in the LICENSE file that
   47.16 + * accompanied this code).
   47.17 + *
   47.18 + * You should have received a copy of the GNU General Public License version
   47.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   47.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   47.21 + *
   47.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   47.23 + * or visit www.oracle.com if you need additional information or have any
   47.24 + * questions.
   47.25 + *
   47.26 + */
   47.27 +
   47.28 +/**
   47.29 + * @test
   47.30 + * @bug 8054478
   47.31 + * @summary dead backbranch in main loop results in erroneous array access
   47.32 + * @run main/othervm -XX:CompileOnly=TestDeadBackbranchArrayAccess -Xcomp TestDeadBackbranchArrayAccess
   47.33 + *
   47.34 + */
   47.35 +
   47.36 +public class TestDeadBackbranchArrayAccess {
   47.37 +    static char[] pattern0 = {0};
   47.38 +    static char[] pattern1 = {1};
   47.39 +
   47.40 +    static void test(char[] array) {
   47.41 +        if (pattern1 == null) return;
   47.42 +
   47.43 +        int i = 0;
   47.44 +        int pos = 0;
   47.45 +        char c = array[pos];
   47.46 +
   47.47 +        while (i >= 0 && (c == pattern0[i] || c == pattern1[i])) {
   47.48 +            i--;
   47.49 +            pos--;
   47.50 +            if (pos != -1) {
   47.51 +                c = array[pos];
   47.52 +            }
   47.53 +        }
   47.54 +    }
   47.55 +
   47.56 +    public static void main(String[] args) {
   47.57 +        for (int i = 0; i < 1000000; i++) {
   47.58 +            test(new char[1]);
   47.59 +        }
   47.60 +    }
   47.61 +}
    48.1 --- a/test/runtime/CheckEndorsedAndExtDirs/EndorsedExtDirs.java	Mon Dec 01 19:09:54 2014 -0800
    48.2 +++ b/test/runtime/CheckEndorsedAndExtDirs/EndorsedExtDirs.java	Fri Dec 12 14:39:40 2014 -0800
    48.3 @@ -26,10 +26,16 @@
    48.4   * @bug 8064667
    48.5   * @summary Sanity test for -XX:+CheckEndorsedAndExtDirs
    48.6   * @library /testlibrary
    48.7 - * @run main/othervm -XX:+CheckEndorsedAndExtDirs EndorsedExtDirs
    48.8 + * @run main/othervm EndorsedExtDirs
    48.9   */
   48.10  
   48.11  import com.oracle.java.testlibrary.*;
   48.12 +import java.io.File;
   48.13 +import java.io.IOException;
   48.14 +import java.nio.file.attribute.BasicFileAttributes;
   48.15 +import java.nio.file.Files;
   48.16 +import java.nio.file.Path;
   48.17 +import java.nio.file.Paths;
   48.18  import java.util.ArrayList;
   48.19  import java.util.List;
   48.20  
   48.21 @@ -38,9 +44,28 @@
   48.22      public static void main(String arg[]) throws Exception {
   48.23          fatalError("-XX:+CheckEndorsedAndExtDirs", "-Djava.endorsed.dirs=foo");
   48.24          fatalError("-XX:+CheckEndorsedAndExtDirs", "-Djava.ext.dirs=bar");
   48.25 +        testNonEmptySystemExtDirs();
   48.26      }
   48.27  
   48.28 -    static void fatalError(String... args) throws Exception {
   48.29 +    static void testNonEmptySystemExtDirs() throws Exception {
   48.30 +        String home = System.getProperty("java.home");
   48.31 +        Path ext = Paths.get(home, "lib", "ext");
   48.32 +        String extDirs = System.getProperty("java.ext.dirs");
   48.33 +        String[] dirs = extDirs.split(File.pathSeparator);
   48.34 +        long count = 0;
   48.35 +        for (String d : dirs) {
   48.36 +            Path path = Paths.get(d);
   48.37 +            if (Files.notExists(path) || path.equals(ext)) continue;
   48.38 +            count += Files.find(path, 1, (Path p, BasicFileAttributes attr)
   48.39 +                                       -> p.getFileName().toString().endsWith(".jar"))
   48.40 +                          .count();
   48.41 +        }
   48.42 +        if (count > 0) {
   48.43 +            fatalError("-XX:+CheckEndorsedAndExtDirs");
   48.44 +        }
   48.45 +    }
   48.46 +
   48.47 +    static ProcessBuilder newProcessBuilder(String... args) {
   48.48          List<String> commands = new ArrayList<>();
   48.49          String java = System.getProperty("java.home") + "/bin/java";
   48.50          commands.add(java);
   48.51 @@ -51,8 +76,15 @@
   48.52          commands.add(cpath);
   48.53          commands.add("EndorsedExtDirs");
   48.54  
   48.55 -        System.out.println("Launching " + commands);
   48.56 -        ProcessBuilder pb = new ProcessBuilder(commands);
   48.57 +        System.out.println("Process " + commands);
   48.58 +        return new ProcessBuilder(commands);
   48.59 +    }
   48.60 +
   48.61 +    static void fatalError(String... args) throws Exception {
   48.62 +        fatalError(newProcessBuilder(args));
   48.63 +    }
   48.64 +
   48.65 +    static void fatalError(ProcessBuilder pb) throws Exception {
   48.66          OutputAnalyzer output = new OutputAnalyzer(pb.start());
   48.67          output.shouldContain("Could not create the Java Virtual Machine");
   48.68          output.shouldHaveExitValue(1);
    49.1 --- a/test/testlibrary/whitebox/sun/hotspot/WhiteBox.java	Mon Dec 01 19:09:54 2014 -0800
    49.2 +++ b/test/testlibrary/whitebox/sun/hotspot/WhiteBox.java	Fri Dec 12 14:39:40 2014 -0800
    49.3 @@ -90,6 +90,10 @@
    49.4    public native URL[] getLookupCacheURLs(ClassLoader loader);
    49.5    public native int[] getLookupCacheMatches(ClassLoader loader, String name);
    49.6  
    49.7 +  // JVMTI
    49.8 +  public native void addToBootstrapClassLoaderSearch(String segment);
    49.9 +  public native void addToSystemClassLoaderSearch(String segment);
   49.10 +
   49.11    // G1
   49.12    public native boolean g1InConcurrentMark();
   49.13    public native boolean g1IsHumongous(Object o);

mercurial