1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 08:34:57 +00:00

LibWasm: Some more performance stuff (#8812)

* 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.
This commit is contained in:
Ali Mohammad Pur 2021-07-17 01:04:37 +04:30 committed by GitHub
parent 3099a6bf2a
commit 35394dbfaa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 49 additions and 27 deletions

View file

@ -512,14 +512,16 @@ int main(int argc, char* argv[])
if (debug)
launch_repl();
if (result.is_trap())
warnln("Execution trapped!");
if (!result.values().is_empty())
warnln("Returned:");
for (auto& value : result.values()) {
Wasm::Printer printer { stream };
g_stdout.write(" -> "sv.bytes());
g_printer.print(value);
if (result.is_trap()) {
warnln("Execution trapped: {}", result.trap().reason);
} else {
if (!result.values().is_empty())
warnln("Returned:");
for (auto& value : result.values()) {
Wasm::Printer printer { stream };
g_stdout.write(" -> "sv.bytes());
g_printer.print(value);
}
}
}
}