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

[wasm] Remove --experimental-liftoff-extern-ref flag

Extern ref in Liftoff is enabled since M-90
(https://crrev.com/c/2625886), hence remove the flag to simplify the
code.

R=ahaas@chromium.org

Bug: v8:11879
Change-Id: Ie72dfbc006d6f42e2e9e83d44ff78e3c53a82614
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2996195Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75478}
parent ef68870f
...@@ -951,8 +951,6 @@ DEFINE_BOOL(liftoff_only, false, ...@@ -951,8 +951,6 @@ DEFINE_BOOL(liftoff_only, false,
DEFINE_IMPLICATION(liftoff_only, liftoff) DEFINE_IMPLICATION(liftoff_only, liftoff)
DEFINE_NEG_IMPLICATION(liftoff_only, wasm_tier_up) DEFINE_NEG_IMPLICATION(liftoff_only, wasm_tier_up)
DEFINE_NEG_IMPLICATION(fuzzing, liftoff_only) DEFINE_NEG_IMPLICATION(fuzzing, liftoff_only)
DEFINE_BOOL(experimental_liftoff_extern_ref, true,
"enable support for externref in Liftoff")
DEFINE_DEBUG_BOOL( DEFINE_DEBUG_BOOL(
enable_testing_opcode_in_wasm, false, enable_testing_opcode_in_wasm, false,
"enables a testing opcode in wasm that is only implemented in TurboFan") "enables a testing opcode in wasm that is only implemented in TurboFan")
......
...@@ -539,9 +539,6 @@ class LiftoffCompiler { ...@@ -539,9 +539,6 @@ class LiftoffCompiler {
// Lazily update {supported_types_}; then check again. // Lazily update {supported_types_}; then check again.
if (CpuFeatures::SupportsWasmSimd128()) supported_types_.Add(kS128); if (CpuFeatures::SupportsWasmSimd128()) supported_types_.Add(kS128);
if (FLAG_experimental_liftoff_extern_ref) {
supported_types_.Add(kExternRefSupported);
}
if (supported_types_.contains(kind)) return true; if (supported_types_.contains(kind)) return true;
LiftoffBailoutReason bailout_reason; LiftoffBailoutReason bailout_reason;
...@@ -769,37 +766,39 @@ class LiftoffCompiler { ...@@ -769,37 +766,39 @@ class LiftoffCompiler {
// Initialize locals beyond parameters. // Initialize locals beyond parameters.
if (num_params < __ num_locals()) CODE_COMMENT("init locals"); if (num_params < __ num_locals()) CODE_COMMENT("init locals");
if (SpillLocalsInitially(decoder, num_params)) { if (SpillLocalsInitially(decoder, num_params)) {
bool has_refs = false;
for (uint32_t param_idx = num_params; param_idx < __ num_locals(); for (uint32_t param_idx = num_params; param_idx < __ num_locals();
++param_idx) { ++param_idx) {
ValueKind kind = __ local_kind(param_idx); ValueKind kind = __ local_kind(param_idx);
has_refs |= is_reference(kind);
__ PushStack(kind); __ PushStack(kind);
} }
int spill_size = __ TopSpillOffset() - params_size; int spill_size = __ TopSpillOffset() - params_size;
__ FillStackSlotsWithZero(params_size, spill_size); __ FillStackSlotsWithZero(params_size, spill_size);
// Initialize all reference type locals with ref.null.
if (has_refs) {
Register null_ref_reg = __ GetUnusedRegister(kGpReg, {}).gp();
LoadNullValue(null_ref_reg, {});
for (uint32_t local_index = num_params; local_index < __ num_locals();
++local_index) {
ValueKind kind = __ local_kind(local_index);
if (is_reference(kind)) {
__ Spill(__ cache_state()->stack_state[local_index].offset(),
LiftoffRegister(null_ref_reg), kind);
}
}
}
} else { } else {
for (uint32_t param_idx = num_params; param_idx < __ num_locals(); for (uint32_t param_idx = num_params; param_idx < __ num_locals();
++param_idx) { ++param_idx) {
ValueKind kind = __ local_kind(param_idx); ValueKind kind = __ local_kind(param_idx);
// Anything which is not i32 or i64 requires spilling.
DCHECK(kind == kI32 || kind == kI64);
__ PushConstant(kind, int32_t{0}); __ PushConstant(kind, int32_t{0});
} }
} }
if (FLAG_experimental_liftoff_extern_ref) {
// Initialize all reference type locals with ref.null.
Register null_ref_reg = no_reg;
for (uint32_t local_index = num_params; local_index < __ num_locals();
++local_index) {
ValueKind kind = __ local_kind(local_index);
if (is_reference(kind)) {
if (null_ref_reg == no_reg) {
null_ref_reg = __ GetUnusedRegister(kGpReg, {}).gp();
LoadNullValue(null_ref_reg, {});
}
__ Spill(__ cache_state()->stack_state[local_index].offset(),
LiftoffRegister(null_ref_reg), kind);
}
}
}
DCHECK_EQ(__ num_locals(), __ cache_state()->stack_height()); DCHECK_EQ(__ num_locals(), __ cache_state()->stack_height());
if (V8_UNLIKELY(debug_sidetable_builder_)) { if (V8_UNLIKELY(debug_sidetable_builder_)) {
...@@ -1643,10 +1642,6 @@ class LiftoffCompiler { ...@@ -1643,10 +1642,6 @@ class LiftoffCompiler {
nullptr); nullptr);
}); });
case kExprRefIsNull: { case kExprRefIsNull: {
if (!FLAG_experimental_liftoff_extern_ref) {
unsupported(decoder, kRefTypes, "ref_is_null");
return;
}
LiftoffRegList pinned; LiftoffRegList pinned;
LiftoffRegister ref = pinned.set(__ PopToRegister()); LiftoffRegister ref = pinned.set(__ PopToRegister());
LiftoffRegister null = __ GetUnusedRegister(kGpReg, pinned); LiftoffRegister null = __ GetUnusedRegister(kGpReg, pinned);
...@@ -2070,10 +2065,6 @@ class LiftoffCompiler { ...@@ -2070,10 +2065,6 @@ class LiftoffCompiler {
} }
void RefNull(FullDecoder* decoder, ValueType type, Value*) { void RefNull(FullDecoder* decoder, ValueType type, Value*) {
if (!FLAG_experimental_liftoff_extern_ref) {
unsupported(decoder, kRefTypes, "ref_null");
return;
}
LiftoffRegister null = __ GetUnusedRegister(kGpReg, {}); LiftoffRegister null = __ GetUnusedRegister(kGpReg, {});
LoadNullValue(null.gp(), {}); LoadNullValue(null.gp(), {});
__ PushRegister(type.kind(), null); __ PushRegister(type.kind(), null);
...@@ -6117,8 +6108,9 @@ class LiftoffCompiler { ...@@ -6117,8 +6108,9 @@ class LiftoffCompiler {
static constexpr WasmOpcode kNoOutstandingOp = kExprUnreachable; static constexpr WasmOpcode kNoOutstandingOp = kExprUnreachable;
static constexpr base::EnumSet<ValueKind> kUnconditionallySupported{ static constexpr base::EnumSet<ValueKind> kUnconditionallySupported{
kI32, kI64, kF32, kF64}; // MVP:
static constexpr base::EnumSet<ValueKind> kExternRefSupported{ kI32, kI64, kF32, kF64,
// Extern ref:
kRef, kOptRef, kRtt, kRttWithDepth, kI8, kI16}; kRef, kOptRef, kRtt, kRttWithDepth, kI8, kI16};
LiftoffAssembler asm_; LiftoffAssembler asm_;
...@@ -6223,8 +6215,6 @@ class LiftoffCompiler { ...@@ -6223,8 +6215,6 @@ class LiftoffCompiler {
constexpr WasmOpcode LiftoffCompiler::kNoOutstandingOp; constexpr WasmOpcode LiftoffCompiler::kNoOutstandingOp;
// static // static
constexpr base::EnumSet<ValueKind> LiftoffCompiler::kUnconditionallySupported; constexpr base::EnumSet<ValueKind> LiftoffCompiler::kUnconditionallySupported;
// static
constexpr base::EnumSet<ValueKind> LiftoffCompiler::kExternRefSupported;
} // namespace } // namespace
......
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