From ec32b91cfa1061b2608838d41e6d7d70fdf681dc Mon Sep 17 00:00:00 2001 From: Roland Levillain Date: Fri, 21 Oct 2016 14:47:26 +0100 Subject: [PATCH] Remove read barrier in UnstartedUnsafeCompareAndSwapLong. art::interpreter::UnstartedRuntime::UnstartedUnsafeCompareAndSwapLong manipulates a long field and does not need a read barrier (read barriers are only required when loading an object reference from the heap). Test: ART_USE_READ_BARRIER=true make test-art-host Bug: 12687968 Change-Id: Ia46590e649a7bb46ca4b3c90bab03fb3a836563d --- runtime/interpreter/unstarted_runtime.cc | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/runtime/interpreter/unstarted_runtime.cc b/runtime/interpreter/unstarted_runtime.cc index 25ce5cc4e..5a62bd77d 100644 --- a/runtime/interpreter/unstarted_runtime.cc +++ b/runtime/interpreter/unstarted_runtime.cc @@ -1238,19 +1238,6 @@ void UnstartedRuntime::UnstartedUnsafeCompareAndSwapLong( int64_t offset = shadow_frame->GetVRegLong(arg_offset + 2); int64_t expectedValue = shadow_frame->GetVRegLong(arg_offset + 4); int64_t newValue = shadow_frame->GetVRegLong(arg_offset + 6); - - // Must use non transactional mode. - if (kUseReadBarrier) { - // Need to make sure the reference stored in the field is a to-space one before attempting the - // CAS or the CAS could fail incorrectly. - mirror::HeapReference* field_addr = - reinterpret_cast*>( - reinterpret_cast(obj) + static_cast(offset)); - ReadBarrier::Barrier( - obj, - MemberOffset(offset), - field_addr); - } bool success; // Check whether we're in a transaction, call accordingly. if (Runtime::Current()->IsActiveTransaction()) { -- 2.11.0