From a2f526f889be06f96ea59624c9dfb1223b3839f3 Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Thu, 19 Jan 2017 14:48:48 -0800 Subject: Compressed native PC for stack maps Compress native PC based on instruction alignment. This reduces the size of stack maps, boot.oat is 0.4% smaller for arm64. Test: test-art-host, test-art-target, N6P booting Change-Id: I2b70eecabda88b06fa80a85688fd992070d54278 --- runtime/stack_map.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'runtime/stack_map.cc') diff --git a/runtime/stack_map.cc b/runtime/stack_map.cc index 9ebf9a7bdd..3c92b86208 100644 --- a/runtime/stack_map.cc +++ b/runtime/stack_map.cc @@ -116,7 +116,8 @@ void InlineInfoEncoding::Dump(VariableIndentationOutputStream* vios) const { void CodeInfo::Dump(VariableIndentationOutputStream* vios, uint32_t code_offset, uint16_t number_of_dex_registers, - bool dump_stack_maps) const { + bool dump_stack_maps, + InstructionSet instruction_set) const { CodeInfoEncoding encoding = ExtractEncoding(); size_t number_of_stack_maps = GetNumberOfStackMaps(encoding); vios->Stream() @@ -139,6 +140,7 @@ void CodeInfo::Dump(VariableIndentationOutputStream* vios, encoding, code_offset, number_of_dex_registers, + instruction_set, " " + std::to_string(i)); } } @@ -188,14 +190,16 @@ void StackMap::Dump(VariableIndentationOutputStream* vios, const CodeInfoEncoding& encoding, uint32_t code_offset, uint16_t number_of_dex_registers, + InstructionSet instruction_set, const std::string& header_suffix) const { StackMapEncoding stack_map_encoding = encoding.stack_map_encoding; + const uint32_t pc_offset = GetNativePcOffset(stack_map_encoding, instruction_set); vios->Stream() << "StackMap" << header_suffix << std::hex - << " [native_pc=0x" << code_offset + GetNativePcOffset(stack_map_encoding) << "]" + << " [native_pc=0x" << code_offset + pc_offset << "]" << " (dex_pc=0x" << GetDexPc(stack_map_encoding) - << ", native_pc_offset=0x" << GetNativePcOffset(stack_map_encoding) + << ", native_pc_offset=0x" << pc_offset << ", dex_register_map_offset=0x" << GetDexRegisterMapOffset(stack_map_encoding) << ", inline_info_offset=0x" << GetInlineDescriptorOffset(stack_map_encoding) << ", register_mask=0x" << GetRegisterMask(stack_map_encoding) -- cgit v1.2.3-59-g8ed1b