Commit Graph

9135 Commits

Author SHA1 Message Date
Peter Huene
58aab85680 Add the pooling-allocator feature.
This commit adds the `pooling-allocator` feature to both the `wasmtime` and
`wasmtime-runtime` crates.

The feature controls whether or not the pooling allocator implementation is
built into the runtime and exposed as a supported instance allocation strategy
in the wasmtime API.

The feature is on by default for the `wasmtime` crate.

Closes #3513.
2021-11-10 13:25:55 -08:00
Alex Crichton
00feefe9a7 Change the bump-version workflow's schedule (#3512)
* Change the bump-version workflow's schedule

Either I don't understand cron or GitHub doesn't understand cron. It's
not clear which. I think that
https://github.com/bytecodealliance/wasmtime/pull/3511 may have fallen
within our schedule but it was supposed to be on a weekday. Otherwise
https://github.com/bytecodealliance/wasmtime/pull/3499 was certainly
spurious. This commit moves to a simpler "just do it on the same day
each month" and we can manually figure out weekdays and such. Hopefully
this should reduce the number of spurious PRs we're getting to bump
versions.

This also removes the script to force a version bump since I found a
button on the GitHub UI to do the same thing. Additionally I've updated
the patch-release documentation to use this button. Note that this
button takes inputs as well which means we can further automate patch
releases to look even more like normal release process, differing only
in one part of the argument used to trigger the workflow.

* Fix a typo
2021-11-08 10:37:53 -06:00
Adam Bratschi-Kaye
12bfbdfaca Skip generating DWARF info for dead code (#3498)
When encountering a subprogram that is dead code (as indicated by the
dead code proposal
https://dwarfstd.org/ShowIssue.php?issue=200609.1), don't generate debug
output for the subprogram or any of its children.
2021-11-08 09:31:04 -06:00
Pat Hickey
2053e972b7 InstancePre can impl Clone (#3510)
Its a manually written impl, not a derive, because InstancePre<T>: Clone
does not require T: Clone.

The clone should be reasonably inexpensive: Clone for Module is just an
Arc, and Clone for Definition should also just be an Arc on the HostFunc
or Instance variants. An InstancePre shouldnt contain any
Definition::Extern variants because there is not yet a Store associated
with it- right?
2021-11-08 09:11:31 -06:00
Alex Crichton
6be0f82b96 Fix a panic with an invalid name section (#3509)
This commit fixes a panic which can happen on a module with an invalid
name section where one of the functions named has the index `u32::MAX`.
Previously Wasmtime would create a new `FuncIndex` with the indices
found in the name section but the sentinel `u32::MAX` causes a panic.

Cranelift otherwise limits the number of functions through `wasmparser`
which has a hard limit (lower than `u32::MAX`) so this commit applies a
fix of only recording function names for function indices that are
actually present in the module.
2021-11-05 15:08:58 -05:00
Alex Crichton
6bcee7f5f7 Add a configuration option to force "static" memories (#3503)
* Add a configuration option to force "static" memories

In poking around at some things earlier today I realized that one
configuration option for memories we haven't exposed from embeddings
like the CLI is to forcibly limit the size of memory growth and force
using a static memory style. This means that the CLI, for example, can't
limit memory growth by default and memories are only limited in size by
what the OS can give and the wasm's own memory type. This configuration
option means that the CLI can artificially limit the size of wasm linear
memories.

Additionally another motivation for this is for testing out various
codegen ramifications of static/dynamic memories. This is the only way
to force a static memory, by default, for wasm64 memories with no
maximum size listed for example.

* Review feedback
2021-11-03 16:50:49 -05:00
Pat Hickey
6428ac80d0 cargo update -p userfaultfd to 0.4.2 (#3505)
which has bugfixes to work correctly on linux 5.11 and above, which is
required for github's ubuntu-latest builder as of this morning
2021-11-03 16:50:40 -05:00
Benjamin Bouvier
c952969389 Remove unused dependencies (#3490)
* Remove unused dependencies in Cranelift

* add serde to the current workspace

* remove more unused dependencies in wasmtime?
2021-11-02 12:08:30 -05:00
Chris Fallin
b024603866 Merge pull request #3502 from cfallin/ifcmp-sp
Add back the `ifcmp_sp` CLIF opcode.
2021-11-01 14:04:51 -07:00
Chris Fallin
5e96a447f0 Add back the ifcmp_sp CLIF opcode.
This opcode was removed as part of the old-backend cleanup in #3446.
While this opcode will definitely go away eventually, it is
unfortunately still used today in Lucet (as we just discovered while
working to upgrade Lucet's pinned Cranelift version). Lucet is
deprecated and slated to eventually be completely sunset in favor of
Wasmtime; but until that happens, we need to keep this opcode.
2021-11-01 13:34:31 -07:00
Chris Fallin
9e7760bd83 Merge pull request #3497 from bjorn3/misc_meta_simplifications
Misc meta crate cleanups
2021-11-01 11:24:44 -07:00
Nick Fitzgerald
d0aac82481 Merge pull request #3501 from bytecodealliance/alexcrichton-patch-1
Add cranelift meeting notes for today
2021-11-01 10:42:08 -07:00
Alex Crichton
5b3c570247 Add cranelift meeting notes for today
Not huge this time, mostly a presentation by fitzgen!
2021-11-01 12:31:21 -05:00
bjorn3
86d2ef8952 Fix CI 2021-11-01 18:19:59 +01:00
bjorn3
93e9bb02e4 Review comments 2021-11-01 18:17:57 +01:00
Chris Fallin
2fab40bec6 Merge pull request #3496 from bjorn3/legalizer_changes
Match on InstructionData instead of Opcode inside the legalizer
2021-11-01 09:48:30 -07:00
Nick Fitzgerald
3c1736f828 Merge pull request #3500 from bytecodealliance/fitzgen-patch-1
Add slides for ISLE update in cranelift meeting
2021-11-01 08:28:52 -07:00
Nick Fitzgerald
925a9f0444 Add slides for ISLE update in cranelift meeting 2021-11-01 08:26:43 -07:00
Nils Martel
240835f8e4 Check cranelift benchmarks in CI (#3494)
* Check cranelift benchmarks in CI

* Use appropriate cargo subcommand

to check benchmarks
2021-11-01 09:33:45 -05:00
Alex Crichton
9a27fdad86 Update v8 used during fuzzing (#3493)
This commit updates the crate name from `rusty_v8` to `v8` as well since
the upstream bindings have sinced moved. I originally wanted to do this
to see if a fix for one of our fuzz bugs was pulled in but I don't think
the fix has been pulled in yet. Despite that it seems reasonable to go
ahead and update.
2021-11-01 09:18:11 -05:00
bjorn3
55f8f8ce05 Remove a bit of dead code 2021-10-31 19:57:04 +01:00
bjorn3
f84e1c16c7 Enforce all OperandKind have documentation 2021-10-31 19:57:04 +01:00
bjorn3
e8f3c0c6a9 Use InstructionFormat inside InstructionFormatBuilder 2021-10-31 19:57:04 +01:00
bjorn3
2fbd57e9e2 Remove imm_with_name
It is only used once to rename an imm field to mask
2021-10-31 19:57:04 +01:00
bjorn3
74261ccd79 Never use the first vararg as typevar operand
If an instruction only takes varargs as values, it may have no arguments
at all.
2021-10-31 19:57:04 +01:00
bjorn3
e4d42a1be4 Move arg unpacking for all remaining expand functions to simple_legalize 2021-10-31 18:26:25 +01:00
bjorn3
ce3175993a Inline expand_br_icmp, expand_stack_load and expand_stack_store 2021-10-31 18:00:39 +01:00
bjorn3
96b14ed8eb Match on InstructionData instead of Opcode
This should be faster by avoiding matching on InstructionData to get the
Opcode, then on Opcode and then finally on the InstructionData again to
get the arguments
2021-10-31 17:52:43 +01:00
Philipp Oppermann
795e381be4 Fix typo: profilng -> profiling (#3492) 2021-10-29 14:01:41 -05:00
Philipp Oppermann
d49b83fcc4 Small comma fix in crate docs (#3491) 2021-10-29 13:36:10 -05:00
Chris Fallin
e953c2dd4c Merge pull request #3480 from bjorn3/move_constant_hash_gen_table
Move generate_table from cranelift-codegen-shared to cranelift-codege…
2021-10-29 09:59:56 -07:00
wasmtime-publish
c1a6a0523d Release Wasmtime 0.31.0 (#3489)
* Bump Wasmtime to 0.31.0

[automatically-tag-and-release-this-commit]

* Update 0.31.0 release notes

Co-authored-by: Wasmtime Publish <wasmtime-publish@users.noreply.github.com>
Co-authored-by: Alex Crichton <alex@alexcrichton.com>
2021-10-29 09:09:35 -05:00
bjorn3
91d4f36970 Move generate_table from cranelift-codegen-shared to cranelift-codegen-meta 2021-10-29 14:43:09 +02:00
Alex Crichton
0737afe07e Fix some typos in the bump-version.yml workflow (#3488)
Mostly just holdovers from various refactorings I applied along the way
when writing this all up.
2021-10-28 16:24:28 -05:00
Alex Crichton
c26197ef8c Fix the publish script to ignore witx more (#3486)
This failed on CI [1] I think because the filesystem is traversed
differently than on my local system. This is relatively easily fixable
though where we shouldn't care about witx version when bumping version
requirements since we don't manage the publication of witx anyway.

[1]: https://github.com/bytecodealliance/wasmtime/runs/4038695579?check_suite_focus=true
2021-10-28 14:39:06 -05:00
Nick Fitzgerald
5c3155fab3 Merge pull request #3485 from alexcrichton/manual-trigger-bump
Add a manual trigger to force CI to bump crate versions
2021-10-28 11:24:47 -07:00
Alex Crichton
909a5d54d2 Add a manual trigger to force CI to bump crate versions
I'm curious to try out the full workflow so instead of waiting a few
weeks I figured I'd add a manual trigger here too
2021-10-28 10:13:00 -07:00
Nick Fitzgerald
9a4afc552f Add notes for Wasmtime 2021-10-28 meeting (#3484) 2021-10-28 11:59:09 -05:00
Pat Hickey
a2d83d4ae6 Merge pull request #3481 from bytecodealliance/pch/ci_apt_update_before_install
CI Check job: run `apt-get update` before `apt-get install`
2021-10-27 13:14:14 -07:00
Pat Hickey
dfebb3e9b6 CI Check job: run apt-get update before apt-get install
trying to fix  https://github.com/bytecodealliance/wasmtime/runs/4025939586?check_suite_focus=true
2021-10-27 12:01:13 -07:00
Nick Fitzgerald
49133f62e6 Merge pull request #3476 from fitzgen/logging-in-cranelift-test-compile
cranelift: in `test_compile` filetest, log disasm not clif
2021-10-26 11:00:23 -07:00
Nick Fitzgerald
8aa8dfe26a cranelift: in test_compile filetest, log disasm not clif
With the old backends, this would log the lowered+legalized clif, but the log is
useles now with the new backends. Logging the disasm is the new moral
equivalent.
2021-10-26 10:21:31 -07:00
Nick Fitzgerald
5c342754f0 Merge pull request #3475 from alexcrichton/discuss-release
wasmtime: Add an agenda item for the release process
2021-10-26 09:51:10 -07:00
Alex Crichton
07e4eb599f wasmtime: Add an agenda item for the release process 2021-10-26 08:28:13 -07:00
Alex Crichton
807b528bfb Automate more of Wasmtime's release process (#3422)
* Automate more of Wasmtime's release process

This change revamps the release process for Wasmtime and intends to make
it nearly 100% automated for major release and hopefully still pretty
simple for patch releases. New workflows are introduced as part of
this commit:

* Once a month a PR is created with major version bumps
* Specifically hinted commit messages to the `main` branch will get
  tagged and pushed to the main repository.
* On tags we'll now not only build releases after running CI but
  additionally crates will be published to crates.io.

In conjunction with other changes this means that the release process
for a new major version of Wasmtime is simply merging a PR. Patch
releases will involve running some steps locally but most of the
nitty-gritty should be simply merging the PR that's generated.

* Use an anchor in a regex
2021-10-26 10:25:40 -05:00
Pat Hickey
7962fe3f43 update tracing-subscriber (#3473)
which gets rid of the transitive dep on `chrono` that was affected by
`RUSTSEC-2020-0159`.
2021-10-26 09:06:45 -05:00
Alex Crichton
490d49a768 Adjust dependency directives between crates (#3420)
* Adjust dependency directives between crates

This commit is a preparation for the release process for Wasmtime. The
specific changes here are to delineate which crates are "public", and
all version requirements on non-public crates will now be done with
`=A.B.C` version requirements instead of today's `A.B.C` version
requirements.

The purpose for doing this is to assist with patch releases that might
happen in the future. Patch releases of wasmtime are already required to
not break the APIs of "public" crates, but no such guarantee is given
about "internal" crates. This means that a patch release runs the risk,
for example, of breaking an internal API. In doing so though we would
also need to release a new major version of the internal crate, but we
wouldn't have a great hole in the number scheme of major versions to do
so. By using `=A.B.C` requirements for internal crates it means we can
safely ignore strict semver-compatibility between releases of internal
crates for patch releases, since the only consumers of the crate will be
the corresponding patch release of the `wasmtime` crate itself (or other
public crates).

The `publish.rs` script has been updated with a check to verify that
dependencies on internal crates are all specified with an `=`
dependency, and dependnecies on all public crates are without a `=`
dependency. This will hopefully make it so we don't have to worry about
what to use where, we just let CI tell us what to do. Using this
modification all version dependency declarations have been updated.

Note that some crates were adjusted to simply remove their `version`
requirement in cases such as the crate wasn't published anyway (`publish
= false` was specified) or it's in the `dev-dependencies` section which
doesn't need version specifiers for path dependencies.

* Switch to normal sever deps for cranelift dependencies

These crates will now all be considered "public" where in patch releases
they will be guaranteed to not have breaking changes.
2021-10-26 09:06:03 -05:00
Nick Fitzgerald
82aad556ea Merge pull request #3472 from fitzgen/no-expect-format
Remove some uses of `foo.expect(&format!(...))` anti-pattern
2021-10-25 19:31:13 -07:00
Nick Fitzgerald
e3a423c3e8 Remove some uses of foo.expect(&format!(...)) pattern
This eagerly evaluates the `format!` and produces a `String` with a heap
allocation, regardless whether `foo` is `Some`/`Ok` or `None`/`Err`. Using
`foo.unwrap_or_else(|| panic!(...))` makes it so that the error message
formatting is only evaluated if `foo` is `None`/`Err`.
2021-10-25 17:35:23 -07:00
Pat Hickey
06a93d3346 Merge pull request #3393 from bytecodealliance/pch/async_limiting
Add ResourceLimiterAsync, which can yield until resource is available
2021-10-25 11:47:48 -07:00