annotate make/solaris/reorder.sh @ 2013:ec8c74742417

7005241: C1: SEGV in java.util.concurrent.LinkedTransferQueue.xfer() with compressed oops Summary: Implementation of the CAS primitive for x64 compressed oops was incorrect. It kills rscratch2 register (r11), which is allocatable in C1. Also, we don't need to restore cmpval as it's never used after that, so we need only one temporary register, which can be scratch1. Reviewed-by: kvn, never
author iveresov
date Wed, 08 Dec 2010 02:36:36 -0800
parents c18cbe5936b8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 #!/bin/sh -x
a61af66fc99e Initial load
duke
parents:
diff changeset
2 #
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 196
diff changeset
3 # Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
4 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
5 #
a61af66fc99e Initial load
duke
parents:
diff changeset
6 # This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
7 # under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
8 # published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
9 #
a61af66fc99e Initial load
duke
parents:
diff changeset
10 # This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
12 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
13 # version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
14 # accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
15 #
a61af66fc99e Initial load
duke
parents:
diff changeset
16 # You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
17 # 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
18 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
19 #
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 196
diff changeset
20 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 196
diff changeset
21 # or visit www.oracle.com if you need additional information or have any
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 196
diff changeset
22 # questions.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
23 #
a61af66fc99e Initial load
duke
parents:
diff changeset
24 #
a61af66fc99e Initial load
duke
parents:
diff changeset
25
a61af66fc99e Initial load
duke
parents:
diff changeset
26 # Generate the reorder data for hotspot.
a61af66fc99e Initial load
duke
parents:
diff changeset
27 #
a61af66fc99e Initial load
duke
parents:
diff changeset
28 # Usage:
a61af66fc99e Initial load
duke
parents:
diff changeset
29 #
a61af66fc99e Initial load
duke
parents:
diff changeset
30 # sh reorder.sh <test_sdk_workspace> <test_sdk> <jbb_dir>
a61af66fc99e Initial load
duke
parents:
diff changeset
31 #
a61af66fc99e Initial load
duke
parents:
diff changeset
32 # <test_sdk_workspace> is a *built* SDK workspace which contains the
a61af66fc99e Initial load
duke
parents:
diff changeset
33 # reordering tools for the SDK. This script relies on lib_mcount.so
a61af66fc99e Initial load
duke
parents:
diff changeset
34 # from this workspace.
a61af66fc99e Initial load
duke
parents:
diff changeset
35 #
a61af66fc99e Initial load
duke
parents:
diff changeset
36 # <test_sdk> is a working SDK which you can use to run the profiled
a61af66fc99e Initial load
duke
parents:
diff changeset
37 # JVMs in to collect data. You must be able to write to this SDK.
a61af66fc99e Initial load
duke
parents:
diff changeset
38 #
a61af66fc99e Initial load
duke
parents:
diff changeset
39 # <jbb_dir> is a directory containing JBB test jar files and properties
a61af66fc99e Initial load
duke
parents:
diff changeset
40 # which will be used to run the JBB test to provide reordering data
a61af66fc99e Initial load
duke
parents:
diff changeset
41 # for the server VM.
a61af66fc99e Initial load
duke
parents:
diff changeset
42 #
a61af66fc99e Initial load
duke
parents:
diff changeset
43 # Profiled builds of the VM are needed (before running this script),
a61af66fc99e Initial load
duke
parents:
diff changeset
44 # build with PROFILE_PRODUCT=1:
a61af66fc99e Initial load
duke
parents:
diff changeset
45 #
a61af66fc99e Initial load
duke
parents:
diff changeset
46 # gnumake profiled1 profiled PROFILE_PRODUCT=1
a61af66fc99e Initial load
duke
parents:
diff changeset
47 #
a61af66fc99e Initial load
duke
parents:
diff changeset
48 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a61af66fc99e Initial load
duke
parents:
diff changeset
49
a61af66fc99e Initial load
duke
parents:
diff changeset
50 test_setup() {
a61af66fc99e Initial load
duke
parents:
diff changeset
51
a61af66fc99e Initial load
duke
parents:
diff changeset
52 # $1 = "client" or "server"
a61af66fc99e Initial load
duke
parents:
diff changeset
53 # $2 = name of reorder file to be generated.
a61af66fc99e Initial load
duke
parents:
diff changeset
54
a61af66fc99e Initial load
duke
parents:
diff changeset
55 echo ""
a61af66fc99e Initial load
duke
parents:
diff changeset
56 echo "TEST_SETUP $1 $2"
a61af66fc99e Initial load
duke
parents:
diff changeset
57 echo ""
91
a294fd0c4b38 6583644: Move all managed/SCCS files out of 'build' into 'make' directory
kamg
parents: 0
diff changeset
58 libreldir=${ALT_OUTPUTDIR:-../../../make/solaris-$arch5}/reorder
a294fd0c4b38 6583644: Move all managed/SCCS files out of 'build' into 'make' directory
kamg
parents: 0
diff changeset
59 libabsdir=${ALT_OUTPUTDIR:-$sdk_ws/make/solaris-$arch5}/reorder
0
a61af66fc99e Initial load
duke
parents:
diff changeset
60 ( cd $sdk_ws/make/tools/reorder ; gnumake $libreldir/$arch5/libmcount.so )
a61af66fc99e Initial load
duke
parents:
diff changeset
61 if [ "${arch3}" = "i386" ] ; then
a61af66fc99e Initial load
duke
parents:
diff changeset
62 # On Solaris/x86 we need to remove the symbol _mcount from the command
a61af66fc99e Initial load
duke
parents:
diff changeset
63 ( cd $sdk_ws/make/tools/reorder ; \
a61af66fc99e Initial load
duke
parents:
diff changeset
64 gnumake $libreldir/$arch5/remove_mcount )
a61af66fc99e Initial load
duke
parents:
diff changeset
65 echo Remove _mcount from java command.
a61af66fc99e Initial load
duke
parents:
diff changeset
66 $libabsdir/$arch5/remove_mcount $jre/bin/java
a61af66fc99e Initial load
duke
parents:
diff changeset
67 fi
a61af66fc99e Initial load
duke
parents:
diff changeset
68 ( cd $sdk_ws/make/tools/reorder ; gnumake tool_classes )
a61af66fc99e Initial load
duke
parents:
diff changeset
69 ( cd $sdk_ws/make/tools/reorder ; gnumake test_classes )
a61af66fc99e Initial load
duke
parents:
diff changeset
70
a61af66fc99e Initial load
duke
parents:
diff changeset
71 tests="Null Exit Hello Sleep IntToString \
a61af66fc99e Initial load
duke
parents:
diff changeset
72 LoadToolkit LoadFrame LoadJFrame JHello"
a61af66fc99e Initial load
duke
parents:
diff changeset
73 swingset=$sdk/demo/jfc/SwingSet2/SwingSet2.jar
a61af66fc99e Initial load
duke
parents:
diff changeset
74 java=$jre/bin/java
a61af66fc99e Initial load
duke
parents:
diff changeset
75 if [ "X$LP64" != "X" ] ; then
a61af66fc99e Initial load
duke
parents:
diff changeset
76 testjava="$jre/bin/${arch3}/java"
a61af66fc99e Initial load
duke
parents:
diff changeset
77 else
a61af66fc99e Initial load
duke
parents:
diff changeset
78 testjava="$jre/bin/java"
a61af66fc99e Initial load
duke
parents:
diff changeset
79 fi
a61af66fc99e Initial load
duke
parents:
diff changeset
80 mcount=$libabsdir/$arch5/libmcount.so
a61af66fc99e Initial load
duke
parents:
diff changeset
81
a61af66fc99e Initial load
duke
parents:
diff changeset
82 if [ ! -x $mcount ] ; then
a61af66fc99e Initial load
duke
parents:
diff changeset
83 echo $mcount is missing!
a61af66fc99e Initial load
duke
parents:
diff changeset
84 exit 1
a61af66fc99e Initial load
duke
parents:
diff changeset
85 fi
a61af66fc99e Initial load
duke
parents:
diff changeset
86
a61af66fc99e Initial load
duke
parents:
diff changeset
87 if [ "X$1" = "client" ] ; then
a61af66fc99e Initial load
duke
parents:
diff changeset
88 if [ "X$NO_SHARING" = "X" ] ; then
a61af66fc99e Initial load
duke
parents:
diff changeset
89 echo "Dumping shared file."
a61af66fc99e Initial load
duke
parents:
diff changeset
90 LD_PRELOAD=$mcount \
a61af66fc99e Initial load
duke
parents:
diff changeset
91 JDK_ALTERNATE_VM=jvm_profiled \
a61af66fc99e Initial load
duke
parents:
diff changeset
92 $testjava -Xshare:dump -Xint -XX:PermSize=16m -version 2> /dev/null
a61af66fc99e Initial load
duke
parents:
diff changeset
93 shared_client="-Xshare:on"
a61af66fc99e Initial load
duke
parents:
diff changeset
94 echo "Shared file dump completed."
a61af66fc99e Initial load
duke
parents:
diff changeset
95 else
a61af66fc99e Initial load
duke
parents:
diff changeset
96 shared_client="-Xshare:off"
a61af66fc99e Initial load
duke
parents:
diff changeset
97 echo "NO_SHARING defined, not using sharing."
a61af66fc99e Initial load
duke
parents:
diff changeset
98 fi
a61af66fc99e Initial load
duke
parents:
diff changeset
99 else
a61af66fc99e Initial load
duke
parents:
diff changeset
100 echo "Server: no sharing"
a61af66fc99e Initial load
duke
parents:
diff changeset
101 shared_server="-Xshare:off"
a61af66fc99e Initial load
duke
parents:
diff changeset
102 fi
a61af66fc99e Initial load
duke
parents:
diff changeset
103
a61af66fc99e Initial load
duke
parents:
diff changeset
104 testpath=$libabsdir/classes
a61af66fc99e Initial load
duke
parents:
diff changeset
105
a61af66fc99e Initial load
duke
parents:
diff changeset
106 reorder_file=$2
a61af66fc99e Initial load
duke
parents:
diff changeset
107
a61af66fc99e Initial load
duke
parents:
diff changeset
108 rm -f ${reorder_file}
a61af66fc99e Initial load
duke
parents:
diff changeset
109 rm -f ${reorder_file}_tmp2
a61af66fc99e Initial load
duke
parents:
diff changeset
110 rm -f ${reorder_file}_tmp1
a61af66fc99e Initial load
duke
parents:
diff changeset
111
a61af66fc99e Initial load
duke
parents:
diff changeset
112 echo "data = R0x2000;" > ${reorder_file}
a61af66fc99e Initial load
duke
parents:
diff changeset
113 echo "text = LOAD ?RXO;" >> ${reorder_file}
a61af66fc99e Initial load
duke
parents:
diff changeset
114 echo "" >> ${reorder_file}
a61af66fc99e Initial load
duke
parents:
diff changeset
115 echo "" >> ${reorder_file}
a61af66fc99e Initial load
duke
parents:
diff changeset
116 }
a61af66fc99e Initial load
duke
parents:
diff changeset
117
a61af66fc99e Initial load
duke
parents:
diff changeset
118 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a61af66fc99e Initial load
duke
parents:
diff changeset
119
a61af66fc99e Initial load
duke
parents:
diff changeset
120 test_client() {
a61af66fc99e Initial load
duke
parents:
diff changeset
121
a61af66fc99e Initial load
duke
parents:
diff changeset
122 # Run each of a set of tests, extract the methods called,
a61af66fc99e Initial load
duke
parents:
diff changeset
123 # append the new functions to the reorder list.
a61af66fc99e Initial load
duke
parents:
diff changeset
124 # $1 = "client" or "server"
a61af66fc99e Initial load
duke
parents:
diff changeset
125 # $2 = name of reorder file to be generated.
a61af66fc99e Initial load
duke
parents:
diff changeset
126
a61af66fc99e Initial load
duke
parents:
diff changeset
127 echo "TEST_CLIENT $1 $2."
a61af66fc99e Initial load
duke
parents:
diff changeset
128 test_setup $1 $2
a61af66fc99e Initial load
duke
parents:
diff changeset
129 echo "TEST_CLIENT $1 $2."
a61af66fc99e Initial load
duke
parents:
diff changeset
130
a61af66fc99e Initial load
duke
parents:
diff changeset
131 for f in $tests ; do
a61af66fc99e Initial load
duke
parents:
diff changeset
132 echo Running test $f.
a61af66fc99e Initial load
duke
parents:
diff changeset
133 rm -f ${reorder_file}_tmp1
a61af66fc99e Initial load
duke
parents:
diff changeset
134 echo "# Test $f" >> ${reorder_file}
a61af66fc99e Initial load
duke
parents:
diff changeset
135
a61af66fc99e Initial load
duke
parents:
diff changeset
136 echo "Using LD_PRELOAD=$mcount"
a61af66fc99e Initial load
duke
parents:
diff changeset
137 echo $testjava ${shared_client} -classpath $testpath $f
a61af66fc99e Initial load
duke
parents:
diff changeset
138
a61af66fc99e Initial load
duke
parents:
diff changeset
139 LD_PRELOAD=$mcount \
a61af66fc99e Initial load
duke
parents:
diff changeset
140 JDK_ALTERNATE_VM=jvm_profiled \
a61af66fc99e Initial load
duke
parents:
diff changeset
141 $testjava ${shared_client} -classpath $testpath $f 2> ${reorder_file}_tmp1
a61af66fc99e Initial load
duke
parents:
diff changeset
142
a61af66fc99e Initial load
duke
parents:
diff changeset
143 echo "Done."
a61af66fc99e Initial load
duke
parents:
diff changeset
144 sed -n -e '/^text:/p' ${reorder_file}_tmp1 > ${reorder_file}_tmp2
a61af66fc99e Initial load
duke
parents:
diff changeset
145 sed -e '/^text:/d' ${reorder_file}_tmp1
a61af66fc99e Initial load
duke
parents:
diff changeset
146 LD_LIBRARY_PATH=$lib/server \
a61af66fc99e Initial load
duke
parents:
diff changeset
147 $java -classpath $testpath Combine ${reorder_file} \
a61af66fc99e Initial load
duke
parents:
diff changeset
148 ${reorder_file}_tmp2 \
a61af66fc99e Initial load
duke
parents:
diff changeset
149 > ${reorder_file}_tmp3
a61af66fc99e Initial load
duke
parents:
diff changeset
150 mv ${reorder_file}_tmp3 ${reorder_file}
a61af66fc99e Initial load
duke
parents:
diff changeset
151 rm -f ${reorder_file}_tmp2
a61af66fc99e Initial load
duke
parents:
diff changeset
152 rm -f ${reorder_file}_tmp1
a61af66fc99e Initial load
duke
parents:
diff changeset
153 done
a61af66fc99e Initial load
duke
parents:
diff changeset
154
a61af66fc99e Initial load
duke
parents:
diff changeset
155 # Run SwingSet, extract the methods called,
a61af66fc99e Initial load
duke
parents:
diff changeset
156 # append the new functions to the reorder list.
a61af66fc99e Initial load
duke
parents:
diff changeset
157
a61af66fc99e Initial load
duke
parents:
diff changeset
158 echo "# SwingSet" >> ${reorder_file}
a61af66fc99e Initial load
duke
parents:
diff changeset
159
a61af66fc99e Initial load
duke
parents:
diff changeset
160 echo ""
a61af66fc99e Initial load
duke
parents:
diff changeset
161 echo ""
a61af66fc99e Initial load
duke
parents:
diff changeset
162 echo "When SwingSet has finished drawing, " \
a61af66fc99e Initial load
duke
parents:
diff changeset
163 "you may terminate it (with your mouse)."
a61af66fc99e Initial load
duke
parents:
diff changeset
164 echo "Otherwise, it should be automatically terminated in 3 minutes."
a61af66fc99e Initial load
duke
parents:
diff changeset
165 echo ""
a61af66fc99e Initial load
duke
parents:
diff changeset
166 echo ""
a61af66fc99e Initial load
duke
parents:
diff changeset
167
a61af66fc99e Initial load
duke
parents:
diff changeset
168 echo "Using LD_PRELOAD=$mcount, JDK_ALTERNATE=jvm_profiled."
a61af66fc99e Initial load
duke
parents:
diff changeset
169 echo $testjava ${shared_client} -classpath $testpath MaxTime $swingset 60
a61af66fc99e Initial load
duke
parents:
diff changeset
170 LD_PRELOAD=$mcount \
a61af66fc99e Initial load
duke
parents:
diff changeset
171 JDK_ALTERNATE_VM=jvm_profiled \
a61af66fc99e Initial load
duke
parents:
diff changeset
172 $testjava ${shared_client} -classpath $testpath MaxTime \
a61af66fc99e Initial load
duke
parents:
diff changeset
173 $swingset 60 2> ${reorder_file}_tmp1
a61af66fc99e Initial load
duke
parents:
diff changeset
174
a61af66fc99e Initial load
duke
parents:
diff changeset
175 sed -n -e '/^text:/p' ${reorder_file}_tmp1 > ${reorder_file}_tmp2
a61af66fc99e Initial load
duke
parents:
diff changeset
176
a61af66fc99e Initial load
duke
parents:
diff changeset
177 LD_LIBRARY_PATH=$lib/server \
a61af66fc99e Initial load
duke
parents:
diff changeset
178 $java -server -classpath $testpath Combine ${reorder_file} ${reorder_file}_tmp2 \
a61af66fc99e Initial load
duke
parents:
diff changeset
179 > ${reorder_file}_tmp3
a61af66fc99e Initial load
duke
parents:
diff changeset
180 echo mv ${reorder_file}_tmp3 ${reorder_file}
a61af66fc99e Initial load
duke
parents:
diff changeset
181 mv ${reorder_file}_tmp3 ${reorder_file}
a61af66fc99e Initial load
duke
parents:
diff changeset
182 echo rm -f ${reorder_file}_tmp2
a61af66fc99e Initial load
duke
parents:
diff changeset
183 rm -f ${reorder_file}_tmp2
a61af66fc99e Initial load
duke
parents:
diff changeset
184 echo rm -f ${reorder_file}_tmp1
a61af66fc99e Initial load
duke
parents:
diff changeset
185 rm -f ${reorder_file}_tmp1
a61af66fc99e Initial load
duke
parents:
diff changeset
186 }
a61af66fc99e Initial load
duke
parents:
diff changeset
187
a61af66fc99e Initial load
duke
parents:
diff changeset
188 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a61af66fc99e Initial load
duke
parents:
diff changeset
189
a61af66fc99e Initial load
duke
parents:
diff changeset
190 test_server() {
a61af66fc99e Initial load
duke
parents:
diff changeset
191
a61af66fc99e Initial load
duke
parents:
diff changeset
192 # Run the JBB script, collecting data on the way.
a61af66fc99e Initial load
duke
parents:
diff changeset
193 # $1 = "client" or "server"
a61af66fc99e Initial load
duke
parents:
diff changeset
194 # $2 = name of reorder file to be generated.
a61af66fc99e Initial load
duke
parents:
diff changeset
195
a61af66fc99e Initial load
duke
parents:
diff changeset
196 echo "TEST_SERVER $1 $2."
a61af66fc99e Initial load
duke
parents:
diff changeset
197 test_setup $1 $2
a61af66fc99e Initial load
duke
parents:
diff changeset
198 echo "TEST_SERVER $1 $2."
a61af66fc99e Initial load
duke
parents:
diff changeset
199
a61af66fc99e Initial load
duke
parents:
diff changeset
200 echo Running JBB.
a61af66fc99e Initial load
duke
parents:
diff changeset
201
a61af66fc99e Initial load
duke
parents:
diff changeset
202 rm -f ${reorder_file}_tmp1
a61af66fc99e Initial load
duke
parents:
diff changeset
203 rm -f ${reorder_file}_tmp2
a61af66fc99e Initial load
duke
parents:
diff changeset
204 heap=200m
a61af66fc99e Initial load
duke
parents:
diff changeset
205
a61af66fc99e Initial load
duke
parents:
diff changeset
206 CLASSPATH=jbb.jar:jbb_no_precompile.jar:check.jar:reporter.jar
a61af66fc99e Initial load
duke
parents:
diff changeset
207
a61af66fc99e Initial load
duke
parents:
diff changeset
208 ( cd $jbb_dir; LD_PRELOAD=$mcount MCOUNT_ORDER_BY_COUNT=1 \
a61af66fc99e Initial load
duke
parents:
diff changeset
209 JDK_ALTERNATE_VM=jvm_profiled \
a61af66fc99e Initial load
duke
parents:
diff changeset
210 $testjava ${shared_server} -classpath $CLASSPATH -Xms${heap} -Xmx${heap} \
a61af66fc99e Initial load
duke
parents:
diff changeset
211 spec.jbb.JBBmain -propfile SPECjbb.props ) 2> ${reorder_file}_tmp1
a61af66fc99e Initial load
duke
parents:
diff changeset
212
a61af66fc99e Initial load
duke
parents:
diff changeset
213 sed -n -e '/^text:/p' ${reorder_file}_tmp1 > ${reorder_file}_tmp2
a61af66fc99e Initial load
duke
parents:
diff changeset
214 sed -e '/^text:/d' ${reorder_file}_tmp1
a61af66fc99e Initial load
duke
parents:
diff changeset
215 cat ${reorder_file}_tmp2 >> ${reorder_file}
a61af66fc99e Initial load
duke
parents:
diff changeset
216 rm -f ${reorder_file}_tmp2
a61af66fc99e Initial load
duke
parents:
diff changeset
217 rm -f ${reorder_file}_tmp1
a61af66fc99e Initial load
duke
parents:
diff changeset
218 }
a61af66fc99e Initial load
duke
parents:
diff changeset
219
a61af66fc99e Initial load
duke
parents:
diff changeset
220 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a61af66fc99e Initial load
duke
parents:
diff changeset
221
a61af66fc99e Initial load
duke
parents:
diff changeset
222 # Rename the old VMs, copy the new in, run the test, and put the
a61af66fc99e Initial load
duke
parents:
diff changeset
223 # old one back.
a61af66fc99e Initial load
duke
parents:
diff changeset
224
a61af66fc99e Initial load
duke
parents:
diff changeset
225 copy_and_test() {
a61af66fc99e Initial load
duke
parents:
diff changeset
226
a61af66fc99e Initial load
duke
parents:
diff changeset
227 # $1 = "client" or "server"
a61af66fc99e Initial load
duke
parents:
diff changeset
228 # $2 = name of reorder file to be generated.
a61af66fc99e Initial load
duke
parents:
diff changeset
229 # $3 = profiled jvm to copy in
a61af66fc99e Initial load
duke
parents:
diff changeset
230
a61af66fc99e Initial load
duke
parents:
diff changeset
231 echo "COPY_AND_TEST ($1, $2, $3)."
a61af66fc99e Initial load
duke
parents:
diff changeset
232 # $2 = name of reorder file to be generated.
a61af66fc99e Initial load
duke
parents:
diff changeset
233 # $3 = profiled jvm to copy in
a61af66fc99e Initial load
duke
parents:
diff changeset
234
a61af66fc99e Initial load
duke
parents:
diff changeset
235 rm -rf $lib/jvm_profiled
a61af66fc99e Initial load
duke
parents:
diff changeset
236 mkdir $lib/jvm_profiled
a61af66fc99e Initial load
duke
parents:
diff changeset
237 cp $3 $lib/jvm_profiled
a61af66fc99e Initial load
duke
parents:
diff changeset
238 test_$1 $1 $2
a61af66fc99e Initial load
duke
parents:
diff changeset
239 rm -rf $lib/jvm_profiled
a61af66fc99e Initial load
duke
parents:
diff changeset
240 }
a61af66fc99e Initial load
duke
parents:
diff changeset
241
a61af66fc99e Initial load
duke
parents:
diff changeset
242 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a61af66fc99e Initial load
duke
parents:
diff changeset
243
a61af66fc99e Initial load
duke
parents:
diff changeset
244
a61af66fc99e Initial load
duke
parents:
diff changeset
245 # Check arguments:
a61af66fc99e Initial load
duke
parents:
diff changeset
246
a61af66fc99e Initial load
duke
parents:
diff changeset
247 if [ $# != 3 ] ; then
a61af66fc99e Initial load
duke
parents:
diff changeset
248 echo ""
a61af66fc99e Initial load
duke
parents:
diff changeset
249 echo "Usage:"
a61af66fc99e Initial load
duke
parents:
diff changeset
250 echo " sh reorder.sh <test_sdk_workspace> <test_sdk> <jbb_dir>"
a61af66fc99e Initial load
duke
parents:
diff changeset
251 echo ""
a61af66fc99e Initial load
duke
parents:
diff changeset
252 exit 1
a61af66fc99e Initial load
duke
parents:
diff changeset
253 fi
a61af66fc99e Initial load
duke
parents:
diff changeset
254
a61af66fc99e Initial load
duke
parents:
diff changeset
255 sdk_ws=$1
a61af66fc99e Initial load
duke
parents:
diff changeset
256 if [ ! -r $sdk_ws/make/tools/reorder/Makefile ] ; then
a61af66fc99e Initial load
duke
parents:
diff changeset
257 echo ""
a61af66fc99e Initial load
duke
parents:
diff changeset
258 echo "test workspace "$sdk_ws" does not contain the reordering tools."
a61af66fc99e Initial load
duke
parents:
diff changeset
259 echo ""
a61af66fc99e Initial load
duke
parents:
diff changeset
260 exit 1
a61af66fc99e Initial load
duke
parents:
diff changeset
261 fi
a61af66fc99e Initial load
duke
parents:
diff changeset
262
a61af66fc99e Initial load
duke
parents:
diff changeset
263 sdk=$2
a61af66fc99e Initial load
duke
parents:
diff changeset
264 jre=$sdk/jre
a61af66fc99e Initial load
duke
parents:
diff changeset
265
a61af66fc99e Initial load
duke
parents:
diff changeset
266 # Set up architecture names as needed by various components.
a61af66fc99e Initial load
duke
parents:
diff changeset
267 # Why couldn't we just use x86 for everything?
a61af66fc99e Initial load
duke
parents:
diff changeset
268
a61af66fc99e Initial load
duke
parents:
diff changeset
269 # Arch name as used in JRE runtime (eg. i386):
a61af66fc99e Initial load
duke
parents:
diff changeset
270 # .../jre/lib/${arch3}/server
a61af66fc99e Initial load
duke
parents:
diff changeset
271 arch3=`uname -p`
a61af66fc99e Initial load
duke
parents:
diff changeset
272
a61af66fc99e Initial load
duke
parents:
diff changeset
273 # Arch name as used in Hotspot build: (eg. i486)
91
a294fd0c4b38 6583644: Move all managed/SCCS files out of 'build' into 'make' directory
kamg
parents: 0
diff changeset
274 # /export/hotspot/make/solaris/solaris_${arch4}_compiler1
0
a61af66fc99e Initial load
duke
parents:
diff changeset
275 arch4=$arch3
a61af66fc99e Initial load
duke
parents:
diff changeset
276
a61af66fc99e Initial load
duke
parents:
diff changeset
277 # Arch name as used in SDK build (eg. i586):
91
a294fd0c4b38 6583644: Move all managed/SCCS files out of 'build' into 'make' directory
kamg
parents: 0
diff changeset
278 # /export/tiger/make/solaris-${arch3}
0
a61af66fc99e Initial load
duke
parents:
diff changeset
279 arch5=$arch3
a61af66fc99e Initial load
duke
parents:
diff changeset
280
a61af66fc99e Initial load
duke
parents:
diff changeset
281 # Tweak for 64-bit sparc builds. At least they all agree.
a61af66fc99e Initial load
duke
parents:
diff changeset
282 if [ $arch3 = sparc -a "X$LP64" != "X" ] ; then
a61af66fc99e Initial load
duke
parents:
diff changeset
283 arch3=sparcv9
a61af66fc99e Initial load
duke
parents:
diff changeset
284 arch4=sparcv9
a61af66fc99e Initial load
duke
parents:
diff changeset
285 arch5=sparcv9
a61af66fc99e Initial load
duke
parents:
diff changeset
286 fi
a61af66fc99e Initial load
duke
parents:
diff changeset
287
a61af66fc99e Initial load
duke
parents:
diff changeset
288 # Tweak for 64-bit i386 == amd64 builds. At least they all agree.
a61af66fc99e Initial load
duke
parents:
diff changeset
289 if [ $arch3 = i386 -a "X$LP64" != "X" ] ; then
a61af66fc99e Initial load
duke
parents:
diff changeset
290 arch3=amd64
a61af66fc99e Initial load
duke
parents:
diff changeset
291 arch4=amd64
a61af66fc99e Initial load
duke
parents:
diff changeset
292 arch5=amd64
a61af66fc99e Initial load
duke
parents:
diff changeset
293 fi
a61af66fc99e Initial load
duke
parents:
diff changeset
294
a61af66fc99e Initial load
duke
parents:
diff changeset
295 # Tweak for x86 builds. All different.
a61af66fc99e Initial load
duke
parents:
diff changeset
296 if [ $arch3 = i386 ] ; then
a61af66fc99e Initial load
duke
parents:
diff changeset
297 arch4=i486
a61af66fc99e Initial load
duke
parents:
diff changeset
298 arch5=i586
a61af66fc99e Initial load
duke
parents:
diff changeset
299 fi
a61af66fc99e Initial load
duke
parents:
diff changeset
300
a61af66fc99e Initial load
duke
parents:
diff changeset
301 lib=$jre/lib/$arch3
a61af66fc99e Initial load
duke
parents:
diff changeset
302 if [ ! -r $jre/lib/rt.jar ] ; then
a61af66fc99e Initial load
duke
parents:
diff changeset
303 echo ""
a61af66fc99e Initial load
duke
parents:
diff changeset
304 echo "test SDK "$sdk" is not a suitable SDK."
a61af66fc99e Initial load
duke
parents:
diff changeset
305 echo ""
a61af66fc99e Initial load
duke
parents:
diff changeset
306 exit 1
a61af66fc99e Initial load
duke
parents:
diff changeset
307 fi
a61af66fc99e Initial load
duke
parents:
diff changeset
308
a61af66fc99e Initial load
duke
parents:
diff changeset
309 jbb_dir=$3
a61af66fc99e Initial load
duke
parents:
diff changeset
310 if [ ! -r $jbb_dir/jbb.jar ] ; then
a61af66fc99e Initial load
duke
parents:
diff changeset
311 echo ""
a61af66fc99e Initial load
duke
parents:
diff changeset
312 echo "jbb.jar not present in $jbb_dir"
a61af66fc99e Initial load
duke
parents:
diff changeset
313 echo ""
a61af66fc99e Initial load
duke
parents:
diff changeset
314 exit 1
a61af66fc99e Initial load
duke
parents:
diff changeset
315 fi
a61af66fc99e Initial load
duke
parents:
diff changeset
316
a61af66fc99e Initial load
duke
parents:
diff changeset
317
a61af66fc99e Initial load
duke
parents:
diff changeset
318 # Were profiled VMs built?
a61af66fc99e Initial load
duke
parents:
diff changeset
319
a61af66fc99e Initial load
duke
parents:
diff changeset
320 if [ "X$LP64" != "X" ] ; then
a61af66fc99e Initial load
duke
parents:
diff changeset
321 if [ ! -r solaris_${arch4}_compiler2/profiled/libjvm.so ] ; then
a61af66fc99e Initial load
duke
parents:
diff changeset
322 echo ""
a61af66fc99e Initial load
duke
parents:
diff changeset
323 echo "Profiled builds of compiler2 are needed first."
a61af66fc99e Initial load
duke
parents:
diff changeset
324 echo ' -- build with "make profiled PROFILE_PRODUCT=1" -- '
a61af66fc99e Initial load
duke
parents:
diff changeset
325 echo "<solaris_${arch4}_compiler2/profiled/libjvm.so>"
a61af66fc99e Initial load
duke
parents:
diff changeset
326 exit 1
a61af66fc99e Initial load
duke
parents:
diff changeset
327 fi
a61af66fc99e Initial load
duke
parents:
diff changeset
328 else
a61af66fc99e Initial load
duke
parents:
diff changeset
329 if [ ! -r solaris_${arch4}_compiler1/profiled/libjvm.so \
a61af66fc99e Initial load
duke
parents:
diff changeset
330 -o ! -r solaris_${arch4}_compiler2/profiled/libjvm.so ] ; then
a61af66fc99e Initial load
duke
parents:
diff changeset
331 echo ""
a61af66fc99e Initial load
duke
parents:
diff changeset
332 echo "Profiled builds of compiler1 and compiler2 are needed first."
a61af66fc99e Initial load
duke
parents:
diff changeset
333 echo ' -- build with "make profiled{,1} PROFILE_PRODUCT=1" -- '
a61af66fc99e Initial load
duke
parents:
diff changeset
334 exit 1
a61af66fc99e Initial load
duke
parents:
diff changeset
335 fi
a61af66fc99e Initial load
duke
parents:
diff changeset
336 fi
a61af66fc99e Initial load
duke
parents:
diff changeset
337
a61af66fc99e Initial load
duke
parents:
diff changeset
338
a61af66fc99e Initial load
duke
parents:
diff changeset
339 # Compiler1 - not supported in 64-bit (b69 java launcher rejects it).
a61af66fc99e Initial load
duke
parents:
diff changeset
340
a61af66fc99e Initial load
duke
parents:
diff changeset
341 if [ "X$LP64" = "X" ] ; then
a61af66fc99e Initial load
duke
parents:
diff changeset
342 #gnumake profiled1
a61af66fc99e Initial load
duke
parents:
diff changeset
343 echo Using profiled client VM.
a61af66fc99e Initial load
duke
parents:
diff changeset
344 echo
a61af66fc99e Initial load
duke
parents:
diff changeset
345 copy_and_test client \
a61af66fc99e Initial load
duke
parents:
diff changeset
346 reorder_COMPILER1_$arch4 \
a61af66fc99e Initial load
duke
parents:
diff changeset
347 solaris_${arch4}_compiler1/profiled/libjvm.so
a61af66fc99e Initial load
duke
parents:
diff changeset
348 fi
a61af66fc99e Initial load
duke
parents:
diff changeset
349
a61af66fc99e Initial load
duke
parents:
diff changeset
350 #gnumake profiled
a61af66fc99e Initial load
duke
parents:
diff changeset
351 echo Using profiled server VM.
a61af66fc99e Initial load
duke
parents:
diff changeset
352 echo
a61af66fc99e Initial load
duke
parents:
diff changeset
353 copy_and_test server \
a61af66fc99e Initial load
duke
parents:
diff changeset
354 reorder_COMPILER2_$arch4 \
a61af66fc99e Initial load
duke
parents:
diff changeset
355 solaris_${arch4}_compiler2/profiled/libjvm.so