Change a few places to use string version of GetTypeId
GetTypeId is about 20% faster than GetStringId + integer GetTypeID
since it does less binary searches.
Change-Id: I876c4ac89ab206acca217b2287b0197ef2e408c2
diff --git a/compiler/driver/compiler_driver-inl.h b/compiler/driver/compiler_driver-inl.h
index 1a7dbe3..14ba81d 100644
--- a/compiler/driver/compiler_driver-inl.h
+++ b/compiler/driver/compiler_driver-inl.h
@@ -187,15 +187,11 @@
// Search dex file for localized ssb index, may fail if member's class is a parent
// of the class mentioned in the dex file and there is no dex cache entry.
std::string temp;
- const DexFile::StringId* string_id =
- dex_file->FindStringId(resolved_member->GetDeclaringClass()->GetDescriptor(&temp));
- if (string_id != nullptr) {
- const DexFile::TypeId* type_id =
- dex_file->FindTypeId(dex_file->GetIndexForStringId(*string_id));
- if (type_id != nullptr) {
- // medium path, needs check of static storage base being initialized
- storage_idx = dex_file->GetIndexForTypeId(*type_id);
- }
+ const DexFile::TypeId* type_id =
+ dex_file->FindTypeId(resolved_member->GetDeclaringClass()->GetDescriptor(&temp));
+ if (type_id != nullptr) {
+ // medium path, needs check of static storage base being initialized
+ storage_idx = dex_file->GetIndexForTypeId(*type_id);
}
}
if (storage_idx != DexFile::kDexNoIndex) {