@@ -204,7 +204,11 @@ function (callback::CodeCacheCallback)(replaced::MethodInstance, max_world::UInt
204
204
for ci in cis
205
205
if ci. max_world == ~ 0 % Csize_t
206
206
@assert ci. min_world - 1 <= max_world " attempting to set illogical constraints"
207
+ @static if VERSION >= v " 1.11.0-DEV.1390"
208
+ @atomic ci. max_world = max_world
209
+ else
207
210
ci. max_world = max_world
211
+ end
208
212
end
209
213
@assert ci. max_world <= max_world
210
214
end
@@ -268,6 +272,13 @@ Base.Experimental.@MethodTable(GLOBAL_METHOD_TABLE)
268
272
269
273
# # interpreter
270
274
275
+ @static if VERSION ≥ v " 1.11.0-DEV.1498"
276
+ import Core. Compiler: get_inference_world
277
+ using Base: get_world_counter
278
+ else
279
+ import Core. Compiler: get_world_counter, get_world_counter as get_inference_world
280
+ end
281
+
271
282
using Core. Compiler: OverlayMethodTable
272
283
const MTType = Core. MethodTable
273
284
if isdefined (Core. Compiler, :CachedMethodTable )
320
331
321
332
CC. InferenceParams (interp:: GPUInterpreter ) = interp. inf_params
322
333
CC. OptimizationParams (interp:: GPUInterpreter ) = interp. opt_params
323
- CC. get_world_counter (interp:: GPUInterpreter ) = interp. world
334
+ #= CC.=# get_inference_world (interp:: GPUInterpreter ) = interp. world
324
335
CC. get_inference_cache (interp:: GPUInterpreter ) = interp. inf_cache
325
336
CC. code_cache (interp:: GPUInterpreter ) = WorldView (interp. code_cache, interp. world)
326
337
471
482
# HACK: in older versions of Julia, `jl_create_native` doesn't take a world argument
472
483
# but instead always generates code for the current world. note that this doesn't
473
484
# actually change the world age, but just spoofs the counter `jl_create_native` reads.
485
+ # XXX : Base.get_world_counter is supposed to be monotonically increasing and is runtime global.
474
486
macro in_world (world, ex)
475
487
quote
476
488
actual_world = Base. get_world_counter ()
0 commit comments