Nicolas Geoffray | 99ea58c | 2014-07-02 15:08:17 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2014 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 | #ifndef ART_RUNTIME_STACK_MAP_H_ |
| 18 | #define ART_RUNTIME_STACK_MAP_H_ |
| 19 | |
Andreas Gampe | 69489fa | 2017-06-08 18:03:25 -0700 | [diff] [blame] | 20 | #include <limits> |
| 21 | |
David Sehr | 1ce2b3b | 2018-04-05 11:02:03 -0700 | [diff] [blame] | 22 | #include "base/bit_memory_region.h" |
David Srbecky | 052f8ca | 2018-04-26 15:42:54 +0100 | [diff] [blame] | 23 | #include "base/bit_table.h" |
Vladimir Marko | 80afd02 | 2015-05-19 18:08:00 +0100 | [diff] [blame] | 24 | #include "base/bit_utils.h" |
Andreas Gampe | 8cf9cb3 | 2017-07-19 09:28:38 -0700 | [diff] [blame] | 25 | #include "base/bit_vector.h" |
David Sehr | 67bf42e | 2018-02-26 16:43:04 -0800 | [diff] [blame] | 26 | #include "base/leb128.h" |
David Sehr | 1ce2b3b | 2018-04-05 11:02:03 -0700 | [diff] [blame] | 27 | #include "base/memory_region.h" |
David Sehr | 9e734c7 | 2018-01-04 17:56:19 -0800 | [diff] [blame] | 28 | #include "dex/dex_file_types.h" |
David Srbecky | 71ec1cc | 2018-05-18 15:57:25 +0100 | [diff] [blame] | 29 | #include "dex_register_location.h" |
Mathieu Chartier | cbcedbf | 2017-03-12 22:24:50 -0700 | [diff] [blame] | 30 | #include "method_info.h" |
David Srbecky | 052f8ca | 2018-04-26 15:42:54 +0100 | [diff] [blame] | 31 | #include "oat_quick_method_header.h" |
Nicolas Geoffray | 99ea58c | 2014-07-02 15:08:17 +0100 | [diff] [blame] | 32 | |
| 33 | namespace art { |
| 34 | |
Vladimir Marko | 8f1e08a | 2015-06-26 12:06:30 +0100 | [diff] [blame] | 35 | class VariableIndentationOutputStream; |
| 36 | |
Roland Levillain | a2d8ec6 | 2015-03-12 15:25:29 +0000 | [diff] [blame] | 37 | // Size of a frame slot, in bytes. This constant is a signed value, |
| 38 | // to please the compiler in arithmetic operations involving int32_t |
| 39 | // (signed) values. |
Roland Levillain | a552e1c | 2015-03-26 15:01:03 +0000 | [diff] [blame] | 40 | static constexpr ssize_t kFrameSlotSize = 4; |
Roland Levillain | a2d8ec6 | 2015-03-12 15:25:29 +0000 | [diff] [blame] | 41 | |
David Srbecky | 6de8833 | 2018-06-03 12:00:11 +0100 | [diff] [blame^] | 42 | // The delta compression of dex register maps means we need to scan the stackmaps backwards. |
| 43 | // We compress the data in such a way so that there is an upper bound on the search distance. |
| 44 | // Max distance 0 means each stack map must be fully defined and no scanning back is allowed. |
| 45 | // If this value is changed, the oat file version should be incremented (for DCHECK to pass). |
| 46 | static constexpr size_t kMaxDexRegisterMapSearchDistance = 32; |
| 47 | |
Nicolas Geoffray | 5d37c15 | 2017-01-12 13:25:19 +0000 | [diff] [blame] | 48 | class ArtMethod; |
Nicolas Geoffray | 004c230 | 2015-03-20 10:06:38 +0000 | [diff] [blame] | 49 | class CodeInfo; |
| 50 | |
David Srbecky | 71ec1cc | 2018-05-18 15:57:25 +0100 | [diff] [blame] | 51 | std::ostream& operator<<(std::ostream& stream, const DexRegisterLocation& reg); |
Nicolas Geoffray | 99ea58c | 2014-07-02 15:08:17 +0100 | [diff] [blame] | 52 | |
David Srbecky | 71ec1cc | 2018-05-18 15:57:25 +0100 | [diff] [blame] | 53 | // Information on Dex register locations for a specific PC. |
| 54 | // Effectively just a convenience wrapper for DexRegisterLocation vector. |
| 55 | // If the size is small enough, it keeps the data on the stack. |
Roland Levillain | a552e1c | 2015-03-26 15:01:03 +0000 | [diff] [blame] | 56 | class DexRegisterMap { |
| 57 | public: |
David Srbecky | 6de8833 | 2018-06-03 12:00:11 +0100 | [diff] [blame^] | 58 | using iterator = DexRegisterLocation*; |
| 59 | |
| 60 | // Create map for given number of registers and initialize them to the given value. |
| 61 | DexRegisterMap(size_t count, DexRegisterLocation value) : count_(count), regs_small_{} { |
David Srbecky | 71ec1cc | 2018-05-18 15:57:25 +0100 | [diff] [blame] | 62 | if (count_ <= kSmallCount) { |
David Srbecky | 6de8833 | 2018-06-03 12:00:11 +0100 | [diff] [blame^] | 63 | std::fill_n(regs_small_.begin(), count, value); |
David Srbecky | 71ec1cc | 2018-05-18 15:57:25 +0100 | [diff] [blame] | 64 | } else { |
David Srbecky | 6de8833 | 2018-06-03 12:00:11 +0100 | [diff] [blame^] | 65 | regs_large_.resize(count, value); |
David Srbecky | 71ec1cc | 2018-05-18 15:57:25 +0100 | [diff] [blame] | 66 | } |
Roland Levillain | a552e1c | 2015-03-26 15:01:03 +0000 | [diff] [blame] | 67 | } |
| 68 | |
David Srbecky | 71ec1cc | 2018-05-18 15:57:25 +0100 | [diff] [blame] | 69 | DexRegisterLocation* data() { |
| 70 | return count_ <= kSmallCount ? regs_small_.data() : regs_large_.data(); |
| 71 | } |
Roland Levillain | a552e1c | 2015-03-26 15:01:03 +0000 | [diff] [blame] | 72 | |
David Srbecky | 6de8833 | 2018-06-03 12:00:11 +0100 | [diff] [blame^] | 73 | iterator begin() { return data(); } |
| 74 | iterator end() { return data() + count_; } |
| 75 | |
David Srbecky | 71ec1cc | 2018-05-18 15:57:25 +0100 | [diff] [blame] | 76 | size_t size() const { return count_; } |
| 77 | |
| 78 | bool IsValid() const { return count_ != 0; } |
| 79 | |
| 80 | DexRegisterLocation Get(size_t index) const { |
| 81 | DCHECK_LT(index, count_); |
| 82 | return count_ <= kSmallCount ? regs_small_[index] : regs_large_[index]; |
| 83 | } |
| 84 | |
| 85 | DexRegisterLocation::Kind GetLocationKind(uint16_t dex_register_number) const { |
| 86 | return Get(dex_register_number).GetKind(); |
| 87 | } |
| 88 | |
| 89 | // TODO: Remove. |
| 90 | DexRegisterLocation::Kind GetLocationInternalKind(uint16_t dex_register_number) const { |
| 91 | return Get(dex_register_number).GetKind(); |
| 92 | } |
| 93 | |
| 94 | DexRegisterLocation GetDexRegisterLocation(uint16_t dex_register_number) const { |
| 95 | return Get(dex_register_number); |
| 96 | } |
Roland Levillain | a552e1c | 2015-03-26 15:01:03 +0000 | [diff] [blame] | 97 | |
David Srbecky | 21d45b4 | 2018-05-30 06:35:05 +0100 | [diff] [blame] | 98 | int32_t GetStackOffsetInBytes(uint16_t dex_register_number) const { |
David Srbecky | 71ec1cc | 2018-05-18 15:57:25 +0100 | [diff] [blame] | 99 | DexRegisterLocation location = Get(dex_register_number); |
Roland Levillain | a552e1c | 2015-03-26 15:01:03 +0000 | [diff] [blame] | 100 | DCHECK(location.GetKind() == DexRegisterLocation::Kind::kInStack); |
Roland Levillain | a552e1c | 2015-03-26 15:01:03 +0000 | [diff] [blame] | 101 | return location.GetValue(); |
| 102 | } |
| 103 | |
David Srbecky | 21d45b4 | 2018-05-30 06:35:05 +0100 | [diff] [blame] | 104 | int32_t GetConstant(uint16_t dex_register_number) const { |
David Srbecky | 71ec1cc | 2018-05-18 15:57:25 +0100 | [diff] [blame] | 105 | DexRegisterLocation location = Get(dex_register_number); |
| 106 | DCHECK(location.GetKind() == DexRegisterLocation::Kind::kConstant); |
Roland Levillain | a552e1c | 2015-03-26 15:01:03 +0000 | [diff] [blame] | 107 | return location.GetValue(); |
| 108 | } |
| 109 | |
David Srbecky | 21d45b4 | 2018-05-30 06:35:05 +0100 | [diff] [blame] | 110 | int32_t GetMachineRegister(uint16_t dex_register_number) const { |
David Srbecky | 71ec1cc | 2018-05-18 15:57:25 +0100 | [diff] [blame] | 111 | DexRegisterLocation location = Get(dex_register_number); |
| 112 | DCHECK(location.GetKind() == DexRegisterLocation::Kind::kInRegister || |
| 113 | location.GetKind() == DexRegisterLocation::Kind::kInRegisterHigh || |
| 114 | location.GetKind() == DexRegisterLocation::Kind::kInFpuRegister || |
| 115 | location.GetKind() == DexRegisterLocation::Kind::kInFpuRegisterHigh); |
Roland Levillain | a552e1c | 2015-03-26 15:01:03 +0000 | [diff] [blame] | 116 | return location.GetValue(); |
| 117 | } |
| 118 | |
Mingyao Yang | 01b47b0 | 2017-02-03 12:09:57 -0800 | [diff] [blame] | 119 | ALWAYS_INLINE bool IsDexRegisterLive(uint16_t dex_register_number) const { |
David Srbecky | 71ec1cc | 2018-05-18 15:57:25 +0100 | [diff] [blame] | 120 | return Get(dex_register_number).IsLive(); |
Roland Levillain | a552e1c | 2015-03-26 15:01:03 +0000 | [diff] [blame] | 121 | } |
| 122 | |
David Srbecky | 71ec1cc | 2018-05-18 15:57:25 +0100 | [diff] [blame] | 123 | size_t GetNumberOfLiveDexRegisters() const { |
Roland Levillain | a552e1c | 2015-03-26 15:01:03 +0000 | [diff] [blame] | 124 | size_t number_of_live_dex_registers = 0; |
David Srbecky | 71ec1cc | 2018-05-18 15:57:25 +0100 | [diff] [blame] | 125 | for (size_t i = 0; i < count_; ++i) { |
Roland Levillain | a552e1c | 2015-03-26 15:01:03 +0000 | [diff] [blame] | 126 | if (IsDexRegisterLive(i)) { |
| 127 | ++number_of_live_dex_registers; |
| 128 | } |
| 129 | } |
| 130 | return number_of_live_dex_registers; |
| 131 | } |
| 132 | |
David Srbecky | 71ec1cc | 2018-05-18 15:57:25 +0100 | [diff] [blame] | 133 | bool HasAnyLiveDexRegisters() const { |
| 134 | for (size_t i = 0; i < count_; ++i) { |
| 135 | if (IsDexRegisterLive(i)) { |
| 136 | return true; |
| 137 | } |
| 138 | } |
| 139 | return false; |
David Srbecky | 21d45b4 | 2018-05-30 06:35:05 +0100 | [diff] [blame] | 140 | } |
| 141 | |
Roland Levillain | a552e1c | 2015-03-26 15:01:03 +0000 | [diff] [blame] | 142 | private: |
David Srbecky | 71ec1cc | 2018-05-18 15:57:25 +0100 | [diff] [blame] | 143 | // Store the data inline if the number of registers is small to avoid memory allocations. |
| 144 | // If count_ <= kSmallCount, we use the regs_small_ array, and regs_large_ otherwise. |
| 145 | static constexpr size_t kSmallCount = 16; |
| 146 | size_t count_; |
| 147 | std::array<DexRegisterLocation, kSmallCount> regs_small_; |
| 148 | dchecked_vector<DexRegisterLocation> regs_large_; |
Roland Levillain | a552e1c | 2015-03-26 15:01:03 +0000 | [diff] [blame] | 149 | }; |
| 150 | |
Nicolas Geoffray | 99ea58c | 2014-07-02 15:08:17 +0100 | [diff] [blame] | 151 | /** |
| 152 | * A Stack Map holds compilation information for a specific PC necessary for: |
| 153 | * - Mapping it to a dex PC, |
| 154 | * - Knowing which stack entries are objects, |
| 155 | * - Knowing which registers hold objects, |
| 156 | * - Knowing the inlining information, |
| 157 | * - Knowing the values of dex registers. |
Nicolas Geoffray | 99ea58c | 2014-07-02 15:08:17 +0100 | [diff] [blame] | 158 | */ |
David Srbecky | 71ec1cc | 2018-05-18 15:57:25 +0100 | [diff] [blame] | 159 | class StackMap : public BitTable<7>::Accessor { |
Nicolas Geoffray | 99ea58c | 2014-07-02 15:08:17 +0100 | [diff] [blame] | 160 | public: |
David Srbecky | d97e082 | 2018-06-03 12:00:24 +0100 | [diff] [blame] | 161 | BIT_TABLE_HEADER() |
| 162 | BIT_TABLE_COLUMN(0, PackedNativePc) |
| 163 | BIT_TABLE_COLUMN(1, DexPc) |
| 164 | BIT_TABLE_COLUMN(2, RegisterMaskIndex) |
| 165 | BIT_TABLE_COLUMN(3, StackMaskIndex) |
| 166 | BIT_TABLE_COLUMN(4, InlineInfoIndex) |
| 167 | BIT_TABLE_COLUMN(5, DexRegisterMaskIndex) |
| 168 | BIT_TABLE_COLUMN(6, DexRegisterMapIndex) |
Nicolas Geoffray | 99ea58c | 2014-07-02 15:08:17 +0100 | [diff] [blame] | 169 | |
David Srbecky | 052f8ca | 2018-04-26 15:42:54 +0100 | [diff] [blame] | 170 | ALWAYS_INLINE uint32_t GetNativePcOffset(InstructionSet instruction_set) const { |
David Srbecky | d02b23f | 2018-05-29 23:27:22 +0100 | [diff] [blame] | 171 | return UnpackNativePc(Get<kPackedNativePc>(), instruction_set); |
David Brazdil | f677ebf | 2015-05-29 16:29:43 +0100 | [diff] [blame] | 172 | } |
Nicolas Geoffray | 99ea58c | 2014-07-02 15:08:17 +0100 | [diff] [blame] | 173 | |
David Srbecky | d97e082 | 2018-06-03 12:00:24 +0100 | [diff] [blame] | 174 | ALWAYS_INLINE bool HasInlineInfo() const { |
| 175 | return HasInlineInfoIndex(); |
| 176 | } |
Nicolas Geoffray | 99ea58c | 2014-07-02 15:08:17 +0100 | [diff] [blame] | 177 | |
David Srbecky | d97e082 | 2018-06-03 12:00:24 +0100 | [diff] [blame] | 178 | ALWAYS_INLINE bool HasDexRegisterMap() const { |
| 179 | return HasDexRegisterMapIndex(); |
| 180 | } |
Nicolas Geoffray | 99ea58c | 2014-07-02 15:08:17 +0100 | [diff] [blame] | 181 | |
David Srbecky | d02b23f | 2018-05-29 23:27:22 +0100 | [diff] [blame] | 182 | static uint32_t PackNativePc(uint32_t native_pc, InstructionSet isa) { |
David Srbecky | d775f96 | 2018-05-30 18:12:52 +0100 | [diff] [blame] | 183 | DCHECK_ALIGNED_PARAM(native_pc, GetInstructionSetInstructionAlignment(isa)); |
David Srbecky | d02b23f | 2018-05-29 23:27:22 +0100 | [diff] [blame] | 184 | return native_pc / GetInstructionSetInstructionAlignment(isa); |
| 185 | } |
| 186 | |
| 187 | static uint32_t UnpackNativePc(uint32_t packed_native_pc, InstructionSet isa) { |
| 188 | uint32_t native_pc = packed_native_pc * GetInstructionSetInstructionAlignment(isa); |
| 189 | DCHECK_EQ(native_pc / GetInstructionSetInstructionAlignment(isa), packed_native_pc); |
| 190 | return native_pc; |
| 191 | } |
| 192 | |
Vladimir Marko | 8f1e08a | 2015-06-26 12:06:30 +0100 | [diff] [blame] | 193 | void Dump(VariableIndentationOutputStream* vios, |
Roland Levillain | f2650d1 | 2015-05-28 14:53:28 +0100 | [diff] [blame] | 194 | const CodeInfo& code_info, |
Mathieu Chartier | cbcedbf | 2017-03-12 22:24:50 -0700 | [diff] [blame] | 195 | const MethodInfo& method_info, |
Roland Levillain | f2650d1 | 2015-05-28 14:53:28 +0100 | [diff] [blame] | 196 | uint32_t code_offset, |
| 197 | uint16_t number_of_dex_registers, |
David Srbecky | 71ec1cc | 2018-05-18 15:57:25 +0100 | [diff] [blame] | 198 | InstructionSet instruction_set) const; |
David Srbecky | 61b28a1 | 2016-02-25 21:55:03 +0000 | [diff] [blame] | 199 | }; |
| 200 | |
Nicolas Geoffray | b1d0f3f | 2015-05-14 12:41:51 +0100 | [diff] [blame] | 201 | /** |
David Srbecky | 052f8ca | 2018-04-26 15:42:54 +0100 | [diff] [blame] | 202 | * Inline information for a specific PC. |
| 203 | * The row referenced from the StackMap holds information at depth 0. |
| 204 | * Following rows hold information for further depths. |
Nicolas Geoffray | b1d0f3f | 2015-05-14 12:41:51 +0100 | [diff] [blame] | 205 | */ |
David Srbecky | 6de8833 | 2018-06-03 12:00:11 +0100 | [diff] [blame^] | 206 | class InlineInfo : public BitTable<6>::Accessor { |
Nicolas Geoffray | b1d0f3f | 2015-05-14 12:41:51 +0100 | [diff] [blame] | 207 | public: |
David Srbecky | d97e082 | 2018-06-03 12:00:24 +0100 | [diff] [blame] | 208 | BIT_TABLE_HEADER() |
| 209 | BIT_TABLE_COLUMN(0, IsLast) // Determines if there are further rows for further depths. |
| 210 | BIT_TABLE_COLUMN(1, DexPc) |
| 211 | BIT_TABLE_COLUMN(2, MethodInfoIndex) |
| 212 | BIT_TABLE_COLUMN(3, ArtMethodHi) // High bits of ArtMethod*. |
| 213 | BIT_TABLE_COLUMN(4, ArtMethodLo) // Low bits of ArtMethod*. |
David Srbecky | 6de8833 | 2018-06-03 12:00:11 +0100 | [diff] [blame^] | 214 | BIT_TABLE_COLUMN(5, NumberOfDexRegisters) // Includes outer levels and the main method. |
David Srbecky | d97e082 | 2018-06-03 12:00:24 +0100 | [diff] [blame] | 215 | BIT_TABLE_COLUMN(6, DexRegisterMapIndex) |
| 216 | |
David Srbecky | 052f8ca | 2018-04-26 15:42:54 +0100 | [diff] [blame] | 217 | static constexpr uint32_t kLast = -1; |
| 218 | static constexpr uint32_t kMore = 0; |
Nicolas Geoffray | b1d0f3f | 2015-05-14 12:41:51 +0100 | [diff] [blame] | 219 | |
David Srbecky | 6e69e52 | 2018-06-03 12:00:14 +0100 | [diff] [blame] | 220 | uint32_t GetMethodIndex(const MethodInfo& method_info) const { |
David Srbecky | d97e082 | 2018-06-03 12:00:24 +0100 | [diff] [blame] | 221 | return method_info.GetMethodIndex(GetMethodInfoIndex()); |
Nicolas Geoffray | b1d0f3f | 2015-05-14 12:41:51 +0100 | [diff] [blame] | 222 | } |
| 223 | |
David Srbecky | 6e69e52 | 2018-06-03 12:00:14 +0100 | [diff] [blame] | 224 | bool EncodesArtMethod() const { |
David Srbecky | d97e082 | 2018-06-03 12:00:24 +0100 | [diff] [blame] | 225 | return HasArtMethodLo(); |
Nicolas Geoffray | b1d0f3f | 2015-05-14 12:41:51 +0100 | [diff] [blame] | 226 | } |
| 227 | |
David Srbecky | 6e69e52 | 2018-06-03 12:00:14 +0100 | [diff] [blame] | 228 | ArtMethod* GetArtMethod() const { |
David Srbecky | d97e082 | 2018-06-03 12:00:24 +0100 | [diff] [blame] | 229 | uint64_t lo = GetArtMethodLo(); |
| 230 | uint64_t hi = GetArtMethodHi(); |
David Srbecky | 71ec1cc | 2018-05-18 15:57:25 +0100 | [diff] [blame] | 231 | return reinterpret_cast<ArtMethod*>((hi << 32) | lo); |
Nicolas Geoffray | b1d0f3f | 2015-05-14 12:41:51 +0100 | [diff] [blame] | 232 | } |
| 233 | |
Vladimir Marko | 8f1e08a | 2015-06-26 12:06:30 +0100 | [diff] [blame] | 234 | void Dump(VariableIndentationOutputStream* vios, |
David Srbecky | 61b28a1 | 2016-02-25 21:55:03 +0000 | [diff] [blame] | 235 | const CodeInfo& info, |
David Srbecky | 6e69e52 | 2018-06-03 12:00:14 +0100 | [diff] [blame] | 236 | const StackMap& stack_map, |
Mathieu Chartier | cbcedbf | 2017-03-12 22:24:50 -0700 | [diff] [blame] | 237 | const MethodInfo& method_info, |
David Srbecky | 6e69e52 | 2018-06-03 12:00:14 +0100 | [diff] [blame] | 238 | uint16_t number_of_dex_registers) const; |
Mathieu Chartier | 575d3e6 | 2017-02-06 11:00:40 -0800 | [diff] [blame] | 239 | }; |
| 240 | |
David Srbecky | 052f8ca | 2018-04-26 15:42:54 +0100 | [diff] [blame] | 241 | class InvokeInfo : public BitTable<3>::Accessor { |
Mathieu Chartier | 575d3e6 | 2017-02-06 11:00:40 -0800 | [diff] [blame] | 242 | public: |
David Srbecky | d97e082 | 2018-06-03 12:00:24 +0100 | [diff] [blame] | 243 | BIT_TABLE_HEADER() |
| 244 | BIT_TABLE_COLUMN(0, PackedNativePc) |
| 245 | BIT_TABLE_COLUMN(1, InvokeType) |
| 246 | BIT_TABLE_COLUMN(2, MethodInfoIndex) |
Mathieu Chartier | 575d3e6 | 2017-02-06 11:00:40 -0800 | [diff] [blame] | 247 | |
David Srbecky | 052f8ca | 2018-04-26 15:42:54 +0100 | [diff] [blame] | 248 | ALWAYS_INLINE uint32_t GetNativePcOffset(InstructionSet instruction_set) const { |
David Srbecky | d02b23f | 2018-05-29 23:27:22 +0100 | [diff] [blame] | 249 | return StackMap::UnpackNativePc(Get<kPackedNativePc>(), instruction_set); |
Mathieu Chartier | d776ff0 | 2017-01-17 09:32:18 -0800 | [diff] [blame] | 250 | } |
| 251 | |
David Srbecky | 052f8ca | 2018-04-26 15:42:54 +0100 | [diff] [blame] | 252 | uint32_t GetMethodIndex(MethodInfo method_info) const { |
David Srbecky | d97e082 | 2018-06-03 12:00:24 +0100 | [diff] [blame] | 253 | return method_info.GetMethodIndex(GetMethodInfoIndex()); |
Mathieu Chartier | d776ff0 | 2017-01-17 09:32:18 -0800 | [diff] [blame] | 254 | } |
David Srbecky | 09ed098 | 2016-02-12 21:58:43 +0000 | [diff] [blame] | 255 | }; |
| 256 | |
David Srbecky | 71ec1cc | 2018-05-18 15:57:25 +0100 | [diff] [blame] | 257 | class DexRegisterInfo : public BitTable<2>::Accessor { |
| 258 | public: |
David Srbecky | d97e082 | 2018-06-03 12:00:24 +0100 | [diff] [blame] | 259 | BIT_TABLE_HEADER() |
| 260 | BIT_TABLE_COLUMN(0, Kind) |
| 261 | BIT_TABLE_COLUMN(1, PackedValue) |
David Srbecky | 71ec1cc | 2018-05-18 15:57:25 +0100 | [diff] [blame] | 262 | |
| 263 | ALWAYS_INLINE DexRegisterLocation GetLocation() const { |
David Srbecky | d97e082 | 2018-06-03 12:00:24 +0100 | [diff] [blame] | 264 | DexRegisterLocation::Kind kind = static_cast<DexRegisterLocation::Kind>(GetKind()); |
| 265 | return DexRegisterLocation(kind, UnpackValue(kind, GetPackedValue())); |
David Srbecky | 71ec1cc | 2018-05-18 15:57:25 +0100 | [diff] [blame] | 266 | } |
| 267 | |
| 268 | static uint32_t PackValue(DexRegisterLocation::Kind kind, uint32_t value) { |
| 269 | uint32_t packed_value = value; |
| 270 | if (kind == DexRegisterLocation::Kind::kInStack) { |
| 271 | DCHECK(IsAligned<kFrameSlotSize>(packed_value)); |
| 272 | packed_value /= kFrameSlotSize; |
| 273 | } |
| 274 | return packed_value; |
| 275 | } |
| 276 | |
| 277 | static uint32_t UnpackValue(DexRegisterLocation::Kind kind, uint32_t packed_value) { |
| 278 | uint32_t value = packed_value; |
| 279 | if (kind == DexRegisterLocation::Kind::kInStack) { |
| 280 | value *= kFrameSlotSize; |
| 281 | } |
| 282 | return value; |
| 283 | } |
| 284 | }; |
| 285 | |
David Srbecky | 4b59d10 | 2018-05-29 21:46:10 +0000 | [diff] [blame] | 286 | // Register masks tend to have many trailing zero bits (caller-saves are usually not encoded), |
| 287 | // therefore it is worth encoding the mask as value+shift. |
| 288 | class RegisterMask : public BitTable<2>::Accessor { |
| 289 | public: |
David Srbecky | d97e082 | 2018-06-03 12:00:24 +0100 | [diff] [blame] | 290 | BIT_TABLE_HEADER() |
| 291 | BIT_TABLE_COLUMN(0, Value) |
| 292 | BIT_TABLE_COLUMN(1, Shift) |
David Srbecky | 4b59d10 | 2018-05-29 21:46:10 +0000 | [diff] [blame] | 293 | |
| 294 | ALWAYS_INLINE uint32_t GetMask() const { |
David Srbecky | d97e082 | 2018-06-03 12:00:24 +0100 | [diff] [blame] | 295 | return GetValue() << GetShift(); |
David Srbecky | 4b59d10 | 2018-05-29 21:46:10 +0000 | [diff] [blame] | 296 | } |
| 297 | }; |
| 298 | |
Nicolas Geoffray | 99ea58c | 2014-07-02 15:08:17 +0100 | [diff] [blame] | 299 | /** |
| 300 | * Wrapper around all compiler information collected for a method. |
David Srbecky | 71ec1cc | 2018-05-18 15:57:25 +0100 | [diff] [blame] | 301 | * See the Decode method at the end for the precise binary format. |
Nicolas Geoffray | 99ea58c | 2014-07-02 15:08:17 +0100 | [diff] [blame] | 302 | */ |
Nicolas Geoffray | 99ea58c | 2014-07-02 15:08:17 +0100 | [diff] [blame] | 303 | class CodeInfo { |
| 304 | public: |
Nicolas Geoffray | 3946844 | 2014-09-02 15:17:15 +0100 | [diff] [blame] | 305 | explicit CodeInfo(const void* data) { |
David Srbecky | 052f8ca | 2018-04-26 15:42:54 +0100 | [diff] [blame] | 306 | Decode(reinterpret_cast<const uint8_t*>(data)); |
Nicolas Geoffray | 3946844 | 2014-09-02 15:17:15 +0100 | [diff] [blame] | 307 | } |
| 308 | |
David Srbecky | 052f8ca | 2018-04-26 15:42:54 +0100 | [diff] [blame] | 309 | explicit CodeInfo(MemoryRegion region) : CodeInfo(region.begin()) { |
| 310 | DCHECK_EQ(size_, region.size()); |
Nicolas Geoffray | 896f8f7 | 2015-03-30 15:44:25 +0100 | [diff] [blame] | 311 | } |
| 312 | |
David Srbecky | 052f8ca | 2018-04-26 15:42:54 +0100 | [diff] [blame] | 313 | explicit CodeInfo(const OatQuickMethodHeader* header) |
| 314 | : CodeInfo(header->GetOptimizedCodeInfoPtr()) { |
Nicolas Geoffray | 896f8f7 | 2015-03-30 15:44:25 +0100 | [diff] [blame] | 315 | } |
| 316 | |
David Srbecky | 052f8ca | 2018-04-26 15:42:54 +0100 | [diff] [blame] | 317 | size_t Size() const { |
| 318 | return size_; |
Roland Levillain | a552e1c | 2015-03-26 15:01:03 +0000 | [diff] [blame] | 319 | } |
| 320 | |
David Srbecky | 052f8ca | 2018-04-26 15:42:54 +0100 | [diff] [blame] | 321 | bool HasInlineInfo() const { |
David Srbecky | 71ec1cc | 2018-05-18 15:57:25 +0100 | [diff] [blame] | 322 | return inline_infos_.NumRows() > 0; |
Nicolas Geoffray | 3946844 | 2014-09-02 15:17:15 +0100 | [diff] [blame] | 323 | } |
| 324 | |
David Srbecky | 052f8ca | 2018-04-26 15:42:54 +0100 | [diff] [blame] | 325 | ALWAYS_INLINE StackMap GetStackMapAt(size_t index) const { |
| 326 | return StackMap(&stack_maps_, index); |
David Srbecky | 45aa598 | 2016-03-18 02:15:09 +0000 | [diff] [blame] | 327 | } |
| 328 | |
David Srbecky | 052f8ca | 2018-04-26 15:42:54 +0100 | [diff] [blame] | 329 | BitMemoryRegion GetStackMask(size_t index) const { |
David Srbecky | 4b59d10 | 2018-05-29 21:46:10 +0000 | [diff] [blame] | 330 | return stack_masks_.GetBitMemoryRegion(index); |
Mathieu Chartier | 1a20b68 | 2017-01-31 14:25:16 -0800 | [diff] [blame] | 331 | } |
| 332 | |
David Srbecky | 052f8ca | 2018-04-26 15:42:54 +0100 | [diff] [blame] | 333 | BitMemoryRegion GetStackMaskOf(const StackMap& stack_map) const { |
David Srbecky | 4b59d10 | 2018-05-29 21:46:10 +0000 | [diff] [blame] | 334 | uint32_t index = stack_map.GetStackMaskIndex(); |
| 335 | return (index == StackMap::kNoValue) ? BitMemoryRegion() : GetStackMask(index); |
Mathieu Chartier | 1a20b68 | 2017-01-31 14:25:16 -0800 | [diff] [blame] | 336 | } |
| 337 | |
David Srbecky | 052f8ca | 2018-04-26 15:42:54 +0100 | [diff] [blame] | 338 | uint32_t GetRegisterMaskOf(const StackMap& stack_map) const { |
David Srbecky | 4b59d10 | 2018-05-29 21:46:10 +0000 | [diff] [blame] | 339 | uint32_t index = stack_map.GetRegisterMaskIndex(); |
| 340 | return (index == StackMap::kNoValue) ? 0 : RegisterMask(®ister_masks_, index).GetMask(); |
Nicolas Geoffray | 3946844 | 2014-09-02 15:17:15 +0100 | [diff] [blame] | 341 | } |
| 342 | |
David Srbecky | 052f8ca | 2018-04-26 15:42:54 +0100 | [diff] [blame] | 343 | uint32_t GetNumberOfLocationCatalogEntries() const { |
David Srbecky | 71ec1cc | 2018-05-18 15:57:25 +0100 | [diff] [blame] | 344 | return dex_register_catalog_.NumRows(); |
Roland Levillain | a552e1c | 2015-03-26 15:01:03 +0000 | [diff] [blame] | 345 | } |
| 346 | |
David Srbecky | 71ec1cc | 2018-05-18 15:57:25 +0100 | [diff] [blame] | 347 | ALWAYS_INLINE DexRegisterLocation GetDexRegisterCatalogEntry(size_t index) const { |
David Srbecky | 6de8833 | 2018-06-03 12:00:11 +0100 | [diff] [blame^] | 348 | return (index == StackMap::kNoValue) |
| 349 | ? DexRegisterLocation::None() |
| 350 | : DexRegisterInfo(&dex_register_catalog_, index).GetLocation(); |
Nicolas Geoffray | 99ea58c | 2014-07-02 15:08:17 +0100 | [diff] [blame] | 351 | } |
| 352 | |
David Srbecky | 052f8ca | 2018-04-26 15:42:54 +0100 | [diff] [blame] | 353 | uint32_t GetNumberOfStackMaps() const { |
| 354 | return stack_maps_.NumRows(); |
Nicolas Geoffray | 6530baf | 2015-05-26 15:22:58 +0100 | [diff] [blame] | 355 | } |
| 356 | |
David Srbecky | 052f8ca | 2018-04-26 15:42:54 +0100 | [diff] [blame] | 357 | InvokeInfo GetInvokeInfo(size_t index) const { |
| 358 | return InvokeInfo(&invoke_infos_, index); |
Mathieu Chartier | d776ff0 | 2017-01-17 09:32:18 -0800 | [diff] [blame] | 359 | } |
| 360 | |
David Srbecky | 71ec1cc | 2018-05-18 15:57:25 +0100 | [diff] [blame] | 361 | ALWAYS_INLINE DexRegisterMap GetDexRegisterMapOf(StackMap stack_map, |
David Srbecky | 6de8833 | 2018-06-03 12:00:11 +0100 | [diff] [blame^] | 362 | size_t vregs ATTRIBUTE_UNUSED = 0) const { |
| 363 | if (stack_map.HasDexRegisterMap()) { |
| 364 | DexRegisterMap map(number_of_dex_registers_, DexRegisterLocation::Invalid()); |
| 365 | DecodeDexRegisterMap(stack_map.Row(), /* first_dex_register */ 0, &map); |
| 366 | return map; |
| 367 | } |
| 368 | return DexRegisterMap(0, DexRegisterLocation::None()); |
Nicolas Geoffray | 99ea58c | 2014-07-02 15:08:17 +0100 | [diff] [blame] | 369 | } |
| 370 | |
David Srbecky | 71ec1cc | 2018-05-18 15:57:25 +0100 | [diff] [blame] | 371 | ALWAYS_INLINE DexRegisterMap GetDexRegisterMapAtDepth(uint8_t depth, |
David Srbecky | 6e69e52 | 2018-06-03 12:00:14 +0100 | [diff] [blame] | 372 | StackMap stack_map, |
David Srbecky | 6de8833 | 2018-06-03 12:00:11 +0100 | [diff] [blame^] | 373 | size_t vregs ATTRIBUTE_UNUSED = 0) const { |
| 374 | if (stack_map.HasDexRegisterMap()) { |
| 375 | // The register counts are commutative and include all outer levels. |
| 376 | // This allows us to determine the range [first, last) in just two lookups. |
| 377 | // If we are at depth 0 (the first inlinee), the count from the main method is used. |
| 378 | uint32_t first = (depth == 0) ? number_of_dex_registers_ |
| 379 | : GetInlineInfoAtDepth(stack_map, depth - 1).GetNumberOfDexRegisters(); |
| 380 | uint32_t last = GetInlineInfoAtDepth(stack_map, depth).GetNumberOfDexRegisters(); |
| 381 | DexRegisterMap map(last - first, DexRegisterLocation::Invalid()); |
| 382 | DecodeDexRegisterMap(stack_map.Row(), first, &map); |
| 383 | return map; |
| 384 | } |
| 385 | return DexRegisterMap(0, DexRegisterLocation::None()); |
Nicolas Geoffray | b1d0f3f | 2015-05-14 12:41:51 +0100 | [diff] [blame] | 386 | } |
| 387 | |
David Srbecky | 052f8ca | 2018-04-26 15:42:54 +0100 | [diff] [blame] | 388 | InlineInfo GetInlineInfo(size_t index) const { |
| 389 | return InlineInfo(&inline_infos_, index); |
Mathieu Chartier | 575d3e6 | 2017-02-06 11:00:40 -0800 | [diff] [blame] | 390 | } |
| 391 | |
David Srbecky | 6e69e52 | 2018-06-03 12:00:14 +0100 | [diff] [blame] | 392 | uint32_t GetInlineDepthOf(StackMap stack_map) const { |
| 393 | uint32_t depth = 0; |
David Srbecky | 052f8ca | 2018-04-26 15:42:54 +0100 | [diff] [blame] | 394 | uint32_t index = stack_map.GetInlineInfoIndex(); |
David Srbecky | 6e69e52 | 2018-06-03 12:00:14 +0100 | [diff] [blame] | 395 | if (index != StackMap::kNoValue) { |
| 396 | while (GetInlineInfo(index + depth++).GetIsLast() == InlineInfo::kMore) { } |
| 397 | } |
| 398 | return depth; |
| 399 | } |
| 400 | |
| 401 | InlineInfo GetInlineInfoAtDepth(StackMap stack_map, uint32_t depth) const { |
| 402 | DCHECK(stack_map.HasInlineInfo()); |
| 403 | DCHECK_LT(depth, GetInlineDepthOf(stack_map)); |
| 404 | return GetInlineInfo(stack_map.GetInlineInfoIndex() + depth); |
Nicolas Geoffray | 99ea58c | 2014-07-02 15:08:17 +0100 | [diff] [blame] | 405 | } |
| 406 | |
David Srbecky | 052f8ca | 2018-04-26 15:42:54 +0100 | [diff] [blame] | 407 | StackMap GetStackMapForDexPc(uint32_t dex_pc) const { |
| 408 | for (size_t i = 0, e = GetNumberOfStackMaps(); i < e; ++i) { |
| 409 | StackMap stack_map = GetStackMapAt(i); |
| 410 | if (stack_map.GetDexPc() == dex_pc) { |
Nicolas Geoffray | 99ea58c | 2014-07-02 15:08:17 +0100 | [diff] [blame] | 411 | return stack_map; |
| 412 | } |
| 413 | } |
Nicolas Geoffray | e12997f | 2015-05-22 14:01:33 +0100 | [diff] [blame] | 414 | return StackMap(); |
Nicolas Geoffray | 99ea58c | 2014-07-02 15:08:17 +0100 | [diff] [blame] | 415 | } |
| 416 | |
David Brazdil | 77a48ae | 2015-09-15 12:34:04 +0000 | [diff] [blame] | 417 | // Searches the stack map list backwards because catch stack maps are stored |
| 418 | // at the end. |
David Srbecky | 052f8ca | 2018-04-26 15:42:54 +0100 | [diff] [blame] | 419 | StackMap GetCatchStackMapForDexPc(uint32_t dex_pc) const { |
| 420 | for (size_t i = GetNumberOfStackMaps(); i > 0; --i) { |
| 421 | StackMap stack_map = GetStackMapAt(i - 1); |
| 422 | if (stack_map.GetDexPc() == dex_pc) { |
David Brazdil | 77a48ae | 2015-09-15 12:34:04 +0000 | [diff] [blame] | 423 | return stack_map; |
| 424 | } |
| 425 | } |
| 426 | return StackMap(); |
| 427 | } |
| 428 | |
David Srbecky | 052f8ca | 2018-04-26 15:42:54 +0100 | [diff] [blame] | 429 | StackMap GetOsrStackMapForDexPc(uint32_t dex_pc) const { |
| 430 | size_t e = GetNumberOfStackMaps(); |
Nicolas Geoffray | b331feb | 2016-02-05 16:51:53 +0000 | [diff] [blame] | 431 | if (e == 0) { |
| 432 | // There cannot be OSR stack map if there is no stack map. |
| 433 | return StackMap(); |
| 434 | } |
| 435 | // Walk over all stack maps. If two consecutive stack maps are identical, then we |
| 436 | // have found a stack map suitable for OSR. |
| 437 | for (size_t i = 0; i < e - 1; ++i) { |
David Srbecky | 052f8ca | 2018-04-26 15:42:54 +0100 | [diff] [blame] | 438 | StackMap stack_map = GetStackMapAt(i); |
| 439 | if (stack_map.GetDexPc() == dex_pc) { |
| 440 | StackMap other = GetStackMapAt(i + 1); |
| 441 | if (other.GetDexPc() == dex_pc && |
| 442 | other.GetNativePcOffset(kRuntimeISA) == |
| 443 | stack_map.GetNativePcOffset(kRuntimeISA)) { |
Nicolas Geoffray | b331feb | 2016-02-05 16:51:53 +0000 | [diff] [blame] | 444 | if (i < e - 2) { |
| 445 | // Make sure there are not three identical stack maps following each other. |
Mathieu Chartier | a2f526f | 2017-01-19 14:48:48 -0800 | [diff] [blame] | 446 | DCHECK_NE( |
David Srbecky | 052f8ca | 2018-04-26 15:42:54 +0100 | [diff] [blame] | 447 | stack_map.GetNativePcOffset(kRuntimeISA), |
| 448 | GetStackMapAt(i + 2).GetNativePcOffset(kRuntimeISA)); |
Nicolas Geoffray | b331feb | 2016-02-05 16:51:53 +0000 | [diff] [blame] | 449 | } |
| 450 | return stack_map; |
| 451 | } |
| 452 | } |
| 453 | } |
| 454 | return StackMap(); |
| 455 | } |
| 456 | |
David Srbecky | 052f8ca | 2018-04-26 15:42:54 +0100 | [diff] [blame] | 457 | StackMap GetStackMapForNativePcOffset(uint32_t native_pc_offset) const { |
David Brazdil | 77a48ae | 2015-09-15 12:34:04 +0000 | [diff] [blame] | 458 | // TODO: Safepoint stack maps are sorted by native_pc_offset but catch stack |
| 459 | // maps are not. If we knew that the method does not have try/catch, |
| 460 | // we could do binary search. |
David Srbecky | 052f8ca | 2018-04-26 15:42:54 +0100 | [diff] [blame] | 461 | for (size_t i = 0, e = GetNumberOfStackMaps(); i < e; ++i) { |
| 462 | StackMap stack_map = GetStackMapAt(i); |
| 463 | if (stack_map.GetNativePcOffset(kRuntimeISA) == native_pc_offset) { |
Nicolas Geoffray | 99ea58c | 2014-07-02 15:08:17 +0100 | [diff] [blame] | 464 | return stack_map; |
| 465 | } |
| 466 | } |
Nicolas Geoffray | e12997f | 2015-05-22 14:01:33 +0100 | [diff] [blame] | 467 | return StackMap(); |
Nicolas Geoffray | 99ea58c | 2014-07-02 15:08:17 +0100 | [diff] [blame] | 468 | } |
| 469 | |
David Srbecky | 052f8ca | 2018-04-26 15:42:54 +0100 | [diff] [blame] | 470 | InvokeInfo GetInvokeInfoForNativePcOffset(uint32_t native_pc_offset) { |
| 471 | for (size_t index = 0; index < invoke_infos_.NumRows(); index++) { |
| 472 | InvokeInfo item = GetInvokeInfo(index); |
| 473 | if (item.GetNativePcOffset(kRuntimeISA) == native_pc_offset) { |
Mathieu Chartier | d776ff0 | 2017-01-17 09:32:18 -0800 | [diff] [blame] | 474 | return item; |
| 475 | } |
| 476 | } |
David Srbecky | d97e082 | 2018-06-03 12:00:24 +0100 | [diff] [blame] | 477 | return InvokeInfo(); |
Mathieu Chartier | d776ff0 | 2017-01-17 09:32:18 -0800 | [diff] [blame] | 478 | } |
| 479 | |
David Srbecky | 71ec1cc | 2018-05-18 15:57:25 +0100 | [diff] [blame] | 480 | // Dump this CodeInfo object on `vios`. |
| 481 | // `code_offset` is the (absolute) native PC of the compiled method. |
Vladimir Marko | 8f1e08a | 2015-06-26 12:06:30 +0100 | [diff] [blame] | 482 | void Dump(VariableIndentationOutputStream* vios, |
Roland Levillain | f2650d1 | 2015-05-28 14:53:28 +0100 | [diff] [blame] | 483 | uint32_t code_offset, |
| 484 | uint16_t number_of_dex_registers, |
David Srbecky | 71ec1cc | 2018-05-18 15:57:25 +0100 | [diff] [blame] | 485 | bool verbose, |
Mathieu Chartier | cbcedbf | 2017-03-12 22:24:50 -0700 | [diff] [blame] | 486 | InstructionSet instruction_set, |
| 487 | const MethodInfo& method_info) const; |
Nicolas Geoffray | 004c230 | 2015-03-20 10:06:38 +0000 | [diff] [blame] | 488 | |
Nicolas Geoffray | 99ea58c | 2014-07-02 15:08:17 +0100 | [diff] [blame] | 489 | private: |
David Srbecky | 6de8833 | 2018-06-03 12:00:11 +0100 | [diff] [blame^] | 490 | // Scan backward to determine dex register locations at given stack map. |
| 491 | void DecodeDexRegisterMap(uint32_t stack_map_index, |
| 492 | uint32_t first_dex_register, |
| 493 | /*out*/ DexRegisterMap* map) const; |
Roland Levillain | a2d8ec6 | 2015-03-12 15:25:29 +0000 | [diff] [blame] | 494 | |
David Srbecky | 052f8ca | 2018-04-26 15:42:54 +0100 | [diff] [blame] | 495 | void Decode(const uint8_t* data) { |
| 496 | size_t non_header_size = DecodeUnsignedLeb128(&data); |
David Srbecky | 71ec1cc | 2018-05-18 15:57:25 +0100 | [diff] [blame] | 497 | BitMemoryRegion region(MemoryRegion(const_cast<uint8_t*>(data), non_header_size)); |
David Srbecky | 052f8ca | 2018-04-26 15:42:54 +0100 | [diff] [blame] | 498 | size_t bit_offset = 0; |
| 499 | size_ = UnsignedLeb128Size(non_header_size) + non_header_size; |
David Srbecky | 71ec1cc | 2018-05-18 15:57:25 +0100 | [diff] [blame] | 500 | stack_maps_.Decode(region, &bit_offset); |
| 501 | register_masks_.Decode(region, &bit_offset); |
| 502 | stack_masks_.Decode(region, &bit_offset); |
| 503 | invoke_infos_.Decode(region, &bit_offset); |
| 504 | inline_infos_.Decode(region, &bit_offset); |
| 505 | dex_register_masks_.Decode(region, &bit_offset); |
| 506 | dex_register_maps_.Decode(region, &bit_offset); |
| 507 | dex_register_catalog_.Decode(region, &bit_offset); |
David Srbecky | 6de8833 | 2018-06-03 12:00:11 +0100 | [diff] [blame^] | 508 | number_of_dex_registers_ = DecodeVarintBits(region, &bit_offset); |
David Srbecky | 71ec1cc | 2018-05-18 15:57:25 +0100 | [diff] [blame] | 509 | CHECK_EQ(non_header_size, BitsToBytesRoundUp(bit_offset)) << "Invalid CodeInfo"; |
David Srbecky | 052f8ca | 2018-04-26 15:42:54 +0100 | [diff] [blame] | 510 | } |
| 511 | |
| 512 | size_t size_; |
David Srbecky | d97e082 | 2018-06-03 12:00:24 +0100 | [diff] [blame] | 513 | BitTable<StackMap::kCount> stack_maps_; |
| 514 | BitTable<RegisterMask::kCount> register_masks_; |
David Srbecky | 4b59d10 | 2018-05-29 21:46:10 +0000 | [diff] [blame] | 515 | BitTable<1> stack_masks_; |
David Srbecky | d97e082 | 2018-06-03 12:00:24 +0100 | [diff] [blame] | 516 | BitTable<InvokeInfo::kCount> invoke_infos_; |
| 517 | BitTable<InlineInfo::kCount> inline_infos_; |
David Srbecky | 71ec1cc | 2018-05-18 15:57:25 +0100 | [diff] [blame] | 518 | BitTable<1> dex_register_masks_; |
| 519 | BitTable<1> dex_register_maps_; |
David Srbecky | d97e082 | 2018-06-03 12:00:24 +0100 | [diff] [blame] | 520 | BitTable<DexRegisterInfo::kCount> dex_register_catalog_; |
David Srbecky | 6de8833 | 2018-06-03 12:00:11 +0100 | [diff] [blame^] | 521 | uint32_t number_of_dex_registers_; // Excludes any inlined methods. |
David Srbecky | 052f8ca | 2018-04-26 15:42:54 +0100 | [diff] [blame] | 522 | |
| 523 | friend class OatDumper; |
Nicolas Geoffray | 99ea58c | 2014-07-02 15:08:17 +0100 | [diff] [blame] | 524 | }; |
| 525 | |
Roland Levillain | 1c1da43 | 2015-07-16 11:54:44 +0100 | [diff] [blame] | 526 | #undef ELEMENT_BYTE_OFFSET_AFTER |
| 527 | #undef ELEMENT_BIT_OFFSET_AFTER |
| 528 | |
Nicolas Geoffray | 99ea58c | 2014-07-02 15:08:17 +0100 | [diff] [blame] | 529 | } // namespace art |
| 530 | |
| 531 | #endif // ART_RUNTIME_STACK_MAP_H_ |