Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: a53d011599e7726daa97e9fd8f233b0cc95aaed5
https://github.com/WebKit/WebKit/commit/a53d011599e7726daa97e9fd8f233b0cc95aaed5
Author: Dan Hecht <[email protected]>
Date: 2026-08-13 (Thu, 13 Aug 2026)
Changed paths:
M Source/JavaScriptCore/bytecode/CodeBlock.cpp
M Source/JavaScriptCore/bytecode/CodeBlock.h
M Source/JavaScriptCore/bytecode/RecordedStatuses.cpp
M Source/JavaScriptCore/bytecode/RecordedStatuses.h
M Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.cpp
M Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.h
M Source/JavaScriptCore/dfg/DFGJITCode.h
M Source/JavaScriptCore/dfg/DFGPlan.cpp
M Source/JavaScriptCore/dfg/DFGPlan.h
M Source/JavaScriptCore/heap/Heap.cpp
M Source/JavaScriptCore/heap/Heap.h
M Source/JavaScriptCore/interpreter/MicrotaskCall.h
M Source/JavaScriptCore/jit/JITPlan.h
M Source/JavaScriptCore/jit/JITWorklist.cpp
M Source/JavaScriptCore/runtime/ErrorInstance.cpp
M Source/JavaScriptCore/runtime/ErrorInstance.h
M Source/JavaScriptCore/runtime/FunctionExecutable.cpp
M Source/JavaScriptCore/runtime/FunctionExecutable.h
M Source/JavaScriptCore/runtime/FunctionExecutableInlines.h
M Source/JavaScriptCore/runtime/GlobalExecutable.cpp
M Source/JavaScriptCore/runtime/GlobalExecutable.h
M Source/JavaScriptCore/runtime/InferredValue.h
M Source/JavaScriptCore/runtime/InferredValueInlines.h
M Source/JavaScriptCore/runtime/JSFinalizationRegistry.cpp
M Source/JavaScriptCore/runtime/JSFinalizationRegistry.h
M Source/JavaScriptCore/runtime/JSWeakObjectRef.cpp
M Source/JavaScriptCore/runtime/JSWeakObjectRef.h
M Source/JavaScriptCore/runtime/ScriptExecutable.h
M Source/JavaScriptCore/runtime/ScriptExecutableInlines.h
M Source/JavaScriptCore/runtime/Structure.cpp
M Source/JavaScriptCore/runtime/Structure.h
M Source/JavaScriptCore/runtime/StructureInlines.h
M Source/JavaScriptCore/runtime/StructureRareData.cpp
M Source/JavaScriptCore/runtime/StructureRareData.h
M Source/JavaScriptCore/runtime/StructureTransitionTable.h
M Source/JavaScriptCore/runtime/SymbolTable.h
M Source/JavaScriptCore/runtime/SymbolTableInlines.h
M Source/JavaScriptCore/runtime/VM.cpp
M Source/JavaScriptCore/runtime/VM.h
M Source/JavaScriptCore/runtime/WeakMapImpl.h
M Source/JavaScriptCore/runtime/WeakMapImplInlines.h
M Source/JavaScriptCore/wasm/js/JSWebAssemblyInstance.cpp
M Source/JavaScriptCore/wasm/js/JSWebAssemblyInstance.h
Log Message:
-----------
[JSC] Rename finalizeUnconditionally to reconcileWeakReferencesAtGCEnd
https://bugs.webkit.org/show_bug.cgi?id=321688
rdar://184832952
Reviewed by Keith Miller.
This runs during the End phase on every marked, surviving cell and settles its
untraced pointers against the liveness that marking just established.
Typically finalizers are called for each dead object, so this dispatches in the
opposite direction. The "unconditionally" qualifier is also ambiguous.
So, make the following renames:
T::finalizeUnconditionally -> T::reconcileWeakReferencesAtGCEnd
Heap::finalizeUnconditionalFinalizers ->
Heap::reconcileWeakReferencesAtGCEnd
Heap::finalizeMarkedUnconditionalFinalizers
->
Heap::reconcileWeakReferencesInMarkedCells
IsoCellSet finalizerSet / finalizerSetFor
-> weakReconciliationSet /
weakReconciliationSetFor
"Reconcile" names what the survivor does, which fits that direction, and covers
the
range of resolutions, e.g.:
clear the pointer JSWeakObjectRef, UnlinkedFunctionExecutable,
LLInt/JIT inline caches
prune a container entry WeakMapImpl, StructureTransitionTable
salvage derived state ErrorInstance stringifies its stack trace while
the
weak frames are still readable, then drops them
invalidate a dependent InferredValue fires a watchpoint;
StructureRareData
drops a cached special property
notify an owner JSFinalizationRegistry moves registrations to a
dead
list and posts a cleanup job
The leaf helpers reached from here are renamed to match:
CodeBlock::finalizeLLIntInlineCaches -> reconcileLLIntInlineCachesAtGCEnd
CodeBlock::finalizeJITInlineCaches -> reconcileJITInlineCachesAtGCEnd
RecordedStatuses::finalize -> reconcileWeakReferences
RecordedStatuses::finalizeWithoutDeleting
->
reconcileWeakReferencesWithoutDeleting
JITPlan::finalizeInGC -> reconcileWeakReferencesAtGCEnd
ScriptExecutable::finalizeCodeBlockEdge
-> jettisonCodeBlockEdgeIfDead
The suffix is dropped where the caller is adjacent and the timing is obvious.
CodeBlock reconciles in multiple ways. Its inline caches are cleared outright,
while
updateAllPredictions salvages: ValueProfile::computeUpdatedPrediction and
ArrayProfile::computeUpdatedPrediction each read an untraced EncodedJSValue or
StructureID, fold it into a pointer-free SpeculatedType, then clear the slot.
Neither can run after sweep. updateActivity and the per-cycle flag reset are the
only work in there that is not reconciliation.
Also documents stronglyVisitWeakReferences, which is easy to mistake for part of
this pass. A CodeBlock is live either because something marked it directly, such
as a conservative stack scan finding it running, or because all of its code
dependencies are still live. In the former case those dependencies have not been
checked by anything, and that function is what keeps them alive.
No behavior change.
* Source/JavaScriptCore/bytecode/CodeBlock.cpp:
(JSC::CodeBlock::reconcileLLIntInlineCachesAtGCEnd):
(JSC::CodeBlock::reconcileJITInlineCachesAtGCEnd):
(JSC::CodeBlock::reconcileWeakReferencesAtGCEnd):
(JSC::CodeBlock::finalizeLLIntInlineCaches): Deleted.
(JSC::CodeBlock::finalizeJITInlineCaches): Deleted.
(JSC::CodeBlock::finalizeUnconditionally): Deleted.
* Source/JavaScriptCore/bytecode/CodeBlock.h:
* Source/JavaScriptCore/bytecode/RecordedStatuses.cpp:
(JSC::RecordedStatuses::reconcileWeakReferencesWithoutDeleting):
(JSC::RecordedStatuses::reconcileWeakReferences):
(JSC::RecordedStatuses::finalizeWithoutDeleting): Deleted.
(JSC::RecordedStatuses::finalize): Deleted.
* Source/JavaScriptCore/bytecode/RecordedStatuses.h:
* Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.cpp:
(JSC::UnlinkedFunctionExecutable::reconcileWeakReferencesAtGCEnd):
(JSC::UnlinkedFunctionExecutable::finalizeUnconditionally): Deleted.
* Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.h:
* Source/JavaScriptCore/dfg/DFGJITCode.h:
* Source/JavaScriptCore/dfg/DFGPlan.cpp:
(JSC::DFG::Plan::reconcileWeakReferencesAtGCEnd):
(JSC::DFG::Plan::finalizeInGC): Deleted.
* Source/JavaScriptCore/dfg/DFGPlan.h:
* Source/JavaScriptCore/heap/Heap.cpp:
(JSC::Heap::reconcileWeakReferencesInMarkedCells):
(JSC::Heap::reconcileWeakReferencesAtGCEnd):
(JSC::Heap::clearConcurrentRetainedDataIfPossible):
(JSC::Heap::finalizeMarkedUnconditionalFinalizers): Deleted.
(JSC::Heap::finalizeUnconditionalFinalizers): Deleted.
* Source/JavaScriptCore/heap/Heap.h:
(JSC::Heap::ScriptExecutableSpaceAndSets::ScriptExecutableSpaceAndSets):
(JSC::Heap::ScriptExecutableSpaceAndSets::weakReconciliationSetFor):
(JSC::Heap::ScriptExecutableSpaceAndSets::finalizerSetFor): Deleted.
* Source/JavaScriptCore/interpreter/MicrotaskCall.h:
* Source/JavaScriptCore/jit/JITPlan.h:
(JSC::JITPlan::reconcileWeakReferencesAtGCEnd):
(JSC::JITPlan::finalizeInGC): Deleted.
* Source/JavaScriptCore/jit/JITWorklist.cpp:
(JSC::JITWorklist::removeDeadPlans):
* Source/JavaScriptCore/runtime/ErrorInstance.cpp:
(JSC::ErrorInstance::reconcileWeakReferencesAtGCEnd):
(JSC::ErrorInstance::finalizeUnconditionally): Deleted.
* Source/JavaScriptCore/runtime/ErrorInstance.h:
* Source/JavaScriptCore/runtime/FunctionExecutable.cpp:
(JSC::FunctionExecutable::visitChildrenImpl):
* Source/JavaScriptCore/runtime/FunctionExecutable.h:
* Source/JavaScriptCore/runtime/FunctionExecutableInlines.h:
(JSC::FunctionExecutable::reconcileWeakReferencesAtGCEnd):
(JSC::FunctionExecutable::finalizeUnconditionally): Deleted.
* Source/JavaScriptCore/runtime/GlobalExecutable.cpp:
(JSC::GlobalExecutable::visitChildrenImpl):
(JSC::GlobalExecutable::reconcileWeakReferencesAtGCEnd):
(JSC::GlobalExecutable::finalizeUnconditionally): Deleted.
* Source/JavaScriptCore/runtime/GlobalExecutable.h:
* Source/JavaScriptCore/runtime/InferredValue.h:
* Source/JavaScriptCore/runtime/InferredValueInlines.h:
(JSC::InferredValue<JSCellType>::reconcileWeakReferencesAtGCEnd):
(JSC::InferredValue<JSCellType>::finalizeUnconditionally): Deleted.
* Source/JavaScriptCore/runtime/JSFinalizationRegistry.cpp:
(JSC::JSFinalizationRegistry::finishCreation):
(JSC::JSFinalizationRegistry::reconcileWeakReferencesAtGCEnd):
(JSC::JSFinalizationRegistry::finalizeUnconditionally): Deleted.
* Source/JavaScriptCore/runtime/JSFinalizationRegistry.h:
* Source/JavaScriptCore/runtime/JSWeakObjectRef.cpp:
(JSC::JSWeakObjectRef::reconcileWeakReferencesAtGCEnd):
(JSC::JSWeakObjectRef::finalizeUnconditionally): Deleted.
* Source/JavaScriptCore/runtime/JSWeakObjectRef.h:
* Source/JavaScriptCore/runtime/ScriptExecutable.h:
* Source/JavaScriptCore/runtime/ScriptExecutableInlines.h:
(JSC::ScriptExecutable::jettisonCodeBlockEdgeIfDead):
(JSC::ScriptExecutable::finalizeCodeBlockEdge): Deleted.
* Source/JavaScriptCore/runtime/Structure.cpp:
(JSC::Structure::reconcileWeakReferencesAtGCEnd):
(JSC::Structure::finalizeUnconditionally): Deleted.
* Source/JavaScriptCore/runtime/Structure.h:
* Source/JavaScriptCore/runtime/StructureInlines.h:
(JSC::StructureTransitionTable::reconcileWeakReferencesAtGCEnd):
(JSC::StructureTransitionTable::finalizeUnconditionally): Deleted.
* Source/JavaScriptCore/runtime/StructureRareData.cpp:
(JSC::StructureRareData::reconcileWeakReferencesAtGCEnd):
(JSC::StructureRareData::finalizeUnconditionally): Deleted.
* Source/JavaScriptCore/runtime/StructureRareData.h:
* Source/JavaScriptCore/runtime/StructureTransitionTable.h:
* Source/JavaScriptCore/runtime/SymbolTable.h:
* Source/JavaScriptCore/runtime/SymbolTableInlines.h:
(JSC::SymbolTable::reconcileWeakReferencesAtGCEnd):
(JSC::SymbolTable::finalizeUnconditionally): Deleted.
* Source/JavaScriptCore/runtime/VM.cpp:
(JSC::VM::reconcileWeakReferencesAtGCEnd):
(JSC::VM::finalizeUnconditionally): Deleted.
* Source/JavaScriptCore/runtime/VM.h:
* Source/JavaScriptCore/runtime/WeakMapImpl.h:
* Source/JavaScriptCore/runtime/WeakMapImplInlines.h:
(JSC::WeakMapImpl<WeakMapBucket>::reconcileWeakReferencesAtGCEnd):
(JSC::WeakMapImpl<WeakMapBucket>::rehash):
(JSC::WeakMapImpl<WeakMapBucket>::finalizeUnconditionally): Deleted.
* Source/JavaScriptCore/wasm/js/JSWebAssemblyInstance.cpp:
(JSC::JSWebAssemblyInstance::reconcileWeakReferencesAtGCEnd):
(JSC::JSWebAssemblyInstance::finalizeUnconditionally): Deleted.
* Source/JavaScriptCore/wasm/js/JSWebAssemblyInstance.h:
Canonical link: https://commits.webkit.org/319132@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications