summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
author Hiroshi Yamauchi <yamauchi@google.com> 2016-04-18 16:05:21 -0700
committer Hiroshi Yamauchi <yamauchi@google.com> 2016-04-18 16:05:21 -0700
commita5b7557f14e9378ffb575ae724a2e03338e012ea (patch)
tree03e1787920887d5cb5a6fdc75f7f9ec4e04054fd /compiler
parentc4d445a40bf00ab497b5e4d43a6b43eaafb5fa50 (diff)
Fix a DCHECK failure in Arm64RelativePatcher with read barrier.
We could encounter an add immediate with LinkerPatch::Type::kDexCacheArray for the HLoadString::LoadKind::kDexCachePcRelative case of VisitLoadString if the non-baker read barrier is enabled. Bug: 28249352 Bug: 12687968 Change-Id: I226bea26f6a614cfabb0307805de7cedb3b54a7f
Diffstat (limited to 'compiler')
-rw-r--r--compiler/linker/arm64/relative_patcher_arm64.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/compiler/linker/arm64/relative_patcher_arm64.cc b/compiler/linker/arm64/relative_patcher_arm64.cc
index b4ecbd8c50..72771079be 100644
--- a/compiler/linker/arm64/relative_patcher_arm64.cc
+++ b/compiler/linker/arm64/relative_patcher_arm64.cc
@@ -210,7 +210,14 @@ void Arm64RelativePatcher::PatchPcRelativeReference(std::vector<uint8_t>* code,
} else {
if ((insn & 0xfffffc00) == 0x91000000) {
// ADD immediate, 64-bit with imm12 == 0 (unset).
- DCHECK(patch.GetType() == LinkerPatch::Type::kStringRelative) << patch.GetType();
+ if (!kEmitCompilerReadBarrier) {
+ DCHECK(patch.GetType() == LinkerPatch::Type::kStringRelative) << patch.GetType();
+ } else {
+ // With the read barrier (non-baker) enabled, it could be kDexCacheArray in the
+ // HLoadString::LoadKind::kDexCachePcRelative case of VisitLoadString().
+ DCHECK(patch.GetType() == LinkerPatch::Type::kStringRelative ||
+ patch.GetType() == LinkerPatch::Type::kDexCacheArray) << patch.GetType();
+ }
shift = 0u; // No shift for ADD.
} else {
// LDR 32-bit or 64-bit with imm12 == 0 (unset).