Thu, 11 Apr 2013 09:39:57 -0700
Added tag jdk8-b85 for changeset 42fe530cd478
kvn@895 | 1 | /* |
trims@1907 | 2 | * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. |
kvn@895 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
kvn@895 | 4 | * |
kvn@895 | 5 | * This code is free software; you can redistribute it and/or modify it |
kvn@895 | 6 | * under the terms of the GNU General Public License version 2 only, as |
kvn@895 | 7 | * published by the Free Software Foundation. |
kvn@895 | 8 | * |
kvn@895 | 9 | * This code is distributed in the hope that it will be useful, but WITHOUT |
kvn@895 | 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
kvn@895 | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
kvn@895 | 12 | * version 2 for more details (a copy is included in the LICENSE file that |
kvn@895 | 13 | * accompanied this code). |
kvn@895 | 14 | * |
kvn@895 | 15 | * You should have received a copy of the GNU General Public License version |
kvn@895 | 16 | * 2 along with this work; if not, write to the Free Software Foundation, |
kvn@895 | 17 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
kvn@895 | 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. |
kvn@895 | 22 | * |
kvn@895 | 23 | */ |
kvn@895 | 24 | |
kvn@895 | 25 | /* |
kvn@895 | 26 | * @test |
kvn@895 | 27 | * @bug 6775880 |
kvn@895 | 28 | * @summary EA +DeoptimizeALot: assert(mon_info->owner()->is_locked(),"object must be locked now") |
kvn@895 | 29 | * @compile -source 1.4 -target 1.4 Test.java |
kvn@999 | 30 | * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -Xbatch -XX:+DoEscapeAnalysis -XX:+DeoptimizeALot -XX:CompileCommand=exclude,java.lang.AbstractStringBuilder::append Test |
kvn@895 | 31 | */ |
kvn@895 | 32 | |
kvn@895 | 33 | public class Test { |
kvn@895 | 34 | |
kvn@895 | 35 | int cnt; |
kvn@895 | 36 | int b[]; |
kvn@895 | 37 | String s; |
kvn@895 | 38 | |
kvn@895 | 39 | String test() { |
kvn@895 | 40 | String res=""; |
kvn@895 | 41 | for (int i=0; i < cnt; i++) { |
kvn@895 | 42 | if (i != 0) { |
kvn@895 | 43 | res = res +"."; |
kvn@895 | 44 | } |
kvn@895 | 45 | res = res + b[i]; |
kvn@895 | 46 | } |
kvn@895 | 47 | return res; |
kvn@895 | 48 | } |
kvn@895 | 49 | |
kvn@895 | 50 | public static void main(String[] args) { |
kvn@895 | 51 | Test t = new Test(); |
kvn@895 | 52 | t.cnt = 3; |
kvn@895 | 53 | t.b = new int[3]; |
kvn@895 | 54 | t.b[0] = 0; |
kvn@895 | 55 | t.b[1] = 1; |
kvn@895 | 56 | t.b[2] = 2; |
kvn@895 | 57 | int j=0; |
kvn@895 | 58 | t.s = ""; |
kvn@895 | 59 | for (int i=0; i<10001; i++) { |
kvn@895 | 60 | t.s = "c"; |
kvn@895 | 61 | t.s = t.test(); |
kvn@895 | 62 | } |
kvn@895 | 63 | System.out.println("After s=" + t.s); |
kvn@895 | 64 | } |
kvn@895 | 65 | } |
kvn@895 | 66 | |
kvn@895 | 67 |