mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-12 18:08:15 +02:00
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:
committed by
Andreas Kling
parent
4fa4ecf31b
commit
720fd567b1
Notes:
github-actions[bot]
2026-02-09 15:37:14 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/720fd567b19 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/7846
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user