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:
parent
3099a6bf2a
commit
35394dbfaa
8 changed files with 49 additions and 27 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue