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> { ...@@ -4215,11 +4215,7 @@ class WasmFullDecoder : public WasmDecoder<validate> {
return opcode_length + imm.length; return opcode_length + imm.length;
} }
case kExprRttFreshSub: case kExprRttFreshSub:
if (!FLAG_experimental_wasm_gc_experiments) { CHECK_PROTOTYPE_OPCODE(gc_experiments);
this->DecodeError(
"rtt.fresh_sub requires --experimental-wasm-gc-experiments");
return 0;
}
V8_FALLTHROUGH; V8_FALLTHROUGH;
case kExprRttSub: { case kExprRttSub: {
IndexImmediate<validate> imm(this, this->pc_ + opcode_length, IndexImmediate<validate> imm(this, this->pc_ + opcode_length,
......
...@@ -1866,7 +1866,7 @@ class ModuleDecoderImpl : public Decoder { ...@@ -1866,7 +1866,7 @@ class ModuleDecoderImpl : public Decoder {
break; break;
} }
case kExprRttFreshSub: case kExprRttFreshSub:
if (!FLAG_experimental_wasm_gc_experiments) { if (!V8_LIKELY(enabled_features_.has_gc_experiments())) {
error(pc(), error(pc(),
"rtt.fresh requires --experimental-wasm-gc-experiments"); "rtt.fresh requires --experimental-wasm-gc-experiments");
return {}; return {};
......
...@@ -1090,9 +1090,8 @@ TEST_F(FunctionBodyDecoderTest, UnreachableRefTypes) { ...@@ -1090,9 +1090,8 @@ TEST_F(FunctionBodyDecoderTest, UnreachableRefTypes) {
WASM_FEATURE_SCOPE(reftypes); WASM_FEATURE_SCOPE(reftypes);
WASM_FEATURE_SCOPE(typed_funcref); WASM_FEATURE_SCOPE(typed_funcref);
WASM_FEATURE_SCOPE(gc); WASM_FEATURE_SCOPE(gc);
WASM_FEATURE_SCOPE(gc_experiments);
WASM_FEATURE_SCOPE(return_call); 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 function_index = builder.AddFunction(sigs.i_ii());
byte struct_index = builder.AddStruct({F(kWasmI32, true), F(kWasmI64, true)}); byte struct_index = builder.AddStruct({F(kWasmI32, true), F(kWasmI64, true)});
...@@ -4291,9 +4290,7 @@ TEST_F(FunctionBodyDecoderTest, RttSub) { ...@@ -4291,9 +4290,7 @@ TEST_F(FunctionBodyDecoderTest, RttSub) {
WASM_FEATURE_SCOPE(reftypes); WASM_FEATURE_SCOPE(reftypes);
WASM_FEATURE_SCOPE(typed_funcref); WASM_FEATURE_SCOPE(typed_funcref);
WASM_FEATURE_SCOPE(gc); WASM_FEATURE_SCOPE(gc);
WASM_FEATURE_SCOPE(eh); WASM_FEATURE_SCOPE(gc_experiments);
FlagScope<bool> flag_gc_experiments(&FLAG_experimental_wasm_gc_experiments,
true);
TestModuleBuilder builder; TestModuleBuilder builder;
module = builder.module(); module = builder.module();
......
...@@ -848,8 +848,8 @@ TEST_F(WasmModuleVerifyTest, GlobalRttFreshSubOfCanon) { ...@@ -848,8 +848,8 @@ TEST_F(WasmModuleVerifyTest, GlobalRttFreshSubOfCanon) {
WASM_FEATURE_SCOPE(reftypes); WASM_FEATURE_SCOPE(reftypes);
WASM_FEATURE_SCOPE(typed_funcref); WASM_FEATURE_SCOPE(typed_funcref);
WASM_FEATURE_SCOPE(gc); WASM_FEATURE_SCOPE(gc);
FlagScope<bool> flag_gc_experiments(&FLAG_experimental_wasm_gc_experiments, WASM_FEATURE_SCOPE(gc_experiments);
true);
static const byte data[] = { static const byte data[] = {
SECTION(Type, ENTRY_COUNT(2), SECTION(Type, ENTRY_COUNT(2),
WASM_STRUCT_DEF(FIELD_COUNT(1), STRUCT_FIELD(kI32Code, true)), WASM_STRUCT_DEF(FIELD_COUNT(1), STRUCT_FIELD(kI32Code, true)),
...@@ -886,8 +886,8 @@ TEST_F(WasmModuleVerifyTest, GlobalRttFreshSubOfSubOfCanon) { ...@@ -886,8 +886,8 @@ TEST_F(WasmModuleVerifyTest, GlobalRttFreshSubOfSubOfCanon) {
WASM_FEATURE_SCOPE(reftypes); WASM_FEATURE_SCOPE(reftypes);
WASM_FEATURE_SCOPE(typed_funcref); WASM_FEATURE_SCOPE(typed_funcref);
WASM_FEATURE_SCOPE(gc); WASM_FEATURE_SCOPE(gc);
FlagScope<bool> flag_gc_experiments(&FLAG_experimental_wasm_gc_experiments, WASM_FEATURE_SCOPE(gc_experiments);
true);
static const byte data[] = { static const byte data[] = {
SECTION(Type, ENTRY_COUNT(2), SECTION(Type, ENTRY_COUNT(2),
WASM_STRUCT_DEF(FIELD_COUNT(1), STRUCT_FIELD(kI32Code, true)), WASM_STRUCT_DEF(FIELD_COUNT(1), STRUCT_FIELD(kI32Code, true)),
...@@ -907,8 +907,8 @@ TEST_F(WasmModuleVerifyTest, GlobalRttFreshSubOfFreshSubOfCanon) { ...@@ -907,8 +907,8 @@ TEST_F(WasmModuleVerifyTest, GlobalRttFreshSubOfFreshSubOfCanon) {
WASM_FEATURE_SCOPE(reftypes); WASM_FEATURE_SCOPE(reftypes);
WASM_FEATURE_SCOPE(typed_funcref); WASM_FEATURE_SCOPE(typed_funcref);
WASM_FEATURE_SCOPE(gc); WASM_FEATURE_SCOPE(gc);
FlagScope<bool> flag_gc_experiments(&FLAG_experimental_wasm_gc_experiments, WASM_FEATURE_SCOPE(gc_experiments);
true);
static const byte data[] = { static const byte data[] = {
SECTION(Type, ENTRY_COUNT(2), SECTION(Type, ENTRY_COUNT(2),
WASM_STRUCT_DEF(FIELD_COUNT(1), STRUCT_FIELD(kI32Code, true)), WASM_STRUCT_DEF(FIELD_COUNT(1), STRUCT_FIELD(kI32Code, true)),
...@@ -952,8 +952,8 @@ TEST_F(WasmModuleVerifyTest, GlobalRttFreshSubOfGlobal) { ...@@ -952,8 +952,8 @@ TEST_F(WasmModuleVerifyTest, GlobalRttFreshSubOfGlobal) {
WASM_FEATURE_SCOPE(reftypes); WASM_FEATURE_SCOPE(reftypes);
WASM_FEATURE_SCOPE(typed_funcref); WASM_FEATURE_SCOPE(typed_funcref);
WASM_FEATURE_SCOPE(gc); WASM_FEATURE_SCOPE(gc);
FlagScope<bool> flag_gc_experiments(&FLAG_experimental_wasm_gc_experiments, WASM_FEATURE_SCOPE(gc_experiments);
true);
static const byte data[] = { static const byte data[] = {
SECTION(Type, ENTRY_COUNT(2), SECTION(Type, ENTRY_COUNT(2),
WASM_STRUCT_DEF(FIELD_COUNT(1), STRUCT_FIELD(kI32Code, true)), WASM_STRUCT_DEF(FIELD_COUNT(1), STRUCT_FIELD(kI32Code, true)),
...@@ -999,8 +999,8 @@ TEST_F(WasmModuleVerifyTest, GlobalRttFreshSubOfGlobalTypeError) { ...@@ -999,8 +999,8 @@ TEST_F(WasmModuleVerifyTest, GlobalRttFreshSubOfGlobalTypeError) {
WASM_FEATURE_SCOPE(reftypes); WASM_FEATURE_SCOPE(reftypes);
WASM_FEATURE_SCOPE(typed_funcref); WASM_FEATURE_SCOPE(typed_funcref);
WASM_FEATURE_SCOPE(gc); WASM_FEATURE_SCOPE(gc);
FlagScope<bool> flag_gc_experiments(&FLAG_experimental_wasm_gc_experiments, WASM_FEATURE_SCOPE(gc_experiments);
true);
static const byte data[] = { static const byte data[] = {
SECTION(Type, ENTRY_COUNT(1), SECTION(Type, ENTRY_COUNT(1),
WASM_STRUCT_DEF(FIELD_COUNT(1), STRUCT_FIELD(kI32Code, true))), WASM_STRUCT_DEF(FIELD_COUNT(1), STRUCT_FIELD(kI32Code, true))),
...@@ -1036,8 +1036,8 @@ TEST_F(WasmModuleVerifyTest, GlobalRttFreshSubIllegalParent) { ...@@ -1036,8 +1036,8 @@ TEST_F(WasmModuleVerifyTest, GlobalRttFreshSubIllegalParent) {
WASM_FEATURE_SCOPE(reftypes); WASM_FEATURE_SCOPE(reftypes);
WASM_FEATURE_SCOPE(typed_funcref); WASM_FEATURE_SCOPE(typed_funcref);
WASM_FEATURE_SCOPE(gc); WASM_FEATURE_SCOPE(gc);
FlagScope<bool> flag_gc_experiments(&FLAG_experimental_wasm_gc_experiments, WASM_FEATURE_SCOPE(gc_experiments);
true);
static const byte data[] = { static const byte data[] = {
SECTION(Type, ENTRY_COUNT(2), SECTION(Type, ENTRY_COUNT(2),
WASM_STRUCT_DEF(FIELD_COUNT(1), STRUCT_FIELD(kI32Code, true)), WASM_STRUCT_DEF(FIELD_COUNT(1), STRUCT_FIELD(kI32Code, true)),
...@@ -1068,8 +1068,8 @@ TEST_F(WasmModuleVerifyTest, RttFreshSubGlobalTypeError) { ...@@ -1068,8 +1068,8 @@ TEST_F(WasmModuleVerifyTest, RttFreshSubGlobalTypeError) {
WASM_FEATURE_SCOPE(reftypes); WASM_FEATURE_SCOPE(reftypes);
WASM_FEATURE_SCOPE(typed_funcref); WASM_FEATURE_SCOPE(typed_funcref);
WASM_FEATURE_SCOPE(gc); WASM_FEATURE_SCOPE(gc);
FlagScope<bool> flag_gc_experiments(&FLAG_experimental_wasm_gc_experiments, WASM_FEATURE_SCOPE(gc_experiments);
true);
static const byte data[] = { static const byte data[] = {
SECTION(Type, ENTRY_COUNT(1), SECTION(Type, ENTRY_COUNT(1),
WASM_STRUCT_DEF(FIELD_COUNT(1), STRUCT_FIELD(kI32Code, true))), 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