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