Diff
Modified: trunk/Source/WTF/ChangeLog (254727 => 254728)
--- trunk/Source/WTF/ChangeLog 2020-01-17 01:14:40 UTC (rev 254727)
+++ trunk/Source/WTF/ChangeLog 2020-01-17 01:16:43 UTC (rev 254728)
@@ -1,3 +1,28 @@
+2020-01-16 Sam Weinig <[email protected]>
+
+ Platform.h is out of control Part 7: Split calling convention macro definitions out of Platform.h and into a new PlatformCallingConventions.h
+ https://bugs.webkit.org/show_bug.cgi?id=206377
+
+ Reviewed by Anders Carlsson.
+
+ As a another step towards cleaning up Platform.h, split out all the calling convention
+ macros into their own file.
+
+ * WTF.xcodeproj/project.pbxproj:
+ * wtf/CMakeLists.txt:
+ Add new header.
+
+ * wtf/Platform.h:
+ * wtf/PlatformCPU.h:
+ * wtf/PlatformEnable.h:
+ * wtf/PlatformHave.h:
+ * wtf/PlatformLegacy.h:
+ * wtf/PlatformOS.h:
+ * wtf/PlatformUse.h:
+ Unify indirect inclusion guard.
+
+ * wtf/PlatformCallingConventions.h: Copied from Source/WTF/wtf/Platform.h.
+
2020-01-16 Robin Morisset <[email protected]>
Use dataLogIf more regularly
Modified: trunk/Source/WTF/WTF.xcodeproj/project.pbxproj (254727 => 254728)
--- trunk/Source/WTF/WTF.xcodeproj/project.pbxproj 2020-01-17 01:14:40 UTC (rev 254727)
+++ trunk/Source/WTF/WTF.xcodeproj/project.pbxproj 2020-01-17 01:16:43 UTC (rev 254728)
@@ -455,6 +455,7 @@
7CDD7FF7186D291E007433CD /* IteratorAdaptors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IteratorAdaptors.h; sourceTree = "<group>"; };
7CDD7FF9186D2A54007433CD /* IteratorRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IteratorRange.h; sourceTree = "<group>"; };
7CEAE5AC1EA6E10F00DB6890 /* NotFound.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NotFound.h; sourceTree = "<group>"; };
+ 7CEF23EB23D1257900F8B904 /* PlatformCallingConventions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformCallingConventions.h; sourceTree = "<group>"; };
7CFAF3C923D0AF1500D21BDD /* PlatformUse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformUse.h; sourceTree = "<group>"; };
7E29C33D15FFD79B00516D61 /* ObjCRuntimeExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ObjCRuntimeExtras.h; sourceTree = "<group>"; };
8134013615B092FD001FF0B8 /* Base64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Base64.cpp; sourceTree = "<group>"; };
@@ -1126,6 +1127,7 @@
0F824A641B7443A0002E345D /* ParkingLot.cpp */,
0F824A651B7443A0002E345D /* ParkingLot.h */,
A876DBD7151816E500DADB95 /* Platform.h */,
+ 7CEF23EB23D1257900F8B904 /* PlatformCallingConventions.h */,
7C42307223CE2D8A006E54D0 /* PlatformCPU.h */,
7C42307123CE2D8A006E54D0 /* PlatformEnable.h */,
7C3A45D023CFA883007DE3A6 /* PlatformHave.h */,
Modified: trunk/Source/WTF/wtf/CMakeLists.txt (254727 => 254728)
--- trunk/Source/WTF/wtf/CMakeLists.txt 2020-01-17 01:14:40 UTC (rev 254727)
+++ trunk/Source/WTF/wtf/CMakeLists.txt 2020-01-17 01:16:43 UTC (rev 254728)
@@ -170,6 +170,7 @@
ParallelVectorIterator.h
ParkingLot.h
Platform.h
+ PlatformCallingConventions.h
PlatformCPU.h
PlatformEnable.h
PlatformHave.h
Modified: trunk/Source/WTF/wtf/Platform.h (254727 => 254728)
--- trunk/Source/WTF/wtf/Platform.h 2020-01-17 01:14:40 UTC (rev 254727)
+++ trunk/Source/WTF/wtf/Platform.h 2020-01-17 01:16:43 UTC (rev 254728)
@@ -30,9 +30,10 @@
/* Include compiler specific macros */
#include <wtf/Compiler.h>
-/* __PLATFORM_INDIRECT__ ensures that users #include <wtf/Platform.h> rather than one of the helper files files directly. */
-#define __PLATFORM_INDIRECT__
+/* This ensures that users #include <wtf/Platform.h> rather than one of the helper files files directly. */
+#define WTF_PLATFORM_GUARD_AGAINST_INDIRECT_INCLUSION
+
/* ==== Platform adaptation macros: these describe properties of the target environment. ==== */
/* CPU() - the target CPU architecture */
@@ -50,6 +51,7 @@
/* HAVE() - specific system features (headers, functions or similar) that are present or not */
#include <wtf/PlatformHave.h>
+
/* ==== Policy decision macros: these define policy choices for a particular port. ==== */
/* USE() - use a particular third-party library or optional OS service */
@@ -58,8 +60,15 @@
/* ENABLE() - turn on a specific feature of WebKit */
#include <wtf/PlatformEnable.h>
-#undef __PLATFORM_INDIRECT__
+/* ==== Helper macros ==== */
+
+/* Macros for specifing specific calling conventions. */
+#include <wtf/PlatformCallingConventions.h>
+
+
+/* ==== Platform additions: additions to Platform.h from outside the main repository ==== */
+
#if USE(APPLE_INTERNAL_SDK) && __has_include(<WebKitAdditions/AdditionalPlatform.h>)
#include <WebKitAdditions/AdditionalPlatform.h>
#endif
@@ -69,7 +78,9 @@
#endif
+#undef WTF_PLATFORM_GUARD_AGAINST_INDIRECT_INCLUSION
+
/* FIXME: The following are currenly positioned at the bottom of this file as they either
are currently dependent on macros they should not be and need to be refined or do not
belong as part of Platform.h at all. */
@@ -78,7 +89,7 @@
/* 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(DARWIN) && CPU(ARM64)
+#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). */
@@ -207,46 +218,3 @@
#if PLATFORM(COCOA) && ENABLE(ACCESSIBILITY)
#define USE_ACCESSIBILITY_CONTEXT_MENUS 1
#endif
-
-
-/* FIXME: These calling convention macros should move to their own file. They are at the bottom currently because they depend on FeatureDefines.h */
-
-#if CPU(X86) && COMPILER(MSVC)
-#define JSC_HOST_CALL __fastcall
-#elif CPU(X86) && COMPILER(GCC_COMPATIBLE)
-#define JSC_HOST_CALL __attribute__ ((fastcall))
-#else
-#define JSC_HOST_CALL
-#endif
-
-#if CPU(X86) && OS(WINDOWS)
-#define CALLING_CONVENTION_IS_STDCALL 1
-#ifndef CDECL
-#if COMPILER(MSVC)
-#define CDECL __cdecl
-#else
-#define CDECL __attribute__ ((__cdecl))
-#endif
-#endif
-#else
-#define CALLING_CONVENTION_IS_STDCALL 0
-#endif
-
-#if CPU(X86)
-#define WTF_COMPILER_SUPPORTS_FASTCALL_CALLING_CONVENTION 1
-#ifndef FASTCALL
-#if COMPILER(MSVC)
-#define FASTCALL __fastcall
-#else
-#define FASTCALL __attribute__ ((fastcall))
-#endif
-#endif
-#else
-#define WTF_COMPILER_SUPPORTS_FASTCALL_CALLING_CONVENTION 0
-#endif
-
-#if ENABLE(JIT) && CALLING_CONVENTION_IS_STDCALL
-#define JIT_OPERATION CDECL
-#else
-#define JIT_OPERATION
-#endif
Modified: trunk/Source/WTF/wtf/PlatformCPU.h (254727 => 254728)
--- trunk/Source/WTF/wtf/PlatformCPU.h 2020-01-17 01:14:40 UTC (rev 254727)
+++ trunk/Source/WTF/wtf/PlatformCPU.h 2020-01-17 01:16:43 UTC (rev 254728)
@@ -25,8 +25,9 @@
#pragma once
-/* Include compiler specific macros */
-#include <wtf/Compiler.h>
+#ifndef WTF_PLATFORM_GUARD_AGAINST_INDIRECT_INCLUSION
+#error "Please #include <wtf/Platform.h> instead of this file directly."
+#endif
/* CPU() - the target CPU architecture */
#define CPU(WTF_FEATURE) (defined WTF_CPU_##WTF_FEATURE && WTF_CPU_##WTF_FEATURE)
Copied: trunk/Source/WTF/wtf/PlatformCallingConventions.h (from rev 254712, trunk/Source/WTF/wtf/Platform.h) (0 => 254728)
--- trunk/Source/WTF/wtf/PlatformCallingConventions.h (rev 0)
+++ trunk/Source/WTF/wtf/PlatformCallingConventions.h 2020-01-17 01:16:43 UTC (rev 254728)
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2006-2020 Apple Inc. All rights reserved.
+ * Copyright (C) 2007-2009 Torch Mobile, Inc.
+ * Copyright (C) 2010, 2011 Research In Motion Limited. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#ifndef WTF_PLATFORM_GUARD_AGAINST_INDIRECT_INCLUSION
+#error "Please #include <wtf/Platform.h> instead of this file directly."
+#endif
+
+/* Macros for specifing specific calling conventions. */
+
+
+#if CPU(X86) && COMPILER(MSVC)
+#define JSC_HOST_CALL __fastcall
+#elif CPU(X86) && COMPILER(GCC_COMPATIBLE)
+#define JSC_HOST_CALL __attribute__ ((fastcall))
+#else
+#define JSC_HOST_CALL
+#endif
+
+#if CPU(X86) && OS(WINDOWS)
+#define CALLING_CONVENTION_IS_STDCALL 1
+#ifndef CDECL
+#if COMPILER(MSVC)
+#define CDECL __cdecl
+#else
+#define CDECL __attribute__ ((__cdecl))
+#endif
+#endif
+#else
+#define CALLING_CONVENTION_IS_STDCALL 0
+#endif
+
+#if CPU(X86)
+#define WTF_COMPILER_SUPPORTS_FASTCALL_CALLING_CONVENTION 1
+#ifndef FASTCALL
+#if COMPILER(MSVC)
+#define FASTCALL __fastcall
+#else
+#define FASTCALL __attribute__ ((fastcall))
+#endif
+#endif
+#else
+#define WTF_COMPILER_SUPPORTS_FASTCALL_CALLING_CONVENTION 0
+#endif
+
+#if ENABLE(JIT) && CALLING_CONVENTION_IS_STDCALL
+#define JIT_OPERATION CDECL
+#else
+#define JIT_OPERATION
+#endif
Modified: trunk/Source/WTF/wtf/PlatformEnable.h (254727 => 254728)
--- trunk/Source/WTF/wtf/PlatformEnable.h 2020-01-17 01:14:40 UTC (rev 254727)
+++ trunk/Source/WTF/wtf/PlatformEnable.h 2020-01-17 01:16:43 UTC (rev 254728)
@@ -28,10 +28,11 @@
#pragma once
-#ifndef __PLATFORM_INDIRECT__
+#ifndef WTF_PLATFORM_GUARD_AGAINST_INDIRECT_INCLUSION
#error "Please #include <wtf/Platform.h> instead of this file directly."
#endif
+
#define ENABLE(WTF_FEATURE) (defined ENABLE_##WTF_FEATURE && ENABLE_##WTF_FEATURE)
/* Use this file to list _all_ ENABLE() macros. Define the macros to be one of the following values:
Modified: trunk/Source/WTF/wtf/PlatformHave.h (254727 => 254728)
--- trunk/Source/WTF/wtf/PlatformHave.h 2020-01-17 01:14:40 UTC (rev 254727)
+++ trunk/Source/WTF/wtf/PlatformHave.h 2020-01-17 01:16:43 UTC (rev 254728)
@@ -27,6 +27,11 @@
#pragma once
+#ifndef WTF_PLATFORM_GUARD_AGAINST_INDIRECT_INCLUSION
+#error "Please #include <wtf/Platform.h> instead of this file directly."
+#endif
+
+
/* HAVE() - specific system features (headers, functions or similar) that are present or not */
#define HAVE(WTF_FEATURE) (defined HAVE_##WTF_FEATURE && HAVE_##WTF_FEATURE)
Modified: trunk/Source/WTF/wtf/PlatformLegacy.h (254727 => 254728)
--- trunk/Source/WTF/wtf/PlatformLegacy.h 2020-01-17 01:14:40 UTC (rev 254727)
+++ trunk/Source/WTF/wtf/PlatformLegacy.h 2020-01-17 01:16:43 UTC (rev 254728)
@@ -27,6 +27,11 @@
#pragma once
+#ifndef WTF_PLATFORM_GUARD_AGAINST_INDIRECT_INCLUSION
+#error "Please #include <wtf/Platform.h> instead of this file directly."
+#endif
+
+
/* PLATFORM() - handles OS, operating environment, graphics API, and
CPU. This macro will be phased out in favor of platform adaptation
macros, policy decision macros, and top-level port definitions. */
Modified: trunk/Source/WTF/wtf/PlatformOS.h (254727 => 254728)
--- trunk/Source/WTF/wtf/PlatformOS.h 2020-01-17 01:14:40 UTC (rev 254727)
+++ trunk/Source/WTF/wtf/PlatformOS.h 2020-01-17 01:16:43 UTC (rev 254728)
@@ -27,9 +27,11 @@
#pragma once
-/* Include compiler specific macros */
-#include <wtf/Compiler.h>
+#ifndef WTF_PLATFORM_GUARD_AGAINST_INDIRECT_INCLUSION
+#error "Please #include <wtf/Platform.h> instead of this file directly."
+#endif
+
#if defined(__APPLE__)
#include <Availability.h>
#include <AvailabilityMacros.h>
@@ -65,6 +67,16 @@
#define WTF_OS_IOS 1
#endif
+/* OS(TVOS) - tvOS */
+#if OS(DARWIN) && TARGET_OS_TV
+#define WTF_OS_TVOS 1
+#endif
+
+/* OS(WATCHOS) - watchOS */
+#if OS(DARWIN) && TARGET_OS_WATCH
+#define WTF_OS_WATCHOS 1
+#endif
+
/* FIXME: Rename this to drop the X, as that is no longer the name of the operating system. */
/* OS(MAC_OS_X) - macOS (not including iOS family) */
#if OS(DARWIN) && TARGET_OS_OSX
Modified: trunk/Source/WTF/wtf/PlatformUse.h (254727 => 254728)
--- trunk/Source/WTF/wtf/PlatformUse.h 2020-01-17 01:14:40 UTC (rev 254727)
+++ trunk/Source/WTF/wtf/PlatformUse.h 2020-01-17 01:16:43 UTC (rev 254728)
@@ -27,7 +27,7 @@
#pragma once
-#ifndef __PLATFORM_INDIRECT__
+#ifndef WTF_PLATFORM_GUARD_AGAINST_INDIRECT_INCLUSION
#error "Please #include <wtf/Platform.h> instead of this file directly."
#endif