MIPS32: Refactor implicit null checks in array/field get/set.
Rationale: on MIPS32 64-bit loads and stores may be performed
as pairs of 32-bit loads/stores. Implicit null checks must be
associated with the first 32-bit load/store in a pair and not
the last. This change ensures proper association of said checks
(a few were done after the last 32-bit load/store in a pair)
and lays ground for further improvements in array/field get/set.
Test: booted MIPS32 in QEMU
Test: test-art-host-gtest
Test: test-art-target-run-test-optimizing in QEMU
Change-Id: I3674947c00bb17930790a7a47c9b7aadc0c030b8
diff --git a/test/551-implicit-null-checks/src/Main.java b/test/551-implicit-null-checks/src/Main.java
index 677e8d3..3586a29 100644
--- a/test/551-implicit-null-checks/src/Main.java
+++ b/test/551-implicit-null-checks/src/Main.java
@@ -18,6 +18,7 @@
private class Inner {
private long i1;
+ private double i2;
}
private Inner inst;
@@ -26,12 +27,22 @@
try {
m.$opt$noinline$testGetLong();
} catch (NullPointerException ex) {
- // good
+ System.out.println("NPE from GetLong");
}
try {
m.$opt$noinline$testPutLong(778899112233L);
} catch (NullPointerException ex) {
- // good
+ System.out.println("NPE from PutLong");
+ }
+ try {
+ m.$opt$noinline$testGetDouble();
+ } catch (NullPointerException ex) {
+ System.out.println("NPE from GetDouble");
+ }
+ try {
+ m.$opt$noinline$testPutDouble(1.0);
+ } catch (NullPointerException ex) {
+ System.out.println("NPE from PutDouble");
}
}
@@ -44,4 +55,14 @@
inst.i1 = a;
throw new Exception(); // prevent inline
}
+
+ public void $opt$noinline$testGetDouble() throws Exception {
+ double result = inst.i2;
+ throw new Exception(); // prevent inline
+ }
+
+ public void $opt$noinline$testPutDouble(double a) throws Exception {
+ inst.i2 = a;
+ throw new Exception(); // prevent inline
+ }
}