mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-20 15:09:42 +00:00
LibWasm: Avoid repeated shrinkage of value stack
This commit is contained in:
parent
0f13952f30
commit
5c6f223f48
Notes:
github-actions[bot]
2025-08-08 10:57:22 +00:00
Author: https://github.com/alimpfard
Commit: 5c6f223f48
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5060
Reviewed-by: https://github.com/Hendiadyoin1
Reviewed-by: https://github.com/R-Goc
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/gmta
1 changed files with 3 additions and 4 deletions
|
@ -52,10 +52,9 @@ Result Configuration::execute(Interpreter& interpreter)
|
||||||
if (interpreter.did_trap())
|
if (interpreter.did_trap())
|
||||||
return interpreter.trap();
|
return interpreter.trap();
|
||||||
|
|
||||||
Vector<Value> results;
|
Vector<Value> results { value_stack().span().slice_from_end(frame().arity()) };
|
||||||
results.ensure_capacity(frame().arity());
|
value_stack().shrink(value_stack().size() - results.size(), true);
|
||||||
for (size_t i = 0; i < frame().arity(); ++i)
|
results.reverse();
|
||||||
results.unchecked_append(value_stack().take_last());
|
|
||||||
|
|
||||||
label_stack().take_last();
|
label_stack().take_last();
|
||||||
return Result { move(results) };
|
return Result { move(results) };
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue