diff options
author | 2017-03-06 12:35:10 -0800 | |
---|---|---|
committer | 2017-03-29 16:51:26 -0700 | |
commit | 8c19d2431f45861ca11cf5ebc4fdaf10200f2458 (patch) | |
tree | 2d376ce322be680898d55fde929e67032d4c711c /runtime/imt_conflict_table.h | |
parent | 4e03442619834c56dbf79a3493eb8a2d91b93e7f (diff) |
Refactor image writer
Aim to have common functions for copying references and pointers.
Required for adding support for faster image fixups.
Test: test-art-host -j32
Bug: 34927277
Bug: 34928633
Change-Id: Ia654efc483b332eea3535570496bfeccd7c635ee
Diffstat (limited to 'runtime/imt_conflict_table.h')
-rw-r--r-- | runtime/imt_conflict_table.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/runtime/imt_conflict_table.h b/runtime/imt_conflict_table.h index fdd10fefc4..35868642e1 100644 --- a/runtime/imt_conflict_table.h +++ b/runtime/imt_conflict_table.h @@ -81,6 +81,14 @@ class ImtConflictTable { return GetMethod(index * kMethodCount + kMethodImplementation, pointer_size); } + void** AddressOfInterfaceMethod(size_t index, PointerSize pointer_size) { + return AddressOfMethod(index * kMethodCount + kMethodInterface, pointer_size); + } + + void** AddressOfImplementationMethod(size_t index, PointerSize pointer_size) { + return AddressOfMethod(index * kMethodCount + kMethodImplementation, pointer_size); + } + // Return true if two conflict tables are the same. bool Equals(ImtConflictTable* other, PointerSize pointer_size) const { size_t num = NumEntries(pointer_size); @@ -169,6 +177,14 @@ class ImtConflictTable { } private: + void** AddressOfMethod(size_t index, PointerSize pointer_size) { + if (pointer_size == PointerSize::k64) { + return reinterpret_cast<void**>(&data64_[index]); + } else { + return reinterpret_cast<void**>(&data32_[index]); + } + } + ArtMethod* GetMethod(size_t index, PointerSize pointer_size) const { if (pointer_size == PointerSize::k64) { return reinterpret_cast<ArtMethod*>(static_cast<uintptr_t>(data64_[index])); |