blob: 10f5cab90730b5bf7691c42aa5d62004de302d8f [file] [log] [blame]
Calin Juravlec416d332015-04-23 16:01:43 +01001/*
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 */
Nicolas Geoffray5d37c152017-01-12 13:25:19 +000016
Calin Juravlec416d332015-04-23 16:01:43 +010017#include "stack_map_stream.h"
18
David Srbecky45aa5982016-03-18 02:15:09 +000019#include <unordered_map>
20
Andreas Gampe90b936d2017-01-31 08:58:55 -080021#include "art_method-inl.h"
David Srbecky45aa5982016-03-18 02:15:09 +000022#include "base/stl_util.h"
Nicolas Geoffrayfbdfa6d2017-02-03 10:43:13 +000023#include "optimizing/optimizing_compiler.h"
Nicolas Geoffray5d37c152017-01-12 13:25:19 +000024#include "runtime.h"
25#include "scoped_thread_state_change-inl.h"
26
Calin Juravlec416d332015-04-23 16:01:43 +010027namespace art {
28
Calin Juravle4f46ac52015-04-23 18:47:21 +010029void StackMapStream::BeginStackMapEntry(uint32_t dex_pc,
30 uint32_t native_pc_offset,
31 uint32_t register_mask,
32 BitVector* sp_mask,
33 uint32_t num_dex_registers,
34 uint8_t inlining_depth) {
35 DCHECK_EQ(0u, current_entry_.dex_pc) << "EndStackMapEntry not called after BeginStackMapEntry";
Calin Juravleb5c46932015-10-06 17:09:49 +010036 DCHECK_NE(dex_pc, static_cast<uint32_t>(-1)) << "invalid dex_pc";
Calin Juravle4f46ac52015-04-23 18:47:21 +010037 current_entry_.dex_pc = dex_pc;
Mathieu Chartiera2f526f2017-01-19 14:48:48 -080038 current_entry_.native_pc_code_offset = CodeOffset::FromOffset(native_pc_offset, instruction_set_);
Calin Juravle4f46ac52015-04-23 18:47:21 +010039 current_entry_.register_mask = register_mask;
40 current_entry_.sp_mask = sp_mask;
41 current_entry_.num_dex_registers = num_dex_registers;
42 current_entry_.inlining_depth = inlining_depth;
Vladimir Marko225b6462015-09-28 12:17:40 +010043 current_entry_.dex_register_locations_start_index = dex_register_locations_.size();
44 current_entry_.inline_infos_start_index = inline_infos_.size();
Calin Juravle4f46ac52015-04-23 18:47:21 +010045 current_entry_.dex_register_map_hash = 0;
46 current_entry_.same_dex_register_map_as_ = kNoSameDexMapFound;
David Srbecky45aa5982016-03-18 02:15:09 +000047 current_entry_.stack_mask_index = 0;
Calin Juravlec416d332015-04-23 16:01:43 +010048 if (num_dex_registers != 0) {
Calin Juravle4f46ac52015-04-23 18:47:21 +010049 current_entry_.live_dex_registers_mask =
Vladimir Markof6a35de2016-03-21 12:01:50 +000050 ArenaBitVector::Create(allocator_, num_dex_registers, true, kArenaAllocStackMapStream);
Calin Juravlec416d332015-04-23 16:01:43 +010051 } else {
Calin Juravle4f46ac52015-04-23 18:47:21 +010052 current_entry_.live_dex_registers_mask = nullptr;
Calin Juravlec416d332015-04-23 16:01:43 +010053 }
Calin Juravlec416d332015-04-23 16:01:43 +010054
55 if (sp_mask != nullptr) {
56 stack_mask_max_ = std::max(stack_mask_max_, sp_mask->GetHighestBitSet());
57 }
58 if (inlining_depth > 0) {
59 number_of_stack_maps_with_inline_info_++;
60 }
61
62 dex_pc_max_ = std::max(dex_pc_max_, dex_pc);
Calin Juravlec416d332015-04-23 16:01:43 +010063 register_mask_max_ = std::max(register_mask_max_, register_mask);
Nicolas Geoffrayb1d0f3f2015-05-14 12:41:51 +010064 current_dex_register_ = 0;
Calin Juravlec416d332015-04-23 16:01:43 +010065}
66
Calin Juravle4f46ac52015-04-23 18:47:21 +010067void StackMapStream::EndStackMapEntry() {
68 current_entry_.same_dex_register_map_as_ = FindEntryWithTheSameDexMap();
Vladimir Marko225b6462015-09-28 12:17:40 +010069 stack_maps_.push_back(current_entry_);
Calin Juravle4f46ac52015-04-23 18:47:21 +010070 current_entry_ = StackMapEntry();
71}
72
Nicolas Geoffrayb1d0f3f2015-05-14 12:41:51 +010073void StackMapStream::AddDexRegisterEntry(DexRegisterLocation::Kind kind, int32_t value) {
Calin Juravlec416d332015-04-23 16:01:43 +010074 if (kind != DexRegisterLocation::Kind::kNone) {
75 // Ensure we only use non-compressed location kind at this stage.
David Srbecky7dc11782016-02-25 13:23:56 +000076 DCHECK(DexRegisterLocation::IsShortLocationKind(kind)) << kind;
Calin Juravlec416d332015-04-23 16:01:43 +010077 DexRegisterLocation location(kind, value);
78
79 // Look for Dex register `location` in the location catalog (using the
80 // companion hash map of locations to indices). Use its index if it
81 // is already in the location catalog. If not, insert it (in the
82 // location catalog and the hash map) and use the newly created index.
83 auto it = location_catalog_entries_indices_.Find(location);
84 if (it != location_catalog_entries_indices_.end()) {
85 // Retrieve the index from the hash map.
Vladimir Marko225b6462015-09-28 12:17:40 +010086 dex_register_locations_.push_back(it->second);
Calin Juravlec416d332015-04-23 16:01:43 +010087 } else {
88 // Create a new entry in the location catalog and the hash map.
Vladimir Marko225b6462015-09-28 12:17:40 +010089 size_t index = location_catalog_entries_.size();
90 location_catalog_entries_.push_back(location);
91 dex_register_locations_.push_back(index);
Calin Juravlec416d332015-04-23 16:01:43 +010092 location_catalog_entries_indices_.Insert(std::make_pair(location, index));
93 }
94
Nicolas Geoffrayb1d0f3f2015-05-14 12:41:51 +010095 if (in_inline_frame_) {
96 // TODO: Support sharing DexRegisterMap across InlineInfo.
97 DCHECK_LT(current_dex_register_, current_inline_info_.num_dex_registers);
98 current_inline_info_.live_dex_registers_mask->SetBit(current_dex_register_);
99 } else {
100 DCHECK_LT(current_dex_register_, current_entry_.num_dex_registers);
101 current_entry_.live_dex_registers_mask->SetBit(current_dex_register_);
102 current_entry_.dex_register_map_hash += (1 <<
103 (current_dex_register_ % (sizeof(current_entry_.dex_register_map_hash) * kBitsPerByte)));
104 current_entry_.dex_register_map_hash += static_cast<uint32_t>(value);
105 current_entry_.dex_register_map_hash += static_cast<uint32_t>(kind);
106 }
Calin Juravlec416d332015-04-23 16:01:43 +0100107 }
Nicolas Geoffrayb1d0f3f2015-05-14 12:41:51 +0100108 current_dex_register_++;
Calin Juravlec416d332015-04-23 16:01:43 +0100109}
110
Nicolas Geoffray5d37c152017-01-12 13:25:19 +0000111void StackMapStream::BeginInlineInfoEntry(ArtMethod* method,
Nicolas Geoffrayb1d0f3f2015-05-14 12:41:51 +0100112 uint32_t dex_pc,
Nicolas Geoffray5d37c152017-01-12 13:25:19 +0000113 uint32_t num_dex_registers,
114 const DexFile* outer_dex_file) {
Nicolas Geoffrayb1d0f3f2015-05-14 12:41:51 +0100115 DCHECK(!in_inline_frame_);
116 in_inline_frame_ = true;
Nicolas Geoffray5d37c152017-01-12 13:25:19 +0000117 if (EncodeArtMethodInInlineInfo(method)) {
118 current_inline_info_.method = method;
119 } else {
120 if (dex_pc != static_cast<uint32_t>(-1) && kIsDebugBuild) {
121 ScopedObjectAccess soa(Thread::Current());
122 DCHECK(IsSameDexFile(*outer_dex_file, *method->GetDexFile()));
123 }
124 current_inline_info_.method_index = method->GetDexMethodIndexUnchecked();
125 }
Nicolas Geoffrayb1d0f3f2015-05-14 12:41:51 +0100126 current_inline_info_.dex_pc = dex_pc;
127 current_inline_info_.num_dex_registers = num_dex_registers;
Vladimir Marko225b6462015-09-28 12:17:40 +0100128 current_inline_info_.dex_register_locations_start_index = dex_register_locations_.size();
Nicolas Geoffrayb1d0f3f2015-05-14 12:41:51 +0100129 if (num_dex_registers != 0) {
130 current_inline_info_.live_dex_registers_mask =
Vladimir Markof6a35de2016-03-21 12:01:50 +0000131 ArenaBitVector::Create(allocator_, num_dex_registers, true, kArenaAllocStackMapStream);
Nicolas Geoffrayb1d0f3f2015-05-14 12:41:51 +0100132 } else {
133 current_inline_info_.live_dex_registers_mask = nullptr;
134 }
135 current_dex_register_ = 0;
136}
137
138void StackMapStream::EndInlineInfoEntry() {
139 DCHECK(in_inline_frame_);
140 DCHECK_EQ(current_dex_register_, current_inline_info_.num_dex_registers)
141 << "Inline information contains less registers than expected";
142 in_inline_frame_ = false;
Vladimir Marko225b6462015-09-28 12:17:40 +0100143 inline_infos_.push_back(current_inline_info_);
Nicolas Geoffrayb1d0f3f2015-05-14 12:41:51 +0100144 current_inline_info_ = InlineInfoEntry();
Calin Juravlec416d332015-04-23 16:01:43 +0100145}
146
Mathieu Chartiera2f526f2017-01-19 14:48:48 -0800147CodeOffset StackMapStream::ComputeMaxNativePcCodeOffset() const {
148 CodeOffset max_native_pc_offset;
Vladimir Marko225b6462015-09-28 12:17:40 +0100149 for (const StackMapEntry& entry : stack_maps_) {
Mathieu Chartiera2f526f2017-01-19 14:48:48 -0800150 max_native_pc_offset = std::max(max_native_pc_offset, entry.native_pc_code_offset);
Vladimir Markobd8c7252015-06-12 10:06:32 +0100151 }
152 return max_native_pc_offset;
153}
154
Calin Juravle4f46ac52015-04-23 18:47:21 +0100155size_t StackMapStream::PrepareForFillIn() {
Mathieu Chartier1a20b682017-01-31 14:25:16 -0800156 const size_t stack_mask_size_in_bits = stack_mask_max_ + 1; // Need room for max element too.
157 const size_t number_of_stack_masks = PrepareStackMasks(stack_mask_size_in_bits);
158 const size_t register_mask_size_in_bits = MinimumBitsToStore(register_mask_max_);
159 const size_t number_of_register_masks = PrepareRegisterMasks();
Calin Juravle4f46ac52015-04-23 18:47:21 +0100160 dex_register_maps_size_ = ComputeDexRegisterMapsSize();
David Srbecky61b28a12016-02-25 21:55:03 +0000161 ComputeInlineInfoEncoding(); // needs dex_register_maps_size_.
162 inline_info_size_ = inline_infos_.size() * inline_info_encoding_.GetEntrySize();
Mathieu Chartiera2f526f2017-01-19 14:48:48 -0800163 CodeOffset max_native_pc_offset = ComputeMaxNativePcCodeOffset();
David Srbecky45aa5982016-03-18 02:15:09 +0000164 // The stack map contains compressed native PC offsets.
Mathieu Chartier1a20b682017-01-31 14:25:16 -0800165 const size_t stack_map_size = stack_map_encoding_.SetFromSizes(
166 max_native_pc_offset.CompressedValue(),
167 dex_pc_max_,
168 dex_register_maps_size_,
169 inline_info_size_,
170 number_of_register_masks,
171 number_of_stack_masks);
Mathieu Chartier12f1b992017-01-19 18:00:45 -0800172 stack_maps_size_ = RoundUp(stack_maps_.size() * stack_map_size, kBitsPerByte) / kBitsPerByte;
Calin Juravle4f46ac52015-04-23 18:47:21 +0100173 dex_register_location_catalog_size_ = ComputeDexRegisterLocationCatalogSize();
Mathieu Chartier1a20b682017-01-31 14:25:16 -0800174 const size_t stack_masks_bits = number_of_stack_masks * stack_mask_size_in_bits;
175 const size_t register_masks_bits = number_of_register_masks * register_mask_size_in_bits;
176 // Register masks are last, stack masks are right before that last.
177 // They are both bit packed / aligned.
178 const size_t non_header_size =
David Srbecky09ed0982016-02-12 21:58:43 +0000179 stack_maps_size_ +
180 dex_register_location_catalog_size_ +
181 dex_register_maps_size_ +
David Srbecky45aa5982016-03-18 02:15:09 +0000182 inline_info_size_ +
Mathieu Chartier1a20b682017-01-31 14:25:16 -0800183 RoundUp(stack_masks_bits + register_masks_bits, kBitsPerByte) / kBitsPerByte;
Calin Juravlec416d332015-04-23 16:01:43 +0100184
David Srbecky09ed0982016-02-12 21:58:43 +0000185 // Prepare the CodeInfo variable-sized encoding.
186 CodeInfoEncoding code_info_encoding;
187 code_info_encoding.non_header_size = non_header_size;
David Srbecky09ed0982016-02-12 21:58:43 +0000188 code_info_encoding.number_of_stack_maps = stack_maps_.size();
David Srbecky45aa5982016-03-18 02:15:09 +0000189 code_info_encoding.number_of_stack_masks = number_of_stack_masks;
Mathieu Chartier1a20b682017-01-31 14:25:16 -0800190 code_info_encoding.number_of_register_masks = number_of_register_masks;
David Srbecky45aa5982016-03-18 02:15:09 +0000191 code_info_encoding.stack_mask_size_in_bits = stack_mask_size_in_bits;
Mathieu Chartier1a20b682017-01-31 14:25:16 -0800192 code_info_encoding.register_mask_size_in_bits = register_mask_size_in_bits;
David Srbecky61b28a12016-02-25 21:55:03 +0000193 code_info_encoding.stack_map_encoding = stack_map_encoding_;
194 code_info_encoding.inline_info_encoding = inline_info_encoding_;
David Srbecky09ed0982016-02-12 21:58:43 +0000195 code_info_encoding.number_of_location_catalog_entries = location_catalog_entries_.size();
196 code_info_encoding.Compress(&code_info_encoding_);
197
Nicolas Geoffray6530baf2015-05-26 15:22:58 +0100198 // TODO: Move the catalog at the end. It is currently too expensive at runtime
199 // to compute its size (note that we do not encode that size in the CodeInfo).
David Srbecky09ed0982016-02-12 21:58:43 +0000200 dex_register_location_catalog_start_ = code_info_encoding_.size() + stack_maps_size_;
Nicolas Geoffray6530baf2015-05-26 15:22:58 +0100201 dex_register_maps_start_ =
202 dex_register_location_catalog_start_ + dex_register_location_catalog_size_;
Calin Juravle4f46ac52015-04-23 18:47:21 +0100203 inline_infos_start_ = dex_register_maps_start_ + dex_register_maps_size_;
Calin Juravlec416d332015-04-23 16:01:43 +0100204
David Srbecky09ed0982016-02-12 21:58:43 +0000205 needed_size_ = code_info_encoding_.size() + non_header_size;
Calin Juravle4f46ac52015-04-23 18:47:21 +0100206 return needed_size_;
Calin Juravlec416d332015-04-23 16:01:43 +0100207}
208
209size_t StackMapStream::ComputeDexRegisterLocationCatalogSize() const {
210 size_t size = DexRegisterLocationCatalog::kFixedSize;
Vladimir Marko225b6462015-09-28 12:17:40 +0100211 for (const DexRegisterLocation& dex_register_location : location_catalog_entries_) {
Calin Juravlec416d332015-04-23 16:01:43 +0100212 size += DexRegisterLocationCatalog::EntrySize(dex_register_location);
213 }
214 return size;
215}
216
Nicolas Geoffrayb1d0f3f2015-05-14 12:41:51 +0100217size_t StackMapStream::ComputeDexRegisterMapSize(uint32_t num_dex_registers,
Vladimir Marko225b6462015-09-28 12:17:40 +0100218 const BitVector* live_dex_registers_mask) const {
219 // For num_dex_registers == 0u live_dex_registers_mask may be null.
220 if (num_dex_registers == 0u) {
221 return 0u; // No register map will be emitted.
222 }
223 DCHECK(live_dex_registers_mask != nullptr);
224
Calin Juravlec416d332015-04-23 16:01:43 +0100225 // Size of the map in bytes.
226 size_t size = DexRegisterMap::kFixedSize;
227 // Add the live bit mask for the Dex register liveness.
Nicolas Geoffrayb1d0f3f2015-05-14 12:41:51 +0100228 size += DexRegisterMap::GetLiveBitMaskSize(num_dex_registers);
Calin Juravlec416d332015-04-23 16:01:43 +0100229 // Compute the size of the set of live Dex register entries.
Vladimir Marko225b6462015-09-28 12:17:40 +0100230 size_t number_of_live_dex_registers = live_dex_registers_mask->NumSetBits();
Calin Juravlec416d332015-04-23 16:01:43 +0100231 size_t map_entries_size_in_bits =
Vladimir Marko225b6462015-09-28 12:17:40 +0100232 DexRegisterMap::SingleEntrySizeInBits(location_catalog_entries_.size())
Calin Juravlec416d332015-04-23 16:01:43 +0100233 * number_of_live_dex_registers;
234 size_t map_entries_size_in_bytes =
235 RoundUp(map_entries_size_in_bits, kBitsPerByte) / kBitsPerByte;
236 size += map_entries_size_in_bytes;
237 return size;
238}
239
Calin Juravle4f46ac52015-04-23 18:47:21 +0100240size_t StackMapStream::ComputeDexRegisterMapsSize() const {
Calin Juravlec416d332015-04-23 16:01:43 +0100241 size_t size = 0;
Nicolas Geoffrayb1d0f3f2015-05-14 12:41:51 +0100242 size_t inline_info_index = 0;
Vladimir Marko225b6462015-09-28 12:17:40 +0100243 for (const StackMapEntry& entry : stack_maps_) {
Calin Juravle4f46ac52015-04-23 18:47:21 +0100244 if (entry.same_dex_register_map_as_ == kNoSameDexMapFound) {
Vladimir Marko225b6462015-09-28 12:17:40 +0100245 size += ComputeDexRegisterMapSize(entry.num_dex_registers, entry.live_dex_registers_mask);
Nicolas Geoffrayb1d0f3f2015-05-14 12:41:51 +0100246 } else {
Calin Juravlec416d332015-04-23 16:01:43 +0100247 // Entries with the same dex map will have the same offset.
Nicolas Geoffrayb1d0f3f2015-05-14 12:41:51 +0100248 }
249 for (size_t j = 0; j < entry.inlining_depth; ++j) {
Vladimir Marko225b6462015-09-28 12:17:40 +0100250 InlineInfoEntry inline_entry = inline_infos_[inline_info_index++];
Nicolas Geoffrayb1d0f3f2015-05-14 12:41:51 +0100251 size += ComputeDexRegisterMapSize(inline_entry.num_dex_registers,
Vladimir Marko225b6462015-09-28 12:17:40 +0100252 inline_entry.live_dex_registers_mask);
Calin Juravlec416d332015-04-23 16:01:43 +0100253 }
254 }
255 return size;
256}
257
David Srbecky61b28a12016-02-25 21:55:03 +0000258void StackMapStream::ComputeInlineInfoEncoding() {
259 uint32_t method_index_max = 0;
Vladimir Marko87f3fcb2016-04-28 15:52:11 +0100260 uint32_t dex_pc_max = DexFile::kDexNoIndex;
Nicolas Geoffray5d37c152017-01-12 13:25:19 +0000261 uint32_t extra_data_max = 0;
David Srbecky61b28a12016-02-25 21:55:03 +0000262
263 uint32_t inline_info_index = 0;
264 for (const StackMapEntry& entry : stack_maps_) {
265 for (size_t j = 0; j < entry.inlining_depth; ++j) {
266 InlineInfoEntry inline_entry = inline_infos_[inline_info_index++];
Nicolas Geoffray5d37c152017-01-12 13:25:19 +0000267 if (inline_entry.method == nullptr) {
268 method_index_max = std::max(method_index_max, inline_entry.method_index);
269 extra_data_max = std::max(extra_data_max, 1u);
270 } else {
271 method_index_max = std::max(
272 method_index_max, High32Bits(reinterpret_cast<uintptr_t>(inline_entry.method)));
273 extra_data_max = std::max(
274 extra_data_max, Low32Bits(reinterpret_cast<uintptr_t>(inline_entry.method)));
275 }
Vladimir Marko87f3fcb2016-04-28 15:52:11 +0100276 if (inline_entry.dex_pc != DexFile::kDexNoIndex &&
277 (dex_pc_max == DexFile::kDexNoIndex || dex_pc_max < inline_entry.dex_pc)) {
278 dex_pc_max = inline_entry.dex_pc;
279 }
David Srbecky61b28a12016-02-25 21:55:03 +0000280 }
281 }
282 DCHECK_EQ(inline_info_index, inline_infos_.size());
283
284 inline_info_encoding_.SetFromSizes(method_index_max,
285 dex_pc_max,
Nicolas Geoffray5d37c152017-01-12 13:25:19 +0000286 extra_data_max,
David Srbecky61b28a12016-02-25 21:55:03 +0000287 dex_register_maps_size_);
Calin Juravlec416d332015-04-23 16:01:43 +0100288}
289
Calin Juravlec416d332015-04-23 16:01:43 +0100290void StackMapStream::FillIn(MemoryRegion region) {
Calin Juravle4f46ac52015-04-23 18:47:21 +0100291 DCHECK_EQ(0u, current_entry_.dex_pc) << "EndStackMapEntry not called after BeginStackMapEntry";
292 DCHECK_NE(0u, needed_size_) << "PrepareForFillIn not called before FillIn";
293
Calin Juravle4f46ac52015-04-23 18:47:21 +0100294 DCHECK_EQ(region.size(), needed_size_);
David Srbecky09ed0982016-02-12 21:58:43 +0000295
296 // Note that the memory region does not have to be zeroed when we JIT code
297 // because we do not use the arena allocator there.
298
299 // Write the CodeInfo header.
300 region.CopyFrom(0, MemoryRegion(code_info_encoding_.data(), code_info_encoding_.size()));
Calin Juravlec416d332015-04-23 16:01:43 +0100301
Calin Juravlec416d332015-04-23 16:01:43 +0100302 MemoryRegion dex_register_locations_region = region.Subregion(
Calin Juravle4f46ac52015-04-23 18:47:21 +0100303 dex_register_maps_start_, dex_register_maps_size_);
Calin Juravlec416d332015-04-23 16:01:43 +0100304
305 MemoryRegion inline_infos_region = region.Subregion(
Calin Juravle4f46ac52015-04-23 18:47:21 +0100306 inline_infos_start_, inline_info_size_);
Calin Juravlec416d332015-04-23 16:01:43 +0100307
David Srbecky09ed0982016-02-12 21:58:43 +0000308 CodeInfo code_info(region);
309 CodeInfoEncoding encoding = code_info.ExtractEncoding();
310 DCHECK_EQ(code_info.GetStackMapsSize(encoding), stack_maps_size_);
Calin Juravlec416d332015-04-23 16:01:43 +0100311
312 // Set the Dex register location catalog.
Calin Juravlec416d332015-04-23 16:01:43 +0100313 MemoryRegion dex_register_location_catalog_region = region.Subregion(
Calin Juravle4f46ac52015-04-23 18:47:21 +0100314 dex_register_location_catalog_start_, dex_register_location_catalog_size_);
Calin Juravlec416d332015-04-23 16:01:43 +0100315 DexRegisterLocationCatalog dex_register_location_catalog(dex_register_location_catalog_region);
316 // Offset in `dex_register_location_catalog` where to store the next
317 // register location.
318 size_t location_catalog_offset = DexRegisterLocationCatalog::kFixedSize;
Vladimir Marko225b6462015-09-28 12:17:40 +0100319 for (DexRegisterLocation dex_register_location : location_catalog_entries_) {
Calin Juravlec416d332015-04-23 16:01:43 +0100320 dex_register_location_catalog.SetRegisterInfo(location_catalog_offset, dex_register_location);
321 location_catalog_offset += DexRegisterLocationCatalog::EntrySize(dex_register_location);
322 }
323 // Ensure we reached the end of the Dex registers location_catalog.
324 DCHECK_EQ(location_catalog_offset, dex_register_location_catalog_region.size());
325
Vladimir Markof6a35de2016-03-21 12:01:50 +0000326 ArenaBitVector empty_bitmask(allocator_, 0, /* expandable */ false, kArenaAllocStackMapStream);
Calin Juravlec416d332015-04-23 16:01:43 +0100327 uintptr_t next_dex_register_map_offset = 0;
328 uintptr_t next_inline_info_offset = 0;
Vladimir Marko225b6462015-09-28 12:17:40 +0100329 for (size_t i = 0, e = stack_maps_.size(); i < e; ++i) {
David Srbecky09ed0982016-02-12 21:58:43 +0000330 StackMap stack_map = code_info.GetStackMapAt(i, encoding);
Vladimir Marko225b6462015-09-28 12:17:40 +0100331 StackMapEntry entry = stack_maps_[i];
Calin Juravlec416d332015-04-23 16:01:43 +0100332
David Brazdilf677ebf2015-05-29 16:29:43 +0100333 stack_map.SetDexPc(stack_map_encoding_, entry.dex_pc);
Mathieu Chartiera2f526f2017-01-19 14:48:48 -0800334 stack_map.SetNativePcCodeOffset(stack_map_encoding_, entry.native_pc_code_offset);
Mathieu Chartier1a20b682017-01-31 14:25:16 -0800335 stack_map.SetRegisterMaskIndex(stack_map_encoding_, entry.register_mask_index);
David Srbecky45aa5982016-03-18 02:15:09 +0000336 stack_map.SetStackMaskIndex(stack_map_encoding_, entry.stack_mask_index);
Calin Juravlec416d332015-04-23 16:01:43 +0100337
Nicolas Geoffray012fc4e2016-01-08 15:58:19 +0000338 if (entry.num_dex_registers == 0 || (entry.live_dex_registers_mask->NumSetBits() == 0)) {
Calin Juravlec416d332015-04-23 16:01:43 +0100339 // No dex map available.
David Brazdilf677ebf2015-05-29 16:29:43 +0100340 stack_map.SetDexRegisterMapOffset(stack_map_encoding_, StackMap::kNoDexRegisterMap);
Calin Juravlec416d332015-04-23 16:01:43 +0100341 } else {
342 // Search for an entry with the same dex map.
Calin Juravle4f46ac52015-04-23 18:47:21 +0100343 if (entry.same_dex_register_map_as_ != kNoSameDexMapFound) {
Calin Juravlec416d332015-04-23 16:01:43 +0100344 // If we have a hit reuse the offset.
David Brazdilf677ebf2015-05-29 16:29:43 +0100345 stack_map.SetDexRegisterMapOffset(
346 stack_map_encoding_,
David Srbecky09ed0982016-02-12 21:58:43 +0000347 code_info.GetStackMapAt(entry.same_dex_register_map_as_, encoding)
David Brazdil77a48ae2015-09-15 12:34:04 +0000348 .GetDexRegisterMapOffset(stack_map_encoding_));
Calin Juravlec416d332015-04-23 16:01:43 +0100349 } else {
350 // New dex registers maps should be added to the stack map.
Nicolas Geoffrayb1d0f3f2015-05-14 12:41:51 +0100351 MemoryRegion register_region = dex_register_locations_region.Subregion(
352 next_dex_register_map_offset,
Vladimir Marko225b6462015-09-28 12:17:40 +0100353 ComputeDexRegisterMapSize(entry.num_dex_registers, entry.live_dex_registers_mask));
Calin Juravlec416d332015-04-23 16:01:43 +0100354 next_dex_register_map_offset += register_region.size();
355 DexRegisterMap dex_register_map(register_region);
356 stack_map.SetDexRegisterMapOffset(
David Srbecky45aa5982016-03-18 02:15:09 +0000357 stack_map_encoding_, register_region.begin() - dex_register_locations_region.begin());
Calin Juravlec416d332015-04-23 16:01:43 +0100358
Nicolas Geoffrayb1d0f3f2015-05-14 12:41:51 +0100359 // Set the dex register location.
360 FillInDexRegisterMap(dex_register_map,
361 entry.num_dex_registers,
362 *entry.live_dex_registers_mask,
363 entry.dex_register_locations_start_index);
Calin Juravlec416d332015-04-23 16:01:43 +0100364 }
365 }
366
367 // Set the inlining info.
368 if (entry.inlining_depth != 0) {
369 MemoryRegion inline_region = inline_infos_region.Subregion(
370 next_inline_info_offset,
David Srbecky61b28a12016-02-25 21:55:03 +0000371 entry.inlining_depth * inline_info_encoding_.GetEntrySize());
Calin Juravlec416d332015-04-23 16:01:43 +0100372 next_inline_info_offset += inline_region.size();
373 InlineInfo inline_info(inline_region);
374
375 // Currently relative to the dex register map.
376 stack_map.SetInlineDescriptorOffset(
David Srbecky45aa5982016-03-18 02:15:09 +0000377 stack_map_encoding_, inline_region.begin() - dex_register_locations_region.begin());
Calin Juravlec416d332015-04-23 16:01:43 +0100378
David Srbecky61b28a12016-02-25 21:55:03 +0000379 inline_info.SetDepth(inline_info_encoding_, entry.inlining_depth);
Vladimir Marko225b6462015-09-28 12:17:40 +0100380 DCHECK_LE(entry.inline_infos_start_index + entry.inlining_depth, inline_infos_.size());
Nicolas Geoffrayb1d0f3f2015-05-14 12:41:51 +0100381 for (size_t depth = 0; depth < entry.inlining_depth; ++depth) {
Vladimir Marko225b6462015-09-28 12:17:40 +0100382 InlineInfoEntry inline_entry = inline_infos_[depth + entry.inline_infos_start_index];
Nicolas Geoffray5d37c152017-01-12 13:25:19 +0000383 if (inline_entry.method != nullptr) {
384 inline_info.SetMethodIndexAtDepth(
385 inline_info_encoding_,
386 depth,
387 High32Bits(reinterpret_cast<uintptr_t>(inline_entry.method)));
388 inline_info.SetExtraDataAtDepth(
389 inline_info_encoding_,
390 depth,
391 Low32Bits(reinterpret_cast<uintptr_t>(inline_entry.method)));
392 } else {
393 inline_info.SetMethodIndexAtDepth(inline_info_encoding_, depth, inline_entry.method_index);
394 inline_info.SetExtraDataAtDepth(inline_info_encoding_, depth, 1);
395 }
David Srbecky61b28a12016-02-25 21:55:03 +0000396 inline_info.SetDexPcAtDepth(inline_info_encoding_, depth, inline_entry.dex_pc);
Nicolas Geoffrayb1d0f3f2015-05-14 12:41:51 +0100397 if (inline_entry.num_dex_registers == 0) {
398 // No dex map available.
David Srbecky61b28a12016-02-25 21:55:03 +0000399 inline_info.SetDexRegisterMapOffsetAtDepth(inline_info_encoding_,
400 depth,
401 StackMap::kNoDexRegisterMap);
Nicolas Geoffrayb1d0f3f2015-05-14 12:41:51 +0100402 DCHECK(inline_entry.live_dex_registers_mask == nullptr);
403 } else {
404 MemoryRegion register_region = dex_register_locations_region.Subregion(
405 next_dex_register_map_offset,
406 ComputeDexRegisterMapSize(inline_entry.num_dex_registers,
Vladimir Marko225b6462015-09-28 12:17:40 +0100407 inline_entry.live_dex_registers_mask));
Nicolas Geoffrayb1d0f3f2015-05-14 12:41:51 +0100408 next_dex_register_map_offset += register_region.size();
409 DexRegisterMap dex_register_map(register_region);
410 inline_info.SetDexRegisterMapOffsetAtDepth(
David Srbecky61b28a12016-02-25 21:55:03 +0000411 inline_info_encoding_,
David Srbecky45aa5982016-03-18 02:15:09 +0000412 depth, register_region.begin() - dex_register_locations_region.begin());
Nicolas Geoffrayb1d0f3f2015-05-14 12:41:51 +0100413
414 FillInDexRegisterMap(dex_register_map,
415 inline_entry.num_dex_registers,
416 *inline_entry.live_dex_registers_mask,
417 inline_entry.dex_register_locations_start_index);
418 }
Calin Juravlec416d332015-04-23 16:01:43 +0100419 }
420 } else {
Calin Juravle4f46ac52015-04-23 18:47:21 +0100421 if (inline_info_size_ != 0) {
David Brazdilf677ebf2015-05-29 16:29:43 +0100422 stack_map.SetInlineDescriptorOffset(stack_map_encoding_, StackMap::kNoInlineInfo);
Calin Juravlec416d332015-04-23 16:01:43 +0100423 }
424 }
425 }
David Srbecky1bbdfd72016-02-24 16:39:26 +0000426
Mathieu Chartier1a20b682017-01-31 14:25:16 -0800427 // Write stack masks table.
David Srbecky45aa5982016-03-18 02:15:09 +0000428 size_t stack_mask_bits = encoding.stack_mask_size_in_bits;
429 if (stack_mask_bits > 0) {
430 size_t stack_mask_bytes = RoundUp(stack_mask_bits, kBitsPerByte) / kBitsPerByte;
431 for (size_t i = 0; i < encoding.number_of_stack_masks; ++i) {
432 MemoryRegion source(&stack_masks_[i * stack_mask_bytes], stack_mask_bytes);
433 BitMemoryRegion stack_mask = code_info.GetStackMask(encoding, i);
434 for (size_t bit_index = 0; bit_index < encoding.stack_mask_size_in_bits; ++bit_index) {
435 stack_mask.StoreBit(bit_index, source.LoadBit(bit_index));
436 }
437 }
438 }
439
Mathieu Chartier1a20b682017-01-31 14:25:16 -0800440 // Write register masks table.
441 for (size_t i = 0; i < encoding.number_of_register_masks; ++i) {
442 BitMemoryRegion register_mask = code_info.GetRegisterMask(encoding, i);
443 register_mask.StoreBits(0, register_masks_[i], encoding.register_mask_size_in_bits);
444 }
445
David Srbecky1bbdfd72016-02-24 16:39:26 +0000446 // Verify all written data in debug build.
447 if (kIsDebugBuild) {
448 CheckCodeInfo(region);
449 }
Calin Juravlec416d332015-04-23 16:01:43 +0100450}
451
Nicolas Geoffrayb1d0f3f2015-05-14 12:41:51 +0100452void StackMapStream::FillInDexRegisterMap(DexRegisterMap dex_register_map,
453 uint32_t num_dex_registers,
454 const BitVector& live_dex_registers_mask,
455 uint32_t start_index_in_dex_register_locations) const {
456 dex_register_map.SetLiveBitMask(num_dex_registers, live_dex_registers_mask);
457 // Set the dex register location mapping data.
Vladimir Marko225b6462015-09-28 12:17:40 +0100458 size_t number_of_live_dex_registers = live_dex_registers_mask.NumSetBits();
459 DCHECK_LE(number_of_live_dex_registers, dex_register_locations_.size());
460 DCHECK_LE(start_index_in_dex_register_locations,
461 dex_register_locations_.size() - number_of_live_dex_registers);
462 for (size_t index_in_dex_register_locations = 0;
463 index_in_dex_register_locations != number_of_live_dex_registers;
464 ++index_in_dex_register_locations) {
465 size_t location_catalog_entry_index = dex_register_locations_[
466 start_index_in_dex_register_locations + index_in_dex_register_locations];
467 dex_register_map.SetLocationCatalogEntryIndex(
468 index_in_dex_register_locations,
469 location_catalog_entry_index,
470 num_dex_registers,
471 location_catalog_entries_.size());
Nicolas Geoffrayb1d0f3f2015-05-14 12:41:51 +0100472 }
473}
474
Calin Juravle4f46ac52015-04-23 18:47:21 +0100475size_t StackMapStream::FindEntryWithTheSameDexMap() {
Vladimir Marko225b6462015-09-28 12:17:40 +0100476 size_t current_entry_index = stack_maps_.size();
Calin Juravle4f46ac52015-04-23 18:47:21 +0100477 auto entries_it = dex_map_hash_to_stack_map_indices_.find(current_entry_.dex_register_map_hash);
Calin Juravlec416d332015-04-23 16:01:43 +0100478 if (entries_it == dex_map_hash_to_stack_map_indices_.end()) {
479 // We don't have a perfect hash functions so we need a list to collect all stack maps
480 // which might have the same dex register map.
Vladimir Marko225b6462015-09-28 12:17:40 +0100481 ArenaVector<uint32_t> stack_map_indices(allocator_->Adapter(kArenaAllocStackMapStream));
482 stack_map_indices.push_back(current_entry_index);
483 dex_map_hash_to_stack_map_indices_.Put(current_entry_.dex_register_map_hash,
484 std::move(stack_map_indices));
Calin Juravlec416d332015-04-23 16:01:43 +0100485 return kNoSameDexMapFound;
486 }
487
Calin Juravle4f46ac52015-04-23 18:47:21 +0100488 // We might have collisions, so we need to check whether or not we really have a match.
Vladimir Marko225b6462015-09-28 12:17:40 +0100489 for (uint32_t test_entry_index : entries_it->second) {
490 if (HaveTheSameDexMaps(GetStackMap(test_entry_index), current_entry_)) {
Calin Juravle4f46ac52015-04-23 18:47:21 +0100491 return test_entry_index;
Calin Juravlec416d332015-04-23 16:01:43 +0100492 }
493 }
Vladimir Marko225b6462015-09-28 12:17:40 +0100494 entries_it->second.push_back(current_entry_index);
Calin Juravle4f46ac52015-04-23 18:47:21 +0100495 return kNoSameDexMapFound;
Calin Juravlec416d332015-04-23 16:01:43 +0100496}
497
498bool StackMapStream::HaveTheSameDexMaps(const StackMapEntry& a, const StackMapEntry& b) const {
499 if (a.live_dex_registers_mask == nullptr && b.live_dex_registers_mask == nullptr) {
500 return true;
501 }
502 if (a.live_dex_registers_mask == nullptr || b.live_dex_registers_mask == nullptr) {
503 return false;
504 }
505 if (a.num_dex_registers != b.num_dex_registers) {
506 return false;
507 }
Vladimir Marko225b6462015-09-28 12:17:40 +0100508 if (a.num_dex_registers != 0u) {
509 DCHECK(a.live_dex_registers_mask != nullptr);
510 DCHECK(b.live_dex_registers_mask != nullptr);
511 if (!a.live_dex_registers_mask->Equal(b.live_dex_registers_mask)) {
Calin Juravlec416d332015-04-23 16:01:43 +0100512 return false;
513 }
Vladimir Marko225b6462015-09-28 12:17:40 +0100514 size_t number_of_live_dex_registers = a.live_dex_registers_mask->NumSetBits();
515 DCHECK_LE(number_of_live_dex_registers, dex_register_locations_.size());
516 DCHECK_LE(a.dex_register_locations_start_index,
517 dex_register_locations_.size() - number_of_live_dex_registers);
518 DCHECK_LE(b.dex_register_locations_start_index,
519 dex_register_locations_.size() - number_of_live_dex_registers);
520 auto a_begin = dex_register_locations_.begin() + a.dex_register_locations_start_index;
521 auto b_begin = dex_register_locations_.begin() + b.dex_register_locations_start_index;
522 if (!std::equal(a_begin, a_begin + number_of_live_dex_registers, b_begin)) {
523 return false;
Calin Juravlec416d332015-04-23 16:01:43 +0100524 }
525 }
526 return true;
527}
528
David Srbecky1bbdfd72016-02-24 16:39:26 +0000529// Helper for CheckCodeInfo - check that register map has the expected content.
530void StackMapStream::CheckDexRegisterMap(const CodeInfo& code_info,
531 const DexRegisterMap& dex_register_map,
532 size_t num_dex_registers,
533 BitVector* live_dex_registers_mask,
534 size_t dex_register_locations_index) const {
David Srbecky09ed0982016-02-12 21:58:43 +0000535 CodeInfoEncoding encoding = code_info.ExtractEncoding();
David Srbecky1bbdfd72016-02-24 16:39:26 +0000536 for (size_t reg = 0; reg < num_dex_registers; reg++) {
537 // Find the location we tried to encode.
538 DexRegisterLocation expected = DexRegisterLocation::None();
539 if (live_dex_registers_mask->IsBitSet(reg)) {
540 size_t catalog_index = dex_register_locations_[dex_register_locations_index++];
541 expected = location_catalog_entries_[catalog_index];
542 }
543 // Compare to the seen location.
544 if (expected.GetKind() == DexRegisterLocation::Kind::kNone) {
545 DCHECK(!dex_register_map.IsValid() || !dex_register_map.IsDexRegisterLive(reg));
546 } else {
547 DCHECK(dex_register_map.IsDexRegisterLive(reg));
548 DexRegisterLocation seen = dex_register_map.GetDexRegisterLocation(
549 reg, num_dex_registers, code_info, encoding);
550 DCHECK_EQ(expected.GetKind(), seen.GetKind());
551 DCHECK_EQ(expected.GetValue(), seen.GetValue());
552 }
553 }
554 if (num_dex_registers == 0) {
555 DCHECK(!dex_register_map.IsValid());
556 }
557}
558
Mathieu Chartier1a20b682017-01-31 14:25:16 -0800559size_t StackMapStream::PrepareRegisterMasks() {
560 register_masks_.resize(stack_maps_.size(), 0u);
561 std::unordered_map<uint32_t, size_t> dedupe;
562 for (StackMapEntry& stack_map : stack_maps_) {
563 const size_t index = dedupe.size();
564 stack_map.register_mask_index = dedupe.emplace(stack_map.register_mask, index).first->second;
565 register_masks_[index] = stack_map.register_mask;
566 }
567 return dedupe.size();
568}
569
David Srbecky45aa5982016-03-18 02:15:09 +0000570size_t StackMapStream::PrepareStackMasks(size_t entry_size_in_bits) {
571 // Preallocate memory since we do not want it to move (the dedup map will point into it).
572 const size_t byte_entry_size = RoundUp(entry_size_in_bits, kBitsPerByte) / kBitsPerByte;
573 stack_masks_.resize(byte_entry_size * stack_maps_.size(), 0u);
574 // For deduplicating we store the stack masks as byte packed for simplicity. We can bit pack later
575 // when copying out from stack_masks_.
576 std::unordered_map<MemoryRegion,
577 size_t,
578 FNVHash<MemoryRegion>,
579 MemoryRegion::ContentEquals> dedup(stack_maps_.size());
580 for (StackMapEntry& stack_map : stack_maps_) {
581 size_t index = dedup.size();
582 MemoryRegion stack_mask(stack_masks_.data() + index * byte_entry_size, byte_entry_size);
583 for (size_t i = 0; i < entry_size_in_bits; i++) {
584 stack_mask.StoreBit(i, stack_map.sp_mask != nullptr && stack_map.sp_mask->IsBitSet(i));
585 }
586 stack_map.stack_mask_index = dedup.emplace(stack_mask, index).first->second;
587 }
588 return dedup.size();
589}
590
David Srbecky1bbdfd72016-02-24 16:39:26 +0000591// Check that all StackMapStream inputs are correctly encoded by trying to read them back.
592void StackMapStream::CheckCodeInfo(MemoryRegion region) const {
593 CodeInfo code_info(region);
David Srbecky09ed0982016-02-12 21:58:43 +0000594 CodeInfoEncoding encoding = code_info.ExtractEncoding();
595 DCHECK_EQ(code_info.GetNumberOfStackMaps(encoding), stack_maps_.size());
David Srbecky1bbdfd72016-02-24 16:39:26 +0000596 for (size_t s = 0; s < stack_maps_.size(); ++s) {
597 const StackMap stack_map = code_info.GetStackMapAt(s, encoding);
David Srbecky09ed0982016-02-12 21:58:43 +0000598 const StackMapEncoding& stack_map_encoding = encoding.stack_map_encoding;
David Srbecky1bbdfd72016-02-24 16:39:26 +0000599 StackMapEntry entry = stack_maps_[s];
600
601 // Check main stack map fields.
Mathieu Chartiera2f526f2017-01-19 14:48:48 -0800602 DCHECK_EQ(stack_map.GetNativePcOffset(stack_map_encoding, instruction_set_),
603 entry.native_pc_code_offset.Uint32Value(instruction_set_));
David Srbecky09ed0982016-02-12 21:58:43 +0000604 DCHECK_EQ(stack_map.GetDexPc(stack_map_encoding), entry.dex_pc);
Mathieu Chartier1a20b682017-01-31 14:25:16 -0800605 DCHECK_EQ(stack_map.GetRegisterMaskIndex(stack_map_encoding), entry.register_mask_index);
606 DCHECK_EQ(code_info.GetRegisterMaskOf(encoding, stack_map), entry.register_mask);
David Srbecky45aa5982016-03-18 02:15:09 +0000607 const size_t num_stack_mask_bits = code_info.GetNumberOfStackMaskBits(encoding);
608 DCHECK_EQ(stack_map.GetStackMaskIndex(stack_map_encoding), entry.stack_mask_index);
609 BitMemoryRegion stack_mask = code_info.GetStackMaskOf(encoding, stack_map);
David Srbecky1bbdfd72016-02-24 16:39:26 +0000610 if (entry.sp_mask != nullptr) {
David Srbecky45aa5982016-03-18 02:15:09 +0000611 DCHECK_GE(stack_mask.size_in_bits(), entry.sp_mask->GetNumberOfBits());
David Srbecky09ed0982016-02-12 21:58:43 +0000612 for (size_t b = 0; b < num_stack_mask_bits; b++) {
David Srbecky45aa5982016-03-18 02:15:09 +0000613 DCHECK_EQ(stack_mask.LoadBit(b), entry.sp_mask->IsBitSet(b));
David Srbecky1bbdfd72016-02-24 16:39:26 +0000614 }
615 } else {
David Srbecky09ed0982016-02-12 21:58:43 +0000616 for (size_t b = 0; b < num_stack_mask_bits; b++) {
David Srbecky45aa5982016-03-18 02:15:09 +0000617 DCHECK_EQ(stack_mask.LoadBit(b), 0u);
David Srbecky1bbdfd72016-02-24 16:39:26 +0000618 }
619 }
620
621 CheckDexRegisterMap(code_info,
622 code_info.GetDexRegisterMapOf(
623 stack_map, encoding, entry.num_dex_registers),
624 entry.num_dex_registers,
625 entry.live_dex_registers_mask,
626 entry.dex_register_locations_start_index);
627
628 // Check inline info.
David Srbecky09ed0982016-02-12 21:58:43 +0000629 DCHECK_EQ(stack_map.HasInlineInfo(stack_map_encoding), (entry.inlining_depth != 0));
David Srbecky1bbdfd72016-02-24 16:39:26 +0000630 if (entry.inlining_depth != 0) {
631 InlineInfo inline_info = code_info.GetInlineInfoOf(stack_map, encoding);
David Srbecky61b28a12016-02-25 21:55:03 +0000632 DCHECK_EQ(inline_info.GetDepth(encoding.inline_info_encoding), entry.inlining_depth);
David Srbecky1bbdfd72016-02-24 16:39:26 +0000633 for (size_t d = 0; d < entry.inlining_depth; ++d) {
634 size_t inline_info_index = entry.inline_infos_start_index + d;
635 DCHECK_LT(inline_info_index, inline_infos_.size());
636 InlineInfoEntry inline_entry = inline_infos_[inline_info_index];
David Srbecky61b28a12016-02-25 21:55:03 +0000637 DCHECK_EQ(inline_info.GetDexPcAtDepth(encoding.inline_info_encoding, d),
638 inline_entry.dex_pc);
Nicolas Geoffray5d37c152017-01-12 13:25:19 +0000639 if (inline_info.EncodesArtMethodAtDepth(encoding.inline_info_encoding, d)) {
640 DCHECK_EQ(inline_info.GetArtMethodAtDepth(encoding.inline_info_encoding, d),
641 inline_entry.method);
642 } else {
643 DCHECK_EQ(inline_info.GetMethodIndexAtDepth(encoding.inline_info_encoding, d),
644 inline_entry.method_index);
645 }
David Srbecky1bbdfd72016-02-24 16:39:26 +0000646
647 CheckDexRegisterMap(code_info,
648 code_info.GetDexRegisterMapAtDepth(
649 d, inline_info, encoding, inline_entry.num_dex_registers),
650 inline_entry.num_dex_registers,
651 inline_entry.live_dex_registers_mask,
652 inline_entry.dex_register_locations_start_index);
653 }
654 }
655 }
656}
657
Calin Juravlec416d332015-04-23 16:01:43 +0100658} // namespace art