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
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.
The text was updated successfully, but these errors were encountered:
AFAIU, backedges are there to make sure optimizations are still valid on method redefinitions, so type inference and inlining. But in purely dynamic cases, where we do no optimizations there are no backedges. But even in those cases we want to intercept breakpoints. For example:
function has_a_bp()
@bp
return 5
end
const S = Any[has_a_bp]
function maybe_bp()
rand() < 0.001 && S[1]()
end
I don't see how we could ever figure out that maybe_bp could have a breakpoint.
Ah, of course, you're right. My idea only works for static subchunks where you can infer the callgraph completely. I've spent too much time working in TPU-land where that's a given. :P
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, ifbreak_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 calljl_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.The text was updated successfully, but these errors were encountered: