Skip to content

Commit f3e475f

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

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
@@ -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)