1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:57:35 +00:00

LibWasm: Let the interpreter itself manage the call frame

This commit is contained in:
Ali Mohammad Pur 2021-05-24 21:24:28 +04:30 committed by Ali Mohammad Pur
parent 85794f8244
commit 477ab6dc4c
3 changed files with 18 additions and 2 deletions

View file

@ -128,7 +128,7 @@ void BytecodeInterpreter::call_address(Configuration& configuration, FunctionAdd
Result result { Trap {} };
{
Configuration::CallFrameHandle handle { configuration };
CallFrameHandle handle { *this, configuration };
result = configuration.call(*this, address, move(args));
}
@ -437,7 +437,10 @@ void BytecodeInterpreter::interpret(Configuration& configuration, InstructionPoi
for (size_t i = 0; i < frame.arity(); ++i)
results.prepend(configuration.stack().pop());
// drop all locals
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
Optional<Label> last_label;
#pragma GCC diagnostic pop
for (; !configuration.stack().is_empty();) {
auto entry = configuration.stack().pop();
if (entry.has<Label>()) {