diff options
-rw-r--r-- | libartbase/base/bit_table.h | 8 | ||||
-rw-r--r-- | runtime/stack_map.cc | 2 | ||||
-rw-r--r-- | runtime/stack_map.h | 8 |
3 files changed, 11 insertions, 7 deletions
diff --git a/libartbase/base/bit_table.h b/libartbase/base/bit_table.h index 8036db1a16..ef2cf21e1f 100644 --- a/libartbase/base/bit_table.h +++ b/libartbase/base/bit_table.h @@ -139,14 +139,14 @@ class BitTableAccessor { static constexpr uint32_t kNumColumns = NumColumns; static constexpr uint32_t kNoValue = BitTableBase<kNumColumns>::kNoValue; - BitTableAccessor() {} BitTableAccessor(const BitTableBase<kNumColumns>* table, uint32_t row) : table_(table), row_(row) { + DCHECK(table_ != nullptr); } ALWAYS_INLINE uint32_t Row() const { return row_; } - ALWAYS_INLINE bool IsValid() const { return table_ != nullptr && row_ < table_->NumRows(); } + ALWAYS_INLINE bool IsValid() const { return row_ < table_->NumRows(); } ALWAYS_INLINE bool Equals(const BitTableAccessor& other) { return this->table_ == other.table_ && this->row_ == other.row_; @@ -228,6 +228,10 @@ class BitTable : public BitTableBase<Accessor::kNumColumns> { ALWAYS_INLINE Accessor GetRow(uint32_t row) const { return Accessor(this, row); } + + ALWAYS_INLINE Accessor GetInvalidRow() const { + return Accessor(this, static_cast<uint32_t>(-1)); + } }; template<typename Accessor> diff --git a/runtime/stack_map.cc b/runtime/stack_map.cc index f40168b8b8..5472d4cb4f 100644 --- a/runtime/stack_map.cc +++ b/runtime/stack_map.cc @@ -44,7 +44,7 @@ StackMap CodeInfo::GetStackMapForNativePcOffset(uint32_t pc, InstructionSet isa) return *it; } } - return StackMap(); + return stack_maps_.GetInvalidRow(); } // Scan backward to determine dex register locations at given stack map. diff --git a/runtime/stack_map.h b/runtime/stack_map.h index 7aac792523..c17efcff25 100644 --- a/runtime/stack_map.h +++ b/runtime/stack_map.h @@ -388,7 +388,7 @@ class CodeInfo { return stack_map; } } - return StackMap(); + return stack_maps_.GetInvalidRow(); } // Searches the stack map list backwards because catch stack maps are stored at the end. @@ -399,7 +399,7 @@ class CodeInfo { return stack_map; } } - return StackMap(); + return stack_maps_.GetInvalidRow(); } StackMap GetOsrStackMapForDexPc(uint32_t dex_pc) const { @@ -409,7 +409,7 @@ class CodeInfo { return stack_map; } } - return StackMap(); + return stack_maps_.GetInvalidRow(); } StackMap GetStackMapForNativePcOffset(uint32_t pc, InstructionSet isa = kRuntimeISA) const; @@ -421,7 +421,7 @@ class CodeInfo { return item; } } - return InvokeInfo(); + return invoke_infos_.GetInvalidRow(); } // Dump this CodeInfo object on `vios`. |