summaryrefslogtreecommitdiffstats
path: root/runtime/stack_map.h
diff options
context:
space:
mode:
authorVladimir Marko <vmarko@google.com>2018-05-29 15:32:55 +0000
committerVladimir Marko <vmarko@google.com>2018-05-29 15:32:55 +0000
commit8b20b5c1f5b454b2f8b8bff492c88724b5002600 (patch)
tree51bea8ddfff23b1f6b0323eaeacf42e6f6199015 /runtime/stack_map.h
parentffaf87a429766ed80e6afee5bebea93db539620b (diff)
downloadart-8b20b5c1f5b454b2f8b8bff492c88724b5002600.tar.gz
art-8b20b5c1f5b454b2f8b8bff492c88724b5002600.tar.bz2
art-8b20b5c1f5b454b2f8b8bff492c88724b5002600.zip
Revert "Optimize register mask and stack mask in stack maps."
This reverts commit ffaf87a429766ed80e6afee5bebea93db539620b. Reason for revert: Breaks exception_test32 on target for CMS and heap poisoning configs. Change-Id: I127c17f693e28211a799f73a50e73105edee7e4c
Diffstat (limited to 'runtime/stack_map.h')
-rw-r--r--runtime/stack_map.h39
1 files changed, 12 insertions, 27 deletions
diff --git a/runtime/stack_map.h b/runtime/stack_map.h
index 02d87130ec..91cecf0690 100644
--- a/runtime/stack_map.h
+++ b/runtime/stack_map.h
@@ -799,24 +799,6 @@ class InvokeInfo : public BitTable<3>::Accessor {
}
};
-// Register masks tend to have many tailing zero bits,
-// therefore it is worth encoding them as value+shift.
-class RegisterMask : public BitTable<2>::Accessor {
- public:
- enum Field {
- kValue,
- kShift,
- kCount,
- };
-
- RegisterMask(const BitTable<kCount>* table, uint32_t row)
- : BitTable<kCount>::Accessor(table, row) {}
-
- ALWAYS_INLINE uint32_t GetMask() const {
- return Get<kValue>() << Get<kShift>();
- }
-};
-
/**
* Wrapper around all compiler information collected for a method.
* The information is of the form:
@@ -851,22 +833,24 @@ class CodeInfo {
return DexRegisterLocationCatalog(location_catalog_);
}
+ ALWAYS_INLINE size_t GetNumberOfStackMaskBits() const {
+ return stack_mask_bits_;
+ }
+
ALWAYS_INLINE StackMap GetStackMapAt(size_t index) const {
return StackMap(&stack_maps_, index);
}
BitMemoryRegion GetStackMask(size_t index) const {
- return stack_masks_.GetBitMemoryRegion(index);
+ return stack_masks_.Subregion(index * stack_mask_bits_, stack_mask_bits_);
}
BitMemoryRegion GetStackMaskOf(const StackMap& stack_map) const {
- uint32_t index = stack_map.GetStackMaskIndex();
- return (index == StackMap::kNoValue) ? BitMemoryRegion() : GetStackMask(index);
+ return GetStackMask(stack_map.GetStackMaskIndex());
}
uint32_t GetRegisterMaskOf(const StackMap& stack_map) const {
- uint32_t index = stack_map.GetRegisterMaskIndex();
- return (index == StackMap::kNoValue) ? 0 : RegisterMask(&register_masks_, index).GetMask();
+ return register_masks_.Get(stack_map.GetRegisterMaskIndex());
}
uint32_t GetNumberOfLocationCatalogEntries() const {
@@ -1061,8 +1045,8 @@ class CodeInfo {
invoke_infos_.Decode(bit_region, &bit_offset);
inline_infos_.Decode(bit_region, &bit_offset);
register_masks_.Decode(bit_region, &bit_offset);
- stack_masks_.Decode(bit_region, &bit_offset);
- CHECK_EQ(BitsToBytesRoundUp(bit_offset), non_header_size);
+ stack_mask_bits_ = DecodeVarintBits(bit_region, &bit_offset);
+ stack_masks_ = bit_region.Subregion(bit_offset, non_header_size * kBitsPerByte - bit_offset);
}
size_t size_;
@@ -1072,8 +1056,9 @@ class CodeInfo {
BitTable<StackMap::Field::kCount> stack_maps_;
BitTable<InvokeInfo::Field::kCount> invoke_infos_;
BitTable<InlineInfo::Field::kCount> inline_infos_;
- BitTable<RegisterMask::Field::kCount> register_masks_;
- BitTable<1> stack_masks_;
+ BitTable<1> register_masks_;
+ uint32_t stack_mask_bits_ = 0;
+ BitMemoryRegion stack_masks_;
friend class OatDumper;
};