test/compiler/6539464/Test.java

Mon, 28 Jul 2014 15:06:38 -0700

author
fzhinkin
date
Mon, 28 Jul 2014 15:06:38 -0700
changeset 6997
dbb05f6d93c4
parent 1907
c18cbe5936b8
child 6876
710a3c8b516e
permissions
-rw-r--r--

8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
Summary: call rtm_deopt() only if there were no compilation bailouts before.
Reviewed-by: kvn

never@1141 1 /*
trims@1907 2 * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
never@1141 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
never@1141 4 *
never@1141 5 * This code is free software; you can redistribute it and/or modify it
never@1141 6 * under the terms of the GNU General Public License version 2 only, as
never@1141 7 * published by the Free Software Foundation.
never@1141 8 *
never@1141 9 * This code is distributed in the hope that it will be useful, but WITHOUT
never@1141 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
never@1141 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
never@1141 12 * version 2 for more details (a copy is included in the LICENSE file that
never@1141 13 * accompanied this code).
never@1141 14 *
never@1141 15 * You should have received a copy of the GNU General Public License version
never@1141 16 * 2 along with this work; if not, write to the Free Software Foundation,
never@1141 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
never@1141 18 *
trims@1907 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
trims@1907 20 * or visit www.oracle.com if you need additional information or have any
trims@1907 21 * questions.
never@1141 22 */
never@1141 23
never@1141 24 /**
never@1141 25 * @test
never@1141 26 * @bug 6539464
never@1141 27 * @summary Math.log() produces inconsistent results between successive runs.
never@1141 28 *
never@1141 29 * @run main/othervm -Xcomp -XX:CompileOnly=Test.main Test
never@1141 30 */
never@1141 31
never@1141 32 public class Test {
never@1141 33 static double log_value = 17197;
never@1141 34 static double log_result = Math.log(log_value);
never@1141 35
never@1141 36 public static void main(String[] args) throws Exception {
never@1141 37 for (int i = 0; i < 1000000; i++) {
never@1141 38 double log_result2 = Math.log(log_value);
never@1141 39 if (log_result2 != log_result) {
never@1141 40 throw new InternalError("Math.log produces inconsistent results: " + log_result2 + " != " + log_result);
never@1141 41 }
never@1141 42 }
never@1141 43 }
never@1141 44 }

mercurial