diff --git a/src/v8.cc b/src/v8.cc index 95cf3adce1..eaa6764358 100644 --- a/src/v8.cc +++ b/src/v8.cc @@ -6,6 +6,7 @@ #include "src/api.h" #include "src/assembler.h" +#include "src/base/atomicops.h" #include "src/base/once.h" #include "src/base/platform/platform.h" #include "src/bootstrapper.h" @@ -109,13 +110,16 @@ void V8::ShutdownPlatform() { v8::Platform* V8::GetCurrentPlatform() { - DCHECK(platform_); - return platform_; + v8::Platform* platform = reinterpret_cast( + base::Relaxed_Load(reinterpret_cast(&platform_))); + DCHECK(platform); + return platform; } - -void V8::SetPlatformForTesting(v8::Platform* platform) { platform_ = platform; } - +void V8::SetPlatformForTesting(v8::Platform* platform) { + base::Relaxed_Store(reinterpret_cast(&platform_), + reinterpret_cast(platform)); +} void V8::SetNativesBlob(StartupData* natives_blob) { #ifdef V8_USE_EXTERNAL_STARTUP_DATA diff --git a/test/mjsunit/regress/regress-430201.js b/test/mjsunit/regress/regress-430201.js index b53383e22e..dfd1346a01 100644 --- a/test/mjsunit/regress/regress-430201.js +++ b/test/mjsunit/regress/regress-430201.js @@ -25,7 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --allow-natives-syntax --expose-gc +// Flags: --allow-natives-syntax --expose-gc --nostress-incremental-marking var array_1 = [];