[JSC] HeapSnapshotBuilder m_rootData should be protected with a lock too
authorysuzuki@apple.com <ysuzuki@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 1 Oct 2019 03:23:58 +0000 (03:23 +0000)
committerysuzuki@apple.com <ysuzuki@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 1 Oct 2019 03:23:58 +0000 (03:23 +0000)
commit428d8fe8dc61ead03ae97a687f272cb1fc440cd8
treea615c922d01397e99d2b6c83c7a3db99fc491d3e
parent41f0c0589b885a9be720fbc77fa4d2f25e1fa041
[JSC] HeapSnapshotBuilder m_rootData should be protected with a lock too
https://bugs.webkit.org/show_bug.cgi?id=202389
<rdar://problem/50717564>

Reviewed by Mark Lam.

JSTests:

* stress/heap-analyzer-taking-lock.js: Added.

Source/JavaScriptCore:

While we are protecting HeapSnapshotBuilder::m_edges with a lock, we are not protecting m_rootData, which is also concurrently modified.
This patch protects it.

* heap/HeapSnapshotBuilder.cpp:
(JSC::HeapSnapshotBuilder::setOpaqueRootReachabilityReasonForCell):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250541 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JSTests/ChangeLog
JSTests/stress/heap-analyzer-taking-lock.js [new file with mode: 0644]
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/heap/HeapSnapshotBuilder.cpp