diff options
| author | 2017-08-25 08:05:29 -0700 | |
|---|---|---|
| committer | 2017-09-11 15:31:00 -0700 | |
| commit | a49e053faa4a254df1f21e055cb73555de241cfc (patch) | |
| tree | bed0e8f0934550d4329c0aed10f016c884c6750f /runtime/art_method.h | |
| parent | 47d00f6c4657af33c3cc29783c0f2eb156aa1449 (diff) | |
Show ArtMethods in imgdiag
Since ArtMethods were moved out of mirror:: classes imgdiag does not
show information about them. Diff ArtMethods to facilitate finding
dirty memory there.
Bug: 38173645
Test: imgdiag --boot-image=/system/framework/boot.art --image-diff-pid=`pid system_server`
Change-Id: Icd86a9ef14d5177a297026c22c81c080f5c85fc1
Diffstat (limited to 'runtime/art_method.h')
| -rw-r--r-- | runtime/art_method.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/runtime/art_method.h b/runtime/art_method.h index 2d677617d9..dab3f234e2 100644 --- a/runtime/art_method.h +++ b/runtime/art_method.h @@ -671,6 +671,24 @@ class ArtMethod FINAL { template <ReadBarrierOption kReadBarrierOption = kWithReadBarrier, typename Visitor> ALWAYS_INLINE void UpdateEntrypoints(const Visitor& visitor, PointerSize pointer_size); + // Visit the individual members of an ArtMethod. Used by imgdiag. + // As imgdiag does not support mixing instruction sets or pointer sizes (e.g., using imgdiag32 + // to inspect 64-bit images, etc.), we can go beneath the accessors directly to the class members. + template <typename VisitorFunc> + void VisitMembers(VisitorFunc& visitor) { + DCHECK(IsImagePointerSize(kRuntimePointerSize)); + visitor(this, &declaring_class_, "declaring_class_"); + visitor(this, &access_flags_, "access_flags_"); + visitor(this, &dex_code_item_offset_, "dex_code_item_offset_"); + visitor(this, &dex_method_index_, "dex_method_index_"); + visitor(this, &method_index_, "method_index_"); + visitor(this, &hotness_count_, "hotness_count_"); + visitor(this, &ptr_sized_fields_.data_, "ptr_sized_fields_.data_"); + visitor(this, + &ptr_sized_fields_.entry_point_from_quick_compiled_code_, + "ptr_sized_fields_.entry_point_from_quick_compiled_code_"); + } + protected: // Field order required by test "ValidateFieldOrderOfJavaCppUnionClasses". // The class we are a part of. |