Commit Graph

103 Commits

Author SHA1 Message Date
StackDoubleFlow
9637bc5a09 Fix cranelift Module and ObjectModule docs links (#2852) 2021-04-21 06:29:02 -07:00
Chris Fallin
67cc42d4c3 Merge pull request #2750 from bjorn3/anon_allocs
Support declaring anonymous functions and data objects
2021-04-12 12:11:11 -07:00
Chris Fallin
6bec13da04 Bump versions: Wasmtime to 0.26.0, Cranelift to 0.73.0. 2021-04-05 10:48:42 -07:00
Benjamin Bouvier
6e6713ae0b cranelift: add support for the Mac aarch64 calling convention
This bumps target-lexicon and adds support for the AppleAarch64 calling
convention. Specifically for WebAssembly support, we only have to worry
about the new stack slots convention. Stack slots don't need to be at
least 8-bytes, they can be as small as the data type's size. For
instance, if we need stack slots for (i32, i32), they can be located at
offsets (+0, +4). Note that they still need to be properly aligned on
the data type they're containing, though, so if we need stack slots for
(i32, i64), we can't start the i64 slot at the +4 offset (it must start
at the +8 offset).

Added one test that was failing on the Mac M1, as well as other tests
stressing different yet similar situations.
2021-03-22 10:06:13 +01:00
bjorn3
cc89111463 Support declaring anonymous functions and data objects 2021-03-21 18:00:26 +01:00
Will Robson
38926fb1fc cranelift-module: Add support for passing a StackMapSink when defining functions
Fixes #2738

This follows the convention set by the existing method of passing a
TrapSink by adding another argument for a StackMapSink.
2021-03-19 00:02:15 +00:00
Nick Fitzgerald
d081ef9c2e Bump Wasmtime to 0.25.0; Cranelift to 0.72.0 2021-03-16 11:02:56 -07:00
Dan Gohman
8854dec01d Bump version to 0.24.0
I used a specially modified version of the publish script to avoid
bumping the `witx` version.
2021-03-04 18:17:03 -08:00
bjorn3
a710fc4425 Make Module object safe 2021-02-22 16:00:37 +01:00
Dan Gohman
8d90ea0390 Bump version to 0.23.0
I used a specially modified version of the publish script to avoid
bumping the `witx` version.
2021-02-17 15:35:43 -08:00
Alex Crichton
4a351ab7fe Update a number of dependencies (#2594)
This commit goes through the dependencies that wasmtime has and updates
versions where possible. This notably brings in a wasmparser/wast update
which has some simd spec changes with new instructions. Otherwise most
of these are just routine updates.
2021-01-21 15:49:13 -06:00
Nick Fitzgerald
5ad82de3c5 Bump Wasmtime to 0.22.0; Cranelift to 0.69.0 2021-01-07 14:51:12 -08:00
Chris Fallin
76fb9a08c7 cranelift-object: reject symbol names with NUL byte without panic'ing.
Avoid a `panic!()`, and return a proper error, on a NUL byte. We hit a
null-byte check inside the `object` crate otherwise; this blocks fuzzing
when testing via a write-object-file-and-dlopen flow.
2020-12-17 09:53:56 -08:00
bjorn3
b7a93c2321 Remove reloc_block
It isn't called and all reloc sinks either ignore it or panic when it is
called.
2020-11-11 12:36:17 +01:00
bjorn3
1dc27c93a4 Introduce DataDescription::all_relocs to dedup some code 2020-11-11 12:36:17 +01:00
bjorn3
844a52e96a Don't unnecessarily take &self for some ModuleDeclarations methods 2020-11-11 11:43:09 +01:00
bjorn3
856f799ade Make some things more consistent between define_function and define_function_bytes 2020-11-11 11:38:28 +01:00
bjorn3
5df5bbbdca Fix usage of default_libcall_names (#2378)
* Fix usage of default_libcall_names

* Add basic cranelift-object test

It is based on a test with the same name in cranelift-simplejit
2020-11-09 10:33:56 -06:00
Andrew Brown
c9e8889d47 Update clippy annotation to use latest version (#2375) 2020-11-09 09:24:59 -06:00
Alex Crichton
8af2dbfbac Allow offloading compilation in cranelift-object (#2371)
This commit is a slight refactoring of the `Module` trait and backend in
`cranelift-object`. The goal is to enable parallelization of compilation
when using `cranelift-object`. Currently this is difficult because
`ObjectModule::define_function` requires `&mut self`. This instead
soups up the `define_function_bytes` interface to handle relocations so
compilation can happen externally before defining it in a `Module`. This
also means that `define_function` is now a convenience wrapper around
`define_function_bytes`.
2020-11-06 09:56:44 -06:00
Alex Crichton
e4c3fc5cf2 Update immediate and transitive dependencies
I don't think this has happened in awhile but I've run a `cargo update`
as well as trimming some of the duplicate/older dependencies in
`Cargo.lock` by updating some of our immediate dependencies as well.
2020-11-05 08:34:09 -08:00
Alex Crichton
ab1958434a Bump to 0.21.0 (#2359) 2020-11-05 09:39:53 -06:00
bjorn3
b061694491 Rustfmt and update docs 2020-10-01 09:53:23 +02:00
bjorn3
d84ca235d2 Remove Backend trait and turn Module into a trait 2020-09-30 19:52:57 +02:00
bjorn3
84c6ec3214 Move alignment config from declare_data to define_data 2020-09-30 19:23:23 +02:00
bjorn3
b44c5bb2be Move ModuleDeclarations to backends 2020-09-30 18:33:29 +02:00
bjorn3
7a6e909efe Move a bit more logic out of Module 2020-09-30 17:31:08 +02:00
bjorn3
c2ffcdc6d0 Move logic out of more Module methods 2020-09-30 17:12:33 +02:00
bjorn3
80f4ecf9b5 Move almost all logic out of Module 2020-09-30 16:50:24 +02:00
bjorn3
588a4be0b3 Store Compiled* in the backend instead of Module 2020-09-30 16:18:57 +02:00
bjorn3
405b9e2875 Remove finalize_* from the Backend trait
Instead let the `finish` method perform finalization
2020-09-30 14:20:39 +02:00
bjorn3
59f95083b1 Remove write_data_funcaddr and write_data_dataaddr
They are unimplemented by all backends
2020-09-30 13:59:26 +02:00
bjorn3
7608749647 Merge finalize_definitions into finish 2020-09-30 13:58:13 +02:00
bjorn3
4483c3740a Remove get_finalized_* 2020-09-30 13:53:01 +02:00
bjorn3
6161acfba5 Minor simplification 2020-09-30 12:33:26 +02:00
bjorn3
b1187b5507 Merge ModuleNamespace and ModuleContents 2020-09-30 12:29:22 +02:00
Alex Crichton
5e08eb3b83 Bump wasmtime to 0.20.0 (#2222)
At the same time bump cranelift crates to 0.67.0
2020-09-23 13:54:02 -05:00
Pat Hickey
1fabb051b0 Merge pull request #2218 from bjorn3/per_function_sections
cranelift-object: Support per function sections
2020-09-22 11:28:58 -07:00
bjorn3
863d4272a7 cranelift-object: Support per function sections
This makes it possible for the linker to omit unused functions when
--gc-sections is passed.
2020-09-22 14:04:15 +02:00
bjorn3
deb20c129a Fix relocated readonly data in custom sections
Lld doesn't allow relocations in readonly sections
2020-09-21 13:38:42 +02:00
Joshua Nelson
d28abad441 Upgrade to target-lexicon 0.11
This allows downstream library users to use `CDataModel` without having
to install two different versions of target-lexicon.
2020-09-15 11:40:09 -07:00
bjorn3
b5e24c8c67 Update object to 0.21.1 (#2144) 2020-08-19 15:14:26 -05: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
Alex Crichton
63d5b91930 Wasmtime 0.19.0 and Cranelift 0.66.0 (#2027)
This commit updates Wasmtime's version to 0.19.0, Cranelift's version to
0.66.0, and updates the release notes as well.
2020-07-16 12:46:21 -05:00
Till Schneidereit
f80c2abffb Update various crates' object and wast dependencies (#1908)
This somewhat cuts down on duplicate dependencies. `wast` is used in a much older version (`11.0.0`) by `witx`, and can be updated without issues there as well, but this at least gets us from 3 copies to 2.
2020-07-01 09:11:38 -05:00
Pat Hickey
4f72a7483b Merge pull request #1836 from carlokok/feature/object_file_section
Cranelift: Module data apis should allow specifying the object file section
2020-06-17 10:49:09 -07:00
Carlo Kok
b2549d1fde Rust fmt fixes 2020-06-17 06:46:58 +02:00
Carlo Kok
0b613caad1 Address concerns in pullrequests. 2020-06-15 20:46:04 +02:00
bjorn3
9788b02dd5 Bump object to 0.19.0 (#1767)
* Bump object to 0.19.0
2020-06-12 15:37:04 -05:00
Dan Gohman
caa87048ab Wasmtime 0.18.0 and Cranelift 0.65.0. 2020-06-11 17:49:56 -07:00