summaryrefslogtreecommitdiffstats
path: root/runtime/mirror
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/mirror')
-rw-r--r--runtime/mirror/class-inl.h4
-rw-r--r--runtime/mirror/class.cc18
-rw-r--r--runtime/mirror/class.h7
-rw-r--r--runtime/mirror/dex_cache_test.cc4
-rw-r--r--runtime/mirror/object_test.cc8
5 files changed, 21 insertions, 20 deletions
diff --git a/runtime/mirror/class-inl.h b/runtime/mirror/class-inl.h
index 679ca43e98..bdad412350 100644
--- a/runtime/mirror/class-inl.h
+++ b/runtime/mirror/class-inl.h
@@ -825,7 +825,7 @@ inline bool Class::DescriptorEquals(const char* match) {
return ProxyDescriptorEquals(match);
} else {
const DexFile& dex_file = GetDexFile();
- const DexFile::TypeId& type_id = dex_file.GetTypeId(GetClassDef()->class_idx_);
+ const dex::TypeId& type_id = dex_file.GetTypeId(GetClassDef()->class_idx_);
return strcmp(dex_file.GetTypeDescriptor(type_id), match) == 0;
}
}
@@ -899,7 +899,7 @@ inline uint32_t Class::NumDirectInterfaces() {
ObjectArray<Class>* interfaces = GetProxyInterfaces();
return interfaces != nullptr ? interfaces->GetLength() : 0;
} else {
- const DexFile::TypeList* interfaces = GetInterfaceTypeList();
+ const dex::TypeList* interfaces = GetInterfaceTypeList();
if (interfaces == nullptr) {
return 0;
} else {
diff --git a/runtime/mirror/class.cc b/runtime/mirror/class.cc
index c5ed1bf4dd..515394ab18 100644
--- a/runtime/mirror/class.cc
+++ b/runtime/mirror/class.cc
@@ -493,7 +493,7 @@ ArtMethod* Class::FindInterfaceMethod(ObjPtr<DexCache> dex_cache,
PointerSize pointer_size) {
// We always search by name and signature, ignoring the type index in the MethodId.
const DexFile& dex_file = *dex_cache->GetDexFile();
- const DexFile::MethodId& method_id = dex_file.GetMethodId(dex_method_idx);
+ const dex::MethodId& method_id = dex_file.GetMethodId(dex_method_idx);
StringPiece name = dex_file.StringDataByIdx(method_id.name_idx_);
const Signature signature = dex_file.GetMethodSignature(method_id);
return FindInterfaceMethod(name, signature, pointer_size);
@@ -620,7 +620,7 @@ ArtMethod* Class::FindClassMethod(ObjPtr<DexCache> dex_cache,
}
// If not found, we need to search by name and signature.
const DexFile& dex_file = *dex_cache->GetDexFile();
- const DexFile::MethodId& method_id = dex_file.GetMethodId(dex_method_idx);
+ const dex::MethodId& method_id = dex_file.GetMethodId(dex_method_idx);
const Signature signature = dex_file.GetMethodSignature(method_id);
StringPiece name; // Delay strlen() until actually needed.
// If we do not have a dex_cache match, try to find the declared method in this class now.
@@ -651,7 +651,7 @@ ArtMethod* Class::FindClassMethod(ObjPtr<DexCache> dex_cache,
// Matching dex_cache. We cannot compare the `dex_method_idx` anymore because
// the type index differs, so compare the name index and proto index.
for (ArtMethod& method : declared_methods) {
- const DexFile::MethodId& cmp_method_id = dex_file.GetMethodId(method.GetDexMethodIndex());
+ const dex::MethodId& cmp_method_id = dex_file.GetMethodId(method.GetDexMethodIndex());
if (cmp_method_id.name_idx_ == method_id.name_idx_ &&
cmp_method_id.proto_idx_ == method_id.proto_idx_) {
candidate_method = &method;
@@ -1005,7 +1005,7 @@ const char* Class::GetDescriptor(std::string* storage) {
return storage->c_str();
} else {
const DexFile& dex_file = GetDexFile();
- const DexFile::TypeId& type_id = dex_file.GetTypeId(GetClassDef()->class_idx_);
+ const dex::TypeId& type_id = dex_file.GetTypeId(GetClassDef()->class_idx_);
return dex_file.GetTypeDescriptor(type_id);
}
}
@@ -1018,7 +1018,7 @@ const char* Class::GetArrayDescriptor(std::string* storage) {
return storage->c_str();
}
-const DexFile::ClassDef* Class::GetClassDef() {
+const dex::ClassDef* Class::GetClassDef() {
uint16_t class_def_idx = GetDexClassDefIndex();
if (class_def_idx == DexFile::kDexNoIndex16) {
return nullptr;
@@ -1086,7 +1086,7 @@ ObjPtr<Class> Class::GetCommonSuperClass(Handle<Class> klass) {
const char* Class::GetSourceFile() {
const DexFile& dex_file = GetDexFile();
- const DexFile::ClassDef* dex_class_def = GetClassDef();
+ const dex::ClassDef* dex_class_def = GetClassDef();
if (dex_class_def == nullptr) {
// Generated classes have no class def.
return nullptr;
@@ -1103,8 +1103,8 @@ std::string Class::GetLocation() {
return "generated class";
}
-const DexFile::TypeList* Class::GetInterfaceTypeList() {
- const DexFile::ClassDef* class_def = GetClassDef();
+const dex::TypeList* Class::GetInterfaceTypeList() {
+ const dex::ClassDef* class_def = GetClassDef();
if (class_def == nullptr) {
return nullptr;
}
@@ -1247,7 +1247,7 @@ uint32_t Class::Depth() {
dex::TypeIndex Class::FindTypeIndexInOtherDexFile(const DexFile& dex_file) {
std::string temp;
- const DexFile::TypeId* type_id = dex_file.FindTypeId(GetDescriptor(&temp));
+ const dex::TypeId* type_id = dex_file.FindTypeId(GetDescriptor(&temp));
return (type_id == nullptr) ? dex::TypeIndex() : dex_file.GetIndexForTypeId(*type_id);
}
diff --git a/runtime/mirror/class.h b/runtime/mirror/class.h
index d5aa514432..8e392bcd77 100644
--- a/runtime/mirror/class.h
+++ b/runtime/mirror/class.h
@@ -24,7 +24,7 @@
#include "base/stride_iterator.h"
#include "class_flags.h"
#include "class_status.h"
-#include "dex/dex_file.h"
+#include "dex/dex_file_structs.h"
#include "dex/dex_file_types.h"
#include "dex/modifiers.h"
#include "dex/primitive.h"
@@ -40,6 +40,7 @@ namespace art {
class ArtField;
class ArtMethod;
struct ClassOffsets;
+class DexFile;
template<class T> class Handle;
enum InvokeType : uint32_t;
template<typename T> class LengthPrefixedArray;
@@ -1133,7 +1134,7 @@ class MANAGED Class final : public Object {
bool DescriptorEquals(const char* match) REQUIRES_SHARED(Locks::mutator_lock_);
- const DexFile::ClassDef* GetClassDef() REQUIRES_SHARED(Locks::mutator_lock_);
+ const dex::ClassDef* GetClassDef() REQUIRES_SHARED(Locks::mutator_lock_);
ALWAYS_INLINE uint32_t NumDirectInterfaces() REQUIRES_SHARED(Locks::mutator_lock_);
@@ -1156,7 +1157,7 @@ class MANAGED Class final : public Object {
const DexFile& GetDexFile() REQUIRES_SHARED(Locks::mutator_lock_);
- const DexFile::TypeList* GetInterfaceTypeList() REQUIRES_SHARED(Locks::mutator_lock_);
+ const dex::TypeList* GetInterfaceTypeList() REQUIRES_SHARED(Locks::mutator_lock_);
// Asserts we are initialized or initializing in the given thread.
void AssertInitializedOrInitializingInThread(Thread* self)
diff --git a/runtime/mirror/dex_cache_test.cc b/runtime/mirror/dex_cache_test.cc
index 36c5ae2ab9..f7c1c02325 100644
--- a/runtime/mirror/dex_cache_test.cc
+++ b/runtime/mirror/dex_cache_test.cc
@@ -146,8 +146,8 @@ TEST_F(DexCacheMethodHandlesTest, TestResolvedMethodTypes) {
Handle<mirror::DexCache> dex_cache = hs.NewHandle(
class_linker_->FindDexCache(Thread::Current(), dex_file));
- const DexFile::MethodId& method1_id = dex_file.GetMethodId(method1->GetDexMethodIndex());
- const DexFile::MethodId& method2_id = dex_file.GetMethodId(method2->GetDexMethodIndex());
+ const dex::MethodId& method1_id = dex_file.GetMethodId(method1->GetDexMethodIndex());
+ const dex::MethodId& method2_id = dex_file.GetMethodId(method2->GetDexMethodIndex());
Handle<mirror::MethodType> method1_type = hs.NewHandle(
class_linker_->ResolveMethodType(soa.Self(),
method1_id.proto_idx_,
diff --git a/runtime/mirror/object_test.cc b/runtime/mirror/object_test.cc
index d8c7b1db30..f4b8ba5908 100644
--- a/runtime/mirror/object_test.cc
+++ b/runtime/mirror/object_test.cc
@@ -364,16 +364,16 @@ TEST_F(ObjectTest, StaticFieldFromCode) {
Handle<Class> klass =
hs.NewHandle(class_linker_->FindClass(soa.Self(), "LStaticsFromCode;", loader));
ArtMethod* clinit = klass->FindClassInitializer(kRuntimePointerSize);
- const DexFile::TypeId* klass_type_id = dex_file->FindTypeId("LStaticsFromCode;");
+ const dex::TypeId* klass_type_id = dex_file->FindTypeId("LStaticsFromCode;");
ASSERT_TRUE(klass_type_id != nullptr);
- const DexFile::TypeId* type_type_id = dex_file->FindTypeId("Ljava/lang/Object;");
+ const dex::TypeId* type_type_id = dex_file->FindTypeId("Ljava/lang/Object;");
ASSERT_TRUE(type_type_id != nullptr);
- const DexFile::StringId* name_str_id = dex_file->FindStringId("s0");
+ const dex::StringId* name_str_id = dex_file->FindStringId("s0");
ASSERT_TRUE(name_str_id != nullptr);
- const DexFile::FieldId* field_id = dex_file->FindFieldId(
+ const dex::FieldId* field_id = dex_file->FindFieldId(
*klass_type_id, *name_str_id, *type_type_id);
ASSERT_TRUE(field_id != nullptr);
uint32_t field_idx = dex_file->GetIndexForFieldId(*field_id);