summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2022-10-04 09:51:12 +0100
committer Nicolas Geoffray <ngeoffray@google.com> 2022-10-04 11:29:22 +0000
commitcbb9de0d1b7d9522adaa36705ddd7f0e8378334b (patch)
treeedc9f94c892c1120bb013e81db3ae836e2beb2fe
parenteed7aec50d6a4576ba170da82e79b3d71d977fa0 (diff)
Use ArtMethod::GetImtIndex to avoid recomputing the imt index.
Small inefficiency spotted when investigating b/249522283. Test: test.py Bug: 249522283 Change-Id: I96f7a141b2e3ad6669760e2f784a093ce58c277f
-rw-r--r--compiler/optimizing/instruction_builder.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/optimizing/instruction_builder.cc b/compiler/optimizing/instruction_builder.cc
index ba58c8d1fe..b80e509258 100644
--- a/compiler/optimizing/instruction_builder.cc
+++ b/compiler/optimizing/instruction_builder.cc
@@ -981,7 +981,8 @@ static ArtMethod* ResolveMethod(uint16_t method_idx,
*imt_or_vtable_index = resolved_method->GetVtableIndex();
} else if (*invoke_type == kInterface) {
// For HInvokeInterface we need the IMT index.
- *imt_or_vtable_index = ImTable::GetImtIndex(resolved_method);
+ *imt_or_vtable_index = resolved_method->GetImtIndex();
+ DCHECK_EQ(*imt_or_vtable_index, ImTable::GetImtIndex(resolved_method));
}
*is_string_constructor =