Description
It would be very neat if the interpreter could figure out when compiled mode won't degrade the debugging experience. Unless I am mistaken, we can figure out all methods that must be interpreted by following backedges from all locations where a breakpoint could occur (e.g. our list of breakpoints and all throw()
instances, if break_on(:error)
is set) and marking all those methods as "must interpret". Any other method, if not stepped into should automatically be switched to compiled mode.
This kind of backedge calculation should be exactly the same as what is used by #265
to trigger recompilation. There may be additional complexity around code within the compiler that can call jl_throw()
from C code (e.g. allocation failure) which we will miss within the interpreter like this, but I don't know if that is caught within the interpreter as of today anyway.