summaryrefslogtreecommitdiffstats
path: root/compiler/optimizing/common_arm64.h
diff options
context:
space:
mode:
authorEvgeny Astigeevich <evgeny.astigeevich@linaro.org>2018-06-25 13:43:53 +0100
committerEvgeny Astigeevich <evgeny.astigeevich@linaro.org>2018-06-27 13:24:35 +0100
commitf9e90541479502840c19274cf4d5b7ff22e51193 (patch)
treea5ba846c0d493aae7db126ee91d635765250a6e9 /compiler/optimizing/common_arm64.h
parenta3234e96206a841c83f9f5bf0d4e14fb07b72a5e (diff)
downloadart-f9e90541479502840c19274cf4d5b7ff22e51193.tar.gz
art-f9e90541479502840c19274cf4d5b7ff22e51193.tar.bz2
art-f9e90541479502840c19274cf4d5b7ff22e51193.zip
ART: Refactor Int64ConstantFrom to use Int64FromConstant; rename it to Int64FromLocation
Int64ConstantFrom function duplicates code of the Int64FromConstant. Its code can be replaced with a call: Int64FromConstant(location.getConstant()). The patch removes the duplicating code. It also changes the function name to Int64FromLocation to be consistent with its usage. Test: test-art-host, test-art-target Change-Id: I5624259aa72523f97ca8fc132a6152f338425c8e
Diffstat (limited to 'compiler/optimizing/common_arm64.h')
-rw-r--r--compiler/optimizing/common_arm64.h14
1 files changed, 3 insertions, 11 deletions
diff --git a/compiler/optimizing/common_arm64.h b/compiler/optimizing/common_arm64.h
index 5191ee2b1e..5556f16740 100644
--- a/compiler/optimizing/common_arm64.h
+++ b/compiler/optimizing/common_arm64.h
@@ -151,23 +151,15 @@ inline vixl::aarch64::CPURegister InputCPURegisterOrZeroRegAt(HInstruction* inst
return InputCPURegisterAt(instr, index);
}
-inline int64_t Int64ConstantFrom(Location location) {
- HConstant* instr = location.GetConstant();
- if (instr->IsIntConstant()) {
- return instr->AsIntConstant()->GetValue();
- } else if (instr->IsNullConstant()) {
- return 0;
- } else {
- DCHECK(instr->IsLongConstant()) << instr->DebugName();
- return instr->AsLongConstant()->GetValue();
- }
+inline int64_t Int64FromLocation(Location location) {
+ return Int64FromConstant(location.GetConstant());
}
inline vixl::aarch64::Operand OperandFrom(Location location, DataType::Type type) {
if (location.IsRegister()) {
return vixl::aarch64::Operand(RegisterFrom(location, type));
} else {
- return vixl::aarch64::Operand(Int64ConstantFrom(location));
+ return vixl::aarch64::Operand(Int64FromLocation(location));
}
}