diff --git a/common.gypi b/common.gypi index 426acc33d298da..7c68b59a0027e2 100644 --- a/common.gypi +++ b/common.gypi @@ -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.3', + 'v8_embedder_string': '-node.4', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/src/compiler/js-heap-broker.cc b/deps/v8/src/compiler/js-heap-broker.cc index 2d24ee14532e53..213dd4f023adee 100644 --- a/deps/v8/src/compiler/js-heap-broker.cc +++ b/deps/v8/src/compiler/js-heap-broker.cc @@ -879,7 +879,7 @@ ElementAccessFeedback const& JSHeapBroker::ProcessFeedbackMapsForElementAccess( Tagged 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); diff --git a/deps/v8/src/execution/frames.h b/deps/v8/src/execution/frames.h index 38005d503bdbe7..25fe0900aeae8f 100644 --- a/deps/v8/src/execution/frames.h +++ b/deps/v8/src/execution/frames.h @@ -1292,11 +1292,11 @@ class WasmFrame : public TypedFrame { FrameSummaries Summarize() 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(frame); } diff --git a/deps/v8/src/execution/isolate.h b/deps/v8/src/execution/isolate.h index 4fabc78b1c463f..d9fb185f0b741c 100644 --- a/deps/v8/src/execution/isolate.h +++ b/deps/v8/src/execution/isolate.h @@ -564,10 +564,14 @@ using DebugObjectCache = std::vector>; #define THREAD_LOCAL_TOP_ADDRESS(type, name) \ inline type* name##_address() { return &thread_local_top()->name##_; } +#if defined(_MSC_VER) +extern thread_local Isolate* g_current_isolate_ V8_CONSTINIT; +#else // Do not use this variable directly, use Isolate::Current() instead. // Defined outside of Isolate because Isolate uses V8_EXPORT_PRIVATE. __attribute__((tls_model(V8_TLS_MODEL))) extern thread_local Isolate* g_current_isolate_ V8_CONSTINIT; +#endif // defined(_MSC_VER) // HiddenFactory exists so Isolate can privately inherit from it without making // Factory's members available to Isolate directly. diff --git a/deps/v8/src/heap/local-heap.h b/deps/v8/src/heap/local-heap.h index 2b208403b72d5c..cd91f10ea11be2 100644 --- a/deps/v8/src/heap/local-heap.h +++ b/deps/v8/src/heap/local-heap.h @@ -34,10 +34,14 @@ class MarkingBarrier; class MutablePageMetadata; class Safepoint; +#if defined(_MSC_VER) +extern thread_local LocalHeap* g_current_local_heap_ V8_CONSTINIT; +#else // Do not use this variable directly, use LocalHeap::Current() instead. // Defined outside of LocalHeap because LocalHeap uses V8_EXPORT_PRIVATE. __attribute__((tls_model(V8_TLS_MODEL))) extern thread_local LocalHeap* g_current_local_heap_ V8_CONSTINIT; +#endif // defined(_MSC_VER) // LocalHeap is used by the GC to track all threads with heap access in order to // stop them before performing a collection. LocalHeaps can be either Parked or diff --git a/deps/v8/src/objects/tagged-field.h b/deps/v8/src/objects/tagged-field.h index 0d0654b8467d87..0a11067b43b641 100644 --- a/deps/v8/src/objects/tagged-field.h +++ b/deps/v8/src/objects/tagged-field.h @@ -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(*(this + 1)); \ } \ const FlexibleDataReturnType& name() const { \ - static_assert(alignof(Type) <= alignof(decltype(*this))); \ using ReturnType = Type[0]; \ return reinterpret_cast(*(this + 1)); \ } \ diff --git a/deps/v8/src/wasm/wasm-objects.cc b/deps/v8/src/wasm/wasm-objects.cc index 9a7161c534c83e..a87575a132a9e4 100644 --- a/deps/v8/src/wasm/wasm-objects.cc +++ b/deps/v8/src/wasm/wasm-objects.cc @@ -2748,15 +2748,21 @@ DirectHandle WasmExportedFunction::New( DirectHandle func_ref, DirectHandle internal_function, int arity, DirectHandle 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 rtt;