Skip to content

Commit ef66247

Browse files
StefanStojanovictargos
authored andcommitted
deps: patch V8 to fix Windows build
1 parent e153665 commit ef66247

3 files changed

Lines changed: 11 additions & 2 deletions

File tree

common.gypi

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

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

4343
##### V8 defaults for Node.js #####
4444

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)