• Shu-yu Guo's avatar
    [shared-struct] Make publishing of shared objects safe · 4266684c
    Shu-yu Guo authored
    Currently there is nothing ensuring the internal VM state of shared
    objects are in a coherent state and visible to other threads when the
    shared object is published.
    
    This CL adds a store-store memory barrier when returning from Factory methods that allocate shared JSObjects that are exposed to user JS code. For primitives, there is an additional store-store memory barrier in the shared value barrier.
    
    Bug: v8:12547
    Change-Id: I4833c7ebf02cc352da9b006d2732669d6d043172
    Cq-Include-Trybots: luci.v8.try:v8_linux64_tsan_isolates_rel_ng,v8_linux64_tsan_rel_ng
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3819041
    Commit-Queue: Shu-yu Guo <syg@chromium.org>
    Reviewed-by: 's avatarDominik Inführ <dinfuehr@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#82596}
    4266684c
factory.h 47.4 KB