From 5d37c152f21a0807459c6f53bc25e2d84f56d259 Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Thu, 12 Jan 2017 13:25:19 +0000 Subject: Put inlined ArtMethod pointer in stack maps. Currently done for JIT. Can be extended for AOT and inlined boot image methods. Also refactor the lookup of a inlined method at runtime to not rely on the dex cache, but look at the class loader tables. bug: 30933338 test: test-art-host, test-art-target Change-Id: I58bd4d763b82ab8ca3023742835ac388671d1794 --- runtime/stack_map.cc | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'runtime/stack_map.cc') diff --git a/runtime/stack_map.cc b/runtime/stack_map.cc index a7e7c21a42..9ebf9a7bdd 100644 --- a/runtime/stack_map.cc +++ b/runtime/stack_map.cc @@ -18,8 +18,9 @@ #include +#include "art_method.h" #include "indenter.h" -#include "invoke_type.h" +#include "scoped_thread_state_change-inl.h" namespace art { @@ -106,7 +107,7 @@ void InlineInfoEncoding::Dump(VariableIndentationOutputStream* vios) const { << "InlineInfoEncoding" << " (method_index_bit_offset=" << static_cast(kMethodIndexBitOffset) << ", dex_pc_bit_offset=" << static_cast(dex_pc_bit_offset_) - << ", invoke_type_bit_offset=" << static_cast(invoke_type_bit_offset_) + << ", extra_data_bit_offset=" << static_cast(extra_data_bit_offset_) << ", dex_register_map_bit_offset=" << static_cast(dex_register_map_bit_offset_) << ", total_bit_size=" << static_cast(total_bit_size_) << ")\n"; @@ -230,12 +231,16 @@ void InlineInfo::Dump(VariableIndentationOutputStream* vios, vios->Stream() << " At depth " << i << std::hex - << " (dex_pc=0x" << GetDexPcAtDepth(inline_info_encoding, i) - << std::dec - << ", method_index=" << GetMethodIndexAtDepth(inline_info_encoding, i) - << ", invoke_type=" << static_cast(GetInvokeTypeAtDepth(inline_info_encoding, - i)) - << ")\n"; + << " (dex_pc=0x" << GetDexPcAtDepth(inline_info_encoding, i); + if (EncodesArtMethodAtDepth(inline_info_encoding, i)) { + ScopedObjectAccess soa(Thread::Current()); + vios->Stream() << ", method=" << GetArtMethodAtDepth(inline_info_encoding, i)->PrettyMethod(); + } else { + vios->Stream() + << std::dec + << ", method_index=" << GetMethodIndexAtDepth(inline_info_encoding, i); + } + vios->Stream() << ")\n"; if (HasDexRegisterMapAtDepth(inline_info_encoding, i) && (number_of_dex_registers != nullptr)) { CodeInfoEncoding encoding = code_info.ExtractEncoding(); DexRegisterMap dex_register_map = -- cgit v1.2.3-59-g8ed1b