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
diff --git a/compiler/driver/compiled_method_storage_test.cc b/compiler/driver/compiled_method_storage_test.cc
index 0695cb5..9e0c22c 100644
--- a/compiler/driver/compiled_method_storage_test.cc
+++ b/compiler/driver/compiled_method_storage_test.cc
@@ -61,24 +61,12 @@
ArrayRef<const SrcMapElem>(raw_src_map1),
ArrayRef<const SrcMapElem>(raw_src_map2),
};
- const uint8_t raw_mapping_table1[] = { 5, 6, 7 };
- const uint8_t raw_mapping_table2[] = { 7, 6, 5, 4 };
- ArrayRef<const uint8_t> mapping_table[] = {
- ArrayRef<const uint8_t>(raw_mapping_table1),
- ArrayRef<const uint8_t>(raw_mapping_table2),
- };
const uint8_t raw_vmap_table1[] = { 2, 4, 6 };
const uint8_t raw_vmap_table2[] = { 7, 5, 3, 1 };
ArrayRef<const uint8_t> vmap_table[] = {
ArrayRef<const uint8_t>(raw_vmap_table1),
ArrayRef<const uint8_t>(raw_vmap_table2),
};
- const uint8_t raw_gc_map1[] = { 9, 8, 7 };
- const uint8_t raw_gc_map2[] = { 6, 7, 8, 9 };
- ArrayRef<const uint8_t> gc_map[] = {
- ArrayRef<const uint8_t>(raw_gc_map1),
- ArrayRef<const uint8_t>(raw_gc_map2),
- };
const uint8_t raw_cfi_info1[] = { 1, 3, 5 };
const uint8_t raw_cfi_info2[] = { 8, 6, 4, 2 };
ArrayRef<const uint8_t> cfi_info[] = {
@@ -102,49 +90,37 @@
compiled_methods.reserve(1u << 7);
for (auto&& c : code) {
for (auto&& s : src_map) {
- for (auto&& m : mapping_table) {
- for (auto&& v : vmap_table) {
- for (auto&& g : gc_map) {
- for (auto&& f : cfi_info) {
- for (auto&& p : patches) {
- compiled_methods.push_back(CompiledMethod::SwapAllocCompiledMethod(
- &driver, kNone, c, 0u, 0u, 0u, s, m, v, g, f, p));
- }
- }
+ for (auto&& v : vmap_table) {
+ for (auto&& f : cfi_info) {
+ for (auto&& p : patches) {
+ compiled_methods.push_back(CompiledMethod::SwapAllocCompiledMethod(
+ &driver, kNone, c, 0u, 0u, 0u, s, v, f, p));
}
}
}
}
}
- constexpr size_t code_bit = 1u << 6;
- constexpr size_t src_map_bit = 1u << 5;
- constexpr size_t mapping_table_bit = 1u << 4;
- constexpr size_t vmap_table_bit = 1u << 3;
- constexpr size_t gc_map_bit = 1u << 2;
+ constexpr size_t code_bit = 1u << 4;
+ constexpr size_t src_map_bit = 1u << 3;
+ constexpr size_t vmap_table_bit = 1u << 2;
constexpr size_t cfi_info_bit = 1u << 1;
constexpr size_t patches_bit = 1u << 0;
- CHECK_EQ(compiled_methods.size(), 1u << 7);
+ CHECK_EQ(compiled_methods.size(), 1u << 5);
for (size_t i = 0; i != compiled_methods.size(); ++i) {
for (size_t j = 0; j != compiled_methods.size(); ++j) {
CompiledMethod* lhs = compiled_methods[i];
CompiledMethod* rhs = compiled_methods[j];
bool same_code = ((i ^ j) & code_bit) == 0u;
bool same_src_map = ((i ^ j) & src_map_bit) == 0u;
- bool same_mapping_table = ((i ^ j) & mapping_table_bit) == 0u;
bool same_vmap_table = ((i ^ j) & vmap_table_bit) == 0u;
- bool same_gc_map = ((i ^ j) & gc_map_bit) == 0u;
bool same_cfi_info = ((i ^ j) & cfi_info_bit) == 0u;
bool same_patches = ((i ^ j) & patches_bit) == 0u;
ASSERT_EQ(same_code, lhs->GetQuickCode().data() == rhs->GetQuickCode().data())
<< i << " " << j;
ASSERT_EQ(same_src_map, lhs->GetSrcMappingTable().data() == rhs->GetSrcMappingTable().data())
<< i << " " << j;
- ASSERT_EQ(same_mapping_table, lhs->GetMappingTable().data() == rhs->GetMappingTable().data())
- << i << " " << j;
ASSERT_EQ(same_vmap_table, lhs->GetVmapTable().data() == rhs->GetVmapTable().data())
<< i << " " << j;
- ASSERT_EQ(same_gc_map, lhs->GetGcMap().data() == rhs->GetGcMap().data())
- << i << " " << j;
ASSERT_EQ(same_cfi_info, lhs->GetCFIInfo().data() == rhs->GetCFIInfo().data())
<< i << " " << j;
ASSERT_EQ(same_patches, lhs->GetPatches().data() == rhs->GetPatches().data())