Age | Commit message (Collapse) | Author |
|
We were doing a number of things wrong:
- Switching to the parent context in the else meant that we couldn't
break out of the else section anymore
- We were not validating the resulting values, and so the stack was
in a relatively unknown state after 'else'
This commit fixes these issues :^)
|
|
...instead of silently ignoring the failure in the constructor.
|
|
|
|
Stop comparing platform-specific sized integer types to max() values of
other interger types. Enable the warning everywhere.
|
|
In order to reduce our reliance on __builtin_{ffs, clz, ctz, popcount},
this commit removes all calls to these functions and replaces them with
the equivalent functions in AK/BuiltinWrappers.h.
|
|
We should not crash, but rather just fail to verify them.
|
|
|
|
|
|
|
|
|
|
Previously we were ignoring the actual parameters and setting the arity
to an incorrect value, which could cause crashes (or unexpected traps).
|
|
|
|
This isn't a complete conversion to ErrorOr<void>, but a good chunk.
The end goal here is to propagate buffer allocation failures to the
caller, and allow the use of TRY() with formatting functions.
|
|
|
|
|
|
|
|
|
|
Same as Vector, ByteBuffer now also signals allocation failure by
returning an ENOMEM Error instead of a bool, allowing us to use the
TRY() and MUST() patterns.
|
|
Instead of signalling allocation failure with a bool return value
(false), we now use ErrorOr<void> and return ENOMEM as appropriate.
This allows us to use TRY() and MUST() with Vector. :^)
|
|
|
|
|
|
|
|
|
|
|
|
If we can easily communicate failure, let's avoid asserting and report
failure instead.
|
|
|
|
|
|
It's possible for the module to request too many locals, we now reject
such modules instead of trying to allocate space for them.
The value itself is chosen arbitrarily, so future tweaks _might_ be
necessary.
Found by OSS-Fuzz: https://oss-fuzz.com/testcase?key=4755809098661888
|
|
|
|
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.
|
|
The variant member already contains enough information to give us the
type when needed, so remove the type member and synthesize it when
needed, this allows lots of optimisation opportunaties when copying and
moving Values around.
|
|
|
|
...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.
|
|
We have a dedicated format specifier which adds the "0x" prefix, so
let's use that instead of adding it manually.
|
|
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.
|
|
These are mostly pretty small functions too, and they were about ~10%
of runtime.
|
|
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.
|
|
|
|
|