summaryrefslogtreecommitdiffstats
path: root/dexlayout
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2018-02-20 16:53:37 -0800
committerMathieu Chartier <mathieuc@google.com>2018-02-20 18:17:21 -0800
commit5e3cfa295a44d4f1a0eb26134c6f866b27245a9f (patch)
treefa079fd6d865b1270a88248cd9919902ab387f46 /dexlayout
parent1efb431b478bbae9d959fad6a58863a4c1b0b47f (diff)
downloadandroid_art-5e3cfa295a44d4f1a0eb26134c6f866b27245a9f.tar.gz
android_art-5e3cfa295a44d4f1a0eb26134c6f866b27245a9f.tar.bz2
android_art-5e3cfa295a44d4f1a0eb26134c6f866b27245a9f.zip
Generalize CompactDexDebugInfo offset table
Renamed the class to CompactOffsetTable. Motivation: Use this table for quicken info offsets too. Bug: 72608794 Bug: 63756964 Test: test-art-host-gtest Change-Id: Idcb5355d8a5e4354bc3694152a7270047bed9d0a
Diffstat (limited to 'dexlayout')
-rw-r--r--dexlayout/compact_dex_writer.cc20
1 files changed, 10 insertions, 10 deletions
diff --git a/dexlayout/compact_dex_writer.cc b/dexlayout/compact_dex_writer.cc
index 39cf86d4b2..bd76bf11d3 100644
--- a/dexlayout/compact_dex_writer.cc
+++ b/dexlayout/compact_dex_writer.cc
@@ -19,8 +19,8 @@
#include "android-base/stringprintf.h"
#include "base/logging.h"
#include "base/time_utils.h"
-#include "dex/compact_dex_debug_info.h"
#include "dex/compact_dex_file.h"
+#include "dex/compact_offset_table.h"
#include "dexlayout.h"
namespace art {
@@ -76,12 +76,12 @@ uint32_t CompactDexWriter::WriteDebugInfoOffsetTable(Stream* stream) {
std::vector<uint8_t> data;
debug_info_base_ = 0u;
debug_info_offsets_table_offset_ = 0u;
- CompactDexDebugInfoOffsetTable::Build(debug_info_offsets,
- &data,
- &debug_info_base_,
- &debug_info_offsets_table_offset_);
+ CompactOffsetTable::Build(debug_info_offsets,
+ &data,
+ &debug_info_base_,
+ &debug_info_offsets_table_offset_);
// Align the table and write it out.
- stream->AlignTo(CompactDexDebugInfoOffsetTable::kAlignment);
+ stream->AlignTo(CompactOffsetTable::kAlignment);
debug_info_offsets_pos_ = stream->Tell();
stream->Write(data.data(), data.size());
@@ -90,12 +90,12 @@ uint32_t CompactDexWriter::WriteDebugInfoOffsetTable(Stream* stream) {
if (kMeasureAndTestOutput && !debug_info_offsets.empty()) {
uint64_t start_time = NanoTime();
stream->Begin();
- CompactDexDebugInfoOffsetTable::Accessor accessor(stream->Begin() + debug_info_offsets_pos_,
- debug_info_base_,
- debug_info_offsets_table_offset_);
+ CompactOffsetTable::Accessor accessor(stream->Begin() + debug_info_offsets_pos_,
+ debug_info_base_,
+ debug_info_offsets_table_offset_);
for (size_t i = 0; i < debug_info_offsets.size(); ++i) {
- CHECK_EQ(accessor.GetDebugInfoOffset(i), debug_info_offsets[i]);
+ CHECK_EQ(accessor.GetOffset(i), debug_info_offsets[i]);
}
uint64_t end_time = NanoTime();
VLOG(dex) << "Average lookup time (ns) for debug info offsets: "