Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (291936 => 291937)
--- trunk/Source/_javascript_Core/ChangeLog 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/_javascript_Core/ChangeLog 2022-03-26 14:41:15 UTC (rev 291937)
@@ -1,5 +1,71 @@
2022-03-26 Yusuke Suzuki <ysuz...@apple.com>
+ Use unary static_assert
+ https://bugs.webkit.org/show_bug.cgi?id=238412
+
+ Reviewed by Mark Lam.
+
+ Replace `static_assert(..., "");` with `static_assert(...);`
+
+ * assembler/ARM64Assembler.h:
+ (JSC::ARM64Assembler::linkJumpOrCall):
+ (JSC::ARM64Assembler::relinkJumpOrCall):
+ * assembler/AssemblerBuffer.h:
+ (JSC::AssemblerBuffer::putIntegralUnchecked):
+ * assembler/MacroAssemblerCodeRef.h:
+ * bytecode/AdaptiveInferredPropertyValueWatchpointBase.h:
+ * bytecode/ArrayProfile.h:
+ * bytecode/CodeBlockHash.cpp:
+ (JSC::CodeBlockHash::CodeBlockHash):
+ * bytecode/ParseHash.cpp:
+ (JSC::ParseHash::ParseHash):
+ * bytecode/Watchpoint.h:
+ * dfg/DFGNode.h:
+ * dfg/DFGOperations.cpp:
+ (JSC::DFG::JSC_DEFINE_JIT_OPERATION):
+ * dfg/DFGSpeculativeJIT.cpp:
+ * dfg/DFGSpeculativeJIT32_64.cpp:
+ (JSC::DFG::SpeculativeJIT::compile):
+ * ftl/FTLLowerDFGToB3.cpp:
+ (JSC::FTL::DFG::LowerDFGToB3::compileArrayPush):
+ * jit/RegisterSet.cpp:
+ (JSC::RegisterSet::llintBaselineCalleeSaveRegisters):
+ (JSC::RegisterSet::dfgCalleeSaveRegisters):
+ (JSC::RegisterSet::ftlCalleeSaveRegisters):
+ * runtime/CachedBytecode.cpp:
+ (JSC::CachedBytecode::commitUpdates const):
+ * runtime/ClonedArguments.h:
+ * runtime/DirectArguments.h:
+ * runtime/DirectEvalExecutable.h:
+ * runtime/ErrorConstructor.h:
+ * runtime/IndirectEvalExecutable.h:
+ * runtime/JSArrayBufferView.cpp:
+ * runtime/JSBoundFunction.h:
+ * runtime/JSLexicalEnvironment.h:
+ (JSC::JSLexicalEnvironment::subspaceFor):
+ * runtime/JSString.cpp:
+ (JSC::JSRopeString::RopeBuilder<RecordOverflow>::expand):
+ * runtime/JSString.h:
+ * runtime/NativeFunction.h:
+ * runtime/Operations.h:
+ (JSC::jsString):
+ * runtime/RegExpObject.h:
+ * runtime/ScopedArguments.h:
+ * runtime/ScopedArgumentsTable.cpp:
+ * runtime/TypedArrayAdaptors.h:
+ (JSC::IntegralTypedArrayAdaptor::toJSValue):
+ * runtime/TypedArrayType.h:
+ * runtime/WeakMapImpl.h:
+ * wasm/WasmAirIRGenerator.cpp:
+ (JSC::Wasm::AirIRGenerator::addCallIndirect):
+ (JSC::Wasm::AirIRGenerator::emitChecksForModOrDiv):
+ (JSC::Wasm::AirIRGenerator::emitModOrDiv):
+ * yarr/YarrInterpreter.cpp:
+ (JSC::Yarr::Interpreter::DisjunctionContext::allocationSize):
+ (JSC::Yarr::Interpreter::ParenthesesDisjunctionContext::allocationSize):
+
+2022-03-26 Yusuke Suzuki <ysuz...@apple.com>
+
[JSC] Include argumentRegisters in identity of SlowPathCallKey when clobberAllRegsInFTLICSlowPath is enabled
https://bugs.webkit.org/show_bug.cgi?id=238411
Modified: trunk/Source/_javascript_Core/assembler/ARM64Assembler.h (291936 => 291937)
--- trunk/Source/_javascript_Core/assembler/ARM64Assembler.h 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/_javascript_Core/assembler/ARM64Assembler.h 2022-03-26 14:41:15 UTC (rev 291937)
@@ -3123,7 +3123,7 @@
template<BranchType type, CopyFunction copy = performJITMemcpy>
static void linkJumpOrCall(int* from, const int* fromInstruction, void* to)
{
- static_assert(type == BranchType_JMP || type == BranchType_CALL, "");
+ static_assert(type == BranchType_JMP || type == BranchType_CALL);
bool link;
int imm26;
@@ -3240,7 +3240,7 @@
template<BranchType type>
static void relinkJumpOrCall(int* from, const int* fromInstruction, void* to)
{
- static_assert(type == BranchType_JMP || type == BranchType_CALL, "");
+ static_assert(type == BranchType_JMP || type == BranchType_CALL);
if ((type == BranchType_JMP) && disassembleNop(from)) {
unsigned op01;
int imm19;
Modified: trunk/Source/_javascript_Core/assembler/AssemblerBuffer.h (291936 => 291937)
--- trunk/Source/_javascript_Core/assembler/AssemblerBuffer.h 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/_javascript_Core/assembler/AssemblerBuffer.h 2022-03-26 14:41:15 UTC (rev 291937)
@@ -456,7 +456,7 @@
void putIntegralUnchecked(IntegralType value)
{
#if CPU(ARM64)
- static_assert(sizeof(value) == 4, "");
+ static_assert(sizeof(value) == 4);
#if CPU(ARM64E)
uint32_t hash = m_hash.update(value, m_index / sizeof(IntegralType));
WTF::unalignedStore<uint32_t>(m_hashes.buffer() + m_index, hash);
Modified: trunk/Source/_javascript_Core/assembler/MacroAssemblerCodeRef.h (291936 => 291937)
--- trunk/Source/_javascript_Core/assembler/MacroAssemblerCodeRef.h 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/_javascript_Core/assembler/MacroAssemblerCodeRef.h 2022-03-26 14:41:15 UTC (rev 291937)
@@ -223,9 +223,9 @@
template<PtrTag> friend class FunctionPtr;
};
-static_assert(sizeof(FunctionPtr<CFunctionPtrTag>) == sizeof(void*), "");
+static_assert(sizeof(FunctionPtr<CFunctionPtrTag>) == sizeof(void*));
#if COMPILER_SUPPORTS(BUILTIN_IS_TRIVIALLY_COPYABLE)
-static_assert(__is_trivially_copyable(FunctionPtr<CFunctionPtrTag>), "");
+static_assert(__is_trivially_copyable(FunctionPtr<CFunctionPtrTag>));
#endif
// ReturnAddressPtr:
Modified: trunk/Source/_javascript_Core/bytecode/AdaptiveInferredPropertyValueWatchpointBase.h (291936 => 291937)
--- trunk/Source/_javascript_Core/bytecode/AdaptiveInferredPropertyValueWatchpointBase.h 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/_javascript_Core/bytecode/AdaptiveInferredPropertyValueWatchpointBase.h 2022-03-26 14:41:15 UTC (rev 291937)
@@ -58,7 +58,7 @@
void fireInternal(VM&, const FireDetail&);
};
// Own destructor may not be called. Keep members trivially destructible.
- static_assert(sizeof(StructureWatchpoint) == sizeof(Watchpoint), "");
+ static_assert(sizeof(StructureWatchpoint) == sizeof(Watchpoint));
class PropertyWatchpoint final : public Watchpoint {
public:
@@ -69,7 +69,7 @@
void fireInternal(VM&, const FireDetail&);
};
// Own destructor may not be called. Keep members trivially destructible.
- static_assert(sizeof(PropertyWatchpoint) == sizeof(Watchpoint), "");
+ static_assert(sizeof(PropertyWatchpoint) == sizeof(Watchpoint));
protected:
virtual bool isValid() const;
Modified: trunk/Source/_javascript_Core/bytecode/ArrayProfile.h (291936 => 291937)
--- trunk/Source/_javascript_Core/bytecode/ArrayProfile.h 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/_javascript_Core/bytecode/ArrayProfile.h 2022-03-26 14:41:15 UTC (rev 291937)
@@ -41,9 +41,9 @@
// The possible IndexingTypes are limited within (0 - 16, 21, 23, 25).
// This is because CoW types only appear for JSArrays.
-static_assert(CopyOnWriteArrayWithInt32 == 21, "");
-static_assert(CopyOnWriteArrayWithDouble == 23, "");
-static_assert(CopyOnWriteArrayWithContiguous == 25, "");
+static_assert(CopyOnWriteArrayWithInt32 == 21);
+static_assert(CopyOnWriteArrayWithDouble == 23);
+static_assert(CopyOnWriteArrayWithContiguous == 25);
const ArrayModes CopyOnWriteArrayWithInt32ArrayMode = 1 << CopyOnWriteArrayWithInt32;
const ArrayModes CopyOnWriteArrayWithDoubleArrayMode = 1 << CopyOnWriteArrayWithDouble;
const ArrayModes CopyOnWriteArrayWithContiguousArrayMode = 1 << CopyOnWriteArrayWithContiguous;
Modified: trunk/Source/_javascript_Core/bytecode/CodeBlockHash.cpp (291936 => 291937)
--- trunk/Source/_javascript_Core/bytecode/CodeBlockHash.cpp 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/_javascript_Core/bytecode/CodeBlockHash.cpp 2022-03-26 14:41:15 UTC (rev 291937)
@@ -77,8 +77,8 @@
if (m_hash == 0 || m_hash == 1)
m_hash += 0x2d5a93d0; // Ensures a non-zero hash, and gets us #Azero0 for CodeForCall and #Azero1 for CodeForConstruct.
- static_assert(static_cast<unsigned>(CodeForCall) == 0, "");
- static_assert(static_cast<unsigned>(CodeForConstruct) == 1, "");
+ static_assert(static_cast<unsigned>(CodeForCall) == 0);
+ static_assert(static_cast<unsigned>(CodeForConstruct) == 1);
m_hash ^= static_cast<unsigned>(kind);
ASSERT(m_hash);
}
Modified: trunk/Source/_javascript_Core/bytecode/ParseHash.cpp (291936 => 291937)
--- trunk/Source/_javascript_Core/bytecode/ParseHash.cpp 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/_javascript_Core/bytecode/ParseHash.cpp 2022-03-26 14:41:15 UTC (rev 291937)
@@ -41,8 +41,8 @@
if (hash == 0 || hash == 1)
hash += 0x2d5a93d0; // Ensures a non-zero hash, and gets us #Azero0 for CodeForCall and #Azero1 for CodeForConstruct.
- static_assert(static_cast<unsigned>(CodeForCall) == 0, "");
- static_assert(static_cast<unsigned>(CodeForConstruct) == 1, "");
+ static_assert(static_cast<unsigned>(CodeForCall) == 0);
+ static_assert(static_cast<unsigned>(CodeForConstruct) == 1);
unsigned hashForCall = hash ^ static_cast<unsigned>(CodeForCall);
unsigned hashForConstruct = hash ^ static_cast<unsigned>(CodeForConstruct);
Modified: trunk/Source/_javascript_Core/bytecode/Watchpoint.h (291936 => 291937)
--- trunk/Source/_javascript_Core/bytecode/Watchpoint.h 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/_javascript_Core/bytecode/Watchpoint.h 2022-03-26 14:41:15 UTC (rev 291937)
@@ -132,7 +132,7 @@
#define JSC_WATCHPOINT_FIELD(type, member) \
type member; \
- static_assert(std::is_trivially_destructible<type>::value, ""); \
+ static_assert(std::is_trivially_destructible<type>::value); \
DECLARE_ALLOCATOR_WITH_HEAP_IDENTIFIER(Watchpoint);
Modified: trunk/Source/_javascript_Core/dfg/DFGNode.h (291936 => 291937)
--- trunk/Source/_javascript_Core/dfg/DFGNode.h 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/_javascript_Core/dfg/DFGNode.h 2022-03-26 14:41:15 UTC (rev 291937)
@@ -124,8 +124,8 @@
uint64_t asQuadWord;
};
};
-static_assert(sizeof(IndexingType) <= sizeof(unsigned), "");
-static_assert(sizeof(NewArrayBufferData) == sizeof(uint64_t), "");
+static_assert(sizeof(IndexingType) <= sizeof(unsigned));
+static_assert(sizeof(NewArrayBufferData) == sizeof(uint64_t));
struct DataViewData {
union {
@@ -138,7 +138,7 @@
uint64_t asQuadWord;
};
};
-static_assert(sizeof(DataViewData) == sizeof(uint64_t), "");
+static_assert(sizeof(DataViewData) == sizeof(uint64_t));
struct BranchTarget {
BranchTarget()
Modified: trunk/Source/_javascript_Core/dfg/DFGOperations.cpp (291936 => 291937)
--- trunk/Source/_javascript_Core/dfg/DFGOperations.cpp 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/_javascript_Core/dfg/DFGOperations.cpp 2022-03-26 14:41:15 UTC (rev 291937)
@@ -2550,7 +2550,7 @@
JITOperationPrologueCallFrameTracer tracer(vm, callFrame);
JSString* string = asString(cell);
- static_assert(static_cast<uint64_t>(JSString::MaxLength) <= static_cast<uint64_t>(std::numeric_limits<int32_t>::max()), "");
+ static_assert(static_cast<uint64_t>(JSString::MaxLength) <= static_cast<uint64_t>(std::numeric_limits<int32_t>::max()));
return stringSlice(globalObject, vm, string, string->length(), start, end);
}
Modified: trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp (291936 => 291937)
--- trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp 2022-03-26 14:41:15 UTC (rev 291937)
@@ -15288,13 +15288,13 @@
MacroAssembler::Label loop = m_jit.label();
m_jit.and32(maskGPR, indexGPR);
if (node->child1().useKind() == WeakSetObjectUse) {
- static_assert(sizeof(WeakMapBucket<WeakMapBucketDataKey>) == sizeof(void*), "");
+ static_assert(sizeof(WeakMapBucket<WeakMapBucketDataKey>) == sizeof(void*));
m_jit.zeroExtend32ToWord(indexGPR, bucketGPR);
m_jit.lshiftPtr(MacroAssembler::Imm32(sizeof(void*) == 4 ? 2 : 3), bucketGPR);
m_jit.addPtr(bufferGPR, bucketGPR);
} else {
ASSERT(node->child1().useKind() == WeakMapObjectUse);
- static_assert(sizeof(WeakMapBucket<WeakMapBucketDataKeyValue>) == 16, "");
+ static_assert(sizeof(WeakMapBucket<WeakMapBucketDataKeyValue>) == 16);
m_jit.zeroExtend32ToWord(indexGPR, bucketGPR);
m_jit.lshiftPtr(MacroAssembler::Imm32(4), bucketGPR);
m_jit.addPtr(bufferGPR, bucketGPR);
@@ -16139,7 +16139,7 @@
ok.link(&m_jit);
}
- static_assert(StringImpl::flagIs8Bit() == JSRopeString::is8BitInPointer, "");
+ static_assert(StringImpl::flagIs8Bit() == JSRopeString::is8BitInPointer);
m_jit.and32(TrustedImm32(StringImpl::flagIs8Bit()), scratchGPR);
m_jit.orPtr(opGPRs[0], scratchGPR);
m_jit.orPtr(TrustedImmPtr(JSString::isRopeInPointer), scratchGPR);
Modified: trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT32_64.cpp (291936 => 291937)
--- trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT32_64.cpp 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT32_64.cpp 2022-03-26 14:41:15 UTC (rev 291937)
@@ -3557,7 +3557,7 @@
GPRReg resultGPR = result.gpr();
m_jit.move(valueTagGPR, resultGPR);
- static_assert((JSValue::UndefinedTag + 1 == JSValue::NullTag) && (JSValue::NullTag & 0x1), "");
+ static_assert((JSValue::UndefinedTag + 1 == JSValue::NullTag) && (JSValue::NullTag & 0x1));
m_jit.or32(CCallHelpers::TrustedImm32(1), resultGPR);
m_jit.compare32(CCallHelpers::Equal, resultGPR, CCallHelpers::TrustedImm32(JSValue::NullTag), resultGPR);
Modified: trunk/Source/_javascript_Core/ftl/FTLLowerDFGToB3.cpp (291936 => 291937)
--- trunk/Source/_javascript_Core/ftl/FTLLowerDFGToB3.cpp 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/_javascript_Core/ftl/FTLLowerDFGToB3.cpp 2022-03-26 14:41:15 UTC (rev 291937)
@@ -6442,7 +6442,7 @@
m_out.appendTo(slowPath, setup);
size_t scratchSize = sizeof(EncodedJSValue) * elementCount;
- static_assert(sizeof(EncodedJSValue) == sizeof(double), "");
+ static_assert(sizeof(EncodedJSValue) == sizeof(double));
ASSERT(scratchSize);
ScratchBuffer* scratchBuffer = vm().scratchBufferForSize(scratchSize);
ValueFromBlock slowBufferResult = m_out.anchor(m_out.constIntPtr(static_cast<EncodedJSValue*>(scratchBuffer->dataBuffer())));
Modified: trunk/Source/_javascript_Core/jit/RegisterSet.cpp (291936 => 291937)
--- trunk/Source/_javascript_Core/jit/RegisterSet.cpp 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/_javascript_Core/jit/RegisterSet.cpp 2022-03-26 14:41:15 UTC (rev 291937)
@@ -201,15 +201,15 @@
#if !OS(WINDOWS)
result.set(GPRInfo::regCS1);
result.set(GPRInfo::regCS2);
- static_assert(GPRInfo::regCS3 == GPRInfo::numberTagRegister, "");
- static_assert(GPRInfo::regCS4 == GPRInfo::notCellMaskRegister, "");
+ static_assert(GPRInfo::regCS3 == GPRInfo::numberTagRegister);
+ static_assert(GPRInfo::regCS4 == GPRInfo::notCellMaskRegister);
result.set(GPRInfo::regCS3);
result.set(GPRInfo::regCS4);
#else
result.set(GPRInfo::regCS3);
result.set(GPRInfo::regCS4);
- static_assert(GPRInfo::regCS5 == GPRInfo::numberTagRegister, "");
- static_assert(GPRInfo::regCS6 == GPRInfo::notCellMaskRegister, "");
+ static_assert(GPRInfo::regCS5 == GPRInfo::numberTagRegister);
+ static_assert(GPRInfo::regCS6 == GPRInfo::notCellMaskRegister);
result.set(GPRInfo::regCS5);
result.set(GPRInfo::regCS6);
#endif
@@ -219,8 +219,8 @@
#elif CPU(ARM64) || CPU(RISCV64)
result.set(GPRInfo::regCS6);
result.set(GPRInfo::regCS7);
- static_assert(GPRInfo::regCS8 == GPRInfo::numberTagRegister, "");
- static_assert(GPRInfo::regCS9 == GPRInfo::notCellMaskRegister, "");
+ static_assert(GPRInfo::regCS8 == GPRInfo::numberTagRegister);
+ static_assert(GPRInfo::regCS9 == GPRInfo::notCellMaskRegister);
result.set(GPRInfo::regCS8);
result.set(GPRInfo::regCS9);
#else
@@ -238,15 +238,15 @@
result.set(GPRInfo::regCS1);
result.set(GPRInfo::regCS2);
#if !OS(WINDOWS)
- static_assert(GPRInfo::regCS3 == GPRInfo::numberTagRegister, "");
- static_assert(GPRInfo::regCS4 == GPRInfo::notCellMaskRegister, "");
+ static_assert(GPRInfo::regCS3 == GPRInfo::numberTagRegister);
+ static_assert(GPRInfo::regCS4 == GPRInfo::notCellMaskRegister);
result.set(GPRInfo::regCS3);
result.set(GPRInfo::regCS4);
#else
result.set(GPRInfo::regCS3);
result.set(GPRInfo::regCS4);
- static_assert(GPRInfo::regCS5 == GPRInfo::numberTagRegister, "");
- static_assert(GPRInfo::regCS6 == GPRInfo::notCellMaskRegister, "");
+ static_assert(GPRInfo::regCS5 == GPRInfo::numberTagRegister);
+ static_assert(GPRInfo::regCS6 == GPRInfo::notCellMaskRegister);
result.set(GPRInfo::regCS5);
result.set(GPRInfo::regCS6);
#endif
@@ -254,8 +254,8 @@
result.set(GPRInfo::regCS0);
result.set(GPRInfo::regCS1);
#elif CPU(ARM64) || CPU(RISCV64)
- static_assert(GPRInfo::regCS8 == GPRInfo::numberTagRegister, "");
- static_assert(GPRInfo::regCS9 == GPRInfo::notCellMaskRegister, "");
+ static_assert(GPRInfo::regCS8 == GPRInfo::numberTagRegister);
+ static_assert(GPRInfo::regCS9 == GPRInfo::notCellMaskRegister);
result.set(GPRInfo::regCS8);
result.set(GPRInfo::regCS9);
#else
@@ -272,8 +272,8 @@
result.set(GPRInfo::regCS0);
result.set(GPRInfo::regCS1);
result.set(GPRInfo::regCS2);
- static_assert(GPRInfo::regCS3 == GPRInfo::numberTagRegister, "");
- static_assert(GPRInfo::regCS4 == GPRInfo::notCellMaskRegister, "");
+ static_assert(GPRInfo::regCS3 == GPRInfo::numberTagRegister);
+ static_assert(GPRInfo::regCS4 == GPRInfo::notCellMaskRegister);
result.set(GPRInfo::regCS3);
result.set(GPRInfo::regCS4);
#elif CPU(ARM64)
@@ -286,8 +286,8 @@
result.set(GPRInfo::regCS5);
result.set(GPRInfo::regCS6);
result.set(GPRInfo::regCS7);
- static_assert(GPRInfo::regCS8 == GPRInfo::numberTagRegister, "");
- static_assert(GPRInfo::regCS9 == GPRInfo::notCellMaskRegister, "");
+ static_assert(GPRInfo::regCS8 == GPRInfo::numberTagRegister);
+ static_assert(GPRInfo::regCS9 == GPRInfo::notCellMaskRegister);
result.set(GPRInfo::regCS8);
result.set(GPRInfo::regCS9);
result.set(FPRInfo::fpRegCS0);
@@ -307,8 +307,8 @@
result.set(GPRInfo::regCS5);
result.set(GPRInfo::regCS6);
result.set(GPRInfo::regCS7);
- static_assert(GPRInfo::regCS8 == GPRInfo::numberTagRegister, "");
- static_assert(GPRInfo::regCS9 == GPRInfo::notCellMaskRegister, "");
+ static_assert(GPRInfo::regCS8 == GPRInfo::numberTagRegister);
+ static_assert(GPRInfo::regCS9 == GPRInfo::notCellMaskRegister);
result.set(GPRInfo::regCS8);
result.set(GPRInfo::regCS9);
result.set(GPRInfo::regCS10);
Modified: trunk/Source/_javascript_Core/runtime/CachedBytecode.cpp (291936 => 291937)
--- trunk/Source/_javascript_Core/runtime/CachedBytecode.cpp 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/_javascript_Core/runtime/CachedBytecode.cpp 2022-03-26 14:41:15 UTC (rev 291937)
@@ -72,7 +72,7 @@
ptrdiff_t kindOffset = functionUpdate.m_kind == CodeForCall ? CachedFunctionExecutableOffsets::codeBlockForCallOffset() : CachedFunctionExecutableOffsets::codeBlockForConstructOffset();
ptrdiff_t codeBlockOffset = functionUpdate.m_base + kindOffset + CachedWriteBarrierOffsets::ptrOffset() + CachedPtrOffsets::offsetOffset();
ptrdiff_t offsetPayload = static_cast<ptrdiff_t>(offset) - codeBlockOffset;
- static_assert(std::is_same<decltype(VariableLengthObjectBase::m_offset), ptrdiff_t>::value, "");
+ static_assert(std::is_same<decltype(VariableLengthObjectBase::m_offset), ptrdiff_t>::value);
callback(codeBlockOffset, &offsetPayload, sizeof(ptrdiff_t));
}
Modified: trunk/Source/_javascript_Core/runtime/ClonedArguments.h (291936 => 291937)
--- trunk/Source/_javascript_Core/runtime/ClonedArguments.h 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/_javascript_Core/runtime/ClonedArguments.h 2022-03-26 14:41:15 UTC (rev 291937)
@@ -45,7 +45,7 @@
template<typename CellType, SubspaceAccess mode>
static GCClient::IsoSubspace* subspaceFor(VM& vm)
{
- static_assert(!CellType::needsDestruction, "");
+ static_assert(!CellType::needsDestruction);
return &vm.clonedArgumentsSpace();
}
Modified: trunk/Source/_javascript_Core/runtime/DirectArguments.h (291936 => 291937)
--- trunk/Source/_javascript_Core/runtime/DirectArguments.h 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/_javascript_Core/runtime/DirectArguments.h 2022-03-26 14:41:15 UTC (rev 291937)
@@ -49,7 +49,7 @@
template<typename CellType, SubspaceAccess>
static CompleteSubspace* subspaceFor(VM& vm)
{
- static_assert(!CellType::needsDestruction, "");
+ static_assert(!CellType::needsDestruction);
return &vm.variableSizedCellSpace();
}
Modified: trunk/Source/_javascript_Core/runtime/DirectEvalExecutable.h (291936 => 291937)
--- trunk/Source/_javascript_Core/runtime/DirectEvalExecutable.h 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/_javascript_Core/runtime/DirectEvalExecutable.h 2022-03-26 14:41:15 UTC (rev 291937)
@@ -36,6 +36,6 @@
DirectEvalExecutable(JSGlobalObject*, const SourceCode&, bool inStrictContext, DerivedContextType, NeedsClassFieldInitializer, PrivateBrandRequirement, bool isArrowFunctionContext, bool isInsideOrdinaryFunction, EvalContextType);
};
-static_assert(sizeof(DirectEvalExecutable) == sizeof(EvalExecutable), "");
+static_assert(sizeof(DirectEvalExecutable) == sizeof(EvalExecutable));
} // namespace JSC
Modified: trunk/Source/_javascript_Core/runtime/ErrorConstructor.h (291936 => 291937)
--- trunk/Source/_javascript_Core/runtime/ErrorConstructor.h 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/_javascript_Core/runtime/ErrorConstructor.h 2022-03-26 14:41:15 UTC (rev 291937)
@@ -55,6 +55,6 @@
};
STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(ErrorConstructor, InternalFunction);
-static_assert(sizeof(ErrorConstructor) == sizeof(InternalFunction), "");
+static_assert(sizeof(ErrorConstructor) == sizeof(InternalFunction));
} // namespace JSC
Modified: trunk/Source/_javascript_Core/runtime/IndirectEvalExecutable.h (291936 => 291937)
--- trunk/Source/_javascript_Core/runtime/IndirectEvalExecutable.h 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/_javascript_Core/runtime/IndirectEvalExecutable.h 2022-03-26 14:41:15 UTC (rev 291937)
@@ -40,6 +40,6 @@
IndirectEvalExecutable(JSGlobalObject*, const SourceCode&, DerivedContextType, bool isArrowFunctionContext, EvalContextType);
};
-static_assert(sizeof(IndirectEvalExecutable) == sizeof(EvalExecutable), "");
+static_assert(sizeof(IndirectEvalExecutable) == sizeof(EvalExecutable));
} // namespace JSC
Modified: trunk/Source/_javascript_Core/runtime/JSArrayBufferView.cpp (291936 => 291937)
--- trunk/Source/_javascript_Core/runtime/JSArrayBufferView.cpp 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/_javascript_Core/runtime/JSArrayBufferView.cpp 2022-03-26 14:41:15 UTC (rev 291937)
@@ -227,7 +227,7 @@
1, // DataViewType
};
-#define FACTORY(type) static_assert(std::is_final<JS ## type ## Array>::value, "");
+#define FACTORY(type) static_assert(std::is_final<JS ## type ## Array>::value);
FOR_EACH_TYPED_ARRAY_TYPE_EXCLUDING_DATA_VIEW(FACTORY)
#undef FACTORY
Modified: trunk/Source/_javascript_Core/runtime/JSBoundFunction.h (291936 => 291937)
--- trunk/Source/_javascript_Core/runtime/JSBoundFunction.h 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/_javascript_Core/runtime/JSBoundFunction.h 2022-03-26 14:41:15 UTC (rev 291937)
@@ -40,7 +40,7 @@
public:
typedef JSFunction Base;
static constexpr unsigned StructureFlags = Base::StructureFlags & ~ImplementsDefaultHasInstance;
- static_assert(StructureFlags & ImplementsHasInstance, "");
+ static_assert(StructureFlags & ImplementsHasInstance);
template<typename CellType, SubspaceAccess mode>
static GCClient::IsoSubspace* subspaceFor(VM& vm)
Modified: trunk/Source/_javascript_Core/runtime/JSLexicalEnvironment.h (291936 => 291937)
--- trunk/Source/_javascript_Core/runtime/JSLexicalEnvironment.h 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/_javascript_Core/runtime/JSLexicalEnvironment.h 2022-03-26 14:41:15 UTC (rev 291937)
@@ -43,7 +43,7 @@
template<typename CellType, SubspaceAccess>
static CompleteSubspace* subspaceFor(VM& vm)
{
- static_assert(!CellType::needsDestruction, "");
+ static_assert(!CellType::needsDestruction);
return &vm.variableSizedCellSpace();
}
Modified: trunk/Source/_javascript_Core/runtime/JSString.cpp (291936 => 291937)
--- trunk/Source/_javascript_Core/runtime/JSString.cpp 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/_javascript_Core/runtime/JSString.cpp 2022-03-26 14:41:15 UTC (rev 291937)
@@ -51,7 +51,7 @@
{
RELEASE_ASSERT(!this->hasOverflowed());
ASSERT(m_strings.size() == JSRopeString::s_maxInternalRopeLength);
- static_assert(3 == JSRopeString::s_maxInternalRopeLength, "");
+ static_assert(3 == JSRopeString::s_maxInternalRopeLength);
ASSERT(m_length);
ASSERT(asString(m_strings.at(0))->length());
ASSERT(asString(m_strings.at(1))->length());
Modified: trunk/Source/_javascript_Core/runtime/JSString.h (291936 => 291937)
--- trunk/Source/_javascript_Core/runtime/JSString.h 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/_javascript_Core/runtime/JSString.h 2022-03-26 14:41:15 UTC (rev 291937)
@@ -118,7 +118,7 @@
// is INT_MAX. Hence, it cannot be changed into another length value without
// breaking all the bounds and overflow checks that assume this.
static constexpr unsigned MaxLength = std::numeric_limits<int32_t>::max();
- static_assert(MaxLength == String::MaxLength, "");
+ static_assert(MaxLength == String::MaxLength);
static constexpr uintptr_t isRopeInPointer = 0x1;
@@ -280,12 +280,12 @@
// We use lower 3bits of fiber0 for flags. These bits are usable due to alignment, and it is OK even in 32bit architecture.
static constexpr uintptr_t is8BitInPointer = static_cast<uintptr_t>(StringImpl::flagIs8Bit());
static constexpr uintptr_t isSubstringInPointer = 0x2;
- static_assert(is8BitInPointer == 0b100, "");
- static_assert(isSubstringInPointer == 0b010, "");
- static_assert(isRopeInPointer == 0b001, "");
+ static_assert(is8BitInPointer == 0b100);
+ static_assert(isSubstringInPointer == 0b010);
+ static_assert(isRopeInPointer == 0b001);
static constexpr uintptr_t stringMask = ~(isRopeInPointer | is8BitInPointer | isSubstringInPointer);
#if CPU(ADDRESS64)
- static_assert(sizeof(uintptr_t) == sizeof(uint64_t), "");
+ static_assert(sizeof(uintptr_t) == sizeof(uint64_t));
class CompactFibers {
public:
static constexpr uintptr_t addressMask = (1ULL << OS_CONSTANT(EFFECTIVE_ADDRESS_WIDTH)) - 1;
@@ -339,7 +339,7 @@
uint16_t m_fiber2Lower { 0 };
uint32_t m_fiber2Upper { 0 };
};
- static_assert(sizeof(CompactFibers) == sizeof(void*) * 2, "");
+ static_assert(sizeof(CompactFibers) == sizeof(void*) * 2);
#else
class CompactFibers {
public:
@@ -398,7 +398,7 @@
if (m_strings.size() == JSRopeString::s_maxInternalRopeLength)
expand();
- static_assert(JSString::MaxLength == std::numeric_limits<int32_t>::max(), "");
+ static_assert(JSString::MaxLength == std::numeric_limits<int32_t>::max());
auto sum = checkedSum<int32_t>(m_length, jsString->length());
if (sum.hasOverflowed()) {
this->overflowed();
@@ -678,7 +678,7 @@
return static_cast<unsigned>(bitwise_cast<uintptr_t>(fiber2()));
}
- static_assert(s_maxInternalRopeLength >= 2, "");
+ static_assert(s_maxInternalRopeLength >= 2);
mutable CompactFibers m_compactFibers;
friend JSString* jsString(JSGlobalObject*, JSString*, JSString*);
Modified: trunk/Source/_javascript_Core/runtime/NativeFunction.h (291936 => 291937)
--- trunk/Source/_javascript_Core/runtime/NativeFunction.h 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/_javascript_Core/runtime/NativeFunction.h 2022-03-26 14:41:15 UTC (rev 291937)
@@ -101,8 +101,8 @@
static constexpr bool safeToCompareToEmptyOrDeleted = true;
};
-static_assert(sizeof(NativeFunction) == sizeof(void*), "");
-static_assert(sizeof(TaggedNativeFunction) == sizeof(void*), "");
+static_assert(sizeof(NativeFunction) == sizeof(void*));
+static_assert(sizeof(TaggedNativeFunction) == sizeof(void*));
} // namespace JSC
Modified: trunk/Source/_javascript_Core/runtime/Operations.h (291936 => 291937)
--- trunk/Source/_javascript_Core/runtime/Operations.h 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/_javascript_Core/runtime/Operations.h 2022-03-26 14:41:15 UTC (rev 291937)
@@ -88,7 +88,7 @@
unsigned length2 = s2->length();
if (!length2)
return jsString(vm, u1);
- static_assert(JSString::MaxLength == std::numeric_limits<int32_t>::max(), "");
+ static_assert(JSString::MaxLength == std::numeric_limits<int32_t>::max());
if (sumOverflows<int32_t>(length1, length2)) {
throwOutOfMemoryError(globalObject, scope);
return nullptr;
@@ -124,7 +124,7 @@
unsigned length2 = u2.length();
if (!length2)
return s1;
- static_assert(JSString::MaxLength == std::numeric_limits<int32_t>::max(), "");
+ static_assert(JSString::MaxLength == std::numeric_limits<int32_t>::max());
if (sumOverflows<int32_t>(length1, length2)) {
throwOutOfMemoryError(globalObject, scope);
return nullptr;
@@ -157,7 +157,7 @@
unsigned length2 = s2->length();
if (!length2)
return s1;
- static_assert(JSString::MaxLength == std::numeric_limits<int32_t>::max(), "");
+ static_assert(JSString::MaxLength == std::numeric_limits<int32_t>::max());
if (sumOverflows<int32_t>(length1, length2)) {
throwOutOfMemoryError(globalObject, scope);
return nullptr;
@@ -183,7 +183,7 @@
if (!length3)
RELEASE_AND_RETURN(scope, jsString(globalObject, s1, s2));
- static_assert(JSString::MaxLength == std::numeric_limits<int32_t>::max(), "");
+ static_assert(JSString::MaxLength == std::numeric_limits<int32_t>::max());
if (sumOverflows<int32_t>(length1, length2, length3)) {
throwOutOfMemoryError(globalObject, scope);
return nullptr;
@@ -203,7 +203,7 @@
unsigned length2 = u2.length();
if (!length2)
return jsString(vm, u1);
- static_assert(JSString::MaxLength == std::numeric_limits<int32_t>::max(), "");
+ static_assert(JSString::MaxLength == std::numeric_limits<int32_t>::max());
if (sumOverflows<int32_t>(length1, length2)) {
throwOutOfMemoryError(globalObject, scope);
return nullptr;
@@ -243,7 +243,7 @@
if (!length3)
RELEASE_AND_RETURN(scope, jsString(globalObject, u1, u2));
- static_assert(JSString::MaxLength == std::numeric_limits<int32_t>::max(), "");
+ static_assert(JSString::MaxLength == std::numeric_limits<int32_t>::max());
if (sumOverflows<int32_t>(length1, length2, length3)) {
throwOutOfMemoryError(globalObject, scope);
return nullptr;
Modified: trunk/Source/_javascript_Core/runtime/RegExpObject.h (291936 => 291937)
--- trunk/Source/_javascript_Core/runtime/RegExpObject.h 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/_javascript_Core/runtime/RegExpObject.h 2022-03-26 14:41:15 UTC (rev 291937)
@@ -35,7 +35,7 @@
template<typename CellType, SubspaceAccess mode>
static GCClient::IsoSubspace* subspaceFor(VM& vm)
{
- static_assert(!CellType::needsDestruction, "");
+ static_assert(!CellType::needsDestruction);
return &vm.regExpObjectSpace();
}
Modified: trunk/Source/_javascript_Core/runtime/ScopedArguments.h (291936 => 291937)
--- trunk/Source/_javascript_Core/runtime/ScopedArguments.h 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/_javascript_Core/runtime/ScopedArguments.h 2022-03-26 14:41:15 UTC (rev 291937)
@@ -46,7 +46,7 @@
template<typename CellType, SubspaceAccess>
static GCClient::IsoSubspace* subspaceFor(VM& vm)
{
- static_assert(!CellType::needsDestruction, "");
+ static_assert(!CellType::needsDestruction);
return &vm.scopedArgumentsSpace();
}
Modified: trunk/Source/_javascript_Core/runtime/ScopedArgumentsTable.cpp (291936 => 291937)
--- trunk/Source/_javascript_Core/runtime/ScopedArgumentsTable.cpp 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/_javascript_Core/runtime/ScopedArgumentsTable.cpp 2022-03-26 14:41:15 UTC (rev 291937)
@@ -104,7 +104,7 @@
return result;
}
-static_assert(std::is_trivially_destructible<ScopeOffset>::value, "");
+static_assert(std::is_trivially_destructible<ScopeOffset>::value);
ScopedArgumentsTable* ScopedArgumentsTable::trySet(VM& vm, uint32_t i, ScopeOffset value)
{
Modified: trunk/Source/_javascript_Core/runtime/TypedArrayAdaptors.h (291936 => 291937)
--- trunk/Source/_javascript_Core/runtime/TypedArrayAdaptors.h 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/_javascript_Core/runtime/TypedArrayAdaptors.h 2022-03-26 14:41:15 UTC (rev 291937)
@@ -49,7 +49,7 @@
static JSValue toJSValue(JSGlobalObject*, Type value)
{
- static_assert(!std::is_floating_point<Type>::value, "");
+ static_assert(!std::is_floating_point<Type>::value);
return jsNumber(value);
}
Modified: trunk/Source/_javascript_Core/runtime/TypedArrayType.h (291936 => 291937)
--- trunk/Source/_javascript_Core/runtime/TypedArrayType.h 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/_javascript_Core/runtime/TypedArrayType.h 2022-03-26 14:41:15 UTC (rev 291937)
@@ -64,11 +64,11 @@
};
#define ASSERT_TYPED_ARRAY_TYPE(name) \
- static_assert(static_cast<uint32_t>(Type ## name) == (static_cast<uint32_t>(name ## ArrayType) - FirstTypedArrayType + static_cast<uint32_t>(TypeInt8)), "");
+ static_assert(static_cast<uint32_t>(Type ## name) == (static_cast<uint32_t>(name ## ArrayType) - FirstTypedArrayType + static_cast<uint32_t>(TypeInt8)));
FOR_EACH_TYPED_ARRAY_TYPE_EXCLUDING_DATA_VIEW(ASSERT_TYPED_ARRAY_TYPE)
#undef ASSERT_TYPED_ARRAY_TYPE
-static_assert(TypeDataView == (DataViewType - FirstTypedArrayType + TypeInt8), "");
+static_assert(TypeDataView == (DataViewType - FirstTypedArrayType + TypeInt8));
inline unsigned toIndex(TypedArrayType type)
{
Modified: trunk/Source/_javascript_Core/runtime/WeakMapImpl.h (291936 => 291937)
--- trunk/Source/_javascript_Core/runtime/WeakMapImpl.h 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/_javascript_Core/runtime/WeakMapImpl.h 2022-03-26 14:41:15 UTC (rev 291937)
@@ -38,7 +38,7 @@
static const HashTableType Type = HashTableType::Key;
WriteBarrier<JSObject> key;
};
-static_assert(sizeof(WeakMapBucketDataKey) == sizeof(void*), "");
+static_assert(sizeof(WeakMapBucketDataKey) == sizeof(void*));
struct WeakMapBucketDataKeyValue {
static const HashTableType Type = HashTableType::KeyValue;
@@ -48,7 +48,7 @@
#endif
WriteBarrier<Unknown> value;
};
-static_assert(sizeof(WeakMapBucketDataKeyValue) == 16, "");
+static_assert(sizeof(WeakMapBucketDataKeyValue) == 16);
ALWAYS_INLINE uint32_t jsWeakMapHash(JSObject* key);
ALWAYS_INLINE uint32_t nextCapacityAfterBatchRemoval(uint32_t capacity, uint32_t keyCount);
Modified: trunk/Source/_javascript_Core/wasm/WasmAirIRGenerator.cpp (291936 => 291937)
--- trunk/Source/_javascript_Core/wasm/WasmAirIRGenerator.cpp 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/_javascript_Core/wasm/WasmAirIRGenerator.cpp 2022-03-26 14:41:15 UTC (rev 291937)
@@ -3770,7 +3770,7 @@
append(Move, Arg::addr(calleeSignatureIndex, WasmToWasmImportableFunction::offsetOfSignatureIndex()), calleeSignatureIndex);
emitCheck([&] {
- static_assert(Signature::invalidIndex == 0, "");
+ static_assert(Signature::invalidIndex == 0);
return Inst(BranchTest64, nullptr, Arg::resCond(MacroAssembler::Zero), calleeSignatureIndex, calleeSignatureIndex);
}, [=, this] (CCallHelpers& jit, const B3::StackmapGenerationParams&) {
this->emitThrowException(jit, ExceptionType::NullTableEntry);
@@ -3998,7 +3998,7 @@
template <typename IntType>
void AirIRGenerator::emitChecksForModOrDiv(bool isSignedDiv, ExpressionType left, ExpressionType right)
{
- static_assert(sizeof(IntType) == 4 || sizeof(IntType) == 8, "");
+ static_assert(sizeof(IntType) == 4 || sizeof(IntType) == 8);
emitCheck([&] {
return Inst(sizeof(IntType) == 4 ? BranchTest32 : BranchTest64, nullptr, Arg::resCond(MacroAssembler::Zero), right, right);
@@ -4034,7 +4034,7 @@
template <typename IntType>
void AirIRGenerator::emitModOrDiv(bool isDiv, ExpressionType lhs, ExpressionType rhs, ExpressionType& result)
{
- static_assert(sizeof(IntType) == 4 || sizeof(IntType) == 8, "");
+ static_assert(sizeof(IntType) == 4 || sizeof(IntType) == 8);
result = sizeof(IntType) == 4 ? g32() : g64();
Modified: trunk/Source/_javascript_Core/yarr/YarrInterpreter.cpp (291936 => 291937)
--- trunk/Source/_javascript_Core/yarr/YarrInterpreter.cpp 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/_javascript_Core/yarr/YarrInterpreter.cpp 2022-03-26 14:41:15 UTC (rev 291937)
@@ -76,7 +76,7 @@
static size_t allocationSize(unsigned numberOfFrames)
{
- static_assert(alignof(DisjunctionContext) <= sizeof(void*), "");
+ static_assert(alignof(DisjunctionContext) <= sizeof(void*));
size_t rawSize = sizeof(DisjunctionContext) - sizeof(uintptr_t) + Checked<size_t>(numberOfFrames) * sizeof(uintptr_t);
size_t roundedSize = roundUpToMultipleOf<sizeof(void*)>(rawSize);
RELEASE_ASSERT(roundedSize >= rawSize);
@@ -135,7 +135,7 @@
static size_t allocationSize(unsigned numberOfSubpatterns)
{
- static_assert(alignof(ParenthesesDisjunctionContext) <= sizeof(void*), "");
+ static_assert(alignof(ParenthesesDisjunctionContext) <= sizeof(void*));
size_t rawSize = sizeof(ParenthesesDisjunctionContext) - sizeof(unsigned) + (Checked<size_t>(numberOfSubpatterns) * 2U) * sizeof(unsigned);
size_t roundedSize = roundUpToMultipleOf<sizeof(void*)>(rawSize);
RELEASE_ASSERT(roundedSize >= rawSize);
Modified: trunk/Source/WTF/ChangeLog (291936 => 291937)
--- trunk/Source/WTF/ChangeLog 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/WTF/ChangeLog 2022-03-26 14:41:15 UTC (rev 291937)
@@ -1,3 +1,35 @@
+2022-03-26 Yusuke Suzuki <ysuz...@apple.com>
+
+ Use unary static_assert
+ https://bugs.webkit.org/show_bug.cgi?id=238412
+
+ Reviewed by Mark Lam.
+
+ * wtf/CompactPointerTuple.h:
+ * wtf/FastMalloc.h:
+ * wtf/FunctionTraits.h:
+ (WTF::slotsForCCallArgument):
+ * wtf/Int128.cpp:
+ * wtf/MallocPtr.h:
+ * wtf/Markable.h:
+ (WTF::std::underlying_type<EnumType>::type>::max):
+ * wtf/PtrTag.h:
+ (WTF::tagInt):
+ * wtf/Seconds.h:
+ * wtf/StdLibExtras.h:
+ (WTF::roundUpToMultipleOf):
+ * wtf/SystemFree.h:
+ * wtf/UnalignedAccess.h:
+ (WTF::unalignedLoad):
+ (WTF::unalignedStore):
+ * wtf/UniqueArray.h:
+ (WTF::makeUniqueArray):
+ * wtf/WTFAssertions.cpp:
+ * wtf/text/StringConcatenate.h:
+ (WTF::tryMakeStringFromAdapters):
+ * wtf/text/StringImpl.h:
+ * wtf/text/SymbolImpl.h:
+
2022-03-25 Chris Dumez <cdu...@apple.com>
Use StringView::split() instead of String::split() in more places
Modified: trunk/Source/WTF/wtf/CompactPointerTuple.h (291936 => 291937)
--- trunk/Source/WTF/wtf/CompactPointerTuple.h 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/WTF/wtf/CompactPointerTuple.h 2022-03-26 14:41:15 UTC (rev 291937)
@@ -44,9 +44,9 @@
class CompactPointerTuple final {
WTF_MAKE_FAST_ALLOCATED;
public:
- static_assert(sizeof(Type) <= 2, "");
- static_assert(std::is_pointer<PointerType>::value, "");
- static_assert(std::is_integral<Type>::value || std::is_enum<Type>::value, "");
+ static_assert(sizeof(Type) <= 2);
+ static_assert(std::is_pointer<PointerType>::value);
+ static_assert(std::is_integral<Type>::value || std::is_enum<Type>::value);
using UnsignedType = std::make_unsigned_t<std::conditional_t<std::is_same_v<Type, bool>, uint8_t, Type>>;
static_assert(sizeof(UnsignedType) == sizeof(Type));
Modified: trunk/Source/WTF/wtf/FastMalloc.h (291936 => 291937)
--- trunk/Source/WTF/wtf/FastMalloc.h 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/WTF/wtf/FastMalloc.h 2022-03-26 14:41:15 UTC (rev 291937)
@@ -254,7 +254,7 @@
template<typename T>
struct FastFree {
- static_assert(std::is_trivially_destructible<T>::value, "");
+ static_assert(std::is_trivially_destructible<T>::value);
void operator()(T* pointer) const
{
@@ -264,7 +264,7 @@
template<typename T>
struct FastFree<T[]> {
- static_assert(std::is_trivially_destructible<T>::value, "");
+ static_assert(std::is_trivially_destructible<T>::value);
void operator()(T* pointer) const
{
Modified: trunk/Source/WTF/wtf/FunctionTraits.h (291936 => 291937)
--- trunk/Source/WTF/wtf/FunctionTraits.h 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/WTF/wtf/FunctionTraits.h 2022-03-26 14:41:15 UTC (rev 291937)
@@ -38,7 +38,7 @@
static constexpr unsigned slotsForCCallArgument()
{
static_assert(!std::is_class<T>::value || sizeof(T) <= sizeof(void*), "This doesn't support complex structs.");
- static_assert(sizeof(T) == 8 || sizeof(T) <= 4, "");
+ static_assert(sizeof(T) == 8 || sizeof(T) <= 4);
// This assumes that all integral values are passed on the stack.
if (sizeof(T) == 8)
return 2;
Modified: trunk/Source/WTF/wtf/Int128.cpp (291936 => 291937)
--- trunk/Source/WTF/wtf/Int128.cpp 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/WTF/wtf/Int128.cpp 2022-03-26 14:41:15 UTC (rev 291937)
@@ -89,7 +89,7 @@
template <typename T>
static UInt128Impl MakeUInt128FromFloat(T v) {
- static_assert(std::is_floating_point<T>::value, "");
+ static_assert(std::is_floating_point<T>::value);
// Rounding behavior is towards zero, same as for built-in types.
@@ -113,8 +113,8 @@
// It is more work, so only use when we need the workaround.
static UInt128Impl MakeUInt128FromFloat(long double v) {
// Go 50 bits at a time, that fits in a double
- static_assert(std::numeric_limits<double>::digits >= 50, "");
- static_assert(std::numeric_limits<long double>::digits <= 150, "");
+ static_assert(std::numeric_limits<double>::digits >= 50);
+ static_assert(std::numeric_limits<long double>::digits <= 150);
// Undefined behavior if v is not finite or cannot fit into UInt128Impl.
assert(std::isfinite(v) && v > -1 && v < std::ldexp(1.0L, 128));
Modified: trunk/Source/WTF/wtf/MallocPtr.h (291936 => 291937)
--- trunk/Source/WTF/wtf/MallocPtr.h 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/WTF/wtf/MallocPtr.h 2022-03-26 14:41:15 UTC (rev 291937)
@@ -142,7 +142,7 @@
T* m_ptr { nullptr };
};
-static_assert(sizeof(MallocPtr<int>) == sizeof(int*), "");
+static_assert(sizeof(MallocPtr<int>) == sizeof(int*));
template<typename U, typename OtherMalloc> MallocPtr<U, OtherMalloc> adoptMallocPtr(U* ptr)
{
Modified: trunk/Source/WTF/wtf/Markable.h (291936 => 291937)
--- trunk/Source/WTF/wtf/Markable.h 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/WTF/wtf/Markable.h 2022-03-26 14:41:15 UTC (rev 291937)
@@ -47,7 +47,7 @@
typename EnumType,
typename std::underlying_type<EnumType>::type constant = std::numeric_limits<typename std::underlying_type<EnumType>::type>::max()>
struct EnumMarkableTraits {
- static_assert(std::is_enum<EnumType>::value, "");
+ static_assert(std::is_enum<EnumType>::value);
using UnderlyingType = typename std::underlying_type<EnumType>::type;
constexpr static bool isEmptyValue(EnumType value)
@@ -63,7 +63,7 @@
template<typename IntegralType, IntegralType constant = 0>
struct IntegralMarkableTraits {
- static_assert(std::is_integral<IntegralType>::value, "");
+ static_assert(std::is_integral<IntegralType>::value);
constexpr static bool isEmptyValue(IntegralType value)
{
return value == constant;
Modified: trunk/Source/WTF/wtf/PtrTag.h (291936 => 291937)
--- trunk/Source/WTF/wtf/PtrTag.h 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/WTF/wtf/PtrTag.h 2022-03-26 14:41:15 UTC (rev 291937)
@@ -128,10 +128,10 @@
#define WTF_DECLARE_PTRTAG(tag) \
constexpr PtrTag tag = static_cast<PtrTag>(WTF_PTRTAG_HASH(#tag)); \
- static_assert(tag != NoPtrTag && tag != CFunctionPtrTag, "");
+ static_assert(tag != NoPtrTag && tag != CFunctionPtrTag);
-static_assert(static_cast<uintptr_t>(NoPtrTag) == static_cast<uintptr_t>(0), "");
-static_assert(static_cast<uintptr_t>(CFunctionPtrTag) == static_cast<uintptr_t>(1), "");
+static_assert(static_cast<uintptr_t>(NoPtrTag) == static_cast<uintptr_t>(0));
+static_assert(static_cast<uintptr_t>(CFunctionPtrTag) == static_cast<uintptr_t>(1));
#if COMPILER(MSVC)
#pragma warning(push)
@@ -532,7 +532,7 @@
template <PtrTag, typename IntType>
inline IntType tagInt(IntType ptrInt)
{
- static_assert(sizeof(IntType) == sizeof(uintptr_t), "");
+ static_assert(sizeof(IntType) == sizeof(uintptr_t));
return ptrInt;
}
Modified: trunk/Source/WTF/wtf/Seconds.h (291936 => 291937)
--- trunk/Source/WTF/wtf/Seconds.h 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/WTF/wtf/Seconds.h 2022-03-26 14:41:15 UTC (rev 291937)
@@ -57,11 +57,11 @@
constexpr double nanoseconds() const { return microseconds() * 1000; }
// Keep in mind that Seconds is held in double. If the value is not in range of 53bit integer, the result may not be precise.
- template<typename T> T minutesAs() const { static_assert(std::is_integral<T>::value, ""); return clampToAccepting64<T>(minutes()); }
- template<typename T> T secondsAs() const { static_assert(std::is_integral<T>::value, ""); return clampToAccepting64<T>(seconds()); }
- template<typename T> T millisecondsAs() const { static_assert(std::is_integral<T>::value, ""); return clampToAccepting64<T>(milliseconds()); }
- template<typename T> T microsecondsAs() const { static_assert(std::is_integral<T>::value, ""); return clampToAccepting64<T>(microseconds()); }
- template<typename T> T nanosecondsAs() const { static_assert(std::is_integral<T>::value, ""); return clampToAccepting64<T>(nanoseconds()); }
+ template<typename T> T minutesAs() const { static_assert(std::is_integral<T>::value); return clampToAccepting64<T>(minutes()); }
+ template<typename T> T secondsAs() const { static_assert(std::is_integral<T>::value); return clampToAccepting64<T>(seconds()); }
+ template<typename T> T millisecondsAs() const { static_assert(std::is_integral<T>::value); return clampToAccepting64<T>(milliseconds()); }
+ template<typename T> T microsecondsAs() const { static_assert(std::is_integral<T>::value); return clampToAccepting64<T>(microseconds()); }
+ template<typename T> T nanosecondsAs() const { static_assert(std::is_integral<T>::value); return clampToAccepting64<T>(nanoseconds()); }
static constexpr Seconds fromMinutes(double minutes)
{
Modified: trunk/Source/WTF/wtf/StdLibExtras.h (291936 => 291937)
--- trunk/Source/WTF/wtf/StdLibExtras.h 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/WTF/wtf/StdLibExtras.h 2022-03-26 14:41:15 UTC (rev 291937)
@@ -193,7 +193,7 @@
template<size_t divisor, typename T> inline T* roundUpToMultipleOf(T* x)
{
- static_assert(sizeof(T*) == sizeof(size_t), "");
+ static_assert(sizeof(T*) == sizeof(size_t));
return reinterpret_cast<T*>(roundUpToMultipleOf<divisor>(reinterpret_cast<size_t>(x)));
}
Modified: trunk/Source/WTF/wtf/SystemFree.h (291936 => 291937)
--- trunk/Source/WTF/wtf/SystemFree.h 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/WTF/wtf/SystemFree.h 2022-03-26 14:41:15 UTC (rev 291937)
@@ -31,7 +31,7 @@
template<typename T>
struct SystemFree {
- static_assert(std::is_trivially_destructible<T>::value, "");
+ static_assert(std::is_trivially_destructible<T>::value);
void operator()(T* pointer) const
{
@@ -41,7 +41,7 @@
template<typename T>
struct SystemFree<T[]> {
- static_assert(std::is_trivially_destructible<T>::value, "");
+ static_assert(std::is_trivially_destructible<T>::value);
void operator()(T* pointer) const
{
Modified: trunk/Source/WTF/wtf/UnalignedAccess.h (291936 => 291937)
--- trunk/Source/WTF/wtf/UnalignedAccess.h 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/WTF/wtf/UnalignedAccess.h 2022-03-26 14:41:15 UTC (rev 291937)
@@ -34,7 +34,7 @@
template<typename Type>
inline Type unalignedLoad(const void* pointer)
{
- static_assert(std::is_trivially_copyable<Type>::value, "");
+ static_assert(std::is_trivially_copyable<Type>::value);
Type result { };
memcpy(&result, pointer, sizeof(Type));
return result;
@@ -43,7 +43,7 @@
template<typename Type>
inline void unalignedStore(void* pointer, Type value)
{
- static_assert(std::is_trivially_copyable<Type>::value, "");
+ static_assert(std::is_trivially_copyable<Type>::value);
memcpy(pointer, &value, sizeof(Type));
}
Modified: trunk/Source/WTF/wtf/UniqueArray.h (291936 => 291937)
--- trunk/Source/WTF/wtf/UniqueArray.h 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/WTF/wtf/UniqueArray.h 2022-03-26 14:41:15 UTC (rev 291937)
@@ -38,7 +38,7 @@
template<typename T>
struct UniqueArrayFree {
- static_assert(std::is_trivially_destructible<T>::value, "");
+ static_assert(std::is_trivially_destructible<T>::value);
void operator()(T* pointer) const
{
@@ -48,7 +48,7 @@
template<typename T>
struct UniqueArrayFree<T[]> {
- static_assert(std::is_trivially_destructible<T>::value, "");
+ static_assert(std::is_trivially_destructible<T>::value);
void operator()(T* pointer) const
{
@@ -68,7 +68,7 @@
// If it is acceptable, we can just use Vector<T> instead. So this UniqueArray<T> only
// accepts the type T which has a trivial destructor. This allows us to skip calling
// destructors for N elements. And this allows UniqueArray<T> not to store its N size.
- static_assert(std::is_trivially_destructible<T>::value, "");
+ static_assert(std::is_trivially_destructible<T>::value);
// Do not use placement new like `new (storage) T[size]()`. `new T[size]()` requires
// larger storage than the `sizeof(T) * size` storage since it want to store `size`
@@ -99,7 +99,7 @@
T value { };
};
- static_assert(sizeof(T) == sizeof(UniqueArrayElement), "");
+ static_assert(sizeof(T) == sizeof(UniqueArrayElement));
using ResultType = typename std::unique_ptr<T[], typename UniqueArrayElement::Deleter>;
@@ -115,7 +115,7 @@
template<typename T>
UniqueArray<T> makeUniqueArray(size_t size)
{
- static_assert(std::is_same<typename std::remove_extent<T>::type, T>::value, "");
+ static_assert(std::is_same<typename std::remove_extent<T>::type, T>::value);
return UniqueArrayMaker<std::is_trivially_destructible<T>::value, T>::make(size);
}
Modified: trunk/Source/WTF/wtf/WTFAssertions.cpp (291936 => 291937)
--- trunk/Source/WTF/wtf/WTFAssertions.cpp 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/WTF/wtf/WTFAssertions.cpp 2022-03-26 14:41:15 UTC (rev 291937)
@@ -40,11 +40,11 @@
struct DummyStruct { };
}
-static_assert(sizeof(Bag<DummyStruct>) == sizeof(void*), "");
+static_assert(sizeof(Bag<DummyStruct>) == sizeof(void*));
-static_assert(sizeof(Ref<DummyStruct>) == sizeof(DummyStruct*), "");
+static_assert(sizeof(Ref<DummyStruct>) == sizeof(DummyStruct*));
-static_assert(sizeof(RefPtr<DummyStruct>) == sizeof(DummyStruct*), "");
+static_assert(sizeof(RefPtr<DummyStruct>) == sizeof(DummyStruct*));
#if OS(DARWIN) && CPU(ADDRESS64)
// NaN boxing encoding relies on this.
Modified: trunk/Source/WTF/wtf/text/StringConcatenate.h (291936 => 291937)
--- trunk/Source/WTF/wtf/text/StringConcatenate.h 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/WTF/wtf/text/StringConcatenate.h 2022-03-26 14:41:15 UTC (rev 291937)
@@ -433,7 +433,7 @@
template<typename StringTypeAdapter, typename... StringTypeAdapters>
String tryMakeStringFromAdapters(StringTypeAdapter adapter, StringTypeAdapters ...adapters)
{
- static_assert(String::MaxLength == std::numeric_limits<int32_t>::max(), "");
+ static_assert(String::MaxLength == std::numeric_limits<int32_t>::max());
auto sum = checkedSum<int32_t>(adapter.length(), adapters.length()...);
if (sum.hasOverflowed())
return String();
Modified: trunk/Source/WTF/wtf/text/StringImpl.h (291936 => 291937)
--- trunk/Source/WTF/wtf/text/StringImpl.h 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/WTF/wtf/text/StringImpl.h 2022-03-26 14:41:15 UTC (rev 291937)
@@ -525,7 +525,7 @@
using StaticStringImpl = StringImpl::StaticStringImpl;
-static_assert(sizeof(StringImpl) == sizeof(StaticStringImpl), "");
+static_assert(sizeof(StringImpl) == sizeof(StaticStringImpl));
template<typename CharacterType>
struct HashTranslatorCharBuffer {
Modified: trunk/Source/WTF/wtf/text/SymbolImpl.h (291936 => 291937)
--- trunk/Source/WTF/wtf/text/SymbolImpl.h 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/WTF/wtf/text/SymbolImpl.h 2022-03-26 14:41:15 UTC (rev 291937)
@@ -122,7 +122,7 @@
unsigned m_hashForSymbolShiftedWithFlagCount;
Flags m_flags { s_flagDefault };
};
-static_assert(sizeof(SymbolImpl) == sizeof(SymbolImpl::StaticSymbolImpl), "");
+static_assert(sizeof(SymbolImpl) == sizeof(SymbolImpl::StaticSymbolImpl));
class PrivateSymbolImpl final : public SymbolImpl {
public:
Modified: trunk/Source/WebCore/ChangeLog (291936 => 291937)
--- trunk/Source/WebCore/ChangeLog 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/WebCore/ChangeLog 2022-03-26 14:41:15 UTC (rev 291937)
@@ -1,3 +1,26 @@
+2022-03-26 Yusuke Suzuki <ysuz...@apple.com>
+
+ Use unary static_assert
+ https://bugs.webkit.org/show_bug.cgi?id=238412
+
+ Reviewed by Mark Lam.
+
+ * Modules/entriesapi/FileSystemDirectoryEntry.h:
+ * Modules/entriesapi/FileSystemFileEntry.h:
+ * css/DOMMatrix.h:
+ * cssjit/SelectorCompiler.cpp:
+ (WebCore::SelectorCompiler::SelectorCodeGenerator::generateAddStyleRelation):
+ * dom/DOMPoint.h:
+ * dom/DOMRect.h:
+ * html/HTMLAllCollection.h:
+ * html/track/AudioTrackList.h:
+ * html/track/VideoTrackList.h:
+ * layout/formattingContexts/inline/InlineItem.cpp:
+ * layout/formattingContexts/inline/InlineTextItem.cpp:
+ * platform/KeyedCoding.h:
+ (WebCore::KeyedDecoder::decodeBytes):
+ * xml/XMLHttpRequestEventTarget.h:
+
2022-03-25 Chris Dumez <cdu...@apple.com>
Simplify / Optimize JSNodeOwner::isReachableFromOpaqueRoots()
Modified: trunk/Source/WebCore/Modules/entriesapi/FileSystemDirectoryEntry.h (291936 => 291937)
--- trunk/Source/WebCore/Modules/entriesapi/FileSystemDirectoryEntry.h 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/WebCore/Modules/entriesapi/FileSystemDirectoryEntry.h 2022-03-26 14:41:15 UTC (rev 291937)
@@ -55,7 +55,7 @@
FileSystemDirectoryEntry(ScriptExecutionContext&, DOMFileSystem&, const String& virtualPath);
};
-static_assert(sizeof(FileSystemDirectoryEntry) == sizeof(FileSystemEntry), "");
+static_assert(sizeof(FileSystemDirectoryEntry) == sizeof(FileSystemEntry));
} // namespace WebCore
Modified: trunk/Source/WebCore/Modules/entriesapi/FileSystemFileEntry.h (291936 => 291937)
--- trunk/Source/WebCore/Modules/entriesapi/FileSystemFileEntry.h 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/WebCore/Modules/entriesapi/FileSystemFileEntry.h 2022-03-26 14:41:15 UTC (rev 291937)
@@ -44,7 +44,7 @@
FileSystemFileEntry(ScriptExecutionContext&, DOMFileSystem&, const String& virtualPath);
};
-static_assert(sizeof(FileSystemFileEntry) == sizeof(FileSystemEntry), "");
+static_assert(sizeof(FileSystemFileEntry) == sizeof(FileSystemEntry));
} // namespace WebCore
Modified: trunk/Source/WebCore/css/DOMMatrix.h (291936 => 291937)
--- trunk/Source/WebCore/css/DOMMatrix.h 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/WebCore/css/DOMMatrix.h 2022-03-26 14:41:15 UTC (rev 291937)
@@ -93,7 +93,7 @@
DOMMatrix(const TransformationMatrix&, Is2D);
DOMMatrix(TransformationMatrix&&, Is2D);
};
-static_assert(sizeof(DOMMatrix) == sizeof(DOMMatrixReadOnly), "");
+static_assert(sizeof(DOMMatrix) == sizeof(DOMMatrixReadOnly));
inline void DOMMatrix::setM13(double f)
{
Modified: trunk/Source/WebCore/cssjit/SelectorCompiler.cpp (291936 => 291937)
--- trunk/Source/WebCore/cssjit/SelectorCompiler.cpp 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/WebCore/cssjit/SelectorCompiler.cpp 2022-03-26 14:41:15 UTC (rev 291937)
@@ -2529,8 +2529,8 @@
auto getLastRelationPointer = [&] (Assembler::RegisterID sizeAndTarget) {
m_assembler.sub32(Assembler::TrustedImm32(1), sizeAndTarget);
#if CPU(ADDRESS64)
- static_assert(sizeof(Style::Relation) == 16, "");
- static_assert(1 << 4 == 16, "");
+ static_assert(sizeof(Style::Relation) == 16);
+ static_assert(1 << 4 == 16);
m_assembler.lshiftPtr(Assembler::TrustedImm32(4), sizeAndTarget);
#else
m_assembler.mul32(Assembler::TrustedImm32(sizeof(Style::Relation)), sizeAndTarget, sizeAndTarget);
Modified: trunk/Source/WebCore/dom/DOMPoint.h (291936 => 291937)
--- trunk/Source/WebCore/dom/DOMPoint.h 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/WebCore/dom/DOMPoint.h 2022-03-26 14:41:15 UTC (rev 291937)
@@ -51,6 +51,6 @@
{
}
};
-static_assert(sizeof(DOMPoint) == sizeof(DOMPointReadOnly), "");
+static_assert(sizeof(DOMPoint) == sizeof(DOMPointReadOnly));
} // namespace WebCore
Modified: trunk/Source/WebCore/dom/DOMRect.h (291936 => 291937)
--- trunk/Source/WebCore/dom/DOMRect.h 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/WebCore/dom/DOMRect.h 2022-03-26 14:41:15 UTC (rev 291937)
@@ -55,6 +55,6 @@
DOMRect() = default;
};
-static_assert(sizeof(DOMRect) == sizeof(DOMRectReadOnly), "");
+static_assert(sizeof(DOMRect) == sizeof(DOMRectReadOnly));
}
Modified: trunk/Source/WebCore/html/HTMLAllCollection.h (291936 => 291937)
--- trunk/Source/WebCore/html/HTMLAllCollection.h 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/WebCore/html/HTMLAllCollection.h 2022-03-26 14:41:15 UTC (rev 291937)
@@ -39,7 +39,7 @@
private:
HTMLAllCollection(Document&, CollectionType);
};
-static_assert(sizeof(HTMLAllCollection) == sizeof(AllDescendantsCollection), "");
+static_assert(sizeof(HTMLAllCollection) == sizeof(AllDescendantsCollection));
class HTMLAllNamedSubCollection final : public CachedHTMLCollection<HTMLAllNamedSubCollection, CollectionTraversalType::Descendants> {
WTF_MAKE_ISO_ALLOCATED(HTMLAllNamedSubCollection);
Modified: trunk/Source/WebCore/html/track/AudioTrackList.h (291936 => 291937)
--- trunk/Source/WebCore/html/track/AudioTrackList.h 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/WebCore/html/track/AudioTrackList.h 2022-03-26 14:41:15 UTC (rev 291937)
@@ -58,7 +58,7 @@
const char* activeDOMObjectName() const final;
};
-static_assert(sizeof(AudioTrackList) == sizeof(TrackListBase), "");
+static_assert(sizeof(AudioTrackList) == sizeof(TrackListBase));
} // namespace WebCore
Modified: trunk/Source/WebCore/html/track/VideoTrackList.h (291936 => 291937)
--- trunk/Source/WebCore/html/track/VideoTrackList.h 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/WebCore/html/track/VideoTrackList.h 2022-03-26 14:41:15 UTC (rev 291937)
@@ -58,7 +58,7 @@
const char* activeDOMObjectName() const final;
};
-static_assert(sizeof(VideoTrackList) == sizeof(TrackListBase), "");
+static_assert(sizeof(VideoTrackList) == sizeof(TrackListBase));
} // namespace WebCore
Modified: trunk/Source/WebCore/layout/formattingContexts/inline/InlineItem.cpp (291936 => 291937)
--- trunk/Source/WebCore/layout/formattingContexts/inline/InlineItem.cpp 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/WebCore/layout/formattingContexts/inline/InlineItem.cpp 2022-03-26 14:41:15 UTC (rev 291937)
@@ -45,7 +45,7 @@
unsigned length;
};
-static_assert(sizeof(InlineItem) == sizeof(SameSizeAsInlineItem), "");
+static_assert(sizeof(InlineItem) == sizeof(SameSizeAsInlineItem));
}
}
Modified: trunk/Source/WebCore/layout/formattingContexts/inline/InlineTextItem.cpp (291936 => 291937)
--- trunk/Source/WebCore/layout/formattingContexts/inline/InlineTextItem.cpp 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/WebCore/layout/formattingContexts/inline/InlineTextItem.cpp 2022-03-26 14:41:15 UTC (rev 291937)
@@ -36,7 +36,7 @@
namespace WebCore {
namespace Layout {
-static_assert(sizeof(InlineItem) == sizeof(InlineTextItem), "");
+static_assert(sizeof(InlineItem) == sizeof(InlineTextItem));
InlineTextItem::InlineTextItem(const InlineTextBox& inlineTextBox, unsigned start, unsigned length, UBiDiLevel bidiLevel, bool hasTrailingSoftHyphen, bool isWordSeparator, std::optional<InlineLayoutUnit> width, TextItemType textItemType)
: InlineItem(inlineTextBox, Type::Text, bidiLevel)
Modified: trunk/Source/WebCore/platform/KeyedCoding.h (291936 => 291937)
--- trunk/Source/WebCore/platform/KeyedCoding.h 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/WebCore/platform/KeyedCoding.h 2022-03-26 14:41:15 UTC (rev 291937)
@@ -53,7 +53,7 @@
template<typename T> WARN_UNUSED_RETURN
bool decodeBytes(const String& key, Vector<T>& vector)
{
- static_assert(sizeof(T) == 1, "");
+ static_assert(sizeof(T) == 1);
size_t size;
const uint8_t* bytes;
Modified: trunk/Source/WebCore/xml/XMLHttpRequestEventTarget.h (291936 => 291937)
--- trunk/Source/WebCore/xml/XMLHttpRequestEventTarget.h 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/WebCore/xml/XMLHttpRequestEventTarget.h 2022-03-26 14:41:15 UTC (rev 291937)
@@ -31,6 +31,6 @@
class XMLHttpRequestEventTarget : public EventTargetWithInlineData {
};
-static_assert(sizeof(XMLHttpRequestEventTarget) == sizeof(EventTargetWithInlineData), "");
+static_assert(sizeof(XMLHttpRequestEventTarget) == sizeof(EventTargetWithInlineData));
} // namespace WebCore
Modified: trunk/Source/WebKit/ChangeLog (291936 => 291937)
--- trunk/Source/WebKit/ChangeLog 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/WebKit/ChangeLog 2022-03-26 14:41:15 UTC (rev 291937)
@@ -1,3 +1,15 @@
+2022-03-26 Yusuke Suzuki <ysuz...@apple.com>
+
+ Use unary static_assert
+ https://bugs.webkit.org/show_bug.cgi?id=238412
+
+ Reviewed by Mark Lam.
+
+ * Shared/API/c/WKContextMenuItem.cpp:
+ * UIProcess/mac/LegacySessionStateCoding.cpp:
+ (WebKit::HistoryEntryDataEncoder::encodeArithmeticType):
+ (WebKit::HistoryEntryDataDecoder::decodeArithmeticType):
+
2022-03-25 Simon Fraser <simon.fra...@apple.com>
Temporarily disable assertion in MessageReceiveQueueMap::addImpl()
Modified: trunk/Source/WebKit/Shared/API/c/WKContextMenuItem.cpp (291936 => 291937)
--- trunk/Source/WebKit/Shared/API/c/WKContextMenuItem.cpp 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/WebKit/Shared/API/c/WKContextMenuItem.cpp 2022-03-26 14:41:15 UTC (rev 291937)
@@ -170,8 +170,8 @@
#if PLATFORM(COCOA)
#define STATIC_ASSERT_EQUALS(a, b, c) \
- static_assert(a == b, ""); \
- static_assert(a == WebCore::c, "");
+ static_assert(a == b); \
+ static_assert(a == WebCore::c);
// These values must remain equal to retain binary compatibility.
STATIC_ASSERT_EQUALS(0, kWKContextMenuItemTagNoAction, ContextMenuItemTagNoAction);
Modified: trunk/Source/WebKit/UIProcess/mac/LegacySessionStateCoding.cpp (291936 => 291937)
--- trunk/Source/WebKit/UIProcess/mac/LegacySessionStateCoding.cpp 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/WebKit/UIProcess/mac/LegacySessionStateCoding.cpp 2022-03-26 14:41:15 UTC (rev 291937)
@@ -205,7 +205,7 @@
template<typename Type>
HistoryEntryDataEncoder& encodeArithmeticType(Type value)
{
- static_assert(std::is_arithmetic<Type>::value, "");
+ static_assert(std::is_arithmetic<Type>::value);
encodeFixedLengthData(reinterpret_cast<uint8_t*>(&value), sizeof(value), sizeof(value));
return *this;
@@ -738,7 +738,7 @@
template<typename Type>
HistoryEntryDataDecoder& decodeArithmeticType(Type& value)
{
- static_assert(std::is_arithmetic<Type>::value, "");
+ static_assert(std::is_arithmetic<Type>::value);
value = Type();
decodeFixedLengthData(reinterpret_cast<uint8_t*>(&value), sizeof(value), sizeof(value));
Modified: trunk/Source/bmalloc/ChangeLog (291936 => 291937)
--- trunk/Source/bmalloc/ChangeLog 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/bmalloc/ChangeLog 2022-03-26 14:41:15 UTC (rev 291937)
@@ -1,3 +1,15 @@
+2022-03-26 Yusuke Suzuki <ysuz...@apple.com>
+
+ Use unary static_assert
+ https://bugs.webkit.org/show_bug.cgi?id=238412
+
+ Reviewed by Mark Lam.
+
+ * bmalloc/Algorithm.h:
+ (bmalloc::isPowerOfTwo):
+ * bmalloc/Gigacage.h:
+ * bmalloc/IsoHeapImpl.h:
+
2022-03-21 Alex Christensen <achristen...@webkit.org>
Dust off Mac CMake build
Modified: trunk/Source/bmalloc/bmalloc/Algorithm.h (291936 => 291937)
--- trunk/Source/bmalloc/bmalloc/Algorithm.h 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/bmalloc/bmalloc/Algorithm.h 2022-03-26 14:41:15 UTC (rev 291937)
@@ -67,7 +67,7 @@
template <typename T>
constexpr bool isPowerOfTwo(T size)
{
- static_assert(std::is_integral<T>::value, "");
+ static_assert(std::is_integral<T>::value);
return size && !(size & (size - 1));
}
Modified: trunk/Source/bmalloc/bmalloc/Gigacage.h (291936 => 291937)
--- trunk/Source/bmalloc/bmalloc/Gigacage.h 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/bmalloc/bmalloc/Gigacage.h 2022-03-26 14:41:15 UTC (rev 291937)
@@ -82,10 +82,10 @@
#endif
-static_assert(bmalloc::isPowerOfTwo(primitiveGigacageSize), "");
-static_assert(bmalloc::isPowerOfTwo(jsValueGigacageSize), "");
-static_assert(primitiveGigacageSize > maximumCageSizeReductionForSlide, "");
-static_assert(jsValueGigacageSize > maximumCageSizeReductionForSlide, "");
+static_assert(bmalloc::isPowerOfTwo(primitiveGigacageSize));
+static_assert(bmalloc::isPowerOfTwo(jsValueGigacageSize));
+static_assert(primitiveGigacageSize > maximumCageSizeReductionForSlide);
+static_assert(jsValueGigacageSize > maximumCageSizeReductionForSlide);
constexpr size_t gigacageSizeToMask(size_t size) { return size - 1; }
Modified: trunk/Source/bmalloc/bmalloc/IsoHeapImpl.h (291936 => 291937)
--- trunk/Source/bmalloc/bmalloc/IsoHeapImpl.h 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Source/bmalloc/bmalloc/IsoHeapImpl.h 2022-03-26 14:41:15 UTC (rev 291937)
@@ -45,8 +45,8 @@
public:
static constexpr unsigned maxAllocationFromShared = 8;
static constexpr unsigned maxAllocationFromSharedMask = (1U << maxAllocationFromShared) - 1U;
- static_assert(maxAllocationFromShared <= bmalloc::alignment, "");
- static_assert(isPowerOfTwo(maxAllocationFromShared), "");
+ static_assert(maxAllocationFromShared <= bmalloc::alignment);
+ static_assert(isPowerOfTwo(maxAllocationFromShared));
virtual ~IsoHeapImplBase();
@@ -93,7 +93,7 @@
unsigned m_availableShared { maxAllocationFromSharedMask };
AllocationMode m_allocationMode { AllocationMode::Init };
bool m_isInlineDirectoryEligibleOrDecommitted { true };
- static_assert(sizeof(m_availableShared) * 8 >= maxAllocationFromShared, "");
+ static_assert(sizeof(m_availableShared) * 8 >= maxAllocationFromShared);
};
template<typename Config>
Modified: trunk/Tools/ChangeLog (291936 => 291937)
--- trunk/Tools/ChangeLog 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Tools/ChangeLog 2022-03-26 14:41:15 UTC (rev 291937)
@@ -1,3 +1,20 @@
+2022-03-26 Yusuke Suzuki <ysuz...@apple.com>
+
+ Use unary static_assert
+ https://bugs.webkit.org/show_bug.cgi?id=238412
+
+ Reviewed by Mark Lam.
+
+ * TestWebKitAPI/Tests/WTF/EnumTraits.cpp:
+ * TestWebKitAPI/Tests/WTF/HashMap.cpp:
+ (TestWebKitAPI::TEST):
+ * TestWebKitAPI/Tests/WTF/Int128.cpp:
+ (TestWebKitAPI::TEST):
+ * TestWebKitAPI/Tests/WTF/Packed.cpp:
+ (TestWebKitAPI::TEST):
+ * TestWebKitAPI/Tests/WTF/RobinHoodHashMap.cpp:
+ (TestWebKitAPI::TEST):
+
2022-03-26 Adrian Perez de Castro <ape...@igalia.com>
[WPE][GTK] Dist/distcheck targets fail due to Python error
Modified: trunk/Tools/TestWebKitAPI/Tests/WTF/EnumTraits.cpp (291936 => 291937)
--- trunk/Tools/TestWebKitAPI/Tests/WTF/EnumTraits.cpp 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Tools/TestWebKitAPI/Tests/WTF/EnumTraits.cpp 2022-03-26 14:41:15 UTC (rev 291937)
@@ -41,9 +41,9 @@
namespace TestWebKitAPI {
-static_assert(WTF::isValidEnum<TestEnum>(0), "");
-static_assert(!WTF::isValidEnum<TestEnum>(-1), "");
-static_assert(!WTF::isValidEnum<TestEnum>(3), "");
+static_assert(WTF::isValidEnum<TestEnum>(0));
+static_assert(!WTF::isValidEnum<TestEnum>(-1));
+static_assert(!WTF::isValidEnum<TestEnum>(3));
TEST(WTF_EnumTraits, IsValidEnum)
{
Modified: trunk/Tools/TestWebKitAPI/Tests/WTF/HashMap.cpp (291936 => 291937)
--- trunk/Tools/TestWebKitAPI/Tests/WTF/HashMap.cpp 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Tools/TestWebKitAPI/Tests/WTF/HashMap.cpp 2022-03-26 14:41:15 UTC (rev 291937)
@@ -1048,7 +1048,7 @@
static Ref<Key> create() { return adoptRef(*new Key); }
};
- static_assert(!WTF::HashTraits<Value>::emptyValueIsZero, "");
+ static_assert(!WTF::HashTraits<Value>::emptyValueIsZero);
HashMap<Ref<Key>, Value> map;
Vector<std::pair<Ref<Key>, int32_t>> vectorMap;
Modified: trunk/Tools/TestWebKitAPI/Tests/WTF/Int128.cpp (291936 => 291937)
--- trunk/Tools/TestWebKitAPI/Tests/WTF/Int128.cpp 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Tools/TestWebKitAPI/Tests/WTF/Int128.cpp 2022-03-26 14:41:15 UTC (rev 291937)
@@ -80,8 +80,8 @@
"");
static_assert(std::is_trivially_copy_constructible<WTF::UInt128Impl>::value,
"");
- static_assert(std::is_trivially_copy_assignable<WTF::UInt128Impl>::value, "");
- static_assert(std::is_trivially_destructible<WTF::UInt128Impl>::value, "");
+ static_assert(std::is_trivially_copy_assignable<WTF::UInt128Impl>::value);
+ static_assert(std::is_trivially_destructible<WTF::UInt128Impl>::value);
}
TEST(WTF_UInt128, AllTests)
@@ -436,9 +436,9 @@
TEST(WTF_UInt128, NumericLimitsTest)
{
- static_assert(std::numeric_limits<WTF::UInt128Impl>::is_specialized, "");
- static_assert(!std::numeric_limits<WTF::UInt128Impl>::is_signed, "");
- static_assert(std::numeric_limits<WTF::UInt128Impl>::is_integer, "");
+ static_assert(std::numeric_limits<WTF::UInt128Impl>::is_specialized);
+ static_assert(!std::numeric_limits<WTF::UInt128Impl>::is_signed);
+ static_assert(std::numeric_limits<WTF::UInt128Impl>::is_integer);
EXPECT_EQ(static_cast<int>(128 * std::log10(2)),
std::numeric_limits<WTF::UInt128Impl>::digits10);
EXPECT_EQ(0, std::numeric_limits<WTF::UInt128Impl>::min());
@@ -512,10 +512,10 @@
TEST(WTF_Int128, TrivialTraitsTest)
{
- static_assert(std::is_trivially_default_constructible<WTF::Int128Impl>::value, "");
- static_assert(std::is_trivially_copy_constructible<WTF::Int128Impl>::value, "");
- static_assert(std::is_trivially_copy_assignable<WTF::Int128Impl>::value, "");
- static_assert(std::is_trivially_destructible<WTF::Int128Impl>::value, "");
+ static_assert(std::is_trivially_default_constructible<WTF::Int128Impl>::value);
+ static_assert(std::is_trivially_copy_constructible<WTF::Int128Impl>::value);
+ static_assert(std::is_trivially_copy_assignable<WTF::Int128Impl>::value);
+ static_assert(std::is_trivially_destructible<WTF::Int128Impl>::value);
}
TEST(WTF_Int128, BoolConversionTest)
@@ -1189,9 +1189,9 @@
TEST(WTF_Int128, NumericLimitsTest)
{
- static_assert(std::numeric_limits<WTF::Int128Impl>::is_specialized, "");
- static_assert(std::numeric_limits<WTF::Int128Impl>::is_signed, "");
- static_assert(std::numeric_limits<WTF::Int128Impl>::is_integer, "");
+ static_assert(std::numeric_limits<WTF::Int128Impl>::is_specialized);
+ static_assert(std::numeric_limits<WTF::Int128Impl>::is_signed);
+ static_assert(std::numeric_limits<WTF::Int128Impl>::is_integer);
EXPECT_EQ(static_cast<int>(127 * std::log10(2)),
std::numeric_limits<WTF::Int128Impl>::digits10);
EXPECT_EQ(WTF::Int128Min(), std::numeric_limits<WTF::Int128Impl>::min());
Modified: trunk/Tools/TestWebKitAPI/Tests/WTF/Packed.cpp (291936 => 291937)
--- trunk/Tools/TestWebKitAPI/Tests/WTF/Packed.cpp 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Tools/TestWebKitAPI/Tests/WTF/Packed.cpp 2022-03-26 14:41:15 UTC (rev 291937)
@@ -66,7 +66,7 @@
{
{
PackedPtr<uint8_t> key { nullptr };
- static_assert(OS_CONSTANT(EFFECTIVE_ADDRESS_WIDTH) != 64, "");
+ static_assert(OS_CONSTANT(EFFECTIVE_ADDRESS_WIDTH) != 64);
uint8_t* candidates[] = {
0,
bitwise_cast<uint8_t*>(static_cast<uintptr_t>((1ULL << (OS_CONSTANT(EFFECTIVE_ADDRESS_WIDTH) / 2)) - 1)),
Modified: trunk/Tools/TestWebKitAPI/Tests/WTF/RobinHoodHashMap.cpp (291936 => 291937)
--- trunk/Tools/TestWebKitAPI/Tests/WTF/RobinHoodHashMap.cpp 2022-03-26 14:07:38 UTC (rev 291936)
+++ trunk/Tools/TestWebKitAPI/Tests/WTF/RobinHoodHashMap.cpp 2022-03-26 14:41:15 UTC (rev 291937)
@@ -1050,7 +1050,7 @@
static Ref<Key> create() { return adoptRef(*new Key); }
};
- static_assert(!WTF::HashTraits<Value>::emptyValueIsZero, "");
+ static_assert(!WTF::HashTraits<Value>::emptyValueIsZero);
MemoryCompactLookupOnlyRobinHoodHashMap<Ref<Key>, Value, RobinHoodHash<Ref<Key>>> map;
Vector<std::pair<Ref<Key>, int32_t>> vectorMap;