From cbb9de0d1b7d9522adaa36705ddd7f0e8378334b Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Tue, 4 Oct 2022 09:51:12 +0100 Subject: Use ArtMethod::GetImtIndex to avoid recomputing the imt index. Small inefficiency spotted when investigating b/249522283. Test: test.py Bug: 249522283 Change-Id: I96f7a141b2e3ad6669760e2f784a093ce58c277f --- compiler/optimizing/instruction_builder.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'compiler/optimizing/instruction_builder.cc') 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 = -- cgit v1.2.3-59-g8ed1b