Skip to content

Commit f10dc6d

Browse files
StefanStojanovictargos
authored andcommitted
deps: patch V8 to fix Windows build
1 parent 21cf280 commit f10dc6d

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
@@ -477,7 +477,11 @@ struct TagRange {
477477
constexpr TagRange(Tag first, Tag last) : first(first), last(last) {
478478
#ifdef V8_ENABLE_CHECKS
479479
// This would typically be a DCHECK, but that's not available here.
480+
#if V8_HAS_BUILTIN_UNREACHABLE
480481
if (first > last) __builtin_unreachable(); // Invalid tag range.
482+
#elif defined(_MSC_VER)
483+
if (first > last) __assume(0); // Invalid tag range.
484+
#endif
481485
#endif
482486
}
483487

deps/v8/src/flags/flags.cc

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

306306
base::Vector<Flag> Flags() { return base::ArrayVector(flags); }
307307

308+
#if V8_CC_MSVC && defined(_DEBUG)
309+
std::array<int, kNumFlags> GetSortedFlagIndices() {
310+
const char* kFlagNames[] = {
311+
#else
308312
consteval std::array<int, kNumFlags> GetSortedFlagIndices() {
309313
constexpr const char* kFlagNames[] = {
314+
#endif
310315
#define FLAG_MODE_APPLY_NAME(nam) #nam,
311316
#define FLAG_ALIAS(ftype, ctype, alias, nam) #alias,
312317
#include "src/flags/flag-definitions.h" // NOLINT(build/include)
@@ -338,7 +343,11 @@ struct FlagNameGreater {
338343
class FlagMapByName {
339344
public:
340345
FlagMapByName() {
346+
#if V8_CC_MSVC && defined(_DEBUG)
347+
const std::array<int, kNumFlags> sorted_indices =
348+
#else
341349
constexpr std::array<int, kNumFlags> sorted_indices =
350+
#endif
342351
GetSortedFlagIndices();
343352
for (size_t i = 0; i < kNumFlags; ++i) {
344353
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
@@ -310,7 +310,7 @@ std::unique_ptr<BackingStore> BackingStore::TryAllocateAndPartiallyCommitMemory(
310310
// For accounting purposes, whether a GC was necessary.
311311
bool did_retry = false;
312312

313-
auto gc_retry = [&](const std::function<bool()>& fn) {
313+
auto gc_retry = [&](const auto& fn) {
314314
if (fn()) return true;
315315
// Collect garbage and retry.
316316
did_retry = true;

0 commit comments

Comments
 (0)