summaryrefslogtreecommitdiff
path: root/runtime/class_linker.cc
diff options
context:
space:
mode:
author Mathieu Chartier <mathieuc@google.com> 2018-06-04 17:19:02 -0700
committer Mathieu Chartier <mathieuc@google.com> 2018-06-07 22:13:48 -0700
commit18e2687c4126d66870d61d6548abc2c7661a66cc (patch)
tree06eff605df9259dde8170c8efb48b11df4108eb3 /runtime/class_linker.cc
parent2607d6c47114a18ccf4a532b20e1099d1dd8fcca (diff)
Refactor ClassAccessor to use an index instead of ClassDef pointer
Removes a separate class_def_idx being required for getting the index of a ClassAccessor foreach loop. Bug: 79758018 Test: test-art-host-gtest Change-Id: Ie3010a17669f24cf492c678b55bdddba7ec62ea8
Diffstat (limited to 'runtime/class_linker.cc')
-rw-r--r--runtime/class_linker.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index be636d80a8..b1fd5f4788 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -2863,9 +2863,9 @@ void ClassLinker::FixupStaticTrampolines(ObjPtr<mirror::Class> klass) {
}
const DexFile& dex_file = klass->GetDexFile();
- const DexFile::ClassDef* dex_class_def = klass->GetClassDef();
- CHECK(dex_class_def != nullptr);
- ClassAccessor accessor(dex_file, *dex_class_def);
+ const uint16_t class_def_idx = klass->GetDexClassDefIndex();
+ CHECK_NE(class_def_idx, DexFile::kDexNoIndex16);
+ ClassAccessor accessor(dex_file, class_def_idx);
// There should always be class data if there were direct methods.
CHECK(accessor.HasClassData()) << klass->PrettyDescriptor();
bool has_oat_class;