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 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 /**
26 * @test
27 * @bug 8139771
28 * @summary Eliminating CastPP nodes at Phis when they all come from a unique input may cause crash
29 * @requires vm.gc=="Serial" | vm.gc=="Parallel"
30 * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:+IgnoreUnrecognizedVMOptions -XX:+StressGCM TestEliminatedCastPPAtPhi
31 *
32 */
33
34 public class TestEliminatedCastPPAtPhi {
35
36 static TestEliminatedCastPPAtPhi saved;
37 static TestEliminatedCastPPAtPhi saved_not_null;
38
39 int f;
40
41 static int test(TestEliminatedCastPPAtPhi obj, int[] array, boolean flag) {
42 int ret = array[0] + array[20];
43 saved = obj;
44 if (obj == null) {
45 return ret;
46 }
47 saved_not_null = obj;
48
49 // empty loop to be optimized out. Delays range check smearing
50 // for the array access below until the if diamond is
51 // optimized out
52 int i = 0;
53 for (; i < 10; i++);
|
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 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 /**
26 * @test
27 * @bug 8139771
28 * @summary Eliminating CastPP nodes at Phis when they all come from a unique input may cause crash
29 * @requires vm.gc=="Serial" | vm.gc=="Parallel"
30 *
31 * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement
32 * -XX:+IgnoreUnrecognizedVMOptions -XX:+StressGCM
33 * compiler.controldependenc.TestEliminatedCastPPAtPhi
34 *
35 */
36
37 package compiler.controldependency;
38
39 public class TestEliminatedCastPPAtPhi {
40
41 static TestEliminatedCastPPAtPhi saved;
42 static TestEliminatedCastPPAtPhi saved_not_null;
43
44 int f;
45
46 static int test(TestEliminatedCastPPAtPhi obj, int[] array, boolean flag) {
47 int ret = array[0] + array[20];
48 saved = obj;
49 if (obj == null) {
50 return ret;
51 }
52 saved_not_null = obj;
53
54 // empty loop to be optimized out. Delays range check smearing
55 // for the array access below until the if diamond is
56 // optimized out
57 int i = 0;
58 for (; i < 10; i++);
|