mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-19 22:25:36 +00:00
LibJS/JIT: Update "unwind context" stack in JIT code
Until now, the unwind context stack has not been maintained by jitted code, which meant we were unable to support the `with` statement. This is a first step towards supporting that by making jitted code call out to C++ to update the unwind context stack when entering/leaving unwind contexts. We also introduce a new "Catch" bytecode instruction that moves the current exception into the accumulator. It's always emitted at the start of a "catch" block.
This commit is contained in:
@@ -2337,6 +2337,8 @@ Bytecode::CodeGenerationErrorOr<void> TryStatement::generate_bytecode(Bytecode::
|
||||
auto& handler_block = generator.make_block();
|
||||
generator.switch_to_basic_block(handler_block);
|
||||
|
||||
generator.emit<Bytecode::Op::Catch>();
|
||||
|
||||
if (!m_finalizer)
|
||||
generator.emit<Bytecode::Op::LeaveUnwindContext>();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user