diff options
Diffstat (limited to 'runtime/gc/heap-inl.h')
| -rw-r--r-- | runtime/gc/heap-inl.h | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/runtime/gc/heap-inl.h b/runtime/gc/heap-inl.h index 948d23303c..791d0378d1 100644 --- a/runtime/gc/heap-inl.h +++ b/runtime/gc/heap-inl.h @@ -37,6 +37,7 @@ #include "runtime.h" #include "thread-inl.h" #include "verify_object.h" +#include "write_barrier-inl.h" namespace art { namespace gc { @@ -151,7 +152,7 @@ inline mirror::Object* Heap::AllocObjectWithAllocator(Thread* self, // enabled. We don't need this for kAllocatorTypeRosAlloc/DlMalloc // cases because we don't directly allocate into the main alloc // space (besides promotions) under the SS/GSS collector. - WriteBarrierField(obj, mirror::Object::ClassOffset(), klass); + WriteBarrier::ForFieldWrite(obj, mirror::Object::ClassOffset(), klass); } pre_fence_visitor(obj, usable_size); QuasiAtomic::ThreadFenceForConstructor(); @@ -272,7 +273,7 @@ inline mirror::Object* Heap::TryToAllocate(Thread* self, } case kAllocatorTypeRosAlloc: { if (kInstrumented && UNLIKELY(is_running_on_memory_tool_)) { - // If running on valgrind or asan, we should be using the instrumented path. + // If running on ASan, we should be using the instrumented path. size_t max_bytes_tl_bulk_allocated = rosalloc_space_->MaxBytesBulkAllocatedFor(alloc_size); if (UNLIKELY(IsOutOfMemoryOnAllocation(allocator_type, max_bytes_tl_bulk_allocated, @@ -303,7 +304,7 @@ inline mirror::Object* Heap::TryToAllocate(Thread* self, } case kAllocatorTypeDlMalloc: { if (kInstrumented && UNLIKELY(is_running_on_memory_tool_)) { - // If running on valgrind, we should be using the instrumented path. + // If running on ASan, we should be using the instrumented path. ret = dlmalloc_space_->Alloc(self, alloc_size, bytes_allocated, @@ -418,22 +419,6 @@ inline void Heap::CheckConcurrentGC(Thread* self, } } -inline void Heap::WriteBarrierField(ObjPtr<mirror::Object> dst, - MemberOffset offset ATTRIBUTE_UNUSED, - ObjPtr<mirror::Object> new_value ATTRIBUTE_UNUSED) { - card_table_->MarkCard(dst.Ptr()); -} - -inline void Heap::WriteBarrierArray(ObjPtr<mirror::Object> dst, - int start_offset ATTRIBUTE_UNUSED, - size_t length ATTRIBUTE_UNUSED) { - card_table_->MarkCard(dst.Ptr()); -} - -inline void Heap::WriteBarrierEveryFieldOf(ObjPtr<mirror::Object> obj) { - card_table_->MarkCard(obj.Ptr()); -} - } // namespace gc } // namespace art |