diff options
author | Nicolas Geoffray <ngeoffray@google.com> | 2015-02-19 14:01:59 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-02-19 14:01:59 +0000 |
commit | 39109a06015c91188232e59fa9e60e0915d24cd7 (patch) | |
tree | a8ffd5fd966512fd280bc1b3214f4e57a9e1805f /compiler/optimizing/code_generator_arm.cc | |
parent | 92095533ac28879ddd8b44b559d700527ca12b8a (diff) | |
parent | d6138ef1ea13d07ae555542f8898b30d89e9ac9a (diff) | |
download | art-39109a06015c91188232e59fa9e60e0915d24cd7.tar.gz art-39109a06015c91188232e59fa9e60e0915d24cd7.tar.bz2 art-39109a06015c91188232e59fa9e60e0915d24cd7.zip |
Merge "Ensure the graph is correctly typed."
Diffstat (limited to 'compiler/optimizing/code_generator_arm.cc')
-rw-r--r-- | compiler/optimizing/code_generator_arm.cc | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/compiler/optimizing/code_generator_arm.cc b/compiler/optimizing/code_generator_arm.cc index 2a79f82588..7b0231b3c0 100644 --- a/compiler/optimizing/code_generator_arm.cc +++ b/compiler/optimizing/code_generator_arm.cc @@ -779,8 +779,8 @@ void CodeGeneratorARM::Move(HInstruction* instruction, Location location, HInstr if (locations != nullptr && locations->Out().IsConstant()) { HConstant* const_to_move = locations->Out().GetConstant(); - if (const_to_move->IsIntConstant()) { - int32_t value = const_to_move->AsIntConstant()->GetValue(); + if (const_to_move->IsIntConstant() || const_to_move->IsNullConstant()) { + int32_t value = GetInt32ValueOf(const_to_move); if (location.IsRegister()) { __ LoadImmediate(location.AsRegister<Register>(), value); } else { @@ -947,8 +947,8 @@ void InstructionCodeGeneratorARM::VisitIf(HIf* if_instr) { __ cmp(left, ShifterOperand(locations->InAt(1).AsRegister<Register>())); } else { DCHECK(locations->InAt(1).IsConstant()); - int32_t value = - locations->InAt(1).GetConstant()->AsIntConstant()->GetValue(); + HConstant* constant = locations->InAt(1).GetConstant(); + int32_t value = CodeGenerator::GetInt32ValueOf(constant); ShifterOperand operand; if (GetAssembler()->ShifterOperandCanHold(R0, left, CMP, value, &operand)) { __ cmp(left, operand); @@ -1109,6 +1109,17 @@ void InstructionCodeGeneratorARM::VisitIntConstant(HIntConstant* constant) { UNUSED(constant); } +void LocationsBuilderARM::VisitNullConstant(HNullConstant* constant) { + LocationSummary* locations = + new (GetGraph()->GetArena()) LocationSummary(constant, LocationSummary::kNoCall); + locations->SetOut(Location::ConstantLocation(constant)); +} + +void InstructionCodeGeneratorARM::VisitNullConstant(HNullConstant* constant) { + // Will be generated at use site. + UNUSED(constant); +} + void LocationsBuilderARM::VisitLongConstant(HLongConstant* constant) { LocationSummary* locations = new (GetGraph()->GetArena()) LocationSummary(constant, LocationSummary::kNoCall); @@ -3399,9 +3410,9 @@ void ParallelMoveResolverARM::EmitMove(size_t index) { } } else { DCHECK(source.IsConstant()) << source; - HInstruction* constant = source.GetConstant(); - if (constant->IsIntConstant()) { - int32_t value = constant->AsIntConstant()->GetValue(); + HConstant* constant = source.GetConstant(); + if (constant->IsIntConstant() || constant->IsNullConstant()) { + int32_t value = CodeGenerator::GetInt32ValueOf(constant); if (destination.IsRegister()) { __ LoadImmediate(destination.AsRegister<Register>(), value); } else { |