@@ -198,14 +198,14 @@ const silence_pkgs = Set{Symbol}()
198
198
const depsdir = joinpath (dirname (@__DIR__ ), " deps" )
199
199
const silencefile = Ref (joinpath (depsdir, " silence.txt" )) # Ref so that tests don't clobber
200
200
201
- # """
202
- # Revise.worldage
203
- #
204
- # The world age Revise was started in. Needed so that Revise doesn't delete methods
205
- # from under itself.
206
- # """
207
- # const worldage = Ref{Union{Nothing,UInt}}(nothing)
208
- using CodeTracking: worldage
201
+ """
202
+ Revise.worldage
203
+
204
+ The world age Revise was started in. Needed so that Revise doesn't delete methods
205
+ from under itself.
206
+ """
207
+ const worldage = Ref {Union{Nothing,UInt}} (nothing )
208
+ # using CodeTracking: worldage
209
209
210
210
# #
211
211
# # The inputs are sets of expressions found in each file.
@@ -639,6 +639,7 @@ function handle_deletions(pkgdata, file)
639
639
topmod = first (keys (mexsold))
640
640
fileok = file_exists (filep)
641
641
mexsnew = fileok ? parse_source (filep, topmod) : ModuleExprsSigs (topmod)
642
+ worldage[] = Base. get_world_counter ()
642
643
if mexsnew != = nothing
643
644
delete_missing! (mexsold, mexsnew)
644
645
end
@@ -732,6 +733,7 @@ function revise(; throw=false)
732
733
733
734
# Do all the deletion first. This ensures that a method that moved from one file to another
734
735
# won't get redefined first and deleted second.
736
+ @show worldage[] = Base. get_world_counter ()
735
737
revision_errors = []
736
738
queue = sort! (collect (revision_queue); lt= pkgfileless)
737
739
finished = eltype (revision_queue)[]
@@ -764,6 +766,7 @@ function revise(; throw=false)
764
766
mode ∈ (:sigs , :eval , :evalmeth , :evalassign ) || error (" unsupported mode " , mode)
765
767
exsold = get (fi. modexsigs, mod, empty_exs_sigs)
766
768
for rex in keys (exsnew)
769
+ @show Base. get_world_counter ()
767
770
sigs, includes = eval_rex (rex, exsold, mod; mode= mode)
768
771
if sigs != = nothing
769
772
exsnew[rex] = sigs
@@ -1191,13 +1194,17 @@ if VERSION < v"1.6.0-DEV.1162"
1191
1194
const lower_in_reviseworld = Meta. lower
1192
1195
else
1193
1196
function invoke_revisefunc (f, args... ; kwargs... )
1194
- @show worldage[]
1195
- Base. show_backtrace (backtrace[1 : 2 ])
1197
+ # @show worldage[]
1198
+ # @show Base.get_world_counter()
1199
+ # Base.show_backtrace(stdout, backtrace()[1:4])
1200
+ # println()
1196
1201
return Base. invoke_in_world (worldage[], f, args... ; kwargs... )
1197
1202
end
1198
1203
function lower_in_reviseworld (m:: Module , @nospecialize (ex))
1199
- @show worldage[]
1200
- Base. show_backtrace (backtrace[1 : 2 ])
1204
+ # @show worldage[]
1205
+ # @show Base.get_world_counter()
1206
+ # Base.show_backtrace(stdout, backtrace()[1:1])
1207
+ # println()
1201
1208
return ccall (:jl_expand_in_world , Any,
1202
1209
(Any, Ref{Module}, Cstring, Cint, Csize_t),
1203
1210
ex, m, " none" , 0 , worldage[],
@@ -1209,7 +1216,7 @@ end
1209
1216
# This uses invokelatest not for reasons of world age but to ensure that the call is made at runtime.
1210
1217
# This allows `revise_first` to be compiled without compiling `revise` itself, and greatly
1211
1218
# reduces the overhead of using Revise.
1212
- revise_first (ex) = Expr (:toplevel , :(isempty ($ revision_queue) || (worldage[] = Base. get_world_counter (); invoke_revisefunc ($ revise))), ex)
1219
+ revise_first (ex) = Expr (:toplevel , :(isempty ($ revision_queue) || (#= worldage[] = Base.get_world_counter(); =# invoke_revisefunc ($ revise))), ex)
1213
1220
1214
1221
@noinline function run_backend (backend)
1215
1222
while true
@@ -1362,6 +1369,8 @@ function __init__()
1362
1369
# Set the lookup callbacks
1363
1370
CodeTracking. method_lookup_callback[] = x -> (worldage[] = Base. get_world_counter (); invoke_revisefunc (get_def, x))
1364
1371
CodeTracking. expressions_callback[] = x -> (worldage[] = Base. get_world_counter (); invoke_revisefunc (get_expressions, x))
1372
+ CodeTracking. method_lookup_callback[] = get_def
1373
+ CodeTracking. expressions_callback[] = get_expressions
1365
1374
1366
1375
# Watch the manifest file for changes
1367
1376
mfile = manifest_file ()
0 commit comments