1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
|
From 257ed304fb3e71d412568dcbed7129c145812fdf Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 2 Sep 2024 21:38:12 -0700
Subject: [PATCH] Fix build issues with latest Clang
https://bugs.webkit.org/show_bug.cgi?id=276198 rdar://130933637
Reviewed by Yusuke Suzuki.
The use of the template keyword to reference template members without a template argument list was deprecated in the C++ standard.
e.g. `foo.template bar()` nows needs to be `foo.template bar<>()`. I ran into a different issue with `std::reference_wrapper` that
blocked me from going any further, which AFAICT is a bug on the Clang side.
This also fixes a few other warnings that popped up while building with the new Clang denoted inline
* Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileCompareStrictEq): Clang didn't like the implicit static_cast<int32_t>(UINT32_MAX) so make it explicit with a static_assert no data was lost.
* Source/JavaScriptCore/jit/AssemblyHelpers.cpp:
(JSC::AssemblyHelpers::emitNonNullDecodeZeroExtendedStructureID): Clang didn't like the implicit static_cast<int32_t>(UINT32_MAX) so make it explicit with a static_assert no data was lost.
* Source/JavaScriptCore/llint/InPlaceInterpreter.cpp:
* Source/JavaScriptCore/llint/LLIntData.h:
(JSC::LLInt::getCodeFunctionPtr):
(JSC::LLInt::getWide16CodeFunctionPtr):
(JSC::LLInt::getWide32CodeFunctionPtr):
* Source/JavaScriptCore/parser/Nodes.h: Missing definition of ModuleScopeData added include.
* Source/JavaScriptCore/runtime/JSCast.h:
(JSC::JSCastingHelpers::inherits):
(JSC::jsDynamicCast):
* Source/ThirdParty/libwebrtc/Source/third_party/boringssl/src/crypto/bio/connect.c:
(conn_callback_ctrl): Had a warning about an incompatible function type. Seems like this is intentional suppressed the warning.
* Source/WTF/wtf/cf/TypeCastsCF.h: Had a warning about extra namespace qualification. I just moved it out of the namespace. That said, it feels like this warning shouldn't apply to macro expansions...
* Source/WebCore/PAL/ThirdParty/libavif/ThirdParty/dav1d/src/decode.c:
(decode_b): Had a warning about different types on the middle/right of a ternary expression. I just pushed the comparison inside the ternary.
Canonical link: https://commits.webkit.org/280700@main
Upstream-Status: Backport [https://github.com/WebKit/WebKit/commit/62b6e2db547e#diff-136d848d7c1b400da9b486916b67592b54e5abf7c66ac247697a93ae2fb743a9]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp | 6 ++++--
Source/JavaScriptCore/jit/AssemblyHelpers.cpp | 6 ++++--
.../JavaScriptCore/llint/InPlaceInterpreter.cpp | 16 ++++++++--------
Source/JavaScriptCore/llint/LLIntData.h | 12 ++++++------
Source/JavaScriptCore/llint/LLIntThunks.cpp | 2 +-
Source/JavaScriptCore/parser/Nodes.h | 4 ++--
Source/JavaScriptCore/runtime/JSCast.h | 4 ++--
7 files changed, 27 insertions(+), 23 deletions(-)
--- a/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp
+++ b/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp
@@ -22930,8 +22930,10 @@ IGNORE_CLANG_WARNINGS_END
return m_out.shl(m_out.zeroExtPtr(structureID), m_out.constIntPtr(StructureID::encodeShiftAmount));
#else
LValue maskedStructureID = structureID;
- if constexpr (structureHeapAddressSize < 4 * GB)
- maskedStructureID = m_out.bitAnd(structureID, m_out.constInt32(StructureID::structureIDMask));
+ if constexpr (structureHeapAddressSize < 4 * GB) {
+ static_assert(static_cast<uint32_t>(StructureID::structureIDMask) == StructureID::structureIDMask);
+ maskedStructureID = m_out.bitAnd(structureID, m_out.constInt32(static_cast<uint32_t>(StructureID::structureIDMask)));
+ }
return m_out.bitOr(m_out.constIntPtr(startOfStructureHeap()), m_out.zeroExtPtr(maskedStructureID));
#endif
}
--- a/Source/JavaScriptCore/jit/AssemblyHelpers.cpp
+++ b/Source/JavaScriptCore/jit/AssemblyHelpers.cpp
@@ -677,8 +677,10 @@ void AssemblyHelpers::emitNonNullDecodeZ
if constexpr (structureHeapAddressSize >= 4 * GB) {
ASSERT(structureHeapAddressSize == 4 * GB);
move(source, dest);
- } else
- and32(TrustedImm32(StructureID::structureIDMask), source, dest);
+ } else {
+ static_assert(static_cast<uint32_t>(StructureID::structureIDMask) == StructureID::structureIDMask);
+ and32(TrustedImm32(static_cast<uint32_t>(StructureID::structureIDMask)), source, dest);
+ }
or64(TrustedImm64(startOfStructureHeap()), dest);
#else // not CPU(ADDRESS64)
move(source, dest);
--- a/Source/JavaScriptCore/llint/InPlaceInterpreter.cpp
+++ b/Source/JavaScriptCore/llint/InPlaceInterpreter.cpp
@@ -43,8 +43,8 @@ namespace JSC { namespace IPInt {
do { \
void* base = reinterpret_cast<void*>(ipint_unreachable_validate); \
void* ptr = reinterpret_cast<void*>(ipint_ ## name ## _validate); \
- void* untaggedBase = CodePtr<CFunctionPtrTag>::fromTaggedPtr(base).template untaggedPtr(); \
- void* untaggedPtr = CodePtr<CFunctionPtrTag>::fromTaggedPtr(ptr).template untaggedPtr(); \
+ void* untaggedBase = CodePtr<CFunctionPtrTag>::fromTaggedPtr(base).template untaggedPtr<>(); \
+ void* untaggedPtr = CodePtr<CFunctionPtrTag>::fromTaggedPtr(ptr).template untaggedPtr<>(); \
RELEASE_ASSERT_WITH_MESSAGE((char*)(untaggedPtr) - (char*)(untaggedBase) == opcode * 256, #name); \
} while (false);
@@ -52,8 +52,8 @@ do { \
do { \
void* base = reinterpret_cast<void*>(ipint_i32_trunc_sat_f32_s_validate); \
void* ptr = reinterpret_cast<void*>(ipint_ ## name ## _validate); \
- void* untaggedBase = CodePtr<CFunctionPtrTag>::fromTaggedPtr(base).template untaggedPtr(); \
- void* untaggedPtr = CodePtr<CFunctionPtrTag>::fromTaggedPtr(ptr).template untaggedPtr(); \
+ void* untaggedBase = CodePtr<CFunctionPtrTag>::fromTaggedPtr(base).template untaggedPtr<>(); \
+ void* untaggedPtr = CodePtr<CFunctionPtrTag>::fromTaggedPtr(ptr).template untaggedPtr<>(); \
RELEASE_ASSERT_WITH_MESSAGE((char*)(untaggedPtr) - (char*)(untaggedBase) == opcode * 256, #name); \
} while (false);
@@ -61,8 +61,8 @@ do { \
do { \
void* base = reinterpret_cast<void*>(ipint_simd_v128_load_mem_validate); \
void* ptr = reinterpret_cast<void*>(ipint_ ## name ## _validate); \
- void* untaggedBase = CodePtr<CFunctionPtrTag>::fromTaggedPtr(base).template untaggedPtr(); \
- void* untaggedPtr = CodePtr<CFunctionPtrTag>::fromTaggedPtr(ptr).template untaggedPtr(); \
+ void* untaggedBase = CodePtr<CFunctionPtrTag>::fromTaggedPtr(base).template untaggedPtr<>(); \
+ void* untaggedPtr = CodePtr<CFunctionPtrTag>::fromTaggedPtr(ptr).template untaggedPtr<>(); \
RELEASE_ASSERT_WITH_MESSAGE((char*)(untaggedPtr) - (char*)(untaggedBase) == opcode * 256, #name); \
} while (false);
@@ -70,8 +70,8 @@ do { \
do { \
void* base = reinterpret_cast<void*>(ipint_memory_atomic_notify_validate); \
void* ptr = reinterpret_cast<void*>(ipint_ ## name ## _validate); \
- void* untaggedBase = CodePtr<CFunctionPtrTag>::fromTaggedPtr(base).template untaggedPtr(); \
- void* untaggedPtr = CodePtr<CFunctionPtrTag>::fromTaggedPtr(ptr).template untaggedPtr(); \
+ void* untaggedBase = CodePtr<CFunctionPtrTag>::fromTaggedPtr(base).template untaggedPtr<>(); \
+ void* untaggedPtr = CodePtr<CFunctionPtrTag>::fromTaggedPtr(ptr).template untaggedPtr<>(); \
RELEASE_ASSERT_WITH_MESSAGE((char*)(untaggedPtr) - (char*)(untaggedBase) == opcode * 256, #name); \
} while (false);
--- a/Source/JavaScriptCore/llint/LLIntData.h
+++ b/Source/JavaScriptCore/llint/LLIntData.h
@@ -217,7 +217,7 @@ ALWAYS_INLINE LLIntCode getCodeFunctionP
#if COMPILER(MSVC)
return reinterpret_cast<LLIntCode>(getCodePtr<tag>(opcodeID).taggedPtr());
#else
- return reinterpret_cast<LLIntCode>(getCodePtr<tag>(opcodeID).template taggedPtr());
+ return reinterpret_cast<LLIntCode>(getCodePtr<tag>(opcodeID).template taggedPtr<>());
#endif
}
@@ -227,7 +227,7 @@ ALWAYS_INLINE LLIntCode getWide16CodeFun
#if COMPILER(MSVC)
return reinterpret_cast<LLIntCode>(getWide16CodePtr<tag>(opcodeID).taggedPtr());
#else
- return reinterpret_cast<LLIntCode>(getWide16CodePtr<tag>(opcodeID).template taggedPtr());
+ return reinterpret_cast<LLIntCode>(getWide16CodePtr<tag>(opcodeID).template taggedPtr<>());
#endif
}
@@ -237,7 +237,7 @@ ALWAYS_INLINE LLIntCode getWide32CodeFun
#if COMPILER(MSVC)
return reinterpret_cast<LLIntCode>(getWide32CodePtr<tag>(opcodeID).taggedPtr());
#else
- return reinterpret_cast<LLIntCode>(getWide32CodePtr<tag>(opcodeID).template taggedPtr());
+ return reinterpret_cast<LLIntCode>(getWide32CodePtr<tag>(opcodeID).template taggedPtr<>());
#endif
}
#else // not ENABLE(JIT)
@@ -361,7 +361,7 @@ ALWAYS_INLINE LLIntCode getCodeFunctionP
#if COMPILER(MSVC)
return reinterpret_cast<LLIntCode>(getCodePtr<tag>(opcodeID).taggedPtr());
#else
- return reinterpret_cast<LLIntCode>(getCodePtr<tag>(opcodeID).template taggedPtr());
+ return reinterpret_cast<LLIntCode>(getCodePtr<tag>(opcodeID).template taggedPtr<>());
#endif
}
@@ -371,7 +371,7 @@ ALWAYS_INLINE LLIntCode getWide16CodeFun
#if COMPILER(MSVC)
return reinterpret_cast<LLIntCode>(getWide16CodePtr<tag>(opcodeID).taggedPtr());
#else
- return reinterpret_cast<LLIntCode>(getWide16CodePtr<tag>(opcodeID).template taggedPtr());
+ return reinterpret_cast<LLIntCode>(getWide16CodePtr<tag>(opcodeID).template taggedPtr<>());
#endif
}
@@ -381,7 +381,7 @@ ALWAYS_INLINE LLIntCode getWide32CodeFun
#if COMPILER(MSVC)
return reinterpret_cast<LLIntCode>(getWide32CodePtr<tag>(opcodeID).taggedPtr());
#else
- return reinterpret_cast<LLIntCode>(getWide32CodePtr<tag>(opcodeID).template taggedPtr());
+ return reinterpret_cast<LLIntCode>(getWide32CodePtr<tag>(opcodeID).template taggedPtr<>());
#endif
}
#else // not ENABLE(JIT)
--- a/Source/JavaScriptCore/llint/LLIntThunks.cpp
+++ b/Source/JavaScriptCore/llint/LLIntThunks.cpp
@@ -227,7 +227,7 @@ ALWAYS_INLINE void* untaggedPtr(void* pt
#if COMPILER(MSVC)
return CodePtr<CFunctionPtrTag>::fromTaggedPtr(ptr).untaggedPtr();
#else
- return CodePtr<CFunctionPtrTag>::fromTaggedPtr(ptr).template untaggedPtr();
+ return CodePtr<CFunctionPtrTag>::fromTaggedPtr(ptr).template untaggedPtr<>();
#endif
}
--- a/Source/JavaScriptCore/parser/Nodes.h
+++ b/Source/JavaScriptCore/parser/Nodes.h
@@ -1,7 +1,7 @@
/*
* Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
* Copyright (C) 2001 Peter Kelly (pmk@post.com)
- * Copyright (C) 2003-2019 Apple Inc. All rights reserved.
+ * Copyright (C) 2003-2024 Apple Inc. All rights reserved.
* Copyright (C) 2007 Cameron Zwarich (cwzwarich@uwaterloo.ca)
* Copyright (C) 2007 Maks Orlovich
* Copyright (C) 2007 Eric Seidel <eric@webkit.org>
@@ -29,6 +29,7 @@
#include "ImplementationVisibility.h"
#include "JITCode.h"
#include "Label.h"
+#include "ModuleScopeData.h"
#include "ParserArena.h"
#include "ParserModes.h"
#include "ParserTokens.h"
@@ -49,7 +50,6 @@ namespace JSC {
class FunctionMetadataNode;
class FunctionParameters;
class ModuleAnalyzer;
- class ModuleScopeData;
class PropertyListNode;
class ReadModifyResolveNode;
class RegisterID;
--- a/Source/JavaScriptCore/runtime/JSCast.h
+++ b/Source/JavaScriptCore/runtime/JSCast.h
@@ -236,7 +236,7 @@ template<typename Target, typename From>
bool inherits(From* from)
{
using Dispatcher = InheritsTraits<Target>;
- return Dispatcher::template inherits(from);
+ return Dispatcher::template inherits<>(from);
}
} // namespace JSCastingHelpers
@@ -245,7 +245,7 @@ template<typename To, typename From>
To jsDynamicCast(From* from)
{
using Dispatcher = JSCastingHelpers::InheritsTraits<typename std::remove_cv<typename std::remove_pointer<To>::type>::type>;
- if (LIKELY(Dispatcher::template inherits(from)))
+ if (LIKELY(Dispatcher::template inherits<>(from)))
return static_cast<To>(from);
return nullptr;
}
|