Title: [245808] trunk/Source/_javascript_Core
- Revision
- 245808
- Author
- [email protected]
- Date
- 2019-05-28 01:45:02 -0700 (Tue, 28 May 2019)
Log Message
Unreviewed, revert r242070 due to Membuster regression
https://bugs.webkit.org/show_bug.cgi?id=195013
Membuster shows ~0.3% regression.
* heap/Heap.cpp:
(JSC::Heap::Heap):
(JSC::Heap::runBeginPhase):
* heap/Heap.h:
* heap/HeapInlines.h:
(JSC::Heap::forEachSlotVisitor):
(JSC::Heap::numberOfSlotVisitors): Deleted.
* heap/MarkingConstraintSolver.cpp:
(JSC::MarkingConstraintSolver::didVisitSomething const):
* heap/SlotVisitor.h:
Modified Paths
Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (245807 => 245808)
--- trunk/Source/_javascript_Core/ChangeLog 2019-05-28 06:36:34 UTC (rev 245807)
+++ trunk/Source/_javascript_Core/ChangeLog 2019-05-28 08:45:02 UTC (rev 245808)
@@ -1,3 +1,21 @@
+2019-05-28 Yusuke Suzuki <[email protected]>
+
+ Unreviewed, revert r242070 due to Membuster regression
+ https://bugs.webkit.org/show_bug.cgi?id=195013
+
+ Membuster shows ~0.3% regression.
+
+ * heap/Heap.cpp:
+ (JSC::Heap::Heap):
+ (JSC::Heap::runBeginPhase):
+ * heap/Heap.h:
+ * heap/HeapInlines.h:
+ (JSC::Heap::forEachSlotVisitor):
+ (JSC::Heap::numberOfSlotVisitors): Deleted.
+ * heap/MarkingConstraintSolver.cpp:
+ (JSC::MarkingConstraintSolver::didVisitSomething const):
+ * heap/SlotVisitor.h:
+
2019-05-27 Tadeu Zagallo <[email protected]>
Fix opensource build of testapi
Modified: trunk/Source/_javascript_Core/heap/Heap.cpp (245807 => 245808)
--- trunk/Source/_javascript_Core/heap/Heap.cpp 2019-05-28 06:36:34 UTC (rev 245807)
+++ trunk/Source/_javascript_Core/heap/Heap.cpp 2019-05-28 08:45:02 UTC (rev 245808)
@@ -301,6 +301,14 @@
, m_threadCondition(AutomaticThreadCondition::create())
{
m_worldState.store(0);
+
+ for (unsigned i = 0, numberOfParallelThreads = heapHelperPool().numberOfThreads(); i < numberOfParallelThreads; ++i) {
+ std::unique_ptr<SlotVisitor> visitor = std::make_unique<SlotVisitor>(*this, toCString("P", i + 1));
+ if (Options::optimizeParallelSlotVisitorsForStoppedMutator())
+ visitor->optimizeForStoppedMutator();
+ m_availableParallelSlotVisitors.append(visitor.get());
+ m_parallelSlotVisitors.append(WTFMove(visitor));
+ }
if (Options::useConcurrentGC()) {
if (Options::useStochasticMutatorScheduler())
@@ -1283,19 +1291,8 @@
SlotVisitor* slotVisitor;
{
LockHolder locker(m_parallelSlotVisitorLock);
- if (m_availableParallelSlotVisitors.isEmpty()) {
- std::unique_ptr<SlotVisitor> newVisitor = std::make_unique<SlotVisitor>(
- *this, toCString("P", m_parallelSlotVisitors.size() + 1));
-
- if (Options::optimizeParallelSlotVisitorsForStoppedMutator())
- newVisitor->optimizeForStoppedMutator();
-
- newVisitor->didStartMarking();
-
- slotVisitor = newVisitor.get();
- m_parallelSlotVisitors.append(WTFMove(newVisitor));
- } else
- slotVisitor = m_availableParallelSlotVisitors.takeLast();
+ RELEASE_ASSERT_WITH_MESSAGE(!m_availableParallelSlotVisitors.isEmpty(), "Parallel SlotVisitors are allocated apriori");
+ slotVisitor = m_availableParallelSlotVisitors.takeLast();
}
Thread::registerGCThread(GCThreadType::Helper);
Modified: trunk/Source/_javascript_Core/heap/Heap.h (245807 => 245808)
--- trunk/Source/_javascript_Core/heap/Heap.h 2019-05-28 06:36:34 UTC (rev 245807)
+++ trunk/Source/_javascript_Core/heap/Heap.h 2019-05-28 08:45:02 UTC (rev 245808)
@@ -393,7 +393,6 @@
template<typename Func>
void forEachSlotVisitor(const Func&);
- unsigned numberOfSlotVisitors();
Seconds totalGCTime() const { return m_totalGCTime; }
Modified: trunk/Source/_javascript_Core/heap/HeapInlines.h (245807 => 245808)
--- trunk/Source/_javascript_Core/heap/HeapInlines.h 2019-05-28 06:36:34 UTC (rev 245807)
+++ trunk/Source/_javascript_Core/heap/HeapInlines.h 2019-05-28 08:45:02 UTC (rev 245808)
@@ -272,7 +272,6 @@
template<typename Func>
void Heap::forEachSlotVisitor(const Func& func)
{
- auto locker = holdLock(m_parallelSlotVisitorLock);
func(*m_collectorSlotVisitor);
func(*m_mutatorSlotVisitor);
for (auto& slotVisitor : m_parallelSlotVisitors)
@@ -279,10 +278,4 @@
func(*slotVisitor);
}
-inline unsigned Heap::numberOfSlotVisitors()
-{
- auto locker = holdLock(m_parallelSlotVisitorLock);
- return m_parallelSlotVisitors.size() + 2; // m_collectorSlotVisitor and m_mutatorSlotVisitor
-}
-
} // namespace JSC
Modified: trunk/Source/_javascript_Core/heap/MarkingConstraintSolver.cpp (245807 => 245808)
--- trunk/Source/_javascript_Core/heap/MarkingConstraintSolver.cpp 2019-05-28 06:36:34 UTC (rev 245807)
+++ trunk/Source/_javascript_Core/heap/MarkingConstraintSolver.cpp 2019-05-28 08:45:02 UTC (rev 245808)
@@ -52,10 +52,6 @@
if (visitCounter.visitCount())
return true;
}
- // If the number of SlotVisitors increases after creating m_visitCounters,
- // we conservatively say there could be something visited by added SlotVisitors.
- if (m_heap.numberOfSlotVisitors() > m_visitCounters.size())
- return true;
return false;
}
Modified: trunk/Source/_javascript_Core/heap/SlotVisitor.h (245807 => 245808)
--- trunk/Source/_javascript_Core/heap/SlotVisitor.h 2019-05-28 06:36:34 UTC (rev 245807)
+++ trunk/Source/_javascript_Core/heap/SlotVisitor.h 2019-05-28 08:45:02 UTC (rev 245808)
@@ -259,6 +259,8 @@
MarkingConstraint* m_currentConstraint { nullptr };
MarkingConstraintSolver* m_currentSolver { nullptr };
+ // Put padding here to mitigate false sharing between multiple SlotVisitors.
+ char padding[64];
public:
#if !ASSERT_DISABLED
bool m_isCheckingForDefaultMarkViolation;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes