Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (254842 => 254843)
--- trunk/Source/_javascript_Core/ChangeLog 2020-01-21 03:48:17 UTC (rev 254842)
+++ trunk/Source/_javascript_Core/ChangeLog 2020-01-21 04:01:50 UTC (rev 254843)
@@ -1,3 +1,50 @@
+2020-01-17 Sam Weinig <[email protected]>
+
+ Platform.h is out of control Part 8: Macros are used inconsistently
+ https://bugs.webkit.org/show_bug.cgi?id=206425
+
+ Reviewed by Darin Adler.
+
+ * assembler/ARM64Assembler.h:
+ (JSC::ARM64Assembler::cacheFlush):
+ (JSC::ARM64Assembler::xOrSp):
+ (JSC::ARM64Assembler::xOrZr):
+ * assembler/ARM64Registers.h:
+ * assembler/ARMv7Assembler.h:
+ (JSC::ARMv7Assembler::cacheFlush):
+ * assembler/ARMv7Registers.h:
+ * assembler/AssemblerCommon.h:
+ (JSC::isDarwin):
+ * b3/air/AirCCallingConvention.cpp:
+ * jit/ExecutableAllocator.h:
+ * jit/ThunkGenerators.cpp:
+ * jsc.cpp:
+ * runtime/MathCommon.cpp:
+ Use OS(DARWIN) more consistently for darwin level functionality.
+
+ * bytecode/CodeOrigin.h:
+ * runtime/JSString.h:
+ Update to use OS_CONSTANT.
+
+ * disassembler/ARM64/A64DOpcode.cpp:
+ * disassembler/ARM64Disassembler.cpp:
+ * disassembler/UDis86Disassembler.cpp:
+ * disassembler/UDis86Disassembler.h:
+ * disassembler/X86Disassembler.cpp:
+ * disassembler/udis86/udis86.c:
+ * disassembler/udis86/udis86_decode.c:
+ * disassembler/udis86/udis86_itab_holder.c:
+ * disassembler/udis86/udis86_syn-att.c:
+ * disassembler/udis86/udis86_syn-intel.c:
+ * disassembler/udis86/udis86_syn.c:
+ * interpreter/Interpreter.cpp:
+ * interpreter/Interpreter.h:
+ * interpreter/InterpreterInlines.h:
+ (JSC::Interpreter::getOpcodeID):
+ * llint/LowLevelInterpreter.cpp:
+ * tools/SigillCrashAnalyzer.cpp:
+ Switch to using ENABLE rather than USE for features internal to WebKit
+
2020-01-20 Gus Caplan <[email protected]>
Remove own toString from NativeError prototype
Modified: trunk/Source/_javascript_Core/assembler/ARM64Assembler.h (254842 => 254843)
--- trunk/Source/_javascript_Core/assembler/ARM64Assembler.h 2020-01-21 03:48:17 UTC (rev 254842)
+++ trunk/Source/_javascript_Core/assembler/ARM64Assembler.h 2020-01-21 04:01:50 UTC (rev 254843)
@@ -2807,7 +2807,7 @@
static void cacheFlush(void* code, size_t size)
{
-#if OS(IOS_FAMILY)
+#if OS(DARWIN)
sys_cache_control(kCacheFunctionPrepareForExecution, code, size);
#elif OS(FUCHSIA)
zx_cache_flush(code, size, ZX_CACHE_FLUSH_INSN);
@@ -3230,13 +3230,13 @@
static int xOrSp(RegisterID reg)
{
ASSERT(!isZr(reg));
- ASSERT(!isIOS() || reg != ARM64Registers::x18);
+ ASSERT(!isDarwin() || reg != ARM64Registers::x18);
return reg;
}
static int xOrZr(RegisterID reg)
{
ASSERT(!isSp(reg));
- ASSERT(!isIOS() || reg != ARM64Registers::x18);
+ ASSERT(!isDarwin() || reg != ARM64Registers::x18);
return reg & 31;
}
static FPRegisterID xOrZrAsFPR(RegisterID reg) { return static_cast<FPRegisterID>(xOrZr(reg)); }
Modified: trunk/Source/_javascript_Core/assembler/ARM64Registers.h (254842 => 254843)
--- trunk/Source/_javascript_Core/assembler/ARM64Registers.h 2020-01-21 03:48:17 UTC (rev 254842)
+++ trunk/Source/_javascript_Core/assembler/ARM64Registers.h 2020-01-21 04:01:50 UTC (rev 254843)
@@ -39,7 +39,7 @@
// beyond what you would save by the platform-agnostic "preserve return address" and "restore
// return address" operations in CCallHelpers.
-#if !PLATFORM(IOS_FAMILY)
+#if !OS(DARWIN)
#define FOR_EACH_GP_REGISTER(macro) \
/* Parameter/result registers. */ \
macro(x0, "x0", 0, 0) \
Modified: trunk/Source/_javascript_Core/assembler/ARMv7Assembler.h (254842 => 254843)
--- trunk/Source/_javascript_Core/assembler/ARMv7Assembler.h 2020-01-21 03:48:17 UTC (rev 254842)
+++ trunk/Source/_javascript_Core/assembler/ARMv7Assembler.h 2020-01-21 04:01:50 UTC (rev 254843)
@@ -2376,7 +2376,7 @@
static void cacheFlush(void* code, size_t size)
{
-#if OS(IOS_FAMILY)
+#if OS(DARWIN)
sys_cache_control(kCacheFunctionPrepareForExecution, code, size);
#elif OS(LINUX)
size_t page = pageSize();
Modified: trunk/Source/_javascript_Core/assembler/ARMv7Registers.h (254842 => 254843)
--- trunk/Source/_javascript_Core/assembler/ARMv7Registers.h 2020-01-21 03:48:17 UTC (rev 254842)
+++ trunk/Source/_javascript_Core/assembler/ARMv7Registers.h 2020-01-21 04:01:50 UTC (rev 254843)
@@ -36,7 +36,7 @@
#define FOR_EACH_FP_REGISTER(macro) \
FOR_EACH_FP_DOUBLE_REGISTER(macro)
-#if !PLATFORM(IOS_FAMILY)
+#if !OS(DARWIN)
#define FOR_EACH_GP_REGISTER(macro) \
macro(r0, "r0", 0, 0) \
macro(r1, "r1", 0, 0) \
Modified: trunk/Source/_javascript_Core/assembler/AssemblerCommon.h (254842 => 254843)
--- trunk/Source/_javascript_Core/assembler/AssemblerCommon.h 2020-01-21 03:48:17 UTC (rev 254842)
+++ trunk/Source/_javascript_Core/assembler/AssemblerCommon.h 2020-01-21 04:01:50 UTC (rev 254843)
@@ -27,6 +27,15 @@
namespace JSC {
+ALWAYS_INLINE constexpr bool isDarwin()
+{
+#if OS(DARWIN)
+ return true;
+#else
+ return false;
+#endif
+}
+
ALWAYS_INLINE constexpr bool isIOS()
{
#if PLATFORM(IOS_FAMILY)
Modified: trunk/Source/_javascript_Core/b3/air/AirCCallingConvention.cpp (254842 => 254843)
--- trunk/Source/_javascript_Core/b3/air/AirCCallingConvention.cpp 2020-01-21 03:48:17 UTC (rev 254842)
+++ trunk/Source/_javascript_Core/b3/air/AirCCallingConvention.cpp 2020-01-21 04:01:50 UTC (rev 254843)
@@ -45,7 +45,7 @@
return Tmp(BankInfo::toArgumentRegister(argumentIndex));
unsigned slotSize;
- if (isARM64() && isIOS()) {
+ if (isARM64() && isDarwin()) {
// Arguments are packed.
slotSize = sizeofType(child->type());
} else {
Modified: trunk/Source/_javascript_Core/bytecode/CodeOrigin.h (254842 => 254843)
--- trunk/Source/_javascript_Core/bytecode/CodeOrigin.h 2020-01-21 03:48:17 UTC (rev 254842)
+++ trunk/Source/_javascript_Core/bytecode/CodeOrigin.h 2020-01-21 04:01:50 UTC (rev 254843)
@@ -234,8 +234,8 @@
}
#if CPU(ADDRESS64)
- static constexpr unsigned s_freeBitsAtTop = 64 - WTF_CPU_EFFECTIVE_ADDRESS_WIDTH;
- static constexpr uintptr_t s_maskCompositeValueForPointer = ((1ULL << WTF_CPU_EFFECTIVE_ADDRESS_WIDTH) - 1) & ~(8ULL - 1);
+ static constexpr unsigned s_freeBitsAtTop = 64 - OS_CONSTANT(EFFECTIVE_ADDRESS_WIDTH);
+ static constexpr uintptr_t s_maskCompositeValueForPointer = ((1ULL << OS_CONSTANT(EFFECTIVE_ADDRESS_WIDTH)) - 1) & ~(8ULL - 1);
static uintptr_t buildCompositeValue(InlineCallFrame* inlineCallFrame, BytecodeIndex bytecodeIndex)
{
if (!bytecodeIndex)
Modified: trunk/Source/_javascript_Core/disassembler/ARM64/A64DOpcode.cpp (254842 => 254843)
--- trunk/Source/_javascript_Core/disassembler/ARM64/A64DOpcode.cpp 2020-01-21 03:48:17 UTC (rev 254842)
+++ trunk/Source/_javascript_Core/disassembler/ARM64/A64DOpcode.cpp 2020-01-21 04:01:50 UTC (rev 254843)
@@ -25,7 +25,7 @@
#include "config.h"
-#if USE(ARM64_DISASSEMBLER)
+#if ENABLE(ARM64_DISASSEMBLER)
#include "A64DOpcode.h"
@@ -1560,4 +1560,4 @@
} } // namespace JSC::ARM64Disassembler
-#endif // USE(ARM64_DISASSEMBLER)
+#endif // ENABLE(ARM64_DISASSEMBLER)
Modified: trunk/Source/_javascript_Core/disassembler/ARM64Disassembler.cpp (254842 => 254843)
--- trunk/Source/_javascript_Core/disassembler/ARM64Disassembler.cpp 2020-01-21 03:48:17 UTC (rev 254842)
+++ trunk/Source/_javascript_Core/disassembler/ARM64Disassembler.cpp 2020-01-21 04:01:50 UTC (rev 254843)
@@ -26,7 +26,7 @@
#include "config.h"
#include "Disassembler.h"
-#if USE(ARM64_DISASSEMBLER)
+#if ENABLE(ARM64_DISASSEMBLER)
#include "A64DOpcode.h"
#include "MacroAssemblerCodeRef.h"
@@ -53,5 +53,5 @@
} // namespace JSC
-#endif // USE(ARM64_DISASSEMBLER)
+#endif // ENABLE(ARM64_DISASSEMBLER)
Modified: trunk/Source/_javascript_Core/disassembler/UDis86Disassembler.cpp (254842 => 254843)
--- trunk/Source/_javascript_Core/disassembler/UDis86Disassembler.cpp 2020-01-21 03:48:17 UTC (rev 254842)
+++ trunk/Source/_javascript_Core/disassembler/UDis86Disassembler.cpp 2020-01-21 04:01:50 UTC (rev 254843)
@@ -26,7 +26,7 @@
#include "config.h"
#include "UDis86Disassembler.h"
-#if USE(UDIS86)
+#if ENABLE(UDIS86)
#include "MacroAssemblerCodeRef.h"
#include "udis86.h"
@@ -59,5 +59,5 @@
} // namespace JSC
-#endif // USE(UDIS86)
+#endif // ENABLE(UDIS86)
Modified: trunk/Source/_javascript_Core/disassembler/UDis86Disassembler.h (254842 => 254843)
--- trunk/Source/_javascript_Core/disassembler/UDis86Disassembler.h 2020-01-21 03:48:17 UTC (rev 254842)
+++ trunk/Source/_javascript_Core/disassembler/UDis86Disassembler.h 2020-01-21 04:01:50 UTC (rev 254843)
@@ -29,14 +29,14 @@
namespace JSC {
-#if USE(UDIS86)
+#if ENABLE(UDIS86)
bool tryToDisassembleWithUDis86(const MacroAssemblerCodePtr<DisassemblyPtrTag>&, size_t, const char* prefix, PrintStream& out);
-#else // USE(UDIS86)
+#else // ENABLE(UDIS86)
inline bool tryToDisassembleWithUDis86(const MacroAssemblerCodePtr<DisassemblyPtrTag>&, size_t, const char*, PrintStream&) { return false; }
-#endif // USE(UDIS86)
+#endif // ENABLE(UDIS86)
} // namespace JSC
Modified: trunk/Source/_javascript_Core/disassembler/X86Disassembler.cpp (254842 => 254843)
--- trunk/Source/_javascript_Core/disassembler/X86Disassembler.cpp 2020-01-21 03:48:17 UTC (rev 254842)
+++ trunk/Source/_javascript_Core/disassembler/X86Disassembler.cpp 2020-01-21 04:01:50 UTC (rev 254843)
@@ -26,7 +26,7 @@
#include "config.h"
#include "Disassembler.h"
-#if USE(UDIS86)
+#if ENABLE(UDIS86)
#include "MacroAssemblerCodeRef.h"
#include "Options.h"
@@ -41,4 +41,4 @@
} // namespace JSC
-#endif // USE(UDIS86)
+#endif // ENABLE(UDIS86)
Modified: trunk/Source/_javascript_Core/disassembler/udis86/udis86.c (254842 => 254843)
--- trunk/Source/_javascript_Core/disassembler/udis86/udis86.c 2020-01-21 03:48:17 UTC (rev 254842)
+++ trunk/Source/_javascript_Core/disassembler/udis86/udis86.c 2020-01-21 04:01:50 UTC (rev 254843)
@@ -26,7 +26,7 @@
#include "config.h"
-#if USE(UDIS86)
+#if ENABLE(UDIS86)
#include "udis86_udint.h"
#include "udis86_extern.h"
@@ -457,6 +457,6 @@
return u->inp_end;
}
-#endif // USE(UDIS86)
+#endif // ENABLE(UDIS86)
/* vim:set ts=2 sw=2 expandtab */
Modified: trunk/Source/_javascript_Core/disassembler/udis86/udis86_decode.c (254842 => 254843)
--- trunk/Source/_javascript_Core/disassembler/udis86/udis86_decode.c 2020-01-21 03:48:17 UTC (rev 254842)
+++ trunk/Source/_javascript_Core/disassembler/udis86/udis86_decode.c 2020-01-21 04:01:50 UTC (rev 254843)
@@ -26,7 +26,7 @@
#include "config.h"
-#if USE(UDIS86)
+#if ENABLE(UDIS86)
#include "udis86_udint.h"
#include "udis86_types.h"
@@ -1266,7 +1266,7 @@
return u->inp_ctr;
}
-#endif // USE(UDIS86)
+#endif // ENABLE(UDIS86)
/*
vim: set ts=2 sw=2 expandtab
Modified: trunk/Source/_javascript_Core/disassembler/udis86/udis86_itab_holder.c (254842 => 254843)
--- trunk/Source/_javascript_Core/disassembler/udis86/udis86_itab_holder.c 2020-01-21 03:48:17 UTC (rev 254842)
+++ trunk/Source/_javascript_Core/disassembler/udis86/udis86_itab_holder.c 2020-01-21 04:01:50 UTC (rev 254843)
@@ -25,7 +25,7 @@
#include "config.h"
-#if USE(UDIS86)
+#if ENABLE(UDIS86)
#include "udis86_itab.c"
Modified: trunk/Source/_javascript_Core/disassembler/udis86/udis86_syn-att.c (254842 => 254843)
--- trunk/Source/_javascript_Core/disassembler/udis86/udis86_syn-att.c 2020-01-21 03:48:17 UTC (rev 254842)
+++ trunk/Source/_javascript_Core/disassembler/udis86/udis86_syn-att.c 2020-01-21 04:01:50 UTC (rev 254843)
@@ -26,7 +26,7 @@
#include "config.h"
-#if USE(UDIS86)
+#if ENABLE(UDIS86)
#include "udis86_types.h"
#include "udis86_extern.h"
@@ -228,7 +228,7 @@
}
}
-#endif // USE(UDIS86)
+#endif // ENABLE(UDIS86)
/*
vim: set ts=2 sw=2 expandtab
Modified: trunk/Source/_javascript_Core/disassembler/udis86/udis86_syn-intel.c (254842 => 254843)
--- trunk/Source/_javascript_Core/disassembler/udis86/udis86_syn-intel.c 2020-01-21 03:48:17 UTC (rev 254842)
+++ trunk/Source/_javascript_Core/disassembler/udis86/udis86_syn-intel.c 2020-01-21 04:01:50 UTC (rev 254843)
@@ -26,7 +26,7 @@
#include "config.h"
-#if USE(UDIS86)
+#if ENABLE(UDIS86)
#include "udis86_types.h"
#include "udis86_extern.h"
@@ -224,7 +224,7 @@
}
}
-#endif // USE(UDIS86)
+#endif // ENABLE(UDIS86)
/*
vim: set ts=2 sw=2 expandtab
Modified: trunk/Source/_javascript_Core/disassembler/udis86/udis86_syn.c (254842 => 254843)
--- trunk/Source/_javascript_Core/disassembler/udis86/udis86_syn.c 2020-01-21 03:48:17 UTC (rev 254842)
+++ trunk/Source/_javascript_Core/disassembler/udis86/udis86_syn.c 2020-01-21 04:01:50 UTC (rev 254843)
@@ -26,7 +26,7 @@
#include "config.h"
-#if USE(UDIS86)
+#if ENABLE(UDIS86)
#include "udis86_types.h"
#include "udis86_decode.h"
@@ -212,7 +212,7 @@
}
}
-#endif // USE(UDIS86)
+#endif // ENABLE(UDIS86)
/*
vim: set ts=2 sw=2 expandtab
Modified: trunk/Source/_javascript_Core/interpreter/Interpreter.cpp (254842 => 254843)
--- trunk/Source/_javascript_Core/interpreter/Interpreter.cpp 2020-01-21 03:48:17 UTC (rev 254842)
+++ trunk/Source/_javascript_Core/interpreter/Interpreter.cpp 2020-01-21 04:01:50 UTC (rev 254843)
@@ -353,7 +353,7 @@
}
#if ENABLE(COMPUTED_GOTO_OPCODES)
-#if !USE(LLINT_EMBEDDED_OPCODE_ID) || ASSERT_ENABLED
+#if !ENABLE(LLINT_EMBEDDED_OPCODE_ID) || ASSERT_ENABLED
HashMap<Opcode, OpcodeID>& Interpreter::opcodeIDTable()
{
static NeverDestroyed<HashMap<Opcode, OpcodeID>> opcodeIDTable;
@@ -367,7 +367,7 @@
return opcodeIDTable;
}
-#endif // !USE(LLINT_EMBEDDED_OPCODE_ID) || ASSERT_ENABLED
+#endif // !ENABLE(LLINT_EMBEDDED_OPCODE_ID) || ASSERT_ENABLED
#endif // ENABLE(COMPUTED_GOTO_OPCODES)
#if ASSERT_ENABLED
Modified: trunk/Source/_javascript_Core/interpreter/Interpreter.h (254842 => 254843)
--- trunk/Source/_javascript_Core/interpreter/Interpreter.h 2020-01-21 03:48:17 UTC (rev 254842)
+++ trunk/Source/_javascript_Core/interpreter/Interpreter.h 2020-01-21 04:01:50 UTC (rev 254843)
@@ -144,9 +144,9 @@
#endif
#if ENABLE(COMPUTED_GOTO_OPCODES)
-#if !USE(LLINT_EMBEDDED_OPCODE_ID) || ASSERT_ENABLED
+#if !ENABLE(LLINT_EMBEDDED_OPCODE_ID) || ASSERT_ENABLED
static HashMap<Opcode, OpcodeID>& opcodeIDTable(); // Maps Opcode => OpcodeID.
-#endif // !USE(LLINT_EMBEDDED_OPCODE_ID) || ASSERT_ENABLED
+#endif // !ENABLE(LLINT_EMBEDDED_OPCODE_ID) || ASSERT_ENABLED
#endif // ENABLE(COMPUTED_GOTO_OPCODES)
};
Modified: trunk/Source/_javascript_Core/interpreter/InterpreterInlines.h (254842 => 254843)
--- trunk/Source/_javascript_Core/interpreter/InterpreterInlines.h 2020-01-21 03:48:17 UTC (rev 254842)
+++ trunk/Source/_javascript_Core/interpreter/InterpreterInlines.h 2020-01-21 04:01:50 UTC (rev 254843)
@@ -46,7 +46,7 @@
{
#if ENABLE(COMPUTED_GOTO_OPCODES)
ASSERT(isOpcode(opcode));
-#if USE(LLINT_EMBEDDED_OPCODE_ID)
+#if ENABLE(LLINT_EMBEDDED_OPCODE_ID)
// The OpcodeID is embedded in the int32_t word preceding the location of
// the LLInt code for the opcode (see the EMBED_OPCODE_ID_IF_NEEDED macro
// in LowLevelInterpreter.cpp).
@@ -57,7 +57,7 @@
return opcodeID;
#else
return opcodeIDTable().get(opcode);
-#endif // USE(LLINT_EMBEDDED_OPCODE_ID)
+#endif // ENABLE(LLINT_EMBEDDED_OPCODE_ID)
#else // not ENABLE(COMPUTED_GOTO_OPCODES)
return opcode;
Modified: trunk/Source/_javascript_Core/jit/ExecutableAllocator.h (254842 => 254843)
--- trunk/Source/_javascript_Core/jit/ExecutableAllocator.h 2020-01-21 03:48:17 UTC (rev 254842)
+++ trunk/Source/_javascript_Core/jit/ExecutableAllocator.h 2020-01-21 04:01:50 UTC (rev 254843)
@@ -37,11 +37,8 @@
#include <wtf/MetaAllocatorHandle.h>
#include <wtf/MetaAllocator.h>
-#if OS(IOS_FAMILY)
+#if OS(DARWIN)
#include <libkern/OSCacheControl.h>
-#endif
-
-#if OS(IOS_FAMILY)
#include <sys/mman.h>
#endif
Modified: trunk/Source/_javascript_Core/jit/ThunkGenerators.cpp (254842 => 254843)
--- trunk/Source/_javascript_Core/jit/ThunkGenerators.cpp 2020-01-21 03:48:17 UTC (rev 254842)
+++ trunk/Source/_javascript_Core/jit/ThunkGenerators.cpp 2020-01-21 04:01:50 UTC (rev 254843)
@@ -796,7 +796,7 @@
} \
static MathThunk UnaryDoubleOpWrapper(function) = &function##Thunk;
-#elif CPU(ARM_THUMB2) && COMPILER(GCC_COMPATIBLE) && PLATFORM(IOS_FAMILY)
+#elif CPU(ARM_THUMB2) && COMPILER(GCC_COMPATIBLE) && OS(DARWIN)
#define defineUnaryDoubleOpWrapper(function) \
asm( \
Modified: trunk/Source/_javascript_Core/jsc.cpp (254842 => 254843)
--- trunk/Source/_javascript_Core/jsc.cpp 2020-01-21 03:48:17 UTC (rev 254842)
+++ trunk/Source/_javascript_Core/jsc.cpp 2020-01-21 04:01:50 UTC (rev 254843)
@@ -135,7 +135,7 @@
#include <windows.h>
#endif
-#if PLATFORM(IOS_FAMILY) && CPU(ARM_THUMB2)
+#if OS(DARWIN) && CPU(ARM_THUMB2)
#include <fenv.h>
#include <arm/arch.h>
#endif
@@ -2484,7 +2484,7 @@
int main(int argc, char** argv)
{
-#if PLATFORM(IOS_FAMILY) && CPU(ARM_THUMB2)
+#if OS(DARWIN) && CPU(ARM_THUMB2)
// Enabled IEEE754 denormal support.
fenv_t env;
fegetenv( &env );
Modified: trunk/Source/_javascript_Core/llint/LowLevelInterpreter.cpp (254842 => 254843)
--- trunk/Source/_javascript_Core/llint/LowLevelInterpreter.cpp 2020-01-21 03:48:17 UTC (rev 254842)
+++ trunk/Source/_javascript_Core/llint/LowLevelInterpreter.cpp 2020-01-21 04:01:50 UTC (rev 254843)
@@ -505,7 +505,7 @@
#define OFFLINE_ASM_BEGIN asm (
#define OFFLINE_ASM_END );
-#if USE(LLINT_EMBEDDED_OPCODE_ID)
+#if ENABLE(LLINT_EMBEDDED_OPCODE_ID)
#define EMBED_OPCODE_ID_IF_NEEDED(__opcode) ".int " __opcode##_value_string "\n"
#else
#define EMBED_OPCODE_ID_IF_NEEDED(__opcode)
Modified: trunk/Source/_javascript_Core/runtime/JSString.h (254842 => 254843)
--- trunk/Source/_javascript_Core/runtime/JSString.h 2020-01-21 03:48:17 UTC (rev 254842)
+++ trunk/Source/_javascript_Core/runtime/JSString.h 2020-01-21 04:01:50 UTC (rev 254843)
@@ -276,7 +276,7 @@
static_assert(sizeof(uintptr_t) == sizeof(uint64_t), "");
class CompactFibers {
public:
- static constexpr uintptr_t addressMask = (1ULL << WTF_CPU_EFFECTIVE_ADDRESS_WIDTH) - 1;
+ static constexpr uintptr_t addressMask = (1ULL << OS_CONSTANT(EFFECTIVE_ADDRESS_WIDTH)) - 1;
JSString* fiber1() const
{
#if CPU(LITTLE_ENDIAN)
Modified: trunk/Source/_javascript_Core/runtime/MathCommon.cpp (254842 => 254843)
--- trunk/Source/_javascript_Core/runtime/MathCommon.cpp 2020-01-21 03:48:17 UTC (rev 254842)
+++ trunk/Source/_javascript_Core/runtime/MathCommon.cpp 2020-01-21 04:01:50 UTC (rev 254843)
@@ -30,7 +30,7 @@
namespace JSC {
-#if PLATFORM(IOS_FAMILY) && CPU(ARM_THUMB2)
+#if OS(DARWIN) && CPU(ARM_THUMB2)
// The following code is taken from netlib.org:
// http://www.netlib.org/fdlibm/fdlibm.h
Modified: trunk/Source/_javascript_Core/tools/SigillCrashAnalyzer.cpp (254842 => 254843)
--- trunk/Source/_javascript_Core/tools/SigillCrashAnalyzer.cpp 2020-01-21 03:48:17 UTC (rev 254842)
+++ trunk/Source/_javascript_Core/tools/SigillCrashAnalyzer.cpp 2020-01-21 04:01:50 UTC (rev 254843)
@@ -33,7 +33,7 @@
#include <mutex>
#include <wtf/StdLibExtras.h>
-#if USE(ARM64_DISASSEMBLER)
+#if ENABLE(ARM64_DISASSEMBLER)
#include "A64DOpcode.h"
#endif
@@ -60,7 +60,7 @@
SigillCrashAnalyzer() { }
void dumpCodeBlock(CodeBlock*, void* machinePC);
-#if USE(ARM64_DISASSEMBLER)
+#if ENABLE(ARM64_DISASSEMBLER)
A64DOpcode m_arm64Opcode;
#endif
};
Modified: trunk/Source/WTF/ChangeLog (254842 => 254843)
--- trunk/Source/WTF/ChangeLog 2020-01-21 03:48:17 UTC (rev 254842)
+++ trunk/Source/WTF/ChangeLog 2020-01-21 04:01:50 UTC (rev 254843)
@@ -1,3 +1,32 @@
+2020-01-17 Sam Weinig <[email protected]>
+
+ Platform.h is out of control Part 8: Macros are used inconsistently
+ https://bugs.webkit.org/show_bug.cgi?id=206425
+
+ Reviewed by Darin Adler.
+
+ Start addressing FIXMEs added to Platform.h (and helper files) during previous
+ cleanup work.
+
+ - Renames WTF_CPU_EFFECTIVE_ADDRESS_WIDTH to WTF_OS_CONSTANT_EFFECTIVE_ADDRESS_WIDTH,
+ making it available via new macro OS_CONSTANT(...), and syncs bmalloc redefinition.
+ - Renames:
+ USE_LLINT_EMBEDDED_OPCODE_ID to ENABLE_LLINT_EMBEDDED_OPCODE_ID
+ USE_UDIS86 to ENABLE_UDIS86
+ USE_ARM64_DISASSEMBLER to ENABLE_ARM64_DISASSEMBLER
+ Enable is more appropriate here as these enable functionality within webkit.
+ - Removes undefs that are no longer needed due to only defining the macro once now.
+ - Removes dead defined(__LP64__) check after PLATFORM(MAC) macOS is always 64-bit these
+ days.
+
+ * wtf/Packed.h:
+ (WTF::alignof):
+ * wtf/Platform.h:
+ * wtf/PlatformEnable.h:
+ * wtf/PlatformOS.h:
+ * wtf/WTFAssertions.cpp:
+ * wtf/text/StringCommon.h:
+
2020-01-20 David Kilzer <[email protected]>
Fix missing header guards and clean up empty files in bmalloc, WTF, _javascript_Core
Modified: trunk/Source/WTF/wtf/Packed.h (254842 => 254843)
--- trunk/Source/WTF/wtf/Packed.h 2020-01-21 03:48:17 UTC (rev 254842)
+++ trunk/Source/WTF/wtf/Packed.h 2020-01-21 04:01:50 UTC (rev 254843)
@@ -107,8 +107,8 @@
static_assert(hasOneBitSet(alignment), "Alignment needs to be power-of-two");
static constexpr bool isPackedType = true;
static constexpr unsigned alignmentShiftSizeIfProfitable = getLSBSetConstexpr(alignment);
- static constexpr unsigned storageSizeWithoutAlignmentShift = roundUpToMultipleOf<8>(WTF_CPU_EFFECTIVE_ADDRESS_WIDTH) / 8;
- static constexpr unsigned storageSizeWithAlignmentShift = roundUpToMultipleOf<8>(WTF_CPU_EFFECTIVE_ADDRESS_WIDTH - alignmentShiftSizeIfProfitable) / 8;
+ static constexpr unsigned storageSizeWithoutAlignmentShift = roundUpToMultipleOf<8>(OS_CONSTANT(EFFECTIVE_ADDRESS_WIDTH)) / 8;
+ static constexpr unsigned storageSizeWithAlignmentShift = roundUpToMultipleOf<8>(OS_CONSTANT(EFFECTIVE_ADDRESS_WIDTH) - alignmentShiftSizeIfProfitable) / 8;
static constexpr bool isAlignmentShiftProfitable = storageSizeWithoutAlignmentShift > storageSizeWithAlignmentShift;
static constexpr unsigned alignmentShiftSize = isAlignmentShiftProfitable ? alignmentShiftSizeIfProfitable : 0;
static constexpr unsigned storageSize = storageSizeWithAlignmentShift;
Modified: trunk/Source/WTF/wtf/Platform.h (254842 => 254843)
--- trunk/Source/WTF/wtf/Platform.h 2020-01-21 03:48:17 UTC (rev 254842)
+++ trunk/Source/WTF/wtf/Platform.h 2020-01-21 04:01:50 UTC (rev 254843)
@@ -82,19 +82,6 @@
belong as part of Platform.h at all. */
-
-/* FIXME: Rename WTF_CPU_EFFECTIVE_ADDRESS_WIDTH to WTF_OS_EFFECTIVE_ADDRESS_WIDTH, as it is an OS feature, not a CPU feature. */
-#if CPU(ADDRESS64)
-#if (OS(IOS) || OS(TVOS) || OS(WATCHOS)) && CPU(ARM64)
-#define WTF_CPU_EFFECTIVE_ADDRESS_WIDTH 36
-#else
-/* We strongly assume that effective address width is <= 48 in 64bit architectures (e.g. NaN boxing). */
-#define WTF_CPU_EFFECTIVE_ADDRESS_WIDTH 48
-#endif
-#else
-#define WTF_CPU_EFFECTIVE_ADDRESS_WIDTH 32
-#endif
-
#if PLATFORM(GTK)
#define GLIB_VERSION_MIN_REQUIRED GLIB_VERSION_2_36
#define GDK_VERSION_MIN_REQUIRED GDK_VERSION_3_6
@@ -151,17 +138,7 @@
#define USE_LIBWEBRTC 1
#endif
-/* FIXME: This is used to "turn on a specific feature of WebKit", so should be converted to an ENABLE macro. */
-/* This feature works by embedding the OpcodeID in the 32 bit just before the generated LLint code
- that executes each opcode. It cannot be supported by the CLoop since there's no way to embed the
- OpcodeID word in the CLoop's switch statement cases. It is also currently not implemented for MSVC.
-*/
-#if !defined(USE_LLINT_EMBEDDED_OPCODE_ID) && !ENABLE(C_LOOP) && !COMPILER(MSVC) && \
- (CPU(X86) || CPU(X86_64) || CPU(ARM64) || (CPU(ARM_THUMB2) && OS(DARWIN)))
-#define USE_LLINT_EMBEDDED_OPCODE_ID 1
-#endif
-
#if PLATFORM(COCOA)
#if ENABLE(WEBGL)
Modified: trunk/Source/WTF/wtf/PlatformEnable.h (254842 => 254843)
--- trunk/Source/WTF/wtf/PlatformEnable.h 2020-01-21 03:48:17 UTC (rev 254842)
+++ trunk/Source/WTF/wtf/PlatformEnable.h 2020-01-21 04:01:50 UTC (rev 254843)
@@ -619,10 +619,6 @@
#define ENABLE_OFFSCREEN_CANVAS 0
#endif
-#if !defined(ENABLE_OPENTYPE_VERTICAL)
-#define ENABLE_OPENTYPE_VERTICAL 0
-#endif
-
#if !defined(ENABLE_ORIENTATION_EVENTS)
#define ENABLE_ORIENTATION_EVENTS 0
#endif
@@ -740,7 +736,7 @@
/* JIT Features */
/* The JIT is enabled by default on all x86-64 & ARM64 platforms. */
-#if !defined(ENABLE_JIT) && (CPU(X86_64) || CPU(ARM64)) && !CPU(APPLE_ARMV7K)
+#if !defined(ENABLE_JIT) && (CPU(X86_64) || CPU(ARM64)) && !CPU(APPLE_ARMV7K)
#define ENABLE_JIT 1
#endif
@@ -781,20 +777,18 @@
#define ENABLE_FTL_JIT 0
#endif
-/* FIXME: This is used to "turn on a specific feature of WebKit", so should be converted to an ENABLE macro. */
/* If possible, try to enable a disassembler. This is optional. We proceed in two
steps: first we try to find some disassembler that we can use, and then we
decide if the high-level disassembler API can be enabled. */
-#if !defined(USE_UDIS86) && ENABLE(JIT) && CPU(X86_64) && !USE(CAPSTONE)
-#define USE_UDIS86 1
+#if !defined(ENABLE_UDIS86) && ENABLE(JIT) && CPU(X86_64) && !USE(CAPSTONE)
+#define ENABLE_UDIS86 1
#endif
-/* FIXME: This is used to "turn on a specific feature of WebKit", so should be converted to an ENABLE macro. */
-#if !defined(USE_ARM64_DISASSEMBLER) && ENABLE(JIT) && CPU(ARM64) && !USE(CAPSTONE)
-#define USE_ARM64_DISASSEMBLER 1
+#if !defined(ENABLE_ARM64_DISASSEMBLER) && ENABLE(JIT) && CPU(ARM64) && !USE(CAPSTONE)
+#define ENABLE_ARM64_DISASSEMBLER 1
#endif
-#if !defined(ENABLE_DISASSEMBLER) && (USE(UDIS86) || USE(ARM64_DISASSEMBLER) || (ENABLE(JIT) && USE(CAPSTONE)))
+#if !defined(ENABLE_DISASSEMBLER) && (ENABLE(UDIS86) || ENABLE(ARM64_DISASSEMBLER) || (ENABLE(JIT) && USE(CAPSTONE)))
#define ENABLE_DISASSEMBLER 1
#endif
@@ -806,9 +800,10 @@
#endif
/* Enable the DFG JIT on ARMv7. Only tested on iOS, Linux, and FreeBSD. */
-#if (CPU(ARM_THUMB2) || CPU(ARM64)) && (PLATFORM(IOS_FAMILY) || OS(LINUX) || OS(FREEBSD))
+#if (CPU(ARM_THUMB2) || CPU(ARM64)) && (OS(DARWIN) || OS(LINUX) || OS(FREEBSD))
#define ENABLE_DFG_JIT 1
#endif
+
/* Enable the DFG JIT on MIPS. */
#if CPU(MIPS)
#define ENABLE_DFG_JIT 1
@@ -956,7 +951,7 @@
#endif
/* CSS Selector JIT Compiler */
-#if !defined(ENABLE_CSS_SELECTOR_JIT) && ((CPU(X86_64) || CPU(ARM64) || (CPU(ARM_THUMB2) && PLATFORM(IOS_FAMILY))) && ENABLE(JIT) && (OS(DARWIN) || PLATFORM(GTK) || PLATFORM(WPE)))
+#if !defined(ENABLE_CSS_SELECTOR_JIT) && ((CPU(X86_64) || CPU(ARM64) || (CPU(ARM_THUMB2) && OS(DARWIN))) && ENABLE(JIT) && (OS(DARWIN) || PLATFORM(GTK) || PLATFORM(WPE)))
#define ENABLE_CSS_SELECTOR_JIT 1
#endif
@@ -992,15 +987,11 @@
#define ENABLE_RESOURCE_USAGE 1
#endif
-/* FIXME: Document or remove explicit undef. */
-#if PLATFORM(GTK) || PLATFORM(WPE)
-#undef ENABLE_OPENTYPE_VERTICAL
+#if !defined(ENABLE_OPENTYPE_VERTICAL) && PLATFORM(GTK) || PLATFORM(WPE)
#define ENABLE_OPENTYPE_VERTICAL 1
#endif
-/* FIXME: Document or remove explicit undef. */
-#if (OS(DARWIN) && USE(CG)) || (USE(FREETYPE) && !PLATFORM(GTK)) || (PLATFORM(WIN) && (USE(CG) || USE(CAIRO)))
-#undef ENABLE_OPENTYPE_MATH
+#if !defined(ENABLE_OPENTYPE_MATH) && (OS(DARWIN) && USE(CG)) || (USE(FREETYPE) && !PLATFORM(GTK)) || (PLATFORM(WIN) && (USE(CG) || USE(CAIRO)))
#define ENABLE_OPENTYPE_MATH 1
#endif
@@ -1015,8 +1006,7 @@
/* Disable SharedArrayBuffers until Spectre security concerns are mitigated. */
#define ENABLE_SHARED_ARRAY_BUFFER 0
-/* FIXME: __LP64__ can probably be removed now that 32-bit macOS is no longer supported. */
-#if PLATFORM(MAC) && defined(__LP64__)
+#if PLATFORM(MAC)
#define ENABLE_WEB_PLAYBACK_CONTROLS_MANAGER 1
#endif
@@ -1042,7 +1032,15 @@
#define ENABLE_PLATFORM_DRIVEN_TEXT_CHECKING 1
#endif
+/* This feature works by embedding the OpcodeID in the 32 bit just before the generated LLint code
+ that executes each opcode. It cannot be supported by the CLoop since there's no way to embed the
+ OpcodeID word in the CLoop's switch statement cases. It is also currently not implemented for MSVC.
+*/
+#if !defined(ENABLE_LLINT_EMBEDDED_OPCODE_ID) && !ENABLE(C_LOOP) && !COMPILER(MSVC) && (CPU(X86) || CPU(X86_64) || CPU(ARM64) || (CPU(ARM_THUMB2) && OS(DARWIN)))
+#define ENABLE_LLINT_EMBEDDED_OPCODE_ID 1
+#endif
+
/* Asserts, invariants for macro definitions */
#if ENABLE(VIDEO_TRACK) && !ENABLE(VIDEO)
Modified: trunk/Source/WTF/wtf/PlatformOS.h (254842 => 254843)
--- trunk/Source/WTF/wtf/PlatformOS.h 2020-01-21 03:48:17 UTC (rev 254842)
+++ trunk/Source/WTF/wtf/PlatformOS.h 2020-01-21 04:01:50 UTC (rev 254843)
@@ -41,7 +41,8 @@
/* OS() - underlying operating system; only to be used for mandated low-level services like
virtual memory, not to choose a GUI toolkit */
-#define OS(WTF_FEATURE) (defined WTF_OS_##WTF_FEATURE && WTF_OS_##WTF_FEATURE)
+#define OS(WTF_FEATURE) (defined WTF_OS_##WTF_FEATURE && WTF_OS_##WTF_FEATURE)
+#define OS_CONSTANT(WTF_FEATURE) (WTF_OS_CONSTANT_##WTF_FEATURE)
/* ==== OS() - underlying operating system; only to be used for mandated low-level services like
@@ -135,6 +136,18 @@
#endif
+#if CPU(ADDRESS64)
+#if (OS(IOS) || OS(TVOS) || OS(WATCHOS)) && CPU(ARM64)
+#define WTF_OS_CONSTANT_EFFECTIVE_ADDRESS_WIDTH 36
+#else
+/* We strongly assume that effective address width is <= 48 in 64bit architectures (e.g. NaN boxing). */
+#define WTF_OS_CONSTANT_EFFECTIVE_ADDRESS_WIDTH 48
+#endif
+#else
+#define WTF_OS_CONSTANT_EFFECTIVE_ADDRESS_WIDTH 32
+#endif
+
+
/* Asserts, invariants for macro definitions */
#define WTF_OS_WIN ERROR "USE WINDOWS WITH OS NOT WIN"
Modified: trunk/Source/WTF/wtf/WTFAssertions.cpp (254842 => 254843)
--- trunk/Source/WTF/wtf/WTFAssertions.cpp 2020-01-21 03:48:17 UTC (rev 254842)
+++ trunk/Source/WTF/wtf/WTFAssertions.cpp 2020-01-21 04:01:50 UTC (rev 254843)
@@ -50,8 +50,8 @@
static_assert(sizeof(RefCountedArray<DummyStruct>) == sizeof(void*), "");
#if OS(DARWIN) && CPU(ADDRESS64)
-static_assert(MACH_VM_MAX_ADDRESS <= ((1ULL << WTF_CPU_EFFECTIVE_ADDRESS_WIDTH) - 1));
+static_assert(MACH_VM_MAX_ADDRESS <= ((1ULL << OS_CONSTANT(EFFECTIVE_ADDRESS_WIDTH)) - 1));
#endif
-
+
} // namespace WTF
Modified: trunk/Source/WTF/wtf/text/StringCommon.h (254842 => 254843)
--- trunk/Source/WTF/wtf/text/StringCommon.h 2020-01-21 03:48:17 UTC (rev 254842)
+++ trunk/Source/WTF/wtf/text/StringCommon.h 2020-01-21 04:01:50 UTC (rev 254843)
@@ -172,7 +172,7 @@
return true;
}
-#elif PLATFORM(IOS_FAMILY) && WTF_ARM_ARCH_AT_LEAST(7) && !ASAN_ENABLED
+#elif OS(DARWIN) && WTF_ARM_ARCH_AT_LEAST(7) && !ASAN_ENABLED
ALWAYS_INLINE bool equal(const LChar* a, const LChar* b, unsigned length)
{
bool isEqual = false;
Modified: trunk/Source/bmalloc/ChangeLog (254842 => 254843)
--- trunk/Source/bmalloc/ChangeLog 2020-01-21 03:48:17 UTC (rev 254842)
+++ trunk/Source/bmalloc/ChangeLog 2020-01-21 04:01:50 UTC (rev 254843)
@@ -1,3 +1,13 @@
+2020-01-17 Sam Weinig <[email protected]>
+
+ Platform.h is out of control Part 8: Macros are used inconsistently
+ https://bugs.webkit.org/show_bug.cgi?id=206425
+
+ Reviewed by Darin Adler.
+
+ * bmalloc/BPlatform.h:
+ Update OS_EFFECTIVE_ADDRESS_WIDTH to match WTF definition, add needed OS macros.
+
2020-01-20 David Kilzer <[email protected]>
Fix missing header guards and clean up empty files in bmalloc, WTF, _javascript_Core
Modified: trunk/Source/bmalloc/bmalloc/BPlatform.h (254842 => 254843)
--- trunk/Source/bmalloc/bmalloc/BPlatform.h 2020-01-21 03:48:17 UTC (rev 254842)
+++ trunk/Source/bmalloc/bmalloc/BPlatform.h 2020-01-21 04:01:50 UTC (rev 254843)
@@ -58,6 +58,7 @@
#if BOS(DARWIN) && !defined(BUILDING_WITH_CMAKE)
#if TARGET_OS_IOS
+#define BOS_IOS 1
#define BPLATFORM_IOS 1
#if TARGET_OS_SIMULATOR
#define BPLATFORM_IOS_SIMULATOR 1
@@ -69,6 +70,7 @@
#define BPLATFORM_IOS_FAMILY_SIMULATOR 1
#endif
#elif TARGET_OS_MAC
+#define BOS_MAC 1
#define BPLATFORM_MAC 1
#endif
#endif
@@ -78,10 +80,12 @@
#endif
#if defined(TARGET_OS_WATCH) && TARGET_OS_WATCH
+#define BOS_WATCHOS 1
#define BPLATFORM_WATCHOS 1
#endif
#if defined(TARGET_OS_TV) && TARGET_OS_TV
+#define BOS_APPLETV 1
#define BPLATFORM_APPLETV 1
#endif
@@ -259,7 +263,7 @@
#endif
#if BCPU(ADDRESS64)
-#if BOS(DARWIN) && BCPU(ARM64)
+#if (BOS(IOS) || BOS(TVOS) || BOS(WATCHOS)) && BCPU(ARM64)
#define BOS_EFFECTIVE_ADDRESS_WIDTH 36
#else
/* We strongly assume that effective address width is <= 48 in 64bit architectures (e.g. NaN boxing). */
Modified: trunk/Tools/ChangeLog (254842 => 254843)
--- trunk/Tools/ChangeLog 2020-01-21 03:48:17 UTC (rev 254842)
+++ trunk/Tools/ChangeLog 2020-01-21 04:01:50 UTC (rev 254843)
@@ -1,3 +1,14 @@
+2020-01-20 Sam Weinig <[email protected]>
+
+ Platform.h is out of control Part 8: Macros are used inconsistently
+ https://bugs.webkit.org/show_bug.cgi?id=206425
+
+ Reviewed by Darin Adler.
+
+ * TestWebKitAPI/Tests/WTF/Packed.cpp:
+ (TestWebKitAPI::TEST):
+ Update to use OS_CONSTANT.
+
2020-01-20 Saam Barati <[email protected]>
REGRESSION(r254788): mozilla-tests.yaml/js1_5/Regress/regress-191633.js.mozilla fails
Modified: trunk/Tools/TestWebKitAPI/Tests/WTF/Packed.cpp (254842 => 254843)
--- trunk/Tools/TestWebKitAPI/Tests/WTF/Packed.cpp 2020-01-21 03:48:17 UTC (rev 254842)
+++ trunk/Tools/TestWebKitAPI/Tests/WTF/Packed.cpp 2020-01-21 04:01:50 UTC (rev 254843)
@@ -59,8 +59,8 @@
{
{
PackedPtr<uint8_t> key { nullptr };
- static_assert(WTF_CPU_EFFECTIVE_ADDRESS_WIDTH != 64, "");
- uint8_t* max = bitwise_cast<uint8_t*>(static_cast<uintptr_t>(((1ULL) << WTF_CPU_EFFECTIVE_ADDRESS_WIDTH) - 1));
+ static_assert(OS_CONSTANT(EFFECTIVE_ADDRESS_WIDTH) != 64, "");
+ uint8_t* max = bitwise_cast<uint8_t*>(static_cast<uintptr_t>(((1ULL) << OS_CONSTANT(EFFECTIVE_ADDRESS_WIDTH)) - 1));
key = max;
EXPECT_EQ(key.get(), max);
}