diff options
author | Nicolas Geoffray <ngeoffray@google.com> | 2015-03-30 15:44:25 +0100 |
---|---|---|
committer | Nicolas Geoffray <ngeoffray@google.com> | 2015-03-31 15:32:48 +0100 |
commit | 896f8f7fe562f6e59119cb32531da9f0a5f13d18 (patch) | |
tree | 9f2b61474702a655ab5e793bac44d89612cf1b80 /compiler/optimizing/stack_map_stream.h | |
parent | 7411a69982c055692966c685636b6a226f10215e (diff) |
Use variable encoding for StackMap.
dex_pc, native_pc_offset, dex_register_map_offset, inline_info_offset,
and register_mask can now be encoded in 1, 2, 3, or 4 bytes.
Change-Id: I15f93e8226ce374204d44c5a80a9fd89bda2687c
Diffstat (limited to 'compiler/optimizing/stack_map_stream.h')
-rw-r--r-- | compiler/optimizing/stack_map_stream.h | 13 |
1 files changed, 10 insertions, 3 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_; |