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