diff options
| author | 2025-01-28 16:05:28 -0800 | |
|---|---|---|
| committer | 2025-01-28 16:05:28 -0800 | |
| commit | 41fdebdb730ef983437fb2bef18597f5acf162d5 (patch) | |
| tree | 5655aac5cd45c74c8ac95b8fc2b8c3e302b4fcb7 /compiler | |
| parent | 2c17c24f7c405def4c575a80998c88c293b71b81 (diff) | |
| parent | 9638f6acdcb111f105fc08efc320029e2d1dc982 (diff) | |
Snap for 12979963 from 9638f6acdcb111f105fc08efc320029e2d1dc982 to 25Q2-release
Change-Id: I57148b7105664c03ce1db10330168ad090be3465
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/optimizing/code_generator.cc | 104 | ||||
| -rw-r--r-- | compiler/optimizing/code_generator.h | 21 | ||||
| -rw-r--r-- | compiler/optimizing/code_generator_arm64.cc | 82 | ||||
| -rw-r--r-- | compiler/optimizing/code_generator_arm64.h | 1 | ||||
| -rw-r--r-- | compiler/optimizing/code_generator_arm_vixl.cc | 95 | ||||
| -rw-r--r-- | compiler/optimizing/code_generator_arm_vixl.h | 1 | ||||
| -rw-r--r-- | compiler/optimizing/code_generator_riscv64.cc | 71 | ||||
| -rw-r--r-- | compiler/optimizing/code_generator_riscv64.h | 1 | ||||
| -rw-r--r-- | compiler/optimizing/code_generator_x86.cc | 84 | ||||
| -rw-r--r-- | compiler/optimizing/code_generator_x86.h | 1 | ||||
| -rw-r--r-- | compiler/optimizing/code_generator_x86_64.cc | 81 | ||||
| -rw-r--r-- | compiler/optimizing/code_generator_x86_64.h | 1 | ||||
| -rw-r--r-- | compiler/optimizing/intrinsics_arm64.cc | 17 | ||||
| -rw-r--r-- | compiler/optimizing/intrinsics_arm_vixl.cc | 14 | ||||
| -rw-r--r-- | compiler/optimizing/intrinsics_riscv64.cc | 51 | ||||
| -rw-r--r-- | compiler/optimizing/intrinsics_x86.cc | 12 | ||||
| -rw-r--r-- | compiler/optimizing/intrinsics_x86_64.cc | 17 |
17 files changed, 295 insertions, 359 deletions
diff --git a/compiler/optimizing/code_generator.cc b/compiler/optimizing/code_generator.cc index cfccdb8934..79386defae 100644 --- a/compiler/optimizing/code_generator.cc +++ b/compiler/optimizing/code_generator.cc @@ -348,7 +348,7 @@ void CodeGenerator::Compile() { // This ensures that we have correct native line mapping for all native instructions. // It is necessary to make stepping over a statement work. Otherwise, any initial // instructions (e.g. moves) would be assumed to be the start of next statement. - MaybeRecordNativeDebugInfo(/* instruction= */ nullptr, block->GetDexPc()); + MaybeRecordNativeDebugInfoForBlockEntry(block->GetDexPc()); for (HInstructionIterator it(block->GetInstructions()); !it.Done(); it.Advance()) { HInstruction* current = it.Current(); if (current->HasEnvironment()) { @@ -541,7 +541,7 @@ void CodeGenerator::GenerateInvokeStaticOrDirectRuntimeCall( UNREACHABLE(); } - InvokeRuntime(entrypoint, invoke, invoke->GetDexPc(), slow_path); + InvokeRuntime(entrypoint, invoke, slow_path); } void CodeGenerator::GenerateInvokeUnresolvedRuntimeCall(HInvokeUnresolved* invoke) { MethodReference method_reference(invoke->GetMethodReference()); @@ -570,7 +570,7 @@ void CodeGenerator::GenerateInvokeUnresolvedRuntimeCall(HInvokeUnresolved* invok LOG(FATAL) << "Unexpected invoke type: " << invoke->GetInvokeType(); UNREACHABLE(); } - InvokeRuntime(entrypoint, invoke, invoke->GetDexPc(), nullptr); + InvokeRuntime(entrypoint, invoke); } void CodeGenerator::GenerateInvokePolymorphicCall(HInvokePolymorphic* invoke, @@ -579,13 +579,13 @@ void CodeGenerator::GenerateInvokePolymorphicCall(HInvokePolymorphic* invoke, // method index) since it requires multiple info from the instruction (registers A, B, H). Not // using the reservation has no effect on the registers used in the runtime call. QuickEntrypointEnum entrypoint = kQuickInvokePolymorphic; - InvokeRuntime(entrypoint, invoke, invoke->GetDexPc(), slow_path); + InvokeRuntime(entrypoint, invoke, slow_path); } void CodeGenerator::GenerateInvokeCustomCall(HInvokeCustom* invoke) { MoveConstant(invoke->GetLocations()->GetTemp(0), invoke->GetCallSiteIndex()); QuickEntrypointEnum entrypoint = kQuickInvokeCustom; - InvokeRuntime(entrypoint, invoke, invoke->GetDexPc(), nullptr); + InvokeRuntime(entrypoint, invoke); } void CodeGenerator::CreateStringBuilderAppendLocations(HStringBuilderAppend* instruction, @@ -690,7 +690,7 @@ void CodeGenerator::GenerateUnresolvedFieldAccess( HInstruction* field_access, DataType::Type field_type, uint32_t field_index, - uint32_t dex_pc, + [[maybe_unused]] uint32_t dex_pc, const FieldAccessCallingConvention& calling_convention) { LocationSummary* locations = field_access->GetLocations(); @@ -754,7 +754,7 @@ void CodeGenerator::GenerateUnresolvedFieldAccess( default: LOG(FATAL) << "Invalid type " << field_type; } - InvokeRuntime(entrypoint, field_access, dex_pc, nullptr); + InvokeRuntime(entrypoint, field_access); if (is_get && DataType::IsFloatingPointType(field_type)) { MoveLocation(locations->Out(), calling_convention.GetReturnLocation(field_type), field_type); @@ -780,10 +780,10 @@ void CodeGenerator::GenerateLoadClassRuntimeCall(HLoadClass* cls) { MoveConstant(locations->GetTemp(0), cls->GetTypeIndex().index_); if (cls->NeedsAccessCheck()) { CheckEntrypointTypes<kQuickResolveTypeAndVerifyAccess, void*, uint32_t>(); - InvokeRuntime(kQuickResolveTypeAndVerifyAccess, cls, cls->GetDexPc()); + InvokeRuntime(kQuickResolveTypeAndVerifyAccess, cls); } else { CheckEntrypointTypes<kQuickResolveType, void*, uint32_t>(); - InvokeRuntime(kQuickResolveType, cls, cls->GetDexPc()); + InvokeRuntime(kQuickResolveType, cls); } } @@ -804,7 +804,7 @@ void CodeGenerator::GenerateLoadMethodHandleRuntimeCall(HLoadMethodHandle* metho LocationSummary* locations = method_handle->GetLocations(); MoveConstant(locations->GetTemp(0), method_handle->GetMethodHandleIndex()); CheckEntrypointTypes<kQuickResolveMethodHandle, void*, uint32_t>(); - InvokeRuntime(kQuickResolveMethodHandle, method_handle, method_handle->GetDexPc()); + InvokeRuntime(kQuickResolveMethodHandle, method_handle); } void CodeGenerator::CreateLoadMethodTypeRuntimeCallLocationSummary( @@ -824,7 +824,7 @@ void CodeGenerator::GenerateLoadMethodTypeRuntimeCall(HLoadMethodType* method_ty LocationSummary* locations = method_type->GetLocations(); MoveConstant(locations->GetTemp(0), method_type->GetProtoIndex().index_); CheckEntrypointTypes<kQuickResolveMethodType, void*, uint32_t>(); - InvokeRuntime(kQuickResolveMethodType, method_type, method_type->GetDexPc()); + InvokeRuntime(kQuickResolveMethodType, method_type); } static uint32_t GetBootImageOffsetImpl(const void* object, ImageHeader::ImageSections section) { @@ -1138,11 +1138,24 @@ static bool NeedsVregInfo(HInstruction* instruction, bool osr) { instruction->CanThrowIntoCatchBlock(); } +void CodeGenerator::RecordPcInfoForFrameOrBlockEntry(uint32_t dex_pc) { + StackMapStream* stack_map_stream = GetStackMapStream(); + stack_map_stream->BeginStackMapEntry(dex_pc, GetAssembler()->CodePosition()); + stack_map_stream->EndStackMapEntry(); +} + void CodeGenerator::RecordPcInfo(HInstruction* instruction, - uint32_t dex_pc, SlowPathCode* slow_path, bool native_debug_info) { - RecordPcInfo(instruction, dex_pc, GetAssembler()->CodePosition(), slow_path, native_debug_info); + // Only for native debuggable apps we take a look at the dex_pc from the instruction itself. For + // the regular case, we retrieve the dex_pc from the instruction's environment. + DCHECK_IMPLIES(native_debug_info, GetCompilerOptions().GetNativeDebuggable()); + DCHECK_IMPLIES(!native_debug_info, instruction->HasEnvironment()) << *instruction; + RecordPcInfo(instruction, + native_debug_info ? instruction->GetDexPc() : kNoDexPc, + GetAssembler()->CodePosition(), + slow_path, + native_debug_info); } void CodeGenerator::RecordPcInfo(HInstruction* instruction, @@ -1150,36 +1163,30 @@ void CodeGenerator::RecordPcInfo(HInstruction* instruction, uint32_t native_pc, SlowPathCode* slow_path, bool native_debug_info) { - if (instruction != nullptr) { - // The code generated for some type conversions - // may call the runtime, thus normally requiring a subsequent - // call to this method. However, the method verifier does not - // produce PC information for certain instructions, which are - // considered "atomic" (they cannot join a GC). - // Therefore we do not currently record PC information for such - // instructions. As this may change later, we added this special - // case so that code generators may nevertheless call - // CodeGenerator::RecordPcInfo without triggering an error in - // CodeGenerator::BuildNativeGCMap ("Missing ref for dex pc 0x") - // thereafter. - if (instruction->IsTypeConversion()) { + DCHECK(instruction != nullptr); + // Only for native debuggable apps we take a look at the dex_pc from the instruction itself. For + // the regular case, we retrieve the dex_pc from the instruction's environment. + DCHECK_IMPLIES(native_debug_info, GetCompilerOptions().GetNativeDebuggable()); + DCHECK_IMPLIES(!native_debug_info, instruction->HasEnvironment()) << *instruction; + // The code generated for some type conversions + // may call the runtime, thus normally requiring a subsequent + // call to this method. However, the method verifier does not + // produce PC information for certain instructions, which are + // considered "atomic" (they cannot join a GC). + // Therefore we do not currently record PC information for such + // instructions. As this may change later, we added this special + // case so that code generators may nevertheless call + // CodeGenerator::RecordPcInfo without triggering an error in + // CodeGenerator::BuildNativeGCMap ("Missing ref for dex pc 0x") + // thereafter. + if (instruction->IsTypeConversion()) { + return; + } + if (instruction->IsRem()) { + DataType::Type type = instruction->AsRem()->GetResultType(); + if ((type == DataType::Type::kFloat32) || (type == DataType::Type::kFloat64)) { return; } - if (instruction->IsRem()) { - DataType::Type type = instruction->AsRem()->GetResultType(); - if ((type == DataType::Type::kFloat32) || (type == DataType::Type::kFloat64)) { - return; - } - } - } - - StackMapStream* stack_map_stream = GetStackMapStream(); - if (instruction == nullptr) { - // For stack overflow checks and native-debug-info entries without dex register - // mapping (i.e. start of basic block or start of slow path). - stack_map_stream->BeginStackMapEntry(dex_pc, native_pc); - stack_map_stream->EndStackMapEntry(); - return; } LocationSummary* locations = instruction->GetLocations(); @@ -1220,6 +1227,7 @@ void CodeGenerator::RecordPcInfo(HInstruction* instruction, ? StackMap::Kind::Debug : (osr ? StackMap::Kind::OSR : StackMap::Kind::Default); bool needs_vreg_info = NeedsVregInfo(instruction, osr); + StackMapStream* stack_map_stream = GetStackMapStream(); stack_map_stream->BeginStackMapEntry(outer_dex_pc, native_pc, register_mask, @@ -1263,6 +1271,16 @@ bool CodeGenerator::HasStackMapAtCurrentPc() { return stack_map_stream->GetStackMapNativePcOffset(count - 1) == pc; } +void CodeGenerator::MaybeRecordNativeDebugInfoForBlockEntry(uint32_t dex_pc) { + if (GetCompilerOptions().GetNativeDebuggable() && dex_pc != kNoDexPc) { + if (HasStackMapAtCurrentPc()) { + // Ensure that we do not collide with the stack map of the previous instruction. + GenerateNop(); + } + RecordPcInfoForFrameOrBlockEntry(dex_pc); + } +} + void CodeGenerator::MaybeRecordNativeDebugInfo(HInstruction* instruction, uint32_t dex_pc, SlowPathCode* slow_path) { @@ -1271,7 +1289,7 @@ void CodeGenerator::MaybeRecordNativeDebugInfo(HInstruction* instruction, // Ensure that we do not collide with the stack map of the previous instruction. GenerateNop(); } - RecordPcInfo(instruction, dex_pc, slow_path, /* native_debug_info= */ true); + RecordPcInfo(instruction, slow_path, /* native_debug_info= */ true); } } @@ -1572,7 +1590,7 @@ bool CodeGenerator::CanMoveNullCheckToUser(HNullCheck* null_check) { void CodeGenerator::MaybeRecordImplicitNullCheck(HInstruction* instr) { HNullCheck* null_check = instr->GetImplicitNullCheck(); if (null_check != nullptr) { - RecordPcInfo(null_check, null_check->GetDexPc(), GetAssembler()->CodePosition()); + RecordPcInfo(null_check); } } diff --git a/compiler/optimizing/code_generator.h b/compiler/optimizing/code_generator.h index 950bae5c8f..741d3fb589 100644 --- a/compiler/optimizing/code_generator.h +++ b/compiler/optimizing/code_generator.h @@ -339,12 +339,9 @@ class CodeGenerator : public DeletableArenaObject<kArenaAllocCodeGenerator> { return GetFrameSize() - FrameEntrySpillSize() - kShouldDeoptimizeFlagSize; } - // Record native to dex mapping for a suspend point. Required by runtime. - void RecordPcInfo(HInstruction* instruction, - uint32_t dex_pc, - uint32_t native_pc, - SlowPathCode* slow_path = nullptr, - bool native_debug_info = false); + // For stack overflow checks and native-debug-info entries without dex register + // mapping i.e. start of basic block or at frame entry. + void RecordPcInfoForFrameOrBlockEntry(uint32_t dex_pc = 0); // Record native to dex mapping for a suspend point. // The native_pc is used from Assembler::CodePosition. @@ -352,7 +349,14 @@ class CodeGenerator : public DeletableArenaObject<kArenaAllocCodeGenerator> { // Note: As Assembler::CodePosition is target dependent, it does not guarantee the exact native_pc // for the instruction. If the exact native_pc is required it must be provided explicitly. void RecordPcInfo(HInstruction* instruction, + SlowPathCode* slow_path = nullptr, + bool native_debug_info = false); + + // Record native to dex mapping for a suspend point. Required by runtime. + // Do not use directly. Use the method above. + void RecordPcInfo(HInstruction* instruction, uint32_t dex_pc, + uint32_t native_pc, SlowPathCode* slow_path = nullptr, bool native_debug_info = false); @@ -363,6 +367,7 @@ class CodeGenerator : public DeletableArenaObject<kArenaAllocCodeGenerator> { // // ARM specific behaviour: The recorded native PC might be a branch over pools to instructions // corresponding the dex PC. + void MaybeRecordNativeDebugInfoForBlockEntry(uint32_t dex_pc); void MaybeRecordNativeDebugInfo(HInstruction* instruction, uint32_t dex_pc, SlowPathCode* slow_path = nullptr); @@ -636,11 +641,12 @@ class CodeGenerator : public DeletableArenaObject<kArenaAllocCodeGenerator> { DataType::Type field_type, const FieldAccessCallingConvention& calling_convention); +// TODO(solanes): Remove dex_pc from this method void GenerateUnresolvedFieldAccess( HInstruction* field_access, DataType::Type field_type, uint32_t field_index, - uint32_t dex_pc, + [[maybe_unused]] uint32_t dex_pc, const FieldAccessCallingConvention& calling_convention); static void CreateLoadClassRuntimeCallLocationSummary(HLoadClass* cls, @@ -674,7 +680,6 @@ class CodeGenerator : public DeletableArenaObject<kArenaAllocCodeGenerator> { virtual void InvokeRuntime(QuickEntrypointEnum entrypoint, HInstruction* instruction, - uint32_t dex_pc, SlowPathCode* slow_path = nullptr) = 0; // Check if the desired_string_load_kind is supported. If it is, return it, diff --git a/compiler/optimizing/code_generator_arm64.cc b/compiler/optimizing/code_generator_arm64.cc index 90c78bb920..b6fe630f64 100644 --- a/compiler/optimizing/code_generator_arm64.cc +++ b/compiler/optimizing/code_generator_arm64.cc @@ -243,7 +243,7 @@ class BoundsCheckSlowPathARM64 : public SlowPathCodeARM64 { QuickEntrypointEnum entrypoint = instruction_->AsBoundsCheck()->IsStringCharAt() ? kQuickThrowStringBounds : kQuickThrowArrayBounds; - arm64_codegen->InvokeRuntime(entrypoint, instruction_, instruction_->GetDexPc(), this); + arm64_codegen->InvokeRuntime(entrypoint, instruction_, this); CheckEntrypointTypes<kQuickThrowStringBounds, void, int32_t, int32_t>(); CheckEntrypointTypes<kQuickThrowArrayBounds, void, int32_t, int32_t>(); } @@ -263,7 +263,7 @@ class DivZeroCheckSlowPathARM64 : public SlowPathCodeARM64 { void EmitNativeCode(CodeGenerator* codegen) override { CodeGeneratorARM64* arm64_codegen = down_cast<CodeGeneratorARM64*>(codegen); __ Bind(GetEntryLabel()); - arm64_codegen->InvokeRuntime(kQuickThrowDivZero, instruction_, instruction_->GetDexPc(), this); + arm64_codegen->InvokeRuntime(kQuickThrowDivZero, instruction_, this); CheckEntrypointTypes<kQuickThrowDivZero, void, void>(); } @@ -291,10 +291,7 @@ class LoadMethodTypeSlowPathARM64 : public SlowPathCodeARM64 { const dex::ProtoIndex proto_index = instruction_->AsLoadMethodType()->GetProtoIndex(); __ Mov(calling_convention.GetRegisterAt(0).W(), proto_index.index_); - arm64_codegen->InvokeRuntime(kQuickResolveMethodType, - instruction_, - instruction_->GetDexPc(), - this); + arm64_codegen->InvokeRuntime(kQuickResolveMethodType, instruction_, this); CheckEntrypointTypes<kQuickResolveMethodType, void*, uint32_t>(); DataType::Type type = instruction_->GetType(); @@ -322,7 +319,6 @@ class LoadClassSlowPathARM64 : public SlowPathCodeARM64 { void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); Location out = locations->Out(); - const uint32_t dex_pc = instruction_->GetDexPc(); bool must_resolve_type = instruction_->IsLoadClass() && cls_->MustResolveTypeOnSlowPath(); bool must_do_clinit = instruction_->IsClinitCheck() || cls_->MustGenerateClinitCheck(); @@ -340,10 +336,10 @@ class LoadClassSlowPathARM64 : public SlowPathCodeARM64 { __ Mov(calling_convention.GetRegisterAt(0).W(), type_index.index_); if (cls_->NeedsAccessCheck()) { CheckEntrypointTypes<kQuickResolveTypeAndVerifyAccess, void*, uint32_t>(); - arm64_codegen->InvokeRuntime(kQuickResolveTypeAndVerifyAccess, instruction_, dex_pc, this); + arm64_codegen->InvokeRuntime(kQuickResolveTypeAndVerifyAccess, instruction_, this); } else { CheckEntrypointTypes<kQuickResolveType, void*, uint32_t>(); - arm64_codegen->InvokeRuntime(kQuickResolveType, instruction_, dex_pc, this); + arm64_codegen->InvokeRuntime(kQuickResolveType, instruction_, this); } // If we also must_do_clinit, the resolved type is now in the correct register. } else { @@ -354,7 +350,7 @@ class LoadClassSlowPathARM64 : public SlowPathCodeARM64 { cls_->GetType()); } if (must_do_clinit) { - arm64_codegen->InvokeRuntime(kQuickInitializeStaticStorage, instruction_, dex_pc, this); + arm64_codegen->InvokeRuntime(kQuickInitializeStaticStorage, instruction_, this); CheckEntrypointTypes<kQuickInitializeStaticStorage, void*, mirror::Class*>(); } @@ -393,7 +389,7 @@ class LoadStringSlowPathARM64 : public SlowPathCodeARM64 { InvokeRuntimeCallingConvention calling_convention; const dex::StringIndex string_index = instruction_->AsLoadString()->GetStringIndex(); __ Mov(calling_convention.GetRegisterAt(0).W(), string_index.index_); - arm64_codegen->InvokeRuntime(kQuickResolveString, instruction_, instruction_->GetDexPc(), this); + arm64_codegen->InvokeRuntime(kQuickResolveString, instruction_, this); CheckEntrypointTypes<kQuickResolveString, void*, uint32_t>(); DataType::Type type = instruction_->GetType(); arm64_codegen->MoveLocation(locations->Out(), calling_convention.GetReturnLocation(type), type); @@ -420,10 +416,7 @@ class NullCheckSlowPathARM64 : public SlowPathCodeARM64 { // Live registers will be restored in the catch block if caught. SaveLiveRegisters(codegen, instruction_->GetLocations()); } - arm64_codegen->InvokeRuntime(kQuickThrowNullPointer, - instruction_, - instruction_->GetDexPc(), - this); + arm64_codegen->InvokeRuntime(kQuickThrowNullPointer, instruction_, this); CheckEntrypointTypes<kQuickThrowNullPointer, void, void>(); } @@ -445,7 +438,7 @@ class SuspendCheckSlowPathARM64 : public SlowPathCodeARM64 { CodeGeneratorARM64* arm64_codegen = down_cast<CodeGeneratorARM64*>(codegen); __ Bind(GetEntryLabel()); SaveLiveRegisters(codegen, locations); // Only saves live vector regs for SIMD. - arm64_codegen->InvokeRuntime(kQuickTestSuspend, instruction_, instruction_->GetDexPc(), this); + arm64_codegen->InvokeRuntime(kQuickTestSuspend, instruction_, this); CheckEntrypointTypes<kQuickTestSuspend, void, void>(); RestoreLiveRegisters(codegen, locations); // Only restores live vector regs for SIMD. if (successor_ == nullptr) { @@ -487,7 +480,6 @@ class TypeCheckSlowPathARM64 : public SlowPathCodeARM64 { DCHECK(instruction_->IsCheckCast() || !locations->GetLiveRegisters()->ContainsCoreRegister(locations->Out().reg())); CodeGeneratorARM64* arm64_codegen = down_cast<CodeGeneratorARM64*>(codegen); - uint32_t dex_pc = instruction_->GetDexPc(); __ Bind(GetEntryLabel()); @@ -505,14 +497,14 @@ class TypeCheckSlowPathARM64 : public SlowPathCodeARM64 { LocationFrom(calling_convention.GetRegisterAt(1)), DataType::Type::kReference); if (instruction_->IsInstanceOf()) { - arm64_codegen->InvokeRuntime(kQuickInstanceofNonTrivial, instruction_, dex_pc, this); + arm64_codegen->InvokeRuntime(kQuickInstanceofNonTrivial, instruction_, this); CheckEntrypointTypes<kQuickInstanceofNonTrivial, size_t, mirror::Object*, mirror::Class*>(); DataType::Type ret_type = instruction_->GetType(); Location ret_loc = calling_convention.GetReturnLocation(ret_type); arm64_codegen->MoveLocation(locations->Out(), ret_loc, ret_type); } else { DCHECK(instruction_->IsCheckCast()); - arm64_codegen->InvokeRuntime(kQuickCheckInstanceOf, instruction_, dex_pc, this); + arm64_codegen->InvokeRuntime(kQuickCheckInstanceOf, instruction_, this); CheckEntrypointTypes<kQuickCheckInstanceOf, void, mirror::Object*, mirror::Class*>(); } @@ -544,7 +536,7 @@ class DeoptimizationSlowPathARM64 : public SlowPathCodeARM64 { InvokeRuntimeCallingConvention calling_convention; __ Mov(calling_convention.GetRegisterAt(0), static_cast<uint32_t>(instruction_->AsDeoptimize()->GetDeoptimizationKind())); - arm64_codegen->InvokeRuntime(kQuickDeoptimize, instruction_, instruction_->GetDexPc(), this); + arm64_codegen->InvokeRuntime(kQuickDeoptimize, instruction_, this); CheckEntrypointTypes<kQuickDeoptimize, void, DeoptimizationKind>(); } @@ -583,7 +575,7 @@ class ArraySetSlowPathARM64 : public SlowPathCodeARM64 { codegen->GetMoveResolver()->EmitNativeCode(¶llel_move); CodeGeneratorARM64* arm64_codegen = down_cast<CodeGeneratorARM64*>(codegen); - arm64_codegen->InvokeRuntime(kQuickAputObject, instruction_, instruction_->GetDexPc(), this); + arm64_codegen->InvokeRuntime(kQuickAputObject, instruction_, this); CheckEntrypointTypes<kQuickAputObject, void, mirror::Array*, int32_t, mirror::Object*>(); RestoreLiveRegisters(codegen, locations); __ B(GetExitLabel()); @@ -768,10 +760,7 @@ class ReadBarrierForHeapReferenceSlowPathARM64 : public SlowPathCodeARM64 { codegen->GetMoveResolver()->EmitNativeCode(¶llel_move); arm64_codegen->MoveConstant(LocationFrom(calling_convention.GetRegisterAt(2)), offset_); } - arm64_codegen->InvokeRuntime(kQuickReadBarrierSlow, - instruction_, - instruction_->GetDexPc(), - this); + arm64_codegen->InvokeRuntime(kQuickReadBarrierSlow, instruction_, this); CheckEntrypointTypes< kQuickReadBarrierSlow, mirror::Object*, mirror::Object*, mirror::Object*, uint32_t>(); arm64_codegen->MoveLocation(out_, calling_convention.GetReturnLocation(type), type); @@ -849,10 +838,7 @@ class ReadBarrierForRootSlowPathARM64 : public SlowPathCodeARM64 { // which would emit a 32-bit move, as `type` is a (32-bit wide) // reference type (`DataType::Type::kReference`). __ Mov(calling_convention.GetRegisterAt(0), XRegisterFrom(out_)); - arm64_codegen->InvokeRuntime(kQuickReadBarrierForRootSlow, - instruction_, - instruction_->GetDexPc(), - this); + arm64_codegen->InvokeRuntime(kQuickReadBarrierForRootSlow, instruction_, this); CheckEntrypointTypes<kQuickReadBarrierForRootSlow, mirror::Object*, GcRoot<mirror::Object>*>(); arm64_codegen->MoveLocation(out_, calling_convention.GetReturnLocation(type), type); @@ -910,7 +896,7 @@ class MethodEntryExitHooksSlowPathARM64 : public SlowPathCodeARM64 { if (instruction_->IsMethodExitHook()) { __ Mov(vixl::aarch64::x4, arm64_codegen->GetFrameSize()); } - arm64_codegen->InvokeRuntime(entry_point, instruction_, instruction_->GetDexPc(), this); + arm64_codegen->InvokeRuntime(entry_point, instruction_, this); RestoreLiveRegisters(codegen, locations); __ B(GetExitLabel()); } @@ -1491,7 +1477,7 @@ void CodeGeneratorARM64::GenerateFrameEntry() { kInstructionSize, CodeBufferCheckScope::kExactSize); __ ldr(wzr, MemOperand(temp, 0)); - RecordPcInfo(nullptr, 0); + RecordPcInfoForFrameOrBlockEntry(); } } @@ -2152,7 +2138,6 @@ void CodeGeneratorARM64::StoreRelease(HInstruction* instruction, void CodeGeneratorARM64::InvokeRuntime(QuickEntrypointEnum entrypoint, HInstruction* instruction, - uint32_t dex_pc, SlowPathCode* slow_path) { ValidateInvokeRuntime(entrypoint, instruction, slow_path); @@ -2166,14 +2151,14 @@ void CodeGeneratorARM64::InvokeRuntime(QuickEntrypointEnum entrypoint, ExactAssemblyScope eas(GetVIXLAssembler(), kInstructionSize, CodeBufferCheckScope::kExactSize); __ blr(lr); if (EntrypointRequiresStackMap(entrypoint)) { - RecordPcInfo(instruction, dex_pc, slow_path); + RecordPcInfo(instruction, slow_path); } } else { // Ensure the pc position is recorded immediately after the `bl` instruction. ExactAssemblyScope eas(GetVIXLAssembler(), kInstructionSize, CodeBufferCheckScope::kExactSize); EmitEntrypointThunkCall(entrypoint_offset); if (EntrypointRequiresStackMap(entrypoint)) { - RecordPcInfo(instruction, dex_pc, slow_path); + RecordPcInfo(instruction, slow_path); } } } @@ -2264,7 +2249,7 @@ void InstructionCodeGeneratorARM64::GenerateSuspendCheck(HSuspendCheck* instruct if (codegen_->CanUseImplicitSuspendCheck()) { __ Ldr(kImplicitSuspendCheckRegister, MemOperand(kImplicitSuspendCheckRegister)); - codegen_->RecordPcInfo(instruction, instruction->GetDexPc()); + codegen_->RecordPcInfo(instruction); if (successor != nullptr) { __ B(codegen_->GetLabelOf(successor)); } @@ -4864,7 +4849,7 @@ void CodeGeneratorARM64::MaybeGenerateInlineCacheCheck(HInstruction* instruction // Fast path for a monomorphic cache. __ Cmp(klass.W(), w9); __ B(eq, &done); - InvokeRuntime(kQuickUpdateInlineCache, instruction, instruction->GetDexPc()); + InvokeRuntime(kQuickUpdateInlineCache, instruction); __ Bind(&done); } else { // This is unexpected, but we don't guarantee stable compilation across @@ -4953,7 +4938,7 @@ void InstructionCodeGeneratorARM64::VisitInvokeInterface(HInvokeInterface* invok // lr(); __ blr(lr); DCHECK(!codegen_->IsLeafMethod()); - codegen_->RecordPcInfo(invoke, invoke->GetDexPc()); + codegen_->RecordPcInfo(invoke); } codegen_->MaybeGenerateMarkingRegisterCheck(/* code= */ __LINE__); @@ -5110,7 +5095,7 @@ void CodeGeneratorARM64::GenerateStaticOrDirectCall( CodeBufferCheckScope::kExactSize); // lr() __ blr(lr); - RecordPcInfo(invoke, invoke->GetDexPc(), slow_path); + RecordPcInfo(invoke, slow_path); }; switch (invoke->GetCodePtrLocation()) { case CodePtrLocation::kCallSelf: @@ -5121,7 +5106,7 @@ void CodeGeneratorARM64::GenerateStaticOrDirectCall( kInstructionSize, CodeBufferCheckScope::kExactSize); __ bl(&frame_entry_label_); - RecordPcInfo(invoke, invoke->GetDexPc(), slow_path); + RecordPcInfo(invoke, slow_path); } break; case CodePtrLocation::kCallCriticalNative: { @@ -5224,7 +5209,7 @@ void CodeGeneratorARM64::GenerateVirtualCall( ExactAssemblyScope eas(GetVIXLAssembler(), kInstructionSize, CodeBufferCheckScope::kExactSize); // lr(); __ blr(lr); - RecordPcInfo(invoke, invoke->GetDexPc(), slow_path); + RecordPcInfo(invoke, slow_path); } } @@ -6092,7 +6077,7 @@ void InstructionCodeGeneratorARM64::VisitLoadString(HLoadString* load) NO_THREAD InvokeRuntimeCallingConvention calling_convention; DCHECK_EQ(calling_convention.GetRegisterAt(0).GetCode(), out.GetCode()); __ Mov(calling_convention.GetRegisterAt(0).W(), load->GetStringIndex().index_); - codegen_->InvokeRuntime(kQuickResolveString, load, load->GetDexPc()); + codegen_->InvokeRuntime(kQuickResolveString, load); CheckEntrypointTypes<kQuickResolveString, void*, uint32_t>(); codegen_->MaybeGenerateMarkingRegisterCheck(/* code= */ __LINE__); } @@ -6115,8 +6100,7 @@ void LocationsBuilderARM64::VisitMonitorOperation(HMonitorOperation* instruction void InstructionCodeGeneratorARM64::VisitMonitorOperation(HMonitorOperation* instruction) { codegen_->InvokeRuntime(instruction->IsEnter() ? kQuickLockObject : kQuickUnlockObject, - instruction, - instruction->GetDexPc()); + instruction); if (instruction->IsEnter()) { CheckEntrypointTypes<kQuickLockObject, void, mirror::Object*>(); } else { @@ -6215,7 +6199,7 @@ void LocationsBuilderARM64::VisitNewArray(HNewArray* instruction) { void InstructionCodeGeneratorARM64::VisitNewArray(HNewArray* instruction) { // Note: if heap poisoning is enabled, the entry point takes care of poisoning the reference. QuickEntrypointEnum entrypoint = CodeGenerator::GetArrayAllocationEntrypoint(instruction); - codegen_->InvokeRuntime(entrypoint, instruction, instruction->GetDexPc()); + codegen_->InvokeRuntime(entrypoint, instruction); CheckEntrypointTypes<kQuickAllocArrayResolved, void*, mirror::Class*, int32_t>(); codegen_->MaybeGenerateMarkingRegisterCheck(/* code= */ __LINE__); } @@ -6229,7 +6213,7 @@ void LocationsBuilderARM64::VisitNewInstance(HNewInstance* instruction) { } void InstructionCodeGeneratorARM64::VisitNewInstance(HNewInstance* instruction) { - codegen_->InvokeRuntime(instruction->GetEntrypoint(), instruction, instruction->GetDexPc()); + codegen_->InvokeRuntime(instruction->GetEntrypoint(), instruction); CheckEntrypointTypes<kQuickAllocObjectWithChecks, void*, mirror::Class*>(); codegen_->MaybeGenerateMarkingRegisterCheck(/* code= */ __LINE__); } @@ -6276,7 +6260,7 @@ void CodeGeneratorARM64::GenerateImplicitNullCheck(HNullCheck* instruction) { EmissionCheckScope guard(GetVIXLAssembler(), kMaxMacroInstructionSizeInBytes); Location obj = instruction->GetLocations()->InAt(0); __ Ldr(wzr, HeapOperandFrom(obj, Offset(0))); - RecordPcInfo(instruction, instruction->GetDexPc()); + RecordPcInfo(instruction); } } @@ -6471,7 +6455,7 @@ void InstructionCodeGeneratorARM64::VisitRem(HRem* rem) { case DataType::Type::kFloat64: { QuickEntrypointEnum entrypoint = (type == DataType::Type::kFloat32) ? kQuickFmodf : kQuickFmod; - codegen_->InvokeRuntime(entrypoint, rem, rem->GetDexPc()); + codegen_->InvokeRuntime(entrypoint, rem); if (type == DataType::Type::kFloat32) { CheckEntrypointTypes<kQuickFmodf, float, float, float>(); } else { @@ -6656,7 +6640,7 @@ void LocationsBuilderARM64::VisitStringBuilderAppend(HStringBuilderAppend* instr void InstructionCodeGeneratorARM64::VisitStringBuilderAppend(HStringBuilderAppend* instruction) { __ Mov(w0, instruction->GetFormat()->GetValue()); - codegen_->InvokeRuntime(kQuickStringBuilderAppend, instruction, instruction->GetDexPc()); + codegen_->InvokeRuntime(kQuickStringBuilderAppend, instruction); } void LocationsBuilderARM64::VisitUnresolvedInstanceFieldGet( @@ -6763,7 +6747,7 @@ void LocationsBuilderARM64::VisitThrow(HThrow* instruction) { } void InstructionCodeGeneratorARM64::VisitThrow(HThrow* instruction) { - codegen_->InvokeRuntime(kQuickDeliverException, instruction, instruction->GetDexPc()); + codegen_->InvokeRuntime(kQuickDeliverException, instruction); CheckEntrypointTypes<kQuickDeliverException, void, mirror::Object*>(); } diff --git a/compiler/optimizing/code_generator_arm64.h b/compiler/optimizing/code_generator_arm64.h index 78bbff2a49..4566cdf0ca 100644 --- a/compiler/optimizing/code_generator_arm64.h +++ b/compiler/optimizing/code_generator_arm64.h @@ -797,7 +797,6 @@ class CodeGeneratorARM64 : public CodeGenerator { // Generate code to invoke a runtime entry point. void InvokeRuntime(QuickEntrypointEnum entrypoint, HInstruction* instruction, - uint32_t dex_pc, SlowPathCode* slow_path = nullptr) override; // Generate code to invoke a runtime entry point, but do not record diff --git a/compiler/optimizing/code_generator_arm_vixl.cc b/compiler/optimizing/code_generator_arm_vixl.cc index e88d14b3eb..20e9d4e0ff 100644 --- a/compiler/optimizing/code_generator_arm_vixl.cc +++ b/compiler/optimizing/code_generator_arm_vixl.cc @@ -375,10 +375,7 @@ class NullCheckSlowPathARMVIXL : public SlowPathCodeARMVIXL { // Live registers will be restored in the catch block if caught. SaveLiveRegisters(codegen, instruction_->GetLocations()); } - arm_codegen->InvokeRuntime(kQuickThrowNullPointer, - instruction_, - instruction_->GetDexPc(), - this); + arm_codegen->InvokeRuntime(kQuickThrowNullPointer, instruction_, this); CheckEntrypointTypes<kQuickThrowNullPointer, void, void>(); } @@ -398,7 +395,7 @@ class DivZeroCheckSlowPathARMVIXL : public SlowPathCodeARMVIXL { void EmitNativeCode(CodeGenerator* codegen) override { CodeGeneratorARMVIXL* arm_codegen = down_cast<CodeGeneratorARMVIXL*>(codegen); __ Bind(GetEntryLabel()); - arm_codegen->InvokeRuntime(kQuickThrowDivZero, instruction_, instruction_->GetDexPc(), this); + arm_codegen->InvokeRuntime(kQuickThrowDivZero, instruction_, this); CheckEntrypointTypes<kQuickThrowDivZero, void, void>(); } @@ -418,7 +415,7 @@ class SuspendCheckSlowPathARMVIXL : public SlowPathCodeARMVIXL { void EmitNativeCode(CodeGenerator* codegen) override { CodeGeneratorARMVIXL* arm_codegen = down_cast<CodeGeneratorARMVIXL*>(codegen); __ Bind(GetEntryLabel()); - arm_codegen->InvokeRuntime(kQuickTestSuspend, instruction_, instruction_->GetDexPc(), this); + arm_codegen->InvokeRuntime(kQuickTestSuspend, instruction_, this); CheckEntrypointTypes<kQuickTestSuspend, void, void>(); if (successor_ == nullptr) { __ B(GetReturnLabel()); @@ -475,7 +472,7 @@ class BoundsCheckSlowPathARMVIXL : public SlowPathCodeARMVIXL { QuickEntrypointEnum entrypoint = instruction_->AsBoundsCheck()->IsStringCharAt() ? kQuickThrowStringBounds : kQuickThrowArrayBounds; - arm_codegen->InvokeRuntime(entrypoint, instruction_, instruction_->GetDexPc(), this); + arm_codegen->InvokeRuntime(entrypoint, instruction_, this); CheckEntrypointTypes<kQuickThrowStringBounds, void, int32_t, int32_t>(); CheckEntrypointTypes<kQuickThrowArrayBounds, void, int32_t, int32_t>(); } @@ -499,7 +496,6 @@ class LoadClassSlowPathARMVIXL : public SlowPathCodeARMVIXL { void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); Location out = locations->Out(); - const uint32_t dex_pc = instruction_->GetDexPc(); bool must_resolve_type = instruction_->IsLoadClass() && cls_->MustResolveTypeOnSlowPath(); bool must_do_clinit = instruction_->IsClinitCheck() || cls_->MustGenerateClinitCheck(); @@ -517,10 +513,10 @@ class LoadClassSlowPathARMVIXL : public SlowPathCodeARMVIXL { __ Mov(calling_convention.GetRegisterAt(0), type_index.index_); if (cls_->NeedsAccessCheck()) { CheckEntrypointTypes<kQuickResolveTypeAndVerifyAccess, void*, uint32_t>(); - arm_codegen->InvokeRuntime(kQuickResolveTypeAndVerifyAccess, instruction_, dex_pc, this); + arm_codegen->InvokeRuntime(kQuickResolveTypeAndVerifyAccess, instruction_, this); } else { CheckEntrypointTypes<kQuickResolveType, void*, uint32_t>(); - arm_codegen->InvokeRuntime(kQuickResolveType, instruction_, dex_pc, this); + arm_codegen->InvokeRuntime(kQuickResolveType, instruction_, this); } // If we also must_do_clinit, the resolved type is now in the correct register. } else { @@ -529,7 +525,7 @@ class LoadClassSlowPathARMVIXL : public SlowPathCodeARMVIXL { arm_codegen->Move32(LocationFrom(calling_convention.GetRegisterAt(0)), source); } if (must_do_clinit) { - arm_codegen->InvokeRuntime(kQuickInitializeStaticStorage, instruction_, dex_pc, this); + arm_codegen->InvokeRuntime(kQuickInitializeStaticStorage, instruction_, this); CheckEntrypointTypes<kQuickInitializeStaticStorage, void*, mirror::Class*>(); } @@ -569,7 +565,7 @@ class LoadStringSlowPathARMVIXL : public SlowPathCodeARMVIXL { InvokeRuntimeCallingConventionARMVIXL calling_convention; __ Mov(calling_convention.GetRegisterAt(0), string_index.index_); - arm_codegen->InvokeRuntime(kQuickResolveString, instruction_, instruction_->GetDexPc(), this); + arm_codegen->InvokeRuntime(kQuickResolveString, instruction_, this); CheckEntrypointTypes<kQuickResolveString, void*, uint32_t>(); arm_codegen->Move32(locations->Out(), LocationFrom(r0)); @@ -612,18 +608,12 @@ class TypeCheckSlowPathARMVIXL : public SlowPathCodeARMVIXL { LocationFrom(calling_convention.GetRegisterAt(1)), DataType::Type::kReference); if (instruction_->IsInstanceOf()) { - arm_codegen->InvokeRuntime(kQuickInstanceofNonTrivial, - instruction_, - instruction_->GetDexPc(), - this); + arm_codegen->InvokeRuntime(kQuickInstanceofNonTrivial, instruction_, this); CheckEntrypointTypes<kQuickInstanceofNonTrivial, size_t, mirror::Object*, mirror::Class*>(); arm_codegen->Move32(locations->Out(), LocationFrom(r0)); } else { DCHECK(instruction_->IsCheckCast()); - arm_codegen->InvokeRuntime(kQuickCheckInstanceOf, - instruction_, - instruction_->GetDexPc(), - this); + arm_codegen->InvokeRuntime(kQuickCheckInstanceOf, instruction_, this); CheckEntrypointTypes<kQuickCheckInstanceOf, void, mirror::Object*, mirror::Class*>(); } @@ -657,7 +647,7 @@ class DeoptimizationSlowPathARMVIXL : public SlowPathCodeARMVIXL { __ Mov(calling_convention.GetRegisterAt(0), static_cast<uint32_t>(instruction_->AsDeoptimize()->GetDeoptimizationKind())); - arm_codegen->InvokeRuntime(kQuickDeoptimize, instruction_, instruction_->GetDexPc(), this); + arm_codegen->InvokeRuntime(kQuickDeoptimize, instruction_, this); CheckEntrypointTypes<kQuickDeoptimize, void, DeoptimizationKind>(); } @@ -696,7 +686,7 @@ class ArraySetSlowPathARMVIXL : public SlowPathCodeARMVIXL { codegen->GetMoveResolver()->EmitNativeCode(¶llel_move); CodeGeneratorARMVIXL* arm_codegen = down_cast<CodeGeneratorARMVIXL*>(codegen); - arm_codegen->InvokeRuntime(kQuickAputObject, instruction_, instruction_->GetDexPc(), this); + arm_codegen->InvokeRuntime(kQuickAputObject, instruction_, this); CheckEntrypointTypes<kQuickAputObject, void, mirror::Array*, int32_t, mirror::Object*>(); RestoreLiveRegisters(codegen, locations); __ B(GetExitLabel()); @@ -854,7 +844,7 @@ class ReadBarrierForHeapReferenceSlowPathARMVIXL : public SlowPathCodeARMVIXL { codegen->GetMoveResolver()->EmitNativeCode(¶llel_move); __ Mov(calling_convention.GetRegisterAt(2), offset_); } - arm_codegen->InvokeRuntime(kQuickReadBarrierSlow, instruction_, instruction_->GetDexPc(), this); + arm_codegen->InvokeRuntime(kQuickReadBarrierSlow, instruction_, this); CheckEntrypointTypes< kQuickReadBarrierSlow, mirror::Object*, mirror::Object*, mirror::Object*, uint32_t>(); arm_codegen->Move32(out_, LocationFrom(r0)); @@ -922,10 +912,7 @@ class ReadBarrierForRootSlowPathARMVIXL : public SlowPathCodeARMVIXL { InvokeRuntimeCallingConventionARMVIXL calling_convention; CodeGeneratorARMVIXL* arm_codegen = down_cast<CodeGeneratorARMVIXL*>(codegen); arm_codegen->Move32(LocationFrom(calling_convention.GetRegisterAt(0)), root_); - arm_codegen->InvokeRuntime(kQuickReadBarrierForRootSlow, - instruction_, - instruction_->GetDexPc(), - this); + arm_codegen->InvokeRuntime(kQuickReadBarrierForRootSlow, instruction_, this); CheckEntrypointTypes<kQuickReadBarrierForRootSlow, mirror::Object*, GcRoot<mirror::Object>*>(); arm_codegen->Move32(out_, LocationFrom(r0)); @@ -958,7 +945,7 @@ class MethodEntryExitHooksSlowPathARMVIXL : public SlowPathCodeARMVIXL { // Load frame size to pass to the exit hooks __ Mov(vixl::aarch32::Register(R2), arm_codegen->GetFrameSize()); } - arm_codegen->InvokeRuntime(entry_point, instruction_, instruction_->GetDexPc(), this); + arm_codegen->InvokeRuntime(entry_point, instruction_, this); RestoreLiveRegisters(codegen, locations); __ B(GetExitLabel()); } @@ -2420,7 +2407,7 @@ void CodeGeneratorARMVIXL::GenerateFrameEntry() { vixl32::kMaxInstructionSizeInBytes, CodeBufferCheckScope::kMaximumSize); __ ldr(temp, MemOperand(temp)); - RecordPcInfo(nullptr, 0); + RecordPcInfoForFrameOrBlockEntry(); } uint32_t frame_size = GetFrameSize(); @@ -2787,7 +2774,6 @@ void CodeGeneratorARMVIXL::AddLocationAsTemp(Location location, LocationSummary* void CodeGeneratorARMVIXL::InvokeRuntime(QuickEntrypointEnum entrypoint, HInstruction* instruction, - uint32_t dex_pc, SlowPathCode* slow_path) { ValidateInvokeRuntime(entrypoint, instruction, slow_path); @@ -2804,7 +2790,7 @@ void CodeGeneratorARMVIXL::InvokeRuntime(QuickEntrypointEnum entrypoint, CodeBufferCheckScope::kExactSize); __ blx(lr); if (EntrypointRequiresStackMap(entrypoint)) { - RecordPcInfo(instruction, dex_pc, slow_path); + RecordPcInfo(instruction, slow_path); } } else { // Ensure the pc position is recorded immediately after the `bl` instruction. @@ -2813,7 +2799,7 @@ void CodeGeneratorARMVIXL::InvokeRuntime(QuickEntrypointEnum entrypoint, CodeBufferCheckScope::kExactSize); EmitEntrypointThunkCall(entrypoint_offset); if (EntrypointRequiresStackMap(entrypoint)) { - RecordPcInfo(instruction, dex_pc, slow_path); + RecordPcInfo(instruction, slow_path); } } } @@ -3709,7 +3695,7 @@ void CodeGeneratorARMVIXL::MaybeGenerateInlineCacheCheck(HInstruction* instructi // Fast path for a monomorphic cache. __ Cmp(klass, ip); __ B(eq, &done, /* is_far_target= */ false); - InvokeRuntime(kQuickUpdateInlineCache, instruction, instruction->GetDexPc()); + InvokeRuntime(kQuickUpdateInlineCache, instruction); __ Bind(&done); } else { // This is unexpected, but we don't guarantee stable compilation across @@ -3803,7 +3789,7 @@ void InstructionCodeGeneratorARMVIXL::VisitInvokeInterface(HInvokeInterface* inv CodeBufferCheckScope::kExactSize); // LR(); __ blx(lr); - codegen_->RecordPcInfo(invoke, invoke->GetDexPc()); + codegen_->RecordPcInfo(invoke); DCHECK(!codegen_->IsLeafMethod()); } @@ -4180,12 +4166,12 @@ void InstructionCodeGeneratorARMVIXL::VisitTypeConversion(HTypeConversion* conve break; case DataType::Type::kFloat32: - codegen_->InvokeRuntime(kQuickF2l, conversion, conversion->GetDexPc()); + codegen_->InvokeRuntime(kQuickF2l, conversion); CheckEntrypointTypes<kQuickF2l, int64_t, float>(); break; case DataType::Type::kFloat64: - codegen_->InvokeRuntime(kQuickD2l, conversion, conversion->GetDexPc()); + codegen_->InvokeRuntime(kQuickD2l, conversion); CheckEntrypointTypes<kQuickD2l, int64_t, double>(); break; @@ -4208,7 +4194,7 @@ void InstructionCodeGeneratorARMVIXL::VisitTypeConversion(HTypeConversion* conve break; case DataType::Type::kInt64: - codegen_->InvokeRuntime(kQuickL2f, conversion, conversion->GetDexPc()); + codegen_->InvokeRuntime(kQuickL2f, conversion); CheckEntrypointTypes<kQuickL2f, float, int64_t>(); break; @@ -4773,7 +4759,7 @@ void InstructionCodeGeneratorARMVIXL::VisitDiv(HDiv* div) { DCHECK(calling_convention.GetRegisterAt(1).Is(RegisterFrom(rhs))); DCHECK(r0.Is(OutputRegister(div))); - codegen_->InvokeRuntime(kQuickIdivmod, div, div->GetDexPc()); + codegen_->InvokeRuntime(kQuickIdivmod, div); CheckEntrypointTypes<kQuickIdivmod, int32_t, int32_t, int32_t>(); } break; @@ -4788,7 +4774,7 @@ void InstructionCodeGeneratorARMVIXL::VisitDiv(HDiv* div) { DCHECK(LowRegisterFrom(div->GetLocations()->Out()).Is(r0)); DCHECK(HighRegisterFrom(div->GetLocations()->Out()).Is(r1)); - codegen_->InvokeRuntime(kQuickLdiv, div, div->GetDexPc()); + codegen_->InvokeRuntime(kQuickLdiv, div); CheckEntrypointTypes<kQuickLdiv, int64_t, int64_t, int64_t>(); break; } @@ -4909,26 +4895,26 @@ void InstructionCodeGeneratorARMVIXL::VisitRem(HRem* rem) { DCHECK(RegisterFrom(second).Is(calling_convention.GetRegisterAt(1))); DCHECK(out_reg.Is(r1)); - codegen_->InvokeRuntime(kQuickIdivmod, rem, rem->GetDexPc()); + codegen_->InvokeRuntime(kQuickIdivmod, rem); CheckEntrypointTypes<kQuickIdivmod, int32_t, int32_t, int32_t>(); } break; } case DataType::Type::kInt64: { - codegen_->InvokeRuntime(kQuickLmod, rem, rem->GetDexPc()); - CheckEntrypointTypes<kQuickLmod, int64_t, int64_t, int64_t>(); + codegen_->InvokeRuntime(kQuickLmod, rem); + CheckEntrypointTypes<kQuickLmod, int64_t, int64_t, int64_t>(); break; } case DataType::Type::kFloat32: { - codegen_->InvokeRuntime(kQuickFmodf, rem, rem->GetDexPc()); + codegen_->InvokeRuntime(kQuickFmodf, rem); CheckEntrypointTypes<kQuickFmodf, float, float, float>(); break; } case DataType::Type::kFloat64: { - codegen_->InvokeRuntime(kQuickFmod, rem, rem->GetDexPc()); + codegen_->InvokeRuntime(kQuickFmod, rem); CheckEntrypointTypes<kQuickFmod, double, double, double>(); break; } @@ -5716,7 +5702,7 @@ void LocationsBuilderARMVIXL::VisitNewInstance(HNewInstance* instruction) { } void InstructionCodeGeneratorARMVIXL::VisitNewInstance(HNewInstance* instruction) { - codegen_->InvokeRuntime(instruction->GetEntrypoint(), instruction, instruction->GetDexPc()); + codegen_->InvokeRuntime(instruction->GetEntrypoint(), instruction); CheckEntrypointTypes<kQuickAllocObjectWithChecks, void*, mirror::Class*>(); codegen_->MaybeGenerateMarkingRegisterCheck(/* code= */ 12); } @@ -5733,7 +5719,7 @@ void LocationsBuilderARMVIXL::VisitNewArray(HNewArray* instruction) { void InstructionCodeGeneratorARMVIXL::VisitNewArray(HNewArray* instruction) { // Note: if heap poisoning is enabled, the entry point takes care of poisoning the reference. QuickEntrypointEnum entrypoint = CodeGenerator::GetArrayAllocationEntrypoint(instruction); - codegen_->InvokeRuntime(entrypoint, instruction, instruction->GetDexPc()); + codegen_->InvokeRuntime(entrypoint, instruction); CheckEntrypointTypes<kQuickAllocArrayResolved, void*, mirror::Class*, int32_t>(); DCHECK(!codegen_->IsLeafMethod()); codegen_->MaybeGenerateMarkingRegisterCheck(/* code= */ 13); @@ -6443,7 +6429,7 @@ void LocationsBuilderARMVIXL::VisitStringBuilderAppend(HStringBuilderAppend* ins void InstructionCodeGeneratorARMVIXL::VisitStringBuilderAppend(HStringBuilderAppend* instruction) { __ Mov(r0, instruction->GetFormat()->GetValue()); - codegen_->InvokeRuntime(kQuickStringBuilderAppend, instruction, instruction->GetDexPc()); + codegen_->InvokeRuntime(kQuickStringBuilderAppend, instruction); } void LocationsBuilderARMVIXL::VisitUnresolvedInstanceFieldGet( @@ -6530,7 +6516,7 @@ void CodeGeneratorARMVIXL::GenerateImplicitNullCheck(HNullCheck* instruction) { vixl32::kMaxInstructionSizeInBytes, CodeBufferCheckScope::kMaximumSize); __ ldr(temps.Acquire(), MemOperand(InputRegisterAt(instruction, 0))); - RecordPcInfo(instruction, instruction->GetDexPc()); + RecordPcInfo(instruction); } void CodeGeneratorARMVIXL::GenerateExplicitNullCheck(HNullCheck* instruction) { @@ -8082,7 +8068,7 @@ void InstructionCodeGeneratorARMVIXL::VisitLoadString(HLoadString* load) NO_THRE DCHECK_EQ(load->GetLoadKind(), HLoadString::LoadKind::kRuntimeCall); InvokeRuntimeCallingConventionARMVIXL calling_convention; __ Mov(calling_convention.GetRegisterAt(0), load->GetStringIndex().index_); - codegen_->InvokeRuntime(kQuickResolveString, load, load->GetDexPc()); + codegen_->InvokeRuntime(kQuickResolveString, load); CheckEntrypointTypes<kQuickResolveString, void*, uint32_t>(); codegen_->MaybeGenerateMarkingRegisterCheck(/* code= */ 18); } @@ -8122,7 +8108,7 @@ void LocationsBuilderARMVIXL::VisitThrow(HThrow* instruction) { } void InstructionCodeGeneratorARMVIXL::VisitThrow(HThrow* instruction) { - codegen_->InvokeRuntime(kQuickDeliverException, instruction, instruction->GetDexPc()); + codegen_->InvokeRuntime(kQuickDeliverException, instruction); CheckEntrypointTypes<kQuickDeliverException, void, mirror::Object*>(); } @@ -8757,8 +8743,7 @@ void LocationsBuilderARMVIXL::VisitMonitorOperation(HMonitorOperation* instructi void InstructionCodeGeneratorARMVIXL::VisitMonitorOperation(HMonitorOperation* instruction) { codegen_->InvokeRuntime(instruction->IsEnter() ? kQuickLockObject : kQuickUnlockObject, - instruction, - instruction->GetDexPc()); + instruction); if (instruction->IsEnter()) { CheckEntrypointTypes<kQuickLockObject, void, mirror::Object*>(); } else { @@ -9631,7 +9616,7 @@ void CodeGeneratorARMVIXL::GenerateStaticOrDirectCall( CodeBufferCheckScope::kExactSize); // LR() __ blx(lr); - RecordPcInfo(invoke, invoke->GetDexPc(), slow_path); + RecordPcInfo(invoke, slow_path); } }; switch (invoke->GetCodePtrLocation()) { @@ -9643,7 +9628,7 @@ void CodeGeneratorARMVIXL::GenerateStaticOrDirectCall( vixl32::k32BitT32InstructionSizeInBytes, CodeBufferCheckScope::kMaximumSize); __ bl(GetFrameEntryLabel()); - RecordPcInfo(invoke, invoke->GetDexPc(), slow_path); + RecordPcInfo(invoke, slow_path); } break; case CodePtrLocation::kCallCriticalNative: { @@ -9733,7 +9718,7 @@ void CodeGeneratorARMVIXL::GenerateVirtualCall( CodeBufferCheckScope::kExactSize); // LR(); __ blx(lr); - RecordPcInfo(invoke, invoke->GetDexPc(), slow_path); + RecordPcInfo(invoke, slow_path); } } diff --git a/compiler/optimizing/code_generator_arm_vixl.h b/compiler/optimizing/code_generator_arm_vixl.h index ea8ec7e485..2e20591c98 100644 --- a/compiler/optimizing/code_generator_arm_vixl.h +++ b/compiler/optimizing/code_generator_arm_vixl.h @@ -615,7 +615,6 @@ class CodeGeneratorARMVIXL : public CodeGenerator { // Generate code to invoke a runtime entry point. void InvokeRuntime(QuickEntrypointEnum entrypoint, HInstruction* instruction, - uint32_t dex_pc, SlowPathCode* slow_path = nullptr) override; // Generate code to invoke a runtime entry point, but do not record diff --git a/compiler/optimizing/code_generator_riscv64.cc b/compiler/optimizing/code_generator_riscv64.cc index c2d82b8033..cd34b90f98 100644 --- a/compiler/optimizing/code_generator_riscv64.cc +++ b/compiler/optimizing/code_generator_riscv64.cc @@ -313,7 +313,7 @@ class SuspendCheckSlowPathRISCV64 : public SlowPathCodeRISCV64 { CodeGeneratorRISCV64* riscv64_codegen = down_cast<CodeGeneratorRISCV64*>(codegen); __ Bind(GetEntryLabel()); SaveLiveRegisters(codegen, locations); // Only saves live vector registers for SIMD. - riscv64_codegen->InvokeRuntime(kQuickTestSuspend, instruction_, instruction_->GetDexPc(), this); + riscv64_codegen->InvokeRuntime(kQuickTestSuspend, instruction_, this); CheckEntrypointTypes<kQuickTestSuspend, void, void>(); RestoreLiveRegisters(codegen, locations); // Only restores live vector registers for SIMD. if (successor_ == nullptr) { @@ -353,8 +353,7 @@ class NullCheckSlowPathRISCV64 : public SlowPathCodeRISCV64 { // Live registers will be restored in the catch block if caught. SaveLiveRegisters(codegen, instruction_->GetLocations()); } - riscv64_codegen->InvokeRuntime( - kQuickThrowNullPointer, instruction_, instruction_->GetDexPc(), this); + riscv64_codegen->InvokeRuntime(kQuickThrowNullPointer, instruction_, this); CheckEntrypointTypes<kQuickThrowNullPointer, void, void>(); } @@ -391,7 +390,7 @@ class BoundsCheckSlowPathRISCV64 : public SlowPathCodeRISCV64 { QuickEntrypointEnum entrypoint = instruction_->AsBoundsCheck()->IsStringCharAt() ? kQuickThrowStringBounds : kQuickThrowArrayBounds; - riscv64_codegen->InvokeRuntime(entrypoint, instruction_, instruction_->GetDexPc(), this); + riscv64_codegen->InvokeRuntime(entrypoint, instruction_, this); CheckEntrypointTypes<kQuickThrowStringBounds, void, int32_t, int32_t>(); CheckEntrypointTypes<kQuickThrowArrayBounds, void, int32_t, int32_t>(); } @@ -414,7 +413,6 @@ class LoadClassSlowPathRISCV64 : public SlowPathCodeRISCV64 { void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); Location out = locations->Out(); - const uint32_t dex_pc = instruction_->GetDexPc(); bool must_resolve_type = instruction_->IsLoadClass() && cls_->MustResolveTypeOnSlowPath(); bool must_do_clinit = instruction_->IsClinitCheck() || cls_->MustGenerateClinitCheck(); @@ -432,11 +430,10 @@ class LoadClassSlowPathRISCV64 : public SlowPathCodeRISCV64 { __ LoadConst32(calling_convention.GetRegisterAt(0), type_index.index_); if (cls_->NeedsAccessCheck()) { CheckEntrypointTypes<kQuickResolveTypeAndVerifyAccess, void*, uint32_t>(); - riscv64_codegen->InvokeRuntime( - kQuickResolveTypeAndVerifyAccess, instruction_, dex_pc, this); + riscv64_codegen->InvokeRuntime(kQuickResolveTypeAndVerifyAccess, instruction_, this); } else { CheckEntrypointTypes<kQuickResolveType, void*, uint32_t>(); - riscv64_codegen->InvokeRuntime(kQuickResolveType, instruction_, dex_pc, this); + riscv64_codegen->InvokeRuntime(kQuickResolveType, instruction_, this); } // If we also must_do_clinit, the resolved type is now in the correct register. } else { @@ -446,7 +443,7 @@ class LoadClassSlowPathRISCV64 : public SlowPathCodeRISCV64 { Location::RegisterLocation(calling_convention.GetRegisterAt(0)), source, cls_->GetType()); } if (must_do_clinit) { - riscv64_codegen->InvokeRuntime(kQuickInitializeStaticStorage, instruction_, dex_pc, this); + riscv64_codegen->InvokeRuntime(kQuickInitializeStaticStorage, instruction_, this); CheckEntrypointTypes<kQuickInitializeStaticStorage, void*, mirror::Class*>(); } @@ -484,7 +481,7 @@ class DeoptimizationSlowPathRISCV64 : public SlowPathCodeRISCV64 { InvokeRuntimeCallingConvention calling_convention; __ LoadConst32(calling_convention.GetRegisterAt(0), static_cast<uint32_t>(instruction_->AsDeoptimize()->GetDeoptimizationKind())); - riscv64_codegen->InvokeRuntime(kQuickDeoptimize, instruction_, instruction_->GetDexPc(), this); + riscv64_codegen->InvokeRuntime(kQuickDeoptimize, instruction_, this); CheckEntrypointTypes<kQuickDeoptimize, void, DeoptimizationKind>(); } @@ -522,10 +519,7 @@ class ReadBarrierForRootSlowPathRISCV64 : public SlowPathCodeRISCV64 { riscv64_codegen->MoveLocation(Location::RegisterLocation(calling_convention.GetRegisterAt(0)), root_, DataType::Type::kReference); - riscv64_codegen->InvokeRuntime(kQuickReadBarrierForRootSlow, - instruction_, - instruction_->GetDexPc(), - this); + riscv64_codegen->InvokeRuntime(kQuickReadBarrierForRootSlow, instruction_, this); CheckEntrypointTypes<kQuickReadBarrierForRootSlow, mirror::Object*, GcRoot<mirror::Object>*>(); riscv64_codegen->MoveLocation(out_, calling_convention.GetReturnLocation(type), type); @@ -557,7 +551,7 @@ class MethodEntryExitHooksSlowPathRISCV64 : public SlowPathCodeRISCV64 { if (instruction_->IsMethodExitHook()) { __ Li(A4, riscv64_codegen->GetFrameSize()); } - riscv64_codegen->InvokeRuntime(entry_point, instruction_, instruction_->GetDexPc(), this); + riscv64_codegen->InvokeRuntime(entry_point, instruction_, this); RestoreLiveRegisters(codegen, locations); __ J(GetExitLabel()); } @@ -599,7 +593,7 @@ class ArraySetSlowPathRISCV64 : public SlowPathCodeRISCV64 { codegen->GetMoveResolver()->EmitNativeCode(¶llel_move); CodeGeneratorRISCV64* riscv64_codegen = down_cast<CodeGeneratorRISCV64*>(codegen); - riscv64_codegen->InvokeRuntime(kQuickAputObject, instruction_, instruction_->GetDexPc(), this); + riscv64_codegen->InvokeRuntime(kQuickAputObject, instruction_, this); CheckEntrypointTypes<kQuickAputObject, void, mirror::Array*, int32_t, mirror::Object*>(); RestoreLiveRegisters(codegen, locations); __ J(GetExitLabel()); @@ -619,7 +613,6 @@ class TypeCheckSlowPathRISCV64 : public SlowPathCodeRISCV64 { void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); - uint32_t dex_pc = instruction_->GetDexPc(); DCHECK(instruction_->IsCheckCast() || !locations->GetLiveRegisters()->ContainsCoreRegister(locations->Out().reg())); CodeGeneratorRISCV64* riscv64_codegen = down_cast<CodeGeneratorRISCV64*>(codegen); @@ -639,14 +632,14 @@ class TypeCheckSlowPathRISCV64 : public SlowPathCodeRISCV64 { Location::RegisterLocation(calling_convention.GetRegisterAt(1)), DataType::Type::kReference); if (instruction_->IsInstanceOf()) { - riscv64_codegen->InvokeRuntime(kQuickInstanceofNonTrivial, instruction_, dex_pc, this); + riscv64_codegen->InvokeRuntime(kQuickInstanceofNonTrivial, instruction_, this); CheckEntrypointTypes<kQuickInstanceofNonTrivial, size_t, mirror::Object*, mirror::Class*>(); DataType::Type ret_type = instruction_->GetType(); Location ret_loc = calling_convention.GetReturnLocation(ret_type); riscv64_codegen->MoveLocation(locations->Out(), ret_loc, ret_type); } else { DCHECK(instruction_->IsCheckCast()); - riscv64_codegen->InvokeRuntime(kQuickCheckInstanceOf, instruction_, dex_pc, this); + riscv64_codegen->InvokeRuntime(kQuickCheckInstanceOf, instruction_, this); CheckEntrypointTypes<kQuickCheckInstanceOf, void, mirror::Object*, mirror::Class*>(); } @@ -674,8 +667,7 @@ class DivZeroCheckSlowPathRISCV64 : public SlowPathCodeRISCV64 { void EmitNativeCode(CodeGenerator* codegen) override { CodeGeneratorRISCV64* riscv64_codegen = down_cast<CodeGeneratorRISCV64*>(codegen); __ Bind(GetEntryLabel()); - riscv64_codegen->InvokeRuntime( - kQuickThrowDivZero, instruction_, instruction_->GetDexPc(), this); + riscv64_codegen->InvokeRuntime(kQuickThrowDivZero, instruction_, this); CheckEntrypointTypes<kQuickThrowDivZero, void, void>(); } @@ -768,8 +760,7 @@ class LoadStringSlowPathRISCV64 : public SlowPathCodeRISCV64 { SaveLiveRegisters(codegen, locations); __ LoadConst32(calling_convention.GetRegisterAt(0), string_index.index_); - riscv64_codegen->InvokeRuntime( - kQuickResolveString, instruction_, instruction_->GetDexPc(), this); + riscv64_codegen->InvokeRuntime(kQuickResolveString, instruction_, this); CheckEntrypointTypes<kQuickResolveString, void*, uint32_t>(); DataType::Type type = DataType::Type::kReference; @@ -4207,7 +4198,7 @@ void InstructionCodeGeneratorRISCV64::VisitInvokeInterface(HInvokeInterface* ins // RA(); __ Jalr(RA); DCHECK(!codegen_->IsLeafMethod()); - codegen_->RecordPcInfo(instruction, instruction->GetDexPc()); + codegen_->RecordPcInfo(instruction); } void LocationsBuilderRISCV64::VisitInvokeStaticOrDirect(HInvokeStaticOrDirect* instruction) { @@ -4586,7 +4577,7 @@ void InstructionCodeGeneratorRISCV64::VisitLoadString(HLoadString* instruction) InvokeRuntimeCallingConvention calling_convention; DCHECK(calling_convention.GetReturnLocation(DataType::Type::kReference).Equals(out_loc)); __ LoadConst32(calling_convention.GetRegisterAt(0), instruction->GetStringIndex().index_); - codegen_->InvokeRuntime(kQuickResolveString, instruction, instruction->GetDexPc()); + codegen_->InvokeRuntime(kQuickResolveString, instruction); CheckEntrypointTypes<kQuickResolveString, void*, uint32_t>(); } @@ -4656,8 +4647,7 @@ void LocationsBuilderRISCV64::VisitMonitorOperation(HMonitorOperation* instructi void InstructionCodeGeneratorRISCV64::VisitMonitorOperation(HMonitorOperation* instruction) { codegen_->InvokeRuntime(instruction->IsEnter() ? kQuickLockObject : kQuickUnlockObject, - instruction, - instruction->GetDexPc()); + instruction); if (instruction->IsEnter()) { CheckEntrypointTypes<kQuickLockObject, void, mirror::Object*>(); } else { @@ -4772,7 +4762,7 @@ void LocationsBuilderRISCV64::VisitNewArray(HNewArray* instruction) { void InstructionCodeGeneratorRISCV64::VisitNewArray(HNewArray* instruction) { QuickEntrypointEnum entrypoint = CodeGenerator::GetArrayAllocationEntrypoint(instruction); - codegen_->InvokeRuntime(entrypoint, instruction, instruction->GetDexPc()); + codegen_->InvokeRuntime(entrypoint, instruction); CheckEntrypointTypes<kQuickAllocArrayResolved, void*, mirror::Class*, int32_t>(); DCHECK(!codegen_->IsLeafMethod()); } @@ -4786,7 +4776,7 @@ void LocationsBuilderRISCV64::VisitNewInstance(HNewInstance* instruction) { } void InstructionCodeGeneratorRISCV64::VisitNewInstance(HNewInstance* instruction) { - codegen_->InvokeRuntime(instruction->GetEntrypoint(), instruction, instruction->GetDexPc()); + codegen_->InvokeRuntime(instruction->GetEntrypoint(), instruction); CheckEntrypointTypes<kQuickAllocObjectWithChecks, void*, mirror::Class*>(); } @@ -4981,7 +4971,7 @@ void InstructionCodeGeneratorRISCV64::VisitRem(HRem* instruction) { case DataType::Type::kFloat64: { QuickEntrypointEnum entrypoint = (type == DataType::Type::kFloat32) ? kQuickFmodf : kQuickFmod; - codegen_->InvokeRuntime(entrypoint, instruction, instruction->GetDexPc()); + codegen_->InvokeRuntime(entrypoint, instruction); if (type == DataType::Type::kFloat32) { CheckEntrypointTypes<kQuickFmodf, float, float, float>(); } else { @@ -5079,7 +5069,7 @@ void LocationsBuilderRISCV64::VisitStringBuilderAppend(HStringBuilderAppend* ins void InstructionCodeGeneratorRISCV64::VisitStringBuilderAppend(HStringBuilderAppend* instruction) { __ LoadConst32(A0, instruction->GetFormat()->GetValue()); - codegen_->InvokeRuntime(kQuickStringBuilderAppend, instruction, instruction->GetDexPc()); + codegen_->InvokeRuntime(kQuickStringBuilderAppend, instruction); } void LocationsBuilderRISCV64::VisitUnresolvedInstanceFieldGet( @@ -5288,7 +5278,7 @@ void LocationsBuilderRISCV64::VisitThrow(HThrow* instruction) { } void InstructionCodeGeneratorRISCV64::VisitThrow(HThrow* instruction) { - codegen_->InvokeRuntime(kQuickDeliverException, instruction, instruction->GetDexPc()); + codegen_->InvokeRuntime(kQuickDeliverException, instruction); CheckEntrypointTypes<kQuickDeliverException, void, mirror::Object*>(); } @@ -6137,7 +6127,7 @@ void CodeGeneratorRISCV64::GenerateFrameEntry() { DCHECK(GetCompilerOptions().GetImplicitStackOverflowChecks()); __ Loadw( Zero, SP, -static_cast<int32_t>(GetStackOverflowReservedBytes(InstructionSet::kRiscv64))); - RecordPcInfo(nullptr, 0); + RecordPcInfoForFrameOrBlockEntry(); } if (!HasEmptyFrame()) { @@ -6511,7 +6501,6 @@ void CodeGeneratorRISCV64::Finalize() { // Generate code to invoke a runtime entry point. void CodeGeneratorRISCV64::InvokeRuntime(QuickEntrypointEnum entrypoint, HInstruction* instruction, - uint32_t dex_pc, SlowPathCode* slow_path) { ValidateInvokeRuntime(entrypoint, instruction, slow_path); @@ -6522,7 +6511,7 @@ void CodeGeneratorRISCV64::InvokeRuntime(QuickEntrypointEnum entrypoint, __ Loadd(RA, TR, entrypoint_offset.Int32Value()); __ Jalr(RA); if (EntrypointRequiresStackMap(entrypoint)) { - RecordPcInfo(instruction, dex_pc, slow_path); + RecordPcInfo(instruction, slow_path); } } @@ -6559,7 +6548,7 @@ void CodeGeneratorRISCV64::GenerateImplicitNullCheck(HNullCheck* instruction) { Location obj = instruction->GetLocations()->InAt(0); __ Lw(Zero, obj.AsRegister<XRegister>(), 0); - RecordPcInfo(instruction, instruction->GetDexPc()); + RecordPcInfo(instruction); } void CodeGeneratorRISCV64::GenerateExplicitNullCheck(HNullCheck* instruction) { @@ -7035,7 +7024,7 @@ void CodeGeneratorRISCV64::GenerateStaticOrDirectCall(HInvokeStaticOrDirect* inv case CodePtrLocation::kCallSelf: DCHECK(!GetGraph()->HasShouldDeoptimizeFlag()); __ Jal(&frame_entry_label_); - RecordPcInfo(invoke, invoke->GetDexPc(), slow_path); + RecordPcInfo(invoke, slow_path); break; case CodePtrLocation::kCallArtMethod: // RA = callee_method->entry_point_from_quick_compiled_code_; @@ -7044,7 +7033,7 @@ void CodeGeneratorRISCV64::GenerateStaticOrDirectCall(HInvokeStaticOrDirect* inv ArtMethod::EntryPointFromQuickCompiledCodeOffset(kRiscv64PointerSize).Int32Value()); // RA() __ Jalr(RA); - RecordPcInfo(invoke, invoke->GetDexPc(), slow_path); + RecordPcInfo(invoke, slow_path); break; case CodePtrLocation::kCallCriticalNative: { size_t out_frame_size = @@ -7059,7 +7048,7 @@ void CodeGeneratorRISCV64::GenerateStaticOrDirectCall(HInvokeStaticOrDirect* inv __ Loadd(RA, callee_method.AsRegister<XRegister>(), offset.Int32Value()); } __ Jalr(RA); - RecordPcInfo(invoke, invoke->GetDexPc(), slow_path); + RecordPcInfo(invoke, slow_path); // The result is returned the same way in native ABI and managed ABI. No result conversion is // needed, see comments in `Riscv64JniCallingConvention::RequiresSmallResultTypeExtension()`. if (out_frame_size != 0u) { @@ -7096,7 +7085,7 @@ void CodeGeneratorRISCV64::MaybeGenerateInlineCacheCheck(HInstruction* instructi // Fast path for a monomorphic cache. __ Beq(klass, tmp, &done); } - InvokeRuntime(kQuickUpdateInlineCache, instruction, instruction->GetDexPc()); + InvokeRuntime(kQuickUpdateInlineCache, instruction); __ Bind(&done); } else { // This is unexpected, but we don't guarantee stable compilation across @@ -7143,7 +7132,7 @@ void CodeGeneratorRISCV64::GenerateVirtualCall(HInvokeVirtual* invoke, __ Loadd(RA, temp, entry_point.Int32Value()); // RA(); __ Jalr(RA); - RecordPcInfo(invoke, invoke->GetDexPc(), slow_path); + RecordPcInfo(invoke, slow_path); } void CodeGeneratorRISCV64::MoveFromReturnRegister(Location trg, DataType::Type type) { diff --git a/compiler/optimizing/code_generator_riscv64.h b/compiler/optimizing/code_generator_riscv64.h index 1945cacb6f..dc88296be2 100644 --- a/compiler/optimizing/code_generator_riscv64.h +++ b/compiler/optimizing/code_generator_riscv64.h @@ -504,7 +504,6 @@ class CodeGeneratorRISCV64 : public CodeGenerator { // Generate code to invoke a runtime entry point. void InvokeRuntime(QuickEntrypointEnum entrypoint, HInstruction* instruction, - uint32_t dex_pc, SlowPathCode* slow_path = nullptr) override; // Generate code to invoke a runtime entry point, but do not record diff --git a/compiler/optimizing/code_generator_x86.cc b/compiler/optimizing/code_generator_x86.cc index 6db49c7771..58d38feb8d 100644 --- a/compiler/optimizing/code_generator_x86.cc +++ b/compiler/optimizing/code_generator_x86.cc @@ -89,10 +89,7 @@ class NullCheckSlowPathX86 : public SlowPathCode { // Live registers will be restored in the catch block if caught. SaveLiveRegisters(codegen, instruction_->GetLocations()); } - x86_codegen->InvokeRuntime(kQuickThrowNullPointer, - instruction_, - instruction_->GetDexPc(), - this); + x86_codegen->InvokeRuntime(kQuickThrowNullPointer, instruction_, this); CheckEntrypointTypes<kQuickThrowNullPointer, void, void>(); } @@ -111,7 +108,7 @@ class DivZeroCheckSlowPathX86 : public SlowPathCode { void EmitNativeCode(CodeGenerator* codegen) override { CodeGeneratorX86* x86_codegen = down_cast<CodeGeneratorX86*>(codegen); __ Bind(GetEntryLabel()); - x86_codegen->InvokeRuntime(kQuickThrowDivZero, instruction_, instruction_->GetDexPc(), this); + x86_codegen->InvokeRuntime(kQuickThrowDivZero, instruction_, this); CheckEntrypointTypes<kQuickThrowDivZero, void, void>(); } @@ -213,7 +210,7 @@ class BoundsCheckSlowPathX86 : public SlowPathCode { QuickEntrypointEnum entrypoint = instruction_->AsBoundsCheck()->IsStringCharAt() ? kQuickThrowStringBounds : kQuickThrowArrayBounds; - x86_codegen->InvokeRuntime(entrypoint, instruction_, instruction_->GetDexPc(), this); + x86_codegen->InvokeRuntime(entrypoint, instruction_, this); CheckEntrypointTypes<kQuickThrowStringBounds, void, int32_t, int32_t>(); CheckEntrypointTypes<kQuickThrowArrayBounds, void, int32_t, int32_t>(); } @@ -236,7 +233,7 @@ class SuspendCheckSlowPathX86 : public SlowPathCode { CodeGeneratorX86* x86_codegen = down_cast<CodeGeneratorX86*>(codegen); __ Bind(GetEntryLabel()); SaveLiveRegisters(codegen, locations); // Only saves full width XMM for SIMD. - x86_codegen->InvokeRuntime(kQuickTestSuspend, instruction_, instruction_->GetDexPc(), this); + x86_codegen->InvokeRuntime(kQuickTestSuspend, instruction_, this); CheckEntrypointTypes<kQuickTestSuspend, void, void>(); RestoreLiveRegisters(codegen, locations); // Only restores full width XMM for SIMD. if (successor_ == nullptr) { @@ -279,7 +276,7 @@ class LoadStringSlowPathX86 : public SlowPathCode { InvokeRuntimeCallingConvention calling_convention; const dex::StringIndex string_index = instruction_->AsLoadString()->GetStringIndex(); __ movl(calling_convention.GetRegisterAt(0), Immediate(string_index.index_)); - x86_codegen->InvokeRuntime(kQuickResolveString, instruction_, instruction_->GetDexPc(), this); + x86_codegen->InvokeRuntime(kQuickResolveString, instruction_, this); CheckEntrypointTypes<kQuickResolveString, void*, uint32_t>(); x86_codegen->Move32(locations->Out(), Location::RegisterLocation(EAX)); RestoreLiveRegisters(codegen, locations); @@ -304,7 +301,6 @@ class LoadClassSlowPathX86 : public SlowPathCode { void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); Location out = locations->Out(); - const uint32_t dex_pc = instruction_->GetDexPc(); bool must_resolve_type = instruction_->IsLoadClass() && cls_->MustResolveTypeOnSlowPath(); bool must_do_clinit = instruction_->IsClinitCheck() || cls_->MustGenerateClinitCheck(); @@ -322,10 +318,10 @@ class LoadClassSlowPathX86 : public SlowPathCode { __ movl(calling_convention.GetRegisterAt(0), Immediate(type_index.index_)); if (cls_->NeedsAccessCheck()) { CheckEntrypointTypes<kQuickResolveTypeAndVerifyAccess, void*, uint32_t>(); - x86_codegen->InvokeRuntime(kQuickResolveTypeAndVerifyAccess, instruction_, dex_pc, this); + x86_codegen->InvokeRuntime(kQuickResolveTypeAndVerifyAccess, instruction_, this); } else { CheckEntrypointTypes<kQuickResolveType, void*, uint32_t>(); - x86_codegen->InvokeRuntime(kQuickResolveType, instruction_, dex_pc, this); + x86_codegen->InvokeRuntime(kQuickResolveType, instruction_, this); } // If we also must_do_clinit, the resolved type is now in the correct register. } else { @@ -334,7 +330,7 @@ class LoadClassSlowPathX86 : public SlowPathCode { x86_codegen->Move32(Location::RegisterLocation(calling_convention.GetRegisterAt(0)), source); } if (must_do_clinit) { - x86_codegen->InvokeRuntime(kQuickInitializeStaticStorage, instruction_, dex_pc, this); + x86_codegen->InvokeRuntime(kQuickInitializeStaticStorage, instruction_, this); CheckEntrypointTypes<kQuickInitializeStaticStorage, void*, mirror::Class*>(); } @@ -390,17 +386,11 @@ class TypeCheckSlowPathX86 : public SlowPathCode { Location::RegisterLocation(calling_convention.GetRegisterAt(1)), DataType::Type::kReference); if (instruction_->IsInstanceOf()) { - x86_codegen->InvokeRuntime(kQuickInstanceofNonTrivial, - instruction_, - instruction_->GetDexPc(), - this); + x86_codegen->InvokeRuntime(kQuickInstanceofNonTrivial, instruction_, this); CheckEntrypointTypes<kQuickInstanceofNonTrivial, size_t, mirror::Object*, mirror::Class*>(); } else { DCHECK(instruction_->IsCheckCast()); - x86_codegen->InvokeRuntime(kQuickCheckInstanceOf, - instruction_, - instruction_->GetDexPc(), - this); + x86_codegen->InvokeRuntime(kQuickCheckInstanceOf, instruction_, this); CheckEntrypointTypes<kQuickCheckInstanceOf, void, mirror::Object*, mirror::Class*>(); } @@ -437,7 +427,7 @@ class DeoptimizationSlowPathX86 : public SlowPathCode { x86_codegen->Load32BitValue( calling_convention.GetRegisterAt(0), static_cast<uint32_t>(instruction_->AsDeoptimize()->GetDeoptimizationKind())); - x86_codegen->InvokeRuntime(kQuickDeoptimize, instruction_, instruction_->GetDexPc(), this); + x86_codegen->InvokeRuntime(kQuickDeoptimize, instruction_, this); CheckEntrypointTypes<kQuickDeoptimize, void, DeoptimizationKind>(); } @@ -476,7 +466,7 @@ class ArraySetSlowPathX86 : public SlowPathCode { codegen->GetMoveResolver()->EmitNativeCode(¶llel_move); CodeGeneratorX86* x86_codegen = down_cast<CodeGeneratorX86*>(codegen); - x86_codegen->InvokeRuntime(kQuickAputObject, instruction_, instruction_->GetDexPc(), this); + x86_codegen->InvokeRuntime(kQuickAputObject, instruction_, this); CheckEntrypointTypes<kQuickAputObject, void, mirror::Array*, int32_t, mirror::Object*>(); RestoreLiveRegisters(codegen, locations); __ jmp(GetExitLabel()); @@ -878,7 +868,7 @@ class ReadBarrierForHeapReferenceSlowPathX86 : public SlowPathCode { codegen->GetMoveResolver()->EmitNativeCode(¶llel_move); __ movl(calling_convention.GetRegisterAt(2), Immediate(offset_)); } - x86_codegen->InvokeRuntime(kQuickReadBarrierSlow, instruction_, instruction_->GetDexPc(), this); + x86_codegen->InvokeRuntime(kQuickReadBarrierSlow, instruction_, this); CheckEntrypointTypes< kQuickReadBarrierSlow, mirror::Object*, mirror::Object*, mirror::Object*, uint32_t>(); x86_codegen->Move32(out_, Location::RegisterLocation(EAX)); @@ -942,10 +932,7 @@ class ReadBarrierForRootSlowPathX86 : public SlowPathCode { InvokeRuntimeCallingConvention calling_convention; CodeGeneratorX86* x86_codegen = down_cast<CodeGeneratorX86*>(codegen); x86_codegen->Move32(Location::RegisterLocation(calling_convention.GetRegisterAt(0)), root_); - x86_codegen->InvokeRuntime(kQuickReadBarrierForRootSlow, - instruction_, - instruction_->GetDexPc(), - this); + x86_codegen->InvokeRuntime(kQuickReadBarrierForRootSlow, instruction_, this); CheckEntrypointTypes<kQuickReadBarrierForRootSlow, mirror::Object*, GcRoot<mirror::Object>*>(); x86_codegen->Move32(out_, Location::RegisterLocation(EAX)); @@ -976,7 +963,7 @@ class MethodEntryExitHooksSlowPathX86 : public SlowPathCode { if (instruction_->IsMethodExitHook()) { __ movl(EBX, Immediate(codegen->GetFrameSize())); } - x86_codegen->InvokeRuntime(entry_point, instruction_, instruction_->GetDexPc(), this); + x86_codegen->InvokeRuntime(entry_point, instruction_, this); RestoreLiveRegisters(codegen, locations); __ jmp(GetExitLabel()); } @@ -1105,12 +1092,11 @@ size_t CodeGeneratorX86::RestoreFloatingPointRegister(size_t stack_index, uint32 void CodeGeneratorX86::InvokeRuntime(QuickEntrypointEnum entrypoint, HInstruction* instruction, - uint32_t dex_pc, SlowPathCode* slow_path) { ValidateInvokeRuntime(entrypoint, instruction, slow_path); GenerateInvokeRuntime(GetThreadOffset<kX86PointerSize>(entrypoint).Int32Value()); if (EntrypointRequiresStackMap(entrypoint)) { - RecordPcInfo(instruction, dex_pc, slow_path); + RecordPcInfo(instruction, slow_path); } } @@ -1429,7 +1415,7 @@ void CodeGeneratorX86::GenerateFrameEntry() { if (!skip_overflow_check) { size_t reserved_bytes = GetStackOverflowReservedBytes(InstructionSet::kX86); __ testl(EAX, Address(ESP, -static_cast<int32_t>(reserved_bytes))); - RecordPcInfo(nullptr, 0); + RecordPcInfoForFrameOrBlockEntry(); } if (!HasEmptyFrame()) { @@ -2944,7 +2930,7 @@ void InstructionCodeGeneratorX86::VisitInvokeInterface(HInvokeInterface* invoke) ArtMethod::EntryPointFromQuickCompiledCodeOffset(kX86PointerSize).Int32Value())); DCHECK(!codegen_->IsLeafMethod()); - codegen_->RecordPcInfo(invoke, invoke->GetDexPc()); + codegen_->RecordPcInfo(invoke); } void LocationsBuilderX86::VisitInvokePolymorphic(HInvokePolymorphic* invoke) { @@ -3470,12 +3456,12 @@ void InstructionCodeGeneratorX86::VisitTypeConversion(HTypeConversion* conversio break; case DataType::Type::kFloat32: - codegen_->InvokeRuntime(kQuickF2l, conversion, conversion->GetDexPc()); + codegen_->InvokeRuntime(kQuickF2l, conversion); CheckEntrypointTypes<kQuickF2l, int64_t, float>(); break; case DataType::Type::kFloat64: - codegen_->InvokeRuntime(kQuickD2l, conversion, conversion->GetDexPc()); + codegen_->InvokeRuntime(kQuickD2l, conversion); CheckEntrypointTypes<kQuickD2l, int64_t, double>(); break; @@ -4309,10 +4295,10 @@ void InstructionCodeGeneratorX86::GenerateDivRemIntegral(HBinaryOperation* instr DCHECK_EQ(EDX, out.AsRegisterPairHigh<Register>()); if (is_div) { - codegen_->InvokeRuntime(kQuickLdiv, instruction, instruction->GetDexPc()); + codegen_->InvokeRuntime(kQuickLdiv, instruction); CheckEntrypointTypes<kQuickLdiv, int64_t, int64_t, int64_t>(); } else { - codegen_->InvokeRuntime(kQuickLmod, instruction, instruction->GetDexPc()); + codegen_->InvokeRuntime(kQuickLmod, instruction); CheckEntrypointTypes<kQuickLmod, int64_t, int64_t, int64_t>(); } break; @@ -5208,7 +5194,7 @@ void LocationsBuilderX86::VisitNewInstance(HNewInstance* instruction) { } void InstructionCodeGeneratorX86::VisitNewInstance(HNewInstance* instruction) { - codegen_->InvokeRuntime(instruction->GetEntrypoint(), instruction, instruction->GetDexPc()); + codegen_->InvokeRuntime(instruction->GetEntrypoint(), instruction); CheckEntrypointTypes<kQuickAllocObjectWithChecks, void*, mirror::Class*>(); DCHECK(!codegen_->IsLeafMethod()); } @@ -5225,7 +5211,7 @@ void LocationsBuilderX86::VisitNewArray(HNewArray* instruction) { void InstructionCodeGeneratorX86::VisitNewArray(HNewArray* instruction) { // Note: if heap poisoning is enabled, the entry point takes care of poisoning the reference. QuickEntrypointEnum entrypoint = CodeGenerator::GetArrayAllocationEntrypoint(instruction); - codegen_->InvokeRuntime(entrypoint, instruction, instruction->GetDexPc()); + codegen_->InvokeRuntime(entrypoint, instruction); CheckEntrypointTypes<kQuickAllocArrayResolved, void*, mirror::Class*, int32_t>(); DCHECK(!codegen_->IsLeafMethod()); } @@ -5616,7 +5602,7 @@ void CodeGeneratorX86::GenerateStaticOrDirectCall( case CodePtrLocation::kCallSelf: DCHECK(!GetGraph()->HasShouldDeoptimizeFlag()); __ call(GetFrameEntryLabel()); - RecordPcInfo(invoke, invoke->GetDexPc(), slow_path); + RecordPcInfo(invoke, slow_path); break; case CodePtrLocation::kCallCriticalNative: { size_t out_frame_size = @@ -5633,7 +5619,7 @@ void CodeGeneratorX86::GenerateStaticOrDirectCall( __ call(Address(callee_method.AsRegister<Register>(), ArtMethod::EntryPointFromJniOffset(kX86PointerSize).Int32Value())); } - RecordPcInfo(invoke, invoke->GetDexPc(), slow_path); + RecordPcInfo(invoke, slow_path); if (out_frame_size == 0u && DataType::IsFloatingPointType(invoke->GetType())) { // Create space for conversion. out_frame_size = 8u; @@ -5679,7 +5665,7 @@ void CodeGeneratorX86::GenerateStaticOrDirectCall( __ call(Address(callee_method.AsRegister<Register>(), ArtMethod::EntryPointFromQuickCompiledCodeOffset( kX86PointerSize).Int32Value())); - RecordPcInfo(invoke, invoke->GetDexPc(), slow_path); + RecordPcInfo(invoke, slow_path); break; } @@ -5718,7 +5704,7 @@ void CodeGeneratorX86::GenerateVirtualCall( // call temp->GetEntryPoint(); __ call(Address( temp, ArtMethod::EntryPointFromQuickCompiledCodeOffset(kX86PointerSize).Int32Value())); - RecordPcInfo(invoke, invoke->GetDexPc(), slow_path); + RecordPcInfo(invoke, slow_path); } void CodeGeneratorX86::RecordBootImageIntrinsicPatch(HX86ComputeBaseMethodAddress* method_address, @@ -6395,7 +6381,7 @@ void LocationsBuilderX86::VisitStringBuilderAppend(HStringBuilderAppend* instruc void InstructionCodeGeneratorX86::VisitStringBuilderAppend(HStringBuilderAppend* instruction) { __ movl(EAX, Immediate(instruction->GetFormat()->GetValue())); - codegen_->InvokeRuntime(kQuickStringBuilderAppend, instruction, instruction->GetDexPc()); + codegen_->InvokeRuntime(kQuickStringBuilderAppend, instruction); } void LocationsBuilderX86::VisitUnresolvedInstanceFieldGet( @@ -6482,7 +6468,7 @@ void CodeGeneratorX86::GenerateImplicitNullCheck(HNullCheck* instruction) { Location obj = locations->InAt(0); __ testl(EAX, Address(obj.AsRegister<Register>(), 0)); - RecordPcInfo(instruction, instruction->GetDexPc()); + RecordPcInfo(instruction); } void CodeGeneratorX86::GenerateExplicitNullCheck(HNullCheck* instruction) { @@ -7723,7 +7709,7 @@ void InstructionCodeGeneratorX86::VisitLoadString(HLoadString* load) NO_THREAD_S InvokeRuntimeCallingConvention calling_convention; DCHECK_EQ(calling_convention.GetRegisterAt(0), out); __ movl(calling_convention.GetRegisterAt(0), Immediate(load->GetStringIndex().index_)); - codegen_->InvokeRuntime(kQuickResolveString, load, load->GetDexPc()); + codegen_->InvokeRuntime(kQuickResolveString, load); CheckEntrypointTypes<kQuickResolveString, void*, uint32_t>(); } @@ -7757,7 +7743,7 @@ void LocationsBuilderX86::VisitThrow(HThrow* instruction) { } void InstructionCodeGeneratorX86::VisitThrow(HThrow* instruction) { - codegen_->InvokeRuntime(kQuickDeliverException, instruction, instruction->GetDexPc()); + codegen_->InvokeRuntime(kQuickDeliverException, instruction); CheckEntrypointTypes<kQuickDeliverException, void, mirror::Object*>(); } @@ -8390,10 +8376,8 @@ void LocationsBuilderX86::VisitMonitorOperation(HMonitorOperation* instruction) } void InstructionCodeGeneratorX86::VisitMonitorOperation(HMonitorOperation* instruction) { - codegen_->InvokeRuntime(instruction->IsEnter() ? kQuickLockObject - : kQuickUnlockObject, - instruction, - instruction->GetDexPc()); + codegen_->InvokeRuntime(instruction->IsEnter() ? kQuickLockObject : kQuickUnlockObject, + instruction); if (instruction->IsEnter()) { CheckEntrypointTypes<kQuickLockObject, void, mirror::Object*>(); } else { diff --git a/compiler/optimizing/code_generator_x86.h b/compiler/optimizing/code_generator_x86.h index fae6c7f801..2c145b5133 100644 --- a/compiler/optimizing/code_generator_x86.h +++ b/compiler/optimizing/code_generator_x86.h @@ -436,7 +436,6 @@ class CodeGeneratorX86 : public CodeGenerator { // Generate code to invoke a runtime entry point. void InvokeRuntime(QuickEntrypointEnum entrypoint, HInstruction* instruction, - uint32_t dex_pc, SlowPathCode* slow_path = nullptr) override; // Generate code to invoke a runtime entry point, but do not record diff --git a/compiler/optimizing/code_generator_x86_64.cc b/compiler/optimizing/code_generator_x86_64.cc index dbbf80c744..9133f87c7b 100644 --- a/compiler/optimizing/code_generator_x86_64.cc +++ b/compiler/optimizing/code_generator_x86_64.cc @@ -89,10 +89,7 @@ class NullCheckSlowPathX86_64 : public SlowPathCode { // Live registers will be restored in the catch block if caught. SaveLiveRegisters(codegen, instruction_->GetLocations()); } - x86_64_codegen->InvokeRuntime(kQuickThrowNullPointer, - instruction_, - instruction_->GetDexPc(), - this); + x86_64_codegen->InvokeRuntime(kQuickThrowNullPointer, instruction_, this); CheckEntrypointTypes<kQuickThrowNullPointer, void, void>(); } @@ -111,7 +108,7 @@ class DivZeroCheckSlowPathX86_64 : public SlowPathCode { void EmitNativeCode(CodeGenerator* codegen) override { CodeGeneratorX86_64* x86_64_codegen = down_cast<CodeGeneratorX86_64*>(codegen); __ Bind(GetEntryLabel()); - x86_64_codegen->InvokeRuntime(kQuickThrowDivZero, instruction_, instruction_->GetDexPc(), this); + x86_64_codegen->InvokeRuntime(kQuickThrowDivZero, instruction_, this); CheckEntrypointTypes<kQuickThrowDivZero, void, void>(); } @@ -167,7 +164,7 @@ class SuspendCheckSlowPathX86_64 : public SlowPathCode { CodeGeneratorX86_64* x86_64_codegen = down_cast<CodeGeneratorX86_64*>(codegen); __ Bind(GetEntryLabel()); SaveLiveRegisters(codegen, locations); // Only saves full width XMM for SIMD. - x86_64_codegen->InvokeRuntime(kQuickTestSuspend, instruction_, instruction_->GetDexPc(), this); + x86_64_codegen->InvokeRuntime(kQuickTestSuspend, instruction_, this); CheckEntrypointTypes<kQuickTestSuspend, void, void>(); RestoreLiveRegisters(codegen, locations); // Only restores full width XMM for SIMD. if (successor_ == nullptr) { @@ -257,7 +254,7 @@ class BoundsCheckSlowPathX86_64 : public SlowPathCode { QuickEntrypointEnum entrypoint = instruction_->AsBoundsCheck()->IsStringCharAt() ? kQuickThrowStringBounds : kQuickThrowArrayBounds; - x86_64_codegen->InvokeRuntime(entrypoint, instruction_, instruction_->GetDexPc(), this); + x86_64_codegen->InvokeRuntime(entrypoint, instruction_, this); CheckEntrypointTypes<kQuickThrowStringBounds, void, int32_t, int32_t>(); CheckEntrypointTypes<kQuickThrowArrayBounds, void, int32_t, int32_t>(); } @@ -285,10 +282,7 @@ class LoadMethodTypeSlowPathX86_64: public SlowPathCode { const dex::ProtoIndex proto_index = instruction_->AsLoadMethodType()->GetProtoIndex(); // Custom calling convention: RAX serves as both input and output. __ movl(CpuRegister(RAX), Immediate(proto_index.index_)); - x86_64_codegen->InvokeRuntime(kQuickResolveMethodType, - instruction_, - instruction_->GetDexPc(), - this); + x86_64_codegen->InvokeRuntime(kQuickResolveMethodType, instruction_, this); CheckEntrypointTypes<kQuickResolveMethodType, void*, uint32_t>(); x86_64_codegen->Move(locations->Out(), Location::RegisterLocation(RAX)); RestoreLiveRegisters(codegen, locations); @@ -313,7 +307,6 @@ class LoadClassSlowPathX86_64 : public SlowPathCode { void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); Location out = locations->Out(); - const uint32_t dex_pc = instruction_->GetDexPc(); bool must_resolve_type = instruction_->IsLoadClass() && cls_->MustResolveTypeOnSlowPath(); bool must_do_clinit = instruction_->IsClinitCheck() || cls_->MustGenerateClinitCheck(); @@ -331,10 +324,10 @@ class LoadClassSlowPathX86_64 : public SlowPathCode { __ movl(CpuRegister(RAX), Immediate(type_index.index_)); if (cls_->NeedsAccessCheck()) { CheckEntrypointTypes<kQuickResolveTypeAndVerifyAccess, void*, uint32_t>(); - x86_64_codegen->InvokeRuntime(kQuickResolveTypeAndVerifyAccess, instruction_, dex_pc, this); + x86_64_codegen->InvokeRuntime(kQuickResolveTypeAndVerifyAccess, instruction_, this); } else { CheckEntrypointTypes<kQuickResolveType, void*, uint32_t>(); - x86_64_codegen->InvokeRuntime(kQuickResolveType, instruction_, dex_pc, this); + x86_64_codegen->InvokeRuntime(kQuickResolveType, instruction_, this); } // If we also must_do_clinit, the resolved type is now in the correct register. } else { @@ -343,7 +336,7 @@ class LoadClassSlowPathX86_64 : public SlowPathCode { x86_64_codegen->Move(Location::RegisterLocation(RAX), source); } if (must_do_clinit) { - x86_64_codegen->InvokeRuntime(kQuickInitializeStaticStorage, instruction_, dex_pc, this); + x86_64_codegen->InvokeRuntime(kQuickInitializeStaticStorage, instruction_, this); CheckEntrypointTypes<kQuickInitializeStaticStorage, void*, mirror::Class*>(); } @@ -381,10 +374,7 @@ class LoadStringSlowPathX86_64 : public SlowPathCode { const dex::StringIndex string_index = instruction_->AsLoadString()->GetStringIndex(); // Custom calling convention: RAX serves as both input and output. __ movl(CpuRegister(RAX), Immediate(string_index.index_)); - x86_64_codegen->InvokeRuntime(kQuickResolveString, - instruction_, - instruction_->GetDexPc(), - this); + x86_64_codegen->InvokeRuntime(kQuickResolveString, instruction_, this); CheckEntrypointTypes<kQuickResolveString, void*, uint32_t>(); x86_64_codegen->Move(locations->Out(), Location::RegisterLocation(RAX)); RestoreLiveRegisters(codegen, locations); @@ -405,7 +395,6 @@ class TypeCheckSlowPathX86_64 : public SlowPathCode { void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); - uint32_t dex_pc = instruction_->GetDexPc(); DCHECK(instruction_->IsCheckCast() || !locations->GetLiveRegisters()->ContainsCoreRegister(locations->Out().reg())); @@ -433,11 +422,11 @@ class TypeCheckSlowPathX86_64 : public SlowPathCode { Location::RegisterLocation(calling_convention.GetRegisterAt(1)), DataType::Type::kReference); if (instruction_->IsInstanceOf()) { - x86_64_codegen->InvokeRuntime(kQuickInstanceofNonTrivial, instruction_, dex_pc, this); + x86_64_codegen->InvokeRuntime(kQuickInstanceofNonTrivial, instruction_, this); CheckEntrypointTypes<kQuickInstanceofNonTrivial, size_t, mirror::Object*, mirror::Class*>(); } else { DCHECK(instruction_->IsCheckCast()); - x86_64_codegen->InvokeRuntime(kQuickCheckInstanceOf, instruction_, dex_pc, this); + x86_64_codegen->InvokeRuntime(kQuickCheckInstanceOf, instruction_, this); CheckEntrypointTypes<kQuickCheckInstanceOf, void, mirror::Object*, mirror::Class*>(); } @@ -475,7 +464,7 @@ class DeoptimizationSlowPathX86_64 : public SlowPathCode { x86_64_codegen->Load32BitValue( CpuRegister(calling_convention.GetRegisterAt(0)), static_cast<uint32_t>(instruction_->AsDeoptimize()->GetDeoptimizationKind())); - x86_64_codegen->InvokeRuntime(kQuickDeoptimize, instruction_, instruction_->GetDexPc(), this); + x86_64_codegen->InvokeRuntime(kQuickDeoptimize, instruction_, this); CheckEntrypointTypes<kQuickDeoptimize, void, DeoptimizationKind>(); } @@ -514,7 +503,7 @@ class ArraySetSlowPathX86_64 : public SlowPathCode { codegen->GetMoveResolver()->EmitNativeCode(¶llel_move); CodeGeneratorX86_64* x86_64_codegen = down_cast<CodeGeneratorX86_64*>(codegen); - x86_64_codegen->InvokeRuntime(kQuickAputObject, instruction_, instruction_->GetDexPc(), this); + x86_64_codegen->InvokeRuntime(kQuickAputObject, instruction_, this); CheckEntrypointTypes<kQuickAputObject, void, mirror::Array*, int32_t, mirror::Object*>(); RestoreLiveRegisters(codegen, locations); __ jmp(GetExitLabel()); @@ -924,10 +913,7 @@ class ReadBarrierForHeapReferenceSlowPathX86_64 : public SlowPathCode { codegen->GetMoveResolver()->EmitNativeCode(¶llel_move); __ movl(CpuRegister(calling_convention.GetRegisterAt(2)), Immediate(offset_)); } - x86_64_codegen->InvokeRuntime(kQuickReadBarrierSlow, - instruction_, - instruction_->GetDexPc(), - this); + x86_64_codegen->InvokeRuntime(kQuickReadBarrierSlow, instruction_, this); CheckEntrypointTypes< kQuickReadBarrierSlow, mirror::Object*, mirror::Object*, mirror::Object*, uint32_t>(); x86_64_codegen->Move(out_, Location::RegisterLocation(RAX)); @@ -992,10 +978,7 @@ class ReadBarrierForRootSlowPathX86_64 : public SlowPathCode { InvokeRuntimeCallingConvention calling_convention; CodeGeneratorX86_64* x86_64_codegen = down_cast<CodeGeneratorX86_64*>(codegen); x86_64_codegen->Move(Location::RegisterLocation(calling_convention.GetRegisterAt(0)), root_); - x86_64_codegen->InvokeRuntime(kQuickReadBarrierForRootSlow, - instruction_, - instruction_->GetDexPc(), - this); + x86_64_codegen->InvokeRuntime(kQuickReadBarrierForRootSlow, instruction_, this); CheckEntrypointTypes<kQuickReadBarrierForRootSlow, mirror::Object*, GcRoot<mirror::Object>*>(); x86_64_codegen->Move(out_, Location::RegisterLocation(RAX)); @@ -1028,7 +1011,7 @@ class MethodEntryExitHooksSlowPathX86_64 : public SlowPathCode { // Load FrameSize to pass to the exit hook. __ movq(CpuRegister(R8), Immediate(codegen->GetFrameSize())); } - x86_64_codegen->InvokeRuntime(entry_point, instruction_, instruction_->GetDexPc(), this); + x86_64_codegen->InvokeRuntime(entry_point, instruction_, this); RestoreLiveRegisters(codegen, locations); __ jmp(GetExitLabel()); } @@ -1209,7 +1192,7 @@ void CodeGeneratorX86_64::GenerateStaticOrDirectCall( case CodePtrLocation::kCallSelf: DCHECK(!GetGraph()->HasShouldDeoptimizeFlag()); __ call(&frame_entry_label_); - RecordPcInfo(invoke, invoke->GetDexPc(), slow_path); + RecordPcInfo(invoke, slow_path); break; case CodePtrLocation::kCallCriticalNative: { size_t out_frame_size = @@ -1225,7 +1208,7 @@ void CodeGeneratorX86_64::GenerateStaticOrDirectCall( __ call(Address(callee_method.AsRegister<CpuRegister>(), ArtMethod::EntryPointFromJniOffset(kX86_64PointerSize).SizeValue())); } - RecordPcInfo(invoke, invoke->GetDexPc(), slow_path); + RecordPcInfo(invoke, slow_path); // Zero-/sign-extend the result when needed due to native and managed ABI mismatch. switch (invoke->GetType()) { case DataType::Type::kBool: @@ -1260,7 +1243,7 @@ void CodeGeneratorX86_64::GenerateStaticOrDirectCall( __ call(Address(callee_method.AsRegister<CpuRegister>(), ArtMethod::EntryPointFromQuickCompiledCodeOffset( kX86_64PointerSize).SizeValue())); - RecordPcInfo(invoke, invoke->GetDexPc(), slow_path); + RecordPcInfo(invoke, slow_path); break; } @@ -1300,7 +1283,7 @@ void CodeGeneratorX86_64::GenerateVirtualCall( // call temp->GetEntryPoint(); __ call(Address(temp, ArtMethod::EntryPointFromQuickCompiledCodeOffset( kX86_64PointerSize).SizeValue())); - RecordPcInfo(invoke, invoke->GetDexPc(), slow_path); + RecordPcInfo(invoke, slow_path); } void CodeGeneratorX86_64::RecordBootImageIntrinsicPatch(uint32_t intrinsic_data) { @@ -1562,12 +1545,11 @@ size_t CodeGeneratorX86_64::RestoreFloatingPointRegister(size_t stack_index, uin void CodeGeneratorX86_64::InvokeRuntime(QuickEntrypointEnum entrypoint, HInstruction* instruction, - uint32_t dex_pc, SlowPathCode* slow_path) { ValidateInvokeRuntime(entrypoint, instruction, slow_path); GenerateInvokeRuntime(GetThreadOffset<kX86_64PointerSize>(entrypoint).Int32Value()); if (EntrypointRequiresStackMap(entrypoint)) { - RecordPcInfo(instruction, dex_pc, slow_path); + RecordPcInfo(instruction, slow_path); } } @@ -1892,7 +1874,7 @@ void CodeGeneratorX86_64::GenerateFrameEntry() { if (!skip_overflow_check) { size_t reserved_bytes = GetStackOverflowReservedBytes(InstructionSet::kX86_64); __ testq(CpuRegister(RAX), Address(CpuRegister(RSP), -static_cast<int32_t>(reserved_bytes))); - RecordPcInfo(nullptr, 0); + RecordPcInfoForFrameOrBlockEntry(); } if (!HasEmptyFrame()) { @@ -3270,7 +3252,7 @@ void InstructionCodeGeneratorX86_64::VisitInvokeInterface(HInvokeInterface* invo temp, ArtMethod::EntryPointFromQuickCompiledCodeOffset(kX86_64PointerSize).SizeValue())); DCHECK(!codegen_->IsLeafMethod()); - codegen_->RecordPcInfo(invoke, invoke->GetDexPc()); + codegen_->RecordPcInfo(invoke); } void LocationsBuilderX86_64::VisitInvokePolymorphic(HInvokePolymorphic* invoke) { @@ -5171,7 +5153,7 @@ void LocationsBuilderX86_64::VisitNewInstance(HNewInstance* instruction) { } void InstructionCodeGeneratorX86_64::VisitNewInstance(HNewInstance* instruction) { - codegen_->InvokeRuntime(instruction->GetEntrypoint(), instruction, instruction->GetDexPc()); + codegen_->InvokeRuntime(instruction->GetEntrypoint(), instruction); CheckEntrypointTypes<kQuickAllocObjectWithChecks, void*, mirror::Class*>(); DCHECK(!codegen_->IsLeafMethod()); } @@ -5188,7 +5170,7 @@ void LocationsBuilderX86_64::VisitNewArray(HNewArray* instruction) { void InstructionCodeGeneratorX86_64::VisitNewArray(HNewArray* instruction) { // Note: if heap poisoning is enabled, the entry point takes care of poisoning the reference. QuickEntrypointEnum entrypoint = CodeGenerator::GetArrayAllocationEntrypoint(instruction); - codegen_->InvokeRuntime(entrypoint, instruction, instruction->GetDexPc()); + codegen_->InvokeRuntime(entrypoint, instruction); CheckEntrypointTypes<kQuickAllocArrayResolved, void*, mirror::Class*, int32_t>(); DCHECK(!codegen_->IsLeafMethod()); } @@ -5711,7 +5693,7 @@ void LocationsBuilderX86_64::VisitStringBuilderAppend(HStringBuilderAppend* inst void InstructionCodeGeneratorX86_64::VisitStringBuilderAppend(HStringBuilderAppend* instruction) { __ movl(CpuRegister(RDI), Immediate(instruction->GetFormat()->GetValue())); - codegen_->InvokeRuntime(kQuickStringBuilderAppend, instruction, instruction->GetDexPc()); + codegen_->InvokeRuntime(kQuickStringBuilderAppend, instruction); } void LocationsBuilderX86_64::VisitUnresolvedInstanceFieldGet( @@ -5798,7 +5780,7 @@ void CodeGeneratorX86_64::GenerateImplicitNullCheck(HNullCheck* instruction) { Location obj = locations->InAt(0); __ testl(CpuRegister(RAX), Address(obj.AsRegister<CpuRegister>(), 0)); - RecordPcInfo(instruction, instruction->GetDexPc()); + RecordPcInfo(instruction); } void CodeGeneratorX86_64::GenerateExplicitNullCheck(HNullCheck* instruction) { @@ -7071,9 +7053,7 @@ void InstructionCodeGeneratorX86_64::VisitLoadString(HLoadString* load) NO_THREA // Custom calling convention: RAX serves as both input and output. __ movl(CpuRegister(RAX), Immediate(load->GetStringIndex().index_)); - codegen_->InvokeRuntime(kQuickResolveString, - load, - load->GetDexPc()); + codegen_->InvokeRuntime(kQuickResolveString, load); CheckEntrypointTypes<kQuickResolveString, void*, uint32_t>(); } @@ -7108,7 +7088,7 @@ void LocationsBuilderX86_64::VisitThrow(HThrow* instruction) { } void InstructionCodeGeneratorX86_64::VisitThrow(HThrow* instruction) { - codegen_->InvokeRuntime(kQuickDeliverException, instruction, instruction->GetDexPc()); + codegen_->InvokeRuntime(kQuickDeliverException, instruction); CheckEntrypointTypes<kQuickDeliverException, void, mirror::Object*>(); } @@ -7757,8 +7737,7 @@ void LocationsBuilderX86_64::VisitMonitorOperation(HMonitorOperation* instructio void InstructionCodeGeneratorX86_64::VisitMonitorOperation(HMonitorOperation* instruction) { codegen_->InvokeRuntime(instruction->IsEnter() ? kQuickLockObject : kQuickUnlockObject, - instruction, - instruction->GetDexPc()); + instruction); if (instruction->IsEnter()) { CheckEntrypointTypes<kQuickLockObject, void, mirror::Object*>(); } else { diff --git a/compiler/optimizing/code_generator_x86_64.h b/compiler/optimizing/code_generator_x86_64.h index 3024116402..8a514b21f0 100644 --- a/compiler/optimizing/code_generator_x86_64.h +++ b/compiler/optimizing/code_generator_x86_64.h @@ -415,7 +415,6 @@ class CodeGeneratorX86_64 : public CodeGenerator { // Generate code to invoke a runtime entry point. void InvokeRuntime(QuickEntrypointEnum entrypoint, HInstruction* instruction, - uint32_t dex_pc, SlowPathCode* slow_path = nullptr) override; // Generate code to invoke a runtime entry point, but do not record diff --git a/compiler/optimizing/intrinsics_arm64.cc b/compiler/optimizing/intrinsics_arm64.cc index a4463cb248..31e617baec 100644 --- a/compiler/optimizing/intrinsics_arm64.cc +++ b/compiler/optimizing/intrinsics_arm64.cc @@ -184,8 +184,7 @@ class InvokePolymorphicSlowPathARM64 : public SlowPathCodeARM64 { // Passing `MethodHandle` object as hidden argument. __ Mov(w0, method_handle_.W()); codegen->InvokeRuntime(QuickEntrypointEnum::kQuickInvokePolymorphicWithHiddenReceiver, - instruction_, - instruction_->GetDexPc()); + instruction_); RestoreLiveRegisters(codegen, instruction_->GetLocations()); __ B(GetExitLabel()); @@ -2476,7 +2475,7 @@ static void GenerateVisitStringIndexOf(HInvoke* invoke, __ Mov(tmp_reg, 0); } - codegen->InvokeRuntime(kQuickIndexOf, invoke, invoke->GetDexPc(), slow_path); + codegen->InvokeRuntime(kQuickIndexOf, invoke, slow_path); CheckEntrypointTypes<kQuickIndexOf, int32_t, void*, uint32_t, uint32_t>(); if (slow_path != nullptr) { @@ -2540,7 +2539,7 @@ void IntrinsicCodeGeneratorARM64::VisitStringNewStringFromBytes(HInvoke* invoke) codegen_->AddSlowPath(slow_path); __ B(eq, slow_path->GetEntryLabel()); - codegen_->InvokeRuntime(kQuickAllocStringFromBytes, invoke, invoke->GetDexPc(), slow_path); + codegen_->InvokeRuntime(kQuickAllocStringFromBytes, invoke, slow_path); CheckEntrypointTypes<kQuickAllocStringFromBytes, void*, void*, int32_t, int32_t, int32_t>(); __ Bind(slow_path->GetExitLabel()); } @@ -2562,7 +2561,7 @@ void IntrinsicCodeGeneratorARM64::VisitStringNewStringFromChars(HInvoke* invoke) // java.lang.StringFactory.newStringFromChars(int offset, int charCount, char[] data) // // all include a null check on `data` before calling that method. - codegen_->InvokeRuntime(kQuickAllocStringFromChars, invoke, invoke->GetDexPc()); + codegen_->InvokeRuntime(kQuickAllocStringFromChars, invoke); CheckEntrypointTypes<kQuickAllocStringFromChars, void*, int32_t, int32_t, void*>(); } @@ -2585,7 +2584,7 @@ void IntrinsicCodeGeneratorARM64::VisitStringNewStringFromString(HInvoke* invoke codegen_->AddSlowPath(slow_path); __ B(eq, slow_path->GetEntryLabel()); - codegen_->InvokeRuntime(kQuickAllocStringFromString, invoke, invoke->GetDexPc(), slow_path); + codegen_->InvokeRuntime(kQuickAllocStringFromString, invoke, slow_path); CheckEntrypointTypes<kQuickAllocStringFromString, void*, void*>(); __ Bind(slow_path->GetExitLabel()); } @@ -2637,7 +2636,7 @@ static void CreateFPFPFPToFPLocations(ArenaAllocator* allocator, HInvoke* invoke static void GenFPToFPCall(HInvoke* invoke, CodeGeneratorARM64* codegen, QuickEntrypointEnum entry) { - codegen->InvokeRuntime(entry, invoke, invoke->GetDexPc()); + codegen->InvokeRuntime(entry, invoke); } void IntrinsicLocationsBuilderARM64::VisitMathCos(HInvoke* invoke) { @@ -3669,7 +3668,7 @@ void IntrinsicCodeGeneratorARM64::HandleValueOf(HInvoke* invoke, auto allocate_instance = [&]() { DCHECK(out.X().Is(InvokeRuntimeCallingConvention().GetRegisterAt(0))); codegen_->LoadIntrinsicDeclaringClass(out, invoke); - codegen_->InvokeRuntime(kQuickAllocObjectInitialized, invoke, invoke->GetDexPc()); + codegen_->InvokeRuntime(kQuickAllocObjectInitialized, invoke); CheckEntrypointTypes<kQuickAllocObjectWithChecks, void*, mirror::Class*>(); }; if (invoke->InputAt(0)->IsIntConstant()) { @@ -6118,7 +6117,7 @@ void IntrinsicCodeGeneratorARM64::VisitMethodHandleInvokeExact(HInvoke* invoke) Offset entry_point = ArtMethod::EntryPointFromQuickCompiledCodeOffset(kArm64PointerSize); __ Ldr(lr, MemOperand(method, entry_point.SizeValue())); __ Blr(lr); - codegen_->RecordPcInfo(invoke, invoke->GetDexPc(), slow_path); + codegen_->RecordPcInfo(invoke, slow_path); __ Bind(slow_path->GetExitLabel()); } diff --git a/compiler/optimizing/intrinsics_arm_vixl.cc b/compiler/optimizing/intrinsics_arm_vixl.cc index db7457a68b..a6f6eb0ba0 100644 --- a/compiler/optimizing/intrinsics_arm_vixl.cc +++ b/compiler/optimizing/intrinsics_arm_vixl.cc @@ -1081,7 +1081,7 @@ static void GenerateVisitStringIndexOf(HInvoke* invoke, __ Mov(tmp_reg, 0); } - codegen->InvokeRuntime(kQuickIndexOf, invoke, invoke->GetDexPc(), slow_path); + codegen->InvokeRuntime(kQuickIndexOf, invoke, slow_path); CheckEntrypointTypes<kQuickIndexOf, int32_t, void*, uint32_t, uint32_t>(); if (slow_path != nullptr) { @@ -1143,7 +1143,7 @@ void IntrinsicCodeGeneratorARMVIXL::VisitStringNewStringFromBytes(HInvoke* invok codegen_->AddSlowPath(slow_path); __ B(eq, slow_path->GetEntryLabel()); - codegen_->InvokeRuntime(kQuickAllocStringFromBytes, invoke, invoke->GetDexPc(), slow_path); + codegen_->InvokeRuntime(kQuickAllocStringFromBytes, invoke, slow_path); CheckEntrypointTypes<kQuickAllocStringFromBytes, void*, void*, int32_t, int32_t, int32_t>(); __ Bind(slow_path->GetExitLabel()); } @@ -1165,7 +1165,7 @@ void IntrinsicCodeGeneratorARMVIXL::VisitStringNewStringFromChars(HInvoke* invok // java.lang.StringFactory.newStringFromChars(int offset, int charCount, char[] data) // // all include a null check on `data` before calling that method. - codegen_->InvokeRuntime(kQuickAllocStringFromChars, invoke, invoke->GetDexPc()); + codegen_->InvokeRuntime(kQuickAllocStringFromChars, invoke); CheckEntrypointTypes<kQuickAllocStringFromChars, void*, int32_t, int32_t, void*>(); } @@ -1186,7 +1186,7 @@ void IntrinsicCodeGeneratorARMVIXL::VisitStringNewStringFromString(HInvoke* invo codegen_->AddSlowPath(slow_path); __ B(eq, slow_path->GetEntryLabel()); - codegen_->InvokeRuntime(kQuickAllocStringFromString, invoke, invoke->GetDexPc(), slow_path); + codegen_->InvokeRuntime(kQuickAllocStringFromString, invoke, slow_path); CheckEntrypointTypes<kQuickAllocStringFromString, void*, void*>(); __ Bind(slow_path->GetExitLabel()); @@ -1666,7 +1666,7 @@ static void GenFPToFPCall(HInvoke* invoke, __ Vmov(RegisterFrom(locations->GetTemp(0)), RegisterFrom(locations->GetTemp(1)), InputDRegisterAt(invoke, 0)); - codegen->InvokeRuntime(entry, invoke, invoke->GetDexPc()); + codegen->InvokeRuntime(entry, invoke); __ Vmov(OutputDRegister(invoke), RegisterFrom(locations->GetTemp(0)), RegisterFrom(locations->GetTemp(1))); @@ -1688,7 +1688,7 @@ static void GenFPFPToFPCall(HInvoke* invoke, __ Vmov(RegisterFrom(locations->GetTemp(2)), RegisterFrom(locations->GetTemp(3)), InputDRegisterAt(invoke, 1)); - codegen->InvokeRuntime(entry, invoke, invoke->GetDexPc()); + codegen->InvokeRuntime(entry, invoke); __ Vmov(OutputDRegister(invoke), RegisterFrom(locations->GetTemp(0)), RegisterFrom(locations->GetTemp(1))); @@ -2338,7 +2338,7 @@ void IntrinsicCodeGeneratorARMVIXL::HandleValueOf(HInvoke* invoke, auto allocate_instance = [&]() { DCHECK(out.Is(InvokeRuntimeCallingConventionARMVIXL().GetRegisterAt(0))); codegen_->LoadIntrinsicDeclaringClass(out, invoke); - codegen_->InvokeRuntime(kQuickAllocObjectInitialized, invoke, invoke->GetDexPc()); + codegen_->InvokeRuntime(kQuickAllocObjectInitialized, invoke); CheckEntrypointTypes<kQuickAllocObjectWithChecks, void*, mirror::Class*>(); }; if (invoke->InputAt(0)->IsIntConstant()) { diff --git a/compiler/optimizing/intrinsics_riscv64.cc b/compiler/optimizing/intrinsics_riscv64.cc index 385ac0e857..cc0f114c56 100644 --- a/compiler/optimizing/intrinsics_riscv64.cc +++ b/compiler/optimizing/intrinsics_riscv64.cc @@ -109,8 +109,7 @@ class InvokePolymorphicSlowPathRISCV64 : public SlowPathCodeRISCV64 { // Passing `MethodHandle` object as hidden argument. __ Mv(A0, method_handle_); codegen->InvokeRuntime(QuickEntrypointEnum::kQuickInvokePolymorphicWithHiddenReceiver, - instruction_, - instruction_->GetDexPc()); + instruction_); RestoreLiveRegisters(codegen, instruction_->GetLocations()); __ J(GetExitLabel()); @@ -731,7 +730,7 @@ void IntrinsicCodeGeneratorRISCV64::HandleValueOf(HInvoke* invoke, auto allocate_instance = [&]() { DCHECK_EQ(out, InvokeRuntimeCallingConvention().GetRegisterAt(0)); codegen_->LoadIntrinsicDeclaringClass(out, invoke); - codegen_->InvokeRuntime(kQuickAllocObjectInitialized, invoke, invoke->GetDexPc()); + codegen_->InvokeRuntime(kQuickAllocObjectInitialized, invoke); CheckEntrypointTypes<kQuickAllocObjectWithChecks, void*, mirror::Class*>(); }; if (invoke->InputAt(0)->IsIntConstant()) { @@ -946,7 +945,7 @@ static void GenerateVisitStringIndexOf(HInvoke* invoke, __ Li(tmp_reg, 0); } - codegen->InvokeRuntime(kQuickIndexOf, invoke, invoke->GetDexPc(), slow_path); + codegen->InvokeRuntime(kQuickIndexOf, invoke, slow_path); CheckEntrypointTypes<kQuickIndexOf, int32_t, void*, uint32_t, uint32_t>(); if (slow_path != nullptr) { @@ -1009,7 +1008,7 @@ void IntrinsicCodeGeneratorRISCV64::VisitStringNewStringFromBytes(HInvoke* invok codegen_->AddSlowPath(slow_path); __ Beqz(byte_array, slow_path->GetEntryLabel()); - codegen_->InvokeRuntime(kQuickAllocStringFromBytes, invoke, invoke->GetDexPc(), slow_path); + codegen_->InvokeRuntime(kQuickAllocStringFromBytes, invoke, slow_path); CheckEntrypointTypes<kQuickAllocStringFromBytes, void*, void*, int32_t, int32_t, int32_t>(); __ Bind(slow_path->GetExitLabel()); } @@ -1031,7 +1030,7 @@ void IntrinsicCodeGeneratorRISCV64::VisitStringNewStringFromChars(HInvoke* invok // java.lang.StringFactory.newStringFromChars(int offset, int charCount, char[] data) // // all include a null check on `data` before calling that method. - codegen_->InvokeRuntime(kQuickAllocStringFromChars, invoke, invoke->GetDexPc()); + codegen_->InvokeRuntime(kQuickAllocStringFromChars, invoke); CheckEntrypointTypes<kQuickAllocStringFromChars, void*, int32_t, int32_t, void*>(); } @@ -1053,7 +1052,7 @@ void IntrinsicCodeGeneratorRISCV64::VisitStringNewStringFromString(HInvoke* invo codegen_->AddSlowPath(slow_path); __ Beqz(string_to_copy, slow_path->GetEntryLabel()); - codegen_->InvokeRuntime(kQuickAllocStringFromString, invoke, invoke->GetDexPc(), slow_path); + codegen_->InvokeRuntime(kQuickAllocStringFromString, invoke, slow_path); CheckEntrypointTypes<kQuickAllocStringFromString, void*, void*>(); __ Bind(slow_path->GetExitLabel()); } @@ -5224,7 +5223,7 @@ void IntrinsicLocationsBuilderRISCV64::VisitMathCos(HInvoke* invoke) { } void IntrinsicCodeGeneratorRISCV64::VisitMathCos(HInvoke* invoke) { - codegen_->InvokeRuntime(kQuickCos, invoke, invoke->GetDexPc()); + codegen_->InvokeRuntime(kQuickCos, invoke); } void IntrinsicLocationsBuilderRISCV64::VisitMathSin(HInvoke* invoke) { @@ -5232,7 +5231,7 @@ void IntrinsicLocationsBuilderRISCV64::VisitMathSin(HInvoke* invoke) { } void IntrinsicCodeGeneratorRISCV64::VisitMathSin(HInvoke* invoke) { - codegen_->InvokeRuntime(kQuickSin, invoke, invoke->GetDexPc()); + codegen_->InvokeRuntime(kQuickSin, invoke); } void IntrinsicLocationsBuilderRISCV64::VisitMathAcos(HInvoke* invoke) { @@ -5240,7 +5239,7 @@ void IntrinsicLocationsBuilderRISCV64::VisitMathAcos(HInvoke* invoke) { } void IntrinsicCodeGeneratorRISCV64::VisitMathAcos(HInvoke* invoke) { - codegen_->InvokeRuntime(kQuickAcos, invoke, invoke->GetDexPc()); + codegen_->InvokeRuntime(kQuickAcos, invoke); } void IntrinsicLocationsBuilderRISCV64::VisitMathAsin(HInvoke* invoke) { @@ -5248,7 +5247,7 @@ void IntrinsicLocationsBuilderRISCV64::VisitMathAsin(HInvoke* invoke) { } void IntrinsicCodeGeneratorRISCV64::VisitMathAsin(HInvoke* invoke) { - codegen_->InvokeRuntime(kQuickAsin, invoke, invoke->GetDexPc()); + codegen_->InvokeRuntime(kQuickAsin, invoke); } void IntrinsicLocationsBuilderRISCV64::VisitMathAtan(HInvoke* invoke) { @@ -5256,7 +5255,7 @@ void IntrinsicLocationsBuilderRISCV64::VisitMathAtan(HInvoke* invoke) { } void IntrinsicCodeGeneratorRISCV64::VisitMathAtan(HInvoke* invoke) { - codegen_->InvokeRuntime(kQuickAtan, invoke, invoke->GetDexPc()); + codegen_->InvokeRuntime(kQuickAtan, invoke); } void IntrinsicLocationsBuilderRISCV64::VisitMathAtan2(HInvoke* invoke) { @@ -5264,7 +5263,7 @@ void IntrinsicLocationsBuilderRISCV64::VisitMathAtan2(HInvoke* invoke) { } void IntrinsicCodeGeneratorRISCV64::VisitMathAtan2(HInvoke* invoke) { - codegen_->InvokeRuntime(kQuickAtan2, invoke, invoke->GetDexPc()); + codegen_->InvokeRuntime(kQuickAtan2, invoke); } void IntrinsicLocationsBuilderRISCV64::VisitMathPow(HInvoke* invoke) { @@ -5272,7 +5271,7 @@ void IntrinsicLocationsBuilderRISCV64::VisitMathPow(HInvoke* invoke) { } void IntrinsicCodeGeneratorRISCV64::VisitMathPow(HInvoke* invoke) { - codegen_->InvokeRuntime(kQuickPow, invoke, invoke->GetDexPc()); + codegen_->InvokeRuntime(kQuickPow, invoke); } void IntrinsicLocationsBuilderRISCV64::VisitMathCbrt(HInvoke* invoke) { @@ -5280,7 +5279,7 @@ void IntrinsicLocationsBuilderRISCV64::VisitMathCbrt(HInvoke* invoke) { } void IntrinsicCodeGeneratorRISCV64::VisitMathCbrt(HInvoke* invoke) { - codegen_->InvokeRuntime(kQuickCbrt, invoke, invoke->GetDexPc()); + codegen_->InvokeRuntime(kQuickCbrt, invoke); } void IntrinsicLocationsBuilderRISCV64::VisitMathCosh(HInvoke* invoke) { @@ -5288,7 +5287,7 @@ void IntrinsicLocationsBuilderRISCV64::VisitMathCosh(HInvoke* invoke) { } void IntrinsicCodeGeneratorRISCV64::VisitMathCosh(HInvoke* invoke) { - codegen_->InvokeRuntime(kQuickCosh, invoke, invoke->GetDexPc()); + codegen_->InvokeRuntime(kQuickCosh, invoke); } void IntrinsicLocationsBuilderRISCV64::VisitMathExp(HInvoke* invoke) { @@ -5296,7 +5295,7 @@ void IntrinsicLocationsBuilderRISCV64::VisitMathExp(HInvoke* invoke) { } void IntrinsicCodeGeneratorRISCV64::VisitMathExp(HInvoke* invoke) { - codegen_->InvokeRuntime(kQuickExp, invoke, invoke->GetDexPc()); + codegen_->InvokeRuntime(kQuickExp, invoke); } void IntrinsicLocationsBuilderRISCV64::VisitMathExpm1(HInvoke* invoke) { @@ -5304,7 +5303,7 @@ void IntrinsicLocationsBuilderRISCV64::VisitMathExpm1(HInvoke* invoke) { } void IntrinsicCodeGeneratorRISCV64::VisitMathExpm1(HInvoke* invoke) { - codegen_->InvokeRuntime(kQuickExpm1, invoke, invoke->GetDexPc()); + codegen_->InvokeRuntime(kQuickExpm1, invoke); } void IntrinsicLocationsBuilderRISCV64::VisitMathHypot(HInvoke* invoke) { @@ -5312,7 +5311,7 @@ void IntrinsicLocationsBuilderRISCV64::VisitMathHypot(HInvoke* invoke) { } void IntrinsicCodeGeneratorRISCV64::VisitMathHypot(HInvoke* invoke) { - codegen_->InvokeRuntime(kQuickHypot, invoke, invoke->GetDexPc()); + codegen_->InvokeRuntime(kQuickHypot, invoke); } void IntrinsicLocationsBuilderRISCV64::VisitMathLog(HInvoke* invoke) { @@ -5320,7 +5319,7 @@ void IntrinsicLocationsBuilderRISCV64::VisitMathLog(HInvoke* invoke) { } void IntrinsicCodeGeneratorRISCV64::VisitMathLog(HInvoke* invoke) { - codegen_->InvokeRuntime(kQuickLog, invoke, invoke->GetDexPc()); + codegen_->InvokeRuntime(kQuickLog, invoke); } void IntrinsicLocationsBuilderRISCV64::VisitMathLog10(HInvoke* invoke) { @@ -5328,7 +5327,7 @@ void IntrinsicLocationsBuilderRISCV64::VisitMathLog10(HInvoke* invoke) { } void IntrinsicCodeGeneratorRISCV64::VisitMathLog10(HInvoke* invoke) { - codegen_->InvokeRuntime(kQuickLog10, invoke, invoke->GetDexPc()); + codegen_->InvokeRuntime(kQuickLog10, invoke); } void IntrinsicLocationsBuilderRISCV64::VisitMathNextAfter(HInvoke* invoke) { @@ -5336,7 +5335,7 @@ void IntrinsicLocationsBuilderRISCV64::VisitMathNextAfter(HInvoke* invoke) { } void IntrinsicCodeGeneratorRISCV64::VisitMathNextAfter(HInvoke* invoke) { - codegen_->InvokeRuntime(kQuickNextAfter, invoke, invoke->GetDexPc()); + codegen_->InvokeRuntime(kQuickNextAfter, invoke); } void IntrinsicLocationsBuilderRISCV64::VisitMathSinh(HInvoke* invoke) { @@ -5344,7 +5343,7 @@ void IntrinsicLocationsBuilderRISCV64::VisitMathSinh(HInvoke* invoke) { } void IntrinsicCodeGeneratorRISCV64::VisitMathSinh(HInvoke* invoke) { - codegen_->InvokeRuntime(kQuickSinh, invoke, invoke->GetDexPc()); + codegen_->InvokeRuntime(kQuickSinh, invoke); } void IntrinsicLocationsBuilderRISCV64::VisitMathTan(HInvoke* invoke) { @@ -5352,7 +5351,7 @@ void IntrinsicLocationsBuilderRISCV64::VisitMathTan(HInvoke* invoke) { } void IntrinsicCodeGeneratorRISCV64::VisitMathTan(HInvoke* invoke) { - codegen_->InvokeRuntime(kQuickTan, invoke, invoke->GetDexPc()); + codegen_->InvokeRuntime(kQuickTan, invoke); } void IntrinsicLocationsBuilderRISCV64::VisitMathTanh(HInvoke* invoke) { @@ -5360,7 +5359,7 @@ void IntrinsicLocationsBuilderRISCV64::VisitMathTanh(HInvoke* invoke) { } void IntrinsicCodeGeneratorRISCV64::VisitMathTanh(HInvoke* invoke) { - codegen_->InvokeRuntime(kQuickTanh, invoke, invoke->GetDexPc()); + codegen_->InvokeRuntime(kQuickTanh, invoke); } void IntrinsicLocationsBuilderRISCV64::VisitMathSqrt(HInvoke* invoke) { @@ -5814,7 +5813,7 @@ void IntrinsicCodeGeneratorRISCV64::VisitMethodHandleInvokeExact(HInvoke* invoke Offset entry_point = ArtMethod::EntryPointFromQuickCompiledCodeOffset(kRiscv64PointerSize); __ Loadd(RA, method, entry_point.SizeValue()); __ Jalr(RA); - codegen_->RecordPcInfo(invoke, invoke->GetDexPc(), slow_path); + codegen_->RecordPcInfo(invoke, slow_path); __ Bind(slow_path->GetExitLabel()); } diff --git a/compiler/optimizing/intrinsics_x86.cc b/compiler/optimizing/intrinsics_x86.cc index 3f021d9aef..5a6b8832c4 100644 --- a/compiler/optimizing/intrinsics_x86.cc +++ b/compiler/optimizing/intrinsics_x86.cc @@ -471,7 +471,7 @@ static void GenFPToFPCall(HInvoke* invoke, CodeGeneratorX86* codegen, QuickEntry } // Now do the actual call. - codegen->InvokeRuntime(entry, invoke, invoke->GetDexPc()); + codegen->InvokeRuntime(entry, invoke); // Extract the return value from the FP stack. __ fstpl(Address(ESP, 0)); @@ -1012,7 +1012,7 @@ void IntrinsicCodeGeneratorX86::VisitStringCompareTo(HInvoke* invoke) { codegen_->AddSlowPath(slow_path); __ j(kEqual, slow_path->GetEntryLabel()); - codegen_->InvokeRuntime(kQuickStringCompareTo, invoke, invoke->GetDexPc(), slow_path); + codegen_->InvokeRuntime(kQuickStringCompareTo, invoke, slow_path); __ Bind(slow_path->GetExitLabel()); } @@ -1351,7 +1351,7 @@ void IntrinsicCodeGeneratorX86::VisitStringNewStringFromBytes(HInvoke* invoke) { codegen_->AddSlowPath(slow_path); __ j(kEqual, slow_path->GetEntryLabel()); - codegen_->InvokeRuntime(kQuickAllocStringFromBytes, invoke, invoke->GetDexPc()); + codegen_->InvokeRuntime(kQuickAllocStringFromBytes, invoke); CheckEntrypointTypes<kQuickAllocStringFromBytes, void*, void*, int32_t, int32_t, int32_t>(); __ Bind(slow_path->GetExitLabel()); } @@ -1373,7 +1373,7 @@ void IntrinsicCodeGeneratorX86::VisitStringNewStringFromChars(HInvoke* invoke) { // java.lang.StringFactory.newStringFromChars(int offset, int charCount, char[] data) // // all include a null check on `data` before calling that method. - codegen_->InvokeRuntime(kQuickAllocStringFromChars, invoke, invoke->GetDexPc()); + codegen_->InvokeRuntime(kQuickAllocStringFromChars, invoke); CheckEntrypointTypes<kQuickAllocStringFromChars, void*, int32_t, int32_t, void*>(); } @@ -1395,7 +1395,7 @@ void IntrinsicCodeGeneratorX86::VisitStringNewStringFromString(HInvoke* invoke) codegen_->AddSlowPath(slow_path); __ j(kEqual, slow_path->GetEntryLabel()); - codegen_->InvokeRuntime(kQuickAllocStringFromString, invoke, invoke->GetDexPc()); + codegen_->InvokeRuntime(kQuickAllocStringFromString, invoke); CheckEntrypointTypes<kQuickAllocStringFromString, void*, void*>(); __ Bind(slow_path->GetExitLabel()); } @@ -3606,7 +3606,7 @@ void IntrinsicCodeGeneratorX86::HandleValueOf(HInvoke* invoke, auto allocate_instance = [&]() { DCHECK_EQ(out, InvokeRuntimeCallingConvention().GetRegisterAt(0)); codegen_->LoadIntrinsicDeclaringClass(out, invoke->AsInvokeStaticOrDirect()); - codegen_->InvokeRuntime(kQuickAllocObjectInitialized, invoke, invoke->GetDexPc()); + codegen_->InvokeRuntime(kQuickAllocObjectInitialized, invoke); CheckEntrypointTypes<kQuickAllocObjectWithChecks, void*, mirror::Class*>(); }; if (invoke->InputAt(0)->IsIntConstant()) { diff --git a/compiler/optimizing/intrinsics_x86_64.cc b/compiler/optimizing/intrinsics_x86_64.cc index 18963bf135..281f196f06 100644 --- a/compiler/optimizing/intrinsics_x86_64.cc +++ b/compiler/optimizing/intrinsics_x86_64.cc @@ -166,8 +166,7 @@ class InvokePolymorphicSlowPathX86_64 : public SlowPathCode { // Passing `MethodHandle` object as hidden argument. __ movl(CpuRegister(RDI), method_handle_); x86_64_codegen->InvokeRuntime(QuickEntrypointEnum::kQuickInvokePolymorphicWithHiddenReceiver, - instruction_, - instruction_->GetDexPc()); + instruction_); RestoreLiveRegisters(codegen, instruction_->GetLocations()); __ jmp(GetExitLabel()); @@ -520,7 +519,7 @@ static void GenFPToFPCall(HInvoke* invoke, CodeGeneratorX86_64* codegen, DCHECK(locations->WillCall()); DCHECK(invoke->IsInvokeStaticOrDirect()); - codegen->InvokeRuntime(entry, invoke, invoke->GetDexPc()); + codegen->InvokeRuntime(entry, invoke); } void IntrinsicLocationsBuilderX86_64::VisitMathCos(HInvoke* invoke) { @@ -1240,7 +1239,7 @@ void IntrinsicCodeGeneratorX86_64::VisitStringCompareTo(HInvoke* invoke) { codegen_->AddSlowPath(slow_path); __ j(kEqual, slow_path->GetEntryLabel()); - codegen_->InvokeRuntime(kQuickStringCompareTo, invoke, invoke->GetDexPc(), slow_path); + codegen_->InvokeRuntime(kQuickStringCompareTo, invoke, slow_path); __ Bind(slow_path->GetExitLabel()); } @@ -1565,7 +1564,7 @@ void IntrinsicCodeGeneratorX86_64::VisitStringNewStringFromBytes(HInvoke* invoke codegen_->AddSlowPath(slow_path); __ j(kEqual, slow_path->GetEntryLabel()); - codegen_->InvokeRuntime(kQuickAllocStringFromBytes, invoke, invoke->GetDexPc()); + codegen_->InvokeRuntime(kQuickAllocStringFromBytes, invoke); CheckEntrypointTypes<kQuickAllocStringFromBytes, void*, void*, int32_t, int32_t, int32_t>(); __ Bind(slow_path->GetExitLabel()); } @@ -1587,7 +1586,7 @@ void IntrinsicCodeGeneratorX86_64::VisitStringNewStringFromChars(HInvoke* invoke // java.lang.StringFactory.newStringFromChars(int offset, int charCount, char[] data) // // all include a null check on `data` before calling that method. - codegen_->InvokeRuntime(kQuickAllocStringFromChars, invoke, invoke->GetDexPc()); + codegen_->InvokeRuntime(kQuickAllocStringFromChars, invoke); CheckEntrypointTypes<kQuickAllocStringFromChars, void*, int32_t, int32_t, void*>(); } @@ -1609,7 +1608,7 @@ void IntrinsicCodeGeneratorX86_64::VisitStringNewStringFromString(HInvoke* invok codegen_->AddSlowPath(slow_path); __ j(kEqual, slow_path->GetEntryLabel()); - codegen_->InvokeRuntime(kQuickAllocStringFromString, invoke, invoke->GetDexPc()); + codegen_->InvokeRuntime(kQuickAllocStringFromString, invoke); CheckEntrypointTypes<kQuickAllocStringFromString, void*, void*>(); __ Bind(slow_path->GetExitLabel()); } @@ -3416,7 +3415,7 @@ void IntrinsicCodeGeneratorX86_64::HandleValueOf(HInvoke* invoke, CpuRegister argument = CpuRegister(calling_convention.GetRegisterAt(0)); auto allocate_instance = [&]() { codegen_->LoadIntrinsicDeclaringClass(argument, invoke); - codegen_->InvokeRuntime(kQuickAllocObjectInitialized, invoke, invoke->GetDexPc()); + codegen_->InvokeRuntime(kQuickAllocObjectInitialized, invoke); CheckEntrypointTypes<kQuickAllocObjectWithChecks, void*, mirror::Class*>(); }; if (invoke->InputAt(0)->IsIntConstant()) { @@ -4375,7 +4374,7 @@ void IntrinsicCodeGeneratorX86_64::VisitMethodHandleInvokeExact(HInvoke* invoke) __ call(Address( method, ArtMethod::EntryPointFromQuickCompiledCodeOffset(art::PointerSize::k64).SizeValue())); - codegen_->RecordPcInfo(invoke, invoke->GetDexPc(), slow_path); + codegen_->RecordPcInfo(invoke, slow_path); __ Bind(slow_path->GetExitLabel()); } |