Skip to content

Commit 0ca7737

Browse files
joyeecheungnodejs-github-bot
authored andcommitted
deps: fix building v8 on macos 13 and Apple Clang 14
1 parent 27cdc90 commit 0ca7737

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
@@ -151,7 +151,7 @@ class StringEscapeAnalysisReducer : public Next {
151151
}
152152

153153
private:
154-
ElidedStringPart(Kind kind, V<String> index) : data(index), kind(kind) {}
154+
ElidedStringPart(Kind kind, V<String> index) : data{index}, kind(kind) {}
155155
};
156156

157157
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
@@ -3863,7 +3863,7 @@ void MarkCompactCollector::ClearWeakCollections() {
38633863

38643864
template <typename TObjectAndSlot, typename TMaybeSlot>
38653865
void MarkCompactCollector::ClearWeakReferences(
3866-
WeakObjects::WeakObjectWorklist<TObjectAndSlot>::Local& worklist,
3866+
typename WeakObjects::WeakObjectWorklist<TObjectAndSlot>::Local& worklist,
38673867
Tagged<HeapObjectReference> cleared_weak_ref) {
38683868
TObjectAndSlot slot;
38693869
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
@@ -2098,7 +2098,7 @@ template <typename Char>
20982098
template <typename StringT>
20992099
FastJsonStringifierResult FastJsonStringifier<Char>::SerializeObjectKey(
21002100
Tagged<String> obj, bool comma, 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 {
@@ -2124,7 +2124,7 @@ template <typename StringT, bool deferred_key>
21242124
FastJsonStringifierResult FastJsonStringifier<Char>::SerializeString(
21252125
Tagged<HeapObject> obj, bool comma, Tagged<String> key,
21262126
const DisallowGarbageCollection& no_gc) {
2127-
using StringChar = StringT::Char;
2127+
using StringChar = typename StringT::Char;
21282128
if constexpr (is_one_byte && sizeof(StringChar) == 2) {
21292129
return CHANGE_ENCODING;
21302130
} else {
@@ -2303,36 +2303,39 @@ FastJsonStringifierResult FastJsonStringifier<Char>::SerializeJSObject(
23032303
break;
23042304
case UNDEFINED:
23052305
break;
2306-
case UNCHANGED:
2307-
stack_.emplace_back(ContinuationRecord::kObject, obj,
2308-
i.as_uint32() + 1);
2306+
case UNCHANGED: {
2307+
ContinuationRecord rec1{ContinuationRecord::kObject, obj, i.as_uint32() + 1};
2308+
stack_.emplace_back(std::move(rec1));
23092309
// property can be an object or array. We don't need to distinguish
23102310
// as index is 0 anyways.
2311-
stack_.emplace_back(ContinuationRecord::kObject, property, 0);
2311+
ContinuationRecord rec2{ContinuationRecord::kObject, property, 0};
2312+
stack_.emplace_back(std::move(rec2));
23122313
result = SerializeObjectKey(key_name, comma, no_gc);
23132314
if constexpr (is_one_byte) {
23142315
if (V8_UNLIKELY(result != SUCCESS)) {
23152316
DCHECK_EQ(result, CHANGE_ENCODING);
2316-
stack_.emplace_back(ContinuationRecord::kObjectKey, key_name,
2317-
comma);
2317+
ContinuationRecord rec3{ContinuationRecord::kObjectKey, key_name, comma};
2318+
stack_.emplace_back(std::move(rec3));
23182319
return result;
23192320
}
23202321
}
23212322
return result;
2322-
case CHANGE_ENCODING:
2323+
}
2324+
case CHANGE_ENCODING: {
23232325
DCHECK(is_one_byte);
2324-
stack_.emplace_back(ContinuationRecord::kObject, obj,
2325-
i.as_uint32() + 1);
2326-
stack_.emplace_back(ContinuationRecord::kResumeFromOther, property,
2327-
0);
2326+
ContinuationRecord rec1{ContinuationRecord::kObject, obj, i.as_uint32() + 1};
2327+
stack_.emplace_back(std::move(rec1));
2328+
ContinuationRecord rec2{ContinuationRecord::kResumeFromOther, property, 0};
2329+
stack_.emplace_back(std::move(rec2));
23282330
result = SerializeObjectKey(key_name, comma, no_gc);
23292331
if (V8_UNLIKELY(result != SUCCESS)) {
2330-
stack_.emplace_back(ContinuationRecord::kObjectKey, key_name,
2331-
comma);
2332+
ContinuationRecord rec3{ContinuationRecord::kObjectKey, key_name, comma};
2333+
stack_.emplace_back(std::move(rec3));
23322334
return result;
23332335
}
23342336
DCHECK(IsString(property));
23352337
return result;
2338+
}
23362339
case SLOW_PATH:
23372340
case EXCEPTION:
23382341
return result;
@@ -2475,15 +2478,21 @@ FastJsonStringifierResult FastJsonStringifier<Char>::SerializeFixedArrayElement(
24752478
case UNDEFINED:
24762479
AppendCStringLiteral("null");
24772480
return SUCCESS;
2478-
case CHANGE_ENCODING:
2481+
case CHANGE_ENCODING: {
24792482
DCHECK(IsString(obj));
2480-
stack_.emplace_back(ContinuationRecord::kArray, array, i + 1);
2481-
stack_.emplace_back(ContinuationRecord::kResumeFromOther, obj, 0);
2483+
ContinuationRecord rec1{ContinuationRecord::kArray, array, i + 1};
2484+
stack_.emplace_back(std::move(rec1));
2485+
ContinuationRecord rec2{ContinuationRecord::kResumeFromOther, obj, 0};
2486+
stack_.emplace_back(std::move(rec2));
24822487
return result;
2483-
case UNCHANGED:
2484-
stack_.emplace_back(ContinuationRecord::kArray, array, i + 1);
2485-
stack_.emplace_back(ContinuationRecord::kResumeFromOther, obj, 0);
2488+
}
2489+
case UNCHANGED: {
2490+
ContinuationRecord rec1{ContinuationRecord::kArray, array, i + 1};
2491+
stack_.emplace_back(std::move(rec1));
2492+
ContinuationRecord rec2{ContinuationRecord::kResumeFromOther, obj, 0};
2493+
stack_.emplace_back(std::move(rec2));
24862494
return result;
2495+
}
24872496
default:
24882497
return result;
24892498
}
@@ -2560,7 +2569,8 @@ FastJsonStringifierResult FastJsonStringifier<Char>::SerializeObject(
25602569
if constexpr (is_one_byte) {
25612570
if (result == CHANGE_ENCODING) {
25622571
DCHECK(IsString(object));
2563-
stack_.emplace_back(ContinuationRecord::kResumeFromOther, object, 0);
2572+
ContinuationRecord rec{ContinuationRecord::kResumeFromOther, object, 0};
2573+
stack_.emplace_back(std::move(rec));
25642574
return result;
25652575
}
25662576
} else {

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

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

42484248
private:
42494249
using TaggedToFloat64ConversionTypeOffset =
4250-
Base::template NextBitField<TaggedToFloat64ConversionType, 2>;
4250+
typename Base::template NextBitField<TaggedToFloat64ConversionType, 2>;
42514251
};
42524252

42534253
class CheckedNumberOrOddballToFloat64

deps/v8/src/objects/objects.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -603,11 +603,11 @@ class Object : public AllStatic {
603603
ConvertToInteger(Isolate* isolate, HandleType<Object> input);
604604
template <template <typename> typename HandleType>
605605
requires(std::is_convertible_v<HandleType<Object>, DirectHandle<Object>>)
606-
V8_WARN_UNUSED_RESULT static HandleType<Number>::MaybeType ConvertToInt32(
606+
V8_WARN_UNUSED_RESULT static typename HandleType<Number>::MaybeType ConvertToInt32(
607607
Isolate* isolate, HandleType<Object> input);
608608
template <template <typename> typename HandleType>
609609
requires(std::is_convertible_v<HandleType<Object>, DirectHandle<Object>>)
610-
V8_WARN_UNUSED_RESULT static HandleType<Number>::MaybeType ConvertToUint32(
610+
V8_WARN_UNUSED_RESULT static typename HandleType<Number>::MaybeType ConvertToUint32(
611611
Isolate* isolate, HandleType<Object> input);
612612
V8_EXPORT_PRIVATE V8_WARN_UNUSED_RESULT static MaybeHandle<Number>
613613
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)