Mercurial > hg > truffle
annotate test/compiler/6857159/Test6857159.java @ 9376:ee75b4f569ed
Don't create null check guard if object is kown to be non-null.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Sat, 27 Apr 2013 21:41:44 +0200 |
parents | 0a8e0d4345b3 |
children |
rev | line source |
---|---|
855
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
1 /* |
2042
0a8e0d4345b3
7010068: Update all 2010 Oracle-changed OpenJDK files to have the proper copyright dates - first pass
trims
parents:
1896
diff
changeset
|
2 * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. |
855
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
4 * |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
8 * |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
13 * accompanied this code). |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
14 * |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
18 * |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
855
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
855
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:
855
diff
changeset
|
21 * questions. |
855
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
22 * |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
23 */ |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
24 |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
25 /** |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
26 * @test |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
27 * @bug 6857159 |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
28 * @summary local schedule failed with checkcast of Thread.currentThread() |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
29 * |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
30 * @run shell Test6857159.sh |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
31 */ |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
32 |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
33 public class Test6857159 extends Thread { |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
34 static class ct0 extends Test6857159 { |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
35 public void message() { |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
36 // System.out.println("message"); |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
37 } |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
38 |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
39 public void run() { |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
40 message(); |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
41 ct0 ct = (ct0) Thread.currentThread(); |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
42 ct.message(); |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
43 } |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
44 } |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
45 static class ct1 extends ct0 { |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
46 public void message() { |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
47 // System.out.println("message"); |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
48 } |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
49 } |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
50 static class ct2 extends ct0 { |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
51 public void message() { |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
52 // System.out.println("message"); |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
53 } |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
54 } |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
55 |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
56 public static void main(String[] args) throws Exception { |
1896
086898a88056
6997495: correction of regression test compiler/6857159/Test6857159
ptisnovs
parents:
1552
diff
changeset
|
57 for (int i = 0; i < 20000; i++) { |
855
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
58 Thread t = null; |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
59 switch (i % 3) { |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
60 case 0: t = new ct0(); break; |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
61 case 1: t = new ct1(); break; |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
62 case 2: t = new ct2(); break; |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
63 } |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
64 t.start(); |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
65 t.join(); |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
66 } |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
67 } |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff
changeset
|
68 } |