Skip to content

Commit

Permalink
Merge pull request #155 from Aimeedeer/v116
Browse files Browse the repository at this point in the history
Upgrade to v116.
  • Loading branch information
brson committed Oct 19, 2023
2 parents 7f500ab + f8b9491 commit b3b05f1
Show file tree
Hide file tree
Showing 15 changed files with 48 additions and 49 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,15 @@ jobs:
run: git submodule update --init --recursive
- run: cargo test --manifest-path components/conformance-tests/Cargo.toml

dwarf:
name: Dwarf feature
non-dwarf:
name: Without dwarf feature
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout submodule
run: git submodule update --init --recursive
- run: cargo test --features=dwarf
- run: cargo test --features=dwarf --manifest-path components/conformance-tests/Cargo.toml
- run: cargo test --no-default-features
- run: cargo test --no-default-features --manifest-path components/conformance-tests/Cargo.toml

fmt:
name: Cargo fmt
Expand Down
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion binaryen
Submodule binaryen updated 746 files
8 changes: 4 additions & 4 deletions components/conformance-tests/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions components/conformance-tests/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "conformance-tests"
version = "0.114.2"
version = "0.116.0"
description = "Tests against binaryen"
license = "MIT / Apache-2.0"
edition = "2018"
Expand All @@ -11,9 +11,9 @@ anyhow = "1.0.58"

[dev-dependencies]
anyhow = "1.0.58"
wasm-opt = { path = "../wasm-opt", version = "0.114.2" }
wasm-opt = { path = "../wasm-opt", version = "0.116.0", default-features = false }
tempfile = "3.3.0"

[features]
default = []
default = ["dwarf"]
dwarf = ["wasm-opt/dwarf"]
3 changes: 1 addition & 2 deletions components/conformance-tests/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ fn build_rust_wasm_opt() -> Result<()> {
let dirs = get_dirs()?;

let mut cmd = Command::new("cargo");
cmd
.current_dir(dirs.workspace)
cmd.current_dir(dirs.workspace)
.args(["build", "-p", "wasm-opt", "--release"]);

#[cfg(feature = "dwarf")]
Expand Down
4 changes: 2 additions & 2 deletions components/wasm-opt-cxx-sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "wasm-opt-cxx-sys"
version = "0.114.2"
version = "0.116.0"
description = "wasm-opt bindings via cxx"
license = "MIT / Apache-2.0"
edition = "2018"
Expand All @@ -11,7 +11,7 @@ readme = "README.md"
[dependencies]
anyhow = "1.0.58"
cxx = "1.0.79"
wasm-opt-sys = { path = "../wasm-opt-sys", version = "0.114.2" }
wasm-opt-sys = { path = "../wasm-opt-sys", version = "0.116.0", default-features = false }

[build-dependencies]
anyhow = "1.0.58"
Expand Down
4 changes: 1 addition & 3 deletions components/wasm-opt-cxx-sys/src/shims.h
Original file line number Diff line number Diff line change
Expand Up @@ -259,16 +259,14 @@ namespace wasm_shims {
f.push_back(wasm::FeatureSet::Feature::Multivalue);
f.push_back(wasm::FeatureSet::Feature::GC);
f.push_back(wasm::FeatureSet::Feature::Memory64);
f.push_back(wasm::FeatureSet::Feature::GCNNLocals);
f.push_back(wasm::FeatureSet::Feature::RelaxedSIMD);
f.push_back(wasm::FeatureSet::Feature::ExtendedConst);
f.push_back(wasm::FeatureSet::Feature::Strings);
f.push_back(wasm::FeatureSet::Feature::MultiMemories);
f.push_back(wasm::FeatureSet::Feature::MultiMemory);
// This is not part of the Rust API because it has the same value as None.
// f.push_back(wasm::FeatureSet::Feature::MVP);
f.push_back(wasm::FeatureSet::Feature::Default);
f.push_back(wasm::FeatureSet::Feature::All);
f.push_back(wasm::FeatureSet::Feature::AllPossible);

return std::make_unique<std::vector<uint32_t>>(f);
}
Expand Down
4 changes: 2 additions & 2 deletions components/wasm-opt-sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "wasm-opt-sys"
version = "0.114.2"
version = "0.116.0"
description = "Native wasm-opt build"
license = "MIT / Apache-2.0"
edition = "2018"
Expand All @@ -18,5 +18,5 @@ cxx-build = "1.0.79"
cxx = "1.0.79"

[features]
default = []
default = ["dwarf"]
dwarf = []
8 changes: 7 additions & 1 deletion components/wasm-opt-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ fn get_converted_wasm_opt_cpp(src_dir: &Path) -> anyhow::Result<PathBuf> {
}

fn get_src_files(src_dir: &Path) -> anyhow::Result<Vec<PathBuf>> {
let analysis_dir = src_dir.join("analysis");
let analysis_files = ["cfg.cpp"];
let analysis_files = analysis_files.iter().map(|f| analysis_dir.join(f));

let wasm_dir = src_dir.join("wasm");
let wasm_files = [
"literal.cpp",
Expand All @@ -155,6 +159,7 @@ fn get_src_files(src_dir: &Path) -> anyhow::Result<Vec<PathBuf>> {
"wasm-debug.cpp",
"wasm-emscripten.cpp",
"wasm-interpreter.cpp",
"wasm-ir-builder.cpp",
"wasm-io.cpp",
"wasm-stack.cpp",
"wasm-s-parser.cpp",
Expand Down Expand Up @@ -222,6 +227,7 @@ fn get_src_files(src_dir: &Path) -> anyhow::Result<Vec<PathBuf>> {

let src_files: Vec<_> = None
.into_iter()
.chain(analysis_files)
.chain(wasm_files)
.chain(support_files)
.chain(ir_files)
Expand Down Expand Up @@ -338,7 +344,7 @@ fn create_config_header() -> anyhow::Result<()> {
let output_dir = Path::new(&output_dir);
let config_file = output_dir.join("config.h");

let config_text = "#define PROJECT_VERSION \"114 (version_114)\"";
let config_text = "#define PROJECT_VERSION \"116 (version_116)\"";

fs::write(&config_file, config_text)?;

Expand Down
8 changes: 4 additions & 4 deletions components/wasm-opt/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "wasm-opt"
version = "0.114.2"
version = "0.116.0"
description = "wasm-opt bindings"
license = "MIT / Apache-2.0"
edition = "2018"
Expand All @@ -12,13 +12,13 @@ readme = "README.md"
[dependencies]
anyhow = "1.0.58"
libc = "0.2.126"
wasm-opt-sys = { path = "../wasm-opt-sys", version = "0.114.2" }
wasm-opt-cxx-sys = { path = "../wasm-opt-cxx-sys", version = "0.114.2" }
wasm-opt-sys = { path = "../wasm-opt-sys", version = "0.116.0", default-features = false }
wasm-opt-cxx-sys = { path = "../wasm-opt-cxx-sys", version = "0.116.0" }
strum = "0.24"
strum_macros = "0.24"
thiserror = "1.0.32"
tempfile = "3.3.0"

[features]
default = []
default = ["dwarf"]
dwarf = ["wasm-opt-sys/dwarf"]
13 changes: 5 additions & 8 deletions components/wasm-opt/src/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,20 +320,17 @@ pub enum Feature {
Multivalue = 1 << 9,
Gc = 1 << 10,
Memory64 = 1 << 11,
// TODO: Remove this feature when the wasm spec stabilizes.
GcNnLocals = 1 << 12,
RelaxedSimd = 1 << 13,
ExtendedConst = 1 << 14,
Strings = 1 << 15,
MultiMemories = 1 << 16,
RelaxedSimd = 1 << 12,
ExtendedConst = 1 << 13,
Strings = 1 << 14,
MultiMemory = 1 << 15,
// MVP has the same value as None.
// Mvp = 0,
Default = 1 << 5 | 1 << 1, // SignExt | MutableGlobals,
// GCNNLocals are opt-in: merely asking for "All" does not apply them. To
// get all possible values use AllPossible. See setAll() below for more
// details.
All = ((1 << 17) - 1) & !(1 << 12), // All = ((1 << 17) - 1) & ~GCNNLocals,
AllPossible = (1 << 17) - 1,
All = (1 << 16) - 1,
}

pub struct PassRunner<'wasm>(cxx::UniquePtr<wasm::PassRunner<'wasm>>);
Expand Down
13 changes: 4 additions & 9 deletions components/wasm-opt/src/features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ pub enum Feature {
/// [Specification](https://github.com/WebAssembly/memory64/blob/main/proposals/memory64/Overview.md).
#[strum(serialize = "memory64")]
Memory64,
#[strum(serialize = "gc-nn-locals")]
GcNnLocals,
/// Relaxed SIMD.
///
/// [Specification](https://github.com/WebAssembly/relaxed-simd/tree/main/proposals/relaxed-simd).
Expand All @@ -84,11 +82,11 @@ pub enum Feature {
ExtendedConst,
#[strum(serialize = "strings")]
Strings,
/// Multiple memories.
/// Multiple memory.
///
/// [Specification](https://github.com/WebAssembly/multi-memory/blob/master/proposals/multi-memory/Overview.md).
#[strum(serialize = "multi-memories")]
MultiMemories,
#[strum(serialize = "multi-memory")]
MultiMemory,
/// The original WebAssembly specification.
///
/// It has the same value as `None`.
Expand All @@ -99,10 +97,7 @@ pub enum Feature {
/// Includes [`Feature::SignExt`] and [`Feature::MutableGlobals`].
#[strum(disabled)]
Default,
/// All features, excluding [`Feature::GcNnLocals`].
#[strum(disabled)]
All,
/// All features.
#[strum(disabled)]
AllPossible,
All,
}
6 changes: 6 additions & 0 deletions components/wasm-opt/src/passes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ pub enum Pass {
///
/// Optimize the entire program using information about what content can actually appear in each location.
Gufa,
/// GUFA plus add casts for all inferences.
GufaCastAll,
/// Gufa plus local optimizations in functions we modified.
GufaOptimizing,
/// Apply more specific subtypes to type fields where possible.
Expand Down Expand Up @@ -207,6 +209,8 @@ pub enum Pass {
RemoveUnusedNames,
/// Remove unused private GC types.
RemoveUnusedTypes,
/// Sorts functions by name (useful for debugging).
ReorderFunctionsByName,
/// Sorts functions by access frequency.
ReorderFunctions,
/// Sorts globals by access frequency.
Expand Down Expand Up @@ -325,6 +329,7 @@ impl Pass {
Gto => "gto",
Gsi => "gsi",
Gufa => "gufa",
GufaCastAll => "gufa-cast-all",
GufaOptimizing => "gufa-optimizing",
TypeRefining => "type-refining",
Heap2Local => "heap2local",
Expand Down Expand Up @@ -388,6 +393,7 @@ impl Pass {
RemoveUnusedNonfunctionModuleElements => "remove-unused-nonfunction-module-elements",
RemoveUnusedNames => "remove-unused-names",
RemoveUnusedTypes => "remove-unused-types",
ReorderFunctionsByName => "reorder-functions-by-name",
ReorderFunctions => "reorder-functions",
ReorderGlobals => "reorder-globals",
RecorderLocals => "reorder-locals",
Expand Down
4 changes: 1 addition & 3 deletions components/wasm-opt/src/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,15 +313,13 @@ fn convert_feature(feature: &Feature) -> BaseFeature {
Feature::Multivalue => BaseFeature::Multivalue,
Feature::Gc => BaseFeature::Gc,
Feature::Memory64 => BaseFeature::Memory64,
Feature::GcNnLocals => BaseFeature::GcNnLocals,
Feature::RelaxedSimd => BaseFeature::RelaxedSimd,
Feature::ExtendedConst => BaseFeature::ExtendedConst,
Feature::Strings => BaseFeature::Strings,
Feature::MultiMemories => BaseFeature::MultiMemories,
Feature::MultiMemory => BaseFeature::MultiMemory,
Feature::Mvp => BaseFeature::None,
Feature::Default => BaseFeature::Default,
Feature::All => BaseFeature::All,
Feature::AllPossible => BaseFeature::AllPossible,
}
}

Expand Down

0 comments on commit b3b05f1

Please sign in to comment.