Skip to content

Commit 3edd19c

Browse files
joyeecheungnodejs-github-bot
authored andcommitted
deps: fix building v8 on macos 13 and Apple Clang 14
1 parent ce44aac commit 3edd19c

File tree

10 files changed

+79
-69
lines changed

10 files changed

+79
-69
lines changed

deps/v8/src/compiler/turboshaft/string-escape-analysis-reducer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ class StringEscapeAnalysisReducer : public Next {
149149
}
150150

151151
private:
152-
ElidedStringPart(Kind kind, V<String> index) : data(index), kind(kind) {}
152+
ElidedStringPart(Kind kind, V<String> index) : data{index}, kind(kind) {}
153153
};
154154

155155
void Analyze() {

deps/v8/src/heap/heap-visitor-inl.h

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -93,26 +93,23 @@ Tagged<T> HeapVisitor<ConcreteVisitor>::Cast(Tagged<HeapObject> object,
9393
}
9494

9595
template <typename ConcreteVisitor>
96-
size_t HeapVisitor<ConcreteVisitor>::Visit(Tagged<HeapObject> object)
97-
requires(!ConcreteVisitor::UsePrecomputedObjectSize())
98-
{
96+
template <typename T, typename>
97+
size_t HeapVisitor<ConcreteVisitor>::Visit(Tagged<HeapObject> object) {
9998
return Visit(object->map(cage_base()), object);
10099
}
101100

102101
template <typename ConcreteVisitor>
102+
template <typename T, typename>
103103
size_t HeapVisitor<ConcreteVisitor>::Visit(Tagged<Map> map,
104-
Tagged<HeapObject> object)
105-
requires(!ConcreteVisitor::UsePrecomputedObjectSize())
106-
{
104+
Tagged<HeapObject> object) {
107105
return Visit(map, object, MaybeObjectSize());
108106
}
109107

110108
template <typename ConcreteVisitor>
109+
template <typename T, typename>
111110
size_t HeapVisitor<ConcreteVisitor>::Visit(Tagged<Map> map,
112111
Tagged<HeapObject> object,
113-
int object_size)
114-
requires(ConcreteVisitor::UsePrecomputedObjectSize())
115-
{
112+
int object_size) {
116113
return Visit(map, object, MaybeObjectSize(object_size));
117114
}
118115

deps/v8/src/heap/heap-visitor.h

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -196,15 +196,18 @@ class HeapVisitor : public ObjectVisitorWithCageBases {
196196
inline explicit HeapVisitor(Isolate* isolate);
197197
inline explicit HeapVisitor(Heap* heap);
198198

199-
V8_INLINE size_t Visit(Tagged<HeapObject> object)
200-
requires(!ConcreteVisitor::UsePrecomputedObjectSize());
199+
template <typename T = ConcreteVisitor,
200+
typename = std::enable_if_t<!T::UsePrecomputedObjectSize()>>
201+
V8_INLINE size_t Visit(Tagged<HeapObject> object);
201202

202-
V8_INLINE size_t Visit(Tagged<Map> map, Tagged<HeapObject> object)
203-
requires(!ConcreteVisitor::UsePrecomputedObjectSize());
203+
template <typename T = ConcreteVisitor,
204+
typename = std::enable_if_t<!T::UsePrecomputedObjectSize()>>
205+
V8_INLINE size_t Visit(Tagged<Map> map, Tagged<HeapObject> object);
204206

207+
template <typename T = ConcreteVisitor,
208+
typename = std::enable_if_t<T::UsePrecomputedObjectSize()>>
205209
V8_INLINE size_t Visit(Tagged<Map> map, Tagged<HeapObject> object,
206-
int object_size)
207-
requires(ConcreteVisitor::UsePrecomputedObjectSize());
210+
int object_size);
208211

209212
protected:
210213
V8_INLINE size_t Visit(Tagged<Map> map, Tagged<HeapObject> object,

deps/v8/src/heap/mark-compact.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3862,7 +3862,7 @@ void MarkCompactCollector::ClearWeakCollections() {
38623862

38633863
template <typename TObjectAndSlot, typename TMaybeSlot>
38643864
void MarkCompactCollector::ClearWeakReferences(
3865-
WeakObjects::WeakObjectWorklist<TObjectAndSlot>::Local& worklist,
3865+
typename WeakObjects::WeakObjectWorklist<TObjectAndSlot>::Local& worklist,
38663866
Tagged<HeapObjectReference> cleared_weak_ref) {
38673867
TObjectAndSlot slot;
38683868
while (worklist.Pop(&slot)) {

deps/v8/src/heap/mark-compact.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ class MarkCompactCollector final {
339339
// Common implementation of the above two.
340340
template <typename TObjectAndSlot, typename TMaybeSlot>
341341
void ClearWeakReferences(
342-
WeakObjects::WeakObjectWorklist<TObjectAndSlot>::Local& worklist,
342+
typename WeakObjects::WeakObjectWorklist<TObjectAndSlot>::Local& worklist,
343343
Tagged<HeapObjectReference> cleared_weak_ref);
344344

345345
// Goes through the list of encountered non-trivial weak references and

deps/v8/src/json/json-stringifier.cc

Lines changed: 32 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2072,7 +2072,7 @@ template <typename Char>
20722072
template <typename StringT>
20732073
FastJsonStringifierResult FastJsonStringifier<Char>::SerializeObjectKey(
20742074
Tagged<String> obj, bool comma, const DisallowGarbageCollection& no_gc) {
2075-
using StringChar = StringT::Char;
2075+
using StringChar = typename StringT::Char;
20762076
if constexpr (is_one_byte && sizeof(StringChar) == 2) {
20772077
return CHANGE_ENCODING;
20782078
} else {
@@ -2098,7 +2098,7 @@ template <typename StringT, bool deferred_key>
20982098
FastJsonStringifierResult FastJsonStringifier<Char>::SerializeString(
20992099
Tagged<HeapObject> obj, bool comma, Tagged<String> key,
21002100
const DisallowGarbageCollection& no_gc) {
2101-
using StringChar = StringT::Char;
2101+
using StringChar = typename StringT::Char;
21022102
if constexpr (is_one_byte && sizeof(StringChar) == 2) {
21032103
return CHANGE_ENCODING;
21042104
} else {
@@ -2277,36 +2277,39 @@ FastJsonStringifierResult FastJsonStringifier<Char>::SerializeJSObject(
22772277
break;
22782278
case UNDEFINED:
22792279
break;
2280-
case UNCHANGED:
2281-
stack_.emplace_back(ContinuationRecord::kObject, obj,
2282-
i.as_uint32() + 1);
2280+
case UNCHANGED: {
2281+
ContinuationRecord rec1{ContinuationRecord::kObject, obj, i.as_uint32() + 1};
2282+
stack_.emplace_back(std::move(rec1));
22832283
// property can be an object or array. We don't need to distinguish
22842284
// as index is 0 anyways.
2285-
stack_.emplace_back(ContinuationRecord::kObject, property, 0);
2285+
ContinuationRecord rec2{ContinuationRecord::kObject, property, 0};
2286+
stack_.emplace_back(std::move(rec2));
22862287
result = SerializeObjectKey(key_name, comma, no_gc);
22872288
if constexpr (is_one_byte) {
22882289
if (V8_UNLIKELY(result != SUCCESS)) {
22892290
DCHECK_EQ(result, CHANGE_ENCODING);
2290-
stack_.emplace_back(ContinuationRecord::kObjectKey, key_name,
2291-
comma);
2291+
ContinuationRecord rec3{ContinuationRecord::kObjectKey, key_name, comma};
2292+
stack_.emplace_back(std::move(rec3));
22922293
return result;
22932294
}
22942295
}
22952296
return result;
2296-
case CHANGE_ENCODING:
2297+
}
2298+
case CHANGE_ENCODING: {
22972299
DCHECK(is_one_byte);
2298-
stack_.emplace_back(ContinuationRecord::kObject, obj,
2299-
i.as_uint32() + 1);
2300-
stack_.emplace_back(ContinuationRecord::kResumeFromOther, property,
2301-
0);
2300+
ContinuationRecord rec1{ContinuationRecord::kObject, obj, i.as_uint32() + 1};
2301+
stack_.emplace_back(std::move(rec1));
2302+
ContinuationRecord rec2{ContinuationRecord::kResumeFromOther, property, 0};
2303+
stack_.emplace_back(std::move(rec2));
23022304
result = SerializeObjectKey(key_name, comma, no_gc);
23032305
if (V8_UNLIKELY(result != SUCCESS)) {
2304-
stack_.emplace_back(ContinuationRecord::kObjectKey, key_name,
2305-
comma);
2306+
ContinuationRecord rec3{ContinuationRecord::kObjectKey, key_name, comma};
2307+
stack_.emplace_back(std::move(rec3));
23062308
return result;
23072309
}
23082310
DCHECK(IsString(property));
23092311
return result;
2312+
}
23102313
case SLOW_PATH:
23112314
case EXCEPTION:
23122315
return result;
@@ -2449,15 +2452,21 @@ FastJsonStringifierResult FastJsonStringifier<Char>::SerializeFixedArrayElement(
24492452
case UNDEFINED:
24502453
AppendCStringLiteral("null");
24512454
return SUCCESS;
2452-
case CHANGE_ENCODING:
2455+
case CHANGE_ENCODING: {
24532456
DCHECK(IsString(obj));
2454-
stack_.emplace_back(ContinuationRecord::kArray, array, i + 1);
2455-
stack_.emplace_back(ContinuationRecord::kResumeFromOther, obj, 0);
2457+
ContinuationRecord rec1{ContinuationRecord::kArray, array, i + 1};
2458+
stack_.emplace_back(std::move(rec1));
2459+
ContinuationRecord rec2{ContinuationRecord::kResumeFromOther, obj, 0};
2460+
stack_.emplace_back(std::move(rec2));
24562461
return result;
2457-
case UNCHANGED:
2458-
stack_.emplace_back(ContinuationRecord::kArray, array, i + 1);
2459-
stack_.emplace_back(ContinuationRecord::kResumeFromOther, obj, 0);
2462+
}
2463+
case UNCHANGED: {
2464+
ContinuationRecord rec1{ContinuationRecord::kArray, array, i + 1};
2465+
stack_.emplace_back(std::move(rec1));
2466+
ContinuationRecord rec2{ContinuationRecord::kResumeFromOther, obj, 0};
2467+
stack_.emplace_back(std::move(rec2));
24602468
return result;
2469+
}
24612470
default:
24622471
return result;
24632472
}
@@ -2534,7 +2543,8 @@ FastJsonStringifierResult FastJsonStringifier<Char>::SerializeObject(
25342543
if constexpr (is_one_byte) {
25352544
if (result == CHANGE_ENCODING) {
25362545
DCHECK(IsString(object));
2537-
stack_.emplace_back(ContinuationRecord::kResumeFromOther, object, 0);
2546+
ContinuationRecord rec{ContinuationRecord::kResumeFromOther, object, 0};
2547+
stack_.emplace_back(std::move(rec));
25382548
return result;
25392549
}
25402550
} else {

deps/v8/src/maglev/maglev-ir.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4025,7 +4025,7 @@ class CheckedNumberOrOddballToFloat64OrHoleyFloat64
40254025

40264026
private:
40274027
using TaggedToFloat64ConversionTypeOffset =
4028-
Base::template NextBitField<TaggedToFloat64ConversionType, 2>;
4028+
typename Base::template NextBitField<TaggedToFloat64ConversionType, 2>;
40294029
};
40304030

40314031
class CheckedNumberOrOddballToFloat64

deps/v8/src/objects/objects.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -604,11 +604,11 @@ class Object : public AllStatic {
604604
ConvertToInteger(Isolate* isolate, HandleType<Object> input);
605605
template <template <typename> typename HandleType>
606606
requires(std::is_convertible_v<HandleType<Object>, DirectHandle<Object>>)
607-
V8_WARN_UNUSED_RESULT static HandleType<Number>::MaybeType ConvertToInt32(
607+
V8_WARN_UNUSED_RESULT static typename HandleType<Number>::MaybeType ConvertToInt32(
608608
Isolate* isolate, HandleType<Object> input);
609609
template <template <typename> typename HandleType>
610610
requires(std::is_convertible_v<HandleType<Object>, DirectHandle<Object>>)
611-
V8_WARN_UNUSED_RESULT static HandleType<Number>::MaybeType ConvertToUint32(
611+
V8_WARN_UNUSED_RESULT static typename HandleType<Number>::MaybeType ConvertToUint32(
612612
Isolate* isolate, HandleType<Object> input);
613613
V8_EXPORT_PRIVATE V8_WARN_UNUSED_RESULT static MaybeHandle<Number>
614614
ConvertToLength(Isolate* isolate, DirectHandle<Object> input);

deps/v8/src/objects/smi.h

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,29 @@ namespace internal {
2424
// Smi stands for small integer.
2525
class Smi : public AllStatic {
2626
public:
27+
// Returns whether value can be represented in a Smi.
28+
template <typename T>
29+
static inline bool constexpr IsValid(T value)
30+
requires(std::is_integral_v<T> && std::is_signed_v<T>)
31+
{
32+
DCHECK_EQ(Internals::IsValidSmi(value),
33+
value >= kMinValue && value <= kMaxValue);
34+
return Internals::IsValidSmi(value);
35+
}
36+
template <typename T>
37+
static inline bool constexpr IsValid(T value)
38+
requires(std::is_integral_v<T> && std::is_unsigned_v<T>)
39+
{
40+
DCHECK_EQ(Internals::IsValidSmi(value), value <= kMaxValue);
41+
return Internals::IsValidSmi(value);
42+
}
43+
44+
// Convert a value to a Smi object.
45+
static inline constexpr Tagged<Smi> FromInt(int value) {
46+
DCHECK(Smi::IsValid(value));
47+
return Tagged<Smi>(Internals::IntegralToSmi(value));
48+
}
49+
2750
static inline constexpr Tagged<Smi> ToUint32Smi(Tagged<Smi> smi) {
2851
if (smi.value() <= 0) return Smi::FromInt(0);
2952
return Smi::FromInt(static_cast<uint32_t>(smi.value()));
@@ -34,12 +57,6 @@ class Smi : public AllStatic {
3457
return Tagged<Smi>(object.ptr()).value();
3558
}
3659

37-
// Convert a value to a Smi object.
38-
static inline constexpr Tagged<Smi> FromInt(int value) {
39-
DCHECK(Smi::IsValid(value));
40-
return Tagged<Smi>(Internals::IntegralToSmi(value));
41-
}
42-
4360
static inline constexpr Tagged<Smi> FromIntptr(intptr_t value) {
4461
DCHECK(Smi::IsValid(value));
4562
int smi_shift_bits = kSmiTagSize + kSmiShiftSize;
@@ -62,23 +79,6 @@ class Smi : public AllStatic {
6279
return FromInt(static_cast<int>(value));
6380
}
6481

65-
// Returns whether value can be represented in a Smi.
66-
template <typename T>
67-
static inline bool constexpr IsValid(T value)
68-
requires(std::is_integral_v<T> && std::is_signed_v<T>)
69-
{
70-
DCHECK_EQ(Internals::IsValidSmi(value),
71-
value >= kMinValue && value <= kMaxValue);
72-
return Internals::IsValidSmi(value);
73-
}
74-
template <typename T>
75-
static inline bool constexpr IsValid(T value)
76-
requires(std::is_integral_v<T> && std::is_unsigned_v<T>)
77-
{
78-
DCHECK_EQ(Internals::IsValidSmi(value), value <= kMaxValue);
79-
return Internals::IsValidSmi(value);
80-
}
81-
8282
// Compare two Smis x, y as if they were converted to strings and then
8383
// compared lexicographically. Returns:
8484
// -1 if x < y.

deps/v8/src/sandbox/external-entity-table.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ class V8_EXPORT_PRIVATE ExternalEntityTable
4848
: public SegmentedTable<Entry, size> {
4949
protected:
5050
using Base = SegmentedTable<Entry, size>;
51-
using FreelistHead = Base::FreelistHead;
52-
using Segment = Base::Segment;
53-
using WriteIterator = Base::WriteIterator;
51+
using FreelistHead = typename Base::FreelistHead;
52+
using Segment = typename Base::Segment;
53+
using WriteIterator = typename Base::WriteIterator;
5454
static constexpr size_t kSegmentSize = Base::kSegmentSize;
5555
static constexpr size_t kEntriesPerSegment = Base::kEntriesPerSegment;
5656
static constexpr size_t kEntrySize = Base::kEntrySize;

0 commit comments

Comments
 (0)