You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Runtime
-------
* An exception stack type, `jl_exc_stack_t` and associated manipulation functions
has been added. Conceptually this stores a stack of (exception,backtrace)
pairs. It's stored in a contiguous buffer so we can avoid reallocating when
throwing and catching the same exception or set of exceptions repeatedly. Space
for the exception and backtrace is allocated on demand inside `throw_internal`,
after changing GC mode. Several variations were tried for allocating this
sgorage, including allocating up front with malloc on the thread local state
and copying during task switching. Keeping everything on the task seemed the
simplest as it involves the least copying and keeps track of the exception
stack buffers in a unified way.
* The exception in transit is no longer a single pointer in the thread local
storage. It's stored in `ptls->current_task->exc_stack` instead, along with
associated backtrace.
* `jl_current_exception()` is now the method to retreive the current exception
from within a `JL_CATCH` dynamic context.
* Several places where manual restoration of the exception and backtrace was
done are no longer necessary because the stack system handles these
automatically. This code is removed, including
`jl_apply_with_saved_exception_state`.
* `jl_eh_restore_state` has become non-inline. It seemed good to get this out
of the public header.
* `jl_sig_throw` is now used with `jl_throw_in_ctx` from signal handlers, to
make the special circumstances clear and to avoid conflation with rethrow
which now simply rethrows the existing exception stack.
* Make rethrow outside a catch block into an error.
* Use `ptls->previous_exception` to support `jl_exception_occurred` in
embedding API.
* finally lowering no longer includes a `foreigncall`, so expressions
using finally can now be interpreted.
Interpreter / Codegen
---------------------
Mostly small changes here, to track the `:enter` and `:pop_exc` association
with the SSAValue token. The token SSAValue slot is ideal here for storing the
state of the exception stack at the `:enter`.
GC
--
Integrate exception and raw backtrace scanning as a special case into GC mark
loop. This is necessary now that Task objects can refer to exception and
backtrace data in raw form.
0 commit comments