summaryrefslogtreecommitdiff
path: root/runtime/art_method-inl.h
diff options
context:
space:
mode:
author Mathieu Chartier <mathieuc@google.com> 2017-11-06 20:02:24 -0800
committer Mathieu Chartier <mathieuc@google.com> 2017-11-09 19:06:10 -0800
commit69147f165efaa9da152bb37da3a16dd5d8c6cf3c (patch)
tree25dbec549b8c06cf24729a577c76ef0b6d3d4c7f /runtime/art_method-inl.h
parent2202d56061941b4fecbdb018d84bcefb05b6c683 (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-inl.h')
-rw-r--r--runtime/art_method-inl.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/runtime/art_method-inl.h b/runtime/art_method-inl.h
index 12b4d16b37..eb16e6eaa2 100644
--- a/runtime/art_method-inl.h
+++ b/runtime/art_method-inl.h
@@ -23,6 +23,7 @@
#include "base/callee_save_type.h"
#include "base/logging.h"
#include "class_linker-inl.h"
+#include "code_item_accessors-inl.h"
#include "common_throws.h"
#include "dex_file-inl.h"
#include "dex_file_annotations.h"
@@ -457,6 +458,18 @@ inline void ArtMethod::UpdateEntrypoints(const Visitor& visitor, PointerSize poi
}
}
+inline IterationRange<DexInstructionIterator> ArtMethod::DexInstructions() {
+ CodeItemInstructionAccessor accessor(this);
+ return { accessor.begin(),
+ accessor.end() };
+}
+
+inline IterationRange<DexInstructionIterator> ArtMethod::NullableDexInstructions() {
+ CodeItemInstructionAccessor accessor(CodeItemInstructionAccessor::CreateNullable(this));
+ return { accessor.begin(),
+ accessor.end() };
+}
+
} // namespace art
#endif // ART_RUNTIME_ART_METHOD_INL_H_