Commit Graph

199 Commits

Author SHA1 Message Date
Afnan Enayet
9128290fb4 Rename ILBuilder to FunctionBuilderContext (#268)
* Rename `ILBuilder` to `FunctionBuilderContext` and update corresponding
code

* Refactor usages of ILBuilder to become FunctionBuilderContext,
update variable names to reflect this change

* Reformat to ensure that lines stay under 100 char limit

* Apply corrections from `rustfmt` to pass tests

* Rename variables to be more consistent with refactor of ILBuilder
2018-03-14 10:48:06 -07:00
Dan Gohman
44ca27beec Update to wasmparser 0.15.1. 2018-03-13 09:34:20 -07:00
Dan Gohman
e776d987fd Add Cargo.toml badges for published packages.
This adds a basic travis badge, as well as a badge indicating
"experimental" status, since the APIs are still evolving.
2018-03-13 09:34:11 -07:00
Dan Gohman
aaf0def241 Add lint overrides for unused extern crate hashmap_core.
This allows these files to build with both the `no_std` and `std`
features enabled at the same time.
2018-03-12 14:09:34 -07:00
Dan Gohman
4a3077d638 Merge remote-tracking branch 'origin/master' into no_std 2018-03-12 12:55:57 -07:00
Dan Gohman
30f8daa9d6 Replace assert! with debug_assert! in production code paths.
This allows the assertions to be disabled in release builds, so that
the code is faster and smaller, at the expense of not performing the
checks. Assertions can be re-enabled in release builds with the
debug-assertions flag in Cargo.toml, as the top-level Cargo.toml
file does.
2018-03-12 12:38:30 -07:00
Dan Gohman
ad363d7e6b Replace cretonne-wasm's Local with cretonne-frontend's Variable.
Previously, cretonne-wasm used its own Local struct for identifying
local variables. However, now that cretonne-frontend provides a
Variable struct, just use that instead.
2018-03-12 12:38:30 -07:00
Dan Gohman
e441337e4b Bump version to 0.3.4 2018-03-09 16:32:13 -08:00
Dan Gohman
56c7d85727 More minor code simplifications. 2018-03-09 15:08:54 -08:00
Dan Gohman
55d0efcb14 Pass the wasmparser::Operator by value, simplifying the code. 2018-03-09 15:08:54 -08:00
Dan Gohman
b5f428b6f2 Bump version to 0.3.3 2018-03-08 02:50:09 -08:00
Dan Gohman
ee0bce4106 Bump version to 0.3.2 2018-03-05 16:17:00 -08:00
Dan Gohman
d119524c90 Bump version to 0.3.1 2018-03-05 07:11:23 -08:00
Dan Gohman
bf480c341b Use https rather than http for several URLs. 2018-03-05 06:55:27 -08:00
Dan Gohman
c59e9180de Tidy up whitespace. 2018-03-05 06:55:27 -08:00
Bruce Mitchener
d2d02565fb I64Extend16S should operate on 16 bits, not 8.
This showed up in clippy warnings as the code for this case was
the same as for `I64Extend8S`.
2018-03-05 06:53:13 -08:00
Bruce Mitchener
125270e2b0 Fix some typos. 2018-03-04 21:33:04 -08:00
Dan Gohman
b9f51d7850 Enable more compliler lints. 2018-02-28 13:18:07 -08:00
Dan Gohman
1cf9a8d669 Implement the wasm sign-extension-ops proposal.
https://github.com/WebAssembly/sign-extension-ops/
2018-02-28 12:02:14 -08:00
Dan Gohman
6fcbb20e10 Bump version to 0.3.0 2018-02-28 10:31:00 -08:00
Dan Gohman
60c6154b94 Add some crate keywords. 2018-02-28 03:38:48 -08:00
Dan Gohman
dabfc55c6e Bump version to 0.2.0 2018-02-27 15:58:25 -08:00
Dan Gohman
0e22c74085 Track wasm reachability explicitly.
Maintain an explicit "reachable" flag when decoding wasm. Push placeholder
frames on the control-flow stack instead of just maintaining a count of
the stack depth in unreachable code, so that we can whether If blocks
have Elses, and whether block exits are branched to, in all contexts.

Fixes #217.
2018-02-26 15:24:33 -08:00
Dan Gohman
81c126619b Ignore unknown custom wasm sections. 2018-02-26 15:24:25 -08:00
Dan Gohman
6c9cf2bacf Switch from error_core to failure. 2018-02-23 21:49:59 -08:00
Dan Gohman
e37f45667f Add an explicit std feature so that features are purely additive. 2018-02-23 21:49:55 -08:00
Lachlan Sneff
ddfa88c8ba Removed extraneous newlines 2018-02-23 20:57:26 -08:00
Lachlan Sneff
2462a065ad Fixed formatting issues 2018-02-23 20:56:30 -08:00
Lachlan Sneff
66a150e67a lib/wasm works with no_std 2018-02-23 20:56:30 -08:00
Dan Gohman
2a26b70854 Update URLs. 2018-02-23 16:16:44 -08:00
Jakob Stoklund Olesen
ec746c3359 Add a publish-all.sh script.
Set identical version numbers on all cretonne-* crates and print "cargo
publish" commands.

Update all crates to version 0.1.0.
2018-02-23 12:51:14 -08:00
Benjamin Bouvier
f02c8fd1ff Fixes #244: Prints the generated code size and wasm bytecode size in wasm command; 2018-02-23 08:46:09 -08:00
Dan Gohman
c7655c4928 Add minimal README.md files to published crates.
This will put descriptions on the packages' crates.io pages.
2018-02-21 20:50:03 -08:00
Dan Gohman
42e1616b82 Update to wasmparser 0.14.1. 2018-02-13 20:14:54 -08:00
Jakob Stoklund Olesen
af89006b09 Fix some markdown issues.
Work around some cases where the old markdown parser differs from the
new Pulldown parser for the documentation.
2018-01-08 16:19:16 -08:00
Jakob Stoklund Olesen
60c456c1ec Add a compilation pass timing facility.
Individual compilation passes call the corresponding timing::*()
function and hold on to their timing token while they run. This causes
nested per-pass timing information to be recorded in thread-local
storage.

The --time-passes command line option prints a pass timing report to
stdout.
2017-12-06 17:04:23 -08:00
Jakob Stoklund Olesen
c09ad06f96 Stop generating reserved_reg heaps in DummyEnvironment.
The reserved register heaps are not implemented in the Cretonne
legalizer, so IR generated by the dummy environment would trip
assertions when compiled.

Use a heap with a vmctx base address instead, and also demonstrate how
vmctx arguments are added to all signatures to achieve this.
2017-12-05 16:31:10 -08:00
Pat Hickey
919de82e9c rename wasm testsuite to wasm_testsuite
this makes it a lot more obvious in the travis build output
2017-12-01 09:00:23 -08:00
Pat Hickey
cced2c8b0c Fix wat syntax so wasm tests pass (#199)
* wasm testsuite: ignore hidden files in test dir

and report a rejected file. it was picking up vim .swp files

* wasmtests: correct wat syntax in icall.wat
2017-11-27 12:46:53 -08:00
Pat Hickey
eb49d9f8bf tests: update ExternalName api 2017-11-23 14:08:47 -08:00
Pat Hickey
803b83c87a wasm: change to new externalname api 2017-11-23 14:08:47 -08:00
Dan Gohman
d51a4c1065 Replace FunctionBuilder's Drop impl with a finalize function. (#193)
* Replace FunctionBuilder's Drop impl with a finalize function.

This has the advantage of not triggering assertion failures in the event
of abandoning a partially-built function. It has the disadvantage of
requiring users to call finalize() explicitly.
2017-11-17 16:03:40 -08:00
Dan Gohman
355e3e3c15 Remove redundant validation for function locals.
Remove the MAX_LOCALS constraint, and the local type validation.
These are checked by whatever is performing proper validation.
2017-11-13 14:34:35 -08:00
Dan Gohman
ced7a88ecc Use consistent formatting for module-level comments. 2017-11-08 14:49:27 -08:00
Dan Gohman
889b06fd16 Replace as casts with type-conversion functions. 2017-11-08 10:48:44 -08:00
Dan Gohman
3ab4349c1b Use Self instead of repeating the type name. 2017-11-08 10:43:11 -08:00
Dan Gohman
b7f979a8be Combine identical match arms. 2017-11-08 10:40:43 -08:00
Dan Gohman
849f090562 Fix nondeterminism in br_table translation. 2017-11-07 15:33:35 -08:00
Dan Gohman
9b15fe7dfd Simplify Ebb parameter creation.
Ebb parameters are appended explicitly by whoever calls create_block,
so they don't need to also be inferred from branches. This makes the
frontend code more flexible for producers that want to create things
in a different order, and it eliminates more temporary allocations.

FunctionBuilder no longer maintains its own list of the function
parameter values; these can be obtained from the ebb parameter list
on the entry block.
2017-11-07 15:13:00 -08:00
Dan Gohman
cce2384ede Remove switch_to_block's jump_args argument.
switch_to_block doesn't need its jump_args argument, since jump
arguments are handled by the `jump` instruction and others, rather
than on the switch to a new ebb itself.
2017-11-06 16:38:13 -08:00