diff options
| author | 2018-07-15 23:58:44 +0100 | |
|---|---|---|
| committer | 2018-08-01 14:49:40 +0100 | |
| commit | 8cd54547cec8a4537db5682c2da8be22843b1310 (patch) | |
| tree | fb1158993bab2e027984cedab59b402c051a45a7 /compiler/driver | |
| parent | 91f0fdb4372d3f2bcfcd9db67afcbe7ee1901048 (diff) | |
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
Diffstat (limited to 'compiler/driver')
| -rw-r--r-- | compiler/driver/compiled_method_storage.cc | 11 | ||||
| -rw-r--r-- | compiler/driver/compiled_method_storage.h | 5 | ||||
| -rw-r--r-- | compiler/driver/compiled_method_storage_test.cc | 28 |
3 files changed, 8 insertions, 36 deletions
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<uint8_t>(swap_space_.get())), - dedupe_method_info_("dedupe method info", - LengthPrefixedArrayAlloc<uint8_t>(swap_space_.get())), dedupe_vmap_table_("dedupe vmap table", LengthPrefixedArrayAlloc<uint8_t>(swap_space_.get())), dedupe_cfi_info_("dedupe cfi info", LengthPrefixedArrayAlloc<uint8_t>(swap_space_.get())), @@ -185,15 +183,6 @@ void CompiledMethodStorage::ReleaseCode(const LengthPrefixedArray<uint8_t>* code ReleaseArrayIfNotDeduplicated(code); } -const LengthPrefixedArray<uint8_t>* CompiledMethodStorage::DeduplicateMethodInfo( - const ArrayRef<const uint8_t>& src_map) { - return AllocateOrDeduplicateArray(src_map, &dedupe_method_info_); -} - -void CompiledMethodStorage::ReleaseMethodInfo(const LengthPrefixedArray<uint8_t>* method_info) { - ReleaseArrayIfNotDeduplicated(method_info); -} - const LengthPrefixedArray<uint8_t>* CompiledMethodStorage::DeduplicateVMapTable( const ArrayRef<const uint8_t>& 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<uint8_t>* DeduplicateCode(const ArrayRef<const uint8_t>& code); void ReleaseCode(const LengthPrefixedArray<uint8_t>* code); - const LengthPrefixedArray<uint8_t>* DeduplicateMethodInfo( - const ArrayRef<const uint8_t>& method_info); - void ReleaseMethodInfo(const LengthPrefixedArray<uint8_t>* method_info); - const LengthPrefixedArray<uint8_t>* DeduplicateVMapTable(const ArrayRef<const uint8_t>& table); void ReleaseVMapTable(const LengthPrefixedArray<uint8_t>* table); @@ -120,7 +116,6 @@ class CompiledMethodStorage { bool dedupe_enabled_; ArrayDedupeSet<uint8_t> dedupe_code_; - ArrayDedupeSet<uint8_t> dedupe_method_info_; ArrayDedupeSet<uint8_t> dedupe_vmap_table_; ArrayDedupeSet<uint8_t> dedupe_cfi_info_; ArrayDedupeSet<linker::LinkerPatch> 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<const uint8_t>(raw_code1), ArrayRef<const uint8_t>(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<const uint8_t> method_info[] = { - ArrayRef<const uint8_t>(raw_method_info_map1), - ArrayRef<const uint8_t>(raw_method_info_map2), - }; 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[] = { @@ -77,38 +71,32 @@ TEST(CompiledMethodStorage, Deduplicate) { }; std::vector<CompiledMethod*> 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()) |