Lines Matching defs:encoding
81 // Large location kinds, requiring a 5-byte encoding (1 byte for the
652 // We reuse the idea from ULEB128p1 to support encoding of -1 (aka 0xFFFFFFFF).
798 ALWAYS_INLINE uint32_t GetDexPc(const StackMapEncoding& encoding) const {
799 return encoding.GetDexPcEncoding().Load(region_);
802 ALWAYS_INLINE void SetDexPc(const StackMapEncoding& encoding, uint32_t dex_pc) {
803 encoding.GetDexPcEncoding().Store(region_, dex_pc);
806 ALWAYS_INLINE uint32_t GetNativePcOffset(const StackMapEncoding& encoding) const {
807 return encoding.GetNativePcEncoding().Load(region_);
810 encoding, uint32_t native_pc_offset) {
811 encoding.GetNativePcEncoding().Store(region_, native_pc_offset);
814 ALWAYS_INLINE uint32_t GetDexRegisterMapOffset(const StackMapEncoding& encoding) const {
815 return encoding.GetDexRegisterMapEncoding().Load(region_);
818 ALWAYS_INLINE void SetDexRegisterMapOffset(const StackMapEncoding& encoding, uint32_t offset) {
819 encoding.GetDexRegisterMapEncoding().Store(region_, offset);
822 ALWAYS_INLINE uint32_t GetInlineDescriptorOffset(const StackMapEncoding& encoding) const {
823 return encoding.GetInlineInfoEncoding().Load(region_);
826 ALWAYS_INLINE void SetInlineDescriptorOffset(const StackMapEncoding& encoding, uint32_t offset) {
827 encoding.GetInlineInfoEncoding().Store(region_, offset);
830 ALWAYS_INLINE uint32_t GetRegisterMask(const StackMapEncoding& encoding) const {
831 return encoding.GetRegisterMaskEncoding().Load(region_);
834 ALWAYS_INLINE void SetRegisterMask(const StackMapEncoding& encoding, uint32_t mask) {
835 encoding.GetRegisterMaskEncoding().Store(region_, mask);
838 ALWAYS_INLINE size_t GetNumberOfStackMaskBits(const StackMapEncoding& encoding) const {
839 return region_.size_in_bits() - encoding.GetStackMaskBitOffset();
842 ALWAYS_INLINE bool GetStackMaskBit(const StackMapEncoding& encoding, size_t index) const {
843 return region_.LoadBit(encoding.GetStackMaskBitOffset() + index);
846 ALWAYS_INLINE void SetStackMaskBit(const StackMapEncoding& encoding, size_t index, bool value) {
847 region_.StoreBit(encoding.GetStackMaskBitOffset() + index, value);
850 ALWAYS_INLINE bool HasDexRegisterMap(const StackMapEncoding& encoding) const {
851 return GetDexRegisterMapOffset(encoding) != kNoDexRegisterMap;
854 ALWAYS_INLINE bool HasInlineInfo(const StackMapEncoding& encoding) const {
855 return GetInlineDescriptorOffset(encoding) != kNoInlineInfo;
864 const CodeInfoEncoding& encoding,
943 ALWAYS_INLINE uint32_t GetDepth(const InlineInfoEncoding& encoding) const {
945 while (!GetRegionAtDepth(encoding, depth++).LoadBit(0)) { } // Check is_last bit.
949 ALWAYS_INLINE void SetDepth(const InlineInfoEncoding& encoding, uint32_t depth) {
952 GetRegionAtDepth(encoding, d).StoreBit(0, d == depth - 1); // Set is_last bit.
956 ALWAYS_INLINE uint32_t GetMethodIndexAtDepth(const InlineInfoEncoding& encoding,
958 return encoding.GetMethodIndexEncoding().Load(GetRegionAtDepth(encoding, depth));
961 ALWAYS_INLINE void SetMethodIndexAtDepth(const InlineInfoEncoding& encoding,
964 encoding.GetMethodIndexEncoding().Store(GetRegionAtDepth(encoding, depth), index);
967 ALWAYS_INLINE uint32_t GetDexPcAtDepth(const InlineInfoEncoding& encoding,
969 return encoding.GetDexPcEncoding().Load(GetRegionAtDepth(encoding, depth));
972 ALWAYS_INLINE void SetDexPcAtDepth(const InlineInfoEncoding& encoding,
975 encoding.GetDexPcEncoding().Store(GetRegionAtDepth(encoding, depth), dex_pc);
978 ALWAYS_INLINE uint32_t GetInvokeTypeAtDepth(const InlineInfoEncoding& encoding,
980 return encoding.GetInvokeTypeEncoding().Load(GetRegionAtDepth(encoding, depth));
983 ALWAYS_INLINE void SetInvokeTypeAtDepth(const InlineInfoEncoding& encoding,
986 encoding.GetInvokeTypeEncoding().Store(GetRegionAtDepth(encoding, depth), invoke_type);
989 ALWAYS_INLINE uint32_t GetDexRegisterMapOffsetAtDepth(const InlineInfoEncoding& encoding,
991 return encoding.GetDexRegisterMapEncoding().Load(GetRegionAtDepth(encoding, depth));
994 ALWAYS_INLINE void SetDexRegisterMapOffsetAtDepth(const InlineInfoEncoding& encoding,
997 encoding.GetDexRegisterMapEncoding().Store(GetRegionAtDepth(encoding, depth), offset);
1000 ALWAYS_INLINE bool HasDexRegisterMapAtDepth(const InlineInfoEncoding& encoding,
1002 return GetDexRegisterMapOffsetAtDepth(encoding, depth) != StackMap::kNoDexRegisterMap;
1010 ALWAYS_INLINE MemoryRegion GetRegionAtDepth(const InlineInfoEncoding& encoding,
1012 size_t entry_size = encoding.GetEntrySize();
1085 CodeInfoEncoding encoding = CodeInfoEncoding(data);
1087 encoding.header_size + encoding.non_header_size);
1094 bool HasInlineInfo(const CodeInfoEncoding& encoding) const {
1095 return encoding.stack_map_encoding.GetInlineInfoEncoding().BitSize() > 0;
1098 DexRegisterLocationCatalog GetDexRegisterLocationCatalog(const CodeInfoEncoding& encoding) const {
1100 GetDexRegisterLocationCatalogOffset(encoding),
1101 GetDexRegisterLocationCatalogSize(encoding)));
1104 StackMap GetStackMapAt(size_t i, const CodeInfoEncoding& encoding) const {
1105 size_t stack_map_size = encoding.stack_map_size_in_bytes;
1106 return StackMap(GetStackMaps(encoding).Subregion(i * stack_map_size, stack_map_size));
1109 uint32_t GetNumberOfLocationCatalogEntries(const CodeInfoEncoding& encoding) const {
1110 return encoding.number_of_location_catalog_entries;
1113 uint32_t GetDexRegisterLocationCatalogSize(const CodeInfoEncoding& encoding) const {
1114 return ComputeDexRegisterLocationCatalogSize(GetDexRegisterLocationCatalogOffset(encoding),
1115 GetNumberOfLocationCatalogEntries(encoding));
1118 uint32_t GetNumberOfStackMaps(const CodeInfoEncoding& encoding) const {
1119 return encoding.number_of_stack_maps;
1123 size_t GetStackMapsSize(const CodeInfoEncoding& encoding) const {
1124 return encoding.stack_map_size_in_bytes * GetNumberOfStackMaps(encoding);
1127 uint32_t GetDexRegisterLocationCatalogOffset(const CodeInfoEncoding& encoding) const {
1128 return GetStackMapsOffset(encoding) + GetStackMapsSize(encoding);
1131 size_t GetDexRegisterMapsOffset(const CodeInfoEncoding& encoding) const {
1132 return GetDexRegisterLocationCatalogOffset(encoding)
1133 + GetDexRegisterLocationCatalogSize(encoding);
1136 uint32_t GetStackMapsOffset(const CodeInfoEncoding& encoding) const {
1137 return encoding.header_size;
1141 const CodeInfoEncoding& encoding,
1143 if (!stack_map.HasDexRegisterMap(encoding.stack_map_encoding)) {
1146 uint32_t offset = GetDexRegisterMapsOffset(encoding)
1147 + stack_map.GetDexRegisterMapOffset(encoding.stack_map_encoding);
1148 size_t size = ComputeDexRegisterMapSizeOf(encoding, offset, number_of_dex_registers);
1156 const CodeInfoEncoding& encoding,
1158 if (!inline_info.HasDexRegisterMapAtDepth(encoding.inline_info_encoding, depth)) {
1161 uint32_t offset = GetDexRegisterMapsOffset(encoding) +
1162 inline_info.GetDexRegisterMapOffsetAtDepth(encoding.inline_info_encoding, depth);
1163 size_t size = ComputeDexRegisterMapSizeOf(encoding, offset, number_of_dex_registers);
1168 InlineInfo GetInlineInfoOf(StackMap stack_map, const CodeInfoEncoding& encoding) const {
1169 DCHECK(stack_map.HasInlineInfo(encoding.stack_map_encoding));
1170 uint32_t offset = stack_map.GetInlineDescriptorOffset(encoding.stack_map_encoding)
1171 + GetDexRegisterMapsOffset(encoding);
1175 StackMap GetStackMapForDexPc(uint32_t dex_pc, const CodeInfoEncoding& encoding) const {
1176 for (size_t i = 0, e = GetNumberOfStackMaps(encoding); i < e; ++i) {
1177 StackMap stack_map = GetStackMapAt(i, encoding);
1178 if (stack_map.GetDexPc(encoding.stack_map_encoding) == dex_pc) {
1187 StackMap GetCatchStackMapForDexPc(uint32_t dex_pc, const CodeInfoEncoding& encoding) const {
1188 for (size_t i = GetNumberOfStackMaps(encoding); i > 0; --i) {
1189 StackMap stack_map = GetStackMapAt(i - 1, encoding);
1190 if (stack_map.GetDexPc(encoding.stack_map_encoding) == dex_pc) {
1197 StackMap GetOsrStackMapForDexPc(uint32_t dex_pc, const CodeInfoEncoding& encoding) const {
1198 size_t e = GetNumberOfStackMaps(encoding);
1205 const StackMapEncoding& stack_map_encoding = encoding.stack_map_encoding;
1207 StackMap stack_map = GetStackMapAt(i, encoding);
1209 StackMap other = GetStackMapAt(i + 1, encoding);
1219 GetStackMapAt(i + 2, encoding).GetNativePcOffset(stack_map_encoding));
1229 const CodeInfoEncoding& encoding) const {
1233 for (size_t i = 0, e = GetNumberOfStackMaps(encoding); i < e; ++i) {
1234 StackMap stack_map = GetStackMapAt(i, encoding);
1235 if (stack_map.GetNativePcOffset(encoding.stack_map_encoding) == native_pc_offset) {
1253 MemoryRegion GetStackMaps(const CodeInfoEncoding& encoding) const {
1256 : region_.Subregion(GetStackMapsOffset(encoding), GetStackMapsSize(encoding));
1261 size_t ComputeDexRegisterMapSizeOf(const CodeInfoEncoding& encoding,
1275 DexRegisterMap::SingleEntrySizeInBits(GetNumberOfLocationCatalogEntries(encoding))