annotate test/compiler/6885584/Test6885584.java @ 15001:27c04ee36dcb

input types
author Lukas Stadler <lukas.stadler@oracle.com>
date Mon, 07 Apr 2014 11:32:04 +0200
parents c18cbe5936b8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1009
03b336640699 6885584: A particular class structure causes large allocation spike for jit
never
parents:
diff changeset
1 /*
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1009
diff changeset
2 * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
1009
03b336640699 6885584: A particular class structure causes large allocation spike for jit
never
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
03b336640699 6885584: A particular class structure causes large allocation spike for jit
never
parents:
diff changeset
4 *
03b336640699 6885584: A particular class structure causes large allocation spike for jit
never
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
03b336640699 6885584: A particular class structure causes large allocation spike for jit
never
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
03b336640699 6885584: A particular class structure causes large allocation spike for jit
never
parents:
diff changeset
7 * published by the Free Software Foundation.
03b336640699 6885584: A particular class structure causes large allocation spike for jit
never
parents:
diff changeset
8 *
03b336640699 6885584: A particular class structure causes large allocation spike for jit
never
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
03b336640699 6885584: A particular class structure causes large allocation spike for jit
never
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
03b336640699 6885584: A particular class structure causes large allocation spike for jit
never
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
03b336640699 6885584: A particular class structure causes large allocation spike for jit
never
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
03b336640699 6885584: A particular class structure causes large allocation spike for jit
never
parents:
diff changeset
13 * accompanied this code).
03b336640699 6885584: A particular class structure causes large allocation spike for jit
never
parents:
diff changeset
14 *
03b336640699 6885584: A particular class structure causes large allocation spike for jit
never
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
03b336640699 6885584: A particular class structure causes large allocation spike for jit
never
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
03b336640699 6885584: A particular class structure causes large allocation spike for jit
never
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
03b336640699 6885584: A particular class structure causes large allocation spike for jit
never
parents:
diff changeset
18 *
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1009
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1009
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1009
diff changeset
21 * questions.
1009
03b336640699 6885584: A particular class structure causes large allocation spike for jit
never
parents:
diff changeset
22 *
03b336640699 6885584: A particular class structure causes large allocation spike for jit
never
parents:
diff changeset
23 */
03b336640699 6885584: A particular class structure causes large allocation spike for jit
never
parents:
diff changeset
24
03b336640699 6885584: A particular class structure causes large allocation spike for jit
never
parents:
diff changeset
25 /**
03b336640699 6885584: A particular class structure causes large allocation spike for jit
never
parents:
diff changeset
26 * @test
03b336640699 6885584: A particular class structure causes large allocation spike for jit
never
parents:
diff changeset
27 * @bug 6885584
03b336640699 6885584: A particular class structure causes large allocation spike for jit
never
parents:
diff changeset
28 * @summary A particular class structure causes large allocation spike for jit
03b336640699 6885584: A particular class structure causes large allocation spike for jit
never
parents:
diff changeset
29 *
03b336640699 6885584: A particular class structure causes large allocation spike for jit
never
parents:
diff changeset
30 * @run main/othervm -Xbatch Test6885584
03b336640699 6885584: A particular class structure causes large allocation spike for jit
never
parents:
diff changeset
31 */
03b336640699 6885584: A particular class structure causes large allocation spike for jit
never
parents:
diff changeset
32
03b336640699 6885584: A particular class structure causes large allocation spike for jit
never
parents:
diff changeset
33
03b336640699 6885584: A particular class structure causes large allocation spike for jit
never
parents:
diff changeset
34
03b336640699 6885584: A particular class structure causes large allocation spike for jit
never
parents:
diff changeset
35 public class Test6885584 {
03b336640699 6885584: A particular class structure causes large allocation spike for jit
never
parents:
diff changeset
36 static private int i1;
03b336640699 6885584: A particular class structure causes large allocation spike for jit
never
parents:
diff changeset
37 static private int i2;
03b336640699 6885584: A particular class structure causes large allocation spike for jit
never
parents:
diff changeset
38 static private int i3;
03b336640699 6885584: A particular class structure causes large allocation spike for jit
never
parents:
diff changeset
39
03b336640699 6885584: A particular class structure causes large allocation spike for jit
never
parents:
diff changeset
40 static int limit = Integer.MAX_VALUE - 8;
03b336640699 6885584: A particular class structure causes large allocation spike for jit
never
parents:
diff changeset
41
03b336640699 6885584: A particular class structure causes large allocation spike for jit
never
parents:
diff changeset
42 public static void main(String args[]) {
03b336640699 6885584: A particular class structure causes large allocation spike for jit
never
parents:
diff changeset
43 // Run long enough to trigger an OSR
03b336640699 6885584: A particular class structure causes large allocation spike for jit
never
parents:
diff changeset
44 for(int j = 200000; j != 0; j--) {
03b336640699 6885584: A particular class structure causes large allocation spike for jit
never
parents:
diff changeset
45 }
03b336640699 6885584: A particular class structure causes large allocation spike for jit
never
parents:
diff changeset
46
03b336640699 6885584: A particular class structure causes large allocation spike for jit
never
parents:
diff changeset
47 // This must reference a field
03b336640699 6885584: A particular class structure causes large allocation spike for jit
never
parents:
diff changeset
48 i1 = i2;
03b336640699 6885584: A particular class structure causes large allocation spike for jit
never
parents:
diff changeset
49
03b336640699 6885584: A particular class structure causes large allocation spike for jit
never
parents:
diff changeset
50 // The resource leak is roughly proportional to this initial value
03b336640699 6885584: A particular class structure causes large allocation spike for jit
never
parents:
diff changeset
51 for(int k = Integer.MAX_VALUE - 1; k != 0; k--) {
03b336640699 6885584: A particular class structure causes large allocation spike for jit
never
parents:
diff changeset
52 // Make sure the body does some work
03b336640699 6885584: A particular class structure causes large allocation spike for jit
never
parents:
diff changeset
53 if(i2 > i3)i1 = k;
03b336640699 6885584: A particular class structure causes large allocation spike for jit
never
parents:
diff changeset
54 if (k <= limit) break;
03b336640699 6885584: A particular class structure causes large allocation spike for jit
never
parents:
diff changeset
55 }
03b336640699 6885584: A particular class structure causes large allocation spike for jit
never
parents:
diff changeset
56 }
03b336640699 6885584: A particular class structure causes large allocation spike for jit
never
parents:
diff changeset
57
03b336640699 6885584: A particular class structure causes large allocation spike for jit
never
parents:
diff changeset
58 }