From 69147f165efaa9da152bb37da3a16dd5d8c6cf3c Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Mon, 6 Nov 2017 20:02:24 -0800 Subject: 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 --- compiler/dex/inline_method_analyser.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'compiler/dex/inline_method_analyser.h') diff --git a/compiler/dex/inline_method_analyser.h b/compiler/dex/inline_method_analyser.h index a35e97fa11..cde2147995 100644 --- a/compiler/dex/inline_method_analyser.h +++ b/compiler/dex/inline_method_analyser.h @@ -30,6 +30,8 @@ namespace art { +class CodeItemDataAccessor; + namespace verifier { class MethodVerifier; } // namespace verifier @@ -121,21 +123,21 @@ class InlineMethodAnalyser { static bool IsSyntheticAccessor(MethodReference ref); private: - static bool AnalyseMethodCode(const DexFile::CodeItem* code_item, + static bool AnalyseMethodCode(const CodeItemDataAccessor* code_item, const MethodReference& method_ref, bool is_static, ArtMethod* method, InlineMethod* result) REQUIRES_SHARED(Locks::mutator_lock_); - static bool AnalyseReturnMethod(const DexFile::CodeItem* code_item, InlineMethod* result); - static bool AnalyseConstMethod(const DexFile::CodeItem* code_item, InlineMethod* result); - static bool AnalyseIGetMethod(const DexFile::CodeItem* code_item, + static bool AnalyseReturnMethod(const CodeItemDataAccessor* code_item, InlineMethod* result); + static bool AnalyseConstMethod(const CodeItemDataAccessor* code_item, InlineMethod* result); + static bool AnalyseIGetMethod(const CodeItemDataAccessor* code_item, const MethodReference& method_ref, bool is_static, ArtMethod* method, InlineMethod* result) REQUIRES_SHARED(Locks::mutator_lock_); - static bool AnalyseIPutMethod(const DexFile::CodeItem* code_item, + static bool AnalyseIPutMethod(const CodeItemDataAccessor* code_item, const MethodReference& method_ref, bool is_static, ArtMethod* method, -- cgit v1.2.3-59-g8ed1b