diff options
author | 2022-10-04 09:51:12 +0100 | |
---|---|---|
committer | 2022-10-04 11:29:22 +0000 | |
commit | cbb9de0d1b7d9522adaa36705ddd7f0e8378334b (patch) | |
tree | edc9f94c892c1120bb013e81db3ae836e2beb2fe | |
parent | eed7aec50d6a4576ba170da82e79b3d71d977fa0 (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.cc | 3 |
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 = |