Commit Graph

6882 Commits

Author SHA1 Message Date
Pat Hickey
4be3b06b61 switch from log::debug to tracing::debug
this duplicates work done in #2139 on code that moves from
where the switch took place in that PR.
2020-08-18 10:55:42 -07:00
Pat Hickey
e8160c9a6b redefine crate to use Error everywhere except in wasi 2020-08-18 10:50:17 -07:00
Pat Hickey
b8409dd9aa wasi-common: define an Error type for the crate 2020-08-18 10:50:17 -07:00
Pat Hickey
19369142cb wasi-common: trace and convert error
this is a bug - the TODO was never resolved, even when the code to
implement it was added right below :)

tracing is already in the transitive deps via wiggle, so no extra
trouble there. tracing::debug is more appropriate than eprintln
2020-08-18 10:50:17 -07:00
Gabor Greif
30b9e69136 don't leave Deref bytecode for Code chunk (#2137)
Re-enter loop after pushing `CompiledExpressionPart::Deref`, so that it
isn't recoded for `CompiledExpressionPart::Code` as well.
2020-08-18 10:54:34 -05:00
Chris Fallin
7c1cd774ef Merge pull request #2134 from cfallin/fix-abi-extension
AArch64 ABI: properly store full 64-bit width of extended args/retvals.
2020-08-18 08:39:30 -07:00
Nick Fitzgerald
4f7b10acac Merge pull request #2135 from bytecodealliance/pch/wasi_dep_version_gardening
Dependency version gardening
2020-08-17 16:39:31 -07:00
Pat Hickey
bacf470a3e bump all wat dependencies to 1.0.23
this gets us down to one version of `wast` in dependency tree!
2020-08-17 16:03:35 -07:00
Pat Hickey
a8ecb451f1 wasmtime-wast: bump wast dependency to 22.0.0 2020-08-17 15:58:56 -07:00
Pat Hickey
19e2a46aaf bump to latest wasi submodule
witx is now 0.8.6.
2020-08-17 15:58:56 -07:00
Chris Fallin
5fa0be3515 AArch64 ABI: properly store full 64-bit width of extended args/retvals.
When storing an argument to a stack location for consumption by a
callee, or storing a return value to an on-stack return slot for
consumption by the caller, the ABI implementation was properly extending
the value but was then performing a store with only the original width.
This fixes the issue by always performing a 64-bit store of the extended
value.

Issue reported by @uweigand (thanks!).
2020-08-17 15:00:04 -07:00
Alex Crichton
7fdbd081e6 Switch back to nightly channel for testing (#2116)
I believe the staticvec issues should be resolved now!
2020-08-17 15:16:12 +02:00
Chris Fallin
ac6539abd7 Merge pull request #2128 from cfallin/machinst-abi-refactor-2
Refactor AArch64 ABI support to extract common bits for shared impl with x64.
2020-08-14 17:08:07 -07:00
Chris Fallin
5cf3fba3da Refactor AArch64 ABI support to extract common bits for shared impl with x64.
We have observed that the ABI implementations for AArch64 and x64 are
very similar; in fact, x64's implementation started as a modified copy
of AArch64's implementation. This is an artifact of both a similar ABI
(both machines pass args and return values in registers first, then the
stack, and both machines give considerable freedom with stack-frame
layout) and a too-low-level ABI abstraction in the existing design. For
machines that fit the mainstream or most common ABI-design idioms, we
should be able to do much better.

This commit factors AArch64 into machine-specific and
machine-independent parts, but does not yet modify x64; that will come
next.

This should be completely neutral with respect to compile time and
generated code performance.
2020-08-14 16:27:39 -07:00
Steve Phillips
a577667f9f Update introduction.md: typo fixes 2020-08-14 11:47:27 -04:00
Chris Fallin
279534e276 Merge pull request #2130 from cfallin/update-regalloc
Upgrade to regalloc 0.0.29.
2020-08-14 08:45:10 -07:00
Pat Hickey
c61469672f Merge pull request #2129 from bytecodealliance/pch/wiggle_doc_fixes
wiggle: doc fixes
2020-08-13 14:24:29 -07:00
Chris Fallin
3b007dd6a2 Upgrade to regalloc 0.0.29.
This upgrade pulls in several recent changes in regalloc that should
improve compile-time performance in the AArch64 and new x64 backends.
2020-08-13 11:40:34 -07:00
Pat Hickey
c268c9e79b wiggle: doc fixes 2020-08-13 11:20:19 -07:00
Johnnie Birch
38ef98700f Adds packed integer subtraction 2020-08-12 09:41:20 -07:00
Nick Fitzgerald
e88d749031 Merge pull request #2123 from alexcrichton/fix-table-error
Update error message for bad table init
2020-08-10 08:58:07 -07:00
Nick Fitzgerald
33a6191909 Merge pull request #2120 from cfallin/wasm-unreachable-if-else-params
Wasm translation bugfix: properly clean up value stack for else-branch when if-branch ends in unreachable.
2020-08-10 08:36:05 -07:00
Nick Fitzgerald
fa82475677 Merge pull request #2122 from alexcrichton/fix-spectests
Fix execution of spectest fuzzer
2020-08-10 08:25:16 -07:00
Alex Crichton
bd8e08fe4a Update error message for bad table init
Although the string description for `TableOutOfBounds` isn't quite
matching what this error case is, it's a bit more descriptive than
`HeapOutOfBounds` anyway.
2020-08-10 06:57:58 -07:00
Alex Crichton
5893317a8e Fix execution of spectest fuzzer
We've enabled bulk memory and reference types by default now which means
that wasmtime in its default settings no longer passes the spec test
suite (due to changes in error messages in initialization), so when
we're running the spec test fuzzer be sure to disable reference types
and bulk memory since that's required to pass.
2020-08-10 06:55:36 -07:00
Chris Fallin
dd5a5ebdbc Wasm translation bugfix: properly clean up value stack for else-branch when if-branch ends in unreachable.
The Wasm translation handles unreachable code sections
specially, skipping ops until the end of a block and a control-flow
merger at which code becomes reachable again. Unfortunately, while the
ordinary else-op handler properly sets up the value stack for the
else-branch with the parameters to the if/else, the unreachable-case
else-op handler did not. This resulted in a bad translation and CLIF
type error despite valid Wasm.

Found via fuzzing by :decoder in
https://bugzilla.mozilla.org/show_bug.cgi?id=1657895.
2020-08-07 18:33:04 -07:00
Nick Fitzgerald
5f36d7eab7 Merge pull request #2118 from fitzgen/enable-ref-types-by-default
Enable ref types and bulk memory operations by default
2020-08-07 17:41:05 -07:00
Nick Fitzgerald
ef13e80bcf docs: Add contributor docs for implementing and enabling new Wasm proposals 2020-08-07 16:54:51 -07:00
Nick Fitzgerald
5647dcbb8f docs: Document and advertise our support for various Wasm proposals 2020-08-07 16:54:51 -07:00
Nick Fitzgerald
47d3c8de52 docs: Better title formatting for the coding guidelines 2020-08-07 16:54:51 -07:00
Nick Fitzgerald
bf16b33739 docs: Use Title Case for the Table of Contents 2020-08-07 16:54:51 -07:00
Nick Fitzgerald
5af47dc4cd cranelift: Only emit stack maps when a function actually uses reference types
This fix avoids a small slow down in scenarios where reference types are enabled
but a given function doesn't actually use them.

Fixes #1883
2020-08-07 16:54:51 -07:00
Nick Fitzgerald
94e4bad1e0 Enable reference types and bulk memory operations by default 2020-08-07 16:54:51 -07:00
Alex Crichton
c7cd70fcec wasmtime: Refactor how imports are resolved (#2102)
This commit removes all import resolution handling from the
`wasmtime-jit` crate, instead moving the logic to the `wasmtime` crate.
Previously `wasmtime-jit` had a generic `Resolver` trait and would do
all the import type matching itself, but with the upcoming
module-linking implementation this is going to get much trickier.

The goal of this commit is to centralize all meaty "preparation" logic
for instantiation into one location, probably the `wasmtime` crate
itself. Instantiation will soon involve recursive instantiation and
management of alias definitions as well. Having everything in one
location, especially with access to `Store` so we can persist
instances for safety, will be quite convenient.

Additionally the `Resolver` trait isn't really necessary any more since
imports are, at the lowest level, provided as a list rather than a map
of some kind. More generic resolution functionality is provided via
`Linker` or user layers on top of `Instance::new` itself. This makes
matching up provided items to expected imports much easier as well.

Overall this is largely just moving code around, but most of the code
in the previous `resolve_imports` phase can be deleted since a lot of it
is handled by surrounding pieces of `wasmtime` as well.
2020-08-07 16:38:01 -05:00
Alex Crichton
08f9eb1725 Making caching support optional in Wasmtime (#2119)
This commit moves all of the caching support that currently lives in
`wasmtime-environ` into a `wasmtime-cache` crate and makes it optional. The
goal here is to slim down the `wasmtime-environ` crate and clearly separate
boundaries where caching is a standalone and optional feature, not intertwined
with other crates.
2020-08-07 15:42:40 -05:00
Gabor Greif
a796d65467 test_debug_parse_expressions: improve expression! macro (#2104)
Provide automatic translation to opcodes from DW_OP_* identifiers. They are looked up from gimli.
Since DW_OP_WASM_location is not contained in gimli yet, we take care of manually translating it.
2020-08-07 13:25:18 -05:00
Gabor Greif
9aebca11ad Don't GC DW_TAG_variant(_part), they are referenced (#2113)
by their respective parents.

See also #2105.
2020-08-07 13:23:47 -05:00
Nick Fitzgerald
00de2a6ab6 Merge pull request #2110 from fitzgen/peepmatic-parse-nesting-depth
Peepmatic: Implement maximum nesting level in parser
2020-08-07 10:49:23 -07:00
Nick Fitzgerald
fdbc9e351f Merge pull request #2111 from fitzgen/rename-stackmap-to-stack-map
Rename "Stackmap" to "StackMap"
2020-08-07 10:46:38 -07:00
Andrew Brown
f0e32c5f71 Fix typo (#2114) 2020-08-07 12:19:07 -05:00
Nick Fitzgerald
aad086899c peepmatic: Implement maximum nesting level in parser
So that we don't blow the stack.

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=24705
2020-08-07 10:12:13 -07:00
Nick Fitzgerald
174159a552 Bump wast to version 22.0.0 in peepmatic crates 2020-08-07 10:12:11 -07:00
Nick Fitzgerald
05bf9ea3f3 Rename "Stackmap" to "StackMap"
And "stackmap" to "stack_map".

This commit is purely mechanical.
2020-08-07 10:08:44 -07:00
Christopher Agia
2482bd80c2 Caller get_export() implemented for Extern::Func. (#2108)
* Caller get_export() implemented for func

* update tests for get_export() Extern::Func return

Signed-off-by: Christopher Agia <chrisagia@google.com>

* document get_export() for Extern::Func

Signed-off-by: Christopher Agia <chrisagia@google.com>
2020-08-07 11:24:42 -05:00
Johnnie Birch
e60a6f2ad2 Fixup packed integer add lowering
Remove stray print statement
Fix bug in match statement causing unreachable code.
2020-08-06 22:25:18 -07:00
Johnnie Birch
f5909b37c3 Add emit tests for packed integer add instructions 2020-08-06 22:25:18 -07:00
Johnnie Birch
dd6ba5f9d7 Lower packed integer add instructions (v128)
Adds lowering support for packed integer add instructions and helper
function for determining if a type for an instruction indicates it is
packed.
2020-08-06 22:25:18 -07:00
Johnnie Birch
2eadc6e2a8 Add packed integer add opcodes (v128) to instruction set enum 2020-08-06 22:25:18 -07:00
Gabor Greif
b5a6daedc4 DW_TAG_enumerator is owned by parent tag (#2107)
so mark it as such for GC to not accidentally lose it.

Fixes https://github.com/bytecodealliance/wasmtime/issues/2105
2020-08-06 14:19:43 -05:00
Chris Fallin
af9759385f Merge pull request #2067 from akirilov-arm/simd_lane
Enable the spec::simd::simd_lane test for AArch64
2020-08-06 10:33:54 -07:00