author | mcimadamore |
Tue, 15 Sep 2015 13:43:44 +0100 | |
changeset 32709 | 55d136799f79 |
permissions | -rw-r--r-- |
32709
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
1 |
/* |
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
2 |
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. |
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
4 |
* |
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. Oracle designates this |
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
8 |
* particular file as subject to the "Classpath" exception as provided |
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
9 |
* by Oracle in the LICENSE file that accompanied this code. |
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
10 |
* |
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
15 |
* accompanied this code). |
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
16 |
* |
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
17 |
* You should have received a copy of the GNU General Public License version |
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
20 |
* |
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
22 |
* or visit www.oracle.com if you need additional information or have any |
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
23 |
* questions. |
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
24 |
*/ |
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
25 |
|
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
26 |
/* |
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
27 |
* @test |
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
28 |
* @bug 8078093 8055894 |
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
29 |
* @summary Exponential performance regression Java 8 compiler compared to Java 7 compiler |
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
30 |
* @compile T8055984.java |
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
31 |
*/ |
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
32 |
|
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
33 |
class T8055984 { |
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
34 |
static class C<U> { |
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
35 |
U fu; |
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
36 |
|
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
37 |
C() { } |
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
38 |
|
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
39 |
C(C<U> other) { |
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
40 |
this.fu = other.fu; |
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
41 |
} |
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
42 |
|
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
43 |
C(U fu) { |
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
44 |
this.fu = fu; |
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
45 |
} |
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
46 |
} |
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
47 |
|
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
48 |
static <U> C<U> m(C<U> src) { return new C<U>(src); } |
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
49 |
|
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
50 |
static void test() { |
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
51 |
C<String> c2 = m(new C<>(m(new C<>() )) ); |
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
52 |
C<String> c3 = m(new C<>(m(new C<>(m(new C<>() )) )) ); |
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
53 |
C<String> c4 = m(new C<>(m(new C<>(m(new C<>(m(new C<>() )) )) )) ); |
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
54 |
C<String> c5 = m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>() )) )) )) )) ); |
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
55 |
C<String> c6 = m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>() )) )) )) )) )) ); |
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
56 |
C<String> c7 = m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>() )) )) )) )) )) )) ); |
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
57 |
C<String> c8 = m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>() )) )) )) )) )) )) )) ); |
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
58 |
C<String> c9 = m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>() )) )) )) )) )) )) )) )) ); |
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
59 |
C<String> c10 = m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>()))))))))))))))))))); |
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
60 |
} |
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
61 |
} |
55d136799f79
8078093: Severe compiler performance regression Java 7 to 8 for nested method invocations
mcimadamore
parents:
diff
changeset
|
62 |