author | adlertz |
Fri, 24 Jan 2014 13:06:52 +0100 | |
changeset 22804 | 401135897b65 |
parent 5547 | f4b087cbb361 |
permissions | -rw-r--r-- |
4092 | 1 |
/* |
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
4092
diff
changeset
|
2 |
* Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. |
4092 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. |
|
8 |
* |
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
* accompanied this code). |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License version |
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 |
* |
|
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
4092
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
4092
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
4092
diff
changeset
|
21 |
* questions. |
4092 | 22 |
* |
23 |
*/ |
|
24 |
||
25 |
/** |
|
26 |
* @test |
|
27 |
* @bug 6891750 |
|
28 |
* @summary deopt blob kills values in O5 |
|
29 |
* |
|
30 |
* @run main Test6891750 |
|
31 |
*/ |
|
32 |
||
33 |
abstract class Base6891750 extends Thread { |
|
34 |
abstract public long m(); |
|
35 |
} |
|
36 |
class Other6891750 extends Base6891750 { |
|
37 |
public long m() { |
|
38 |
return 0; |
|
39 |
} |
|
40 |
} |
|
41 |
||
42 |
public class Test6891750 extends Base6891750 { |
|
43 |
Base6891750 d; |
|
44 |
volatile long value = 9; |
|
45 |
||
46 |
static int limit = 400000; |
|
47 |
||
48 |
Test6891750() { |
|
49 |
d = this; |
|
50 |
||
51 |
} |
|
52 |
public long m() { |
|
53 |
return value; |
|
54 |
} |
|
55 |
||
56 |
public long test(boolean doit) { |
|
57 |
if (doit) { |
|
58 |
long total0 = 0; |
|
59 |
long total1 = 0; |
|
60 |
long total2 = 0; |
|
61 |
long total3 = 0; |
|
62 |
long total4 = 0; |
|
63 |
long total5 = 0; |
|
64 |
long total6 = 0; |
|
65 |
long total7 = 0; |
|
66 |
long total8 = 0; |
|
67 |
long total9 = 0; |
|
68 |
for (int i = 0; i < limit; i++) { |
|
69 |
total0 += d.m(); |
|
70 |
total1 += d.m(); |
|
71 |
total2 += d.m(); |
|
72 |
total3 += d.m(); |
|
73 |
total4 += d.m(); |
|
74 |
total5 += d.m(); |
|
75 |
total6 += d.m(); |
|
76 |
total7 += d.m(); |
|
77 |
total8 += d.m(); |
|
78 |
total9 += d.m(); |
|
79 |
} |
|
80 |
return total0 + total1 + total2 + total3 + total4 + total5 + total6 + total7 + total8 + total9; |
|
81 |
} |
|
82 |
return 0; |
|
83 |
} |
|
84 |
||
85 |
public void run() { |
|
86 |
long result = test(true); |
|
87 |
for (int i = 0; i < 300; i++) { |
|
88 |
long result2 = test(true); |
|
89 |
if (result != result2) { |
|
90 |
throw new InternalError(result + " != " + result2); |
|
91 |
} |
|
92 |
} |
|
93 |
} |
|
94 |
||
95 |
public static void main(String[] args) throws Exception { |
|
96 |
Test6891750 Test6891750 = new Test6891750(); |
|
97 |
// warm it up |
|
98 |
for (int i = 0; i < 200000; i++) { |
|
99 |
Test6891750.test(false); |
|
100 |
} |
|
101 |
// set in off running |
|
102 |
Test6891750.start(); |
|
103 |
Thread.sleep(2000); |
|
104 |
||
105 |
// Load a class to invalidate CHA |
|
106 |
new Other6891750(); |
|
107 |
} |
|
108 |
} |