diff options
| -rw-r--r-- | compiler/optimizing/code_generator.cc | 1 | ||||
| -rw-r--r-- | runtime/gc/collector/semi_space.cc | 5 | ||||
| -rw-r--r-- | runtime/oat_file.cc | 9 |
3 files changed, 12 insertions, 3 deletions
diff --git a/compiler/optimizing/code_generator.cc b/compiler/optimizing/code_generator.cc index d8e442c642..c2e83cd2c2 100644 --- a/compiler/optimizing/code_generator.cc +++ b/compiler/optimizing/code_generator.cc @@ -1126,6 +1126,7 @@ void CodeGenerator::RecordPcInfo(HInstruction* instruction, if (osr) { DCHECK_EQ(info->GetSuspendCheck(), instruction); DCHECK(info->IsIrreducible()); + DCHECK(environment != nullptr); if (kIsDebugBuild) { for (size_t i = 0, environment_size = environment->Size(); i < environment_size; ++i) { HInstruction* in_environment = environment->GetInstructionAt(i); diff --git a/runtime/gc/collector/semi_space.cc b/runtime/gc/collector/semi_space.cc index 19b1fc7878..15e0711948 100644 --- a/runtime/gc/collector/semi_space.cc +++ b/runtime/gc/collector/semi_space.cc @@ -736,7 +736,8 @@ void SemiSpace::ScanObject(Object* obj) { void SemiSpace::ProcessMarkStack() { TimingLogger::ScopedTiming t(__FUNCTION__, GetTimings()); accounting::ContinuousSpaceBitmap* live_bitmap = nullptr; - if (collect_from_space_only_) { + const bool collect_from_space_only = collect_from_space_only_; + if (collect_from_space_only) { // If a bump pointer space only collection (and the promotion is // enabled,) we delay the live-bitmap marking of promoted objects // from MarkObject() until this function. @@ -748,7 +749,7 @@ void SemiSpace::ProcessMarkStack() { } while (!mark_stack_->IsEmpty()) { Object* obj = mark_stack_->PopBack(); - if (collect_from_space_only_ && promo_dest_space_->HasAddress(obj)) { + if (collect_from_space_only && promo_dest_space_->HasAddress(obj)) { // obj has just been promoted. Mark the live bitmap for it, // which is delayed from MarkObject(). DCHECK(!live_bitmap->Test(obj)); diff --git a/runtime/oat_file.cc b/runtime/oat_file.cc index af87637d57..c1ccd33774 100644 --- a/runtime/oat_file.cc +++ b/runtime/oat_file.cc @@ -33,6 +33,7 @@ #include "android/dlext.h" #endif +#include <android-base/logging.h> #include "android-base/stringprintf.h" #include "art_method.h" @@ -467,6 +468,7 @@ static void DCheckIndexToBssMapping(OatFile* oat_file, } prev_entry = &entry; } + CHECK(prev_entry != nullptr); CHECK_LT(prev_entry->GetIndex(index_bits), number_of_indexes); } } @@ -1755,11 +1757,15 @@ OatDexFile::OatDexFile(const OatFile* oat_file, } } -OatDexFile::OatDexFile(TypeLookupTable&& lookup_table) : lookup_table_(std::move(lookup_table)) {} +OatDexFile::OatDexFile(TypeLookupTable&& lookup_table) : lookup_table_(std::move(lookup_table)) { + // Stripped-down OatDexFile only allowed in the compiler. + CHECK(Runtime::Current() == nullptr || Runtime::Current()->IsAotCompiler()); +} OatDexFile::~OatDexFile() {} size_t OatDexFile::FileSize() const { + DCHECK(dex_file_pointer_ != nullptr); return reinterpret_cast<const DexFile::Header*>(dex_file_pointer_)->file_size_; } @@ -1779,6 +1785,7 @@ std::unique_ptr<const DexFile> OatDexFile::OpenDexFile(std::string* error_msg) c } uint32_t OatDexFile::GetOatClassOffset(uint16_t class_def_index) const { + DCHECK(oat_class_offsets_pointer_ != nullptr); return oat_class_offsets_pointer_[class_def_index]; } |