Age | Commit message (Collapse) | Author |
|
|
|
No functional changes.
|
|
Imported functions in Wasm may throw JS exceptions, and we need to
preserve these exceptions so we can pass them to the calling JS code.
This also adds a `assert_wasm_result()` API to Result for cases where
only Wasm traps or values are expected (e.g. internal uses) to avoid
making LibWasm (pointlessly) handle JS exceptions that will never show
up in reality.
|
|
|
|
|
|
|
|
|
|
And add a spec link while I'm at it.
|
|
|
|
|
|
|
|
We have a new, improved string type coming up in AK (OOM aware, no null
state), and while it's going to use UTF-8, the name UTF8String is a
mouthful - so let's free up the String name by renaming the existing
class.
Making the old one have an annoying name will hopefully also help with
quick adoption :^)
|
|
|
|
|
|
|
|
Previously we were ignoring the actual parameters and setting the arity
to an incorrect value, which could cause crashes (or unexpected traps).
|
|
|
|
|
|
|
|
This instruction wants RoundingMode::ToEven, so let's use the correct
function.
|
|
Using a left-shift operator for a right shift operation is not exactly
the most correct action :P
|
|
|
|
We only need to know the initial bounds, which we calculate by default
when the interpreter is constructed.
This cuts down on syscalls and makes wasm calls a lot cheaper.
|
|
|
|
...or rather, match what the spec _means_ to say, not what it actually
says.
|
|
|
|
This should make debugging and profiling much better, at little to no
runtime cost.
Also moves off the operator definitions to a separate header, so it
should also improve the editing experience quite a bit.
|
|
There are no multiple exit paths in that function, so we can just put
the ending logic right at the end of the function instead.
|
|
...and enable it for LibWeb and test-wasm.
Note that `wasm` will not be limited by this.
|
|
This reverts commit 35394dbfaa23b44a293da85b20a63a10f73572c3.
I pushed the wrong button again, hopefully this will be the last of
such incidents.
|
|
* wasm: Don't try to print the function results if it traps
* LibWasm: Inline some very hot functions
These are mostly pretty small functions too, and they were about ~10%
of runtime.
* LibWasm+Everywhere: Make the instruction count limit configurable
...and enable it for LibWeb and test-wasm.
Note that `wasm` will not be limited by this.
* LibWasm: Remove a useless use of ScopeGuard
There are no multiple exit paths in that function, so we can just put
the ending logic right at the end of the function instead.
|
|
Perform signed integer shifts, addition, subtraction, and rotations
using their corresponding unsigned type. Additionally, mod the right
hand side of shifts and rotations by the bit width of the integer per
the spec. This seems strange, but the spec is clear on the desired
wrapping behavior of arithmetic operations.
|
|
This way, we can make sure that it doesn't overflow when ASAN is
enabled.
|
|
These strings are only used when execution traps, so there's no reason
to create actual strings until that happens; instead switch to using
StringViews.
|
|
|
|
Also adds a forgotten Wasm::Printer implementation for printing table
branch arguments.
|
|
If the stack is empty, let's just trap.
|
|
Specifically, explicitly specify the checked type, use the resulting
value instead of doing the same calculation twice, and break down
calculations to discrete operations to ensure no intermediary overflows
are missed.
|
|
This makes debugging wasm code a bit easier, as we now know what fails
instead of just "too bad, something went wrong".
|
|
These limits are described in the spec, and we're supposed to stop
execution at some point.
The limits are arbitrarily chosen.
|
|
Otherwise we'd just crash, which is not a good thing
|
|
With these, the only remaining unimplemented instructions are the
following:
- memory.init
- data.drop
- memory.copy
- memory.fill
- table.init
- elem.drop
- table.copy
- table.grow
- table.size
- table.fill
|
|
|
|
|
|
|