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,
DEFINE_IMPLICATION(liftoff_only, liftoff)
DEFINE_NEG_IMPLICATION(liftoff_only, wasm_tier_up)
DEFINE_NEG_IMPLICATION(fuzzing, liftoff_only)
DEFINE_BOOL(experimental_liftoff_extern_ref, true,
"enable support for externref in Liftoff")
DEFINE_DEBUG_BOOL(
enable_testing_opcode_in_wasm, false,
"enables a testing opcode in wasm that is only implemented in TurboFan")
......
......@@ -539,9 +539,6 @@ class LiftoffCompiler {
// Lazily update {supported_types_}; then check again.
if (CpuFeatures::SupportsWasmSimd128()) supported_types_.Add(kS128);
if (FLAG_experimental_liftoff_extern_ref) {
supported_types_.Add(kExternRefSupported);
}
if (supported_types_.contains(kind)) return true;
LiftoffBailoutReason bailout_reason;
......@@ -769,37 +766,39 @@ class LiftoffCompiler {
// Initialize locals beyond parameters.
if (num_params < __ num_locals()) CODE_COMMENT("init locals");
if (SpillLocalsInitially(decoder, num_params)) {
bool has_refs = false;
for (uint32_t param_idx = num_params; param_idx < __ num_locals();
++param_idx) {
ValueKind kind = __ local_kind(param_idx);
has_refs |= is_reference(kind);
__ PushStack(kind);
}
int spill_size = __ TopSpillOffset() - params_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 {
for (uint32_t param_idx = num_params; param_idx < __ num_locals();
++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});
}
}
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());
if (V8_UNLIKELY(debug_sidetable_builder_)) {
......@@ -1643,10 +1642,6 @@ class LiftoffCompiler {
nullptr);
});
case kExprRefIsNull: {
if (!FLAG_experimental_liftoff_extern_ref) {
unsupported(decoder, kRefTypes, "ref_is_null");
return;
}
LiftoffRegList pinned;
LiftoffRegister ref = pinned.set(__ PopToRegister());
LiftoffRegister null = __ GetUnusedRegister(kGpReg, pinned);
......@@ -2070,10 +2065,6 @@ class LiftoffCompiler {
}
void RefNull(FullDecoder* decoder, ValueType type, Value*) {
if (!FLAG_experimental_liftoff_extern_ref) {
unsupported(decoder, kRefTypes, "ref_null");
return;
}
LiftoffRegister null = __ GetUnusedRegister(kGpReg, {});
LoadNullValue(null.gp(), {});
__ PushRegister(type.kind(), null);
......@@ -6117,8 +6108,9 @@ class LiftoffCompiler {
static constexpr WasmOpcode kNoOutstandingOp = kExprUnreachable;
static constexpr base::EnumSet<ValueKind> kUnconditionallySupported{
kI32, kI64, kF32, kF64};
static constexpr base::EnumSet<ValueKind> kExternRefSupported{
// MVP:
kI32, kI64, kF32, kF64,
// Extern ref:
kRef, kOptRef, kRtt, kRttWithDepth, kI8, kI16};
LiftoffAssembler asm_;
......@@ -6223,8 +6215,6 @@ class LiftoffCompiler {
constexpr WasmOpcode LiftoffCompiler::kNoOutstandingOp;
// static
constexpr base::EnumSet<ValueKind> LiftoffCompiler::kUnconditionallySupported;
// static
constexpr base::EnumSet<ValueKind> LiftoffCompiler::kExternRefSupported;
} // 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