Skip to content

Commit

Permalink
deps: patch V8 to support compilation with MSVC
Browse files Browse the repository at this point in the history
Co-Authored-By: Michaël Zasso <targos@protonmail.com>
PR-URL: nodejs/node#54536
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
  • Loading branch information
2 people authored and nodejs-github-bot committed Nov 13, 2024
1 parent 7559fd7 commit 4402803
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,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.3',
'v8_embedder_string': '-node.4',

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

Expand Down
2 changes: 1 addition & 1 deletion deps/v8/src/compiler/js-heap-broker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,7 @@ ElementAccessFeedback const& JSHeapBroker::ProcessFeedbackMapsForElementAccess(
Tagged<Map> transition_target;

// Don't generate elements kind transitions from stable maps.
if (!map.is_stable()) {
if (!map.is_stable() && possible_transition_targets.begin() != possible_transition_targets.end()) {
// The lock is needed for UnusedPropertyFields (called deep inside
// FindElementsKindTransitionedMap).
MapUpdaterGuardIfNeeded mumd_scope(this);
Expand Down
6 changes: 3 additions & 3 deletions deps/v8/src/execution/frames.h
Original file line number Diff line number Diff line change
Expand Up @@ -1274,11 +1274,11 @@ class WasmFrame : public TypedFrame {
void Summarize(std::vector<FrameSummary>* frames) const override;

static WasmFrame* cast(StackFrame* frame) {
DCHECK(frame->is_wasm()
#ifdef V8_ENABLE_DRUMBRAKE
&& !frame->is_wasm_interpreter_entry()
DCHECK(frame->is_wasm() && !frame->is_wasm_interpreter_entry());
#else
DCHECK(frame->is_wasm());
#endif // V8_ENABLE_DRUMBRAKE
);
return static_cast<WasmFrame*>(frame);
}

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 @@ -121,12 +121,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
10 changes: 8 additions & 2 deletions deps/v8/src/wasm/wasm-objects.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2595,15 +2595,21 @@ Handle<WasmExportedFunction> WasmExportedFunction::New(
DirectHandle<WasmFuncRef> func_ref,
DirectHandle<WasmInternalFunction> internal_function, int arity,
DirectHandle<Code> export_wrapper) {
#if V8_ENABLE_DRUMBRAKE
DCHECK(CodeKind::JS_TO_WASM_FUNCTION == export_wrapper->kind() ||
(export_wrapper->is_builtin() &&
(export_wrapper->builtin_id() == Builtin::kJSToWasmWrapper ||
#if V8_ENABLE_DRUMBRAKE
export_wrapper->builtin_id() ==
Builtin::kGenericJSToWasmInterpreterWrapper ||
#endif // V8_ENABLE_DRUMBRAKE
export_wrapper->builtin_id() == Builtin::kWasmPromising ||
export_wrapper->builtin_id() == Builtin::kWasmStressSwitch)));
#else
DCHECK(CodeKind::JS_TO_WASM_FUNCTION == export_wrapper->kind() ||
(export_wrapper->is_builtin() &&
(export_wrapper->builtin_id() == Builtin::kJSToWasmWrapper ||
export_wrapper->builtin_id() == Builtin::kWasmPromising ||
export_wrapper->builtin_id() == Builtin::kWasmStressSwitch)));
#endif // V8_ENABLE_DRUMBRAKE
int func_index = internal_function->function_index();
Factory* factory = isolate->factory();
DirectHandle<Map> rtt;
Expand Down

0 comments on commit 4402803

Please sign in to comment.