diff options
| author | 2012-09-18 13:47:36 -0700 | |
|---|---|---|
| committer | 2012-09-18 13:53:50 -0700 | |
| commit | 46c6bb2f52cef82660b9be7576b49f83845df93a (patch) | |
| tree | 3e9768b404a987e481a240a52ee07756323120d9 | |
| parent | e8c819e7dfd1fa9205465843df595f6f227d2d73 (diff) | |
Rename PcToReferenceMap adding Dex.
Change-Id: I21ebfe9ac7fd8a627299f1f721eb4b11c87642dc
| -rw-r--r-- | src/oatdump.cc | 4 | ||||
| -rw-r--r-- | src/thread.cc | 2 | ||||
| -rw-r--r-- | src/verifier/gc_map.cc | 6 | ||||
| -rw-r--r-- | src/verifier/gc_map.h | 10 | ||||
| -rw-r--r-- | src/verifier/method_verifier.cc | 8 | ||||
| -rw-r--r-- | src/verifier/method_verifier.h | 2 | ||||
| -rw-r--r-- | test/ReferenceMap/stack_walk_refmap_jni.cc | 2 | ||||
| -rw-r--r-- | test/StackWalk/stack_walk_jni.cc | 2 |
8 files changed, 18 insertions, 18 deletions
diff --git a/src/oatdump.cc b/src/oatdump.cc index 86137d5bd2..54183bbfb2 100644 --- a/src/oatdump.cc +++ b/src/oatdump.cc @@ -394,9 +394,9 @@ class OatDumper { } uint32_t gc_map_length = (gc_map_raw[0] << 24) | (gc_map_raw[1] << 16) | (gc_map_raw[2] << 8) | (gc_map_raw[3] << 0); - verifier::PcToReferenceMap map(gc_map_raw + sizeof(uint32_t), gc_map_length); + verifier::DexPcToReferenceMap map(gc_map_raw + sizeof(uint32_t), gc_map_length); for (size_t entry = 0; entry < map.NumEntries(); entry++) { - os << StringPrintf("\t\t\t0x%04x", map.GetPC(entry)); + os << StringPrintf("\t\t\t0x%04x", map.GetDexPc(entry)); size_t num_regs = map.RegWidth() * 8; const uint8_t* reg_bitmap = map.GetBitMap(entry); bool first = true; diff --git a/src/thread.cc b/src/thread.cc index e45ed48d94..e3bbc4d092 100644 --- a/src/thread.cc +++ b/src/thread.cc @@ -1714,7 +1714,7 @@ class ReferenceMapVisitor : public StackVisitor { CHECK(gc_map != NULL) << PrettyMethod(m); uint32_t gc_map_length = m->GetGcMapLength(); CHECK_NE(0U, gc_map_length) << PrettyMethod(m); - verifier::PcToReferenceMap map(gc_map, gc_map_length); + verifier::DexPcToReferenceMap map(gc_map, gc_map_length); const uint8_t* reg_bitmap = map.FindBitMap(GetDexPc()); CHECK(reg_bitmap != NULL); const VmapTable vmap_table(m->GetVmapTableRaw()); diff --git a/src/verifier/gc_map.cc b/src/verifier/gc_map.cc index a9d481e221..66cb6c77c1 100644 --- a/src/verifier/gc_map.cc +++ b/src/verifier/gc_map.cc @@ -21,13 +21,13 @@ namespace art { namespace verifier { -const uint8_t* PcToReferenceMap::FindBitMap(uint16_t dex_pc, bool error_if_not_present) const { +const uint8_t* DexPcToReferenceMap::FindBitMap(uint16_t dex_pc, bool error_if_not_present) const { size_t num_entries = NumEntries(); // Do linear or binary search? static const size_t kSearchThreshold = 8; if (num_entries < kSearchThreshold) { for (size_t i = 0; i < num_entries; i++) { - if (GetPC(i) == dex_pc) { + if (GetDexPc(i) == dex_pc) { return GetBitMap(i); } } @@ -36,7 +36,7 @@ const uint8_t* PcToReferenceMap::FindBitMap(uint16_t dex_pc, bool error_if_not_p int hi = num_entries -1; while (hi >= lo) { int mid = (hi + lo) / 2; - int mid_pc = GetPC(mid); + int mid_pc = GetDexPc(mid); if (dex_pc > mid_pc) { lo = mid + 1; } else if (dex_pc < mid_pc) { diff --git a/src/verifier/gc_map.h b/src/verifier/gc_map.h index 07f6317934..d6a1c46c31 100644 --- a/src/verifier/gc_map.h +++ b/src/verifier/gc_map.h @@ -34,10 +34,10 @@ enum RegisterMapFormat { kRegMapFormatCompact16 = 3, // Compact layout, 16-bit addresses. }; -// Lightweight wrapper for PC to reference bit maps. -class PcToReferenceMap { +// Lightweight wrapper for Dex PC to reference bit maps. +class DexPcToReferenceMap { public: - PcToReferenceMap(const uint8_t* data, size_t data_length) { + DexPcToReferenceMap(const uint8_t* data, size_t data_length) { data_ = data; CHECK(data_ != NULL); // Check the size of the table agrees with the number of entries @@ -50,8 +50,8 @@ class PcToReferenceMap { return GetData()[2] | (GetData()[3] << 8); } - // Get the PC at the given index - uint16_t GetPC(size_t index) const { + // Get the Dex PC at the given index + uint16_t GetDexPc(size_t index) const { size_t entry_offset = index * EntryWidth(); if (PcWidth() == 1) { return Table()[entry_offset]; diff --git a/src/verifier/method_verifier.cc b/src/verifier/method_verifier.cc index 8cbf23e513..a01aa8db48 100644 --- a/src/verifier/method_verifier.cc +++ b/src/verifier/method_verifier.cc @@ -3163,8 +3163,8 @@ const std::vector<uint8_t>* MethodVerifier::GenerateGcMap() { return NULL; } // Write table header - table->push_back(format | ((ref_bitmap_bytes >> PcToReferenceMap::kRegMapFormatShift) & - ~PcToReferenceMap::kRegMapFormatMask)); + table->push_back(format | ((ref_bitmap_bytes >> DexPcToReferenceMap::kRegMapFormatShift) & + ~DexPcToReferenceMap::kRegMapFormatMask)); table->push_back(ref_bitmap_bytes & 0xFF); table->push_back(num_entries & 0xFF); table->push_back((num_entries >> 8) & 0xFF); @@ -3186,13 +3186,13 @@ const std::vector<uint8_t>* MethodVerifier::GenerateGcMap() { void MethodVerifier::VerifyGcMap(const std::vector<uint8_t>& data) { // Check that for every GC point there is a map entry, there aren't entries for non-GC points, // that the table data is well formed and all references are marked (or not) in the bitmap - PcToReferenceMap map(&data[0], data.size()); + DexPcToReferenceMap map(&data[0], data.size()); size_t map_index = 0; for (size_t i = 0; i < code_item_->insns_size_in_code_units_; i++) { const uint8_t* reg_bitmap = map.FindBitMap(i, false); if (insn_flags_[i].IsGcPoint()) { CHECK_LT(map_index, map.NumEntries()); - CHECK_EQ(map.GetPC(map_index), i); + CHECK_EQ(map.GetDexPc(map_index), i); CHECK_EQ(map.GetBitMap(map_index), reg_bitmap); map_index++; RegisterLine* line = reg_table_.GetLine(i); diff --git a/src/verifier/method_verifier.h b/src/verifier/method_verifier.h index 7eaf672c89..92621efff6 100644 --- a/src/verifier/method_verifier.h +++ b/src/verifier/method_verifier.h @@ -49,7 +49,7 @@ namespace verifier { class MethodVerifier; class InsnFlags; -class PcToReferenceMap; +class DexPcToReferenceMap; /* * "Direct" and "virtual" methods are stored independently. The type of call used to invoke the diff --git a/test/ReferenceMap/stack_walk_refmap_jni.cc b/test/ReferenceMap/stack_walk_refmap_jni.cc index e6d652de66..8cb1ed2b49 100644 --- a/test/ReferenceMap/stack_walk_refmap_jni.cc +++ b/test/ReferenceMap/stack_walk_refmap_jni.cc @@ -55,7 +55,7 @@ struct ReferenceMap2Visitor : public StackVisitor { } LOG(INFO) << "At " << PrettyMethod(m, false); - verifier::PcToReferenceMap map(m->GetGcMap(), m->GetGcMapLength()); + verifier::DexPcToReferenceMap map(m->GetGcMap(), m->GetGcMapLength()); if (m->IsCalleeSaveMethod()) { LOG(WARNING) << "no PC for " << PrettyMethod(m); diff --git a/test/StackWalk/stack_walk_jni.cc b/test/StackWalk/stack_walk_jni.cc index 444eaed818..5fdb92fb0d 100644 --- a/test/StackWalk/stack_walk_jni.cc +++ b/test/StackWalk/stack_walk_jni.cc @@ -58,7 +58,7 @@ struct TestReferenceMapVisitor : public StackVisitor { } const uint8_t* reg_bitmap = NULL; if (!IsShadowFrame()) { - verifier::PcToReferenceMap map(m->GetGcMap(), m->GetGcMapLength()); + verifier::DexPcToReferenceMap map(m->GetGcMap(), m->GetGcMapLength()); reg_bitmap = map.FindBitMap(GetDexPc()); } MethodHelper mh(m); |