Commit c4959e25 authored by Clemens Backes's avatar Clemens Backes Committed by V8 LUCI CQ

Revert "Port Generic JS-Wasm Wrapper for arm64"

This reverts commit 5a318a23.

Reason for revert: Fails on Mac arm64: https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Mac%20-%20arm64%20-%20debug/8211/overview

Original change's description:
> Port Generic JS-Wasm Wrapper for arm64
>
> Bug: v8:10701
> Change-Id: I2014f8994c74379663998e2560d1d51b98a4a9a6
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3811834
> Reviewed-by: Jakob Linke <jgruber@chromium.org>
> Commit-Queue: Ilya Rezvov <irezvov@chromium.org>
> Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#82915}

Bug: v8:10701
Change-Id: I9d5f19fedb82e2be64bd313f8cf5821fb0d8c795
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3869145
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82917}
parent f2faee85
This diff is collapsed.
......@@ -2842,35 +2842,59 @@ void TurboAssembler::Prologue() {
void TurboAssembler::EnterFrame(StackFrame::Type type) {
UseScratchRegisterScope temps(this);
if (StackFrame::IsJavaScript(type)) {
if (type == StackFrame::INTERNAL
#if V8_ENABLE_WEBASSEMBLY
|| type == StackFrame::WASM_DEBUG_BREAK
#endif // V8_ENABLE_WEBASSEMBLY
) {
Register type_reg = temps.AcquireX();
Mov(type_reg, StackFrame::TypeToMarker(type));
Push<TurboAssembler::kSignLR>(lr, fp, type_reg, padreg);
const int kFrameSize =
TypedFrameConstants::kFixedFrameSizeFromFp + kSystemPointerSize;
Add(fp, sp, kFrameSize);
// sp[3] : lr
// sp[2] : fp
// sp[1] : type
// sp[0] : for alignment
#if V8_ENABLE_WEBASSEMBLY
} else if (type == StackFrame::WASM ||
type == StackFrame::WASM_COMPILE_LAZY ||
type == StackFrame::WASM_EXIT) {
Register type_reg = temps.AcquireX();
Mov(type_reg, StackFrame::TypeToMarker(type));
Push<TurboAssembler::kSignLR>(lr, fp);
Mov(fp, sp);
Push(type_reg, kWasmInstanceRegister);
// sp[3] : lr
// sp[2] : fp
// sp[1] : type
// sp[0] : wasm instance
#endif // V8_ENABLE_WEBASSEMBLY
} else if (type == StackFrame::CONSTRUCT) {
Register type_reg = temps.AcquireX();
Mov(type_reg, StackFrame::TypeToMarker(type));
// Users of this frame type push a context pointer after the type field,
// so do it here to keep the stack pointer aligned.
Push<TurboAssembler::kSignLR>(lr, fp, type_reg, cp);
// The context pointer isn't part of the fixed frame, so add an extra slot
// to account for it.
Add(fp, sp,
TypedFrameConstants::kFixedFrameSizeFromFp + kSystemPointerSize);
// sp[3] : lr
// sp[2] : fp
// sp[1] : type
// sp[0] : cp
} else {
DCHECK(StackFrame::IsJavaScript(type));
// Just push a minimal "machine frame", saving the frame pointer and return
// address, without any markers.
Push<TurboAssembler::kSignLR>(lr, fp);
Mov(fp, sp);
// sp[1] : lr
// sp[0] : fp
} else {
Register type_reg = temps.AcquireX();
Mov(type_reg, StackFrame::TypeToMarker(type));
Register fourth_reg = no_reg;
if (type == StackFrame::CONSTRUCT) {
fourth_reg = cp;
#if V8_ENABLE_WEBASSEMBLY
} else if (type == StackFrame::WASM ||
type == StackFrame::WASM_COMPILE_LAZY ||
type == StackFrame::WASM_EXIT) {
fourth_reg = kWasmInstanceRegister;
#endif // V8_ENABLE_WEBASSEMBLY
} else {
fourth_reg = padreg;
}
Push<TurboAssembler::kSignLR>(lr, fp, type_reg, fourth_reg);
static constexpr int kSPToFPDelta = 2 * kSystemPointerSize;
Add(fp, sp, kSPToFPDelta);
// sp[3] : lr
// sp[2] : fp
// sp[1] : type
// sp[0] : cp | wasm instance | for alignment
}
}
......
......@@ -959,10 +959,6 @@ DEFINE_VALUE_IMPLICATION(optimize_for_size, max_semi_space_size, size_t{1})
DEFINE_BOOL(wasm_generic_wrapper, true,
"allow use of the generic js-to-wasm wrapper instead of "
"per-signature wrappers")
DEFINE_BOOL(enable_wasm_arm64_generic_wrapper, false,
"allow use of the generic js-to-wasm wrapper instead of "
"per-signature wrappers on arm64")
DEFINE_WEAK_IMPLICATION(future, enable_wasm_arm64_generic_wrapper)
DEFINE_BOOL(expose_wasm, true, "expose wasm interface to JavaScript")
DEFINE_INT(wasm_num_compilation_tasks, 128,
"maximum number of parallel compilation tasks for wasm")
......
......@@ -169,12 +169,7 @@ void WasmCompilationUnit::CompileWasmFunction(Isolate* isolate,
namespace {
bool UseGenericWrapper(const FunctionSig* sig) {
#if V8_TARGET_ARCH_ARM64
if (!v8_flags.enable_wasm_arm64_generic_wrapper) {
return false;
}
#endif
#if (V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_ARM64)
#if V8_TARGET_ARCH_X64
if (sig->returns().size() > 1) {
return false;
}
......
......@@ -17,7 +17,7 @@ namespace test_run_wasm_wrappers {
using testing::CompileAndInstantiateForTesting;
#if (V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_ARM64)
#ifdef V8_TARGET_ARCH_X64
namespace {
Handle<WasmInstanceObject> CompileModule(Zone* zone, Isolate* isolate,
WasmModuleBuilder* builder) {
......@@ -69,9 +69,6 @@ TEST(WrapperBudget) {
// This test assumes use of the generic wrapper.
FlagScope<bool> use_wasm_generic_wrapper(&v8_flags.wasm_generic_wrapper,
true);
FlagScope<bool> use_enable_wasm_arm64_generic_wrapper(
&v8_flags.enable_wasm_arm64_generic_wrapper,
true);
// Initialize the environment and create a module builder.
AccountingAllocator allocator;
......@@ -119,9 +116,6 @@ TEST(WrapperReplacement) {
// This test assumes use of the generic wrapper.
FlagScope<bool> use_wasm_generic_wrapper(&v8_flags.wasm_generic_wrapper,
true);
FlagScope<bool> use_enable_wasm_arm64_generic_wrapper(
&v8_flags.enable_wasm_arm64_generic_wrapper,
true);
// Initialize the environment and create a module builder.
AccountingAllocator allocator;
......@@ -191,9 +185,6 @@ TEST(EagerWrapperReplacement) {
// This test assumes use of the generic wrapper.
FlagScope<bool> use_wasm_generic_wrapper(&v8_flags.wasm_generic_wrapper,
true);
FlagScope<bool> use_enable_wasm_arm64_generic_wrapper(
&v8_flags.enable_wasm_arm64_generic_wrapper,
true);
// Initialize the environment and create a module builder.
AccountingAllocator allocator;
......@@ -299,9 +290,6 @@ TEST(WrapperReplacement_IndirectExport) {
// This test assumes use of the generic wrapper.
FlagScope<bool> use_wasm_generic_wrapper(&v8_flags.wasm_generic_wrapper,
true);
FlagScope<bool> use_enable_wasm_arm64_generic_wrapper(
&v8_flags.enable_wasm_arm64_generic_wrapper,
true);
// Initialize the environment and create a module builder.
AccountingAllocator allocator;
......
......@@ -3,7 +3,6 @@
// found in the LICENSE file.
// Flags: --wasm-generic-wrapper --expose-gc --allow-natives-syntax
// Flags: --enable-wasm-arm64-generic-wrapper
d8.file.execute("test/mjsunit/wasm/wasm-module-builder.js");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment