summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--runtime/gc/accounting/space_bitmap-inl.h2
-rw-r--r--runtime/gc/heap.cc2
2 files changed, 3 insertions, 1 deletions
diff --git a/runtime/gc/accounting/space_bitmap-inl.h b/runtime/gc/accounting/space_bitmap-inl.h
index a8dabde716..702a78731d 100644
--- a/runtime/gc/accounting/space_bitmap-inl.h
+++ b/runtime/gc/accounting/space_bitmap-inl.h
@@ -32,6 +32,7 @@ namespace accounting {
template<size_t kAlignment>
inline bool SpaceBitmap<kAlignment>::AtomicTestAndSet(const mirror::Object* obj) {
+ DCHECK(obj != nullptr);
uintptr_t addr = reinterpret_cast<uintptr_t>(obj);
DCHECK_GE(addr, heap_begin_);
const uintptr_t offset = addr - heap_begin_;
@@ -232,6 +233,7 @@ void SpaceBitmap<kAlignment>::Walk(Visitor&& visitor) {
template<size_t kAlignment>
template<bool kSetBit>
inline bool SpaceBitmap<kAlignment>::Modify(const mirror::Object* obj) {
+ DCHECK(obj != nullptr);
uintptr_t addr = reinterpret_cast<uintptr_t>(obj);
DCHECK_GE(addr, heap_begin_);
DCHECK(HasAddress(obj)) << obj;
diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc
index 531cbcf97b..dcb25a08d7 100644
--- a/runtime/gc/heap.cc
+++ b/runtime/gc/heap.cc
@@ -2688,7 +2688,7 @@ void Heap::MarkAllocStack(accounting::ContinuousSpaceBitmap* bitmap1,
const auto* limit = stack->End();
for (auto* it = stack->Begin(); it != limit; ++it) {
const mirror::Object* obj = it->AsMirrorPtr();
- if (!kUseThreadLocalAllocationStack || obj != nullptr) {
+ if (obj != nullptr) {
if (bitmap1->HasAddress(obj)) {
bitmap1->Set(obj);
} else if (bitmap2->HasAddress(obj)) {