diff options
| author | 2017-03-16 13:17:50 -0700 | |
|---|---|---|
| committer | 2017-03-16 13:25:00 -0700 | |
| commit | 051071718085ce807a2e7c55278a8d723e238e86 (patch) | |
| tree | 396c41b8b887544f2905c5f97055e2f123c67730 | |
| parent | ed883a11b8cd7f3712bd30fca1e2b0fb641bff63 (diff) | |
Delete SrcMap
No longer used. SrcMapElem is still used by elf_debug_line_writer.h.
Address previous comments from aog/351387.
Test: make
Change-Id: Ib1525168b14889abbdc78ba20c64f3223b140a51
| -rw-r--r-- | compiler/compiled_method.h | 51 | ||||
| -rw-r--r-- | compiler/driver/compiled_method_storage.h | 1 | ||||
| -rw-r--r-- | compiler/driver/compiler_driver.h | 2 | ||||
| -rw-r--r-- | compiler/optimizing/optimizing_compiler.cc | 1 | ||||
| -rw-r--r-- | runtime/oat.h | 2 | ||||
| -rw-r--r-- | runtime/oat_quick_method_header.h | 1 |
6 files changed, 1 insertions, 57 deletions
diff --git a/compiler/compiled_method.h b/compiler/compiled_method.h index 23422570f0..aa529f8352 100644 --- a/compiler/compiled_method.h +++ b/compiler/compiled_method.h @@ -109,57 +109,6 @@ inline bool operator==(const SrcMapElem& lhs, const SrcMapElem& rhs) { return lhs.from_ == rhs.from_ && lhs.to_ == rhs.to_; } -template <class Allocator> -class SrcMap FINAL : public std::vector<SrcMapElem, Allocator> { - public: - using std::vector<SrcMapElem, Allocator>::begin; - using typename std::vector<SrcMapElem, Allocator>::const_iterator; - using std::vector<SrcMapElem, Allocator>::empty; - using std::vector<SrcMapElem, Allocator>::end; - using std::vector<SrcMapElem, Allocator>::resize; - using std::vector<SrcMapElem, Allocator>::shrink_to_fit; - using std::vector<SrcMapElem, Allocator>::size; - - explicit SrcMap() {} - explicit SrcMap(const Allocator& alloc) : std::vector<SrcMapElem, Allocator>(alloc) {} - - template <class InputIt> - SrcMap(InputIt first, InputIt last, const Allocator& alloc) - : std::vector<SrcMapElem, Allocator>(first, last, alloc) {} - - void push_back(const SrcMapElem& elem) { - if (!empty()) { - // Check that the addresses are inserted in sorted order. - DCHECK_GE(elem.from_, this->back().from_); - // If two consequitive entries map to the same value, ignore the later. - // E.g. for map {{0, 1}, {4, 1}, {8, 2}}, all values in [0,8) map to 1. - if (elem.to_ == this->back().to_) { - return; - } - } - std::vector<SrcMapElem, Allocator>::push_back(elem); - } - - // Returns true and the corresponding "to" value if the mapping is found. - // Oterwise returns false and 0. - std::pair<bool, int32_t> Find(uint32_t from) const { - // Finds first mapping such that lb.from_ >= from. - auto lb = std::lower_bound(begin(), end(), SrcMapElem {from, INT32_MIN}); - if (lb != end() && lb->from_ == from) { - // Found exact match. - return std::make_pair(true, lb->to_); - } else if (lb != begin()) { - // The previous mapping is still in effect. - return std::make_pair(true, (--lb)->to_); - } else { - // Not found because 'from' is smaller than first entry in the map. - return std::make_pair(false, 0); - } - } -}; - -using DefaultSrcMap = SrcMap<std::allocator<SrcMapElem>>; - class LinkerPatch { public: // Note: We explicitly specify the underlying type of the enum because GCC diff --git a/compiler/driver/compiled_method_storage.h b/compiler/driver/compiled_method_storage.h index b833702352..27011e8955 100644 --- a/compiler/driver/compiled_method_storage.h +++ b/compiler/driver/compiled_method_storage.h @@ -29,7 +29,6 @@ namespace art { class LinkerPatch; -class SrcMapElem; class CompiledMethodStorage { public: diff --git a/compiler/driver/compiler_driver.h b/compiler/driver/compiler_driver.h index cbde587241..874e35716c 100644 --- a/compiler/driver/compiler_driver.h +++ b/compiler/driver/compiler_driver.h @@ -65,8 +65,6 @@ class InstructionSetFeatures; class ParallelCompilationManager; class ScopedObjectAccess; template <class Allocator> class SrcMap; -class SrcMapElem; -using SwapSrcMap = SrcMap<SwapAllocator<SrcMapElem>>; template<class T> class Handle; class TimingLogger; class VdexFile; diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc index 8b1b04b462..23ccd9e953 100644 --- a/compiler/optimizing/optimizing_compiler.cc +++ b/compiler/optimizing/optimizing_compiler.cc @@ -1,4 +1,3 @@ - /* * Copyright (C) 2014 The Android Open Source Project * diff --git a/runtime/oat.h b/runtime/oat.h index 7943b0fead..190d533eff 100644 --- a/runtime/oat.h +++ b/runtime/oat.h @@ -32,7 +32,7 @@ class InstructionSetFeatures; class PACKED(4) OatHeader { public: static constexpr uint8_t kOatMagic[] = { 'o', 'a', 't', '\n' }; - static constexpr uint8_t kOatVersion[] = { '1', '1', '6', '\0' }; // Add method infos + static constexpr uint8_t kOatVersion[] = { '1', '1', '6', '\0' }; // Add method infos. static constexpr const char* kImageLocationKey = "image-location"; static constexpr const char* kDex2OatCmdLineKey = "dex2oat-cmdline"; diff --git a/runtime/oat_quick_method_header.h b/runtime/oat_quick_method_header.h index 07a4a9f2df..f2a2af2a5f 100644 --- a/runtime/oat_quick_method_header.h +++ b/runtime/oat_quick_method_header.h @@ -193,7 +193,6 @@ class PACKED(4) OatQuickMethodHeader { // The method info offset is not in the CodeInfo since CodeInfo has good dedupe properties that // would be lost from doing so. The method info memory region contains method indices since they // are hard to dedupe. - uint32_t method_info_offset_ = 0u; // The stack frame information. QuickMethodFrameInfo frame_info_; |