diff options
author | Ian Rogers <irogers@google.com> | 2011-11-14 18:35:10 -0800 |
---|---|---|
committer | Ian Rogers <irogers@google.com> | 2011-11-14 18:45:22 -0800 |
commit | 9b1a4f425711c26d0465d54a1cb95ec4a813322a (patch) | |
tree | 07a996d94ad42313f100b3912a608aceead6c6b8 /src/dex_file.h | |
parent | b861dc0077342d5a1d2dd9cade3f6990620778ec (diff) | |
download | art-9b1a4f425711c26d0465d54a1cb95ec4a813322a.zip art-9b1a4f425711c26d0465d54a1cb95ec4a813322a.tar.gz art-9b1a4f425711c26d0465d54a1cb95ec4a813322a.tar.bz2 |
Refactor testing to use dex file find routines.
Change-Id: I0abdbd06c7666f23490241984e4d4340d398e18b
Diffstat (limited to 'src/dex_file.h')
-rw-r--r-- | src/dex_file.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/dex_file.h b/src/dex_file.h index 62b99ab..d48067b 100644 --- a/src/dex_file.h +++ b/src/dex_file.h @@ -300,6 +300,17 @@ class DexFile { return field_ids_[idx]; } + uint32_t GetIndexForFieldId(const FieldId& field_id) const { + CHECK_GE(&field_id, field_ids_); + CHECK_LT(&field_id, field_ids_ + header_->field_ids_size_); + return &field_id - field_ids_; + } + + // Looks up a field by its declaring class, name and type + const FieldId* FindFieldId(const DexFile::TypeId& declaring_klass, + const DexFile::StringId& name, + const DexFile::TypeId& type) const; + // Returns the declaring class descriptor string of a field id. const char* GetFieldDeclaringClassDescriptor(const FieldId& field_id) const { const DexFile::TypeId& type_id = GetTypeId(field_id.class_idx_); @@ -335,8 +346,9 @@ class DexFile { return &method_id - method_ids_; } - // Looks up a method by its class_dex, name and proto_id - const MethodId* FindMethodId(const DexFile::TypeId& klass, const DexFile::StringId& name, + // Looks up a method by its declaring class, name and proto_id + const MethodId* FindMethodId(const DexFile::TypeId& declaring_klass, + const DexFile::StringId& name, const DexFile::ProtoId& signature) const; // Returns the declaring class descriptor string of a method id. |