Skip to content

Commit e53fd85

Browse files
committed
[JSC] Remove masking of tagbits in CalleeBits
https://bugs.webkit.org/show_bug.cgi?id=298699 rdar://160343969 Reviewed by Mark Lam. BBQCallee is held in ThreadSafeWeakOrStrongPtr in CalleeGroup. Old code was assuming that ThreadSafeWeakOrStrongPtr may produce a pointer without stripping a tag, but that no longer happens after 289802@main. * Source/JavaScriptCore/interpreter/CalleeBits.h: (JSC::CalleeBits::boxNativeCallee): * Source/JavaScriptCore/jit/AssemblyHelpers.h: (JSC::AssemblyHelpers::boxNativeCallee): Canonical link: https://commits.webkit.org/300995@main
1 parent 5d3532e commit e53fd85

File tree

2 files changed

+0
-12
lines changed

2 files changed

+0
-12
lines changed

Source/JavaScriptCore/interpreter/CalleeBits.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -137,18 +137,10 @@ class CalleeBits {
137137
return nullptr;
138138
}
139139

140-
#if CPU(ARM64)
141-
// NativeCallees are sometimes stored in ThreadSafeWeakOrStrongPtr, which relies on top byte ignore, so we need to strip the top byte on ARM64.
142-
static constexpr uintptr_t nativeCalleeTopByteMask = std::numeric_limits<uintptr_t>::max() >> CHAR_BIT;
143-
#endif
144-
145140
static void* boxNativeCallee(NativeCallee* callee)
146141
{
147142
#if USE(JSVALUE64)
148143
auto bits = std::bit_cast<uintptr_t>(callee);
149-
#if CPU(ARM64)
150-
bits &= nativeCalleeTopByteMask;
151-
#endif
152144
CalleeBits result { static_cast<int64_t>((bits - lowestAccessibleAddress()) | JSValue::NativeCalleeTag) };
153145
ASSERT(result.isNativeCallee());
154146
return result.rawPtr();

Source/JavaScriptCore/jit/AssemblyHelpers.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1709,10 +1709,6 @@ class AssemblyHelpers : public MacroAssembler {
17091709
void boxNativeCallee(GPRReg calleeGPR, GPRReg boxedGPR)
17101710
{
17111711
#if USE(JSVALUE64)
1712-
#if CPU(ARM64)
1713-
// NativeCallees are sometimes stored in ThreadSafeWeakOrStrongPtr, which relies on top byte ignore, so we need to strip the top byte on ARM64.
1714-
and64(TrustedImm64(CalleeBits::nativeCalleeTopByteMask), calleeGPR);
1715-
#endif
17161712
sub64(calleeGPR, TrustedImm64(lowestAccessibleAddress()), boxedGPR);
17171713
or64(TrustedImm64(JSValue::NativeCalleeTag), boxedGPR);
17181714
#else

0 commit comments

Comments
 (0)