diff options
Diffstat (limited to 'compiler/optimizing/code_generator_arm.cc')
-rw-r--r-- | compiler/optimizing/code_generator_arm.cc | 72 |
1 files changed, 38 insertions, 34 deletions
diff --git a/compiler/optimizing/code_generator_arm.cc b/compiler/optimizing/code_generator_arm.cc index 0403af1eaf..689f5357f4 100644 --- a/compiler/optimizing/code_generator_arm.cc +++ b/compiler/optimizing/code_generator_arm.cc @@ -82,7 +82,7 @@ class NullCheckSlowPathARM : public SlowPathCodeARM { CodeGeneratorARM* arm_codegen = down_cast<CodeGeneratorARM*>(codegen); __ Bind(GetEntryLabel()); arm_codegen->InvokeRuntime( - QUICK_ENTRY_POINT(pThrowNullPointer), instruction_, instruction_->GetDexPc()); + QUICK_ENTRY_POINT(pThrowNullPointer), instruction_, instruction_->GetDexPc(), this); } private: @@ -98,7 +98,7 @@ class DivZeroCheckSlowPathARM : public SlowPathCodeARM { CodeGeneratorARM* arm_codegen = down_cast<CodeGeneratorARM*>(codegen); __ Bind(GetEntryLabel()); arm_codegen->InvokeRuntime( - QUICK_ENTRY_POINT(pThrowDivZero), instruction_, instruction_->GetDexPc()); + QUICK_ENTRY_POINT(pThrowDivZero), instruction_, instruction_->GetDexPc(), this); } private: @@ -114,10 +114,10 @@ class SuspendCheckSlowPathARM : public SlowPathCodeARM { void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { CodeGeneratorARM* arm_codegen = down_cast<CodeGeneratorARM*>(codegen); __ Bind(GetEntryLabel()); - codegen->SaveLiveRegisters(instruction_->GetLocations()); + SaveLiveRegisters(codegen, instruction_->GetLocations()); arm_codegen->InvokeRuntime( - QUICK_ENTRY_POINT(pTestSuspend), instruction_, instruction_->GetDexPc()); - codegen->RestoreLiveRegisters(instruction_->GetLocations()); + QUICK_ENTRY_POINT(pTestSuspend), instruction_, instruction_->GetDexPc(), this); + RestoreLiveRegisters(codegen, instruction_->GetLocations()); if (successor_ == nullptr) { __ b(GetReturnLabel()); } else { @@ -162,7 +162,7 @@ class BoundsCheckSlowPathARM : public SlowPathCodeARM { length_location_, Location::RegisterLocation(calling_convention.GetRegisterAt(1))); arm_codegen->InvokeRuntime( - QUICK_ENTRY_POINT(pThrowArrayBounds), instruction_, instruction_->GetDexPc()); + QUICK_ENTRY_POINT(pThrowArrayBounds), instruction_, instruction_->GetDexPc(), this); } private: @@ -188,7 +188,7 @@ class LoadClassSlowPathARM : public SlowPathCodeARM { CodeGeneratorARM* arm_codegen = down_cast<CodeGeneratorARM*>(codegen); __ Bind(GetEntryLabel()); - codegen->SaveLiveRegisters(locations); + SaveLiveRegisters(codegen, locations); InvokeRuntimeCallingConvention calling_convention; __ LoadImmediate(calling_convention.GetRegisterAt(0), cls_->GetTypeIndex()); @@ -196,7 +196,7 @@ class LoadClassSlowPathARM : public SlowPathCodeARM { int32_t entry_point_offset = do_clinit_ ? QUICK_ENTRY_POINT(pInitializeStaticStorage) : QUICK_ENTRY_POINT(pInitializeType); - arm_codegen->InvokeRuntime(entry_point_offset, at_, dex_pc_); + arm_codegen->InvokeRuntime(entry_point_offset, at_, dex_pc_, this); // Move the class to the desired location. Location out = locations->Out(); @@ -204,7 +204,7 @@ class LoadClassSlowPathARM : public SlowPathCodeARM { DCHECK(out.IsRegister() && !locations->GetLiveRegisters()->ContainsCoreRegister(out.reg())); arm_codegen->Move32(locations->Out(), Location::RegisterLocation(R0)); } - codegen->RestoreLiveRegisters(locations); + RestoreLiveRegisters(codegen, locations); __ b(GetExitLabel()); } @@ -235,16 +235,16 @@ class LoadStringSlowPathARM : public SlowPathCodeARM { CodeGeneratorARM* arm_codegen = down_cast<CodeGeneratorARM*>(codegen); __ Bind(GetEntryLabel()); - codegen->SaveLiveRegisters(locations); + SaveLiveRegisters(codegen, locations); InvokeRuntimeCallingConvention calling_convention; arm_codegen->LoadCurrentMethod(calling_convention.GetRegisterAt(1)); __ LoadImmediate(calling_convention.GetRegisterAt(0), instruction_->GetStringIndex()); arm_codegen->InvokeRuntime( - QUICK_ENTRY_POINT(pResolveString), instruction_, instruction_->GetDexPc()); + QUICK_ENTRY_POINT(pResolveString), instruction_, instruction_->GetDexPc(), this); arm_codegen->Move32(locations->Out(), Location::RegisterLocation(R0)); - codegen->RestoreLiveRegisters(locations); + RestoreLiveRegisters(codegen, locations); __ b(GetExitLabel()); } @@ -272,7 +272,7 @@ class TypeCheckSlowPathARM : public SlowPathCodeARM { CodeGeneratorARM* arm_codegen = down_cast<CodeGeneratorARM*>(codegen); __ Bind(GetEntryLabel()); - codegen->SaveLiveRegisters(locations); + SaveLiveRegisters(codegen, locations); // We're moving two locations to locations that could overlap, so we need a parallel // move resolver. @@ -284,14 +284,15 @@ class TypeCheckSlowPathARM : public SlowPathCodeARM { Location::RegisterLocation(calling_convention.GetRegisterAt(1))); if (instruction_->IsInstanceOf()) { - arm_codegen->InvokeRuntime(QUICK_ENTRY_POINT(pInstanceofNonTrivial), instruction_, dex_pc_); + arm_codegen->InvokeRuntime( + QUICK_ENTRY_POINT(pInstanceofNonTrivial), instruction_, dex_pc_, this); arm_codegen->Move32(locations->Out(), Location::RegisterLocation(R0)); } else { DCHECK(instruction_->IsCheckCast()); - arm_codegen->InvokeRuntime(QUICK_ENTRY_POINT(pCheckCast), instruction_, dex_pc_); + arm_codegen->InvokeRuntime(QUICK_ENTRY_POINT(pCheckCast), instruction_, dex_pc_, this); } - codegen->RestoreLiveRegisters(locations); + RestoreLiveRegisters(codegen, locations); __ b(GetExitLabel()); } @@ -857,10 +858,11 @@ void CodeGeneratorARM::Move(HInstruction* instruction, Location location, HInstr void CodeGeneratorARM::InvokeRuntime(int32_t entry_point_offset, HInstruction* instruction, - uint32_t dex_pc) { + uint32_t dex_pc, + SlowPathCode* slow_path) { __ LoadFromOffset(kLoadWord, LR, TR, entry_point_offset); __ blx(LR); - RecordPcInfo(instruction, dex_pc); + RecordPcInfo(instruction, dex_pc, slow_path); DCHECK(instruction->IsSuspendCheck() || instruction->IsBoundsCheck() || instruction->IsNullCheck() @@ -901,10 +903,6 @@ void LocationsBuilderARM::VisitExit(HExit* exit) { void InstructionCodeGeneratorARM::VisitExit(HExit* exit) { UNUSED(exit); - if (kIsDebugBuild) { - __ Comment("Unreachable"); - __ bkpt(0); - } } void LocationsBuilderARM::VisitIf(HIf* if_instr) { @@ -1205,6 +1203,7 @@ void InstructionCodeGeneratorARM::VisitInvokeStaticOrDirect(HInvokeStaticOrDirec Register temp = invoke->GetLocations()->GetTemp(0).AsRegister<Register>(); codegen_->GenerateStaticOrDirectCall(invoke, temp); + codegen_->RecordPcInfo(invoke, invoke->GetDexPc()); } void LocationsBuilderARM::HandleInvoke(HInvoke* invoke) { @@ -1673,14 +1672,16 @@ void InstructionCodeGeneratorARM::VisitTypeConversion(HTypeConversion* conversio // Processing a Dex `float-to-long' instruction. codegen_->InvokeRuntime(QUICK_ENTRY_POINT(pF2l), conversion, - conversion->GetDexPc()); + conversion->GetDexPc(), + nullptr); break; case Primitive::kPrimDouble: // Processing a Dex `double-to-long' instruction. codegen_->InvokeRuntime(QUICK_ENTRY_POINT(pD2l), conversion, - conversion->GetDexPc()); + conversion->GetDexPc(), + nullptr); break; default: @@ -2134,7 +2135,7 @@ void InstructionCodeGeneratorARM::VisitDiv(HDiv* div) { DCHECK_EQ(R0, out.AsRegisterPairLow<Register>()); DCHECK_EQ(R1, out.AsRegisterPairHigh<Register>()); - codegen_->InvokeRuntime(QUICK_ENTRY_POINT(pLdiv), div, div->GetDexPc()); + codegen_->InvokeRuntime(QUICK_ENTRY_POINT(pLdiv), div, div->GetDexPc(), nullptr); break; } @@ -2228,17 +2229,17 @@ void InstructionCodeGeneratorARM::VisitRem(HRem* rem) { } case Primitive::kPrimLong: { - codegen_->InvokeRuntime(QUICK_ENTRY_POINT(pLmod), rem, rem->GetDexPc()); + codegen_->InvokeRuntime(QUICK_ENTRY_POINT(pLmod), rem, rem->GetDexPc(), nullptr); break; } case Primitive::kPrimFloat: { - codegen_->InvokeRuntime(QUICK_ENTRY_POINT(pFmodf), rem, rem->GetDexPc()); + codegen_->InvokeRuntime(QUICK_ENTRY_POINT(pFmodf), rem, rem->GetDexPc(), nullptr); break; } case Primitive::kPrimDouble: { - codegen_->InvokeRuntime(QUICK_ENTRY_POINT(pFmod), rem, rem->GetDexPc()); + codegen_->InvokeRuntime(QUICK_ENTRY_POINT(pFmod), rem, rem->GetDexPc(), nullptr); break; } @@ -2455,7 +2456,8 @@ void InstructionCodeGeneratorARM::VisitNewInstance(HNewInstance* instruction) { __ LoadImmediate(calling_convention.GetRegisterAt(0), instruction->GetTypeIndex()); codegen_->InvokeRuntime(GetThreadOffset<kArmWordSize>(instruction->GetEntrypoint()).Int32Value(), instruction, - instruction->GetDexPc()); + instruction->GetDexPc(), + nullptr); } void LocationsBuilderARM::VisitNewArray(HNewArray* instruction) { @@ -2474,7 +2476,8 @@ void InstructionCodeGeneratorARM::VisitNewArray(HNewArray* instruction) { __ LoadImmediate(calling_convention.GetRegisterAt(0), instruction->GetTypeIndex()); codegen_->InvokeRuntime(GetThreadOffset<kArmWordSize>(instruction->GetEntrypoint()).Int32Value(), instruction, - instruction->GetDexPc()); + instruction->GetDexPc(), + nullptr); } void LocationsBuilderARM::VisitParameterValue(HParameterValue* instruction) { @@ -3204,7 +3207,8 @@ void InstructionCodeGeneratorARM::VisitArraySet(HArraySet* instruction) { DCHECK_EQ(value_type, Primitive::kPrimNot); codegen_->InvokeRuntime(QUICK_ENTRY_POINT(pAputObject), instruction, - instruction->GetDexPc()); + instruction->GetDexPc(), + nullptr); } break; } @@ -3691,7 +3695,7 @@ void LocationsBuilderARM::VisitThrow(HThrow* instruction) { void InstructionCodeGeneratorARM::VisitThrow(HThrow* instruction) { codegen_->InvokeRuntime( - QUICK_ENTRY_POINT(pDeliverException), instruction, instruction->GetDexPc()); + QUICK_ENTRY_POINT(pDeliverException), instruction, instruction->GetDexPc(), nullptr); } void LocationsBuilderARM::VisitInstanceOf(HInstanceOf* instruction) { @@ -3784,7 +3788,8 @@ void InstructionCodeGeneratorARM::VisitMonitorOperation(HMonitorOperation* instr codegen_->InvokeRuntime(instruction->IsEnter() ? QUICK_ENTRY_POINT(pLockObject) : QUICK_ENTRY_POINT(pUnlockObject), instruction, - instruction->GetDexPc()); + instruction->GetDexPc(), + nullptr); } void LocationsBuilderARM::VisitAnd(HAnd* instruction) { HandleBitwiseOperation(instruction); } @@ -3888,7 +3893,6 @@ void CodeGeneratorARM::GenerateStaticOrDirectCall(HInvokeStaticOrDirect* invoke, __ bl(GetFrameEntryLabel()); } - RecordPcInfo(invoke, invoke->GetDexPc()); DCHECK(!IsLeafMethod()); } |