From 8cd54547cec8a4537db5682c2da8be22843b1310 Mon Sep 17 00:00:00 2001 From: David Srbecky Date: Sun, 15 Jul 2018 23:58:44 +0100 Subject: Move MethodInfo to CodeInfo. There is no need to treat it specially any more, because of the de-duplication at BitTable level. This saves 0.6% of oat file size. Test: test-art-host-gtest Change-Id: Ife7927d736243879a41d6f325d49ebf6930a63f6 --- compiler/driver/compiled_method_storage.cc | 11 ---------- compiler/driver/compiled_method_storage.h | 5 ----- compiler/driver/compiled_method_storage_test.cc | 28 +++++++------------------ 3 files changed, 8 insertions(+), 36 deletions(-) (limited to 'compiler/driver') diff --git a/compiler/driver/compiled_method_storage.cc b/compiler/driver/compiled_method_storage.cc index d56b135aca..31062fb390 100644 --- a/compiler/driver/compiled_method_storage.cc +++ b/compiler/driver/compiled_method_storage.cc @@ -148,8 +148,6 @@ CompiledMethodStorage::CompiledMethodStorage(int swap_fd) : swap_space_(swap_fd == -1 ? nullptr : new SwapSpace(swap_fd, 10 * MB)), dedupe_enabled_(true), dedupe_code_("dedupe code", LengthPrefixedArrayAlloc(swap_space_.get())), - dedupe_method_info_("dedupe method info", - LengthPrefixedArrayAlloc(swap_space_.get())), dedupe_vmap_table_("dedupe vmap table", LengthPrefixedArrayAlloc(swap_space_.get())), dedupe_cfi_info_("dedupe cfi info", LengthPrefixedArrayAlloc(swap_space_.get())), @@ -185,15 +183,6 @@ void CompiledMethodStorage::ReleaseCode(const LengthPrefixedArray* code ReleaseArrayIfNotDeduplicated(code); } -const LengthPrefixedArray* CompiledMethodStorage::DeduplicateMethodInfo( - const ArrayRef& src_map) { - return AllocateOrDeduplicateArray(src_map, &dedupe_method_info_); -} - -void CompiledMethodStorage::ReleaseMethodInfo(const LengthPrefixedArray* method_info) { - ReleaseArrayIfNotDeduplicated(method_info); -} - const LengthPrefixedArray* CompiledMethodStorage::DeduplicateVMapTable( const ArrayRef& table) { return AllocateOrDeduplicateArray(table, &dedupe_vmap_table_); diff --git a/compiler/driver/compiled_method_storage.h b/compiler/driver/compiled_method_storage.h index 1634facb7c..a5a7691e12 100644 --- a/compiler/driver/compiled_method_storage.h +++ b/compiler/driver/compiled_method_storage.h @@ -54,10 +54,6 @@ class CompiledMethodStorage { const LengthPrefixedArray* DeduplicateCode(const ArrayRef& code); void ReleaseCode(const LengthPrefixedArray* code); - const LengthPrefixedArray* DeduplicateMethodInfo( - const ArrayRef& method_info); - void ReleaseMethodInfo(const LengthPrefixedArray* method_info); - const LengthPrefixedArray* DeduplicateVMapTable(const ArrayRef& table); void ReleaseVMapTable(const LengthPrefixedArray* table); @@ -120,7 +116,6 @@ class CompiledMethodStorage { bool dedupe_enabled_; ArrayDedupeSet dedupe_code_; - ArrayDedupeSet dedupe_method_info_; ArrayDedupeSet dedupe_vmap_table_; ArrayDedupeSet dedupe_cfi_info_; ArrayDedupeSet dedupe_linker_patches_; diff --git a/compiler/driver/compiled_method_storage_test.cc b/compiler/driver/compiled_method_storage_test.cc index 14d1e191ca..5e2f444a24 100644 --- a/compiler/driver/compiled_method_storage_test.cc +++ b/compiler/driver/compiled_method_storage_test.cc @@ -45,12 +45,6 @@ TEST(CompiledMethodStorage, Deduplicate) { ArrayRef(raw_code1), ArrayRef(raw_code2), }; - const uint8_t raw_method_info_map1[] = { 1u, 2u, 3u, 4u, 5u, 6u }; - const uint8_t raw_method_info_map2[] = { 8u, 7u, 6u, 5u, 4u, 3u, 2u, 1u }; - ArrayRef method_info[] = { - ArrayRef(raw_method_info_map1), - ArrayRef(raw_method_info_map2), - }; const uint8_t raw_vmap_table1[] = { 2, 4, 6 }; const uint8_t raw_vmap_table2[] = { 7, 5, 3, 1 }; ArrayRef vmap_table[] = { @@ -77,38 +71,32 @@ TEST(CompiledMethodStorage, Deduplicate) { }; std::vector compiled_methods; - compiled_methods.reserve(1u << 7); + compiled_methods.reserve(1u << 4); for (auto&& c : code) { - for (auto&& s : method_info) { - for (auto&& v : vmap_table) { - for (auto&& f : cfi_info) { - for (auto&& p : patches) { - compiled_methods.push_back(CompiledMethod::SwapAllocCompiledMethod( - &driver, InstructionSet::kNone, c, s, v, f, p)); - } + for (auto&& v : vmap_table) { + for (auto&& f : cfi_info) { + for (auto&& p : patches) { + compiled_methods.push_back(CompiledMethod::SwapAllocCompiledMethod( + &driver, InstructionSet::kNone, c, v, f, p)); } } } } - constexpr size_t code_bit = 1u << 4; - constexpr size_t src_map_bit = 1u << 3; + constexpr size_t code_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 << 5); + CHECK_EQ(compiled_methods.size(), 1u << 4); 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_vmap_table = ((i ^ j) & vmap_table_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->GetMethodInfo().data() == rhs->GetMethodInfo().data()) - << i << " " << j; ASSERT_EQ(same_vmap_table, lhs->GetVmapTable().data() == rhs->GetVmapTable().data()) << i << " " << j; ASSERT_EQ(same_cfi_info, lhs->GetCFIInfo().data() == rhs->GetCFIInfo().data()) -- cgit v1.2.3-59-g8ed1b