From e6c0f2a75bd969253279580e2e4772e54787034b Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Mon, 7 Sep 2020 08:30:52 +0100 Subject: Pass a full MethodReference of the invoke in HInvoke nodes. Cleanup to ensure we don't make mistakes when passing a dex method index to the HInvoke constructor, and we know which dex file it relates to. Test: test.py Change-Id: I625949add88a6b97e1dafeb7aed37961e105d6aa --- compiler/optimizing/code_generator.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'compiler/optimizing/code_generator.cc') diff --git a/compiler/optimizing/code_generator.cc b/compiler/optimizing/code_generator.cc index 901424f570..4f1ab75d82 100644 --- a/compiler/optimizing/code_generator.cc +++ b/compiler/optimizing/code_generator.cc @@ -573,7 +573,8 @@ const char* CodeGenerator::GetCriticalNativeShorty(HInvokeStaticOrDirect* invoke void CodeGenerator::GenerateInvokeStaticOrDirectRuntimeCall( HInvokeStaticOrDirect* invoke, Location temp, SlowPathCode* slow_path) { - MoveConstant(temp, invoke->GetDexMethodIndex()); + MethodReference method_reference(invoke->GetMethodReference()); + MoveConstant(temp, method_reference.index); // The access check is unnecessary but we do not want to introduce // extra entrypoints for the codegens that do not support some @@ -602,7 +603,8 @@ void CodeGenerator::GenerateInvokeStaticOrDirectRuntimeCall( InvokeRuntime(entrypoint, invoke, invoke->GetDexPc(), slow_path); } void CodeGenerator::GenerateInvokeUnresolvedRuntimeCall(HInvokeUnresolved* invoke) { - MoveConstant(invoke->GetLocations()->GetTemp(0), invoke->GetDexMethodIndex()); + MethodReference method_reference(invoke->GetMethodReference()); + MoveConstant(invoke->GetLocations()->GetTemp(0), method_reference.index); // Initialize to anything to silent compiler warnings. QuickEntrypointEnum entrypoint = kQuickInvokeStaticTrampolineWithAccessCheck; -- cgit v1.2.3-59-g8ed1b