Commit Graph

2133 Commits

Author SHA1 Message Date
Dan Gohman
17859a87ff Fix a typo in a comment. 2018-10-03 13:09:37 -07:00
Tyler McMullen
79cea5e18b Implement jump tables (#453)
* Add 'jump_table_entry' and 'indirect_jump' instructions.

* Update CodeSink to keep track of code size. Pretty up clif-util's disassembly output.

* Only disassemble the machine portion of output. Pretty print the read-only data after it.

* Update switch frontend code to use new br_table instruction w/ default.
2018-10-03 10:04:21 -07:00
Benjamin Bouvier
de1d82b4ba Make SettingsError easier to diagnose; 2018-10-03 06:36:03 -07:00
Benjamin Bouvier
8b296e4874 Fixes #504: Implement Display/Fail for SetError and LookupError; 2018-10-03 06:36:03 -07:00
Benjamin Bouvier
0b3d3ac880 Remove logging levels restrictions (#538)
* Fixes #537: Remove release mode logging levels restrictions;

* Add information about log's logging levels in the README;
2018-10-02 10:45:23 -07:00
Dan Gohman
e8fc612dc2 Update to wasmparser 0.19.0. 2018-09-28 16:56:04 -07:00
Dan Gohman
b94cf6c65b Rename test modules to "tests" for consistency.
The majority of the test modules were already named "tests", and that's
what the example in the Rust book uses, so switch to that for all test
modules, for consistency.
2018-09-28 14:50:01 -07:00
Dan Gohman
52aa1d292a Update no_std support in cranelift-frontend. 2018-09-28 14:46:26 -07:00
Dan Gohman
75e4ff62a0 Update to filecheck 0.4.0. 2018-09-27 17:30:16 -07:00
Dan Gohman
44f1ee5518 Comment that test-all.sh runs checks on the Python files. 2018-09-27 16:50:01 -07:00
Dan Gohman
aa5ba71c97 Clarify the meaning of the symbol_value instruction. 2018-09-27 11:43:41 -07:00
Dan Gohman
6fdd58d143 Tidy up one last mention of EntityMap. 2018-09-27 09:07:44 -07:00
Dan Gohman
87e43ccb94 Mention in the README that we avoid using callstack recursion.
Callstack recursion has the property that the maximum stack depth can
grow significantly, depending on the input program. Cranelift uses
several recursive algorithms, however it uses explicit heap-based
stacks to do so.
2018-09-26 13:07:43 -07:00
Muhammad Mominul Huque
d266b1a42d Rename EntityMap to SecondaryMap (#528)
* Rename `EntityMap` to `SecondaryMap`
2018-09-26 12:03:44 -07:00
Dan Gohman
7ff71fcfd9 Merge pull request #507 from Aaronepower/master
Added FunctionBuilder::{call_memcpy, call_memset, call_memmove}
2018-09-25 21:31:58 -07:00
Dan Gohman
95e904da75 Merge branch 'master' into master 2018-09-25 16:12:26 -07:00
bjorn3
2eec1469a8 Legalize some more i8/i16 intructions (#524)
* Legalize some more i8/i16 intructions
2018-09-25 16:10:23 -07:00
bjorn3
2c53e2102c Add a sparse Switch usable instead of JumpTable to cranelift-frontend (#517)
* Add a sparse Switch usable instead of JumpTable to cranelift-frontend (fixes #438)
2018-09-25 07:34:32 -07:00
Bruce Mitchener
81d6731e76 clippy: Remove explicit return statements. 2018-09-24 09:40:32 -07:00
Bruce Mitchener
c8a65a721c clippy: Remove useless format call. 2018-09-24 09:40:32 -07:00
Bruce Mitchener
e07e159bda filetests: run_passes can take &str, not &String. 2018-09-24 09:40:32 -07:00
Sergey Pepyakin
2a7cc7e644 Bump wabt version to 0.6. 2018-09-23 16:35:33 -07:00
Aaron Power
09f2b78b14 Added FunctionBuilder::{call_memcpy, call_memset, call_memmove} 2018-09-23 11:25:39 +01:00
Dan Gohman
3e996c198f Remove the scroll 0.9.0 dependency.
Scroll 0.9.2 is now published which fixes the issue in 0.9.1, so
we can drop our fixed dependency on 0.9.0.
2018-09-22 22:24:29 -07:00
Aaron Power
c187e7a345 Replaced LibCall's fmt::Display implementation 2018-09-22 21:43:31 -07:00
Dan Gohman
15a237520e Depend on scroll 0.9.0 to fix Rust 1.25 compatibility. 2018-09-22 20:59:54 -07:00
Dan Gohman
ab99720959 Bump version to 0.22.0 2018-09-21 21:39:41 -07:00
Dan Gohman
10edc1b6ab Format src/wasm.rs with newer rustfmt. 2018-09-21 21:29:14 -07:00
Dan Gohman
cb6b1a76db Add a use std::vec::Vec; to fix the no_std build. 2018-09-21 21:14:06 -07:00
Dan Gohman
46beddecde Update to capstone 0.5.0. 2018-09-21 20:58:22 -07:00
Dan Gohman
8055abf90d Add a mention of simplejit-demo to the README. 2018-09-21 20:52:59 -07:00
Dan Gohman
ea0c196c11 More introductory documentation (#520)
* Add a comment to .rustfmt.toml explaning why it's here.

* Use `<details>` for specialized information in README.md.

* Describe a more elaborate issue-labelling system.
2018-09-21 20:16:55 -07:00
Dan Gohman
8d6a8e9069 Remove Module's finalize_function and finalize_data. (#519)
* Remove `Module`'s `finalize_function` and `finalize_data`.

Remove the ability to finalize individiual functions and data objects,
and instead just provide a way to finalize everything that's been
defined but not yet finalized. This allows SimpleJIT to share an
allocation between multiple functions without having to worry about
individual functions being finalized and needing to be published
without the other functions in the same allocation.

Users of the return values of `Module`'s `finalize_function` and
`finalize_data` should now use `get_finalized_function` and
`get_finalized_data` to obtain these values.
2018-09-21 20:13:33 -07:00
Dan Gohman
fd081f2af8 Update README.md to mention the actual version of Rust supported. 2018-09-21 19:50:05 -07:00
Dan Gohman
e7565a8893 Mention the Windows x64 calling convention support in README.md. 2018-09-21 19:49:24 -07:00
Dan Gohman
c840fb2f08 Move tests/moduletests.rs into lib/simplejit/tests.
These tests depend on cranelift-simplejit, which is higher-level than the
other crates they depend on, so lib/simplejit is a good place for them.
2018-09-19 20:19:57 -07:00
Dan Gohman
6e9c33a1ef Mark JIT memory as readable in addition to executable.
While we don't currently need this, we will for jump tables and constant
pools.
2018-09-19 20:11:37 -07:00
Dan Gohman
d514cec065 Avoid unneeded '&'s in let patterns. 2018-09-19 20:11:37 -07:00
Dan Gohman
3228d73f33 Add more content to cranelift-entity's README.md. (#515)
* Add more content to cranelift-entity's README.md.

Summarize what cranelift-entity provides, and how it differs from
similar systems such as slotmap, which was recently highlighted in the
RustConf 2018 Closing Keynote.
2018-09-19 13:49:59 -07:00
Dan Gohman
2fe96c30a6 Check in the Crane and Ferris drawing so that people can remix it :-).
Fixes #514.
2018-09-13 15:30:39 -07:00
Dan Gohman
53a0c6c67f Update to the rustfmt in rust 1.29, which is now stable. 2018-09-13 12:59:25 -07:00
Dan Gohman
f23ea04242 Fix a panic when splitting a critical edge on a jump_table with nulls.
This fixes #505.
2018-09-12 16:59:03 -07:00
Dan Gohman
f6519c87a4 Improve the assertion failure message for sealing a block twice. 2018-09-12 16:58:36 -07:00
Dan Gohman
f2177deec1 Improve assertion messages in Module finalization.
When an object being finalized references an object declared as needing
a definition, the definition needs to be available. Add asserts to catch
this specific case.
2018-09-12 16:07:43 -07:00
Dan Gohman
9e65b694bd Minor code simplification; avoid an unneeded match. 2018-09-12 16:07:14 -07:00
Dan Gohman
d0f703a6ff Fix the type of table bounds in DummyEnvironment.
Also, fix the wasm testsuite harness to run the verifier with a
TargetIsa so that it catches problems like this.
2018-09-12 14:40:20 -07:00
Maddy
52e6b07058 Update the reload pass to replace copies with fill/spill instructions. 2018-09-12 14:15:45 -07:00
Nick Fitzgerald
ea85018ccf clif-util: fix clif-util pass subcommand arguments
Because of the way that the `pass` subcommand orders its arguments, the
positional "single-file" input cannot be optional with a default value, because
it is followed by required positional arguments. If it were optional, that would
result in argument ambiguity where `clap` cannot tell if the optional positional
argument is supplied, or if the given argument is the next required positional
argument.

Before this commit:

```
$ cargo run --bin clif-util -- pass ./filetests/dce/basic.clif dce
   Compiling cranelift-tools v0.21.0 (file:///Users/fitzgen/src/cranelift)
    Finished dev [unoptimized + debuginfo] target(s) in 4.38s
     Running `target/debug/clif-util pass ./filetests/dce/basic.clif dce`
thread 'main' panicked at 'Found positional argument which is not required with a lower index than a required positional argument: "single-file" index 1', /Users/fitzgen/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-2.32.0/src/app/parser.rs:612:21
note: Run with `RUST_BACKTRACE=1` for a backtrace.
```

After this commit:

```
$ cargo run --bin clif-util -- pass ./filetests/dce/basic.clif dce
   Compiling cranelift-filetests v0.21.0 (file:///Users/fitzgen/src/cranelift/lib/filetests)
   Compiling cranelift-tools v0.21.0 (file:///Users/fitzgen/src/cranelift)
    Finished dev [unoptimized + debuginfo] target(s) in 5.96s
     Running `target/debug/clif-util pass ./filetests/dce/basic.clif dce`
1 tests
```
2018-09-11 10:16:14 -07:00
Dan Gohman
9ebe1cc26c Merge pull request #503 from joshuawarner32/simplejit-example-improvements
Improve simplejit-example
2018-09-11 09:49:07 -07:00
Dan Gohman
40bcd613cd Merge branch 'master' into simplejit-example-improvements 2018-09-11 09:45:43 -07:00