@@ -257,7 +257,7 @@ function prepare_call(@nospecialize(f), allargs; enter_generated = false)
257
257
return framecode, args, lenv, argtypes
258
258
end
259
259
260
- function prepare_framedata (framecode, argvals:: Vector{Any} , caller_will_catch_err:: Bool = false )
260
+ function prepare_framedata (framecode, argvals:: Vector{Any} , lenv :: SimpleVector = empty_svec, caller_will_catch_err:: Bool = false )
261
261
if isa (framecode. scope, Method)
262
262
meth, src = framecode. scope:: Method , framecode. src
263
263
slotnames = src. slotnames:: SlotNamesType
@@ -309,6 +309,13 @@ function prepare_framedata(framecode, argvals::Vector{Any}, caller_will_catch_er
309
309
callargs = Any[]
310
310
last_exception = Ref {Any} (nothing )
311
311
end
312
+ resize! (sparams, length (lenv))
313
+ # Add static parameters to environment
314
+ for i = 1 : length (lenv)
315
+ T = lenv[i]
316
+ isa (T, TypeVar) && continue # only fill concrete types
317
+ sparams[i] = T
318
+ end
312
319
FrameData (locals, ssavalues, sparams, exception_frames, last_exception, caller_will_catch_err, last_reference, callargs)
313
320
end
314
321
@@ -319,14 +326,7 @@ Construct a new `Frame` for `framecode`, given lowered-code arguments `frameargs
319
326
static parameters `lenv`. See [`JuliaInterpreter.prepare_call`](@ref) for information about how to prepare the inputs.
320
327
"""
321
328
function prepare_frame (framecode:: FrameCode , args:: Vector{Any} , lenv:: SimpleVector , caller_will_catch_err:: Bool = false )
322
- framedata = prepare_framedata (framecode, args, caller_will_catch_err)
323
- resize! (framedata. sparams, length (lenv))
324
- # Add static parameters to environment
325
- for i = 1 : length (lenv)
326
- T = lenv[i]
327
- isa (T, TypeVar) && continue # only fill concrete types
328
- framedata. sparams[i] = T
329
- end
329
+ framedata = prepare_framedata (framecode, args, lenv, caller_will_catch_err)
330
330
return Frame (framecode, framedata)
331
331
end
332
332
0 commit comments