Commit 83d30dcb authored by Manos Koukoutos's avatar Manos Koukoutos Committed by V8 LUCI CQ

[wasm-gc] Use feature over flag for rtt.fresh_sub

Bug: v8:7748
Change-Id: I4d1badcc31accfc1a2efcd0d12118e7aa436e610
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2940894
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75011}
parent 45662e6f
......@@ -4215,11 +4215,7 @@ class WasmFullDecoder : public WasmDecoder<validate> {
return opcode_length + imm.length;
}
case kExprRttFreshSub:
if (!FLAG_experimental_wasm_gc_experiments) {
this->DecodeError(
"rtt.fresh_sub requires --experimental-wasm-gc-experiments");
return 0;
}
CHECK_PROTOTYPE_OPCODE(gc_experiments);
V8_FALLTHROUGH;
case kExprRttSub: {
IndexImmediate<validate> imm(this, this->pc_ + opcode_length,
......
......@@ -1866,7 +1866,7 @@ class ModuleDecoderImpl : public Decoder {
break;
}
case kExprRttFreshSub:
if (!FLAG_experimental_wasm_gc_experiments) {
if (!V8_LIKELY(enabled_features_.has_gc_experiments())) {
error(pc(),
"rtt.fresh requires --experimental-wasm-gc-experiments");
return {};
......
......@@ -1090,9 +1090,8 @@ TEST_F(FunctionBodyDecoderTest, UnreachableRefTypes) {
WASM_FEATURE_SCOPE(reftypes);
WASM_FEATURE_SCOPE(typed_funcref);
WASM_FEATURE_SCOPE(gc);
WASM_FEATURE_SCOPE(gc_experiments);
WASM_FEATURE_SCOPE(return_call);
FlagScope<bool> flag_gc_experiments(&FLAG_experimental_wasm_gc_experiments,
true);
byte function_index = builder.AddFunction(sigs.i_ii());
byte struct_index = builder.AddStruct({F(kWasmI32, true), F(kWasmI64, true)});
......@@ -4291,9 +4290,7 @@ TEST_F(FunctionBodyDecoderTest, RttSub) {
WASM_FEATURE_SCOPE(reftypes);
WASM_FEATURE_SCOPE(typed_funcref);
WASM_FEATURE_SCOPE(gc);
WASM_FEATURE_SCOPE(eh);
FlagScope<bool> flag_gc_experiments(&FLAG_experimental_wasm_gc_experiments,
true);
WASM_FEATURE_SCOPE(gc_experiments);
TestModuleBuilder builder;
module = builder.module();
......
......@@ -848,8 +848,8 @@ TEST_F(WasmModuleVerifyTest, GlobalRttFreshSubOfCanon) {
WASM_FEATURE_SCOPE(reftypes);
WASM_FEATURE_SCOPE(typed_funcref);
WASM_FEATURE_SCOPE(gc);
FlagScope<bool> flag_gc_experiments(&FLAG_experimental_wasm_gc_experiments,
true);
WASM_FEATURE_SCOPE(gc_experiments);
static const byte data[] = {
SECTION(Type, ENTRY_COUNT(2),
WASM_STRUCT_DEF(FIELD_COUNT(1), STRUCT_FIELD(kI32Code, true)),
......@@ -886,8 +886,8 @@ TEST_F(WasmModuleVerifyTest, GlobalRttFreshSubOfSubOfCanon) {
WASM_FEATURE_SCOPE(reftypes);
WASM_FEATURE_SCOPE(typed_funcref);
WASM_FEATURE_SCOPE(gc);
FlagScope<bool> flag_gc_experiments(&FLAG_experimental_wasm_gc_experiments,
true);
WASM_FEATURE_SCOPE(gc_experiments);
static const byte data[] = {
SECTION(Type, ENTRY_COUNT(2),
WASM_STRUCT_DEF(FIELD_COUNT(1), STRUCT_FIELD(kI32Code, true)),
......@@ -907,8 +907,8 @@ TEST_F(WasmModuleVerifyTest, GlobalRttFreshSubOfFreshSubOfCanon) {
WASM_FEATURE_SCOPE(reftypes);
WASM_FEATURE_SCOPE(typed_funcref);
WASM_FEATURE_SCOPE(gc);
FlagScope<bool> flag_gc_experiments(&FLAG_experimental_wasm_gc_experiments,
true);
WASM_FEATURE_SCOPE(gc_experiments);
static const byte data[] = {
SECTION(Type, ENTRY_COUNT(2),
WASM_STRUCT_DEF(FIELD_COUNT(1), STRUCT_FIELD(kI32Code, true)),
......@@ -952,8 +952,8 @@ TEST_F(WasmModuleVerifyTest, GlobalRttFreshSubOfGlobal) {
WASM_FEATURE_SCOPE(reftypes);
WASM_FEATURE_SCOPE(typed_funcref);
WASM_FEATURE_SCOPE(gc);
FlagScope<bool> flag_gc_experiments(&FLAG_experimental_wasm_gc_experiments,
true);
WASM_FEATURE_SCOPE(gc_experiments);
static const byte data[] = {
SECTION(Type, ENTRY_COUNT(2),
WASM_STRUCT_DEF(FIELD_COUNT(1), STRUCT_FIELD(kI32Code, true)),
......@@ -999,8 +999,8 @@ TEST_F(WasmModuleVerifyTest, GlobalRttFreshSubOfGlobalTypeError) {
WASM_FEATURE_SCOPE(reftypes);
WASM_FEATURE_SCOPE(typed_funcref);
WASM_FEATURE_SCOPE(gc);
FlagScope<bool> flag_gc_experiments(&FLAG_experimental_wasm_gc_experiments,
true);
WASM_FEATURE_SCOPE(gc_experiments);
static const byte data[] = {
SECTION(Type, ENTRY_COUNT(1),
WASM_STRUCT_DEF(FIELD_COUNT(1), STRUCT_FIELD(kI32Code, true))),
......@@ -1036,8 +1036,8 @@ TEST_F(WasmModuleVerifyTest, GlobalRttFreshSubIllegalParent) {
WASM_FEATURE_SCOPE(reftypes);
WASM_FEATURE_SCOPE(typed_funcref);
WASM_FEATURE_SCOPE(gc);
FlagScope<bool> flag_gc_experiments(&FLAG_experimental_wasm_gc_experiments,
true);
WASM_FEATURE_SCOPE(gc_experiments);
static const byte data[] = {
SECTION(Type, ENTRY_COUNT(2),
WASM_STRUCT_DEF(FIELD_COUNT(1), STRUCT_FIELD(kI32Code, true)),
......@@ -1068,8 +1068,8 @@ TEST_F(WasmModuleVerifyTest, RttFreshSubGlobalTypeError) {
WASM_FEATURE_SCOPE(reftypes);
WASM_FEATURE_SCOPE(typed_funcref);
WASM_FEATURE_SCOPE(gc);
FlagScope<bool> flag_gc_experiments(&FLAG_experimental_wasm_gc_experiments,
true);
WASM_FEATURE_SCOPE(gc_experiments);
static const byte data[] = {
SECTION(Type, ENTRY_COUNT(1),
WASM_STRUCT_DEF(FIELD_COUNT(1), STRUCT_FIELD(kI32Code, true))),
......
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