diff options
author | Andreas Gampe <agampe@google.com> | 2017-09-15 11:59:26 -0700 |
---|---|---|
committer | Andreas Gampe <agampe@google.com> | 2017-09-18 11:36:24 -0700 |
commit | e2abbc604ce003c776c00ecf1293796bb4c4ac5a (patch) | |
tree | f7d124d1861cad2162c30dfe932bb4e1beaf41ef /profman | |
parent | 7090dfe84f78b1928fcbdfd664d0dd9ea52633ff (diff) | |
download | android_art-e2abbc604ce003c776c00ecf1293796bb4c4ac5a.tar.gz android_art-e2abbc604ce003c776c00ecf1293796bb4c4ac5a.tar.bz2 android_art-e2abbc604ce003c776c00ecf1293796bb4c4ac5a.zip |
ART: Move kDexNoIndex to dex_file_types.h
Define the constant with the types to allow lowering the dependency
on DexFile.
Test: m
Change-Id: I3c61421db45be96d2057e01b1a7825883d8bd178
Diffstat (limited to 'profman')
-rw-r--r-- | profman/profman.cc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/profman/profman.cc b/profman/profman.cc index d0c99e0201..91061a691d 100644 --- a/profman/profman.cc +++ b/profman/profman.cc @@ -39,6 +39,7 @@ #include "boot_image_profile.h" #include "bytecode_utils.h" #include "dex_file.h" +#include "dex_file_types.h" #include "jit/profile_compilation_info.h" #include "profile_assistant.h" #include "runtime.h" @@ -668,14 +669,14 @@ class ProfMan FINAL { constexpr uint16_t kInvalidMethodIndex = std::numeric_limits<uint16_t>::max() - 1; return kInvalidMethodIndex >= dex_file->NumMethodIds() ? kInvalidMethodIndex - : DexFile::kDexNoIndex; + : dex::kDexNoIndex; } std::vector<std::string> name_and_signature; Split(method_spec, kProfileParsingFirstCharInSignature, &name_and_signature); if (name_and_signature.size() != 2) { LOG(ERROR) << "Invalid method name and signature " << method_spec; - return DexFile::kDexNoIndex; + return dex::kDexNoIndex; } const std::string& name = name_and_signature[0]; @@ -684,24 +685,24 @@ class ProfMan FINAL { const DexFile::StringId* name_id = dex_file->FindStringId(name.c_str()); if (name_id == nullptr) { LOG(WARNING) << "Could not find name: " << name; - return DexFile::kDexNoIndex; + return dex::kDexNoIndex; } dex::TypeIndex return_type_idx; std::vector<dex::TypeIndex> param_type_idxs; if (!dex_file->CreateTypeList(signature, &return_type_idx, ¶m_type_idxs)) { LOG(WARNING) << "Could not create type list" << signature; - return DexFile::kDexNoIndex; + return dex::kDexNoIndex; } const DexFile::ProtoId* proto_id = dex_file->FindProtoId(return_type_idx, param_type_idxs); if (proto_id == nullptr) { LOG(WARNING) << "Could not find proto_id: " << name; - return DexFile::kDexNoIndex; + return dex::kDexNoIndex; } const DexFile::MethodId* method_id = dex_file->FindMethodId( dex_file->GetTypeId(class_ref.type_index), *name_id, *proto_id); if (method_id == nullptr) { LOG(WARNING) << "Could not find method_id: " << name; - return DexFile::kDexNoIndex; + return dex::kDexNoIndex; } return dex_file->GetIndexForMethodId(*method_id); @@ -848,7 +849,7 @@ class ProfMan FINAL { } const uint32_t method_index = FindMethodIndex(class_ref, method_spec); - if (method_index == DexFile::kDexNoIndex) { + if (method_index == dex::kDexNoIndex) { return false; } |