From 9d07e3d128ccfa0ef7670feadd424a825e447d1d Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Thu, 31 Mar 2016 12:02:28 +0100 Subject: Clean up OatQuickMethodHeader after Quick removal. This reduces the size of the pre-header by 8 bytes, reducing oat file size and mmapped .text section size. The memory needed to store a CompiledMethod by dex2oat is also reduced, for 32-bit dex2oat by 8B and for 64-bit dex2oat by 16B. The aosp_flounder-userdebug 32-bit and 64-bit boot.oat are each about 1.1MiB smaller. Disable the broken StubTest.IMT, b/27991555 . Change-Id: I05fe45c28c8ffb7a0fa8b1117b969786748b1039 --- compiler/common_compiler_test.cc | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) (limited to 'compiler/common_compiler_test.cc') diff --git a/compiler/common_compiler_test.cc b/compiler/common_compiler_test.cc index 6483ef63b1..0001b672be 100644 --- a/compiler/common_compiler_test.cc +++ b/compiler/common_compiler_test.cc @@ -59,36 +59,20 @@ void CommonCompilerTest::MakeExecutable(ArtMethod* method) { ArrayRef vmap_table = compiled_method->GetVmapTable(); uint32_t vmap_table_offset = vmap_table.empty() ? 0u : sizeof(OatQuickMethodHeader) + vmap_table.size(); - ArrayRef mapping_table = compiled_method->GetMappingTable(); - bool mapping_table_used = !mapping_table.empty(); - size_t mapping_table_size = mapping_table.size(); - uint32_t mapping_table_offset = !mapping_table_used ? 0u - : sizeof(OatQuickMethodHeader) + vmap_table.size() + mapping_table_size; - ArrayRef gc_map = compiled_method->GetGcMap(); - bool gc_map_used = !gc_map.empty(); - size_t gc_map_size = gc_map.size(); - uint32_t gc_map_offset = !gc_map_used ? 0u - : sizeof(OatQuickMethodHeader) + vmap_table.size() + mapping_table_size + gc_map_size; - OatQuickMethodHeader method_header(mapping_table_offset, vmap_table_offset, gc_map_offset, + OatQuickMethodHeader method_header(vmap_table_offset, compiled_method->GetFrameSizeInBytes(), compiled_method->GetCoreSpillMask(), - compiled_method->GetFpSpillMask(), code_size); + compiled_method->GetFpSpillMask(), + code_size); header_code_and_maps_chunks_.push_back(std::vector()); std::vector* chunk = &header_code_and_maps_chunks_.back(); const size_t max_padding = GetInstructionSetAlignment(compiled_method->GetInstructionSet()); - const size_t size = - gc_map_size + mapping_table_size + vmap_table.size() + sizeof(method_header) + code_size; + const size_t size = vmap_table.size() + sizeof(method_header) + code_size; chunk->reserve(size + max_padding); chunk->resize(sizeof(method_header)); memcpy(&(*chunk)[0], &method_header, sizeof(method_header)); chunk->insert(chunk->begin(), vmap_table.begin(), vmap_table.end()); - if (mapping_table_used) { - chunk->insert(chunk->begin(), mapping_table.begin(), mapping_table.end()); - } - if (gc_map_used) { - chunk->insert(chunk->begin(), gc_map.begin(), gc_map.end()); - } chunk->insert(chunk->end(), code.begin(), code.end()); CHECK_EQ(chunk->size(), size); const void* unaligned_code_ptr = chunk->data() + (size - code_size); -- cgit v1.2.3-59-g8ed1b