diff options
Diffstat (limited to 'runtime/gc')
| -rw-r--r-- | runtime/gc/collector/concurrent_copying-inl.h | 1 | ||||
| -rw-r--r-- | runtime/gc/collector/concurrent_copying.cc | 6 | ||||
| -rw-r--r-- | runtime/gc/heap-inl.h | 2 | ||||
| -rw-r--r-- | runtime/gc/heap.cc | 1 |
4 files changed, 7 insertions, 3 deletions
diff --git a/runtime/gc/collector/concurrent_copying-inl.h b/runtime/gc/collector/concurrent_copying-inl.h index 7c649525e4..854d0a58ff 100644 --- a/runtime/gc/collector/concurrent_copying-inl.h +++ b/runtime/gc/collector/concurrent_copying-inl.h @@ -22,6 +22,7 @@ #include "gc/accounting/space_bitmap-inl.h" #include "gc/heap.h" #include "gc/space/region_space.h" +#include "mirror/object-inl.h" #include "lock_word.h" namespace art { diff --git a/runtime/gc/collector/concurrent_copying.cc b/runtime/gc/collector/concurrent_copying.cc index 0819ba04f7..f12ad8058d 100644 --- a/runtime/gc/collector/concurrent_copying.cc +++ b/runtime/gc/collector/concurrent_copying.cc @@ -1875,8 +1875,10 @@ class ConcurrentCopying::RefFieldsVisitor { // Scan ref fields of an object. inline void ConcurrentCopying::Scan(mirror::Object* to_ref) { - if (kDisallowReadBarrierDuringScan) { + if (kDisallowReadBarrierDuringScan && !Runtime::Current()->IsActiveTransaction()) { // Avoid all read barriers during visit references to help performance. + // Don't do this in transaction mode because we may read the old value of an field which may + // trigger read barriers. Thread::Current()->ModifyDebugDisallowReadBarrier(1); } DCHECK(!region_space_->IsInFromSpace(to_ref)); @@ -1885,7 +1887,7 @@ inline void ConcurrentCopying::Scan(mirror::Object* to_ref) { // Disable the read barrier for a performance reason. to_ref->VisitReferences</*kVisitNativeRoots*/true, kDefaultVerifyFlags, kWithoutReadBarrier>( visitor, visitor); - if (kDisallowReadBarrierDuringScan) { + if (kDisallowReadBarrierDuringScan && !Runtime::Current()->IsActiveTransaction()) { Thread::Current()->ModifyDebugDisallowReadBarrier(-1); } } diff --git a/runtime/gc/heap-inl.h b/runtime/gc/heap-inl.h index 54f221056a..394e541fd8 100644 --- a/runtime/gc/heap-inl.h +++ b/runtime/gc/heap-inl.h @@ -34,7 +34,7 @@ #include "handle_scope-inl.h" #include "thread-inl.h" #include "utils.h" -#include "verify_object-inl.h" +#include "verify_object.h" namespace art { namespace gc { diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc index aa15714595..fc475b5e5a 100644 --- a/runtime/gc/heap.cc +++ b/runtime/gc/heap.cc @@ -78,6 +78,7 @@ #include "scoped_thread_state_change-inl.h" #include "handle_scope-inl.h" #include "thread_list.h" +#include "verify_object-inl.h" #include "well_known_classes.h" namespace art { |