Fix null checks on volatile reference field loads on ARM64.

ART's compiler adds a null check HIR instruction before each field
load HIR instruction created in the instruction builder phase. When
implicit null checks are allowed, the compiler elides the null check
if it can be turned into an implicit one (i.e. if the offset is within
a system page range).

On ARM64, the Baker read barrier thunk built for field reference loads
needs to check the lock word of the holder of the field, and thus
includes an explicit null check if no null check has been done before.
However, this was not done for volatile loads (implemented with a
load-acquire instruction on ARM64). This change adds this missing null
check.

Test: art/test/testrunner/testrunner.py --target --64 -t 1004-checker-volatile-ref-load
Bug: 140507091
Bug: 36141117
Change-Id: Ie94f2e73d2f439ae4460549d7b71848401602a21
diff --git a/test/knownfailures.json b/test/knownfailures.json
index dd23b95..ced3a2e 100644
--- a/test/knownfailures.json
+++ b/test/knownfailures.json
@@ -1248,5 +1248,17 @@
                   "575-checker-string-init-alias"],
         "variant": "baseline",
         "description": [ "Working as intended tests that don't pass with baseline." ]
+    },
+    {
+        "tests": ["1004-checker-volatile-ref-load"],
+        "env_vars": {"ART_USE_READ_BARRIER": "false"},
+        "bug": "b/140507091",
+        "description": ["Test containing Checker assertions expecting Baker read barriers."]
+    },
+    {
+        "tests": ["1004-checker-volatile-ref-load"],
+        "env_vars": {"ART_READ_BARRIER_TYPE": "TABLELOOKUP"},
+        "bug": "b/140507091",
+        "description": ["Test containing Checker assertions expecting Baker read barriers."]
     }
 ]