author | hseigel |
Wed, 02 Mar 2016 23:48:41 +0000 | |
changeset 36397 | c487ced7231c |
parent 28338 | 53f6dcec62d1 |
permissions | -rw-r--r-- |
28338
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
1 |
/* |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
2 |
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
4 |
* |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
8 |
* |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
13 |
* accompanied this code). |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
14 |
* |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
18 |
* |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
21 |
* questions. |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
22 |
*/ |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
23 |
|
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
24 |
/* |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
25 |
* @test |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
26 |
* @bug 8067429 |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
27 |
* @summary java.lang.VerifyError: Inconsistent stackmap frames at branch target |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
28 |
* @author srikanth |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
29 |
* |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
30 |
* @compile BranchToFewerDefines.java |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
31 |
* @run main BranchToFewerDefines |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
32 |
*/ |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
33 |
|
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
34 |
public class BranchToFewerDefines { |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
35 |
public static void main(String[] args) { |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
36 |
} |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
37 |
private void problematicMethod(int p) { |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
38 |
switch (p) { |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
39 |
case 3: |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
40 |
long n; |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
41 |
while (true) { |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
42 |
if (false) { |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
43 |
break; |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
44 |
} |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
45 |
} |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
46 |
break; |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
47 |
case 2: |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
48 |
loop: while (true) { |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
49 |
while (true) { |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
50 |
int i = 4; |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
51 |
if (p != 16) { |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
52 |
return; |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
53 |
} |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
54 |
break loop; |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
55 |
} |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
56 |
} |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
57 |
break; |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
58 |
default: |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
59 |
while (true) { |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
60 |
if (false) { |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
61 |
break; |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
62 |
} |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
63 |
} |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
64 |
break; |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
65 |
} |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
66 |
long b; |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
67 |
if (p != 7) { |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
68 |
switch (p) { |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
69 |
case 1: |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
70 |
long a = 17; |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
71 |
break; |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
72 |
case 2: |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
73 |
break; |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
74 |
default: |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
75 |
break; |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
76 |
} |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
77 |
} |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
78 |
} |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
79 |
private void problematicMethod2(int p) { |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
80 |
switch (p) { |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
81 |
case 3: |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
82 |
long n; |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
83 |
{ |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
84 |
int i = 4; |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
85 |
break; |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
86 |
} |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
87 |
case 2: |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
88 |
{ |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
89 |
int i = 4; |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
90 |
break; |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
91 |
} |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
92 |
default: |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
93 |
{ |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
94 |
int i = 4; |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
95 |
break; |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
96 |
} |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
97 |
} |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
98 |
long b; |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
99 |
if (p != 7) { |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
100 |
switch (p) { |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
101 |
case 1: |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
102 |
long a = 17; |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
103 |
break; |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
104 |
case 2: |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
105 |
break; |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
106 |
default: |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
107 |
break; |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
108 |
} |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
109 |
} |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
110 |
} |
53f6dcec62d1
8067429: java.lang.VerifyError: Inconsistent stackmap frames at branch target
mcimadamore
parents:
diff
changeset
|
111 |
} |