Skip to content

Commit e5e8eaa

Browse files
targosnodejs-github-bot
authored andcommitted
Revert "deps: patch V8 to support compilation with MSVC"
This reverts commit 0f98039. PR-URL: #58187 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Rafael Gonzaga <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent f2138b5 commit e5e8eaa

File tree

14 files changed

+26
-89
lines changed

14 files changed

+26
-89
lines changed

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.12',
41+
'v8_embedder_string': '-node.13',
4242

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

deps/v8/src/base/fpu.cc

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -57,21 +57,13 @@ void FPU::SetFlushDenormals(bool value) {
5757
#elif defined(V8_HOST_ARCH_ARM64) || defined(V8_HOST_ARCH_ARM)
5858

5959
namespace {
60-
#if defined(V8_HOST_ARCH_ARM64) && defined(_MSC_VER) && !defined(__clang__)
61-
#include <intrin.h>
62-
#endif
63-
6460
// Bit 24 is the flush-to-zero mode control bit. Setting it to 1 flushes
6561
// denormals to 0.
6662
constexpr int kFlushDenormToZeroBit = (1 << 24);
6763
int GetStatusWord() {
6864
int result;
6965
#if defined(V8_HOST_ARCH_ARM64)
70-
# if defined(_MSC_VER) && !defined(__clang__)
71-
result = _ReadStatusReg(ARM64_FPCR);
72-
# else
73-
asm volatile("mrs %x[result], FPCR" : [result] "=r"(result));
74-
# endif
66+
asm volatile("mrs %x[result], FPCR" : [result] "=r"(result));
7567
#else
7668
asm volatile("vmrs %[result], FPSCR" : [result] "=r"(result));
7769
#endif
@@ -80,11 +72,7 @@ int GetStatusWord() {
8072

8173
void SetStatusWord(int a) {
8274
#if defined(V8_HOST_ARCH_ARM64)
83-
# if defined(_MSC_VER) && !defined(__clang__)
84-
_WriteStatusReg(ARM64_FPCR, a);
85-
# else
86-
asm volatile("msr FPCR, %x[src]" : : [src] "r"(a));
87-
# endif
75+
asm volatile("msr FPCR, %x[src]" : : [src] "r"(a));
8876
#else
8977
asm volatile("vmsr FPSCR, %[src]" : : [src] "r"(a));
9078
#endif

deps/v8/src/codegen/arm64/assembler-arm64.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,14 @@ class AssemblerZone {
168168
public:
169169
explicit AssemblerZone(const MaybeAssemblerZone& zone)
170170
// Create a fresh Zone unless one is already provided.
171-
: maybe_local_zone_(),
171+
: maybe_local_zone_(
172+
std::holds_alternative<Zone*>(zone)
173+
? std::nullopt
174+
: std::make_optional<Zone>(std::get<AccountingAllocator*>(zone),
175+
ZONE_NAME)),
172176
zone_(std::holds_alternative<Zone*>(zone)
173177
? std::get<Zone*>(zone)
174-
: &maybe_local_zone_.emplace(std::get<AccountingAllocator*>(zone), ZONE_NAME)) {}
178+
: &maybe_local_zone_.value()) {}
175179

176180
Zone* get() const { return zone_; }
177181

deps/v8/src/compiler/js-heap-broker.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -879,7 +879,7 @@ ElementAccessFeedback const& JSHeapBroker::ProcessFeedbackMapsForElementAccess(
879879
Tagged<Map> transition_target;
880880

881881
// Don't generate elements kind transitions from stable maps.
882-
if (!map.is_stable() && possible_transition_targets.begin() != possible_transition_targets.end()) {
882+
if (!map.is_stable()) {
883883
// The lock is needed for UnusedPropertyFields (called deep inside
884884
// FindElementsKindTransitionedMap).
885885
MapUpdaterGuardIfNeeded mumd_scope(this);

deps/v8/src/execution/frames.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1292,11 +1292,11 @@ class WasmFrame : public TypedFrame {
12921292
FrameSummaries Summarize() const override;
12931293

12941294
static WasmFrame* cast(StackFrame* frame) {
1295+
DCHECK(frame->is_wasm()
12951296
#ifdef V8_ENABLE_DRUMBRAKE
1296-
DCHECK(frame->is_wasm() && !frame->is_wasm_interpreter_entry());
1297-
#else
1298-
DCHECK(frame->is_wasm());
1297+
&& !frame->is_wasm_interpreter_entry()
12991298
#endif // V8_ENABLE_DRUMBRAKE
1299+
);
13001300
return static_cast<WasmFrame*>(frame);
13011301
}
13021302

deps/v8/src/execution/isolate.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -574,14 +574,10 @@ using DebugObjectCache = std::vector<Handle<HeapObject>>;
574574
#define THREAD_LOCAL_TOP_ADDRESS(type, name) \
575575
inline type* name##_address() { return &thread_local_top()->name##_; }
576576

577-
#if defined(_MSC_VER)
578-
extern thread_local Isolate* g_current_isolate_ V8_CONSTINIT;
579-
#else
580577
// Do not use this variable directly, use Isolate::Current() instead.
581578
// Defined outside of Isolate because Isolate uses V8_EXPORT_PRIVATE.
582579
__attribute__((tls_model(V8_TLS_MODEL))) extern thread_local Isolate*
583580
g_current_isolate_ V8_CONSTINIT;
584-
#endif // defined(_MSC_VER)
585581

586582
// HiddenFactory exists so Isolate can privately inherit from it without making
587583
// Factory's members available to Isolate directly.

deps/v8/src/heap/base/asm/arm64/push_registers_masm.S

Lines changed: 0 additions & 32 deletions
This file was deleted.

deps/v8/src/heap/local-heap.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,10 @@ class MarkingBarrier;
3333
class MutablePageMetadata;
3434
class Safepoint;
3535

36-
#if defined(_MSC_VER)
37-
extern thread_local LocalHeap* g_current_local_heap_ V8_CONSTINIT;
38-
#else
3936
// Do not use this variable directly, use LocalHeap::Current() instead.
4037
// Defined outside of LocalHeap because LocalHeap uses V8_EXPORT_PRIVATE.
4138
__attribute__((tls_model(V8_TLS_MODEL))) extern thread_local LocalHeap*
4239
g_current_local_heap_ V8_CONSTINIT;
43-
#endif // defined(_MSC_VER)
4440

4541
// LocalHeap is used by the GC to track all threads with heap access in order to
4642
// stop them before performing a collection. LocalHeaps can be either Parked or

deps/v8/src/maglev/maglev-graph-builder.cc

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11003,19 +11003,13 @@ MaybeReduceResult MaglevGraphBuilder::TryReduceCallForNewClosure(
1100311003
return BuildCallRuntime(Runtime::kThrowConstructorNonCallableError,
1100411004
{target_node});
1100511005
}
11006-
11007-
#ifdef V8_ENABLE_LEAPTIERING
11008-
RETURN_IF_DONE(TryBuildCallKnownJSFunction(
11009-
target_context, target_node,
11010-
GetRootConstant(RootIndex::kUndefinedValue),
11011-
dispatch_handle,
11012-
shared, feedback_cell, args, feedback_source));
11013-
#else
1101411006
RETURN_IF_DONE(TryBuildCallKnownJSFunction(
1101511007
target_context, target_node,
1101611008
GetRootConstant(RootIndex::kUndefinedValue),
11017-
shared, feedback_cell, args, feedback_source));
11009+
#ifdef V8_ENABLE_LEAPTIERING
11010+
dispatch_handle,
1101811011
#endif
11012+
shared, feedback_cell, args, feedback_source));
1101911013
}
1102011014
return BuildGenericCall(target_node, Call::TargetType::kJSFunction, args);
1102111015
}

deps/v8/src/objects/instance-type-inl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ HEAP_OBJECT_TYPE_LIST(DECL_TYPE)
4242
// Instance types which are associated with one unique map.
4343

4444
template <class type>
45-
V8_INLINE constexpr std::optional<RootIndex> UniqueMapOfInstanceTypeCheck() {
45+
V8_INLINE consteval std::optional<RootIndex> UniqueMapOfInstanceTypeCheck() {
4646
return {};
4747
}
4848

4949
#define INSTANCE_TYPE_MAP(V, rootIndexName, rootAccessorName, class_name) \
5050
template <> \
51-
V8_INLINE constexpr std::optional<RootIndex> \
51+
V8_INLINE consteval std::optional<RootIndex> \
5252
UniqueMapOfInstanceTypeCheck<InstanceTypeTraits::class_name>() { \
5353
return {RootIndex::k##rootIndexName}; \
5454
}

deps/v8/src/objects/tagged-field.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,12 @@ static_assert(sizeof(UnalignedDoubleMember) == sizeof(double));
121121
#define FLEXIBLE_ARRAY_MEMBER(Type, name) \
122122
using FlexibleDataReturnType = Type[0]; \
123123
FlexibleDataReturnType& name() { \
124+
static_assert(alignof(Type) <= alignof(decltype(*this))); \
124125
using ReturnType = Type[0]; \
125126
return reinterpret_cast<ReturnType&>(*(this + 1)); \
126127
} \
127128
const FlexibleDataReturnType& name() const { \
129+
static_assert(alignof(Type) <= alignof(decltype(*this))); \
128130
using ReturnType = Type[0]; \
129131
return reinterpret_cast<const ReturnType&>(*(this + 1)); \
130132
} \

deps/v8/src/runtime/runtime-test.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1204,8 +1204,8 @@ RUNTIME_FUNCTION(Runtime_SetAllocationTimeout) {
12041204
namespace {
12051205

12061206
int FixedArrayLenFromSize(int size) {
1207-
return std::min<int>((size - OFFSET_OF_DATA_START(FixedArray)) / kTaggedSize,
1208-
static_cast<int>(FixedArray::kMaxRegularLength));
1207+
return std::min({(size - OFFSET_OF_DATA_START(FixedArray)) / kTaggedSize,
1208+
FixedArray::kMaxRegularLength});
12091209
}
12101210

12111211
void FillUpOneNewSpacePage(Isolate* isolate, Heap* heap,

deps/v8/src/wasm/wasm-objects.cc

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3009,21 +3009,15 @@ DirectHandle<WasmExportedFunction> WasmExportedFunction::New(
30093009
DirectHandle<WasmFuncRef> func_ref,
30103010
DirectHandle<WasmInternalFunction> internal_function, int arity,
30113011
DirectHandle<Code> export_wrapper) {
3012-
#if V8_ENABLE_DRUMBRAKE
30133012
DCHECK(CodeKind::JS_TO_WASM_FUNCTION == export_wrapper->kind() ||
30143013
(export_wrapper->is_builtin() &&
30153014
(export_wrapper->builtin_id() == Builtin::kJSToWasmWrapper ||
3015+
#if V8_ENABLE_DRUMBRAKE
30163016
export_wrapper->builtin_id() ==
30173017
Builtin::kGenericJSToWasmInterpreterWrapper ||
3018+
#endif // V8_ENABLE_DRUMBRAKE
30183019
export_wrapper->builtin_id() == Builtin::kWasmPromising ||
30193020
export_wrapper->builtin_id() == Builtin::kWasmStressSwitch)));
3020-
#else
3021-
DCHECK(CodeKind::JS_TO_WASM_FUNCTION == export_wrapper->kind() ||
3022-
(export_wrapper->is_builtin() &&
3023-
(export_wrapper->builtin_id() == Builtin::kJSToWasmWrapper ||
3024-
export_wrapper->builtin_id() == Builtin::kWasmPromising ||
3025-
export_wrapper->builtin_id() == Builtin::kWasmStressSwitch)));
3026-
#endif // V8_ENABLE_DRUMBRAKE
30273021
int func_index = internal_function->function_index();
30283022
Factory* factory = isolate->factory();
30293023
DirectHandle<Map> rtt;

deps/v8/third_party/rapidhash-v8/rapidhash.h

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,8 @@ struct PlainHashReader {
153153
/*
154154
* Likely and unlikely macros.
155155
*/
156-
#if defined(_MSC_VER) && !defined(__clang__)
157-
#define _likely_(x) (x)
158-
#define _unlikely_(x) (x)
159-
#else
160-
#define _likely_(x) __builtin_expect(x, 1)
161-
#define _unlikely_(x) __builtin_expect(x, 0)
162-
#endif
156+
#define _likely_(x) __builtin_expect(x, 1)
157+
#define _unlikely_(x) __builtin_expect(x, 0)
163158

164159
/*
165160
* Default seed.

0 commit comments

Comments
 (0)