diff options
author | Nicolas Geoffray <ngeoffray@google.com> | 2015-03-31 14:33:40 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-03-31 14:33:40 +0000 |
commit | ebbb1e322d8c89e69424a543faa03402e5b63673 (patch) | |
tree | c03c84e737c5e5603b84d7b32ee344611aa7d5b1 /compiler/optimizing | |
parent | 5942d57ed5f727d357787aedc089e51aed8eaefa (diff) | |
parent | 896f8f7fe562f6e59119cb32531da9f0a5f13d18 (diff) | |
download | android_art-ebbb1e322d8c89e69424a543faa03402e5b63673.tar.gz android_art-ebbb1e322d8c89e69424a543faa03402e5b63673.tar.bz2 android_art-ebbb1e322d8c89e69424a543faa03402e5b63673.zip |
Merge "Use variable encoding for StackMap."
Diffstat (limited to 'compiler/optimizing')
-rw-r--r-- | compiler/optimizing/stack_map_stream.h | 13 | ||||
-rw-r--r-- | compiler/optimizing/stack_map_test.cc | 5 |
2 files changed, 12 insertions, 6 deletions
diff --git a/compiler/optimizing/stack_map_stream.h b/compiler/optimizing/stack_map_stream.h index b77e60471b..a73c8d77f3 100644 --- a/compiler/optimizing/stack_map_stream.h +++ b/compiler/optimizing/stack_map_stream.h @@ -68,6 +68,7 @@ class StackMapStream : public ValueObject { stack_mask_max_(-1), dex_pc_max_(0), native_pc_offset_max_(0), + register_mask_max_(0), number_of_stack_maps_with_inline_info_(0), dex_map_hash_to_stack_map_indices_(std::less<uint32_t>(), allocator->Adapter()) {} @@ -128,6 +129,7 @@ class StackMapStream : public ValueObject { dex_pc_max_ = std::max(dex_pc_max_, dex_pc); native_pc_offset_max_ = std::max(native_pc_offset_max_, native_pc_offset); + register_mask_max_ = std::max(register_mask_max_, register_mask); } void AddInlineInfoEntry(uint32_t method_index) { @@ -156,7 +158,8 @@ class StackMapStream : public ValueObject { ComputeInlineInfoSize(), ComputeDexRegisterMapsSize(), dex_pc_max_, - native_pc_offset_max_); + native_pc_offset_max_, + register_mask_max_); } // Compute the size of the Dex register location catalog of `entry`. @@ -248,8 +251,11 @@ class StackMapStream : public ValueObject { ComputeInlineInfoStart(), inline_info_size); - code_info.SetEncoding( - inline_info_size, dex_register_map_size, dex_pc_max_, native_pc_offset_max_); + code_info.SetEncoding(inline_info_size, + dex_register_map_size, + dex_pc_max_, + native_pc_offset_max_, + register_mask_max_); code_info.SetNumberOfStackMaps(stack_maps_.Size()); code_info.SetStackMaskSize(stack_mask_size); DCHECK_EQ(code_info.GetStackMapsSize(), ComputeStackMapsSize()); @@ -476,6 +482,7 @@ class StackMapStream : public ValueObject { int stack_mask_max_; uint32_t dex_pc_max_; uint32_t native_pc_offset_max_; + uint32_t register_mask_max_; size_t number_of_stack_maps_with_inline_info_; ArenaSafeMap<uint32_t, GrowableArray<uint32_t>> dex_map_hash_to_stack_map_indices_; diff --git a/compiler/optimizing/stack_map_test.cc b/compiler/optimizing/stack_map_test.cc index b9bf0165f3..8d160bc81e 100644 --- a/compiler/optimizing/stack_map_test.cc +++ b/compiler/optimizing/stack_map_test.cc @@ -401,9 +401,8 @@ TEST(StackMapTest, DexRegisterMapOffsetOverflow) { // ...the offset of the second Dex register map (relative to the // beginning of the Dex register maps region) is 255 (i.e., // kNoDexRegisterMapSmallEncoding). - ASSERT_NE(StackMap::kNoDexRegisterMap, stack_map1.GetDexRegisterMapOffset(code_info)); - ASSERT_EQ(StackMap::kNoDexRegisterMapSmallEncoding, - stack_map1.GetDexRegisterMapOffset(code_info)); + ASSERT_NE(stack_map1.GetDexRegisterMapOffset(code_info), StackMap::kNoDexRegisterMap); + ASSERT_EQ(stack_map1.GetDexRegisterMapOffset(code_info), 0xFFu); } TEST(StackMapTest, TestShareDexRegisterMap) { |