Revert "Inline and optimize interface calls."
Went ahead too quickly.
This reverts commit d9faceaa8da92f4a56c2907de949081bd42faf79.
Change-Id: I1610deaf89b38037cf2786d135a59c48b10ced0c
diff --git a/test/478-checker-clinit-check-pruning/src/Main.java b/test/478-checker-clinit-check-pruning/src/Main.java
index 95ac1ee..6fc12f1 100644
--- a/test/478-checker-clinit-check-pruning/src/Main.java
+++ b/test/478-checker-clinit-check-pruning/src/Main.java
@@ -103,8 +103,10 @@
static boolean doThrow = false;
static void $noinline$staticMethod() {
- // Try defeating inlining.
- if (doThrow) { throw new Error(); }
+ if (doThrow) {
+ // Try defeating inlining.
+ throw new Error();
+ }
}
}
@@ -179,8 +181,10 @@
static boolean doThrow = false;
static void $noinline$staticMethod() {
+ if (doThrow) {
// Try defeating inlining.
- if (doThrow) { throw new Error(); }
+ throw new Error();
+ }
}
}
@@ -241,8 +245,10 @@
static boolean doThrow = false;
static void $noinline$staticMethod() {
+ if (doThrow) {
// Try defeating inlining.
- if (doThrow) { throw new Error(); }
+ throw new Error();
+ }
}
static {
@@ -308,7 +314,7 @@
static void constClassAndInvokeStatic(Iterable<?> it) {
$opt$inline$ignoreClass(ClassWithClinit7.class);
- ClassWithClinit7.$noinline$someStaticMethod(it);
+ ClassWithClinit7.someStaticMethod(it);
}
static void $opt$inline$ignoreClass(Class<?> c) {
@@ -319,10 +325,10 @@
System.out.println("Main$ClassWithClinit7's static initializer");
}
- static void $noinline$someStaticMethod(Iterable<?> it) {
+ // Note: not inlined from constClassAndInvokeStatic() but fully inlined from main().
+ static void someStaticMethod(Iterable<?> it) {
+ // We're not inlining invoke-interface at the moment.
it.iterator();
- // We're not inlining throw at the moment.
- if (doThrow) { throw new Error(""); }
}
}
@@ -339,7 +345,7 @@
static void sgetAndInvokeStatic(Iterable<?> it) {
$opt$inline$ignoreInt(ClassWithClinit8.value);
- ClassWithClinit8.$noinline$someStaticMethod(it);
+ ClassWithClinit8.someStaticMethod(it);
}
static void $opt$inline$ignoreInt(int i) {
@@ -351,10 +357,10 @@
System.out.println("Main$ClassWithClinit8's static initializer");
}
- static void $noinline$someStaticMethod(Iterable<?> it) {
+ // Note: not inlined from sgetAndInvokeStatic() but fully inlined from main().
+ static void someStaticMethod(Iterable<?> it) {
+ // We're not inlining invoke-interface at the moment.
it.iterator();
- // We're not inlining throw at the moment.
- if (doThrow) { throw new Error(""); }
}
}
@@ -371,7 +377,7 @@
static void constClassSgetAndInvokeStatic(Iterable<?> it) {
$opt$inline$ignoreClass(ClassWithClinit9.class);
$opt$inline$ignoreInt(ClassWithClinit9.value);
- ClassWithClinit9.$noinline$someStaticMethod(it);
+ ClassWithClinit9.someStaticMethod(it);
}
static class ClassWithClinit9 {
@@ -380,10 +386,10 @@
System.out.println("Main$ClassWithClinit9's static initializer");
}
- static void $noinline$someStaticMethod(Iterable<?> it) {
+ // Note: not inlined from constClassSgetAndInvokeStatic() but fully inlined from main().
+ static void someStaticMethod(Iterable<?> it) {
+ // We're not inlining invoke-interface at the moment.
it.iterator();
- // We're not inlining throw at the moment.
- if (doThrow) { throw new Error(""); }
}
}
@@ -416,9 +422,8 @@
static void inlinedForNull(Iterable<?> it) {
if (it != null) {
+ // We're not inlining invoke-interface at the moment.
it.iterator();
- // We're not inlining throw at the moment.
- if (doThrow) { throw new Error(""); }
}
}
}
@@ -455,11 +460,8 @@
}
static void inlinedForNull(Iterable<?> it) {
+ // We're not inlining invoke-interface at the moment.
it.iterator();
- if (it != null) {
- // We're not inlining throw at the moment.
- if (doThrow) { throw new Error(""); }
- }
}
}
@@ -492,8 +494,8 @@
static void inlinedForNull(Iterable<?> it) {
if (it != null) {
- // We're not inlining throw at the moment.
- if (doThrow) { throw new Error(""); }
+ // We're not inlining invoke-interface at the moment.
+ it.iterator();
}
}
}
@@ -508,9 +510,8 @@
}
public static void $noinline$getIterator(Iterable<?> it) {
+ // We're not inlining invoke-interface at the moment.
it.iterator();
- // We're not inlining throws at the moment.
- if (doThrow) { throw new Error(""); }
}
}