* Transform DWARF sections into native format for wasm2obj and wasmtime.
Generate DWARF sections based on WASM DWARF.
Ignore some of debug_info/debug_line for dead code.
* Fix test
wasmtime-execute is now wasmtime-jit. Move `JITCode` and the TargetIsa
into a new `Compiler` type. `InstancePlus` is no more, with trampoline
functionality now handled by `Compiler`.
And lots of other miscellaneous changes. Rename InstanceWorld to
InstancePlus and reorganize its contents. This still isn't a great name,
but at least now it has a clear purpose.
This implements a minimal wast testing harness in tests/wast.rs, which
runs the wast tests under tests/wast.
It also adds tests for trapping in a variety of ways, and fixes several
bugs exposed by those tests.
A CallConv enum on every function signature makes it possible to
generate calls to functions with different calling conventions within
the same ISA / within a single function.
The calling conventions also serve as a way of customizing Cretonne's
behavior when embedded inside a VM. As an example, the SpiderWASM
calling convention is used to compile WebAssembly functions that run
inside the SpiderMonkey virtual machine.
All function signatures must have a calling convention at the end, so
this changes the textual IL syntax.
Before:
sig1 = signature(i32, f64) -> f64
After
sig1 = (i32, f64) -> f64 native
sig2 = (i32) spiderwasm
When printing functions, the signature goes after the return types:
function %r1() -> i32, f32 spiderwasm {
ebb1:
...
}
In the parser, this calling convention is optional and defaults to
"native". This is mostly to avoid updating all the existing test cases
under filetests/. When printing a function, the calling convention is
always included, including for "native" functions.
* Function names should start with %
* Create FunctionName from string
* Implement displaying of FunctionName as %nnnn with fallback to #xxxx
* Run rustfmt and fix FunctionName::with_string in parser
* Implement FunctionName::new as a generic function
* Binary function names should start with #
* Implement NameRepr for function name
* Fix examples in docs to reflect that function names start with %
* Rebase and fix filecheck tests
The DominatorTree has existing DomNodes per EBB that can be used in lieu
of expensive HastSets for the depth-first traversal of the CFG.
Make the computed and cached post-order available for other passes
through the `cfg_postorder()` method which returns a slice.
The post-order algorithm is essentially the same as the one in
ControlFlowGraph::postorder_ebbs(), except it will never push a
successor node that has already been visited once. This is more
efficient, but it generates a different post-order.
Change the cfg_traversal tests to check this new algorithm.
Move the flow graph computation into a compute method which can be
called with multiple functions.
This allows us to reuse the ControlFlowGraph memory and keep an instance
in the Context.
Create a new directory hierarchy under 'filetests' for all the tests
that are run by 'cton-util test'.
Convert the parser tests under 'tests/parser' to use 'test cat' and
filecheck directives.
The -c flag to 'cton-util filecheck' will now print out a description of how
the directives are matching the input.
This explanation is also printed when a match fails.
- Add a ir::jumptable module with a JumpTableData struct representing the vector
of destinations.
- Add an entity map of jump tables to the Function.
- Parse and write jump tables in the function preamble.
- Rewrite EBB references in jumptables after parsing.
We llow forward references to values and EBBs, so it is not possible to rewrite
these from the source domain to the in-memory domain during parsing.
Instead go through all the instructions after parsing everything and rewrite the
value and EBB references when everything has been created and mapped.
This instruction uses two type variables: input and output. Make sure that our
parser can handle it. The output type variable annotation is mandatory.
Add a ValueTypeSet::example() method which is used to provide better diagnostics
for a missing type variable.
Add new intcc and floatcc operand types for the immediate condition codes on
these instructions.
Add new IntCompare and FloatCompare instruction formats.
Add a generic match_enum() parser function that can match any identifier-like
enumerated operand kind that implements FromStr.
Define the icmp and fcmp instructions in case.py. Include documentation for the
condition codes with these two instructions.
These instruction formats take immediate lane index operands. We store these as
u8 fields and require them to be in decimal format in the source. No hexadecimal
lane indexes are supported.