Commit 524f41db authored by Manos Koukoutos's avatar Manos Koukoutos Committed by Commit Bot

[wasm] Remove multivalue feature flag

Multivalue has been shipped for a while now, so it is time to remove
its experimental feature flag.

Additional change: Set kV8MaxWasmFunctionReturns to the old
kV8MaxWasmFunctionMultiReturns value.

Change-Id: I5c4d33b036e64a7221de17f0e97119bb0a036838
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2817790Reviewed-by: 's avatarThibaud Michaud <thibaudm@chromium.org>
Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#73927}
parent 3a407f7b
...@@ -6568,7 +6568,7 @@ class WasmWrapperGraphBuilder : public WasmGraphBuilder { ...@@ -6568,7 +6568,7 @@ class WasmWrapperGraphBuilder : public WasmGraphBuilder {
Node* BuildCallAllocateJSArray(Node* array_length, Node* context) { Node* BuildCallAllocateJSArray(Node* array_length, Node* context) {
// Since we don't check that args will fit in an array, // Since we don't check that args will fit in an array,
// we make sure this is true based on statically known limits. // we make sure this is true based on statically known limits.
STATIC_ASSERT(wasm::kV8MaxWasmFunctionMultiReturns <= STATIC_ASSERT(wasm::kV8MaxWasmFunctionReturns <=
JSArray::kInitialMaxFastElementArray); JSArray::kInitialMaxFastElementArray);
return gasm_->CallBuiltin(Builtins::kWasmAllocateJSArray, return gasm_->CallBuiltin(Builtins::kWasmAllocateJSArray,
Operator::kEliminatable, array_length, context); Operator::kEliminatable, array_length, context);
...@@ -7055,7 +7055,7 @@ class WasmWrapperGraphBuilder : public WasmGraphBuilder { ...@@ -7055,7 +7055,7 @@ class WasmWrapperGraphBuilder : public WasmGraphBuilder {
SetEffectControl( SetEffectControl(
return_value, return_value,
graph()->NewNode(mcgraph()->common()->IfTrue(), exception_branch)); graph()->NewNode(mcgraph()->common()->IfTrue(), exception_branch));
DCHECK_LT(sig_->return_count(), wasm::kV8MaxWasmFunctionMultiReturns); DCHECK_LT(sig_->return_count(), wasm::kV8MaxWasmFunctionReturns);
size_t return_count = sig_->return_count(); size_t return_count = sig_->return_count();
if (return_count == 0) { if (return_count == 0) {
Return(Int32Constant(0)); Return(Int32Constant(0));
......
...@@ -257,7 +257,6 @@ void Engine::operator delete(void* p) { ::operator delete(p); } ...@@ -257,7 +257,6 @@ void Engine::operator delete(void* p) { ::operator delete(p); }
auto Engine::make(own<Config>&& config) -> own<Engine> { auto Engine::make(own<Config>&& config) -> own<Engine> {
i::FLAG_expose_gc = true; i::FLAG_expose_gc = true;
i::FLAG_experimental_wasm_reftypes = true; i::FLAG_experimental_wasm_reftypes = true;
i::FLAG_experimental_wasm_mv = true;
auto engine = new (std::nothrow) EngineImpl; auto engine = new (std::nothrow) EngineImpl;
if (!engine) return own<Engine>(); if (!engine) return own<Engine>();
engine->platform = v8::platform::NewDefaultPlatform(); engine->platform = v8::platform::NewDefaultPlatform();
......
...@@ -539,13 +539,6 @@ struct BlockTypeImmediate { ...@@ -539,13 +539,6 @@ struct BlockTypeImmediate {
type = value_type_reader::read_value_type<validate>(decoder, pc, &length, type = value_type_reader::read_value_type<validate>(decoder, pc, &length,
module, enabled); module, enabled);
} else { } else {
if (!VALIDATE(enabled.has_mv())) {
DecodeError<validate>(decoder, pc,
"invalid block type %" PRId64
", enable with --experimental-wasm-mv",
block_type);
return;
}
type = kWasmBottom; type = kWasmBottom;
sig_index = static_cast<uint32_t>(block_type); sig_index = static_cast<uint32_t>(block_type);
} }
...@@ -1184,9 +1177,7 @@ class WasmDecoder : public Decoder { ...@@ -1184,9 +1177,7 @@ class WasmDecoder : public Decoder {
module_(module), module_(module),
enabled_(enabled), enabled_(enabled),
detected_(detected), detected_(detected),
sig_(sig) { sig_(sig) {}
if (sig_ && sig_->return_count() > 1) detected_->Add(kFeature_mv);
}
Zone* zone() const { return local_types_.get_allocator().zone(); } Zone* zone() const { return local_types_.get_allocator().zone(); }
...@@ -1433,9 +1424,6 @@ class WasmDecoder : public Decoder { ...@@ -1433,9 +1424,6 @@ class WasmDecoder : public Decoder {
inline bool Complete(CallFunctionImmediate<validate>& imm) { inline bool Complete(CallFunctionImmediate<validate>& imm) {
if (!VALIDATE(imm.index < module_->functions.size())) return false; if (!VALIDATE(imm.index < module_->functions.size())) return false;
imm.sig = module_->functions[imm.index].sig; imm.sig = module_->functions[imm.index].sig;
if (imm.sig->return_count() > 1) {
this->detected_->Add(kFeature_mv);
}
return true; return true;
} }
...@@ -1450,9 +1438,6 @@ class WasmDecoder : public Decoder { ...@@ -1450,9 +1438,6 @@ class WasmDecoder : public Decoder {
inline bool Complete(CallIndirectImmediate<validate>& imm) { inline bool Complete(CallIndirectImmediate<validate>& imm) {
if (!VALIDATE(module_->has_signature(imm.sig_index))) return false; if (!VALIDATE(module_->has_signature(imm.sig_index))) return false;
imm.sig = module_->signature(imm.sig_index); imm.sig = module_->signature(imm.sig_index);
if (imm.sig->return_count() > 1) {
this->detected_->Add(kFeature_mv);
}
return true; return true;
} }
...@@ -1573,9 +1558,6 @@ class WasmDecoder : public Decoder { ...@@ -1573,9 +1558,6 @@ class WasmDecoder : public Decoder {
if (imm.type != kWasmBottom) return true; if (imm.type != kWasmBottom) return true;
if (!VALIDATE(module_->has_signature(imm.sig_index))) return false; if (!VALIDATE(module_->has_signature(imm.sig_index))) return false;
imm.sig = module_->signature(imm.sig_index); imm.sig = module_->signature(imm.sig_index);
if (imm.sig->return_count() > 1) {
this->detected_->Add(kFeature_mv);
}
return true; return true;
} }
......
...@@ -767,7 +767,6 @@ void UpdateFeatureUseCounts(Isolate* isolate, const WasmFeatures& detected) { ...@@ -767,7 +767,6 @@ void UpdateFeatureUseCounts(Isolate* isolate, const WasmFeatures& detected) {
using Feature = v8::Isolate::UseCounterFeature; using Feature = v8::Isolate::UseCounterFeature;
constexpr static std::pair<WasmFeature, Feature> kUseCounters[] = { constexpr static std::pair<WasmFeature, Feature> kUseCounters[] = {
{kFeature_reftypes, Feature::kWasmRefTypes}, {kFeature_reftypes, Feature::kWasmRefTypes},
{kFeature_mv, Feature::kWasmMultiValue},
{kFeature_simd, Feature::kWasmSimdOpcodes}, {kFeature_simd, Feature::kWasmSimdOpcodes},
{kFeature_threads, Feature::kWasmThreadOpcodes}, {kFeature_threads, Feature::kWasmThreadOpcodes},
{kFeature_eh, Feature::kWasmExceptionHandling}}; {kFeature_eh, Feature::kWasmExceptionHandling}};
......
...@@ -1911,10 +1911,8 @@ class ModuleDecoderImpl : public Decoder { ...@@ -1911,10 +1911,8 @@ class ModuleDecoderImpl : public Decoder {
std::vector<ValueType> returns; std::vector<ValueType> returns;
// Parse return types. // Parse return types.
const size_t max_return_count = enabled_features_.has_mv() uint32_t return_count =
? kV8MaxWasmFunctionMultiReturns consume_count("return count", kV8MaxWasmFunctionReturns);
: kV8MaxWasmFunctionReturns;
uint32_t return_count = consume_count("return count", max_return_count);
if (failed()) return nullptr; if (failed()) return nullptr;
for (uint32_t i = 0; ok() && i < return_count; ++i) { for (uint32_t i = 0; ok() && i < return_count; ++i) {
returns.push_back(consume_value_type()); returns.push_back(consume_value_type());
......
...@@ -76,13 +76,6 @@ ...@@ -76,13 +76,6 @@
// Shipped features (enabled by default). Remove the feature flag once they hit // Shipped features (enabled by default). Remove the feature flag once they hit
// stable and are expected to stay enabled. // stable and are expected to stay enabled.
#define FOREACH_WASM_SHIPPED_FEATURE_FLAG(V) /* (force 80 columns) */ \ #define FOREACH_WASM_SHIPPED_FEATURE_FLAG(V) /* (force 80 columns) */ \
/* Multi-value proposal. */ \
/* https://github.com/WebAssembly/multi-value */ \
/* V8 side owner: thibaudm */ \
/* Shipped in v8.6. */ \
/* ITS: https://groups.google.com/g/v8-users/c/pv2E4yFWeF0 */ \
V(mv, "multi-value support", true) \
\
/* Fixed-width SIMD operations. */ \ /* Fixed-width SIMD operations. */ \
/* https://github.com/webassembly/simd */ \ /* https://github.com/webassembly/simd */ \
/* V8 side owner: gdeepti, zhin */ \ /* V8 side owner: gdeepti, zhin */ \
......
...@@ -1475,9 +1475,7 @@ void WebAssemblyFunction(const v8::FunctionCallbackInfo<v8::Value>& args) { ...@@ -1475,9 +1475,7 @@ void WebAssemblyFunction(const v8::FunctionCallbackInfo<v8::Value>& args) {
thrower.TypeError("Argument 0 contains results without 'length'"); thrower.TypeError("Argument 0 contains results without 'length'");
return; return;
} }
if (results_len > (enabled_features.has_mv() if (results_len > i::wasm::kV8MaxWasmFunctionReturns) {
? i::wasm::kV8MaxWasmFunctionMultiReturns
: i::wasm::kV8MaxWasmFunctionReturns)) {
thrower.TypeError("Argument 0 contains too many results"); thrower.TypeError("Argument 0 contains too many results");
return; return;
} }
......
...@@ -43,8 +43,7 @@ constexpr size_t kV8MaxWasmModuleSize = 1024 * 1024 * 1024; // = 1 GiB ...@@ -43,8 +43,7 @@ constexpr size_t kV8MaxWasmModuleSize = 1024 * 1024 * 1024; // = 1 GiB
constexpr size_t kV8MaxWasmFunctionSize = 7654321; constexpr size_t kV8MaxWasmFunctionSize = 7654321;
constexpr size_t kV8MaxWasmFunctionLocals = 50000; constexpr size_t kV8MaxWasmFunctionLocals = 50000;
constexpr size_t kV8MaxWasmFunctionParams = 1000; constexpr size_t kV8MaxWasmFunctionParams = 1000;
constexpr size_t kV8MaxWasmFunctionMultiReturns = 1000; constexpr size_t kV8MaxWasmFunctionReturns = 1000;
constexpr size_t kV8MaxWasmFunctionReturns = 1;
constexpr size_t kV8MaxWasmFunctionBrTableSize = 65520; constexpr size_t kV8MaxWasmFunctionBrTableSize = 65520;
// Don't use this limit directly, but use the value of FLAG_wasm_max_table_size. // Don't use this limit directly, but use the value of FLAG_wasm_max_table_size.
constexpr size_t kV8MaxWasmTableSize = 10000000; constexpr size_t kV8MaxWasmTableSize = 10000000;
......
...@@ -35,9 +35,6 @@ std::ostream& operator<<(std::ostream& os, const FunctionSig& sig) { ...@@ -35,9 +35,6 @@ std::ostream& operator<<(std::ostream& os, const FunctionSig& sig) {
// https://chromium-review.googlesource.com/c/v8/v8/+/2413251). // https://chromium-review.googlesource.com/c/v8/v8/+/2413251).
bool IsJSCompatibleSignature(const FunctionSig* sig, const WasmModule* module, bool IsJSCompatibleSignature(const FunctionSig* sig, const WasmModule* module,
const WasmFeatures& enabled_features) { const WasmFeatures& enabled_features) {
if (!enabled_features.has_mv() && sig->return_count() > 1) {
return false;
}
for (auto type : sig->all()) { for (auto type : sig->all()) {
// TODO(7748): Allow structs, arrays, and rtts when their JS-interaction is // TODO(7748): Allow structs, arrays, and rtts when their JS-interaction is
// decided on. // decided on.
......
...@@ -114,21 +114,18 @@ static void RunInt32AddTest(TestExecutionTier execution_tier, const byte* code, ...@@ -114,21 +114,18 @@ static void RunInt32AddTest(TestExecutionTier execution_tier, const byte* code,
} }
WASM_EXEC_TEST(Int32Add_P2) { WASM_EXEC_TEST(Int32Add_P2) {
EXPERIMENTAL_FLAG_SCOPE(mv);
static const byte code[] = { static const byte code[] = {
WASM_I32_ADD(WASM_LOCAL_GET(0), WASM_LOCAL_GET(1))}; WASM_I32_ADD(WASM_LOCAL_GET(0), WASM_LOCAL_GET(1))};
RunInt32AddTest(execution_tier, code, sizeof(code)); RunInt32AddTest(execution_tier, code, sizeof(code));
} }
WASM_EXEC_TEST(Int32Add_block1) { WASM_EXEC_TEST(Int32Add_block1) {
EXPERIMENTAL_FLAG_SCOPE(mv);
static const byte code[] = { static const byte code[] = {
WASM_BLOCK_X(1, WASM_LOCAL_GET(0), WASM_LOCAL_GET(1)), kExprI32Add}; WASM_BLOCK_X(1, WASM_LOCAL_GET(0), WASM_LOCAL_GET(1)), kExprI32Add};
RunInt32AddTest(execution_tier, code, sizeof(code)); RunInt32AddTest(execution_tier, code, sizeof(code));
} }
WASM_EXEC_TEST(Int32Add_block2) { WASM_EXEC_TEST(Int32Add_block2) {
EXPERIMENTAL_FLAG_SCOPE(mv);
static const byte code[] = { static const byte code[] = {
WASM_BLOCK_X(1, WASM_LOCAL_GET(0), WASM_LOCAL_GET(1), kExprBr, DEPTH_0), WASM_BLOCK_X(1, WASM_LOCAL_GET(0), WASM_LOCAL_GET(1), kExprBr, DEPTH_0),
kExprI32Add}; kExprI32Add};
...@@ -136,7 +133,6 @@ WASM_EXEC_TEST(Int32Add_block2) { ...@@ -136,7 +133,6 @@ WASM_EXEC_TEST(Int32Add_block2) {
} }
WASM_EXEC_TEST(Int32Add_multi_if) { WASM_EXEC_TEST(Int32Add_multi_if) {
EXPERIMENTAL_FLAG_SCOPE(mv);
static const byte code[] = { static const byte code[] = {
WASM_IF_ELSE_X(1, WASM_LOCAL_GET(0), WASM_IF_ELSE_X(1, WASM_LOCAL_GET(0),
WASM_SEQ(WASM_LOCAL_GET(0), WASM_LOCAL_GET(1)), WASM_SEQ(WASM_LOCAL_GET(0), WASM_LOCAL_GET(1)),
...@@ -2741,7 +2737,6 @@ WASM_EXEC_TEST(AddCall) { ...@@ -2741,7 +2737,6 @@ WASM_EXEC_TEST(AddCall) {
} }
WASM_EXEC_TEST(MultiReturnSub) { WASM_EXEC_TEST(MultiReturnSub) {
EXPERIMENTAL_FLAG_SCOPE(mv);
WasmRunner<int32_t, int32_t, int32_t> r(execution_tier); WasmRunner<int32_t, int32_t, int32_t> r(execution_tier);
ValueType storage[] = {kWasmI32, kWasmI32, kWasmI32, kWasmI32}; ValueType storage[] = {kWasmI32, kWasmI32, kWasmI32, kWasmI32};
...@@ -2763,7 +2758,6 @@ WASM_EXEC_TEST(MultiReturnSub) { ...@@ -2763,7 +2758,6 @@ WASM_EXEC_TEST(MultiReturnSub) {
template <typename T> template <typename T>
void RunMultiReturnSelect(TestExecutionTier execution_tier, const T* inputs) { void RunMultiReturnSelect(TestExecutionTier execution_tier, const T* inputs) {
EXPERIMENTAL_FLAG_SCOPE(mv);
ValueType type = ValueType::For(MachineTypeForC<T>()); ValueType type = ValueType::For(MachineTypeForC<T>());
ValueType storage[] = {type, type, type, type, type, type}; ValueType storage[] = {type, type, type, type, type, type};
const size_t kNumReturns = 2; const size_t kNumReturns = 2;
...@@ -3117,7 +3111,6 @@ WASM_EXEC_TEST(Regress_EnsureArguments) { ...@@ -3117,7 +3111,6 @@ WASM_EXEC_TEST(Regress_EnsureArguments) {
} }
WASM_EXEC_TEST(Regress_PushControl) { WASM_EXEC_TEST(Regress_PushControl) {
EXPERIMENTAL_FLAG_SCOPE(mv);
WasmRunner<int32_t> r(execution_tier); WasmRunner<int32_t> r(execution_tier);
BUILD(r, WASM_I32V(42), BUILD(r, WASM_I32V(42),
WASM_IF(WASM_I32V(0), WASM_UNREACHABLE, kExprIf, kVoidCode, kExprEnd)); WASM_IF(WASM_I32V(0), WASM_UNREACHABLE, kExprIf, kVoidCode, kExprEnd));
...@@ -3854,7 +3847,6 @@ TEST(Liftoff_tier_up) { ...@@ -3854,7 +3847,6 @@ TEST(Liftoff_tier_up) {
} }
TEST(Regression_1085507) { TEST(Regression_1085507) {
EXPERIMENTAL_FLAG_SCOPE(mv);
WasmRunner<int32_t> r(TestExecutionTier::kInterpreter); WasmRunner<int32_t> r(TestExecutionTier::kInterpreter);
TestSignatures sigs; TestSignatures sigs;
uint32_t sig_v_i = r.builder().AddSignature(sigs.v_i()); uint32_t sig_v_i = r.builder().AddSignature(sigs.v_i());
......
...@@ -546,7 +546,6 @@ WASM_COMPILED_EXEC_TEST(WasmBreakInPostMVP) { ...@@ -546,7 +546,6 @@ WASM_COMPILED_EXEC_TEST(WasmBreakInPostMVP) {
// being used. There was a bug where we were trying to update the "detected" // being used. There was a bug where we were trying to update the "detected"
// features set, but we were passing a nullptr when compiling with // features set, but we were passing a nullptr when compiling with
// breakpoints. // breakpoints.
EXPERIMENTAL_FLAG_SCOPE(mv);
WasmRunner<int> runner(execution_tier); WasmRunner<int> runner(execution_tier);
Isolate* isolate = runner.main_isolate(); Isolate* isolate = runner.main_isolate();
......
...@@ -165,7 +165,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { ...@@ -165,7 +165,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
if (param_count > Code::kMaxArguments) return 0; if (param_count > Code::kMaxArguments) return 0;
size_t return_count = input.NumNonZeroBytes(param_count + 1, kNumTypes); size_t return_count = input.NumNonZeroBytes(param_count + 1, kNumTypes);
if (return_count > wasm::kV8MaxWasmFunctionMultiReturns) return 0; if (return_count > wasm::kV8MaxWasmFunctionReturns) return 0;
CallDescriptor* desc = CallDescriptor* desc =
CreateRandomCallDescriptor(&zone, return_count, param_count, &input); CreateRandomCallDescriptor(&zone, return_count, param_count, &input);
......
...@@ -1796,7 +1796,6 @@ TEST_F(FunctionBodyDecoderTest, IncompleteIndirectReturnCall) { ...@@ -1796,7 +1796,6 @@ TEST_F(FunctionBodyDecoderTest, IncompleteIndirectReturnCall) {
} }
TEST_F(FunctionBodyDecoderTest, MultiReturn) { TEST_F(FunctionBodyDecoderTest, MultiReturn) {
WASM_FEATURE_SCOPE(mv);
ValueType storage[] = {kWasmI32, kWasmI32}; ValueType storage[] = {kWasmI32, kWasmI32};
FunctionSig sig_ii_v(2, 0, storage); FunctionSig sig_ii_v(2, 0, storage);
FunctionSig sig_v_ii(0, 2, storage); FunctionSig sig_v_ii(0, 2, storage);
...@@ -1810,7 +1809,6 @@ TEST_F(FunctionBodyDecoderTest, MultiReturn) { ...@@ -1810,7 +1809,6 @@ TEST_F(FunctionBodyDecoderTest, MultiReturn) {
} }
TEST_F(FunctionBodyDecoderTest, MultiReturnType) { TEST_F(FunctionBodyDecoderTest, MultiReturnType) {
WASM_FEATURE_SCOPE(mv);
for (size_t a = 0; a < arraysize(kValueTypes); a++) { for (size_t a = 0; a < arraysize(kValueTypes); a++) {
for (size_t b = 0; b < arraysize(kValueTypes); b++) { for (size_t b = 0; b < arraysize(kValueTypes); b++) {
for (size_t c = 0; c < arraysize(kValueTypes); c++) { for (size_t c = 0; c < arraysize(kValueTypes); c++) {
...@@ -2957,7 +2955,6 @@ TEST_F(FunctionBodyDecoderTest, TryDelegate) { ...@@ -2957,7 +2955,6 @@ TEST_F(FunctionBodyDecoderTest, TryDelegate) {
#undef WASM_TRY_OP #undef WASM_TRY_OP
TEST_F(FunctionBodyDecoderTest, MultiValBlock1) { TEST_F(FunctionBodyDecoderTest, MultiValBlock1) {
WASM_FEATURE_SCOPE(mv);
byte sig0 = builder.AddSignature(sigs.ii_v()); byte sig0 = builder.AddSignature(sigs.ii_v());
ExpectValidates( ExpectValidates(
sigs.i_ii(), sigs.i_ii(),
...@@ -2975,7 +2972,6 @@ TEST_F(FunctionBodyDecoderTest, MultiValBlock1) { ...@@ -2975,7 +2972,6 @@ TEST_F(FunctionBodyDecoderTest, MultiValBlock1) {
} }
TEST_F(FunctionBodyDecoderTest, MultiValBlock2) { TEST_F(FunctionBodyDecoderTest, MultiValBlock2) {
WASM_FEATURE_SCOPE(mv);
byte sig0 = builder.AddSignature(sigs.ii_v()); byte sig0 = builder.AddSignature(sigs.ii_v());
ExpectValidates(sigs.i_ii(), ExpectValidates(sigs.i_ii(),
{WASM_BLOCK_X(sig0, WASM_LOCAL_GET(0), WASM_LOCAL_GET(1)), {WASM_BLOCK_X(sig0, WASM_LOCAL_GET(0), WASM_LOCAL_GET(1)),
...@@ -2994,7 +2990,6 @@ TEST_F(FunctionBodyDecoderTest, MultiValBlock2) { ...@@ -2994,7 +2990,6 @@ TEST_F(FunctionBodyDecoderTest, MultiValBlock2) {
} }
TEST_F(FunctionBodyDecoderTest, MultiValBlockBr) { TEST_F(FunctionBodyDecoderTest, MultiValBlockBr) {
WASM_FEATURE_SCOPE(mv);
byte sig0 = builder.AddSignature(sigs.ii_v()); byte sig0 = builder.AddSignature(sigs.ii_v());
ExpectFailure(sigs.i_ii(), {WASM_BLOCK_X(sig0, WASM_LOCAL_GET(0), WASM_BR(0)), ExpectFailure(sigs.i_ii(), {WASM_BLOCK_X(sig0, WASM_LOCAL_GET(0), WASM_BR(0)),
kExprI32Add}); kExprI32Add});
...@@ -3004,7 +2999,6 @@ TEST_F(FunctionBodyDecoderTest, MultiValBlockBr) { ...@@ -3004,7 +2999,6 @@ TEST_F(FunctionBodyDecoderTest, MultiValBlockBr) {
} }
TEST_F(FunctionBodyDecoderTest, MultiValLoop1) { TEST_F(FunctionBodyDecoderTest, MultiValLoop1) {
WASM_FEATURE_SCOPE(mv);
byte sig0 = builder.AddSignature(sigs.ii_v()); byte sig0 = builder.AddSignature(sigs.ii_v());
ExpectValidates( ExpectValidates(
sigs.i_ii(), sigs.i_ii(),
...@@ -3021,7 +3015,6 @@ TEST_F(FunctionBodyDecoderTest, MultiValLoop1) { ...@@ -3021,7 +3015,6 @@ TEST_F(FunctionBodyDecoderTest, MultiValLoop1) {
} }
TEST_F(FunctionBodyDecoderTest, MultiValIf) { TEST_F(FunctionBodyDecoderTest, MultiValIf) {
WASM_FEATURE_SCOPE(mv);
byte sig0 = builder.AddSignature(sigs.ii_v()); byte sig0 = builder.AddSignature(sigs.ii_v());
ExpectValidates( ExpectValidates(
sigs.i_ii(), sigs.i_ii(),
...@@ -3081,7 +3074,6 @@ TEST_F(FunctionBodyDecoderTest, MultiValIf) { ...@@ -3081,7 +3074,6 @@ TEST_F(FunctionBodyDecoderTest, MultiValIf) {
} }
TEST_F(FunctionBodyDecoderTest, BlockParam) { TEST_F(FunctionBodyDecoderTest, BlockParam) {
WASM_FEATURE_SCOPE(mv);
byte sig1 = builder.AddSignature(sigs.i_i()); byte sig1 = builder.AddSignature(sigs.i_i());
byte sig2 = builder.AddSignature(sigs.i_ii()); byte sig2 = builder.AddSignature(sigs.i_ii());
ExpectValidates( ExpectValidates(
...@@ -3108,7 +3100,6 @@ TEST_F(FunctionBodyDecoderTest, BlockParam) { ...@@ -3108,7 +3100,6 @@ TEST_F(FunctionBodyDecoderTest, BlockParam) {
} }
TEST_F(FunctionBodyDecoderTest, LoopParam) { TEST_F(FunctionBodyDecoderTest, LoopParam) {
WASM_FEATURE_SCOPE(mv);
byte sig1 = builder.AddSignature(sigs.i_i()); byte sig1 = builder.AddSignature(sigs.i_i());
byte sig2 = builder.AddSignature(sigs.i_ii()); byte sig2 = builder.AddSignature(sigs.i_ii());
ExpectValidates(sigs.i_ii(), {WASM_LOCAL_GET(0), ExpectValidates(sigs.i_ii(), {WASM_LOCAL_GET(0),
...@@ -3134,7 +3125,6 @@ TEST_F(FunctionBodyDecoderTest, LoopParam) { ...@@ -3134,7 +3125,6 @@ TEST_F(FunctionBodyDecoderTest, LoopParam) {
} }
TEST_F(FunctionBodyDecoderTest, LoopParamBr) { TEST_F(FunctionBodyDecoderTest, LoopParamBr) {
WASM_FEATURE_SCOPE(mv);
byte sig1 = builder.AddSignature(sigs.i_i()); byte sig1 = builder.AddSignature(sigs.i_i());
byte sig2 = builder.AddSignature(sigs.i_ii()); byte sig2 = builder.AddSignature(sigs.i_ii());
ExpectValidates(sigs.i_ii(), ExpectValidates(sigs.i_ii(),
...@@ -3156,7 +3146,6 @@ TEST_F(FunctionBodyDecoderTest, LoopParamBr) { ...@@ -3156,7 +3146,6 @@ TEST_F(FunctionBodyDecoderTest, LoopParamBr) {
} }
TEST_F(FunctionBodyDecoderTest, IfParam) { TEST_F(FunctionBodyDecoderTest, IfParam) {
WASM_FEATURE_SCOPE(mv);
byte sig1 = builder.AddSignature(sigs.i_i()); byte sig1 = builder.AddSignature(sigs.i_i());
byte sig2 = builder.AddSignature(sigs.i_ii()); byte sig2 = builder.AddSignature(sigs.i_ii());
ExpectValidates(sigs.i_ii(), ExpectValidates(sigs.i_ii(),
......
...@@ -2162,7 +2162,6 @@ TEST_F(WasmSignatureDecodeTest, Ok_t_t) { ...@@ -2162,7 +2162,6 @@ TEST_F(WasmSignatureDecodeTest, Ok_t_t) {
TEST_F(WasmSignatureDecodeTest, Ok_i_tt) { TEST_F(WasmSignatureDecodeTest, Ok_i_tt) {
WASM_FEATURE_SCOPE(reftypes); WASM_FEATURE_SCOPE(reftypes);
WASM_FEATURE_SCOPE(mv);
for (size_t i = 0; i < arraysize(kValueTypes); i++) { for (size_t i = 0; i < arraysize(kValueTypes); i++) {
ValueTypePair p0_type = kValueTypes[i]; ValueTypePair p0_type = kValueTypes[i];
for (size_t j = 0; j < arraysize(kValueTypes); j++) { for (size_t j = 0; j < arraysize(kValueTypes); j++) {
...@@ -2182,7 +2181,6 @@ TEST_F(WasmSignatureDecodeTest, Ok_i_tt) { ...@@ -2182,7 +2181,6 @@ TEST_F(WasmSignatureDecodeTest, Ok_i_tt) {
TEST_F(WasmSignatureDecodeTest, Ok_tt_tt) { TEST_F(WasmSignatureDecodeTest, Ok_tt_tt) {
WASM_FEATURE_SCOPE(reftypes); WASM_FEATURE_SCOPE(reftypes);
WASM_FEATURE_SCOPE(mv);
for (size_t i = 0; i < arraysize(kValueTypes); i++) { for (size_t i = 0; i < arraysize(kValueTypes); i++) {
ValueTypePair p0_type = kValueTypes[i]; ValueTypePair p0_type = kValueTypes[i];
for (size_t j = 0; j < arraysize(kValueTypes); j++) { for (size_t j = 0; j < arraysize(kValueTypes); j++) {
...@@ -2212,12 +2210,8 @@ TEST_F(WasmSignatureDecodeTest, TooManyParams) { ...@@ -2212,12 +2210,8 @@ TEST_F(WasmSignatureDecodeTest, TooManyParams) {
TEST_F(WasmSignatureDecodeTest, TooManyReturns) { TEST_F(WasmSignatureDecodeTest, TooManyReturns) {
for (int i = 0; i < 2; i++) { for (int i = 0; i < 2; i++) {
bool enable_mv = i != 0; byte data[] = {kWasmFunctionTypeCode, 0,
WASM_FEATURE_SCOPE_VAL(mv, enable_mv); WASM_I32V_3(kV8MaxWasmFunctionReturns + 1), kI32Code};
const int max_return_count = static_cast<int>(
enable_mv ? kV8MaxWasmFunctionMultiReturns : kV8MaxWasmFunctionReturns);
byte data[] = {kWasmFunctionTypeCode, 0, WASM_I32V_3(max_return_count + 1),
kI32Code};
const FunctionSig* sig = DecodeSig(data, data + sizeof(data)); const FunctionSig* sig = DecodeSig(data, data + sizeof(data));
EXPECT_EQ(nullptr, sig); EXPECT_EQ(nullptr, sig);
} }
......
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