From 342befe0186d5b405cad3fbce4508c782cce3491 Mon Sep 17 00:00:00 2001 From: Ulan Degenbaev Date: Wed, 17 Jan 2018 13:19:08 +0100 Subject: [PATCH] [heap, runtime] Make map.visitor_id accessor atomic. This is a workaround for false positive race reported by TSAN. Bug: v8:7315 Change-Id: I55712010dc5386a58b5ef7d48043e474f4b89bb9 Reviewed-on: https://chromium-review.googlesource.com/869672 Reviewed-by: Michael Lippautz Commit-Queue: Ulan Degenbaev Cr-Commit-Position: refs/heads/master@{#50654} --- src/objects/map-inl.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/objects/map-inl.h b/src/objects/map-inl.h index 3b4e274c32..b6e310e965 100644 --- a/src/objects/map-inl.h +++ b/src/objects/map-inl.h @@ -189,13 +189,14 @@ FixedArrayBase* Map::GetInitialElements() const { } VisitorId Map::visitor_id() const { - return static_cast(READ_BYTE_FIELD(this, kVisitorIdOffset)); + return static_cast( + RELAXED_READ_BYTE_FIELD(this, kVisitorIdOffset)); } void Map::set_visitor_id(VisitorId id) { DCHECK_LE(0, id); DCHECK_LT(id, 256); - WRITE_BYTE_FIELD(this, kVisitorIdOffset, static_cast(id)); + RELAXED_WRITE_BYTE_FIELD(this, kVisitorIdOffset, static_cast(id)); } int Map::instance_size_in_words() const {