|
| 1 | +2021-11-10 Mark Lam <mark.lam@apple.com> |
| 2 | + |
| 3 | + Move m_doesGC from Heap to VM. |
| 4 | + https://bugs.webkit.org/show_bug.cgi?id=232975 |
| 5 | + rdar://85277492 |
| 6 | + |
| 7 | + Reviewed by Filip Pizlo. |
| 8 | + |
| 9 | + m_doesGC is only needed for ENABLE(DFG_DOES_GC_VALIDATION), and is used for checking |
| 10 | + if the VM thread's execution is in a state that can allow GC to run. Hence, it is |
| 11 | + more related to VM thread execution as opposed to the state of the Heap. This patch |
| 12 | + moves m_doesGC from Heap to VM to get it out of the way of upcoming Global GC work. |
| 13 | + |
| 14 | + Also change DeferGC, DeferGCForAWhile, and GCDeferralContext to take a VM& instead |
| 15 | + of a Heap&. DeferGC and GCDeferralContext need to access VM& in order to call |
| 16 | + VM::verifyCanGC(). DeferGCForAWhile does not need VM&, but we're changing it to be |
| 17 | + consistent with DeferGC. There should be no perf impact for this change. |
| 18 | + |
| 19 | + * CMakeLists.txt: |
| 20 | + * JavaScriptCore.xcodeproj/project.pbxproj: |
| 21 | + * bytecode/CodeBlock.cpp: |
| 22 | + (JSC::CodeBlock::jettison): |
| 23 | + * bytecode/UnlinkedFunctionExecutable.cpp: |
| 24 | + (JSC::UnlinkedFunctionExecutable::decodeCachedCodeBlocks): |
| 25 | + * bytecode/Watchpoint.cpp: |
| 26 | + (JSC::WatchpointSet::fireAllWatchpoints): |
| 27 | + * bytecompiler/BytecodeGenerator.h: |
| 28 | + (JSC::BytecodeGenerator::generate): |
| 29 | + * dfg/DFGDoesGCCheck.cpp: |
| 30 | + * dfg/DFGOSRExit.cpp: |
| 31 | + (JSC::DFG::JSC_DEFINE_JIT_OPERATION): |
| 32 | + (JSC::DFG::OSRExit::compileExit): |
| 33 | + * dfg/DFGOperations.cpp: |
| 34 | + (JSC::DFG::JSC_DEFINE_JIT_OPERATION): |
| 35 | + * dfg/DFGSpeculativeJIT.cpp: |
| 36 | + (JSC::DFG::SpeculativeJIT::compileLoopHint): |
| 37 | + * dfg/DFGSpeculativeJIT32_64.cpp: |
| 38 | + (JSC::DFG::SpeculativeJIT::compile): |
| 39 | + * dfg/DFGSpeculativeJIT64.cpp: |
| 40 | + (JSC::DFG::SpeculativeJIT::compile): |
| 41 | + * ftl/FTLLowerDFGToB3.cpp: |
| 42 | + (JSC::FTL::DFG::LowerDFGToB3::compileNode): |
| 43 | + (JSC::FTL::DFG::LowerDFGToB3::compileCompareStrictEq): |
| 44 | + * ftl/FTLOSRExitCompiler.cpp: |
| 45 | + (JSC::FTL::compileStub): |
| 46 | + (JSC::FTL::JSC_DEFINE_JIT_OPERATION): |
| 47 | + * ftl/FTLOperations.cpp: |
| 48 | + (JSC::FTL::JSC_DEFINE_JIT_OPERATION): |
| 49 | + * heap/CompleteSubspace.cpp: |
| 50 | + (JSC::CompleteSubspace::tryAllocateSlow): |
| 51 | + (JSC::CompleteSubspace::reallocatePreciseAllocationNonVirtual): |
| 52 | + * heap/CompleteSubspaceInlines.h: |
| 53 | + (JSC::CompleteSubspace::allocateNonVirtual): |
| 54 | + * heap/DeferGC.h: |
| 55 | + (JSC::DeferGC::DeferGC): Deleted. |
| 56 | + (JSC::DeferGC::~DeferGC): Deleted. |
| 57 | + (JSC::DeferGCForAWhile::DeferGCForAWhile): Deleted. |
| 58 | + (JSC::DeferGCForAWhile::~DeferGCForAWhile): Deleted. |
| 59 | + * heap/DeferGCInlines.h: Added. |
| 60 | + (JSC::DeferGC::DeferGC): |
| 61 | + (JSC::DeferGC::~DeferGC): |
| 62 | + (JSC::DeferGCForAWhile::DeferGCForAWhile): |
| 63 | + (JSC::DeferGCForAWhile::~DeferGCForAWhile): |
| 64 | + * heap/GCDeferralContext.h: |
| 65 | + * heap/GCDeferralContextInlines.h: |
| 66 | + (JSC::GCDeferralContext::GCDeferralContext): |
| 67 | + (JSC::GCDeferralContext::~GCDeferralContext): |
| 68 | + * heap/Heap.cpp: |
| 69 | + (JSC::Heap::collectNow): |
| 70 | + (JSC::Heap::collectAsync): |
| 71 | + (JSC::Heap::collectSync): |
| 72 | + (JSC::Heap::stopIfNecessarySlow): |
| 73 | + (JSC::Heap::collectIfNecessaryOrDefer): |
| 74 | + * heap/Heap.h: |
| 75 | + (JSC::Heap::addressOfDoesGC): Deleted. |
| 76 | + (JSC::Heap::setDoesGCExpectation): Deleted. |
| 77 | + (JSC::Heap::verifyCanGC): Deleted. |
| 78 | + * heap/HeapInlines.h: |
| 79 | + (JSC::Heap::acquireAccess): |
| 80 | + (JSC::Heap::stopIfNecessary): |
| 81 | + * heap/HeapSnapshotBuilder.cpp: |
| 82 | + (JSC::HeapSnapshotBuilder::json): |
| 83 | + * heap/IncrementalSweeper.cpp: |
| 84 | + (JSC::IncrementalSweeper::sweepNextBlock): |
| 85 | + * heap/LocalAllocatorInlines.h: |
| 86 | + (JSC::LocalAllocator::allocate): |
| 87 | + * heap/PreciseAllocation.cpp: |
| 88 | + (JSC::PreciseAllocation::tryCreate): |
| 89 | + (JSC::PreciseAllocation::createForLowerTier): |
| 90 | + * inspector/JSInjectedScriptHost.cpp: |
| 91 | + (Inspector::JSInjectedScriptHost::queryHolders): |
| 92 | + * inspector/agents/InspectorHeapAgent.cpp: |
| 93 | + (Inspector::InspectorHeapAgent::getPreview): |
| 94 | + (Inspector::InspectorHeapAgent::getRemoteObject): |
| 95 | + * inspector/agents/InspectorScriptProfilerAgent.cpp: |
| 96 | + (Inspector::InspectorScriptProfilerAgent::trackingComplete): |
| 97 | + * interpreter/ShadowChickenInlines.h: |
| 98 | + (JSC::ShadowChicken::iterate): |
| 99 | + * jit/JITOperations.cpp: |
| 100 | + (JSC::JSC_DEFINE_JIT_OPERATION): |
| 101 | + * jit/JITWorklist.cpp: |
| 102 | + (JSC::JITWorklist::completeAllReadyPlansForVM): |
| 103 | + (JSC::JITWorklist::waitUntilAllPlansForVMAreReady): |
| 104 | + (JSC::JITWorklist::completeAllPlansForVM): |
| 105 | + (JSC::JITWorklist::removeAllReadyPlansForVM): |
| 106 | + * jit/Repatch.cpp: |
| 107 | + (JSC::fireWatchpointsAndClearStubIfNeeded): |
| 108 | + (JSC::tryCacheGetBy): |
| 109 | + (JSC::tryCacheArrayGetByVal): |
| 110 | + (JSC::tryCachePutBy): |
| 111 | + (JSC::tryCacheArrayPutByVal): |
| 112 | + (JSC::tryCacheDeleteBy): |
| 113 | + (JSC::tryCacheInBy): |
| 114 | + (JSC::tryCacheHasPrivateBrand): |
| 115 | + (JSC::tryCacheCheckPrivateBrand): |
| 116 | + (JSC::tryCacheSetPrivateBrand): |
| 117 | + (JSC::tryCacheInstanceOf): |
| 118 | + (JSC::linkPolymorphicCall): |
| 119 | + * jsc.cpp: |
| 120 | + (JSC_DEFINE_HOST_FUNCTION): |
| 121 | + * llint/LLIntSlowPaths.cpp: |
| 122 | + (JSC::LLInt::jitCompileAndSetHeuristics): |
| 123 | + (JSC::LLInt::LLINT_SLOW_PATH_DECL): |
| 124 | + * runtime/CachedTypes.cpp: |
| 125 | + (JSC::decodeCodeBlockImpl): |
| 126 | + * runtime/ConcurrentJSLock.h: |
| 127 | + (JSC::GCSafeConcurrentJSLocker::GCSafeConcurrentJSLocker): |
| 128 | + * runtime/ExceptionFuzz.cpp: |
| 129 | + (JSC::doExceptionFuzzing): |
| 130 | + * runtime/JSArray.cpp: |
| 131 | + (JSC::JSArray::unshiftCountWithArrayStorage): |
| 132 | + * runtime/JSArrayBufferView.cpp: |
| 133 | + (JSC::JSArrayBufferView::slowDownAndWasteMemory): |
| 134 | + * runtime/JSCellInlines.h: |
| 135 | + * runtime/JSGenericTypedArrayViewInlines.h: |
| 136 | + * runtime/JSGlobalObject.cpp: |
| 137 | + (JSC::JSGlobalObject::haveABadTime): |
| 138 | + * runtime/JSObject.cpp: |
| 139 | + (JSC::JSObject::enterDictionaryIndexingModeWhenArrayStorageAlreadyExists): |
| 140 | + (JSC::JSObject::createInitialUndecided): |
| 141 | + (JSC::JSObject::createInitialInt32): |
| 142 | + (JSC::JSObject::createInitialDouble): |
| 143 | + (JSC::JSObject::createInitialContiguous): |
| 144 | + (JSC::JSObject::createArrayStorage): |
| 145 | + (JSC::JSObject::convertUndecidedToArrayStorage): |
| 146 | + (JSC::JSObject::convertInt32ToArrayStorage): |
| 147 | + (JSC::JSObject::convertDoubleToArrayStorage): |
| 148 | + (JSC::JSObject::convertContiguousToArrayStorage): |
| 149 | + (JSC::JSObject::increaseVectorLength): |
| 150 | + (JSC::JSObject::ensureLengthSlow): |
| 151 | + (JSC::JSObject::reallocateAndShrinkButterfly): |
| 152 | + (JSC::createCustomGetterFunction): |
| 153 | + (JSC::createCustomSetterFunction): |
| 154 | + * runtime/JSString.h: |
| 155 | + (JSC::jsSingleCharacterString): |
| 156 | + (JSC::JSString::toAtomString const): |
| 157 | + (JSC::JSString::toExistingAtomString const): |
| 158 | + (JSC::JSString::value const): |
| 159 | + (JSC::JSString::tryGetValue const): |
| 160 | + (JSC::JSRopeString::unsafeView const): |
| 161 | + (JSC::JSRopeString::viewWithUnderlyingString const): |
| 162 | + (JSC::JSString::unsafeView const): |
| 163 | + * runtime/JSSymbolTableObject.h: |
| 164 | + (JSC::symbolTablePut): |
| 165 | + * runtime/RegExpKey.h: |
| 166 | + * runtime/RegExpMatchesArray.cpp: |
| 167 | + (JSC::createEmptyRegExpMatchesArray): |
| 168 | + * runtime/RegExpMatchesArray.h: |
| 169 | + (JSC::createRegExpMatchesArray): |
| 170 | + * runtime/SamplingProfiler.cpp: |
| 171 | + (JSC::SamplingProfiler::stackTracesAsJSON): |
| 172 | + (JSC::SamplingProfiler::reportTopFunctions): |
| 173 | + (JSC::SamplingProfiler::reportTopBytecodes): |
| 174 | + * runtime/ScriptExecutable.cpp: |
| 175 | + (JSC::ScriptExecutable::prepareForExecutionImpl): |
| 176 | + * runtime/Structure.cpp: |
| 177 | + (JSC::Structure::materializePropertyTable): |
| 178 | + (JSC::Structure::addNewPropertyTransition): |
| 179 | + (JSC::Structure::removeNewPropertyTransition): |
| 180 | + (JSC::Structure::changePrototypeTransition): |
| 181 | + (JSC::Structure::attributeChangeTransition): |
| 182 | + (JSC::Structure::toDictionaryTransition): |
| 183 | + (JSC::Structure::nonPropertyTransitionSlow): |
| 184 | + (JSC::Structure::flattenDictionaryStructure): |
| 185 | + * runtime/StructureInlines.h: |
| 186 | + (JSC::Structure::add): |
| 187 | + (JSC::Structure::remove): |
| 188 | + (JSC::Structure::attributeChange): |
| 189 | + * runtime/VM.h: |
| 190 | + (JSC::VM::addressOfDoesGC): |
| 191 | + (JSC::VM::setDoesGCExpectation): |
| 192 | + (JSC::VM::verifyCanGC): |
| 193 | + |
1 | 194 | 2021-11-10 Saam Barati <sbarati@apple.com> |
2 | 195 |
|
3 | 196 | in_by_val should not constant fold to in_by_id when the property is a property index |
|
0 commit comments