Skip to content

Commit 5e25a58

Browse files
katallaxiegithub-actions[bot]
authored andcommitted
Upgrade V8 binaries for 13.1.201.19 version
1 parent 9be30a3 commit 5e25a58

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+6515
-2206
lines changed

deps/include/OWNERS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,4 @@ per-file v8-version.h=v8-ci-autoroll-builder@chops-service-accounts.iam.gservice
1919

2020
# For branch updates:
2121
per-file v8-version.h=file:../INFRA_OWNERS
22-
2322

deps/include/cppgc/DEPS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ include_rules = [
22
"-include",
33
"+v8config.h",
44
"+v8-platform.h",
5+
"+v8-source-location.h",
56
"+cppgc",
67
"-src",
78
"+libplatform/libplatform.h",

deps/include/cppgc/allocation.h

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ namespace internal {
4747
// Similar to C++17 std::align_val_t;
4848
enum class AlignVal : size_t {};
4949

50-
class V8_EXPORT MakeGarbageCollectedTraitInternal {
50+
class MakeGarbageCollectedTraitInternal {
5151
protected:
5252
static inline void MarkObjectAsFullyConstructed(const void* payload) {
5353
// See api_constants for an explanation of the constants.
@@ -121,16 +121,15 @@ class V8_EXPORT MakeGarbageCollectedTraitInternal {
121121
};
122122

123123
private:
124-
static void* CPPGC_DEFAULT_ALIGNED Allocate(cppgc::AllocationHandle&, size_t,
125-
GCInfoIndex);
126-
static void* CPPGC_DOUBLE_WORD_ALIGNED Allocate(cppgc::AllocationHandle&,
127-
size_t, AlignVal,
128-
GCInfoIndex);
129-
static void* CPPGC_DEFAULT_ALIGNED Allocate(cppgc::AllocationHandle&, size_t,
130-
GCInfoIndex, CustomSpaceIndex);
131-
static void* CPPGC_DOUBLE_WORD_ALIGNED Allocate(cppgc::AllocationHandle&,
132-
size_t, AlignVal, GCInfoIndex,
133-
CustomSpaceIndex);
124+
V8_EXPORT static void* CPPGC_DEFAULT_ALIGNED
125+
Allocate(cppgc::AllocationHandle&, size_t, GCInfoIndex);
126+
V8_EXPORT static void* CPPGC_DOUBLE_WORD_ALIGNED
127+
Allocate(cppgc::AllocationHandle&, size_t, AlignVal, GCInfoIndex);
128+
V8_EXPORT static void* CPPGC_DEFAULT_ALIGNED
129+
Allocate(cppgc::AllocationHandle&, size_t, GCInfoIndex, CustomSpaceIndex);
130+
V8_EXPORT static void* CPPGC_DOUBLE_WORD_ALIGNED
131+
Allocate(cppgc::AllocationHandle&, size_t, AlignVal, GCInfoIndex,
132+
CustomSpaceIndex);
134133

135134
friend class HeapObjectHeader;
136135
};

deps/include/cppgc/cross-thread-persistent.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,11 @@ class BasicCrossThreadPersistent final : public CrossThreadPersistentBase,
148148

149149
template <typename U, typename MemberBarrierPolicy,
150150
typename MemberWeaknessTag, typename MemberCheckingPolicy,
151+
typename MemberStorageType,
151152
typename = std::enable_if_t<std::is_base_of<T, U>::value>>
152153
BasicCrossThreadPersistent(
153154
internal::BasicMember<U, MemberBarrierPolicy, MemberWeaknessTag,
154-
MemberCheckingPolicy>
155+
MemberCheckingPolicy, MemberStorageType>
155156
member,
156157
const SourceLocation& loc = SourceLocation::Current())
157158
: BasicCrossThreadPersistent(member.Get(), loc) {}
@@ -230,10 +231,11 @@ class BasicCrossThreadPersistent final : public CrossThreadPersistentBase,
230231
// Assignment from member.
231232
template <typename U, typename MemberBarrierPolicy,
232233
typename MemberWeaknessTag, typename MemberCheckingPolicy,
234+
typename MemberStorageType,
233235
typename = std::enable_if_t<std::is_base_of<T, U>::value>>
234236
BasicCrossThreadPersistent& operator=(
235237
internal::BasicMember<U, MemberBarrierPolicy, MemberWeaknessTag,
236-
MemberCheckingPolicy>
238+
MemberCheckingPolicy, MemberStorageType>
237239
member) {
238240
return operator=(member.Get());
239241
}

deps/include/cppgc/default-platform.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,12 @@ class V8_EXPORT DefaultPlatform : public Platform {
3737
return v8_platform_->MonotonicallyIncreasingTime();
3838
}
3939

40-
std::shared_ptr<cppgc::TaskRunner> GetForegroundTaskRunner() override {
40+
std::shared_ptr<cppgc::TaskRunner> GetForegroundTaskRunner(
41+
TaskPriority priority) override {
4142
// V8's default platform creates a new task runner when passed the
4243
// `v8::Isolate` pointer the first time. For non-default platforms this will
4344
// require getting the appropriate task runner.
44-
return v8_platform_->GetForegroundTaskRunner(kNoIsolate);
45+
return v8_platform_->GetForegroundTaskRunner(kNoIsolate, priority);
4546
}
4647

4748
std::unique_ptr<cppgc::JobHandle> PostJob(

deps/include/cppgc/garbage-collected.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,14 @@ class GarbageCollectedMixin {
9494
public:
9595
using IsGarbageCollectedMixinTypeMarker = void;
9696

97+
// Must use MakeGarbageCollected.
98+
void* operator new(size_t) = delete;
99+
void* operator new[](size_t) = delete;
100+
// The garbage collector is taking care of reclaiming the object.
101+
// Not override the non-array varaint of `delete` to not conflict with the
102+
// operator in GarbageCollected above.
103+
void operator delete[](void*) = delete;
104+
97105
/**
98106
* This Trace method must be overriden by objects inheriting from
99107
* GarbageCollectedMixin.

deps/include/cppgc/heap-consistency.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ class HeapConsistency final {
6262
* \returns whether a write barrier is needed and which barrier to invoke.
6363
*/
6464
template <typename T, typename WeaknessTag, typename WriteBarrierPolicy,
65-
typename CheckingPolicy>
65+
typename CheckingPolicy, typename StorageType>
6666
static V8_INLINE WriteBarrierType GetWriteBarrierType(
6767
const internal::BasicMember<T, WeaknessTag, WriteBarrierPolicy,
68-
CheckingPolicy>& value,
68+
CheckingPolicy, StorageType>& value,
6969
WriteBarrierParams& params) {
7070
return internal::WriteBarrier::GetWriteBarrierType(
7171
value.GetRawSlot(), value.GetRawStorage(), params);
@@ -114,7 +114,7 @@ class HeapConsistency final {
114114
* has not yet been processed.
115115
*
116116
* \param params The parameters retrieved from `GetWriteBarrierType()`.
117-
* \param object The pointer to the object. May be an interior pointer to a
117+
* \param object The pointer to the object. May be an interior pointer to
118118
* an interface of the actual object.
119119
*/
120120
static V8_INLINE void DijkstraWriteBarrier(const WriteBarrierParams& params,

deps/include/cppgc/heap-statistics.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ struct HeapStatistics final {
102102
size_t resident_size_bytes = 0;
103103
/** Amount of memory actually used on the heap. */
104104
size_t used_size_bytes = 0;
105+
/** Memory retained in the page pool, not used directly by the heap. */
106+
size_t pooled_memory_size_bytes = 0;
105107
/** Detail level of this HeapStatistics. */
106108
DetailLevel detail_level;
107109

deps/include/cppgc/internal/api-constants.h

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,47 @@ static constexpr size_t kFullyConstructedBitFieldOffsetFromPayload =
3030
// Mask for in-construction bit.
3131
static constexpr uint16_t kFullyConstructedBitMask = uint16_t{1};
3232

33-
static constexpr size_t kPageSize = size_t{1} << 17;
33+
static constexpr size_t kPageSizeBits = 17;
34+
static constexpr size_t kPageSize = size_t{1} << kPageSizeBits;
3435

35-
#if defined(V8_TARGET_ARCH_ARM64) && defined(V8_OS_MACOS)
36+
#if defined(V8_HOST_ARCH_ARM64) && defined(V8_OS_DARWIN)
37+
constexpr size_t kGuardPageSize = 0;
38+
#elif defined(V8_HOST_ARCH_PPC64)
39+
constexpr size_t kGuardPageSize = 0;
40+
#elif defined(V8_HOST_ARCH_LOONG64) || defined(V8_HOST_ARCH_MIPS64)
3641
constexpr size_t kGuardPageSize = 0;
3742
#else
3843
constexpr size_t kGuardPageSize = 4096;
3944
#endif
4045

4146
static constexpr size_t kLargeObjectSizeThreshold = kPageSize / 2;
4247

48+
#if defined(CPPGC_POINTER_COMPRESSION)
49+
#if defined(CPPGC_ENABLE_LARGER_CAGE)
50+
constexpr unsigned kPointerCompressionShift = 3;
51+
#else // !defined(CPPGC_ENABLE_LARGER_CAGE)
52+
constexpr unsigned kPointerCompressionShift = 1;
53+
#endif // !defined(CPPGC_ENABLE_LARGER_CAGE)
54+
#endif // !defined(CPPGC_POINTER_COMPRESSION)
55+
4356
#if defined(CPPGC_CAGED_HEAP)
4457
#if defined(CPPGC_2GB_CAGE)
45-
constexpr size_t kCagedHeapReservationSize = static_cast<size_t>(2) * kGB;
46-
#else // !defined(CPPGC_2GB_CAGE)
47-
constexpr size_t kCagedHeapReservationSize = static_cast<size_t>(4) * kGB;
58+
constexpr size_t kCagedHeapDefaultReservationSize =
59+
static_cast<size_t>(2) * kGB;
60+
constexpr size_t kCagedHeapMaxReservationSize =
61+
kCagedHeapDefaultReservationSize;
62+
#else // !defined(CPPGC_2GB_CAGE)
63+
constexpr size_t kCagedHeapDefaultReservationSize =
64+
static_cast<size_t>(4) * kGB;
65+
#if defined(CPPGC_POINTER_COMPRESSION)
66+
constexpr size_t kCagedHeapMaxReservationSize =
67+
size_t{1} << (31 + kPointerCompressionShift);
68+
#else // !defined(CPPGC_POINTER_COMPRESSION)
69+
constexpr size_t kCagedHeapMaxReservationSize =
70+
kCagedHeapDefaultReservationSize;
71+
#endif // !defined(CPPGC_POINTER_COMPRESSION)
4872
#endif // !defined(CPPGC_2GB_CAGE)
49-
constexpr size_t kCagedHeapReservationAlignment = kCagedHeapReservationSize;
73+
constexpr size_t kCagedHeapReservationAlignment = kCagedHeapMaxReservationSize;
5074
#endif // defined(CPPGC_CAGED_HEAP)
5175

5276
static constexpr size_t kDefaultAlignment = sizeof(void*);
@@ -57,6 +81,9 @@ static constexpr size_t kMaxSupportedAlignment = 2 * kDefaultAlignment;
5781
// Granularity of heap allocations.
5882
constexpr size_t kAllocationGranularity = sizeof(void*);
5983

84+
// Default cacheline size.
85+
constexpr size_t kCachelineSize = 64;
86+
6087
} // namespace api_constants
6188

6289
} // namespace internal

deps/include/cppgc/internal/caged-heap-local-data.h

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@ class V8_EXPORT AgeTable final {
4646
enum class AdjacentCardsPolicy : uint8_t { kConsider, kIgnore };
4747

4848
static constexpr size_t kCardSizeInBytes =
49-
api_constants::kCagedHeapReservationSize / kRequiredSize;
49+
api_constants::kCagedHeapDefaultReservationSize / kRequiredSize;
50+
51+
static constexpr size_t CalculateAgeTableSizeForHeapSize(size_t heap_size) {
52+
return heap_size / kCardSizeInBytes;
53+
}
5054

5155
void SetAge(uintptr_t cage_offset, Age age) {
5256
table_[card(cage_offset)] = age;
@@ -81,23 +85,29 @@ class V8_EXPORT AgeTable final {
8185
#endif // !V8_HAS_BUILTIN_CTZ
8286
static_assert((1 << kGranularityBits) == kCardSizeInBytes);
8387
const size_t entry = offset >> kGranularityBits;
84-
CPPGC_DCHECK(table_.size() > entry);
88+
CPPGC_DCHECK(CagedHeapBase::GetAgeTableSize() > entry);
8589
return entry;
8690
}
8791

88-
std::array<Age, kRequiredSize> table_;
92+
#if defined(V8_CC_GNU)
93+
// gcc disallows flexible arrays in otherwise empty classes.
94+
Age table_[0];
95+
#else // !defined(V8_CC_GNU)
96+
Age table_[];
97+
#endif // !defined(V8_CC_GNU)
8998
};
9099

91-
static_assert(sizeof(AgeTable) == 1 * api_constants::kMB,
92-
"Size of AgeTable is 1MB");
93-
94100
#endif // CPPGC_YOUNG_GENERATION
95101

96102
struct CagedHeapLocalData final {
97103
V8_INLINE static CagedHeapLocalData& Get() {
98104
return *reinterpret_cast<CagedHeapLocalData*>(CagedHeapBase::GetBase());
99105
}
100106

107+
static constexpr size_t CalculateLocalDataSizeForHeapSize(size_t heap_size) {
108+
return AgeTable::CalculateAgeTableSizeForHeapSize(heap_size);
109+
}
110+
101111
#if defined(CPPGC_YOUNG_GENERATION)
102112
AgeTable age_table;
103113
#endif

deps/include/cppgc/internal/caged-heap.h

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,24 +33,31 @@ class V8_EXPORT CagedHeapBase {
3333

3434
V8_INLINE static bool AreWithinCage(const void* addr1, const void* addr2) {
3535
#if defined(CPPGC_2GB_CAGE)
36-
static constexpr size_t kHalfWordShift = sizeof(uint32_t) * CHAR_BIT - 1;
36+
static constexpr size_t kHeapBaseShift = sizeof(uint32_t) * CHAR_BIT - 1;
3737
#else //! defined(CPPGC_2GB_CAGE)
38-
static constexpr size_t kHalfWordShift = sizeof(uint32_t) * CHAR_BIT;
38+
#if defined(CPPGC_POINTER_COMPRESSION)
39+
static constexpr size_t kHeapBaseShift =
40+
31 + api_constants::kPointerCompressionShift;
41+
#else // !defined(CPPGC_POINTER_COMPRESSION)
42+
static constexpr size_t kHeapBaseShift = sizeof(uint32_t) * CHAR_BIT;
43+
#endif // !defined(CPPGC_POINTER_COMPRESSION)
3944
#endif //! defined(CPPGC_2GB_CAGE)
40-
static_assert((static_cast<size_t>(1) << kHalfWordShift) ==
41-
api_constants::kCagedHeapReservationSize);
45+
static_assert((static_cast<size_t>(1) << kHeapBaseShift) ==
46+
api_constants::kCagedHeapMaxReservationSize);
4247
CPPGC_DCHECK(g_heap_base_);
4348
return !(((reinterpret_cast<uintptr_t>(addr1) ^ g_heap_base_) |
4449
(reinterpret_cast<uintptr_t>(addr2) ^ g_heap_base_)) >>
45-
kHalfWordShift);
50+
kHeapBaseShift);
4651
}
4752

4853
V8_INLINE static uintptr_t GetBase() { return g_heap_base_; }
54+
V8_INLINE static size_t GetAgeTableSize() { return g_age_table_size_; }
4955

5056
private:
5157
friend class CagedHeap;
5258

5359
static uintptr_t g_heap_base_;
60+
static size_t g_age_table_size_;
5461
};
5562

5663
} // namespace internal

deps/include/cppgc/internal/compiler-specific.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
#ifndef INCLUDE_CPPGC_INTERNAL_COMPILER_SPECIFIC_H_
66
#define INCLUDE_CPPGC_INTERNAL_COMPILER_SPECIFIC_H_
77

8+
#include "v8config.h" // NOLINT(build/include_directory)
9+
810
namespace cppgc {
911

1012
#if defined(__has_attribute)
@@ -21,7 +23,13 @@ namespace cppgc {
2123

2224
// [[no_unique_address]] comes in C++20 but supported in clang with -std >=
2325
// c++11.
24-
#if CPPGC_HAS_CPP_ATTRIBUTE(no_unique_address)
26+
#if defined(V8_CC_MSVC) && CPPGC_HAS_CPP_ATTRIBUTE(msvc::no_unique_address)
27+
// Unfortunately MSVC ignores [[no_unique_address]] (see
28+
// https://devblogs.microsoft.com/cppblog/msvc-cpp20-and-the-std-cpp20-switch/#msvc-extensions-and-abi),
29+
// and clang-cl matches it for ABI compatibility reasons. We need to prefer
30+
// [[msvc::no_unique_address]] when available if we actually want any effect.
31+
#define CPPGC_NO_UNIQUE_ADDRESS [[msvc::no_unique_address]]
32+
#elif CPPGC_HAS_CPP_ATTRIBUTE(no_unique_address)
2533
#define CPPGC_NO_UNIQUE_ADDRESS [[no_unique_address]]
2634
#else
2735
#define CPPGC_NO_UNIQUE_ADDRESS

0 commit comments

Comments
 (0)