1 /*
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 
17 class Main {
getA()18   public String getA() {
19     return "A";
20   }
getB()21   public String getB() {
22     return "B";
23   }
getC()24   public String getC() {
25     return "C";
26   }
27 }
28 
29 class TestInline {
inlineMonomorphic(Super s)30   public int inlineMonomorphic(Super s) {
31     return s.getValue();
32   }
33 
inlinePolymorphic(Super s)34   public int inlinePolymorphic(Super s) {
35     return s.getValue();
36   }
37 
inlineMegamorphic(Super s)38   public int inlineMegamorphic(Super s) {
39     return s.getValue();
40   }
41 
inlineMissingTypes(Super s)42   public int inlineMissingTypes(Super s) {
43     return s.getValue();
44   }
45 
noInlineCache(Super s)46   public int noInlineCache(Super s) {
47     return s.getValue();
48   }
49 }
50 
51 abstract class Super {
getValue()52   abstract int getValue();
53 }
54 
55 class SubA extends Super {
getValue()56   int getValue() { return 42; }
57 }
58 
59 class SubB extends Super {
getValue()60   int getValue() { return 38; };
61 }
62 
63 class SubD extends Super {
getValue()64   int getValue() { return 20; };
65 }
66 
67 class SubE extends Super {
getValue()68   int getValue() { return 16; };
69 }
70 
71 // Add a class with lots of methods so we can test profile guided compilation triggers.
72 class ZLotsOfMethods {
m1()73   public void m1() {}
m2()74   public void m2() {}
m3()75   public void m3() {}
m4()76   public void m4() {}
m5()77   public void m5() {}
m6()78   public void m6() {}
m7()79   public void m7() {}
m8()80   public void m8() {}
m9()81   public void m9() {}
m10()82   public void m10() {}
m11()83   public void m11() {}
m12()84   public void m12() {}
m13()85   public void m13() {}
m14()86   public void m14() {}
m15()87   public void m15() {}
m16()88   public void m16() {}
m17()89   public void m17() {}
m18()90   public void m18() {}
m19()91   public void m19() {}
m20()92   public void m20() {}
m21()93   public void m21() {}
m22()94   public void m22() {}
m23()95   public void m23() {}
m24()96   public void m24() {}
m25()97   public void m25() {}
m26()98   public void m26() {}
m27()99   public void m27() {}
m28()100   public void m28() {}
m29()101   public void m29() {}
m30()102   public void m30() {}
m31()103   public void m31() {}
m32()104   public void m32() {}
m33()105   public void m33() {}
m34()106   public void m34() {}
m35()107   public void m35() {}
m36()108   public void m36() {}
m37()109   public void m37() {}
m38()110   public void m38() {}
m39()111   public void m39() {}
m40()112   public void m40() {}
m41()113   public void m41() {}
m42()114   public void m42() {}
m43()115   public void m43() {}
m44()116   public void m44() {}
m45()117   public void m45() {}
m46()118   public void m46() {}
m47()119   public void m47() {}
m48()120   public void m48() {}
m49()121   public void m49() {}
m50()122   public void m50() {}
m51()123   public void m51() {}
m52()124   public void m52() {}
m53()125   public void m53() {}
m54()126   public void m54() {}
m55()127   public void m55() {}
m56()128   public void m56() {}
m57()129   public void m57() {}
m58()130   public void m58() {}
m59()131   public void m59() {}
m60()132   public void m60() {}
m61()133   public void m61() {}
m62()134   public void m62() {}
m63()135   public void m63() {}
m64()136   public void m64() {}
m65()137   public void m65() {}
m66()138   public void m66() {}
m67()139   public void m67() {}
m68()140   public void m68() {}
m69()141   public void m69() {}
m70()142   public void m70() {}
m71()143   public void m71() {}
m72()144   public void m72() {}
m73()145   public void m73() {}
m74()146   public void m74() {}
m75()147   public void m75() {}
m76()148   public void m76() {}
m77()149   public void m77() {}
m78()150   public void m78() {}
m79()151   public void m79() {}
m80()152   public void m80() {}
m81()153   public void m81() {}
m82()154   public void m82() {}
m83()155   public void m83() {}
m84()156   public void m84() {}
m85()157   public void m85() {}
m86()158   public void m86() {}
m87()159   public void m87() {}
m88()160   public void m88() {}
m89()161   public void m89() {}
m90()162   public void m90() {}
m91()163   public void m91() {}
m92()164   public void m92() {}
m93()165   public void m93() {}
m94()166   public void m94() {}
m95()167   public void m95() {}
m96()168   public void m96() {}
m97()169   public void m97() {}
m98()170   public void m98() {}
m99()171   public void m99() {}
m100()172   public void m100() {}
m101()173   public void m101() {}
m102()174   public void m102() {}
m103()175   public void m103() {}
m104()176   public void m104() {}
m105()177   public void m105() {}
m106()178   public void m106() {}
m107()179   public void m107() {}
m108()180   public void m108() {}
m109()181   public void m109() {}
m110()182   public void m110() {}
m111()183   public void m111() {}
m112()184   public void m112() {}
m113()185   public void m113() {}
m114()186   public void m114() {}
m115()187   public void m115() {}
m116()188   public void m116() {}
m117()189   public void m117() {}
m118()190   public void m118() {}
m119()191   public void m119() {}
m120()192   public void m120() {}
m121()193   public void m121() {}
m122()194   public void m122() {}
m123()195   public void m123() {}
m124()196   public void m124() {}
m125()197   public void m125() {}
m126()198   public void m126() {}
m127()199   public void m127() {}
m128()200   public void m128() {}
m129()201   public void m129() {}
m130()202   public void m130() {}
m131()203   public void m131() {}
m132()204   public void m132() {}
m133()205   public void m133() {}
m134()206   public void m134() {}
m135()207   public void m135() {}
m136()208   public void m136() {}
m137()209   public void m137() {}
m138()210   public void m138() {}
m139()211   public void m139() {}
m140()212   public void m140() {}
m141()213   public void m141() {}
m142()214   public void m142() {}
m143()215   public void m143() {}
m144()216   public void m144() {}
m145()217   public void m145() {}
m146()218   public void m146() {}
m147()219   public void m147() {}
m148()220   public void m148() {}
m149()221   public void m149() {}
m150()222   public void m150() {}
223 }
224