Skip to content

Commit

Permalink
deps: patch V8 to support compilation with MSVC
Browse files Browse the repository at this point in the history
After enabling -std:c++20 on Windows, patch is now much smaller.

PR-URL: #52465
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
  • Loading branch information
StefanStojanovic authored and RafaelGSS committed Apr 22, 2024
1 parent 2b1e7c2 commit 3795e97
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 3 additions & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

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

##### V8 defaults for Node.js #####

Expand Down Expand Up @@ -288,6 +288,8 @@
'/Zc:__cplusplus',
# The following option enables c++20 on Windows. This is needed for V8 v12.4+
'-std:c++20',
# The following option reduces the "error C1060: compiler is out of heap space"
'/Zm2000',
],
'BufferSecurityCheck': 'true',
'DebugInformationFormat': 1, # /Z7 embed info in .obj files
Expand Down
7 changes: 4 additions & 3 deletions deps/v8/src/compiler/backend/instruction-selector-adapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -855,12 +855,13 @@ struct TurboshaftAdapter : public turboshaft::OperationMatcher {
*traps_on_null = load_->kind.trap_on_null;
#if V8_ENABLE_WEBASSEMBLY
} else {
DCHECK((load_transform_ && !load_transform_->load_kind.trap_on_null)
#if V8_ENABLE_WASM_SIMD256_REVEC
DCHECK((load_transform_ && !load_transform_->load_kind.trap_on_null)
|| (load_transform256_ &&
!load_transform256_->load_kind.trap_on_null)
!load_transform256_->load_kind.trap_on_null));
#else
DCHECK((load_transform_ && !load_transform_->load_kind.trap_on_null));
#endif // V8_ENABLE_WASM_SIMD256_REVEC
);
*traps_on_null = false;
#endif // V8_ENABLE_WEBASSEMBLY
}
Expand Down
2 changes: 0 additions & 2 deletions deps/v8/src/objects/tagged-field.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,10 @@ static_assert(sizeof(UnalignedDoubleMember) == sizeof(double));
#define FLEXIBLE_ARRAY_MEMBER(Type, name) \
using FlexibleDataReturnType = Type[0]; \
FlexibleDataReturnType& name() { \
static_assert(alignof(Type) <= alignof(decltype(*this))); \
using ReturnType = Type[0]; \
return reinterpret_cast<ReturnType&>(*(this + 1)); \
} \
const FlexibleDataReturnType& name() const { \
static_assert(alignof(Type) <= alignof(decltype(*this))); \
using ReturnType = Type[0]; \
return reinterpret_cast<const ReturnType&>(*(this + 1)); \
} \
Expand Down

0 comments on commit 3795e97

Please sign in to comment.