Enable the multi-value proposal by default (#1667)

This was merged into the wasm spec upstream in WebAssembly/spec#1145, so
let's follow the spec and enable it by default here as well!
This commit is contained in:
Alex Crichton
2020-05-06 12:37:29 -05:00
committed by GitHub
parent 6d73fdb70a
commit 57fb1c69c5
11 changed files with 18 additions and 27 deletions

View File

@@ -82,7 +82,7 @@ impl Config {
enable_reference_types: false,
enable_bulk_memory: false,
enable_simd: false,
enable_multi_value: false,
enable_multi_value: true,
},
},
flags,
@@ -247,16 +247,10 @@ impl Config {
/// Configures whether the WebAssembly multi-value proposal will
/// be enabled for compilation.
///
/// The [WebAssembly multi-value proposal][proposal] is not
/// currently fully standardized and is undergoing development.
/// Additionally the support in wasmtime itself is still being worked on.
/// Support for this feature can be enabled through this method for
/// appropriate wasm modules.
///
/// This feature gates functions and blocks returning multiple values in a
/// module, for example.
///
/// This is `false` by default.
/// This is `true` by default.
///
/// [proposal]: https://github.com/webassembly/multi-value
pub fn wasm_multi_value(&mut self, enable: bool) -> &mut Self {

View File

@@ -39,7 +39,6 @@ pub(crate) fn fuzz_default_config(
config
.cranelift_debug_verifier(true)
.cranelift_nan_canonicalization(true)
.wasm_multi_value(true)
.wasm_bulk_memory(true)
.strategy(strategy)?;
Ok(config)

View File

@@ -53,8 +53,7 @@ fn generate_load(item: &syn::ItemTrait) -> syn::Result<TokenStream> {
use #root::wasmtime::{Config, Extern, Engine, Store, Instance, Module};
use #root::anyhow::{bail, format_err};
let engine = Engine::new(Config::new().wasm_multi_value(true));
let store = Store::new(&engine);
let store = Store::default();
let data = #root::wasmtime_interface_types::ModuleData::new(bytes.as_ref())?;

View File

@@ -356,6 +356,8 @@ fn is_matching_assert_invalid_error_message(expected: &str, actual: &str) -> boo
// `elem.wast` and `proposals/bulk-memory-operations/elem.wast` disagree
// on the expected error message for the same error.
|| (expected.contains("out of bounds") && actual.contains("does not fit"))
// slight difference in error messages
|| (expected.contains("unknown elem segment") && actual.contains("unknown element segment"))
}
fn extract_lane_as_i8(bytes: u128, lane: usize) -> i8 {