Use Is*() helpers to shorten code in the optimizing compiler.
Change-Id: I79f31833bc9a0aa2918381aa3fb0b05d45f75689
diff --git a/compiler/optimizing/code_generator_arm.cc b/compiler/optimizing/code_generator_arm.cc
index d555a0d..0c879bf 100644
--- a/compiler/optimizing/code_generator_arm.cc
+++ b/compiler/optimizing/code_generator_arm.cc
@@ -544,7 +544,7 @@
return;
}
- if (instruction->AsIntConstant() != nullptr) {
+ if (instruction->IsIntConstant()) {
int32_t value = instruction->AsIntConstant()->GetValue();
if (location.IsRegister()) {
__ LoadImmediate(location.As<Register>(), value);
@@ -553,7 +553,7 @@
__ LoadImmediate(IP, value);
__ str(IP, Address(SP, location.GetStackIndex()));
}
- } else if (instruction->AsLongConstant() != nullptr) {
+ } else if (instruction->IsLongConstant()) {
int64_t value = instruction->AsLongConstant()->GetValue();
if (location.IsRegisterPair()) {
__ LoadImmediate(location.AsRegisterPairLow<Register>(), Low32Bits(value));
@@ -565,7 +565,7 @@
__ LoadImmediate(IP, High32Bits(value));
__ str(IP, Address(SP, location.GetHighStackIndex(kArmWordSize)));
}
- } else if (instruction->AsLoadLocal() != nullptr) {
+ } else if (instruction->IsLoadLocal()) {
uint32_t stack_slot = GetStackSlot(instruction->AsLoadLocal()->GetLocal());
switch (instruction->GetType()) {
case Primitive::kPrimBoolean:
@@ -1706,7 +1706,7 @@
}
} else {
DCHECK(source.IsConstant());
- DCHECK(source.GetConstant()->AsIntConstant() != nullptr);
+ DCHECK(source.GetConstant()->IsIntConstant());
int32_t value = source.GetConstant()->AsIntConstant()->GetValue();
if (destination.IsRegister()) {
__ LoadImmediate(destination.As<Register>(), value);