Commit Graph

581 Commits

Author SHA1 Message Date
Dan Gohman
4992162fab Format with rustfmt. 2018-08-03 15:37:57 -07:00
Dan Gohman
548c45c604 Rename wasmtime-runtime to wasmtime-environ.
This mirrors changes in cranelift.
2018-08-03 15:20:19 -07:00
Dan Gohman
ef5254c0da More code reorganization and cleanups. 2018-08-03 15:06:59 -07:00
Dan Gohman
831b481f13 More code reorganization. 2018-08-03 14:18:23 -07:00
Dan Gohman
6659ef7018 More code reorganization. 2018-08-03 13:35:25 -07:00
Dan Gohman
2608dd0c47 Update to cranelift 0.16.1, target-lexicon 0.0.3, faerie 0.4.4. 2018-07-21 06:46:19 -07:00
Dan Gohman
c612d48b33 Rename to wasmtime. It's wasmtime!
Also, update to Cretonne 0.13.0.
2018-07-02 16:20:22 -07:00
Dan Gohman
73639e4557 Update to cretonne 0.9.0 and faerie 0.4.1. 2018-06-07 14:37:36 -07:00
Dan Gohman
99ee96ca16 Update to latest stable rustfmt-preview. 2018-06-07 14:17:56 -07:00
Dan Gohman
b5e794a584 Update to Cretonne 0.8.0. 2018-05-14 12:58:28 -10:00
Dan Gohman
f276a021cb Update wasmstandalone for API changes.
This updates to the latest faerie and cretonne API changes.
2018-02-22 09:44:02 -08:00
Dan Gohman
be9e3e88e4 Emit wasm data initializers as faerie data segments.
This is a temporary measure while other parts of the system are being
developed, and will need to be replaced by a proper solution.
2017-11-04 15:28:19 -07:00
Dan Gohman
c30116d948 Fix copypasta in a FIXME message. 2017-11-02 07:42:03 -07:00
Dan Gohman
ca1b461375 Begin internal reorganization.
This begins reorganizing how translation and compilation occur, and
setting up infrastructure for imports/exports and relocations. It
splits parts out of StandaloneRuntime, forming Module, Compilation,
and Instance structs, which can be used more independently.

It also simplifies the command-line interface, in a step towards
making simple tools that just expose the functionality of the
libraries.
2017-10-13 14:47:01 -07:00
Dan Gohman
142b17a3f0 Delete an unused settings builder. 2017-10-10 09:47:04 -07:00
Dan Gohman
f90e7ade86 Enable the cretonne verifier by default in debug builds. 2017-10-05 18:01:27 -07:00
Dan Gohman
b5732bc200 On error, always print the error message and exit with non-zero status. 2017-10-05 08:49:32 -07:00
Dan Gohman
c8e015f31a Remove an unused argument. 2017-10-04 12:32:45 -07:00
Dan Gohman
fc857a758e Remove an unneeded block. 2017-10-04 12:22:32 -07:00
Dan Gohman
b4e7e918cc Use the correct index for printing function definitions when imports are present. 2017-10-04 12:22:07 -07:00
Dan Gohman
23bafd1218 Split the runtime and execution code into separate crates. 2017-10-03 14:57:52 -07:00
Dan Gohman
865a3d9f31 Rename wasmstandalone::StandaloneRuntime to wasmstandalone::Runtime. 2017-10-03 13:01:31 -07:00
Dan Gohman
6c4bbc643c Set the faerie target based on the cretonne target. 2017-10-03 12:39:52 -07:00
Dan Gohman
a68b2619bd Sniff the wasm magic bytes, rather than relying on the filename extension. 2017-10-03 12:23:59 -07:00
Dan Gohman
e5ed1517ce Fix the command name in the usage message. 2017-10-03 12:21:09 -07:00
Dan Gohman
324a395a95 Make the "wat2wasm" error message not panic. 2017-10-03 12:20:37 -07:00
Dan Gohman
5b0a083124 Avoid unnecessary BufReaders. 2017-10-03 06:56:23 -07:00
Dan Gohman
e64eb79aaf Fix dependency paths. wasmstandalone no longer depends on out-of-tree patches. 2017-09-23 15:38:38 -07:00
Dan Gohman
0c78a2f298 Import the wasm2obj experiment and minimally update it. 2017-09-23 15:38:38 -07:00
Dan Gohman
b583d75c7a Fix redundant borrows. 2017-09-22 16:11:11 -07:00
Dan Gohman
382415ed0c Fix a useless format!. 2017-09-22 16:09:10 -07:00
Dan Gohman
b89277d9ce Rename "wast" to "wat". 2017-09-22 15:57:32 -07:00
Dan Gohman
cdffc1b50a Roughly update for the recent Cretonne API changes.
Everything builds and simple modules run, though there's still lots more
to do.
2017-09-22 15:56:18 -07:00
Dan Gohman
73f5adb19d Clippy cleanups. 2017-09-06 09:56:14 -07:00
Dan Gohman
3868467917 Format with rustfmt 0.9.0. 2017-09-06 08:37:12 -07:00
Dan Gohman
d0fe50a2a8 Check in the wasmstandalone code.
This is based on the code in https://github.com/denismerigoux/cretonne/commits/wasm2cretonne
before wasmstandalone was removed, with minor updates for the new library structure.
It is not yet updated for the latest cretonne API changes.
2017-09-05 17:06:51 -07:00
Jakob Stoklund Olesen
2927878707 Track regmove instruction during binemit.
Register locations can change throughout an EBB. Make sure the
emit_inst() function considers this when encoding instructions and
update the register diversion tracker.
2017-07-18 12:52:53 -07:00
Jakob Stoklund Olesen
28457f82c3 Add a Context::emit_to_memory function.
This function will emit the binary machine code into contiguous raw
memory while sending relocations to a RelocSink.

Add a MemoryCodeSink for generating machine code directly into memory
efficiently. Allow the TargetIsa to provide emit_function
implementations that are specialized to the MemoryCodeSink type to avoid
needless small virtual callbacks to put1() et etc.
2017-07-18 08:03:53 -07:00
Jakob Stoklund Olesen
6cc729a69b Add a Context::compile() function which runs all compiler passes.
This is the main entry point to the code generator. It returns the
computed size of the functions code.

Also add a 'test compile' command which runs the whole code generation
pipeline.
2017-07-12 12:22:49 -07:00
Jakob Stoklund Olesen
b6d4b884ad Add an ISA argument to dfg.display_inst().
Include ISA-specific annotations in tracing and error messages.
2017-07-12 10:13:13 -07:00
Jakob Stoklund Olesen
71af555e6f Include ISA-specific information in verifier errors.
When the test driver reports a verifier error, make sure to include the
TargetIsa when printing the failing function.
2017-07-12 10:13:13 -07:00
Jakob Stoklund Olesen
e7c6efa31e Update docopt dependency to 0.8.0.
This breaks our depending on two different versions of the regex
library.

This updated docopt uses serde instead of rustc_serialize.
2017-06-14 10:38:06 -07:00
Denis Merigoux
9b06f76057 LICM pass (#87)
* LICM pass

* Uses loop analysis to detect loop tree
* For each loop (starting with the inner ones), create a pre-header and move there loop-invariant instructions
* An instruction is loop invariant if it does not use as argument a value defined earlier in the loop
* File tests to check LICM's correctness
* Optimized pre-header creation
If the loop already has a natural pre-header, we use it instead of creating a new one.
The natural pre-header of a loop is the only predecessor of the header it doesn't dominate.
2017-06-07 11:27:22 -07:00
Dan Gohman
dc809628f4 Start a very simple GVN pass (#79)
* Skeleton simple_gvn pass.
* Basic testing infrastructure for simple-gvn.
* Add can_load and can_store flags to instructions.
* Move the replace_values function into the DataFlowGraph.
* Make InstructionData derive from Hash, PartialEq, and Eq.
* Make EntityList's hash and eq functions panic.
* Change Ieee32 and Ieee64 to store u32 and u64, respectively.
2017-05-18 18:18:57 -07:00
Benjamin Bouvier
a2fd9cf0cc Update rustfmt to 0.8.4; (#81) 2017-05-15 15:10:47 -07:00
Dan Gohman
526feb161a Fix rustfmt diffs. 2017-05-11 06:57:55 -07:00
Dan Gohman
c571975a5c Use write! in utility code, rather than calling write_function directly. 2017-05-11 06:57:55 -07:00
Jakob Stoklund Olesen
15606fa735 Upgrade to rustfmt 0.8.3. 2017-04-27 12:52:41 -07:00
Jakob Stoklund Olesen
962a3a6a5e Upgrade to Rust 1.17.
- Remove some uses of 'static in const and static globals that are no
  longer needed.
- Use the new struct initialization shorthand.
2017-04-27 12:46:44 -07:00
Jakob Stoklund Olesen
c36aedfd03 Add an EntityMap::get_or_default() method.
This covers a common pattern for secondary entity maps: Get the value in
the map or the default value for out-of-range keys.
2017-04-25 15:53:30 -07:00