Skip to content

Commit c05c23f

Browse files
StefanStojanovictargos
authored andcommitted
deps: patch V8 to fix Windows build
PR-URL: #61898 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Filip Skokan <[email protected]> Reviewed-By: Rafael Gonzaga <[email protected]> Reviewed-By: Chengzhong Wu <[email protected]>
1 parent dfb7b4b commit c05c23f

4 files changed

Lines changed: 15 additions & 2 deletions

File tree

common.gypi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141
# Reset this number to 0 on major V8 upgrades.
4242
# Increment by one for each non-official patch applied to deps/v8.
43-
'v8_embedder_string': '-node.6',
43+
'v8_embedder_string': '-node.7',
4444

4545
##### V8 defaults for Node.js #####
4646

deps/v8/include/v8-internal.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,11 @@ struct TagRange {
479479
constexpr TagRange(Tag first, Tag last) : first(first), last(last) {
480480
#ifdef V8_ENABLE_CHECKS
481481
// This would typically be a DCHECK, but that's not available here.
482+
#if V8_HAS_BUILTIN_UNREACHABLE
482483
if (first > last) __builtin_unreachable(); // Invalid tag range.
484+
#elif defined(_MSC_VER)
485+
if (first > last) __assume(0); // Invalid tag range.
486+
#endif
483487
#endif
484488
}
485489

deps/v8/src/flags/flags.cc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,8 +307,13 @@ constexpr size_t kNumFlags = arraysize(flags);
307307

308308
base::Vector<Flag> Flags() { return base::ArrayVector(flags); }
309309

310+
#if V8_CC_MSVC && defined(_DEBUG)
311+
std::array<int, kNumFlags> GetSortedFlagIndices() {
312+
const char* kFlagNames[] = {
313+
#else
310314
consteval std::array<int, kNumFlags> GetSortedFlagIndices() {
311315
constexpr const char* kFlagNames[] = {
316+
#endif
312317
#define FLAG_MODE_APPLY_NAME(nam) #nam,
313318
#define FLAG_ALIAS(ftype, ctype, alias, nam) #alias,
314319
#include "src/flags/flag-definitions.h" // NOLINT(build/include)
@@ -340,7 +345,11 @@ struct FlagNameGreater {
340345
class FlagMapByName {
341346
public:
342347
FlagMapByName() {
348+
#if V8_CC_MSVC && defined(_DEBUG)
349+
const std::array<int, kNumFlags> sorted_indices =
350+
#else
343351
constexpr std::array<int, kNumFlags> sorted_indices =
352+
#endif
344353
GetSortedFlagIndices();
345354
for (size_t i = 0; i < kNumFlags; ++i) {
346355
flags_[i] = &flags[sorted_indices[i]];

deps/v8/src/objects/backing-store.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ std::unique_ptr<BackingStore> BackingStore::TryAllocateAndPartiallyCommitMemory(
322322
// For accounting purposes, whether a GC was necessary.
323323
bool did_retry = false;
324324

325-
auto gc_retry = [&](const std::function<bool()>& fn) {
325+
auto gc_retry = [&](const auto& fn) {
326326
if (fn()) return true;
327327
// Collect garbage and retry.
328328
did_retry = true;

0 commit comments

Comments
 (0)