From ede7bf8a5cef965974e7c1edcf46a41fbe50a49d Mon Sep 17 00:00:00 2001 From: Roland Levillain Date: Fri, 13 Mar 2015 12:23:04 +0000 Subject: Align CodeInfo regions instead of their inner subregions. Instead of word-aligning every stack map region, as well as the Dex register maps region of a CodeInfo object, just align the whole CodeInfo region itself. Change-Id: Ia35d213d2bd184729aa0d048874c76f7bc6da0f6 --- compiler/optimizing/stack_map_stream.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'compiler/optimizing/stack_map_stream.h') diff --git a/compiler/optimizing/stack_map_stream.h b/compiler/optimizing/stack_map_stream.h index 8fb58d19a9..863bab29ac 100644 --- a/compiler/optimizing/stack_map_stream.h +++ b/compiler/optimizing/stack_map_stream.h @@ -99,10 +99,12 @@ class StackMapStream : public ValueObject { } size_t ComputeNeededSize() const { - return CodeInfo::kFixedSize + size_t size = CodeInfo::kFixedSize + ComputeStackMapsSize() + ComputeDexRegisterMapsSize() + ComputeInlineInfoSize(); + // On ARM, CodeInfo data must be 4-byte aligned. + return RoundUp(size, kWordAlignment); } size_t ComputeStackMaskSize() const { @@ -110,7 +112,7 @@ class StackMapStream : public ValueObject { } size_t ComputeStackMapsSize() const { - return stack_maps_.Size() * StackMap::ComputeAlignedStackMapSize(ComputeStackMaskSize()); + return stack_maps_.Size() * StackMap::ComputeStackMapSize(ComputeStackMaskSize()); } // Compute the size of the Dex register map of `entry`. @@ -133,8 +135,7 @@ class StackMapStream : public ValueObject { DexRegisterLocation entry = dex_register_maps_.Get(i); size += DexRegisterMap::EntrySize(entry); } - // On ARM, the Dex register maps must be 4-byte aligned. - return RoundUp(size, kWordAlignment); + return size; } // Compute the size of all the inline information pieces. -- cgit v1.2.3-59-g8ed1b