460N/A/*
1472N/A * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
460N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
460N/A *
460N/A * This code is free software; you can redistribute it and/or modify it
460N/A * under the terms of the GNU General Public License version 2 only, as
460N/A * published by the Free Software Foundation.
460N/A *
460N/A * This code is distributed in the hope that it will be useful, but WITHOUT
460N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
460N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
460N/A * version 2 for more details (a copy is included in the LICENSE file that
460N/A * accompanied this code).
460N/A *
460N/A * You should have received a copy of the GNU General Public License version
460N/A * 2 along with this work; if not, write to the Free Software Foundation,
460N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
460N/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.
460N/A *
460N/A */
460N/A
460N/A/*
460N/A * @test
460N/A * @bug 6775880
460N/A * @summary EA +DeoptimizeALot: assert(mon_info->owner()->is_locked(),"object must be locked now")
460N/A * @compile -source 1.4 -target 1.4 Test.java
564N/A * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -Xbatch -XX:+DoEscapeAnalysis -XX:+DeoptimizeALot -XX:CompileCommand=exclude,java.lang.AbstractStringBuilder::append Test
460N/A */
460N/A
460N/Apublic class Test {
460N/A
460N/A int cnt;
460N/A int b[];
460N/A String s;
460N/A
460N/A String test() {
460N/A String res="";
460N/A for (int i=0; i < cnt; i++) {
460N/A if (i != 0) {
460N/A res = res +".";
460N/A }
460N/A res = res + b[i];
460N/A }
460N/A return res;
460N/A }
460N/A
460N/A public static void main(String[] args) {
460N/A Test t = new Test();
460N/A t.cnt = 3;
460N/A t.b = new int[3];
460N/A t.b[0] = 0;
460N/A t.b[1] = 1;
460N/A t.b[2] = 2;
460N/A int j=0;
460N/A t.s = "";
460N/A for (int i=0; i<10001; i++) {
460N/A t.s = "c";
460N/A t.s = t.test();
460N/A }
460N/A System.out.println("After s=" + t.s);
460N/A }
460N/A}
460N/A
460N/A