Update the walrus dependency (#2125)

This commit updates the `walrus` crate used in `wasm-bindgen`. The major
change here is how `walrus` handles element segments, exposing segments
rather than trying to keep a contiugous array of all the elements and
doing the splitting itself. That means that we need to do mroe logic
here in `wasm-bindgen` to juggle indices, segments, etc.
This commit is contained in:
Alex Crichton
2020-05-06 12:57:02 -05:00
committed by GitHub
parent dc54c0fb25
commit 8e3d6fe619
20 changed files with 242 additions and 120 deletions

View File

@ -13,12 +13,12 @@ edition = "2018"
[dependencies]
anyhow = "1.0"
walrus = "0.14.0"
walrus = "0.16.0"
[dev-dependencies]
rayon = "1.0"
wasmprinter = "0.2"
wast = "3.0"
wast = "15.0"
wat = "1.0"
[[test]]

View File

@ -162,10 +162,12 @@ fn xform_one(
round_up_to_alignment(results_size, 8) + 8
}
walrus::ValType::V128 => round_up_to_alignment(results_size, 16) + 16,
walrus::ValType::Anyref => anyhow::bail!(
"cannot multi-value transform functions that return \
anyref, since they can't go into linear memory"
),
walrus::ValType::Anyref | walrus::ValType::Funcref | walrus::ValType::Nullref => {
anyhow::bail!(
"cannot multi-value transform functions that return \
reference types, since they can't go into linear memory"
)
}
};
}
// Round up to 16-byte alignment, since that's what LLVM's emitted Wasm code
@ -284,7 +286,9 @@ fn xform_one(
);
offset += 16;
}
walrus::ValType::Anyref => unreachable!(),
walrus::ValType::Anyref | walrus::ValType::Funcref | walrus::ValType::Nullref => {
unreachable!()
}
}
}