Try/Catch analysis; various workarounds
Fixed a couple of codegen bugs. Added a temporary workaround until
SSA renaming problem is fixed. By enabling the "CompileDexLibCore"
test in compiler_test.cc and disabling the jni_compiler, we appear to
be successfully compiling 17,641 methods of libcore (note: of those,
4 exhibit the SSA problem).
Also turned off most of the compiler logging, and disabled the fast
path for invoke virtual (which seems to be broken).
Change-Id: I0ecf460cba209f885209efbee62e9f80bffbf666
diff --git a/test/IntMath/IntMath.java b/test/IntMath/IntMath.java
index 1be8a98..14c68d1 100644
--- a/test/IntMath/IntMath.java
+++ b/test/IntMath/IntMath.java
@@ -67,6 +67,15 @@
return x;
}
+ static int catchBlockNoThrow(int x) {
+ try {
+ x += 123;
+ } catch (NullPointerException npe) {
+ x += 456;
+ }
+ return x;
+ }
+
static int staticFieldTest(int x) {
mBoolean1 = true;
mBoolean2 = false;
@@ -627,20 +636,14 @@
}
}
- /*
- static void throwNullPointerException() {
- throw new NullPointerException("first throw");
- }
-
- static int throwAndCatch() {
+ static int throwAndCatch() {
try {
- throwNullPointerException();
- return 1;
+ throwNullPointerException();
+ return 1;
} catch (NullPointerException npe) {
- return 0;
+ return 0;
}
- }
- */
+ }
static int manyArgs(int a0, long a1, int a2, long a3, int a4, long a5,
int a6, int a7, double a8, float a9, double a10, short a11, int a12,
@@ -807,14 +810,12 @@
System.out.println("fibonacci FAILED: " + res);
}
- /*
- res = throwAndCatch();
- if (res == 0) {
+ res = throwAndCatch();
+ if (res == 0) {
System.out.println("throwAndCatch PASSED");
- } else {
+ } else {
System.out.println("throwAndCatch FAILED: " + res);
- }
- */
+ }
res = manyArgs(0, 1L, 2, 3L, 4, 5L, 6, 7, 8.0, 9.0f, 10.0,
(short)11, 12, (char)13, 14, 15, (byte)-16, true, 18,
@@ -853,6 +854,13 @@
System.out.println("catchBlock FAILED: " + res);
}
+ res = catchBlockNoThrow(1000);
+ if (res == 1123) {
+ System.out.println("catchBlockNoThrow PASSED");
+ } else {
+ System.out.println("catchBlockNoThrow FAILED: " + res);
+ }
+
res = superTest(4141);
if (res == 4175) {
System.out.println("superTest PASSED");