diff options
author | Nicolas Geoffray <ngeoffray@google.com> | 2015-03-20 10:06:38 +0000 |
---|---|---|
committer | Nicolas Geoffray <ngeoffray@google.com> | 2015-03-20 14:55:15 +0000 |
commit | 004c230b4cfc856690c61faabc41864061813c88 (patch) | |
tree | 40d95445eaa2eb248fa639755689c797a5e0c2ae /oatdump | |
parent | 735dc87c92bee338d0638b3290c2b93a122429f2 (diff) | |
download | art-004c230b4cfc856690c61faabc41864061813c88.zip art-004c230b4cfc856690c61faabc41864061813c88.tar.gz art-004c230b4cfc856690c61faabc41864061813c88.tar.bz2 |
Compress the StackMaps.
First step towards the compression of the StackMap (not
the DexRegisterMap). Next step will be to just use what is
needed (instead of byte -> word).
Change-Id: I4f81b2d05bf5cc508585e16fbbed1bafbc850e2e
Diffstat (limited to 'oatdump')
-rw-r--r-- | oatdump/oatdump.cc | 53 |
1 files changed, 1 insertions, 52 deletions
diff --git a/oatdump/oatdump.cc b/oatdump/oatdump.cc index c27b3d4..14bcd4b 100644 --- a/oatdump/oatdump.cc +++ b/oatdump/oatdump.cc @@ -1039,62 +1039,11 @@ class OatDumper { } } - void DumpRegisterMapping(std::ostream& os, - size_t dex_register_num, - DexRegisterLocation::Kind kind, - int32_t value, - const std::string& prefix = "v", - const std::string& suffix = "") { - os << " " << prefix << dex_register_num << ": " - << DexRegisterLocation::PrettyDescriptor(kind) - << " (" << value << ")" << suffix << '\n'; - } - - void DumpStackMapHeader(std::ostream& os, const CodeInfo& code_info, size_t stack_map_num) { - StackMap stack_map = code_info.GetStackMapAt(stack_map_num); - os << " StackMap " << stack_map_num - << std::hex - << " (dex_pc=0x" << stack_map.GetDexPc() - << ", native_pc_offset=0x" << stack_map.GetNativePcOffset() - << ", register_mask=0x" << stack_map.GetRegisterMask() - << std::dec - << ", stack_mask=0b"; - MemoryRegion stack_mask = stack_map.GetStackMask(); - for (size_t i = 0, e = stack_mask.size_in_bits(); i < e; ++i) { - os << stack_mask.LoadBit(e - i - 1); - } - os << ")\n"; - }; - // Display a CodeInfo object emitted by the optimizing compiler. void DumpCodeInfo(std::ostream& os, const CodeInfo& code_info, const DexFile::CodeItem& code_item) { - uint16_t number_of_dex_registers = code_item.registers_size_; - uint32_t code_info_size = code_info.GetOverallSize(); - size_t number_of_stack_maps = code_info.GetNumberOfStackMaps(); - os << " Optimized CodeInfo (size=" << code_info_size - << ", number_of_dex_registers=" << number_of_dex_registers - << ", number_of_stack_maps=" << number_of_stack_maps << ")\n"; - - // Display stack maps along with Dex register maps. - for (size_t i = 0; i < number_of_stack_maps; ++i) { - StackMap stack_map = code_info.GetStackMapAt(i); - DumpStackMapHeader(os, code_info, i); - if (stack_map.HasDexRegisterMap()) { - DexRegisterMap dex_register_map = - code_info.GetDexRegisterMapOf(stack_map, number_of_dex_registers); - // TODO: Display the bit mask of live Dex registers. - for (size_t j = 0; j < number_of_dex_registers; ++j) { - if (dex_register_map.IsDexRegisterLive(j)) { - DexRegisterLocation location = - dex_register_map.GetLocationKindAndValue(j, number_of_dex_registers); - DumpRegisterMapping(os, j, location.GetInternalKind(), location.GetValue()); - } - } - } - } - // TODO: Dump the stack map's inline information. + code_info.Dump(os, code_item.registers_size_); } // Display a vmap table. |