Index: src/heap/spaces.h |
diff --git a/src/heap/spaces.h b/src/heap/spaces.h |
index fd477fa1cb88df15642e596ff6a313fab5146318..dc63e85a2aab4d0e88cfc176d38c2fc4fc76650d 100644 |
--- a/src/heap/spaces.h |
+++ b/src/heap/spaces.h |
@@ -552,10 +552,11 @@ class MemoryChunk { |
void set_prev_chunk(MemoryChunk* prev) { prev_chunk_.SetValue(prev); } |
Space* owner() const { |
- if ((reinterpret_cast<intptr_t>(owner_) & kPageHeaderTagMask) == |
- kPageHeaderTag) { |
- return reinterpret_cast<Space*>(reinterpret_cast<intptr_t>(owner_) - |
- kPageHeaderTag); |
+ intptr_t owner_value = base::NoBarrierAtomicValue<intptr_t>::FromAddress( |
+ const_cast<Address*>(&owner_)) |
+ ->Value(); |
+ if ((owner_value & kPageHeaderTagMask) == kPageHeaderTag) { |
+ return reinterpret_cast<Space*>(owner_value - kPageHeaderTag); |
} else { |
return nullptr; |
} |