Title: [272830] trunk/Source/_javascript_Core
Revision
272830
Author
[email protected]
Date
2021-02-12 21:30:58 -0800 (Fri, 12 Feb 2021)

Log Message

Rename `slotVisitor` variables to `visitor`.
https://bugs.webkit.org/show_bug.cgi?id=221866

Reviewed by Yusuke Suzuki.

In existing code, we sometimes name a SlotVisitor instance `slotVisitor` and
sometimes just `visitor`.  This patch makes it so that we use `visitor` consistently
everywhere.  This will also reduce the size of the GC verifier patch later.

Also fixed a few typos in comments.

This is a pure refactoring patch.  There are no behavior changes.

* API/JSMarkingConstraintPrivate.cpp:
(JSContextGroupAddMarkingConstraint):
* bytecode/RecordedStatuses.cpp:
(JSC::RecordedStatuses::visitAggregate):
(JSC::RecordedStatuses::markIfCheap):
* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::blocksInPostOrder):
* heap/Heap.cpp:
(JSC::Heap::runBeginPhase):
(JSC::Heap::runFixpointPhase):
(JSC::Heap::runConcurrentPhase):
(JSC::Heap::stopThePeriphery):
(JSC::Heap::resumeThePeriphery):
(JSC::Heap::addCoreConstraints):
(JSC::Heap::performIncrement):
* heap/HeapInlines.h:
(JSC::Heap::forEachSlotVisitor):
* runtime/JSSegmentedVariableObject.cpp:
(JSC::JSSegmentedVariableObject::visitChildren):
* runtime/SamplingProfiler.cpp:
(JSC::SamplingProfiler::visit):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/API/JSMarkingConstraintPrivate.cpp (272829 => 272830)


--- trunk/Source/_javascript_Core/API/JSMarkingConstraintPrivate.cpp	2021-02-13 04:36:29 UTC (rev 272829)
+++ trunk/Source/_javascript_Core/API/JSMarkingConstraintPrivate.cpp	2021-02-13 05:30:58 UTC (rev 272830)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 Apple Inc.  All rights reserved.
+ * Copyright (C) 2017-2021 Apple Inc.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -73,12 +73,11 @@
     auto constraint = makeUnique<SimpleMarkingConstraint>(
         toCString("Amc", constraintIndex, "(", RawPointer(bitwise_cast<void*>(constraintCallback)), ")"),
         toCString("API Marking Constraint #", constraintIndex, " (", RawPointer(bitwise_cast<void*>(constraintCallback)), ", ", RawPointer(userData), ")"),
-        [constraintCallback, userData]
-        (SlotVisitor& slotVisitor) {
+        [constraintCallback, userData] (SlotVisitor& visitor) {
             Marker marker;
             marker.IsMarked = isMarked;
             marker.Mark = mark;
-            marker.visitor = &slotVisitor;
+            marker.visitor = &visitor;
             
             constraintCallback(&marker, userData);
         },

Modified: trunk/Source/_javascript_Core/ChangeLog (272829 => 272830)


--- trunk/Source/_javascript_Core/ChangeLog	2021-02-13 04:36:29 UTC (rev 272829)
+++ trunk/Source/_javascript_Core/ChangeLog	2021-02-13 05:30:58 UTC (rev 272830)
@@ -1,5 +1,42 @@
 2021-02-12  Mark Lam  <[email protected]>
 
+        Rename `slotVisitor` variables to `visitor`.
+        https://bugs.webkit.org/show_bug.cgi?id=221866
+
+        Reviewed by Yusuke Suzuki.
+
+        In existing code, we sometimes name a SlotVisitor instance `slotVisitor` and
+        sometimes just `visitor`.  This patch makes it so that we use `visitor` consistently
+        everywhere.  This will also reduce the size of the GC verifier patch later.
+
+        Also fixed a few typos in comments.
+
+        This is a pure refactoring patch.  There are no behavior changes.
+
+        * API/JSMarkingConstraintPrivate.cpp:
+        (JSContextGroupAddMarkingConstraint):
+        * bytecode/RecordedStatuses.cpp:
+        (JSC::RecordedStatuses::visitAggregate):
+        (JSC::RecordedStatuses::markIfCheap):
+        * dfg/DFGGraph.cpp:
+        (JSC::DFG::Graph::blocksInPostOrder):
+        * heap/Heap.cpp:
+        (JSC::Heap::runBeginPhase):
+        (JSC::Heap::runFixpointPhase):
+        (JSC::Heap::runConcurrentPhase):
+        (JSC::Heap::stopThePeriphery):
+        (JSC::Heap::resumeThePeriphery):
+        (JSC::Heap::addCoreConstraints):
+        (JSC::Heap::performIncrement):
+        * heap/HeapInlines.h:
+        (JSC::Heap::forEachSlotVisitor):
+        * runtime/JSSegmentedVariableObject.cpp:
+        (JSC::JSSegmentedVariableObject::visitChildren):
+        * runtime/SamplingProfiler.cpp:
+        (JSC::SamplingProfiler::visit):
+
+2021-02-12  Mark Lam  <[email protected]>
+
         Remove some unused methods in MarkedBlock and PreciseAllocation.
         https://bugs.webkit.org/show_bug.cgi?id=221864
 

Modified: trunk/Source/_javascript_Core/bytecode/RecordedStatuses.cpp (272829 => 272830)


--- trunk/Source/_javascript_Core/bytecode/RecordedStatuses.cpp	2021-02-13 04:36:29 UTC (rev 272829)
+++ trunk/Source/_javascript_Core/bytecode/RecordedStatuses.cpp	2021-02-13 05:30:58 UTC (rev 272830)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2018-2020 Apple Inc. All rights reserved.
+ * Copyright (C) 2018-2021 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -102,32 +102,32 @@
     return result;
 }
 
-void RecordedStatuses::visitAggregate(SlotVisitor& slotVisitor)
+void RecordedStatuses::visitAggregate(SlotVisitor& visitor)
 {
     for (auto& pair : gets)
-        pair.second->visitAggregate(slotVisitor);
+        pair.second->visitAggregate(visitor);
     for (auto& pair : deletes)
-        pair.second->visitAggregate(slotVisitor);
+        pair.second->visitAggregate(visitor);
     for (auto& pair : checkPrivateBrands)
-        pair.second->visitAggregate(slotVisitor);
+        pair.second->visitAggregate(visitor);
     for (auto& pair : setPrivateBrands)
-        pair.second->visitAggregate(slotVisitor);
+        pair.second->visitAggregate(visitor);
 }
 
-void RecordedStatuses::markIfCheap(SlotVisitor& slotVisitor)
+void RecordedStatuses::markIfCheap(SlotVisitor& visitor)
 {
     for (auto& pair : gets)
-        pair.second->markIfCheap(slotVisitor);
+        pair.second->markIfCheap(visitor);
     for (auto& pair : puts)
-        pair.second->markIfCheap(slotVisitor);
+        pair.second->markIfCheap(visitor);
     for (auto& pair : ins)
-        pair.second->markIfCheap(slotVisitor);
+        pair.second->markIfCheap(visitor);
     for (auto& pair : deletes)
-        pair.second->markIfCheap(slotVisitor);
+        pair.second->markIfCheap(visitor);
     for (auto& pair : checkPrivateBrands)
-        pair.second->markIfCheap(slotVisitor);
+        pair.second->markIfCheap(visitor);
     for (auto& pair : setPrivateBrands)
-        pair.second->markIfCheap(slotVisitor);
+        pair.second->markIfCheap(visitor);
 }
 
 void RecordedStatuses::finalizeWithoutDeleting(VM& vm)

Modified: trunk/Source/_javascript_Core/dfg/DFGGraph.cpp (272829 => 272830)


--- trunk/Source/_javascript_Core/dfg/DFGGraph.cpp	2021-02-13 04:36:29 UTC (rev 272829)
+++ trunk/Source/_javascript_Core/dfg/DFGGraph.cpp	2021-02-13 05:30:58 UTC (rev 272830)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011-2020 Apple Inc. All rights reserved.
+ * Copyright (C) 2011-2021 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -977,7 +977,7 @@
         }
     }
 
-    if (isSafeToValidate && validationEnabled()) { // There are users of this where we haven't yet built of the CFG enough to be able to run dominators.
+    if (isSafeToValidate && validationEnabled()) { // There are users of this where we haven't yet built the CFG enough to be able to run dominators.
         auto validateResults = [&] (auto& dominators) {
             // When iterating over reverse post order, we should see dominators
             // before things they dominate.

Modified: trunk/Source/_javascript_Core/heap/Heap.cpp (272829 => 272830)


--- trunk/Source/_javascript_Core/heap/Heap.cpp	2021-02-13 04:36:29 UTC (rev 272829)
+++ trunk/Source/_javascript_Core/heap/Heap.cpp	2021-02-13 05:30:58 UTC (rev 272830)
@@ -1297,27 +1297,27 @@
 
     m_helperClient.setFunction(
         [this] () {
-            SlotVisitor* slotVisitor;
+            SlotVisitor* visitor;
             {
                 LockHolder locker(m_parallelSlotVisitorLock);
                 RELEASE_ASSERT_WITH_MESSAGE(!m_availableParallelSlotVisitors.isEmpty(), "Parallel SlotVisitors are allocated apriori");
-                slotVisitor = m_availableParallelSlotVisitors.takeLast();
+                visitor = m_availableParallelSlotVisitors.takeLast();
             }
 
             Thread::registerGCThread(GCThreadType::Helper);
 
             {
-                ParallelModeEnabler parallelModeEnabler(*slotVisitor);
-                slotVisitor->drainFromShared(SlotVisitor::HelperDrain);
+                ParallelModeEnabler parallelModeEnabler(*visitor);
+                visitor->drainFromShared(SlotVisitor::HelperDrain);
             }
 
             {
                 LockHolder locker(m_parallelSlotVisitorLock);
-                m_availableParallelSlotVisitors.append(slotVisitor);
+                m_availableParallelSlotVisitors.append(visitor);
             }
         });
 
-    SlotVisitor& slotVisitor = *m_collectorSlotVisitor;
+    SlotVisitor& visitor = *m_collectorSlotVisitor;
 
     m_constraintSet->didStartMarking();
     
@@ -1325,19 +1325,19 @@
     if (UNLIKELY(Options::logGC()))
         m_scheduler->log();
     
-    // After this, we will almost certainly fall through all of the "slotVisitor.isEmpty()"
+    // After this, we will almost certainly fall through all of the "visitor.isEmpty()"
     // checks because bootstrap would have put things into the visitor. So, we should fall
     // through to draining.
     
-    if (!slotVisitor.didReachTermination()) {
+    if (!visitor.didReachTermination()) {
         dataLog("Fatal: SlotVisitor should think that GC should terminate before constraint solving, but it does not think this.\n");
-        dataLog("slotVisitor.isEmpty(): ", slotVisitor.isEmpty(), "\n");
-        dataLog("slotVisitor.collectorMarkStack().isEmpty(): ", slotVisitor.collectorMarkStack().isEmpty(), "\n");
-        dataLog("slotVisitor.mutatorMarkStack().isEmpty(): ", slotVisitor.mutatorMarkStack().isEmpty(), "\n");
+        dataLog("visitor.isEmpty(): ", visitor.isEmpty(), "\n");
+        dataLog("visitor.collectorMarkStack().isEmpty(): ", visitor.collectorMarkStack().isEmpty(), "\n");
+        dataLog("visitor.mutatorMarkStack().isEmpty(): ", visitor.mutatorMarkStack().isEmpty(), "\n");
         dataLog("m_numberOfActiveParallelMarkers: ", m_numberOfActiveParallelMarkers, "\n");
         dataLog("m_sharedCollectorMarkStack->isEmpty(): ", m_sharedCollectorMarkStack->isEmpty(), "\n");
         dataLog("m_sharedMutatorMarkStack->isEmpty(): ", m_sharedMutatorMarkStack->isEmpty(), "\n");
-        dataLog("slotVisitor.didReachTermination(): ", slotVisitor.didReachTermination(), "\n");
+        dataLog("visitor.didReachTermination(): ", visitor.didReachTermination(), "\n");
         RELEASE_ASSERT_NOT_REACHED();
     }
         
@@ -1348,13 +1348,13 @@
 {
     RELEASE_ASSERT(conn == GCConductor::Collector || m_currentThreadState);
     
-    SlotVisitor& slotVisitor = *m_collectorSlotVisitor;
+    SlotVisitor& visitor = *m_collectorSlotVisitor;
     
     if (UNLIKELY(Options::logGC())) {
         HashMap<const char*, size_t> visitMap;
         forEachSlotVisitor(
-            [&] (SlotVisitor& slotVisitor) {
-                visitMap.add(slotVisitor.codeName(), slotVisitor.bytesVisited() / 1024);
+            [&] (SlotVisitor& visitor) {
+                visitMap.add(visitor.codeName(), visitor.bytesVisited() / 1024);
             });
         
         auto perVisitorDump = sortedMapDump(
@@ -1367,7 +1367,7 @@
         dataLog("v=", bytesVisited() / 1024, "kb (", perVisitorDump, ") o=", m_opaqueRoots.size(), " b=", m_barriersExecuted, " ");
     }
         
-    if (slotVisitor.didReachTermination()) {
+    if (visitor.didReachTermination()) {
         m_opaqueRoots.deleteOldTables();
         
         m_scheduler->didReachTermination();
@@ -1382,11 +1382,11 @@
             
         // Wondering what this does? Look at Heap::addCoreConstraints(). The DOM and others can also
         // add their own using Heap::addMarkingConstraint().
-        bool converged = m_constraintSet->executeConvergence(slotVisitor);
+        bool converged = m_constraintSet->executeConvergence(visitor);
         
-        // FIXME: The slotVisitor.isEmpty() check is most likely not needed.
+        // FIXME: The visitor.isEmpty() check is most likely not needed.
         // https://bugs.webkit.org/show_bug.cgi?id=180310
-        if (converged && slotVisitor.isEmpty()) {
+        if (converged && visitor.isEmpty()) {
             assertMarkStacksEmpty();
             return changePhase(conn, CollectorPhase::End);
         }
@@ -1394,11 +1394,11 @@
         m_scheduler->didExecuteConstraints();
     }
         
-    dataLogIf(Options::logGC(), slotVisitor.collectorMarkStack().size(), "+", m_mutatorMarkStack->size() + slotVisitor.mutatorMarkStack().size(), " ");
+    dataLogIf(Options::logGC(), visitor.collectorMarkStack().size(), "+", m_mutatorMarkStack->size() + visitor.mutatorMarkStack().size(), " ");
         
     {
-        ParallelModeEnabler enabler(slotVisitor);
-        slotVisitor.drainInParallel(m_scheduler->timeToResume());
+        ParallelModeEnabler enabler(visitor);
+        visitor.drainInParallel(m_scheduler->timeToResume());
     }
         
     m_scheduler->synchronousDrainingDidStall();
@@ -1412,8 +1412,8 @@
     //
     // This doesn't have to check the mutator SlotVisitor because that one becomes empty after every GC
     // work increment, so it must be empty now.
-    if (slotVisitor.didReachTermination())
-        return true; // This is like relooping to the top if runFixpointPhase().
+    if (visitor.didReachTermination())
+        return true; // This is like relooping to the top of runFixpointPhase().
         
     if (!m_scheduler->shouldResume())
         return true;
@@ -1434,7 +1434,7 @@
 
 NEVER_INLINE bool Heap::runConcurrentPhase(GCConductor conn)
 {
-    SlotVisitor& slotVisitor = *m_collectorSlotVisitor;
+    SlotVisitor& visitor = *m_collectorSlotVisitor;
 
     switch (conn) {
     case GCConductor::Mutator: {
@@ -1441,19 +1441,19 @@
         // When the mutator has the conn, we poll runConcurrentPhase() on every time someone says
         // stopIfNecessary(), so on every allocation slow path. When that happens we poll if it's time
         // to stop and do some work.
-        if (slotVisitor.didReachTermination()
+        if (visitor.didReachTermination()
             || m_scheduler->shouldStop())
             return changePhase(conn, CollectorPhase::Reloop);
         
         // We could be coming from a collector phase that stuffed our SlotVisitor, so make sure we donate
         // everything. This is super cheap if the SlotVisitor is already empty.
-        slotVisitor.donateAll();
+        visitor.donateAll();
         return false;
     }
     case GCConductor::Collector: {
         {
-            ParallelModeEnabler enabler(slotVisitor);
-            slotVisitor.drainInParallelPassively(m_scheduler->timeToStop());
+            ParallelModeEnabler enabler(visitor);
+            visitor.drainInParallelPassively(m_scheduler->timeToStop());
         }
         return changePhase(conn, CollectorPhase::Reloop);
     } }
@@ -1640,8 +1640,8 @@
     m_worldIsStopped = true;
 
     forEachSlotVisitor(
-        [&] (SlotVisitor& slotVisitor) {
-            slotVisitor.updateMutatorIsStopped(NoLockingNecessary);
+        [&] (SlotVisitor& visitor) {
+            visitor.updateMutatorIsStopped(NoLockingNecessary);
         });
 
 #if ENABLE(JIT)
@@ -1685,33 +1685,33 @@
     // queues at once, which is totally achievable - it would just require memory allocation, which is
     // suboptimal but not a disaster. Alternatively, we could replace the SlotVisitor rightToRun lock
     // with a DLG-style handshake mechanism, but that seems not as general.
-    Vector<SlotVisitor*, 8> slotVisitorsToUpdate;
+    Vector<SlotVisitor*, 8> visitorsToUpdate;
 
     forEachSlotVisitor(
-        [&] (SlotVisitor& slotVisitor) {
-            slotVisitorsToUpdate.append(&slotVisitor);
+        [&] (SlotVisitor& visitor) {
+            visitorsToUpdate.append(&visitor);
         });
     
-    for (unsigned countdown = 40; !slotVisitorsToUpdate.isEmpty() && countdown--;) {
-        for (unsigned index = 0; index < slotVisitorsToUpdate.size(); ++index) {
-            SlotVisitor& slotVisitor = *slotVisitorsToUpdate[index];
+    for (unsigned countdown = 40; !visitorsToUpdate.isEmpty() && countdown--;) {
+        for (unsigned index = 0; index < visitorsToUpdate.size(); ++index) {
+            SlotVisitor& visitor = *visitorsToUpdate[index];
             bool remove = false;
-            if (slotVisitor.hasAcknowledgedThatTheMutatorIsResumed())
+            if (visitor.hasAcknowledgedThatTheMutatorIsResumed())
                 remove = true;
-            else if (auto locker = tryHoldLock(slotVisitor.rightToRun())) {
-                slotVisitor.updateMutatorIsStopped(locker);
+            else if (auto locker = tryHoldLock(visitor.rightToRun())) {
+                visitor.updateMutatorIsStopped(locker);
                 remove = true;
             }
             if (remove) {
-                slotVisitorsToUpdate[index--] = slotVisitorsToUpdate.last();
-                slotVisitorsToUpdate.takeLast();
+                visitorsToUpdate[index--] = visitorsToUpdate.last();
+                visitorsToUpdate.takeLast();
             }
         }
         Thread::yield();
     }
     
-    for (SlotVisitor* slotVisitor : slotVisitorsToUpdate)
-        slotVisitor->updateMutatorIsStopped();
+    for (SlotVisitor* visitor : visitorsToUpdate)
+        visitor->updateMutatorIsStopped();
     
     resumeCompilerThreads();
 }
@@ -2701,7 +2701,7 @@
 {
     m_constraintSet->add(
         "Cs", "Conservative Scan",
-        [this, lastVersion = static_cast<uint64_t>(0)] (SlotVisitor& slotVisitor) mutable {
+        [this, lastVersion = static_cast<uint64_t>(0)] (SlotVisitor& visitor) mutable {
             bool shouldNotProduceWork = lastVersion == m_phaseVersion;
             if (shouldNotProduceWork)
                 return;
@@ -2718,13 +2718,13 @@
                 gatherJSStackRoots(conservativeRoots);
                 gatherScratchBufferRoots(conservativeRoots);
 
-                SetRootMarkReasonScope rootScope(slotVisitor, RootMarkReason::ConservativeScan);
-                slotVisitor.append(conservativeRoots);
+                SetRootMarkReasonScope rootScope(visitor, RootMarkReason::ConservativeScan);
+                visitor.append(conservativeRoots);
             }
             if (Options::useJIT()) {
                 // JITStubRoutines must be visited after scanning ConservativeRoots since JITStubRoutines depend on the hook executed during gathering ConservativeRoots.
-                SetRootMarkReasonScope rootScope(slotVisitor, RootMarkReason::JITStubRoutines);
-                m_jitStubRoutines->traceMarkedStubRoutines(slotVisitor);
+                SetRootMarkReasonScope rootScope(visitor, RootMarkReason::JITStubRoutines);
+                m_jitStubRoutines->traceMarkedStubRoutines(visitor);
             }
             
             lastVersion = m_phaseVersion;
@@ -2733,35 +2733,35 @@
     
     m_constraintSet->add(
         "Msr", "Misc Small Roots",
-        [this] (SlotVisitor& slotVisitor) {
+        [this] (SlotVisitor& visitor) {
 
 #if JSC_OBJC_API_ENABLED
-            scanExternalRememberedSet(m_vm, slotVisitor);
+            scanExternalRememberedSet(m_vm, visitor);
 #endif
             if (m_vm.smallStrings.needsToBeVisited(*m_collectionScope)) {
-                SetRootMarkReasonScope rootScope(slotVisitor, RootMarkReason::StrongReferences);
-                m_vm.smallStrings.visitStrongReferences(slotVisitor);
+                SetRootMarkReasonScope rootScope(visitor, RootMarkReason::StrongReferences);
+                m_vm.smallStrings.visitStrongReferences(visitor);
             }
             
             {
-                SetRootMarkReasonScope rootScope(slotVisitor, RootMarkReason::ProtectedValues);
+                SetRootMarkReasonScope rootScope(visitor, RootMarkReason::ProtectedValues);
                 for (auto& pair : m_protectedValues)
-                    slotVisitor.appendUnbarriered(pair.key);
+                    visitor.appendUnbarriered(pair.key);
             }
             
             if (m_markListSet && m_markListSet->size()) {
-                SetRootMarkReasonScope rootScope(slotVisitor, RootMarkReason::ConservativeScan);
-                MarkedArgumentBuffer::markLists(slotVisitor, *m_markListSet);
+                SetRootMarkReasonScope rootScope(visitor, RootMarkReason::ConservativeScan);
+                MarkedArgumentBuffer::markLists(visitor, *m_markListSet);
             }
 
             m_markedJSValueRefArrays.forEach([&] (MarkedJSValueRefArray* array) {
-                array->visitAggregate(slotVisitor);
+                array->visitAggregate(visitor);
             });
 
             {
-                SetRootMarkReasonScope rootScope(slotVisitor, RootMarkReason::VMExceptions);
-                slotVisitor.appendUnbarriered(m_vm.exception());
-                slotVisitor.appendUnbarriered(m_vm.lastException());
+                SetRootMarkReasonScope rootScope(visitor, RootMarkReason::VMExceptions);
+                visitor.appendUnbarriered(m_vm.exception());
+                visitor.appendUnbarriered(m_vm.lastException());
             }
         },
         ConstraintVolatility::GreyedByExecution);
@@ -2768,57 +2768,57 @@
     
     m_constraintSet->add(
         "Sh", "Strong Handles",
-        [this] (SlotVisitor& slotVisitor) {
-            SetRootMarkReasonScope rootScope(slotVisitor, RootMarkReason::StrongHandles);
-            m_handleSet.visitStrongHandles(slotVisitor);
+        [this] (SlotVisitor& visitor) {
+            SetRootMarkReasonScope rootScope(visitor, RootMarkReason::StrongHandles);
+            m_handleSet.visitStrongHandles(visitor);
         },
         ConstraintVolatility::GreyedByExecution);
     
     m_constraintSet->add(
         "D", "Debugger",
-        [this] (SlotVisitor& slotVisitor) {
-            SetRootMarkReasonScope rootScope(slotVisitor, RootMarkReason::Debugger);
+        [this] (SlotVisitor& visitor) {
+            SetRootMarkReasonScope rootScope(visitor, RootMarkReason::Debugger);
 
 #if ENABLE(SAMPLING_PROFILER)
             if (SamplingProfiler* samplingProfiler = m_vm.samplingProfiler()) {
                 auto locker = holdLock(samplingProfiler->getLock());
                 samplingProfiler->processUnverifiedStackTraces(locker);
-                samplingProfiler->visit(slotVisitor);
+                samplingProfiler->visit(visitor);
                 if (Options::logGC() == GCLogging::Verbose)
-                    dataLog("Sampling Profiler data:\n", slotVisitor);
+                    dataLog("Sampling Profiler data:\n", visitor);
             }
 #endif // ENABLE(SAMPLING_PROFILER)
 
             if (m_vm.typeProfiler())
-                m_vm.typeProfilerLog()->visit(slotVisitor);
+                m_vm.typeProfilerLog()->visit(visitor);
             
             if (auto* shadowChicken = m_vm.shadowChicken())
-                shadowChicken->visitChildren(slotVisitor);
+                shadowChicken->visitChildren(visitor);
         },
         ConstraintVolatility::GreyedByExecution);
     
     m_constraintSet->add(
         "Ws", "Weak Sets",
-        [this] (SlotVisitor& slotVisitor) {
-            SetRootMarkReasonScope rootScope(slotVisitor, RootMarkReason::WeakSets);
-            m_objectSpace.visitWeakSets(slotVisitor);
+        [this] (SlotVisitor& visitor) {
+            SetRootMarkReasonScope rootScope(visitor, RootMarkReason::WeakSets);
+            m_objectSpace.visitWeakSets(visitor);
         },
         ConstraintVolatility::GreyedByMarking);
     
     m_constraintSet->add(
         "O", "Output",
-        [] (SlotVisitor& slotVisitor) {
-            VM& vm = slotVisitor.vm();
+        [] (SlotVisitor& visitor) {
+            VM& vm = visitor.vm();
 
-            auto callOutputConstraint = [] (SlotVisitor& slotVisitor, HeapCell* heapCell, HeapCell::Kind) {
-                SetRootMarkReasonScope rootScope(slotVisitor, RootMarkReason::Output);
-                VM& vm = slotVisitor.vm();
+            auto callOutputConstraint = [] (SlotVisitor& visitor, HeapCell* heapCell, HeapCell::Kind) {
+                SetRootMarkReasonScope rootScope(visitor, RootMarkReason::Output);
+                VM& vm = visitor.vm();
                 JSCell* cell = static_cast<JSCell*>(heapCell);
-                cell->methodTable(vm)->visitOutputConstraints(cell, slotVisitor);
+                cell->methodTable(vm)->visitOutputConstraints(cell, visitor);
             };
             
             auto add = [&] (auto& set) {
-                slotVisitor.addParallelConstraintTask(set.forEachMarkedCellInParallel(callOutputConstraint));
+                visitor.addParallelConstraintTask(set.forEachMarkedCellInParallel(callOutputConstraint));
             };
             
             add(vm.executableToCodeBlockEdgesWithConstraints);
@@ -2832,11 +2832,11 @@
     if (Options::useJIT()) {
         m_constraintSet->add(
             "Dw", "DFG Worklists",
-            [this] (SlotVisitor& slotVisitor) {
-                SetRootMarkReasonScope rootScope(slotVisitor, RootMarkReason::DFGWorkLists);
+            [this] (SlotVisitor& visitor) {
+                SetRootMarkReasonScope rootScope(visitor, RootMarkReason::DFGWorkLists);
 
                 for (unsigned i = DFG::numberOfWorklists(); i--;)
-                    DFG::existingWorklistForIndex(i).visitWeakReferences(slotVisitor);
+                    DFG::existingWorklistForIndex(i).visitWeakReferences(visitor);
                 
                 // FIXME: This is almost certainly unnecessary.
                 // https://bugs.webkit.org/show_bug.cgi?id=166829
@@ -2843,11 +2843,11 @@
                 DFG::iterateCodeBlocksForGC(
                     m_vm,
                     [&] (CodeBlock* codeBlock) {
-                        slotVisitor.appendUnbarriered(codeBlock);
+                        visitor.appendUnbarriered(codeBlock);
                     });
                 
                 if (Options::logGC() == GCLogging::Verbose)
-                    dataLog("DFG Worklists:\n", slotVisitor);
+                    dataLog("DFG Worklists:\n", visitor);
             },
             ConstraintVolatility::GreyedByMarking);
     }
@@ -2855,14 +2855,14 @@
     
     m_constraintSet->add(
         "Cb", "CodeBlocks",
-        [this] (SlotVisitor& slotVisitor) {
-            SetRootMarkReasonScope rootScope(slotVisitor, RootMarkReason::CodeBlocks);
+        [this] (SlotVisitor& visitor) {
+            SetRootMarkReasonScope rootScope(visitor, RootMarkReason::CodeBlocks);
             iterateExecutingAndCompilingCodeBlocksWithoutHoldingLocks(
                 [&] (CodeBlock* codeBlock) {
                     // Visit the CodeBlock as a constraint only if it's black.
                     if (isMarked(codeBlock)
                         && codeBlock->cellState() == CellState::PossiblyBlack)
-                        slotVisitor.visitAsConstraint(codeBlock);
+                        visitor.visitAsConstraint(codeBlock);
                 });
         },
         ConstraintVolatility::SeldomGreyed);
@@ -2978,9 +2978,9 @@
         return;
     targetBytes = std::min(targetBytes, Options::gcIncrementMaxBytes());
 
-    SlotVisitor& slotVisitor = *m_mutatorSlotVisitor;
-    ParallelModeEnabler parallelModeEnabler(slotVisitor);
-    size_t bytesVisited = slotVisitor.performIncrementOfDraining(static_cast<size_t>(targetBytes));
+    SlotVisitor& visitor = *m_mutatorSlotVisitor;
+    ParallelModeEnabler parallelModeEnabler(visitor);
+    size_t bytesVisited = visitor.performIncrementOfDraining(static_cast<size_t>(targetBytes));
     // incrementBalance may go negative here because it'll remember how many bytes we overshot.
     m_incrementBalance -= bytesVisited;
 }

Modified: trunk/Source/_javascript_Core/heap/HeapInlines.h (272829 => 272830)


--- trunk/Source/_javascript_Core/heap/HeapInlines.h	2021-02-13 04:36:29 UTC (rev 272829)
+++ trunk/Source/_javascript_Core/heap/HeapInlines.h	2021-02-13 05:30:58 UTC (rev 272830)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014-2020 Apple Inc. All rights reserved.
+ * Copyright (C) 2014-2021 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -274,8 +274,8 @@
 {
     func(*m_collectorSlotVisitor);
     func(*m_mutatorSlotVisitor);
-    for (auto& slotVisitor : m_parallelSlotVisitors)
-        func(*slotVisitor);
+    for (auto& visitor : m_parallelSlotVisitors)
+        func(*visitor);
 }
 
 } // namespace JSC

Modified: trunk/Source/_javascript_Core/runtime/JSSegmentedVariableObject.cpp (272829 => 272830)


--- trunk/Source/_javascript_Core/runtime/JSSegmentedVariableObject.cpp	2021-02-13 04:36:29 UTC (rev 272829)
+++ trunk/Source/_javascript_Core/runtime/JSSegmentedVariableObject.cpp	2021-02-13 05:30:58 UTC (rev 272830)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012-2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2012-2021 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -62,17 +62,17 @@
     return ScopeOffset(oldSize);
 }
 
-void JSSegmentedVariableObject::visitChildren(JSCell* cell, SlotVisitor& slotVisitor)
+void JSSegmentedVariableObject::visitChildren(JSCell* cell, SlotVisitor& visitor)
 {
     JSSegmentedVariableObject* thisObject = jsCast<JSSegmentedVariableObject*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, info());
-    Base::visitChildren(thisObject, slotVisitor);
+    Base::visitChildren(thisObject, visitor);
     
     // FIXME: We could avoid locking here if SegmentedVector was lock-free. It could be made lock-free
     // relatively easily.
     auto locker = holdLock(thisObject->cellLock());
     for (unsigned i = thisObject->m_variables.size(); i--;)
-        slotVisitor.appendHidden(thisObject->m_variables[i]);
+        visitor.appendHidden(thisObject->m_variables[i]);
 }
 
 void JSSegmentedVariableObject::analyzeHeap(JSCell* cell, HeapAnalyzer& analyzer)

Modified: trunk/Source/_javascript_Core/runtime/SamplingProfiler.cpp (272829 => 272830)


--- trunk/Source/_javascript_Core/runtime/SamplingProfiler.cpp	2021-02-13 04:36:29 UTC (rev 272829)
+++ trunk/Source/_javascript_Core/runtime/SamplingProfiler.cpp	2021-02-13 05:30:58 UTC (rev 272830)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016-2020 Apple Inc. All rights reserved.
+ * Copyright (C) 2016-2021 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -652,11 +652,11 @@
     m_unprocessedStackTraces.clear();
 }
 
-void SamplingProfiler::visit(SlotVisitor& slotVisitor)
+void SamplingProfiler::visit(SlotVisitor& visitor)
 {
     RELEASE_ASSERT(m_lock.isLocked());
     for (JSCell* cell : m_liveCellPointers)
-        slotVisitor.appendUnbarriered(cell);
+        visitor.appendUnbarriered(cell);
 }
 
 void SamplingProfiler::shutdown()
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to