diff options
| -rw-r--r-- | compiler/optimizing/stack_map_stream.h | 9 | ||||
| -rw-r--r-- | runtime/stack_map.h | 7 |
2 files changed, 10 insertions, 6 deletions
diff --git a/compiler/optimizing/stack_map_stream.h b/compiler/optimizing/stack_map_stream.h index 79bebd2e64..76ddbf3204 100644 --- a/compiler/optimizing/stack_map_stream.h +++ b/compiler/optimizing/stack_map_stream.h @@ -129,7 +129,8 @@ class StackMapStream : public ValueObject { DexRegisterLocation entry = dex_register_maps_.Get(i); size += DexRegisterMap::EntrySize(entry); } - return size; + // On ARM, the Dex register maps must be 4-byte aligned. + return RoundUp(size, kWordAlignment); } // Compute the size of all the inline information pieces. @@ -139,12 +140,12 @@ class StackMapStream : public ValueObject { + (number_of_stack_maps_with_inline_info_ * InlineInfo::kFixedSize); } - size_t ComputeDexRegisterMapStart() const { + size_t ComputeDexRegisterMapsStart() const { return CodeInfo::kFixedSize + ComputeStackMapSize(); } size_t ComputeInlineInfoStart() const { - return ComputeDexRegisterMapStart() + ComputeDexRegisterMapsSize(); + return ComputeDexRegisterMapsStart() + ComputeDexRegisterMapsSize(); } void FillIn(MemoryRegion region) { @@ -155,7 +156,7 @@ class StackMapStream : public ValueObject { uint8_t* memory_start = region.start(); MemoryRegion dex_register_maps_region = region.Subregion( - ComputeDexRegisterMapStart(), + ComputeDexRegisterMapsStart(), ComputeDexRegisterMapsSize()); MemoryRegion inline_infos_region = region.Subregion( diff --git a/runtime/stack_map.h b/runtime/stack_map.h index c98162306c..e88820fc79 100644 --- a/runtime/stack_map.h +++ b/runtime/stack_map.h @@ -28,6 +28,9 @@ namespace art { // (signed) values. static ssize_t constexpr kFrameSlotSize = 4; +// Word alignment required on ARM, in bytes. +static constexpr size_t kWordAlignment = 4; + /** * Classes in the following file are wrapper on stack map information backed * by a MemoryRegion. As such they read and write to the region, they don't have @@ -526,9 +529,9 @@ class StackMap { && region_.size() == other.region_.size(); } - static size_t ComputeAlignedStackMapSize(size_t stack_map_size) { + static size_t ComputeAlignedStackMapSize(size_t stack_mask_size) { // On ARM, the stack maps must be 4-byte aligned. - return RoundUp(StackMap::kFixedSize + stack_map_size, 4); + return RoundUp(StackMap::kFixedSize + stack_mask_size, kWordAlignment); } // Special (invalid) offset for the DexRegisterMapOffset field meaning |