summaryrefslogtreecommitdiff
path: root/compiler/optimizing/common_arm.h
diff options
context:
space:
mode:
author Scott Wakeling <scott.wakeling@linaro.org> 2016-11-21 19:46:00 +0000
committer Anton Kirilov <anton.kirilov@linaro.org> 2016-11-25 14:16:31 +0000
commitb77051ea5718fe017f2fa884b9ca4c8186c95190 (patch)
treebb51782f8350be00195becabc3cd8758f15010a0 /compiler/optimizing/common_arm.h
parentd0111420a9f924fe560a97132d09ae531852fd69 (diff)
ARM: VIXL32: Fix breaking changes from recent VIXL update.
Test: m test-art-host Test: m test-art-target Change-Id: I02a608bf51b889a2bfff43272a3619582bf9cf20
Diffstat (limited to 'compiler/optimizing/common_arm.h')
-rw-r--r--compiler/optimizing/common_arm.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/compiler/optimizing/common_arm.h b/compiler/optimizing/common_arm.h
index 5129dafca1..d3623f17d1 100644
--- a/compiler/optimizing/common_arm.h
+++ b/compiler/optimizing/common_arm.h
@@ -139,9 +139,14 @@ inline int32_t Int32ConstantFrom(Location location) {
HConstant* instr = location.GetConstant();
if (instr->IsIntConstant()) {
return instr->AsIntConstant()->GetValue();
- } else {
- DCHECK(instr->IsNullConstant()) << instr->DebugName();
+ } else if (instr->IsNullConstant()) {
return 0;
+ } else {
+ DCHECK(instr->IsLongConstant()) << instr->DebugName();
+ const int64_t ret = instr->AsLongConstant()->GetValue();
+ DCHECK_GE(ret, std::numeric_limits<int32_t>::min());
+ DCHECK_LE(ret, std::numeric_limits<int32_t>::max());
+ return ret;
}
}
@@ -161,7 +166,7 @@ inline vixl::aarch32::Operand OperandFrom(Location location, Primitive::Type typ
if (location.IsRegister()) {
return vixl::aarch32::Operand(RegisterFrom(location, type));
} else {
- return vixl::aarch32::Operand(Int64ConstantFrom(location));
+ return vixl::aarch32::Operand(Int32ConstantFrom(location));
}
}