8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
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 * @test
26 * @bug 6934604
27 * @summary enable parts of EliminateAutoBox by default
28 * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox TestDoubleBoxing
29 * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox
30 * -XX:CompileCommand=exclude,TestDoubleBoxing.dummy -XX:CompileCommand=exclude,TestDoubleBoxing.foo -XX:CompileCommand=exclude,TestDoubleBoxing.foob TestDoubleBoxing
31 * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-EliminateAutoBox
32 * -XX:CompileCommand=exclude,TestDoubleBoxing.dummy -XX:CompileCommand=exclude,TestDoubleBoxing.foo -XX:CompileCommand=exclude,TestDoubleBoxing.foob TestDoubleBoxing
33 *
34 */
35
36 public class TestDoubleBoxing {
37
38 static final Double ibc = new Double(1.);
39
40 //===============================================
41 // Non-inlined methods to test deoptimization info
42 static void dummy() { }
43 static double foo(double i) { return i; }
44 static Double foob(double i) { return Double.valueOf(i); }
45
46
47 static double simple(double i) {
48 Double ib = new Double(i);
49 return ib;
50 }
51
52 static double simpleb(double i) {
53 Double ib = Double.valueOf(i);
54 return ib;
55 }
|
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
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 * @test
26 * @bug 6934604
27 * @summary enable parts of EliminateAutoBox by default
28 *
29 * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox
30 * compiler.eliminateAutobox.TestDoubleBoxing
31 * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox
32 * -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestDoubleBoxing::dummy
33 * -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestDoubleBoxing::foo
34 * -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestDoubleBoxing::foob
35 * compiler.eliminateAutobox.TestDoubleBoxing
36 * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-EliminateAutoBox
37 * -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestDoubleBoxing::dummy
38 * -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestDoubleBoxing::foo
39 * -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestDoubleBoxing::foob
40 * compiler.eliminateAutobox.TestDoubleBoxing
41 */
42
43 package compiler.eliminateAutobox;
44
45 public class TestDoubleBoxing {
46
47 static final Double ibc = new Double(1.);
48
49 //===============================================
50 // Non-inlined methods to test deoptimization info
51 static void dummy() { }
52 static double foo(double i) { return i; }
53 static Double foob(double i) { return Double.valueOf(i); }
54
55
56 static double simple(double i) {
57 Double ib = new Double(i);
58 return ib;
59 }
60
61 static double simpleb(double i) {
62 Double ib = Double.valueOf(i);
63 return ib;
64 }
|