diff options
Diffstat (limited to 'runtime/stack_map.cc')
-rw-r--r-- | runtime/stack_map.cc | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/runtime/stack_map.cc b/runtime/stack_map.cc index e8746bc7f1..cd82284a9a 100644 --- a/runtime/stack_map.cc +++ b/runtime/stack_map.cc @@ -58,6 +58,7 @@ void CodeInfo::Decode(const uint8_t* data, DecodeFlags flags) { BitMemoryReader reader(data, /* bit_offset */ 0); DecodeTable(stack_maps_, reader, data); DecodeTable(inline_infos_, reader, data); + DecodeTable(method_infos_, reader, data); if (flags & DecodeFlags::InlineInfoOnly) { return; } @@ -99,6 +100,7 @@ size_t CodeInfo::Dedupe(std::vector<uint8_t>* out, const uint8_t* in, DedupeMap* BitMemoryWriter<std::vector<uint8_t>> writer(out, /* bit_offset */ out->size() * kBitsPerByte); DedupeTable<StackMap>(writer, reader, dedupe_map); DedupeTable<InlineInfo>(writer, reader, dedupe_map); + DedupeTable<MethodInfo>(writer, reader, dedupe_map); DedupeTable<RegisterMask>(writer, reader, dedupe_map); DedupeTable<MaskInfo>(writer, reader, dedupe_map); DedupeTable<MaskInfo>(writer, reader, dedupe_map); @@ -211,9 +213,10 @@ void CodeInfo::AddSizeStats(/*out*/ Stats* parent) const { Stats* stats = parent->Child("CodeInfo"); stats->AddBytes(Size()); AddTableSizeStats<StackMap>("StackMaps", stack_maps_, stats); + AddTableSizeStats<InlineInfo>("InlineInfos", inline_infos_, stats); + AddTableSizeStats<MethodInfo>("MethodInfo", method_infos_, stats); AddTableSizeStats<RegisterMask>("RegisterMasks", register_masks_, stats); AddTableSizeStats<MaskInfo>("StackMasks", stack_masks_, stats); - AddTableSizeStats<InlineInfo>("InlineInfos", inline_infos_, stats); AddTableSizeStats<MaskInfo>("DexRegisterMasks", dex_register_masks_, stats); AddTableSizeStats<DexRegisterMapInfo>("DexRegisterMaps", dex_register_maps_, stats); AddTableSizeStats<DexRegisterInfo>("DexRegisterCatalog", dex_register_catalog_, stats); @@ -271,14 +274,14 @@ static void DumpTable(VariableIndentationOutputStream* vios, void CodeInfo::Dump(VariableIndentationOutputStream* vios, uint32_t code_offset, bool verbose, - InstructionSet instruction_set, - const MethodInfo& method_info) const { + InstructionSet instruction_set) const { vios->Stream() << "CodeInfo\n"; ScopedIndentation indent1(vios); DumpTable<StackMap>(vios, "StackMaps", stack_maps_, verbose); + DumpTable<InlineInfo>(vios, "InlineInfos", inline_infos_, verbose); + DumpTable<MethodInfo>(vios, "MethodInfo", method_infos_, verbose); DumpTable<RegisterMask>(vios, "RegisterMasks", register_masks_, verbose); DumpTable<MaskInfo>(vios, "StackMasks", stack_masks_, verbose, true /* is_mask */); - DumpTable<InlineInfo>(vios, "InlineInfos", inline_infos_, verbose); DumpTable<MaskInfo>(vios, "DexRegisterMasks", dex_register_masks_, verbose, true /* is_mask */); DumpTable<DexRegisterMapInfo>(vios, "DexRegisterMaps", dex_register_maps_, verbose); DumpTable<DexRegisterInfo>(vios, "DexRegisterCatalog", dex_register_catalog_, verbose); @@ -286,14 +289,13 @@ void CodeInfo::Dump(VariableIndentationOutputStream* vios, // Display stack maps along with (live) Dex register maps. if (verbose) { for (StackMap stack_map : stack_maps_) { - stack_map.Dump(vios, *this, method_info, code_offset, instruction_set); + stack_map.Dump(vios, *this, code_offset, instruction_set); } } } void StackMap::Dump(VariableIndentationOutputStream* vios, const CodeInfo& code_info, - const MethodInfo& method_info, uint32_t code_offset, InstructionSet instruction_set) const { const uint32_t pc_offset = GetNativePcOffset(instruction_set); @@ -312,14 +314,13 @@ void StackMap::Dump(VariableIndentationOutputStream* vios, vios->Stream() << ")\n"; code_info.GetDexRegisterMapOf(*this).Dump(vios); for (InlineInfo inline_info : code_info.GetInlineInfosOf(*this)) { - inline_info.Dump(vios, code_info, *this, method_info); + inline_info.Dump(vios, code_info, *this); } } void InlineInfo::Dump(VariableIndentationOutputStream* vios, const CodeInfo& code_info, - const StackMap& stack_map, - const MethodInfo& method_info) const { + const StackMap& stack_map) const { uint32_t depth = Row() - stack_map.GetInlineInfoIndex(); vios->Stream() << "InlineInfo[" << Row() << "]" @@ -332,7 +333,7 @@ void InlineInfo::Dump(VariableIndentationOutputStream* vios, } else { vios->Stream() << std::dec - << ", method_index=" << GetMethodIndex(method_info); + << ", method_index=" << code_info.GetMethodIndexOf(*this); } vios->Stream() << ")\n"; code_info.GetInlineDexRegisterMapOf(stack_map, *this).Dump(vios); |