Skip to content

Commit 25fcd56

Browse files
committed
Handle :latestworld expr
These were added in JuliaLang/julia#56523. This simply adds tracking for the world age to the interpreter, but does not use it for anything. JuliaInterpreter's current model of world age does not match Base anyway. We should fix that eventually, but it's probably easier to do that once JuliaLang/julia#56509 and binding partitions are merged.
1 parent 5de78c7 commit 25fcd56

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/interpret.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,8 @@ function step_expr!(@nospecialize(recurse), frame::Frame, @nospecialize(node), i
550550
error("unexpected error statement ", node)
551551
elseif node.head === :incomplete
552552
error("incomplete statement ", node)
553+
elseif node.head === :latestworld
554+
frame.world = Base.get_world_counter()
553555
else
554556
rhs = eval_rhs(recurse, frame, node)
555557
end

src/types.jl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,10 @@ mutable struct Frame
253253
caller::Union{Frame,Nothing}
254254
callee::Union{Frame,Nothing}
255255
last_codeloc::Int
256+
# TODO: This is incompletely implemented
257+
world::UInt
256258
end
257-
function Frame(framecode::FrameCode, framedata::FrameData, pc=1, caller=nothing)
259+
function Frame(framecode::FrameCode, framedata::FrameData, pc=1, caller=nothing, world=Base.tls_world_age())
258260
if length(junk_frames) > 0
259261
frame = pop!(junk_frames)
260262
frame.framecode = framecode
@@ -264,9 +266,10 @@ function Frame(framecode::FrameCode, framedata::FrameData, pc=1, caller=nothing)
264266
frame.caller = caller
265267
frame.callee = nothing
266268
frame.last_codeloc = 0
269+
frame.world = world
267270
return frame
268271
else
269-
return Frame(framecode, framedata, pc, 1, caller, nothing, 0)
272+
return Frame(framecode, framedata, pc, 1, caller, nothing, 0, world)
270273
end
271274
end
272275
"""

0 commit comments

Comments
 (0)