Mercurial > hg > graal-compiler
annotate test/compiler/inlining/DefaultMethodsDependencies.java @ 21514:b426469fadb7
mx: better description for strict-compliance and fix typo
author | Gilles Duboscq <gilles.m.duboscq@oracle.com> |
---|---|
date | Wed, 06 May 2015 17:04:06 +0200 |
parents | 91d70d102132 |
children |
rev | line source |
---|---|
21111
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
1 /* |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
2 * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
4 * |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
8 * |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
13 * accompanied this code). |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
14 * |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
18 * |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
21 * questions. |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
22 */ |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
23 |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
24 /* |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
25 * @test |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
26 * @bug 8069263 |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
27 * @summary Deoptimization between array allocation and arraycopy may result in non initialized array |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
28 * @run main/othervm -XX:-BackgroundCompilation -XX:CompileOnly=DefaultMethodsDependencies::test -XX:CompileOnly=DefaultMethodsDependencies$I2::m1 DefaultMethodsDependencies |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
29 * |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
30 */ |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
31 |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
32 public class DefaultMethodsDependencies { |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
33 |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
34 interface I1 { |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
35 void m1(); |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
36 // triggers processing of default methods in C1 |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
37 default void m2() { |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
38 } |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
39 } |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
40 |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
41 interface I2 extends I1 { |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
42 // added to C2 as default method |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
43 default void m1() { |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
44 } |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
45 } |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
46 |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
47 static abstract class C1 implements I1 { |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
48 } |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
49 |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
50 static class C2 extends C1 implements I2 { |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
51 } |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
52 |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
53 static void test(C1 obj) { |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
54 obj.m1(); |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
55 } |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
56 |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
57 static public void main(String[] args) { |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
58 C2 obj = new C2(); |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
59 for (int i = 0; i < 20000; i++) { |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
60 test(obj); |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
61 } |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
62 } |
91d70d102132
8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
roland
parents:
diff
changeset
|
63 } |