diff options
Diffstat (limited to 'test/ProfileTestMultiDex')
-rw-r--r-- | test/ProfileTestMultiDex/Main.java | 40 | ||||
-rw-r--r-- | test/ProfileTestMultiDex/Second.java | 1 | ||||
-rw-r--r-- | test/ProfileTestMultiDex/main.jpp | 8 | ||||
-rw-r--r-- | test/ProfileTestMultiDex/main.list | 2 |
4 files changed, 49 insertions, 2 deletions
diff --git a/test/ProfileTestMultiDex/Main.java b/test/ProfileTestMultiDex/Main.java index 978cb2c6fd..98d4d96281 100644 --- a/test/ProfileTestMultiDex/Main.java +++ b/test/ProfileTestMultiDex/Main.java @@ -46,26 +46,64 @@ class TestInline { public int noInlineCache(Super s) { return s.getValue(); } + + public int inlineMultiMonomorphic(Super s, Secret sec) { + return s.getValue() + sec.getIdentity(); + } + + public int inlineMultiPolymorphic(Super s, Secret sec) { + return s.getValue() + sec.getIdentity(); + } + + public int inlineTriplePolymorphic(Super s, Secret sec, Secret thr) { + return s.getValue() + sec.getIdentity() + thr.getIdentity(); + } + + public int inlineMultiMegamorphic(Super s, Secret sec) { + return s.getValue() + sec.getIdentity(); + } + + public int inlineMultiMissingTypes(Super s, Secret sec) { + return s.getValue() + sec.getIdentity(); + } + + public int noInlineCacheMulti(Super s, Secret sec) { + return s.getValue() + sec.getIdentity(); + } +} + +class TestInlineSubtype extends TestInline { + public void foobar() { + this.inlineMonomorphic(new SubA()); + } +} + +abstract class Secret { + abstract int getIdentity(); } -abstract class Super { +abstract class Super extends Secret { abstract int getValue(); } class SubA extends Super { int getValue() { return 42; } + int getIdentity() { return 24; } } class SubB extends Super { int getValue() { return 38; }; + int getIdentity() { return 83; } } class SubD extends Super { int getValue() { return 20; }; + int getIdentity() { return 2; }; } class SubE extends Super { int getValue() { return 16; }; + int getIdentity() { return 61; }; } // Add a class with lots of methods so we can test profile guided compilation triggers. diff --git a/test/ProfileTestMultiDex/Second.java b/test/ProfileTestMultiDex/Second.java index a2bb8d4bfd..c9b3c0be04 100644 --- a/test/ProfileTestMultiDex/Second.java +++ b/test/ProfileTestMultiDex/Second.java @@ -28,6 +28,7 @@ class Second { class SubC extends Super { int getValue() { return 24; } + int getIdentity() { return 42; } } class TestIntrinsicOatdump { diff --git a/test/ProfileTestMultiDex/main.jpp b/test/ProfileTestMultiDex/main.jpp index 0644072510..33fede8a5b 100644 --- a/test/ProfileTestMultiDex/main.jpp +++ b/test/ProfileTestMultiDex/main.jpp @@ -1,9 +1,12 @@ Main: @@com.android.jack.annotations.ForceInMainDex class Main -TestInqline: +TestInline: @@com.android.jack.annotations.ForceInMainDex class TestInline +Secret: + @@com.android.jack.annotations.ForceInMainDex + class Secret Super: @@com.android.jack.annotations.ForceInMainDex class Super @@ -22,3 +25,6 @@ SubE: ZLotsOfMethods: @@com.android.jack.annotations.ForceInMainDex class ZLotsOfMethods +TestInlineSubtype: + @@com.android.jack.annotations.ForceInMainDex + class TestInlineSubtype diff --git a/test/ProfileTestMultiDex/main.list b/test/ProfileTestMultiDex/main.list index 6ca79d4bbe..023f948d0f 100644 --- a/test/ProfileTestMultiDex/main.list +++ b/test/ProfileTestMultiDex/main.list @@ -1,5 +1,7 @@ Main.class TestInline.class +TestInlineSubtype.class +Secret.class Super.class SubA.class SubB.class |