Nicolas Geoffray | 004c230 | 2015-03-20 10:06:38 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2015 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #include "stack_map.h" |
| 18 | |
Nicolas Geoffray | 896f8f7 | 2015-03-30 15:44:25 +0100 | [diff] [blame] | 19 | #include <stdint.h> |
| 20 | |
Roland Levillain | 0396ed7 | 2015-05-27 15:12:19 +0100 | [diff] [blame] | 21 | #include "indenter.h" |
Nicolas Geoffray | 12bdb72 | 2015-06-17 09:44:43 +0100 | [diff] [blame] | 22 | #include "invoke_type.h" |
Roland Levillain | 0396ed7 | 2015-05-27 15:12:19 +0100 | [diff] [blame] | 23 | |
Nicolas Geoffray | 004c230 | 2015-03-20 10:06:38 +0000 | [diff] [blame] | 24 | namespace art { |
| 25 | |
Roland Levillain | a552e1c | 2015-03-26 15:01:03 +0000 | [diff] [blame] | 26 | constexpr size_t DexRegisterLocationCatalog::kNoLocationEntryIndex; |
Nicolas Geoffray | 004c230 | 2015-03-20 10:06:38 +0000 | [diff] [blame] | 27 | constexpr uint32_t StackMap::kNoDexRegisterMap; |
| 28 | constexpr uint32_t StackMap::kNoInlineInfo; |
| 29 | |
David Srbecky | 7dc1178 | 2016-02-25 13:23:56 +0000 | [diff] [blame^] | 30 | std::ostream& operator<<(std::ostream& stream, const DexRegisterLocation::Kind& kind) { |
| 31 | using Kind = DexRegisterLocation::Kind; |
| 32 | switch (kind) { |
| 33 | case Kind::kNone: |
| 34 | return stream << "none"; |
| 35 | case Kind::kInStack: |
| 36 | return stream << "in stack"; |
| 37 | case Kind::kInRegister: |
| 38 | return stream << "in register"; |
| 39 | case Kind::kInRegisterHigh: |
| 40 | return stream << "in register high"; |
| 41 | case Kind::kInFpuRegister: |
| 42 | return stream << "in fpu register"; |
| 43 | case Kind::kInFpuRegisterHigh: |
| 44 | return stream << "in fpu register high"; |
| 45 | case Kind::kConstant: |
| 46 | return stream << "as constant"; |
| 47 | case Kind::kInStackLargeOffset: |
| 48 | return stream << "in stack (large offset)"; |
| 49 | case Kind::kConstantLargeValue: |
| 50 | return stream << "as constant (large value)"; |
| 51 | } |
| 52 | return stream << "Kind<" << static_cast<uint32_t>(kind) << ">"; |
| 53 | } |
| 54 | |
Roland Levillain | 1c1da43 | 2015-07-16 11:54:44 +0100 | [diff] [blame] | 55 | DexRegisterLocation::Kind DexRegisterMap::GetLocationInternalKind( |
| 56 | uint16_t dex_register_number, |
| 57 | uint16_t number_of_dex_registers, |
| 58 | const CodeInfo& code_info, |
| 59 | const StackMapEncoding& enc) const { |
Roland Levillain | a552e1c | 2015-03-26 15:01:03 +0000 | [diff] [blame] | 60 | DexRegisterLocationCatalog dex_register_location_catalog = |
David Brazdil | f677ebf | 2015-05-29 16:29:43 +0100 | [diff] [blame] | 61 | code_info.GetDexRegisterLocationCatalog(enc); |
Roland Levillain | a552e1c | 2015-03-26 15:01:03 +0000 | [diff] [blame] | 62 | size_t location_catalog_entry_index = GetLocationCatalogEntryIndex( |
| 63 | dex_register_number, |
| 64 | number_of_dex_registers, |
Roland Levillain | 1c1da43 | 2015-07-16 11:54:44 +0100 | [diff] [blame] | 65 | code_info.GetNumberOfLocationCatalogEntries()); |
Roland Levillain | a552e1c | 2015-03-26 15:01:03 +0000 | [diff] [blame] | 66 | return dex_register_location_catalog.GetLocationInternalKind(location_catalog_entry_index); |
| 67 | } |
| 68 | |
| 69 | DexRegisterLocation DexRegisterMap::GetDexRegisterLocation(uint16_t dex_register_number, |
| 70 | uint16_t number_of_dex_registers, |
David Brazdil | f677ebf | 2015-05-29 16:29:43 +0100 | [diff] [blame] | 71 | const CodeInfo& code_info, |
| 72 | const StackMapEncoding& enc) const { |
Roland Levillain | a552e1c | 2015-03-26 15:01:03 +0000 | [diff] [blame] | 73 | DexRegisterLocationCatalog dex_register_location_catalog = |
David Brazdil | f677ebf | 2015-05-29 16:29:43 +0100 | [diff] [blame] | 74 | code_info.GetDexRegisterLocationCatalog(enc); |
Roland Levillain | a552e1c | 2015-03-26 15:01:03 +0000 | [diff] [blame] | 75 | size_t location_catalog_entry_index = GetLocationCatalogEntryIndex( |
| 76 | dex_register_number, |
| 77 | number_of_dex_registers, |
Roland Levillain | 1c1da43 | 2015-07-16 11:54:44 +0100 | [diff] [blame] | 78 | code_info.GetNumberOfLocationCatalogEntries()); |
Roland Levillain | a552e1c | 2015-03-26 15:01:03 +0000 | [diff] [blame] | 79 | return dex_register_location_catalog.GetDexRegisterLocation(location_catalog_entry_index); |
| 80 | } |
| 81 | |
David Brazdil | f677ebf | 2015-05-29 16:29:43 +0100 | [diff] [blame] | 82 | uint32_t StackMap::LoadAt(size_t number_of_bytes, size_t offset, bool check_max) const { |
Nicolas Geoffray | 896f8f7 | 2015-03-30 15:44:25 +0100 | [diff] [blame] | 83 | if (number_of_bytes == 0u) { |
| 84 | DCHECK(!check_max); |
| 85 | return 0; |
| 86 | } else if (number_of_bytes == 1u) { |
David Brazdil | f677ebf | 2015-05-29 16:29:43 +0100 | [diff] [blame] | 87 | uint8_t value = region_.LoadUnaligned<uint8_t>(offset); |
| 88 | return (check_max && value == 0xFF) ? -1 : value; |
Nicolas Geoffray | 896f8f7 | 2015-03-30 15:44:25 +0100 | [diff] [blame] | 89 | } else if (number_of_bytes == 2u) { |
David Brazdil | f677ebf | 2015-05-29 16:29:43 +0100 | [diff] [blame] | 90 | uint16_t value = region_.LoadUnaligned<uint16_t>(offset); |
| 91 | return (check_max && value == 0xFFFF) ? -1 : value; |
Nicolas Geoffray | 896f8f7 | 2015-03-30 15:44:25 +0100 | [diff] [blame] | 92 | } else if (number_of_bytes == 3u) { |
David Brazdil | f677ebf | 2015-05-29 16:29:43 +0100 | [diff] [blame] | 93 | uint16_t low = region_.LoadUnaligned<uint16_t>(offset); |
| 94 | uint16_t high = region_.LoadUnaligned<uint8_t>(offset + sizeof(uint16_t)); |
Nicolas Geoffray | 896f8f7 | 2015-03-30 15:44:25 +0100 | [diff] [blame] | 95 | uint32_t value = (high << 16) + low; |
David Brazdil | f677ebf | 2015-05-29 16:29:43 +0100 | [diff] [blame] | 96 | return (check_max && value == 0xFFFFFF) ? -1 : value; |
Nicolas Geoffray | 004c230 | 2015-03-20 10:06:38 +0000 | [diff] [blame] | 97 | } else { |
Nicolas Geoffray | 896f8f7 | 2015-03-30 15:44:25 +0100 | [diff] [blame] | 98 | DCHECK_EQ(number_of_bytes, 4u); |
David Brazdil | f677ebf | 2015-05-29 16:29:43 +0100 | [diff] [blame] | 99 | return region_.LoadUnaligned<uint32_t>(offset); |
Nicolas Geoffray | 004c230 | 2015-03-20 10:06:38 +0000 | [diff] [blame] | 100 | } |
| 101 | } |
| 102 | |
David Brazdil | f677ebf | 2015-05-29 16:29:43 +0100 | [diff] [blame] | 103 | void StackMap::StoreAt(size_t number_of_bytes, size_t offset, uint32_t value) const { |
Nicolas Geoffray | 896f8f7 | 2015-03-30 15:44:25 +0100 | [diff] [blame] | 104 | if (number_of_bytes == 0u) { |
| 105 | DCHECK_EQ(value, 0u); |
| 106 | } else if (number_of_bytes == 1u) { |
David Brazdil | f677ebf | 2015-05-29 16:29:43 +0100 | [diff] [blame] | 107 | region_.StoreUnaligned<uint8_t>(offset, value); |
Nicolas Geoffray | 896f8f7 | 2015-03-30 15:44:25 +0100 | [diff] [blame] | 108 | } else if (number_of_bytes == 2u) { |
David Brazdil | f677ebf | 2015-05-29 16:29:43 +0100 | [diff] [blame] | 109 | region_.StoreUnaligned<uint16_t>(offset, value); |
Nicolas Geoffray | 896f8f7 | 2015-03-30 15:44:25 +0100 | [diff] [blame] | 110 | } else if (number_of_bytes == 3u) { |
David Brazdil | f677ebf | 2015-05-29 16:29:43 +0100 | [diff] [blame] | 111 | region_.StoreUnaligned<uint16_t>(offset, Low16Bits(value)); |
| 112 | region_.StoreUnaligned<uint8_t>(offset + sizeof(uint16_t), High16Bits(value)); |
Nicolas Geoffray | 896f8f7 | 2015-03-30 15:44:25 +0100 | [diff] [blame] | 113 | } else { |
David Brazdil | f677ebf | 2015-05-29 16:29:43 +0100 | [diff] [blame] | 114 | region_.StoreUnaligned<uint32_t>(offset, value); |
Nicolas Geoffray | 896f8f7 | 2015-03-30 15:44:25 +0100 | [diff] [blame] | 115 | DCHECK_EQ(number_of_bytes, 4u); |
| 116 | } |
| 117 | } |
| 118 | |
Roland Levillain | a552e1c | 2015-03-26 15:01:03 +0000 | [diff] [blame] | 119 | static void DumpRegisterMapping(std::ostream& os, |
| 120 | size_t dex_register_num, |
| 121 | DexRegisterLocation location, |
| 122 | const std::string& prefix = "v", |
| 123 | const std::string& suffix = "") { |
Vladimir Marko | 8f1e08a | 2015-06-26 12:06:30 +0100 | [diff] [blame] | 124 | os << prefix << dex_register_num << ": " |
David Srbecky | 7dc1178 | 2016-02-25 13:23:56 +0000 | [diff] [blame^] | 125 | << location.GetInternalKind() |
Vladimir Marko | 8f1e08a | 2015-06-26 12:06:30 +0100 | [diff] [blame] | 126 | << " (" << location.GetValue() << ")" << suffix << '\n'; |
Roland Levillain | 0396ed7 | 2015-05-27 15:12:19 +0100 | [diff] [blame] | 127 | } |
| 128 | |
Vladimir Marko | 8f1e08a | 2015-06-26 12:06:30 +0100 | [diff] [blame] | 129 | void CodeInfo::Dump(VariableIndentationOutputStream* vios, |
Roland Levillain | f2650d1 | 2015-05-28 14:53:28 +0100 | [diff] [blame] | 130 | uint32_t code_offset, |
Roland Levillain | 0396ed7 | 2015-05-27 15:12:19 +0100 | [diff] [blame] | 131 | uint16_t number_of_dex_registers, |
| 132 | bool dump_stack_maps) const { |
David Brazdil | f677ebf | 2015-05-29 16:29:43 +0100 | [diff] [blame] | 133 | StackMapEncoding encoding = ExtractEncoding(); |
Nicolas Geoffray | 004c230 | 2015-03-20 10:06:38 +0000 | [diff] [blame] | 134 | uint32_t code_info_size = GetOverallSize(); |
| 135 | size_t number_of_stack_maps = GetNumberOfStackMaps(); |
Vladimir Marko | 8f1e08a | 2015-06-26 12:06:30 +0100 | [diff] [blame] | 136 | vios->Stream() |
| 137 | << "Optimized CodeInfo (size=" << code_info_size |
| 138 | << ", number_of_dex_registers=" << number_of_dex_registers |
| 139 | << ", number_of_stack_maps=" << number_of_stack_maps |
| 140 | << ", has_inline_info=" << encoding.HasInlineInfo() |
| 141 | << ", number_of_bytes_for_inline_info=" << encoding.NumberOfBytesForInlineInfo() |
| 142 | << ", number_of_bytes_for_dex_register_map=" << encoding.NumberOfBytesForDexRegisterMap() |
| 143 | << ", number_of_bytes_for_dex_pc=" << encoding.NumberOfBytesForDexPc() |
| 144 | << ", number_of_bytes_for_native_pc=" << encoding.NumberOfBytesForNativePc() |
| 145 | << ", number_of_bytes_for_register_mask=" << encoding.NumberOfBytesForRegisterMask() |
| 146 | << ")\n"; |
| 147 | ScopedIndentation indent1(vios); |
Roland Levillain | a552e1c | 2015-03-26 15:01:03 +0000 | [diff] [blame] | 148 | // Display the Dex register location catalog. |
Vladimir Marko | 8f1e08a | 2015-06-26 12:06:30 +0100 | [diff] [blame] | 149 | GetDexRegisterLocationCatalog(encoding).Dump(vios, *this); |
Roland Levillain | a552e1c | 2015-03-26 15:01:03 +0000 | [diff] [blame] | 150 | // Display stack maps along with (live) Dex register maps. |
Roland Levillain | 0396ed7 | 2015-05-27 15:12:19 +0100 | [diff] [blame] | 151 | if (dump_stack_maps) { |
| 152 | for (size_t i = 0; i < number_of_stack_maps; ++i) { |
David Brazdil | f677ebf | 2015-05-29 16:29:43 +0100 | [diff] [blame] | 153 | StackMap stack_map = GetStackMapAt(i, encoding); |
Vladimir Marko | 8f1e08a | 2015-06-26 12:06:30 +0100 | [diff] [blame] | 154 | stack_map.Dump(vios, |
David Brazdil | f677ebf | 2015-05-29 16:29:43 +0100 | [diff] [blame] | 155 | *this, |
| 156 | encoding, |
| 157 | code_offset, |
| 158 | number_of_dex_registers, |
| 159 | " " + std::to_string(i)); |
Nicolas Geoffray | 004c230 | 2015-03-20 10:06:38 +0000 | [diff] [blame] | 160 | } |
| 161 | } |
Nicolas Geoffray | b1d0f3f | 2015-05-14 12:41:51 +0100 | [diff] [blame] | 162 | // TODO: Dump the stack map's inline information? We need to know more from the caller: |
| 163 | // we need to know the number of dex registers for each inlined method. |
| 164 | } |
| 165 | |
Vladimir Marko | 8f1e08a | 2015-06-26 12:06:30 +0100 | [diff] [blame] | 166 | void DexRegisterLocationCatalog::Dump(VariableIndentationOutputStream* vios, |
| 167 | const CodeInfo& code_info) { |
David Brazdil | f677ebf | 2015-05-29 16:29:43 +0100 | [diff] [blame] | 168 | StackMapEncoding encoding = code_info.ExtractEncoding(); |
Roland Levillain | 1c1da43 | 2015-07-16 11:54:44 +0100 | [diff] [blame] | 169 | size_t number_of_location_catalog_entries = code_info.GetNumberOfLocationCatalogEntries(); |
David Brazdil | f677ebf | 2015-05-29 16:29:43 +0100 | [diff] [blame] | 170 | size_t location_catalog_size_in_bytes = code_info.GetDexRegisterLocationCatalogSize(encoding); |
Vladimir Marko | 8f1e08a | 2015-06-26 12:06:30 +0100 | [diff] [blame] | 171 | vios->Stream() |
Roland Levillain | 0396ed7 | 2015-05-27 15:12:19 +0100 | [diff] [blame] | 172 | << "DexRegisterLocationCatalog (number_of_entries=" << number_of_location_catalog_entries |
| 173 | << ", size_in_bytes=" << location_catalog_size_in_bytes << ")\n"; |
| 174 | for (size_t i = 0; i < number_of_location_catalog_entries; ++i) { |
| 175 | DexRegisterLocation location = GetDexRegisterLocation(i); |
Vladimir Marko | 8f1e08a | 2015-06-26 12:06:30 +0100 | [diff] [blame] | 176 | ScopedIndentation indent1(vios); |
| 177 | DumpRegisterMapping(vios->Stream(), i, location, "entry "); |
Roland Levillain | 0396ed7 | 2015-05-27 15:12:19 +0100 | [diff] [blame] | 178 | } |
| 179 | } |
| 180 | |
Vladimir Marko | 8f1e08a | 2015-06-26 12:06:30 +0100 | [diff] [blame] | 181 | void DexRegisterMap::Dump(VariableIndentationOutputStream* vios, |
Nicolas Geoffray | b1d0f3f | 2015-05-14 12:41:51 +0100 | [diff] [blame] | 182 | const CodeInfo& code_info, |
| 183 | uint16_t number_of_dex_registers) const { |
David Brazdil | f677ebf | 2015-05-29 16:29:43 +0100 | [diff] [blame] | 184 | StackMapEncoding encoding = code_info.ExtractEncoding(); |
Roland Levillain | 1c1da43 | 2015-07-16 11:54:44 +0100 | [diff] [blame] | 185 | size_t number_of_location_catalog_entries = code_info.GetNumberOfLocationCatalogEntries(); |
Nicolas Geoffray | b1d0f3f | 2015-05-14 12:41:51 +0100 | [diff] [blame] | 186 | // TODO: Display the bit mask of live Dex registers. |
| 187 | for (size_t j = 0; j < number_of_dex_registers; ++j) { |
| 188 | if (IsDexRegisterLive(j)) { |
| 189 | size_t location_catalog_entry_index = GetLocationCatalogEntryIndex( |
| 190 | j, number_of_dex_registers, number_of_location_catalog_entries); |
David Brazdil | f677ebf | 2015-05-29 16:29:43 +0100 | [diff] [blame] | 191 | DexRegisterLocation location = GetDexRegisterLocation(j, |
| 192 | number_of_dex_registers, |
| 193 | code_info, |
| 194 | encoding); |
Vladimir Marko | 8f1e08a | 2015-06-26 12:06:30 +0100 | [diff] [blame] | 195 | ScopedIndentation indent1(vios); |
Nicolas Geoffray | b1d0f3f | 2015-05-14 12:41:51 +0100 | [diff] [blame] | 196 | DumpRegisterMapping( |
Vladimir Marko | 8f1e08a | 2015-06-26 12:06:30 +0100 | [diff] [blame] | 197 | vios->Stream(), j, location, "v", |
Nicolas Geoffray | b1d0f3f | 2015-05-14 12:41:51 +0100 | [diff] [blame] | 198 | "\t[entry " + std::to_string(static_cast<int>(location_catalog_entry_index)) + "]"); |
| 199 | } |
| 200 | } |
| 201 | } |
| 202 | |
Vladimir Marko | 8f1e08a | 2015-06-26 12:06:30 +0100 | [diff] [blame] | 203 | void StackMap::Dump(VariableIndentationOutputStream* vios, |
Roland Levillain | f2650d1 | 2015-05-28 14:53:28 +0100 | [diff] [blame] | 204 | const CodeInfo& code_info, |
David Brazdil | f677ebf | 2015-05-29 16:29:43 +0100 | [diff] [blame] | 205 | const StackMapEncoding& encoding, |
Roland Levillain | f2650d1 | 2015-05-28 14:53:28 +0100 | [diff] [blame] | 206 | uint32_t code_offset, |
| 207 | uint16_t number_of_dex_registers, |
| 208 | const std::string& header_suffix) const { |
Vladimir Marko | 8f1e08a | 2015-06-26 12:06:30 +0100 | [diff] [blame] | 209 | vios->Stream() |
| 210 | << "StackMap" << header_suffix |
| 211 | << std::hex |
| 212 | << " [native_pc=0x" << code_offset + GetNativePcOffset(encoding) << "]" |
| 213 | << " (dex_pc=0x" << GetDexPc(encoding) |
| 214 | << ", native_pc_offset=0x" << GetNativePcOffset(encoding) |
| 215 | << ", dex_register_map_offset=0x" << GetDexRegisterMapOffset(encoding) |
| 216 | << ", inline_info_offset=0x" << GetInlineDescriptorOffset(encoding) |
| 217 | << ", register_mask=0x" << GetRegisterMask(encoding) |
| 218 | << std::dec |
| 219 | << ", stack_mask=0b"; |
David Brazdil | f677ebf | 2015-05-29 16:29:43 +0100 | [diff] [blame] | 220 | MemoryRegion stack_mask = GetStackMask(encoding); |
Roland Levillain | f2650d1 | 2015-05-28 14:53:28 +0100 | [diff] [blame] | 221 | for (size_t i = 0, e = stack_mask.size_in_bits(); i < e; ++i) { |
Vladimir Marko | 8f1e08a | 2015-06-26 12:06:30 +0100 | [diff] [blame] | 222 | vios->Stream() << stack_mask.LoadBit(e - i - 1); |
Roland Levillain | f2650d1 | 2015-05-28 14:53:28 +0100 | [diff] [blame] | 223 | } |
Vladimir Marko | 8f1e08a | 2015-06-26 12:06:30 +0100 | [diff] [blame] | 224 | vios->Stream() << ")\n"; |
David Brazdil | f677ebf | 2015-05-29 16:29:43 +0100 | [diff] [blame] | 225 | if (HasDexRegisterMap(encoding)) { |
| 226 | DexRegisterMap dex_register_map = code_info.GetDexRegisterMapOf( |
| 227 | *this, encoding, number_of_dex_registers); |
Vladimir Marko | 8f1e08a | 2015-06-26 12:06:30 +0100 | [diff] [blame] | 228 | dex_register_map.Dump(vios, code_info, number_of_dex_registers); |
Roland Levillain | f2650d1 | 2015-05-28 14:53:28 +0100 | [diff] [blame] | 229 | } |
Nicolas Geoffray | 12bdb72 | 2015-06-17 09:44:43 +0100 | [diff] [blame] | 230 | if (HasInlineInfo(encoding)) { |
| 231 | InlineInfo inline_info = code_info.GetInlineInfoOf(*this, encoding); |
| 232 | // We do not know the length of the dex register maps of inlined frames |
| 233 | // at this level, so we just pass null to `InlineInfo::Dump` to tell |
| 234 | // it not to look at these maps. |
Vladimir Marko | 8f1e08a | 2015-06-26 12:06:30 +0100 | [diff] [blame] | 235 | inline_info.Dump(vios, code_info, nullptr); |
Nicolas Geoffray | 12bdb72 | 2015-06-17 09:44:43 +0100 | [diff] [blame] | 236 | } |
Roland Levillain | f2650d1 | 2015-05-28 14:53:28 +0100 | [diff] [blame] | 237 | } |
| 238 | |
Vladimir Marko | 8f1e08a | 2015-06-26 12:06:30 +0100 | [diff] [blame] | 239 | void InlineInfo::Dump(VariableIndentationOutputStream* vios, |
Nicolas Geoffray | b1d0f3f | 2015-05-14 12:41:51 +0100 | [diff] [blame] | 240 | const CodeInfo& code_info, |
| 241 | uint16_t number_of_dex_registers[]) const { |
Vladimir Marko | 8f1e08a | 2015-06-26 12:06:30 +0100 | [diff] [blame] | 242 | vios->Stream() << "InlineInfo with depth " << static_cast<uint32_t>(GetDepth()) << "\n"; |
Nicolas Geoffray | b1d0f3f | 2015-05-14 12:41:51 +0100 | [diff] [blame] | 243 | |
| 244 | for (size_t i = 0; i < GetDepth(); ++i) { |
Vladimir Marko | 8f1e08a | 2015-06-26 12:06:30 +0100 | [diff] [blame] | 245 | vios->Stream() |
| 246 | << " At depth " << i |
| 247 | << std::hex |
| 248 | << " (dex_pc=0x" << GetDexPcAtDepth(i) |
| 249 | << std::dec |
| 250 | << ", method_index=" << GetMethodIndexAtDepth(i) |
| 251 | << ", invoke_type=" << static_cast<InvokeType>(GetInvokeTypeAtDepth(i)) |
| 252 | << ")\n"; |
Nicolas Geoffray | 12bdb72 | 2015-06-17 09:44:43 +0100 | [diff] [blame] | 253 | if (HasDexRegisterMapAtDepth(i) && (number_of_dex_registers != nullptr)) { |
David Brazdil | f677ebf | 2015-05-29 16:29:43 +0100 | [diff] [blame] | 254 | StackMapEncoding encoding = code_info.ExtractEncoding(); |
Nicolas Geoffray | b1d0f3f | 2015-05-14 12:41:51 +0100 | [diff] [blame] | 255 | DexRegisterMap dex_register_map = |
David Brazdil | f677ebf | 2015-05-29 16:29:43 +0100 | [diff] [blame] | 256 | code_info.GetDexRegisterMapAtDepth(i, *this, encoding, number_of_dex_registers[i]); |
Vladimir Marko | 8f1e08a | 2015-06-26 12:06:30 +0100 | [diff] [blame] | 257 | ScopedIndentation indent1(vios); |
| 258 | dex_register_map.Dump(vios, code_info, number_of_dex_registers[i]); |
Nicolas Geoffray | b1d0f3f | 2015-05-14 12:41:51 +0100 | [diff] [blame] | 259 | } |
| 260 | } |
Nicolas Geoffray | 004c230 | 2015-03-20 10:06:38 +0000 | [diff] [blame] | 261 | } |
| 262 | |
| 263 | } // namespace art |