diff options
author | 2017-11-06 20:02:24 -0800 | |
---|---|---|
committer | 2017-11-09 19:06:10 -0800 | |
commit | 69147f165efaa9da152bb37da3a16dd5d8c6cf3c (patch) | |
tree | 25dbec549b8c06cf24729a577c76ef0b6d3d4c7f /runtime/art_method.h | |
parent | 2202d56061941b4fecbdb018d84bcefb05b6c683 (diff) |
Add code item accessor helper classes
Add classes to abstract accesses to code item data. These classes
handle both standard dex and compact dex.
Added:
- CodeItemInstructionsAccessor to handle code item instructions.
- CodeItemDataAccessor to handle code item data excluding debug info.
Moved inline_method_analyzer to use the new classes to test the new
APIs.
Bug: 63756964
Test: test-art-host
Change-Id: I9926acb77b81fa64ed4a3b49b7bed1aab30a0f33
Diffstat (limited to 'runtime/art_method.h')
-rw-r--r-- | runtime/art_method.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/runtime/art_method.h b/runtime/art_method.h index 8927481e46..df9b3aa852 100644 --- a/runtime/art_method.h +++ b/runtime/art_method.h @@ -22,8 +22,10 @@ #include "base/bit_utils.h" #include "base/casts.h" #include "base/enums.h" +#include "base/iteration_range.h" #include "base/logging.h" #include "dex_file.h" +#include "dex_instruction_iterator.h" #include "gc_root.h" #include "modifiers.h" #include "obj_ptr.h" @@ -700,6 +702,15 @@ class ArtMethod FINAL { "ptr_sized_fields_.entry_point_from_quick_compiled_code_"); } + // Returns the dex instructions of the code item for the art method. Must not be called on null + // code items. + ALWAYS_INLINE IterationRange<DexInstructionIterator> DexInstructions() + REQUIRES_SHARED(Locks::mutator_lock_); + + // Handles a null code item by returning iterators that have a null address. + ALWAYS_INLINE IterationRange<DexInstructionIterator> NullableDexInstructions() + REQUIRES_SHARED(Locks::mutator_lock_); + protected: // Field order required by test "ValidateFieldOrderOfJavaCppUnionClasses". // The class we are a part of. |