Skip to content

Commit e92b51e

Browse files
committed
[JSC] Use DestructionMode instead of bool for JSCell::needsDestruction
https://bugs.webkit.org/show_bug.cgi?id=287207 rdar://problem/144349726 Reviewed by Yijia Huang and Keith Miller. This patch changes needsDestruction from bool to DestructionMode. We would like to add a third variant later, like, "MayNeedDestruction" for optimization, so this is a preparation for that. * Source/JavaScriptCore/API/JSAPIGlobalObject.h: * Source/JavaScriptCore/API/JSAPIWrapperObject.mm: * Source/JavaScriptCore/API/JSCallbackConstructor.h: * Source/JavaScriptCore/API/JSCallbackObject.cpp: * Source/JavaScriptCore/API/JSCallbackObject.h: * Source/JavaScriptCore/API/ObjCCallbackFunction.h: * Source/JavaScriptCore/API/glib/JSAPIWrapperGlobalObject.cpp: * Source/JavaScriptCore/API/glib/JSAPIWrapperObjectGLib.cpp: * Source/JavaScriptCore/API/glib/JSCCallbackFunction.h: * Source/JavaScriptCore/bytecode/CodeBlock.h: * Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h: * Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.h: * Source/JavaScriptCore/heap/BlockDirectory.h: (JSC::BlockDirectory::needsDestruction const): * Source/JavaScriptCore/heap/MarkedBlock.cpp: (JSC::MarkedBlock::Handle::sweep): * Source/JavaScriptCore/inspector/JSInjectedScriptHost.h: * Source/JavaScriptCore/inspector/JSJavaScriptCallFrame.h: * Source/JavaScriptCore/runtime/AbstractModuleRecord.h: * Source/JavaScriptCore/runtime/DateInstance.h: * Source/JavaScriptCore/runtime/ErrorInstance.h: * Source/JavaScriptCore/runtime/Exception.h: * Source/JavaScriptCore/runtime/ExecutableBase.h: * Source/JavaScriptCore/runtime/FunctionRareData.h: * Source/JavaScriptCore/runtime/IntlCollator.h: * Source/JavaScriptCore/runtime/IntlDateTimeFormat.h: * Source/JavaScriptCore/runtime/IntlDisplayNames.h: * Source/JavaScriptCore/runtime/IntlDurationFormat.h: * Source/JavaScriptCore/runtime/IntlListFormat.h: * Source/JavaScriptCore/runtime/IntlLocale.h: * Source/JavaScriptCore/runtime/IntlNumberFormat.h: * Source/JavaScriptCore/runtime/IntlPluralRules.h: * Source/JavaScriptCore/runtime/IntlRelativeTimeFormat.h: * Source/JavaScriptCore/runtime/IntlSegmentIterator.h: * Source/JavaScriptCore/runtime/IntlSegmenter.h: * Source/JavaScriptCore/runtime/IntlSegments.h: * Source/JavaScriptCore/runtime/JSCell.h: * Source/JavaScriptCore/runtime/JSCustomGetterFunction.h: * Source/JavaScriptCore/runtime/JSCustomSetterFunction.h: * Source/JavaScriptCore/runtime/JSDestructibleObject.h: * Source/JavaScriptCore/runtime/JSFinalizationRegistry.h: * Source/JavaScriptCore/runtime/JSGlobalLexicalEnvironment.h: * Source/JavaScriptCore/runtime/JSGlobalObject.h: * Source/JavaScriptCore/runtime/JSModuleNamespaceObject.h: * Source/JavaScriptCore/runtime/JSModuleRecord.h: * Source/JavaScriptCore/runtime/JSNativeStdFunction.h: * Source/JavaScriptCore/runtime/JSScriptFetchParameters.h: * Source/JavaScriptCore/runtime/JSScriptFetcher.h: * Source/JavaScriptCore/runtime/JSSegmentedVariableObject.h: * Source/JavaScriptCore/runtime/JSSourceCode.h: * Source/JavaScriptCore/runtime/JSString.h: * Source/JavaScriptCore/runtime/JSTemplateObjectDescriptor.h: * Source/JavaScriptCore/runtime/PropertyTable.h: * Source/JavaScriptCore/runtime/RegExp.h: * Source/JavaScriptCore/runtime/ScopedArgumentsTable.h: * Source/JavaScriptCore/runtime/SparseArrayValueMap.h: * Source/JavaScriptCore/runtime/Structure.h: * Source/JavaScriptCore/runtime/StructureRareData.h: * Source/JavaScriptCore/runtime/Symbol.h: * Source/JavaScriptCore/runtime/SymbolTable.h: * Source/JavaScriptCore/runtime/SyntheticModuleRecord.h: * Source/JavaScriptCore/runtime/WeakMapImpl.h: * Source/JavaScriptCore/tools/JSDollarVM.cpp: * Source/JavaScriptCore/wasm/js/JSWebAssemblyArray.h: * Source/JavaScriptCore/wasm/js/JSWebAssemblyException.h: * Source/JavaScriptCore/wasm/js/JSWebAssemblyGlobal.h: * Source/JavaScriptCore/wasm/js/JSWebAssemblyInstance.h: * Source/JavaScriptCore/wasm/js/JSWebAssemblyMemory.h: * Source/JavaScriptCore/wasm/js/JSWebAssemblyModule.h: * Source/JavaScriptCore/wasm/js/JSWebAssemblyStruct.h: * Source/JavaScriptCore/wasm/js/JSWebAssemblyTable.h: * Source/JavaScriptCore/wasm/js/JSWebAssemblyTag.h: * Source/JavaScriptCore/wasm/js/WebAssemblyFunction.h: * Source/JavaScriptCore/wasm/js/WebAssemblyModuleRecord.h: * Source/WebCore/bindings/js/JSDOMConstructorBase.h: * Source/WebCore/bindings/js/JSDOMConstructorNotCallable.h: * Source/WebCore/bindings/js/JSDOMWindowProperties.h: * Source/WebCore/bindings/js/JSObservableArray.h: * Source/WebCore/bindings/js/JSWindowProxy.h: * Source/WebCore/bridge/objc/objc_runtime.h: * Source/WebCore/bridge/runtime_array.h: * Source/WebCore/bridge/runtime_object.h: Canonical link: https://commits.webkit.org/289983@main
1 parent 5a4c7f2 commit e92b51e

File tree

78 files changed

+83
-80
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+83
-80
lines changed

Source/JavaScriptCore/API/JSAPIGlobalObject.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class JSAPIGlobalObject final : public JSGlobalObject {
3737

3838
DECLARE_EXPORT_INFO;
3939

40-
static constexpr bool needsDestruction = true;
40+
static constexpr DestructionMode needsDestruction = NeedsDestruction;
4141
template<typename CellType, SubspaceAccess mode>
4242
static GCClient::IsoSubspace* subspaceFor(VM& vm)
4343
{

Source/JavaScriptCore/API/JSAPIWrapperObject.mm

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
DEFINE_VISIT_CHILDREN_WITH_MODIFIER(template<>, JSCallbackObject<JSAPIWrapperObject>);
7777

7878
template <> const ClassInfo JSCallbackObject<JSAPIWrapperObject>::s_info = { "JSAPIWrapperObject"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSCallbackObject) };
79-
template <> const bool JSCallbackObject<JSAPIWrapperObject>::needsDestruction = true;
79+
template <> const JSC::DestructionMode JSCallbackObject<JSAPIWrapperObject>::needsDestruction = JSC::NeedsDestruction;
8080

8181
template <>
8282
NativeFunction::Ptr JSCallbackObject<JSAPIWrapperObject>::getCallFunction()

Source/JavaScriptCore/API/JSCallbackConstructor.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class JSCallbackConstructor final : public JSNonFinalObject {
3838
public:
3939
using Base = JSNonFinalObject;
4040
static constexpr unsigned StructureFlags = Base::StructureFlags | ImplementsHasInstance | ImplementsDefaultHasInstance;
41-
static constexpr bool needsDestruction = true;
41+
static constexpr DestructionMode needsDestruction = NeedsDestruction;
4242

4343
template<typename CellType, SubspaceAccess mode>
4444
static GCClient::IsoSubspace* subspaceFor(VM& vm)

Source/JavaScriptCore/API/JSCallbackObject.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ DEFINE_VISIT_CHILDREN_WITH_MODIFIER(template<>, JSCallbackObject<JSGlobalObject>
4747
// Define the two types of JSCallbackObjects we support.
4848
template <> const ClassInfo JSCallbackObject<JSNonFinalObject>::s_info = { "CallbackObject"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSCallbackObject) };
4949
template <> const ClassInfo JSCallbackObject<JSGlobalObject>::s_info = { "CallbackGlobalObject"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSCallbackObject) };
50-
template<> const bool JSCallbackObject<JSNonFinalObject>::needsDestruction = true;
51-
template<> const bool JSCallbackObject<JSGlobalObject>::needsDestruction = true;
50+
template<> const DestructionMode JSCallbackObject<JSNonFinalObject>::needsDestruction = NeedsDestruction;
51+
template<> const DestructionMode JSCallbackObject<JSGlobalObject>::needsDestruction = NeedsDestruction;
5252

5353
template<>
5454
NativeFunction::Ptr JSCallbackObject<JSNonFinalObject>::getCallFunction()

Source/JavaScriptCore/API/JSCallbackObject.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ class JSCallbackObject final : public Parent {
145145
}
146146
static JSCallbackObject<Parent>* create(VM&, JSClassRef, Structure*);
147147

148-
static const bool needsDestruction;
148+
static const DestructionMode needsDestruction;
149149
static void destroy(JSCell* cell)
150150
{
151151
static_cast<JSCallbackObject*>(cell)->JSCallbackObject::~JSCallbackObject();

Source/JavaScriptCore/API/ObjCCallbackFunction.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class ObjCCallbackFunction : public InternalFunction {
6060
}
6161

6262
static ObjCCallbackFunction* create(VM&, JSGlobalObject*, const String& name, std::unique_ptr<ObjCCallbackFunctionImpl>);
63-
static constexpr bool needsDestruction = true;
63+
static constexpr DestructionMode needsDestruction = NeedsDestruction;
6464
static void destroy(JSCell*);
6565

6666
static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)

Source/JavaScriptCore/API/glib/JSAPIWrapperGlobalObject.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ static JSC_DECLARE_CUSTOM_GETTER(staticFunctionGetterJSAPIWrapperGlobalObjectCal
6363
DEFINE_VISIT_CHILDREN_WITH_MODIFIER(template<>, JSCallbackObject<JSAPIWrapperGlobalObject>);
6464

6565
template <> const ClassInfo JSCallbackObject<JSAPIWrapperGlobalObject>::s_info = { "JSAPIWrapperGlobalObject"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSCallbackObject) };
66-
template<> const bool JSCallbackObject<JSAPIWrapperGlobalObject>::needsDestruction = true;
66+
template<> const DestructionMode JSCallbackObject<JSAPIWrapperGlobalObject>::needsDestruction = NeedsDestruction;
6767

6868
template <>
6969
NativeFunction::Ptr JSCallbackObject<JSAPIWrapperGlobalObject>::getCallFunction()

Source/JavaScriptCore/API/glib/JSAPIWrapperObjectGLib.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ static JSC_DECLARE_CUSTOM_GETTER(staticFunctionGetterJSAPIWrapperObjectCallbackO
7676
DEFINE_VISIT_CHILDREN_WITH_MODIFIER(template<>, JSCallbackObject<JSAPIWrapperObject>);
7777

7878
template <> const ClassInfo JSCallbackObject<JSAPIWrapperObject>::s_info = { "JSAPIWrapperObject"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSCallbackObject) };
79-
template<> const bool JSCallbackObject<JSAPIWrapperObject>::needsDestruction = true;
79+
template<> const DestructionMode JSCallbackObject<JSAPIWrapperObject>::needsDestruction = NeedsDestruction;
8080

8181
template <>
8282
NativeFunction::Ptr JSCallbackObject<JSAPIWrapperObject>::getCallFunction()

Source/JavaScriptCore/API/glib/JSCCallbackFunction.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class JSCCallbackFunction final : public InternalFunction {
5353
};
5454

5555
static JSCCallbackFunction* create(VM&, JSGlobalObject*, const String& name, Type, JSCClass*, GRefPtr<GClosure>&&, GType, std::optional<Vector<GType>>&&);
56-
static constexpr bool needsDestruction = true;
56+
static constexpr DestructionMode needsDestruction = NeedsDestruction;
5757
static void destroy(JSCell*);
5858

5959
static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)

Source/JavaScriptCore/bytecode/CodeBlock.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ class CodeBlock : public JSCell {
118118
enum CopyParsedBlockTag { CopyParsedBlock };
119119

120120
static constexpr unsigned StructureFlags = Base::StructureFlags | StructureIsImmortal;
121-
static constexpr bool needsDestruction = true;
121+
static constexpr DestructionMode needsDestruction = NeedsDestruction;
122122

123123
template<typename, SubspaceAccess>
124124
static void subspaceFor(VM&)

Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ class UnlinkedCodeBlock : public JSCell {
140140
typedef JSCell Base;
141141
static constexpr unsigned StructureFlags = Base::StructureFlags;
142142

143-
static constexpr bool needsDestruction = true;
143+
static constexpr DestructionMode needsDestruction = NeedsDestruction;
144144

145145
template<typename, SubspaceAccess>
146146
static void subspaceFor(VM&)

Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ class UnlinkedFunctionExecutable final : public JSCell {
149149

150150
PrivateBrandRequirement privateBrandRequirement() const { return static_cast<PrivateBrandRequirement>(m_privateBrandRequirement); }
151151

152-
static constexpr bool needsDestruction = true;
152+
static constexpr DestructionMode needsDestruction = NeedsDestruction;
153153
static void destroy(JSCell*);
154154

155155
ImplementationVisibility implementationVisibility() const { return static_cast<ImplementationVisibility>(m_implementationVisibility); }

Source/JavaScriptCore/inspector/JSInjectedScriptHost.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class JSInjectedScriptHost final : public JSC::JSNonFinalObject {
3535
public:
3636
using Base = JSC::JSNonFinalObject;
3737
static constexpr unsigned StructureFlags = Base::StructureFlags;
38-
static constexpr bool needsDestruction = true;
38+
static constexpr JSC::DestructionMode needsDestruction = JSC::NeedsDestruction;
3939

4040
template<typename CellType, JSC::SubspaceAccess mode>
4141
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)

Source/JavaScriptCore/inspector/JSJavaScriptCallFrame.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class JSJavaScriptCallFrame final : public JSC::JSNonFinalObject {
3434
public:
3535
using Base = JSC::JSNonFinalObject;
3636
static constexpr unsigned StructureFlags = Base::StructureFlags;
37-
static constexpr bool needsDestruction = true;
37+
static constexpr JSC::DestructionMode needsDestruction = JSC::NeedsDestruction;
3838

3939
template<typename CellType, JSC::SubspaceAccess mode>
4040
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)

Source/JavaScriptCore/runtime/AbstractModuleRecord.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class AbstractModuleRecord : public JSInternalFieldObjectImpl<2> {
4444
public:
4545
using Base = JSInternalFieldObjectImpl<2>;
4646

47-
static constexpr bool needsDestruction = true;
47+
static constexpr DestructionMode needsDestruction = NeedsDestruction;
4848

4949
template<typename CellType, SubspaceAccess>
5050
static void subspaceFor(VM&)

Source/JavaScriptCore/runtime/DateInstance.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class DateInstance final : public JSNonFinalObject {
2828
public:
2929
using Base = JSNonFinalObject;
3030

31-
static constexpr bool needsDestruction = true;
31+
static constexpr DestructionMode needsDestruction = NeedsDestruction;
3232
static void destroy(JSCell* cell)
3333
{
3434
static_cast<DateInstance*>(cell)->DateInstance::~DateInstance();

Source/JavaScriptCore/runtime/ErrorInstance.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class ErrorInstance : public JSNonFinalObject {
3434
using Base = JSNonFinalObject;
3535

3636
static constexpr unsigned StructureFlags = Base::StructureFlags | OverridesGetOwnPropertySlot | OverridesGetOwnSpecialPropertyNames | OverridesPut | GetOwnPropertySlotIsImpureForPropertyAbsence;
37-
static constexpr bool needsDestruction = true;
37+
static constexpr DestructionMode needsDestruction = NeedsDestruction;
3838

3939
static void destroy(JSCell* cell)
4040
{

Source/JavaScriptCore/runtime/Exception.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class Exception final : public JSCell {
3535
public:
3636
using Base = JSCell;
3737
static constexpr unsigned StructureFlags = Base::StructureFlags | StructureIsImmortal;
38-
static constexpr bool needsDestruction = true;
38+
static constexpr DestructionMode needsDestruction = NeedsDestruction;
3939

4040
template<typename CellType, SubspaceAccess mode>
4141
static GCClient::IsoSubspace* subspaceFor(VM& vm)

Source/JavaScriptCore/runtime/ExecutableBase.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class ExecutableBase : public JSCell {
7171
public:
7272
static constexpr unsigned StructureFlags = Base::StructureFlags;
7373

74-
static constexpr bool needsDestruction = true;
74+
static constexpr DestructionMode needsDestruction = NeedsDestruction;
7575
static void destroy(JSCell*);
7676

7777
// Force subclasses to override this.

Source/JavaScriptCore/runtime/FunctionRareData.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class FunctionRareData final : public JSCell {
5353

5454
static FunctionRareData* create(VM&, ExecutableBase*);
5555

56-
static constexpr bool needsDestruction = true;
56+
static constexpr DestructionMode needsDestruction = NeedsDestruction;
5757

5858
template<typename CellType, SubspaceAccess mode>
5959
static GCClient::IsoSubspace* subspaceFor(VM& vm)

Source/JavaScriptCore/runtime/IntlCollator.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class IntlCollator final : public JSNonFinalObject {
4040
public:
4141
using Base = JSNonFinalObject;
4242

43-
static constexpr bool needsDestruction = true;
43+
static constexpr DestructionMode needsDestruction = NeedsDestruction;
4444

4545
static void destroy(JSCell* cell)
4646
{

Source/JavaScriptCore/runtime/IntlDateTimeFormat.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class IntlDateTimeFormat final : public JSNonFinalObject {
4646
public:
4747
using Base = JSNonFinalObject;
4848

49-
static constexpr bool needsDestruction = true;
49+
static constexpr DestructionMode needsDestruction = NeedsDestruction;
5050

5151
static void destroy(JSCell* cell)
5252
{

Source/JavaScriptCore/runtime/IntlDisplayNames.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class IntlDisplayNames final : public JSNonFinalObject {
3737
public:
3838
using Base = JSNonFinalObject;
3939

40-
static constexpr bool needsDestruction = true;
40+
static constexpr DestructionMode needsDestruction = NeedsDestruction;
4141

4242
static void destroy(JSCell* cell)
4343
{

Source/JavaScriptCore/runtime/IntlDurationFormat.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class IntlDurationFormat final : public JSNonFinalObject {
3939
public:
4040
using Base = JSNonFinalObject;
4141

42-
static constexpr bool needsDestruction = true;
42+
static constexpr DestructionMode needsDestruction = NeedsDestruction;
4343

4444
static void destroy(JSCell* cell)
4545
{

Source/JavaScriptCore/runtime/IntlListFormat.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class IntlListFormat final : public JSNonFinalObject {
4242
public:
4343
using Base = JSNonFinalObject;
4444

45-
static constexpr bool needsDestruction = true;
45+
static constexpr DestructionMode needsDestruction = NeedsDestruction;
4646

4747
static void destroy(JSCell* cell)
4848
{

Source/JavaScriptCore/runtime/IntlLocale.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class IntlLocale final : public JSNonFinalObject {
3434
public:
3535
using Base = JSNonFinalObject;
3636

37-
static constexpr bool needsDestruction = true;
37+
static constexpr DestructionMode needsDestruction = NeedsDestruction;
3838

3939
static void destroy(JSCell* cell)
4040
{

Source/JavaScriptCore/runtime/IntlNumberFormat.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ class IntlNumberFormat final : public JSNonFinalObject {
137137
public:
138138
using Base = JSNonFinalObject;
139139

140-
static constexpr bool needsDestruction = true;
140+
static constexpr DestructionMode needsDestruction = NeedsDestruction;
141141

142142
static void destroy(JSCell* cell)
143143
{

Source/JavaScriptCore/runtime/IntlPluralRules.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class IntlPluralRules final : public JSNonFinalObject {
4444
public:
4545
using Base = JSNonFinalObject;
4646

47-
static constexpr bool needsDestruction = true;
47+
static constexpr DestructionMode needsDestruction = NeedsDestruction;
4848

4949
static void destroy(JSCell* cell)
5050
{

Source/JavaScriptCore/runtime/IntlRelativeTimeFormat.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class IntlRelativeTimeFormat final : public JSNonFinalObject {
3838
public:
3939
using Base = JSNonFinalObject;
4040

41-
static constexpr bool needsDestruction = true;
41+
static constexpr DestructionMode needsDestruction = NeedsDestruction;
4242

4343
static void destroy(JSCell* cell)
4444
{

Source/JavaScriptCore/runtime/IntlSegmentIterator.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class IntlSegmentIterator final : public JSNonFinalObject {
3434
public:
3535
using Base = JSNonFinalObject;
3636

37-
static constexpr bool needsDestruction = true;
37+
static constexpr DestructionMode needsDestruction = NeedsDestruction;
3838

3939
static void destroy(JSCell* cell)
4040
{

Source/JavaScriptCore/runtime/IntlSegmenter.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class IntlSegmenter final : public JSNonFinalObject {
3737
public:
3838
using Base = JSNonFinalObject;
3939

40-
static constexpr bool needsDestruction = true;
40+
static constexpr DestructionMode needsDestruction = NeedsDestruction;
4141

4242
static void destroy(JSCell* cell)
4343
{

Source/JavaScriptCore/runtime/IntlSegments.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class IntlSegments final : public JSNonFinalObject {
3333
public:
3434
using Base = JSNonFinalObject;
3535

36-
static constexpr bool needsDestruction = true;
36+
static constexpr DestructionMode needsDestruction = NeedsDestruction;
3737

3838
static void destroy(JSCell* cell)
3939
{

Source/JavaScriptCore/runtime/JSCell.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include "CallData.h"
2626
#include "CellState.h"
2727
#include "ConstructData.h"
28+
#include "DestructionMode.h"
2829
#include "EnumerationMode.h"
2930
#include "Heap.h"
3031
#include "HeapCell.h"
@@ -99,7 +100,7 @@ class JSCell : public HeapCell {
99100
public:
100101
static constexpr unsigned StructureFlags = 0;
101102

102-
static constexpr bool needsDestruction = false;
103+
static constexpr DestructionMode needsDestruction = DoesNotNeedDestruction;
103104

104105
static constexpr bool usePreciseAllocationsOnly = false;
105106
static constexpr uint8_t numberOfLowerTierPreciseCells = 8;

Source/JavaScriptCore/runtime/JSCustomGetterFunction.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class JSCustomGetterFunction final : public JSFunction {
3636

3737
using CustomFunctionPointer = GetValueFunc;
3838

39-
static constexpr bool needsDestruction = true;
39+
static constexpr DestructionMode needsDestruction = NeedsDestruction;
4040
static void destroy(JSCell*);
4141

4242
template<typename CellType, SubspaceAccess mode>

Source/JavaScriptCore/runtime/JSCustomSetterFunction.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class JSCustomSetterFunction final : public JSFunction {
3636

3737
using CustomFunctionPointer = PutValueFunc;
3838

39-
static constexpr bool needsDestruction = true;
39+
static constexpr DestructionMode needsDestruction = NeedsDestruction;
4040
static void destroy(JSCell*);
4141

4242
template<typename CellType, SubspaceAccess mode>

Source/JavaScriptCore/runtime/JSDestructibleObject.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class JSDestructibleObject : public JSNonFinalObject {
3535
public:
3636
using Base = JSNonFinalObject;
3737

38-
static constexpr bool needsDestruction = true;
38+
static constexpr DestructionMode needsDestruction = NeedsDestruction;
3939

4040
const ClassInfo* classInfo() const { return m_classInfo; }
4141

Source/JavaScriptCore/runtime/JSFinalizationRegistry.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class JSFinalizationRegistry final : public JSInternalFieldObjectImpl<1> {
7272
void finalizeUnconditionally(VM&, CollectionScope);
7373
DECLARE_VISIT_CHILDREN;
7474
static void destroy(JSCell*);
75-
static constexpr bool needsDestruction = true;
75+
static constexpr DestructionMode needsDestruction = NeedsDestruction;
7676

7777
JSValue takeDeadHoldingsValue();
7878

Source/JavaScriptCore/runtime/JSGlobalLexicalEnvironment.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class JSGlobalLexicalEnvironment final : public JSSegmentedVariableObject {
5454
static bool put(JSCell*, JSGlobalObject*, PropertyName, JSValue, PutPropertySlot&);
5555

5656
static void destroy(JSCell*);
57-
static constexpr bool needsDestruction = true;
57+
static constexpr DestructionMode needsDestruction = NeedsDestruction;
5858

5959
bool isEmpty() const { return !symbolTable()->size(); }
6060
bool isConstVariable(UniquedStringImpl*);

Source/JavaScriptCore/runtime/JSGlobalObject.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ class JSGlobalObject : public JSSegmentedVariableObject {
630630
using Base = JSSegmentedVariableObject;
631631
static constexpr unsigned StructureFlags = Base::StructureFlags | HasStaticPropertyTable | OverridesGetOwnPropertySlot | OverridesPut | IsImmutablePrototypeExoticObject;
632632

633-
static constexpr bool needsDestruction = true;
633+
static constexpr DestructionMode needsDestruction = NeedsDestruction;
634634
template<typename CellType, SubspaceAccess mode>
635635
static GCClient::IsoSubspace* subspaceFor(VM& vm)
636636
{

Source/JavaScriptCore/runtime/JSModuleNamespaceObject.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class JSModuleNamespaceObject final : public JSNonFinalObject {
3636
using Base = JSNonFinalObject;
3737
static constexpr unsigned StructureFlags = Base::StructureFlags | OverridesGetOwnPropertySlot | OverridesGetOwnPropertyNames | OverridesPut | InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | GetOwnPropertySlotIsImpureForPropertyAbsence | IsImmutablePrototypeExoticObject;
3838

39-
static constexpr bool needsDestruction = true;
39+
static constexpr DestructionMode needsDestruction = NeedsDestruction;
4040
static void destroy(JSCell*);
4141

4242
template<typename CellType, SubspaceAccess mode>

Source/JavaScriptCore/runtime/JSModuleRecord.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class JSModuleRecord final : public AbstractModuleRecord {
4242

4343
DECLARE_EXPORT_INFO;
4444

45-
static constexpr bool needsDestruction = true;
45+
static constexpr DestructionMode needsDestruction = NeedsDestruction;
4646
static void destroy(JSCell*);
4747

4848
template<typename CellType, SubspaceAccess mode>

Source/JavaScriptCore/runtime/JSNativeStdFunction.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class JSNativeStdFunction final : public JSFunction {
3838
using Base = JSFunction;
3939

4040
static constexpr unsigned StructureFlags = Base::StructureFlags;
41-
static constexpr bool needsDestruction = true;
41+
static constexpr DestructionMode needsDestruction = NeedsDestruction;
4242
static void destroy(JSCell* cell)
4343
{
4444
static_cast<JSNativeStdFunction*>(cell)->JSNativeStdFunction::~JSNativeStdFunction();

Source/JavaScriptCore/runtime/JSScriptFetchParameters.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class JSScriptFetchParameters final : public JSCell {
3737
using Base = JSCell;
3838

3939
static constexpr unsigned StructureFlags = Base::StructureFlags | StructureIsImmortal;
40-
static constexpr bool needsDestruction = true;
40+
static constexpr DestructionMode needsDestruction = NeedsDestruction;
4141

4242
DECLARE_EXPORT_INFO;
4343

0 commit comments

Comments
 (0)