Changeset 272797 in webkit
- Timestamp:
- Feb 12, 2021, 11:25:13 AM (4 years ago)
- Location:
- trunk/Source
- Files:
-
- 1 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/CMakeLists.txt
r272638 r272797 683 683 heap/PreciseAllocation.h 684 684 heap/RegisterState.h 685 heap/RootMarkReason.h 685 686 heap/RunningScope.h 686 687 heap/SimpleMarkingConstraint.h -
trunk/Source/JavaScriptCore/ChangeLog
r272768 r272797 1 2021-02-12 Mark Lam <mark.lam@apple.com> 2 3 Move RootMarkReason out of SlotVisitor. 4 https://bugs.webkit.org/show_bug.cgi?id=221831 5 6 Reviewed by Tadeu Zagallo. 7 8 This will lessen the amount of diff needed for the GC verifier later. 9 10 * CMakeLists.txt: 11 * JavaScriptCore.xcodeproj/project.pbxproj: 12 * heap/Heap.cpp: 13 (JSC::Heap::addCoreConstraints): 14 * heap/HeapAnalyzer.h: 15 * heap/HeapSnapshotBuilder.cpp: 16 (JSC::HeapSnapshotBuilder::analyzeEdge): 17 (JSC::rootTypeToString): 18 * heap/HeapSnapshotBuilder.h: 19 * heap/RootMarkReason.h: Added. 20 * heap/SlotVisitor.h: 21 (JSC::SetRootMarkReasonScope::SetRootMarkReasonScope): 22 * inspector/JSInjectedScriptHost.cpp: 23 1 24 2021-02-11 Nikita Vasilyev <nvasilyev@apple.com> 2 25 -
trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r272638 r272797 1952 1952 FE3A06BE1C11041200390FDD /* JITLeftShiftGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = FE3A06B71C1103D900390FDD /* JITLeftShiftGenerator.h */; }; 1953 1953 FE3A06C01C11041A00390FDD /* JITRightShiftGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = FE3A06B91C1103D900390FDD /* JITRightShiftGenerator.h */; }; 1954 FE3B642F25D6FB4D001ADDB4 /* RootMarkReason.h in Headers */ = {isa = PBXBuildFile; fileRef = FE3B642E25D6FB4C001ADDB4 /* RootMarkReason.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1954 1955 FE476FF4207E85D50093CA2D /* JITCodeMap.h in Headers */ = {isa = PBXBuildFile; fileRef = FE476FF3207E85D40093CA2D /* JITCodeMap.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1955 1956 FE48BD4423245E9300F136D0 /* JSCConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = FE48BD4223245E8700F136D0 /* JSCConfig.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 5291 5292 FE3A06B81C1103D900390FDD /* JITRightShiftGenerator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JITRightShiftGenerator.cpp; sourceTree = "<group>"; }; 5292 5293 FE3A06B91C1103D900390FDD /* JITRightShiftGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JITRightShiftGenerator.h; sourceTree = "<group>"; }; 5294 FE3B642E25D6FB4C001ADDB4 /* RootMarkReason.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RootMarkReason.h; sourceTree = "<group>"; }; 5293 5295 FE42388F1BE18C1200514737 /* JITSubGenerator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JITSubGenerator.cpp; sourceTree = "<group>"; }; 5294 5296 FE476FF3207E85D40093CA2D /* JITCodeMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JITCodeMap.h; sourceTree = "<group>"; }; … … 6427 6429 0FD0E5EF1E46BF230006AB08 /* RegisterState.h */, 6428 6430 0F7CF94E1DBEEE860098CC12 /* ReleaseHeapAccessScope.h */, 6431 FE3B642E25D6FB4C001ADDB4 /* RootMarkReason.h */, 6429 6432 0F2C63A91E4FA42C00C13839 /* RunningScope.h */, 6430 6433 0F4D8C761FCA3CF2001D32AC /* SimpleMarkingConstraint.cpp */, … … 10547 10550 0F963B3813FC6FE90002D9B2 /* ValueProfile.h in Headers */, 10548 10551 0F426A481460CBB300131F8F /* ValueRecovery.h in Headers */, 10552 FE3B642F25D6FB4D001ADDB4 /* RootMarkReason.h in Headers */, 10549 10553 79EE0C001B4AFB85000385C9 /* VariableEnvironment.h in Headers */, 10550 10554 0F6C73511AC9F99F00BE1682 /* VariableWriteFireDetail.h in Headers */, -
trunk/Source/JavaScriptCore/heap/Heap.cpp
r264743 r272797 1 1 /* 2 * Copyright (C) 2003-202 0Apple Inc. All rights reserved.2 * Copyright (C) 2003-2021 Apple Inc. All rights reserved. 3 3 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> 4 4 * … … 2719 2719 gatherScratchBufferRoots(conservativeRoots); 2720 2720 2721 SetRootMarkReasonScope rootScope(slotVisitor, SlotVisitor::RootMarkReason::ConservativeScan);2721 SetRootMarkReasonScope rootScope(slotVisitor, RootMarkReason::ConservativeScan); 2722 2722 slotVisitor.append(conservativeRoots); 2723 2723 } 2724 2724 if (Options::useJIT()) { 2725 2725 // JITStubRoutines must be visited after scanning ConservativeRoots since JITStubRoutines depend on the hook executed during gathering ConservativeRoots. 2726 SetRootMarkReasonScope rootScope(slotVisitor, SlotVisitor::RootMarkReason::JITStubRoutines);2726 SetRootMarkReasonScope rootScope(slotVisitor, RootMarkReason::JITStubRoutines); 2727 2727 m_jitStubRoutines->traceMarkedStubRoutines(slotVisitor); 2728 2728 } … … 2740 2740 #endif 2741 2741 if (m_vm.smallStrings.needsToBeVisited(*m_collectionScope)) { 2742 SetRootMarkReasonScope rootScope(slotVisitor, SlotVisitor::RootMarkReason::StrongReferences);2742 SetRootMarkReasonScope rootScope(slotVisitor, RootMarkReason::StrongReferences); 2743 2743 m_vm.smallStrings.visitStrongReferences(slotVisitor); 2744 2744 } 2745 2745 2746 2746 { 2747 SetRootMarkReasonScope rootScope(slotVisitor, SlotVisitor::RootMarkReason::ProtectedValues);2747 SetRootMarkReasonScope rootScope(slotVisitor, RootMarkReason::ProtectedValues); 2748 2748 for (auto& pair : m_protectedValues) 2749 2749 slotVisitor.appendUnbarriered(pair.key); … … 2751 2751 2752 2752 if (m_markListSet && m_markListSet->size()) { 2753 SetRootMarkReasonScope rootScope(slotVisitor, SlotVisitor::RootMarkReason::ConservativeScan);2753 SetRootMarkReasonScope rootScope(slotVisitor, RootMarkReason::ConservativeScan); 2754 2754 MarkedArgumentBuffer::markLists(slotVisitor, *m_markListSet); 2755 2755 } … … 2760 2760 2761 2761 { 2762 SetRootMarkReasonScope rootScope(slotVisitor, SlotVisitor::RootMarkReason::VMExceptions);2762 SetRootMarkReasonScope rootScope(slotVisitor, RootMarkReason::VMExceptions); 2763 2763 slotVisitor.appendUnbarriered(m_vm.exception()); 2764 2764 slotVisitor.appendUnbarriered(m_vm.lastException()); … … 2770 2770 "Sh", "Strong Handles", 2771 2771 [this] (SlotVisitor& slotVisitor) { 2772 SetRootMarkReasonScope rootScope(slotVisitor, SlotVisitor::RootMarkReason::StrongHandles);2772 SetRootMarkReasonScope rootScope(slotVisitor, RootMarkReason::StrongHandles); 2773 2773 m_handleSet.visitStrongHandles(slotVisitor); 2774 2774 }, … … 2778 2778 "D", "Debugger", 2779 2779 [this] (SlotVisitor& slotVisitor) { 2780 SetRootMarkReasonScope rootScope(slotVisitor, SlotVisitor::RootMarkReason::Debugger);2780 SetRootMarkReasonScope rootScope(slotVisitor, RootMarkReason::Debugger); 2781 2781 2782 2782 #if ENABLE(SAMPLING_PROFILER) … … 2801 2801 "Ws", "Weak Sets", 2802 2802 [this] (SlotVisitor& slotVisitor) { 2803 SetRootMarkReasonScope rootScope(slotVisitor, SlotVisitor::RootMarkReason::WeakSets);2803 SetRootMarkReasonScope rootScope(slotVisitor, RootMarkReason::WeakSets); 2804 2804 m_objectSpace.visitWeakSets(slotVisitor); 2805 2805 }, … … 2812 2812 2813 2813 auto callOutputConstraint = [] (SlotVisitor& slotVisitor, HeapCell* heapCell, HeapCell::Kind) { 2814 SetRootMarkReasonScope rootScope(slotVisitor, SlotVisitor::RootMarkReason::Output);2814 SetRootMarkReasonScope rootScope(slotVisitor, RootMarkReason::Output); 2815 2815 VM& vm = slotVisitor.vm(); 2816 2816 JSCell* cell = static_cast<JSCell*>(heapCell); … … 2834 2834 "Dw", "DFG Worklists", 2835 2835 [this] (SlotVisitor& slotVisitor) { 2836 SetRootMarkReasonScope rootScope(slotVisitor, SlotVisitor::RootMarkReason::DFGWorkLists);2836 SetRootMarkReasonScope rootScope(slotVisitor, RootMarkReason::DFGWorkLists); 2837 2837 2838 2838 for (unsigned i = DFG::numberOfWorklists(); i--;) … … 2857 2857 "Cb", "CodeBlocks", 2858 2858 [this] (SlotVisitor& slotVisitor) { 2859 SetRootMarkReasonScope rootScope(slotVisitor, SlotVisitor::RootMarkReason::CodeBlocks);2859 SetRootMarkReasonScope rootScope(slotVisitor, RootMarkReason::CodeBlocks); 2860 2860 iterateExecutingAndCompilingCodeBlocksWithoutHoldingLocks( 2861 2861 [&] (CodeBlock* codeBlock) { -
trunk/Source/JavaScriptCore/heap/HeapAnalyzer.h
r248925 r272797 1 1 /* 2 * Copyright (C) 2019 Apple Inc. All rights reserved.2 * Copyright (C) 2019-2021 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 26 26 #pragma once 27 27 28 #include " SlotVisitor.h"28 #include "RootMarkReason.h" 29 29 #include <wtf/text/UniquedStringImpl.h> 30 30 #include <wtf/text/WTFString.h> … … 40 40 41 41 // A reference from one cell to another. 42 virtual void analyzeEdge(JSCell* from, JSCell* to, SlotVisitor::RootMarkReason) = 0;42 virtual void analyzeEdge(JSCell* from, JSCell* to, RootMarkReason) = 0; 43 43 virtual void analyzePropertyNameEdge(JSCell* from, JSCell* to, UniquedStringImpl* propertyName) = 0; 44 44 virtual void analyzeVariableNameEdge(JSCell* from, JSCell* to, UniquedStringImpl* variableName) = 0; -
trunk/Source/JavaScriptCore/heap/HeapSnapshotBuilder.cpp
r264736 r272797 1 1 /* 2 * Copyright (C) 2016-202 0Apple Inc. All rights reserved.2 * Copyright (C) 2016-2021 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 40 40 namespace JSC { 41 41 42 static const char* rootTypeToString( SlotVisitor::RootMarkReason);42 static const char* rootTypeToString(RootMarkReason); 43 43 44 44 NodeIdentifier HeapSnapshotBuilder::nextAvailableObjectIdentifier = 1; … … 100 100 } 101 101 102 void HeapSnapshotBuilder::analyzeEdge(JSCell* from, JSCell* to, SlotVisitor::RootMarkReason rootMarkReason)102 void HeapSnapshotBuilder::analyzeEdge(JSCell* from, JSCell* to, RootMarkReason rootMarkReason) 103 103 { 104 104 ASSERT(m_profiler.activeHeapAnalyzer() == this); … … 112 112 113 113 if (m_snapshotType == SnapshotType::GCDebuggingSnapshot && !from) { 114 if (rootMarkReason == SlotVisitor::RootMarkReason::None && m_snapshotType == SnapshotType::GCDebuggingSnapshot)114 if (rootMarkReason == RootMarkReason::None && m_snapshotType == SnapshotType::GCDebuggingSnapshot) 115 115 WTFLogAlways("Cell %p is a root but no root marking reason was supplied", to); 116 116 … … 306 306 } 307 307 308 static const char* rootTypeToString( SlotVisitor::RootMarkReason type)308 static const char* rootTypeToString(RootMarkReason type) 309 309 { 310 310 switch (type) { 311 case SlotVisitor::RootMarkReason::None:311 case RootMarkReason::None: 312 312 return "None"; 313 case SlotVisitor::RootMarkReason::ConservativeScan:313 case RootMarkReason::ConservativeScan: 314 314 return "Conservative scan"; 315 case SlotVisitor::RootMarkReason::StrongReferences:315 case RootMarkReason::StrongReferences: 316 316 return "Strong references"; 317 case SlotVisitor::RootMarkReason::ProtectedValues:317 case RootMarkReason::ProtectedValues: 318 318 return "Protected values"; 319 case SlotVisitor::RootMarkReason::MarkListSet:319 case RootMarkReason::MarkListSet: 320 320 return "Mark list set"; 321 case SlotVisitor::RootMarkReason::VMExceptions:321 case RootMarkReason::VMExceptions: 322 322 return "VM exceptions"; 323 case SlotVisitor::RootMarkReason::StrongHandles:323 case RootMarkReason::StrongHandles: 324 324 return "Strong handles"; 325 case SlotVisitor::RootMarkReason::Debugger:325 case RootMarkReason::Debugger: 326 326 return "Debugger"; 327 case SlotVisitor::RootMarkReason::JITStubRoutines:327 case RootMarkReason::JITStubRoutines: 328 328 return "JIT stub routines"; 329 case SlotVisitor::RootMarkReason::WeakSets:329 case RootMarkReason::WeakSets: 330 330 return "Weak sets"; 331 case SlotVisitor::RootMarkReason::Output:331 case RootMarkReason::Output: 332 332 return "Output"; 333 case SlotVisitor::RootMarkReason::DFGWorkLists:333 case RootMarkReason::DFGWorkLists: 334 334 return "DFG work lists"; 335 case SlotVisitor::RootMarkReason::CodeBlocks:335 case RootMarkReason::CodeBlocks: 336 336 return "Code blocks"; 337 case SlotVisitor::RootMarkReason::DOMGCOutput:337 case RootMarkReason::DOMGCOutput: 338 338 return "DOM GC output"; 339 339 } -
trunk/Source/JavaScriptCore/heap/HeapSnapshotBuilder.h
r261567 r272797 1 1 /* 2 * Copyright (C) 2016-202 0Apple Inc. All rights reserved.2 * Copyright (C) 2016-2021 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 120 120 121 121 // A reference from one cell to another. 122 void analyzeEdge(JSCell* from, JSCell* to, SlotVisitor::RootMarkReason) final;122 void analyzeEdge(JSCell* from, JSCell* to, RootMarkReason) final; 123 123 void analyzePropertyNameEdge(JSCell* from, JSCell* to, UniquedStringImpl* propertyName) final; 124 124 void analyzeVariableNameEdge(JSCell* from, JSCell* to, UniquedStringImpl* variableName) final; … … 144 144 struct RootData { 145 145 const char* reachabilityFromOpaqueRootReasons { nullptr }; 146 SlotVisitor::RootMarkReason markReason { SlotVisitor::RootMarkReason::None };146 RootMarkReason markReason { RootMarkReason::None }; 147 147 }; 148 148 -
trunk/Source/JavaScriptCore/heap/SlotVisitor.h
r268993 r272797 1 1 /* 2 * Copyright (C) 2011-20 19Apple Inc. All rights reserved.2 * Copyright (C) 2011-2021 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 29 29 #include "IterationStatus.h" 30 30 #include "MarkStack.h" 31 #include "RootMarkReason.h" 31 32 #include "VisitRaceKey.h" 32 33 #include <wtf/Forward.h> … … 58 59 59 60 public: 60 enum RootMarkReason {61 None,62 ConservativeScan,63 StrongReferences,64 ProtectedValues,65 MarkListSet,66 VMExceptions,67 StrongHandles,68 Debugger,69 JITStubRoutines,70 WeakSets,71 Output,72 DFGWorkLists,73 CodeBlocks,74 DOMGCOutput,75 };76 77 61 SlotVisitor(Heap&, CString codeName); 78 62 ~SlotVisitor(); … … 290 274 class SetRootMarkReasonScope { 291 275 public: 292 SetRootMarkReasonScope(SlotVisitor& visitor, SlotVisitor::RootMarkReason reason)276 SetRootMarkReasonScope(SlotVisitor& visitor, RootMarkReason reason) 293 277 : m_visitor(visitor) 294 278 , m_previousReason(visitor.rootMarkReason()) … … 304 288 private: 305 289 SlotVisitor& m_visitor; 306 SlotVisitor::RootMarkReason m_previousReason;290 RootMarkReason m_previousReason; 307 291 }; 308 292 -
trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHost.cpp
r272638 r272797 1 1 /* 2 * Copyright (C) 2013-202 0Apple Inc. All rights reserved.2 * Copyright (C) 2013-2021 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 754 754 HashSet<JSCell*>& holders() { return m_holders; } 755 755 756 void analyzeEdge(JSCell* from, JSCell* to, SlotVisitor::RootMarkReason reason) final756 void analyzeEdge(JSCell* from, JSCell* to, RootMarkReason reason) final 757 757 { 758 758 ASSERT(to); … … 774 774 } 775 775 776 if (reason == SlotVisitor::RootMarkReason::Debugger)776 if (reason == RootMarkReason::Debugger) 777 777 m_rootsToIgnore.add(to); 778 else if (!from || reason != SlotVisitor::RootMarkReason::None)778 else if (!from || reason != RootMarkReason::None) 779 779 m_rootsToInclude.add(to); 780 780 } 781 void analyzePropertyNameEdge(JSCell* from, JSCell* to, UniquedStringImpl*) final { analyzeEdge(from, to, SlotVisitor::RootMarkReason::None); }782 void analyzeVariableNameEdge(JSCell* from, JSCell* to, UniquedStringImpl*) final { analyzeEdge(from, to, SlotVisitor::RootMarkReason::None); }783 void analyzeIndexEdge(JSCell* from, JSCell* to, uint32_t) final { analyzeEdge(from, to, SlotVisitor::RootMarkReason::None); }781 void analyzePropertyNameEdge(JSCell* from, JSCell* to, UniquedStringImpl*) final { analyzeEdge(from, to, RootMarkReason::None); } 782 void analyzeVariableNameEdge(JSCell* from, JSCell* to, UniquedStringImpl*) final { analyzeEdge(from, to, RootMarkReason::None); } 783 void analyzeIndexEdge(JSCell* from, JSCell* to, uint32_t) final { analyzeEdge(from, to, RootMarkReason::None); } 784 784 785 785 void analyzeNode(JSCell*) final { } -
trunk/Source/WebCore/ChangeLog
r272794 r272797 1 2021-02-12 Mark Lam <mark.lam@apple.com> 2 3 Move RootMarkReason out of SlotVisitor. 4 https://bugs.webkit.org/show_bug.cgi?id=221831 5 6 Reviewed by Tadeu Zagallo. 7 8 * bindings/js/DOMGCOutputConstraint.cpp: 9 (WebCore::DOMGCOutputConstraint::executeImpl): 10 1 11 2021-02-12 Julian Gonzalez <julian_a_gonzalez@apple.com> 2 12 -
trunk/Source/WebCore/bindings/js/DOMGCOutputConstraint.cpp
r248925 r272797 1 1 /* 2 * Copyright (C) 2017-20 18Apple Inc. All rights reserved.2 * Copyright (C) 2017-2021 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 62 62 [&] (Subspace& subspace) { 63 63 auto func = [] (SlotVisitor& visitor, HeapCell* heapCell, HeapCell::Kind) { 64 SetRootMarkReasonScope rootScope(visitor, SlotVisitor::RootMarkReason::DOMGCOutput);64 SetRootMarkReasonScope rootScope(visitor, RootMarkReason::DOMGCOutput); 65 65 JSCell* cell = static_cast<JSCell*>(heapCell); 66 66 cell->methodTable(visitor.vm())->visitOutputConstraints(cell, visitor);
Note:
See TracChangeset
for help on using the changeset viewer.