@@ -391,7 +391,7 @@ julia> framecode, frameargs, lenv, argtypes = JuliaInterpreter.prepare_call(myme
391
391
julia> framecode
392
392
JuliaInterpreter.JuliaFrameCode(mymethod(x::Array{T,1}) where T in Main at none:1, CodeInfo(
393
393
1 ─ return 1
394
- ), Core. TypeMapEntry[#undef], BitSet([]), false, false, true)
394
+ ), Union{Compiled, TypeMapEntry}[#undef], JuliaInterpreter.BreakpointState [#undef], BitSet([]), false, false, true)
395
395
396
396
julia> frameargs
397
397
2-element Array{Any,1}:
@@ -916,9 +916,9 @@ mymethod (generic function with 1 method)
916
916
917
917
julia> JuliaInterpreter.enter_call_expr(:(\$ mymethod(1)))
918
918
JuliaStackFrame(JuliaInterpreter.JuliaFrameCode(mymethod(x) in Main at none:1, CodeInfo(
919
- 1 ─ %1 = (\ $ (QuoteNode(+)))(x, 1)
919
+ 1 ─ %1 = ($(QuoteNode (+ )) )(x, 1)
920
920
└── return %1
921
- ), Core. TypeMapEntry[#undef, #undef], BitSet([1]), false, false, true), Union{Nothing, Some{Any}}[Some(mymethod), Some(1)], Any[#undef, #undef], Any[], Int64[], Base.RefValue{Any}(nothing), Base.RefValue{JuliaInterpreter.JuliaProgramCounter}(JuliaProgramCounter(1)), Dict{ Symbol,Int64}( ), Any[])
921
+ ), Union{Compiled, TypeMapEntry} [#undef, #undef], JuliaInterpreter.BreakpointState[#undef, #undef], BitSet([1]), false, false, true), Union{Nothing, Some{Any}}[Some(mymethod), Some(1)], Any[#undef, #undef], Any[], Int64[], Base.RefValue{Any}(nothing), Base.RefValue{JuliaInterpreter.JuliaProgramCounter}(JuliaProgramCounter(1)), Dict( Symbol("#self#")=>1,:x=>2 ), Any[])
922
922
923
923
julia> mymethod(x::Vector{T}) where T = 1
924
924
mymethod (generic function with 2 methods)
@@ -931,7 +931,7 @@ julia> a = [1.0, 2.0]
931
931
julia> JuliaInterpreter.enter_call_expr(:(\$ mymethod(\$ a)))
932
932
JuliaStackFrame(JuliaInterpreter.JuliaFrameCode(mymethod(x::Array{T,1}) where T in Main at none:1, CodeInfo(
933
933
1 ─ return 1
934
- ), Core. TypeMapEntry[#undef], BitSet([]), false, false, true), Union{Nothing, Some{Any}}[Some(mymethod), Some([1.0, 2.0])], Any[#undef], Any[Float64], Int64[], Base.RefValue{Any}(nothing), Base.RefValue{JuliaInterpreter.JuliaProgramCounter}(JuliaProgramCounter(1)), Dict{ Symbol,Int64}( ), Any[])
934
+ ), Union{Compiled, TypeMapEntry} [#undef], JuliaInterpreter.BreakpointState[#undef], BitSet([]), false, false, true), Union{Nothing, Some{Any}}[Some(mymethod), Some([1.0, 2.0])], Any[#undef], Any[Float64], Int64[], Base.RefValue{Any}(nothing), Base.RefValue{JuliaInterpreter.JuliaProgramCounter}(JuliaProgramCounter(1)), Dict( Symbol("#self#")=>1,:x=>2 ), Any[])
935
935
```
936
936
937
937
See [`enter_call`](@ref) for a similar approach not based on expressions.
@@ -959,15 +959,15 @@ julia> JuliaInterpreter.enter_call(mymethod, 1)
959
959
JuliaStackFrame(JuliaInterpreter.JuliaFrameCode(mymethod(x) in Main at none:1, CodeInfo(
960
960
1 ─ %1 = ($(QuoteNode (+ )) )(x, 1)
961
961
└── return %1
962
- ), Core. TypeMapEntry[#undef, #undef], BitSet([1]), false, false, true), Union{Nothing, Some{Any}}[Some(mymethod), Some(1)], Any[#undef, #undef], Any[], Int64[], Base.RefValue{Any}(nothing), Base.RefValue{JuliaInterpreter.JuliaProgramCounter}(JuliaProgramCounter(1)), Dict{ Symbol,Int64}( ), Any[])
962
+ ), Union{Compiled, TypeMapEntry} [#undef, #undef], JuliaInterpreter.BreakpointState[#undef, #undef], BitSet([1]), false, false, true), Union{Nothing, Some{Any}}[Some(mymethod), Some(1)], Any[#undef, #undef], Any[], Int64[], Base.RefValue{Any}(nothing), Base.RefValue{JuliaInterpreter.JuliaProgramCounter}(JuliaProgramCounter(1)), Dict( Symbol("#self#")=>1,:x=>2 ), Any[])
963
963
964
964
julia> mymethod(x::Vector{T}) where T = 1
965
965
mymethod (generic function with 2 methods)
966
966
967
967
julia> JuliaInterpreter.enter_call(mymethod, [1.0, 2.0])
968
968
JuliaStackFrame(JuliaInterpreter.JuliaFrameCode(mymethod(x::Array{T,1}) where T in Main at none:1, CodeInfo(
969
969
1 ─ return 1
970
- ), Core. TypeMapEntry[#undef], BitSet([]), false, false, true), Union{Nothing, Some{Any}}[Some(mymethod), Some([1.0, 2.0])], Any[#undef], Any[Float64], Int64[], Base.RefValue{Any}(nothing), Base.RefValue{JuliaInterpreter.JuliaProgramCounter}(JuliaProgramCounter(1)), Dict{ Symbol,Int64}( ), Any[])
970
+ ), Union{Compiled, TypeMapEntry} [#undef], JuliaInterpreter.BreakpointState[#undef], BitSet([]), false, false, true), Union{Nothing, Some{Any}}[Some(mymethod), Some([1.0, 2.0])], Any[#undef], Any[Float64], Int64[], Base.RefValue{Any}(nothing), Base.RefValue{JuliaInterpreter.JuliaProgramCounter}(JuliaProgramCounter(1)), Dict( Symbol("#self#")=>1,:x=>2 ), Any[])
971
971
```
972
972
973
973
For a `@generated` function you can use `enter_call((f, true), args...; kwargs...)`
0 commit comments