LibJS: Collapse handler/finalizer into single exception handler target

After replacing the runtime unwind context stack with explicit
completion records for try/finally dispatch, the distinction between
"handler" (catch) and "finalizer" (finally) in the exception handler
table is no longer meaningful at runtime.

handle_exception() checked handler first, then finalizer, but they
did the exact same thing (set the PC). When both were present, the
finalizer was dead code.

Collapse both fields into a single handler_offset (now non-optional,
since an entry always has a target), remove the finalizer concept
from BasicBlock, UnwindContext, and ExceptionHandlers, and simplify
handle_exception() to a direct assignment.
This commit is contained in:
Andreas Kling 2026-02-09 12:08:49 +01:00 committed by Andreas Kling
parent 4fa4ecf31b
commit 720fd567b1
Notes: github-actions[bot] 2026-02-09 15:37:14 +00:00
7 changed files with 14 additions and 36 deletions

View file

@ -81,11 +81,10 @@ void Executable::dump() const
warnln("");
warnln("Exception handlers:");
for (auto& handlers : exception_handlers) {
warnln(" from {:4x} to {:4x} handler {:4x} finalizer {:4x}",
warnln(" from {:4x} to {:4x} handler {:4x}",
handlers.start_offset,
handlers.end_offset,
handlers.handler_offset.value_or(0),
handlers.finalizer_offset.value_or(0));
handlers.handler_offset);
}
}