Skip to content

Commit 55e71c0

Browse files
committed
Adopt NODELETE annotation in more places in JavaScriptCore/
https://bugs.webkit.org/show_bug.cgi?id=308196 Reviewed by Keith Miller. * Source/JavaScriptCore/API/tests/CompareAndSwapTest.cpp: (Bitmap::numBits const): (Bitmap::concurrentTestAndSet): * Source/JavaScriptCore/API/tests/ExecutionTimeLimitTest.cpp: (shouldTerminateCallback): (cancelTerminateCallback): (dispatchTermitateCallback): * Source/JavaScriptCore/API/tests/GlobalContextWithFinalizerTest.cpp: (finalize): * Source/JavaScriptCore/API/tests/Node.h: * Source/JavaScriptCore/API/tests/NodeList.h: * Source/JavaScriptCore/API/tests/TypedArrayCTest.cpp: (bytesDeallocatorNoCopy): * Source/JavaScriptCore/API/tests/testapi.c: (MyObject_convertToTypeWrapper): (MyObject_set_nullGetForwardSet): (Base_returnHardNull): (myBadConstructor_callAsConstructor): (checkConstnessInJSObjectNames): * Source/JavaScriptCore/API/tests/testapi.cpp: (TestAPI::failed const): * Source/JavaScriptCore/assembler/testmasm.cpp: (hiddenTruthBecauseNoReturnIsStupid): (JSC::isPC): (JSC::isSP): (JSC::isFP): (JSC::isSpecialGPR): (JSC::testFunctionToTrashGPRs): * Source/JavaScriptCore/b3/air/testair.cpp: (hiddenTruthBecauseNoReturnIsStupid): * Source/JavaScriptCore/b3/testb3_2.cpp: (bitAndDouble): (bitAndFloat): * Source/JavaScriptCore/b3/testb3_3.cpp: (bitOrDouble): (bitOrFloat): (countLeadingZero): (zero): (negativeZero): * Source/JavaScriptCore/b3/testb3_6.cpp: (b3Pow): * Source/JavaScriptCore/b3/testb3_7.cpp: (makeArrayForLoops): (testFastTLSLoad): (testFastTLSStore): (doubleEq): (doubleNeq): (doubleGt): (doubleGte): (doubleLt): (doubleLte): * Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::dataFormatString): * Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h: * Source/JavaScriptCore/dfg/testdfg.cpp: (hiddenTruthBecauseNoReturnIsStupid): * Source/JavaScriptCore/disassembler/ARM64/Binja.c: (extractRegNumber): (isReg64Bit): * Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::abstractHeapForOwnPropertyKeysCache): (JSC::FTL::DFG::LowerDFGToB3::compileCompareStrictEq): * Source/JavaScriptCore/jsc.cpp: (Message::releaseContents): (Message::index const): (Worker::isMain const): (StopWatch::getElapsedMS): (shellSupportsRichSourceInfo): (pathSeparator): (JSCMemoryFootprint::subspaceFor): (JSFileDescriptor::subspaceFor): (JSFileDescriptor::descriptor const): (crashDueToJSCShellTimeout): * Source/JavaScriptCore/llint/LLIntOffsetsExtractor.cpp: (JSC::LLIntOffsetsExtractor::dummy): * Source/JavaScriptCore/parser/Parser.cpp: (JSC::isPrivateFieldName): (JSC::destructuringKindToVariableKindName): (JSC::adjustSuperBindingForBaseConstructor): (JSC::stringArticleForFunctionMode): (JSC::stringForFunctionMode): (JSC::getMetadata): * Source/JavaScriptCore/parser/Parser.h: * Source/JavaScriptCore/runtime/IntlDateTimeFormat.h: * Source/JavaScriptCore/runtime/IntlDurationFormat.cpp: (JSC::displayName): (JSC::getDurationSign): * Source/JavaScriptCore/runtime/IntlNumberFormat.cpp: (JSC::computeCurrencySortKey): (JSC::extractCurrencySortKey): * Source/JavaScriptCore/runtime/IntlPluralRules.h: * Source/JavaScriptCore/testRegExp.cpp: (StopWatch::getElapsedMS): * Source/JavaScriptCore/wasm/WasmBBQJIT.h: * Source/JavaScriptCore/wasm/WasmBBQJIT64.cpp: (JSC::Wasm::BBQJITImpl::BBQJIT::sizeOfType): (JSC::Wasm::BBQJITImpl::BBQJIT::alignedFrameSize const): (JSC::Wasm::BBQJITImpl::BBQJIT::notifyFunctionUsesSIMD): * Source/JavaScriptCore/wasm/WasmIPIntSlowPaths.cpp: (JSC::IPInt::copyExceptionStackToPayload): (JSC::IPInt::copyExceptionPayloadToStack): * Source/JavaScriptCore/wasm/WasmIPIntSlowPaths.h: * Source/JavaScriptCore/wasm/debugger/tests/ControlFlowTests.cpp: (WasmDebugInfoTest::testTryOpcode): (WasmDebugInfoTest::testCatchOpcode): (WasmDebugInfoTest::testThrowOpcode): (WasmDebugInfoTest::testRethrowOpcode): (WasmDebugInfoTest::testThrowRefOpcode): (WasmDebugInfoTest::testDelegateOpcode): (WasmDebugInfoTest::testCatchAllOpcode): (WasmDebugInfoTest::testTryTableOpcode): * Source/JavaScriptCore/wasm/debugger/tests/ExecutionHandlerTestSupport.cpp: (ExecutionHandlerTestSupport::Worker::isMain const): * Source/JavaScriptCore/wasm/debugger/tests/TestScripts.h: Canonical link: https://commits.webkit.org/307853@main
1 parent 6c50837 commit 55e71c0

35 files changed

Lines changed: 169 additions & 169 deletions

Source/JavaScriptCore/API/tests/CompareAndSwapTest.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class Bitmap {
3939

4040
inline void clearAll();
4141
inline bool concurrentTestAndSet(size_t n);
42-
inline size_t numBits() const { return words * wordSize; }
42+
inline size_t NODELETE numBits() const { return words * wordSize; }
4343

4444
private:
4545
static constexpr size_t Size = 4096*10;
@@ -56,7 +56,7 @@ inline void Bitmap::clearAll()
5656
memset(&bits, 0, sizeof(bits));
5757
}
5858

59-
inline bool Bitmap::concurrentTestAndSet(size_t n)
59+
inline bool NODELETE Bitmap::concurrentTestAndSet(size_t n)
6060
{
6161
uint8_t mask = one << (n % wordSize);
6262
size_t index = n / wordSize;

Source/JavaScriptCore/API/tests/ExecutionTimeLimitTest.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,14 @@ static JSValueRef currentCPUTimeAsJSFunctionCallback(JSContextRef ctx, JSObjectR
6161
}
6262

6363
bool shouldTerminateCallbackWasCalled = false;
64-
static bool shouldTerminateCallback(JSContextRef, void*)
64+
static bool NODELETE shouldTerminateCallback(JSContextRef, void*)
6565
{
6666
shouldTerminateCallbackWasCalled = true;
6767
return true;
6868
}
6969

7070
bool cancelTerminateCallbackWasCalled = false;
71-
static bool cancelTerminateCallback(JSContextRef, void*)
71+
static bool NODELETE cancelTerminateCallback(JSContextRef, void*)
7272
{
7373
cancelTerminateCallbackWasCalled = true;
7474
return false;
@@ -88,7 +88,7 @@ static bool extendTerminateCallback(JSContextRef ctx, void*)
8888

8989
#if HAVE(MACH_EXCEPTIONS)
9090
bool dispatchTerminateCallbackCalled = false;
91-
static bool dispatchTermitateCallback(JSContextRef, void*)
91+
static bool NODELETE dispatchTermitateCallback(JSContextRef, void*)
9292
{
9393
dispatchTerminateCallbackCalled = true;
9494
return true;

Source/JavaScriptCore/API/tests/GlobalContextWithFinalizerTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
static bool failed = true;
3333

34-
static void finalize(JSObjectRef)
34+
static void NODELETE finalize(JSObjectRef)
3535
{
3636
failed = false;
3737
}

Source/JavaScriptCore/API/tests/Node.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ struct __Node {
4040
};
4141

4242
extern Node* Node_new(void);
43-
extern void Node_ref(Node* node);
43+
extern void NODELETE Node_ref(Node* node);
4444
extern void Node_deref(Node* node);
4545
extern void Node_appendChild(Node* node, Node* child);
4646
extern void Node_removeChild(Node* node, Node* child);

Source/JavaScriptCore/API/tests/NodeList.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ typedef struct {
3333
} NodeList;
3434

3535
extern NodeList* NodeList_new(Node* parentNode);
36-
extern unsigned NodeList_length(NodeList*);
37-
extern Node* NodeList_item(NodeList*, unsigned);
38-
extern void NodeList_ref(NodeList*);
36+
extern unsigned NODELETE NodeList_length(NodeList*);
37+
extern Node* NODELETE NodeList_item(NodeList*, unsigned);
38+
extern void NODELETE NodeList_ref(NodeList*);
3939
extern void NodeList_deref(NodeList*);

Source/JavaScriptCore/API/tests/TypedArrayCTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ WTF_ALLOW_UNSAFE_BUFFER_USAGE_BEGIN
3636

3737
extern "C" void JSSynchronousGarbageCollectForDebugging(JSContextRef);
3838

39-
static void bytesDeallocatorNoCopy(void*, void*) { }
39+
static void NODELETE bytesDeallocatorNoCopy(void*, void*) { }
4040
static void freePtr(void* ptr, void*)
4141
{
4242
free(ptr);

Source/JavaScriptCore/API/tests/testapi.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ static JSValueRef MyObject_convertToType(JSContextRef context, JSObjectRef objec
385385
return JSValueMakeNull(context);
386386
}
387387

388-
static JSValueRef MyObject_convertToTypeWrapper(JSContextRef context, JSObjectRef object, JSType type, JSValueRef* exception)
388+
static JSValueRef NODELETE MyObject_convertToTypeWrapper(JSContextRef context, JSObjectRef object, JSType type, JSValueRef* exception)
389389
{
390390
UNUSED_PARAM(context);
391391
UNUSED_PARAM(object);
@@ -395,7 +395,7 @@ static JSValueRef MyObject_convertToTypeWrapper(JSContextRef context, JSObjectRe
395395
return 0;
396396
}
397397

398-
static bool MyObject_set_nullGetForwardSet(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef value, JSValueRef* exception)
398+
static bool NODELETE MyObject_set_nullGetForwardSet(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef value, JSValueRef* exception)
399399
{
400400
UNUSED_PARAM(ctx);
401401
UNUSED_PARAM(object);
@@ -756,7 +756,7 @@ static JSValueRef Base_callAsFunction(JSContextRef ctx, JSObjectRef function, JS
756756
return JSValueMakeNumber(ctx, 1); // distinguish base call from derived call
757757
}
758758

759-
static JSValueRef Base_returnHardNull(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
759+
static JSValueRef NODELETE Base_returnHardNull(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
760760
{
761761
UNUSED_PARAM(ctx);
762762
UNUSED_PARAM(function);
@@ -943,7 +943,7 @@ static JSObjectRef myConstructor_callAsConstructor(JSContextRef context, JSObjec
943943
return result;
944944
}
945945

946-
static JSObjectRef myBadConstructor_callAsConstructor(JSContextRef context, JSObjectRef constructorObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
946+
static JSObjectRef NODELETE myBadConstructor_callAsConstructor(JSContextRef context, JSObjectRef constructorObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
947947
{
948948
UNUSED_PARAM(context);
949949
UNUSED_PARAM(constructorObject);
@@ -1173,7 +1173,7 @@ static bool globalContextNameTest(void)
11731173
}
11741174

11751175
IGNORE_GCC_WARNINGS_BEGIN("unused-but-set-variable")
1176-
static void checkConstnessInJSObjectNames(void)
1176+
static void NODELETE checkConstnessInJSObjectNames(void)
11771177
{
11781178
JSStaticFunction fun;
11791179
fun.name = "something";

Source/JavaScriptCore/API/tests/testapi.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ class TestAPI {
164164
void testJSObjectSetOnGlobalObjectSubclassDefinition();
165165
void testBigInt();
166166

167-
int failed() const { return m_failed; }
167+
int NODELETE failed() const { return m_failed; }
168168

169169
private:
170170

Source/JavaScriptCore/assembler/testmasm.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
WTF_ALLOW_UNSAFE_BUFFER_USAGE_BEGIN
4848

4949
// We don't have a NO_RETURN_DUE_TO_EXIT, nor should we. That's ridiculous.
50-
static bool hiddenTruthBecauseNoReturnIsStupid() { return true; }
50+
static bool NODELETE hiddenTruthBecauseNoReturnIsStupid() { return true; }
5151

5252
static void usage()
5353
{
@@ -222,7 +222,7 @@ template<typename T> T nextID(T id) { return static_cast<T>(id + 1); }
222222
CRASH(); \
223223
} while (false)
224224

225-
bool isPC(MacroAssembler::RegisterID id)
225+
bool NODELETE isPC(MacroAssembler::RegisterID id)
226226
{
227227
#if CPU(ARM_THUMB2)
228228
return id == ARMRegisters::pc;
@@ -232,17 +232,17 @@ bool isPC(MacroAssembler::RegisterID id)
232232
#endif
233233
}
234234

235-
bool isSP(MacroAssembler::RegisterID id)
235+
bool NODELETE isSP(MacroAssembler::RegisterID id)
236236
{
237237
return id == MacroAssembler::stackPointerRegister;
238238
}
239239

240-
bool isFP(MacroAssembler::RegisterID id)
240+
bool NODELETE isFP(MacroAssembler::RegisterID id)
241241
{
242242
return id == MacroAssembler::framePointerRegister;
243243
}
244244

245-
bool isSpecialGPR(MacroAssembler::RegisterID id)
245+
bool NODELETE isSpecialGPR(MacroAssembler::RegisterID id)
246246
{
247247
if (isPC(id) || isSP(id) || isFP(id))
248248
return true;
@@ -5393,7 +5393,7 @@ void testProbeWritesArgumentRegisters()
53935393
CHECK_EQ(probeCallCount, 2);
53945394
}
53955395

5396-
static NEVER_INLINE NOT_TAIL_CALLED int testFunctionToTrashGPRs(int a, int b, int c, int d, int e, int f, int g, int h, int i, int j)
5396+
static NEVER_INLINE NOT_TAIL_CALLED int NODELETE testFunctionToTrashGPRs(int a, int b, int c, int d, int e, int f, int g, int h, int i, int j)
53975397
{
53985398
if (j > 0)
53995399
return testFunctionToTrashGPRs(a + 1, b + a, c + b, d + 5, e - a, f * 1.5, g ^ a, h - b, i, j - 1);

Source/JavaScriptCore/b3/air/testair.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
WTF_ALLOW_UNSAFE_BUFFER_USAGE_BEGIN
5555

5656
// We don't have a NO_RETURN_DUE_TO_EXIT, nor should we. That's ridiculous.
57-
static bool hiddenTruthBecauseNoReturnIsStupid() { return true; }
57+
static bool NODELETE hiddenTruthBecauseNoReturnIsStupid() { return true; }
5858

5959
static void usage()
6060
{
@@ -1359,7 +1359,7 @@ void testShuffleShiftMemoryAllRegs64()
13591359
CHECK(memory[1] == 35000000000000ll);
13601360
}
13611361

1362-
int64_t combineHiLo(int64_t high, int64_t low)
1362+
int64_t NODELETE combineHiLo(int64_t high, int64_t low)
13631363
{
13641364
union {
13651365
int64_t value;

0 commit comments

Comments
 (0)