blob: a8ced544c98565ab71032a07cdbca8110d77fac7 [file] [log] [blame]
Calin Juravle877fd962016-01-05 14:29:29 +00001/*
2 * Copyright (C) 2016 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17class Main {
18 public String getA() {
19 return "A";
20 }
21 public String getB() {
22 return "B";
23 }
24 public String getC() {
25 return "C";
26 }
27}
Calin Juravlee0ac1152017-02-13 19:03:47 -080028
29class TestInline {
30 public int inlineMonomorphic(Super s) {
31 return s.getValue();
32 }
33
34 public int inlinePolymorphic(Super s) {
35 return s.getValue();
36 }
37
38 public int inlineMegamorphic(Super s) {
39 return s.getValue();
40 }
41
Calin Juravle589e71e2017-03-03 16:05:05 -080042 public int inlineMissingTypes(Super s) {
43 return s.getValue();
44 }
45
Calin Juravlee0ac1152017-02-13 19:03:47 -080046 public int noInlineCache(Super s) {
47 return s.getValue();
48 }
49}
50
51abstract class Super {
52 abstract int getValue();
53}
54
55class SubA extends Super {
56 int getValue() { return 42; }
57}
58
59class SubB extends Super {
60 int getValue() { return 38; };
61}
62
63class SubD extends Super {
64 int getValue() { return 20; };
65}
66
67class SubE extends Super {
68 int getValue() { return 16; };
69}