Print this page
rev 4502 : 7115383: TEST_BUG: some jtreg tests fail because they explicitly specify -server option
Summary: Small changes to hotspot tests to remove "-server" and replace with ${TESTVMOPTS}
Reviewed-by: kvn
Split |
Split |
Close |
Expand all |
Collapse all |
--- old/test/compiler/6589834/Test_ia32.java
+++ new/test/compiler/6589834/Test_ia32.java
1 1 /*
2 2 * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 4 *
5 5 * This code is free software; you can redistribute it and/or modify it
6 6 * under the terms of the GNU General Public License version 2 only, as
7 7 * published by the Free Software Foundation.
8 8 *
9 9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 12 * version 2 for more details (a copy is included in the LICENSE file that
13 13 * accompanied this code).
14 14 *
15 15 * You should have received a copy of the GNU General Public License version
16 16 * 2 along with this work; if not, write to the Free Software Foundation,
17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 18 *
↓ open down ↓ |
18 lines elided |
↑ open up ↑ |
19 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 20 * or visit www.oracle.com if you need additional information or have any
21 21 * questions.
22 22 */
23 23
24 24 /**
25 25 * @test
26 26 * @bug 6589834
27 27 * @summary deoptimization problem with -XX:+DeoptimizeALot
28 28 *
29 - * @run main/othervm -server Test_ia32
29 + * @run main Test_ia32
30 30 */
31 31
32 32 /***************************************************************************************
33 33 NOTE: The bug shows up (with several "Bug!" message) even without the
34 34 flag -XX:+DeoptimizeALot. In a debug build, you may want to try
35 35 the flags -XX:+VerifyStack and -XX:+DeoptimizeALot to get more information.
36 36 ****************************************************************************************/
37 37 import java.lang.reflect.Constructor;
38 38
39 39 public class Test_ia32 {
40 40
41 41 public static int NUM_THREADS = 100;
42 42
43 43 public static int CLONE_LENGTH = 1000;
44 44
45 45 public static void main(String[] args) throws InterruptedException, ClassNotFoundException {
46 46
47 47 Reflector[] threads = new Reflector[NUM_THREADS];
48 48 for (int i = 0; i < threads.length; i++) {
49 49 threads[i] = new Reflector();
50 50 threads[i].start();
51 51 }
52 52
53 53 System.out.println("Give Reflector.run() some time to compile...");
54 54 Thread.sleep(5000);
55 55
56 56 System.out.println("Load RMISecurityException causing run() deoptimization");
57 57 ClassLoader.getSystemClassLoader().loadClass("java.rmi.RMISecurityException");
58 58
59 59 for (Reflector thread : threads)
60 60 thread.requestStop();
61 61
62 62 for (Reflector thread : threads)
63 63 try {
64 64 thread.join();
65 65 } catch (InterruptedException e) {
66 66 System.out.println(e);
67 67 }
68 68
69 69 }
70 70
71 71 }
72 72
73 73 class Reflector extends Thread {
74 74
75 75 volatile boolean _doSpin = true;
76 76
77 77 Test_ia32[] _tests;
78 78
79 79 Reflector() {
80 80 _tests = new Test_ia32[Test_ia32.CLONE_LENGTH];
81 81 for (int i = 0; i < _tests.length; i++) {
82 82 _tests[i] = new Test_ia32();
83 83 }
84 84 }
85 85
86 86 static int g(int i1, int i2, Test_ia32[] arr, int i3, int i4) {
87 87
88 88 if (!(i1==1 && i2==2 && i3==3 && i4==4)) {
89 89 System.out.println("Bug!");
90 90 }
91 91
92 92 return arr.length;
93 93 }
94 94
95 95 static int f(Test_ia32[] arr) {
96 96 return g(1, 2, arr.clone(), 3, 4);
97 97 }
98 98
99 99 @Override
100 100 public void run() {
101 101 Constructor[] ctrs = null;
102 102 Class<Test_ia32> klass = Test_ia32.class;
103 103 try {
104 104 ctrs = klass.getConstructors();
105 105 } catch (SecurityException e) {
106 106 System.out.println(e);
107 107 }
108 108
109 109 try {
110 110 while (_doSpin) {
111 111 if (f(_tests) < 0)
112 112 System.out.println("return value usage");
113 113 }
114 114 } catch (NullPointerException e) {
115 115 e.printStackTrace();
116 116 }
117 117
118 118 System.out.println(this + " - stopped.");
119 119 }
120 120
121 121 public void requestStop() {
122 122 System.out.println(this + " - stop requested.");
123 123 _doSpin = false;
124 124 }
125 125
126 126 }
↓ open down ↓ |
87 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX