Title: [209767] trunk/Source/_javascript_Core
- Revision
- 209767
- Author
- [email protected]
- Date
- 2016-12-13 12:14:51 -0800 (Tue, 13 Dec 2016)
Log Message
Add null checks to opaque root APIs.
Rubber stamped by Saam Barati.
If we got a crash report about null in the opaque root HashSet, we would probably not
celebrate how great it is that we found out about a new race - instead we would probably
be annoyed that null wasn't just silently ignored.
* heap/SlotVisitor.cpp:
(JSC::SlotVisitor::addOpaqueRoot):
(JSC::SlotVisitor::containsOpaqueRoot):
(JSC::SlotVisitor::containsOpaqueRootTriState):
Modified Paths
Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (209766 => 209767)
--- trunk/Source/_javascript_Core/ChangeLog 2016-12-13 19:54:15 UTC (rev 209766)
+++ trunk/Source/_javascript_Core/ChangeLog 2016-12-13 20:14:51 UTC (rev 209767)
@@ -1,5 +1,20 @@
2016-12-13 Filip Pizlo <[email protected]>
+ Add null checks to opaque root APIs.
+
+ Rubber stamped by Saam Barati.
+
+ If we got a crash report about null in the opaque root HashSet, we would probably not
+ celebrate how great it is that we found out about a new race - instead we would probably
+ be annoyed that null wasn't just silently ignored.
+
+ * heap/SlotVisitor.cpp:
+ (JSC::SlotVisitor::addOpaqueRoot):
+ (JSC::SlotVisitor::containsOpaqueRoot):
+ (JSC::SlotVisitor::containsOpaqueRootTriState):
+
+2016-12-13 Filip Pizlo <[email protected]>
+
Make opaque root scanning truly constraint-based
https://bugs.webkit.org/show_bug.cgi?id=165760
Modified: trunk/Source/_javascript_Core/heap/SlotVisitor.cpp (209766 => 209767)
--- trunk/Source/_javascript_Core/heap/SlotVisitor.cpp 2016-12-13 19:54:15 UTC (rev 209766)
+++ trunk/Source/_javascript_Core/heap/SlotVisitor.cpp 2016-12-13 20:14:51 UTC (rev 209767)
@@ -600,6 +600,9 @@
void SlotVisitor::addOpaqueRoot(void* root)
{
+ if (!root)
+ return;
+
if (Options::numberOfGCMarkers() == 1) {
// Put directly into the shared HashSet.
m_heap.m_opaqueRoots.add(root);
@@ -625,6 +628,9 @@
bool SlotVisitor::containsOpaqueRoot(void* root) const
{
+ if (!root)
+ return false;
+
ASSERT(!m_isInParallelMode);
return m_heap.m_opaqueRoots.contains(root);
}
@@ -631,6 +637,9 @@
TriState SlotVisitor::containsOpaqueRootTriState(void* root) const
{
+ if (!root)
+ return FalseTriState;
+
if (m_opaqueRoots.contains(root))
return TrueTriState;
std::lock_guard<Lock> lock(m_heap.m_opaqueRootsMutex);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes