Test6891750.java revision 1037
0N/A/*
2362N/A * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
0N/A * published by the Free Software Foundation.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
2362N/A * CA 95054 USA or visit www.sun.com if you need additional information or
2362N/A * have any questions.
0N/A *
0N/A */
0N/A
0N/A/**
0N/A * @test
0N/A * @bug 6891750
0N/A * @summary deopt blob kills values in O5
0N/A *
0N/A * @run main Test6891750
0N/A */
0N/A
0N/Aabstract class Base6891750 extends Thread {
0N/A abstract public long m();
0N/A}
0N/Aclass Other6891750 extends Base6891750 {
0N/A public long m() {
0N/A return 0;
0N/A }
0N/A}
0N/A
0N/Apublic class Test6891750 extends Base6891750 {
0N/A Base6891750 d;
0N/A volatile long value = 9;
0N/A
0N/A static int limit = 400000;
0N/A
0N/A Test6891750() {
0N/A d = this;
0N/A
0N/A }
0N/A public long m() {
0N/A return value;
0N/A }
0N/A
0N/A public long test(boolean doit) {
0N/A if (doit) {
0N/A long total0 = 0;
0N/A long total1 = 0;
0N/A long total2 = 0;
0N/A long total3 = 0;
0N/A long total4 = 0;
0N/A long total5 = 0;
0N/A long total6 = 0;
0N/A long total7 = 0;
0N/A long total8 = 0;
0N/A long total9 = 0;
0N/A for (int i = 0; i < limit; i++) {
0N/A total0 += d.m();
0N/A total1 += d.m();
0N/A total2 += d.m();
0N/A total3 += d.m();
0N/A total4 += d.m();
0N/A total5 += d.m();
0N/A total6 += d.m();
0N/A total7 += d.m();
0N/A total8 += d.m();
0N/A total9 += d.m();
0N/A }
0N/A return total0 + total1 + total2 + total3 + total4 + total5 + total6 + total7 + total8 + total9;
0N/A }
0N/A return 0;
0N/A }
0N/A
0N/A public void run() {
0N/A long result = test(true);
0N/A for (int i = 0; i < 300; i++) {
0N/A long result2 = test(true);
0N/A if (result != result2) {
0N/A throw new InternalError(result + " != " + result2);
0N/A }
0N/A }
0N/A }
0N/A
0N/A public static void main(String[] args) throws Exception {
0N/A Test6891750 Test6891750 = new Test6891750();
0N/A // warm it up
0N/A for (int i = 0; i < 200000; i++) {
0N/A Test6891750.test(false);
0N/A }
0N/A // set in off running
0N/A Test6891750.start();
0N/A Thread.sleep(2000);
0N/A
0N/A // Load a class to invalidate CHA
0N/A new Other6891750();
0N/A }
0N/A}
0N/A