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
This changes the compiler to use closures and a Future object, instead
of call and return on the native call stack, to simulate a cactus-stack
and allow greater flexibility and visibility with deep inference.
Before, less than 900 frames in under a second:
$ time ./julia -e 'f(::Val{N}) where {N} = N <= 0 ? 0 : f(Val(N - 1)); Base.promote_op(f, Val{900})'
Warning: detected a stack overflow; program state may be corrupted, so further execution might be unreliable.
Now: unlimited, as long as you are willing to wait for it:
$ time ./julia -e 'f(::Val{N}) where {N} = N <= 0 ? 0 : f(Val(N - 1)); Base.promote_op(f, Val{50000})'
info: inference of f(Base.Val{50000}) from f(Base.Val{N}) where {N} exceeding 2500 frames (may be slow).
info: inference of f(Base.Val{50000}) from f(Base.Val{N}) where {N} exceeding 5000 frames (may be slow).
info: inference of f(Base.Val{50000}) from f(Base.Val{N}) where {N} exceeding 10000 frames (may be slow).
info: inference of f(Base.Val{50000}) from f(Base.Val{N}) where {N} exceeding 20000 frames (may be slow).
info: inference of f(Base.Val{50000}) from f(Base.Val{N}) where {N} exceeding 40000 frames (may be slow).
real 7m4.988s
tasks = sv.tasks # allow dropping gc root over the previous call
1197
+
completed isa Bool ||throw(TypeError(:return, "", Bool, task)) # print the task on failure as part of the error message, instead of just "@ workloop:line"
1198
+
completed ||push!(tasks, task)
1199
+
# efficient post-order visitor: items pushed are executed in reverse post order such
1200
+
# that later items are executed before earlier ones, but are fully executed
1201
+
# (including any dependencies scheduled by them) before going on to the next item
@assertisempty(irsv.tasks) #TODO: this whole function needs to be converted to a stackless design to be a valid AbsIntState, but this should work here for now
150
+
result =abstract_eval_statement_expr(interp, stmt, nothing, irsv)
0 commit comments