summaryrefslogtreecommitdiff
path: root/compiler/optimizing/code_generator.cc
diff options
context:
space:
mode:
authorNicolas Geoffray <ngeoffray@google.com>2020-09-07 08:30:52 +0100
committerNicolas Geoffray <ngeoffray@google.com>2020-09-08 13:51:53 +0000
commite6c0f2a75bd969253279580e2e4772e54787034b (patch)
tree79598b2b6b457d9c718ddb18e29a0211a73ae85a /compiler/optimizing/code_generator.cc
parent63c0c2d9da31d26781f5e77aba6125f0d0988795 (diff)
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
Diffstat (limited to 'compiler/optimizing/code_generator.cc')
-rw-r--r--compiler/optimizing/code_generator.cc6
1 files changed, 4 insertions, 2 deletions
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;