summaryrefslogtreecommitdiff
path: root/test/616-cha-interface-default/src-multidex/Base.java
diff options
context:
space:
mode:
author Mingyao Yang <mingyao@google.com> 2017-02-27 16:23:51 -0800
committer Mingyao Yang <mingyao@google.com> 2017-03-07 16:47:13 -0800
commit8f301e26943c53485abc2da5ff1907f7c2e0ff0c (patch)
treee255d1ce3041dff95d2cd2b6bf1b1474962d811e /test/616-cha-interface-default/src-multidex/Base.java
parentdcab11d06860ae1e23d03926adb6c31f75404032 (diff)
Revert "Revert "CHA for interface method.""
This reverts commit 85a1ec1347c8117365632dcaaa648ebb0a8691f5. It also fixed the issue that's caused by changing an invokeinterface to an invokevirtual, when the method is the original default interface method. Since the default interface method is not in any vtable, unless it's copied and becomes a virtual method. Test: ART_TEST_JIT=true m -j20 test-art-host-run-test Change-Id: I627616978690485c66cfca47c234f1504066ea1d
Diffstat (limited to 'test/616-cha-interface-default/src-multidex/Base.java')
-rw-r--r--test/616-cha-interface-default/src-multidex/Base.java41
1 files changed, 41 insertions, 0 deletions
diff --git a/test/616-cha-interface-default/src-multidex/Base.java b/test/616-cha-interface-default/src-multidex/Base.java
new file mode 100644
index 0000000000..2cbcb500c4
--- /dev/null
+++ b/test/616-cha-interface-default/src-multidex/Base.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+interface Base {
+ default public int foo(int i) {
+ if (i != 1) {
+ return -2;
+ }
+ return i + 10;
+ }
+
+ // Test default method that's not inlined.
+ default public int $noinline$bar() {
+ System.out.print("");
+ System.out.print("");
+ System.out.print("");
+ System.out.print("");
+ System.out.print("");
+ System.out.print("");
+ System.out.print("");
+ System.out.print("");
+ return -1;
+ }
+
+ default void printError(String msg) {
+ System.out.println(msg);
+ }
+}