@@ -11,7 +11,7 @@ using UUIDs
11
11
using Random. DSFMT
12
12
using InteractiveUtils
13
13
14
- export @enter , @make_stack , @ interpret , Compiled, JuliaStackFrame,
14
+ export @interpret , Compiled, JuliaStackFrame,
15
15
Breakpoints, breakpoint, @breakpoint , breakpoints, enable, disable, remove
16
16
17
17
module CompiledCalls
@@ -995,28 +995,6 @@ function enter_call(@nospecialize(finfo), @nospecialize(args...); kwargs...)
995
995
return nothing
996
996
end
997
997
998
- function maybe_step_through_wrapper! (stack)
999
- length (stack[1 ]. code. code. code) < 2 && return stack
1000
- last = stack[1 ]. code. code. code[end - 1 ]
1001
- isexpr (last, :(= )) && (last = last. args[2 ])
1002
- stack1 = stack[1 ]
1003
- is_kw = stack1. code. scope isa Method && startswith (String (Base. unwrap_unionall (Base. unwrap_unionall (stack1. code. scope. sig). parameters[1 ]). name. name), " #kw" )
1004
- if is_kw || isexpr (last, :call ) && any (x-> x== SlotNumber (1 ), last. args)
1005
- # If the last expr calls #self# or passes it to an implementation method,
1006
- # this is a wrapper function that we might want to step through
1007
- frame = stack1
1008
- pc = frame. pc[]
1009
- while pc != JuliaProgramCounter (length (frame. code. code. code)- 1 )
1010
- pc = next_call! (Compiled (), frame, pc)
1011
- end
1012
- stack[1 ] = JuliaStackFrame (JuliaFrameCode (frame. code; wrapper= true ), frame, pc)
1013
- newcall = Expr (:call , map (x-> @lookup (frame, x), last. args)... )
1014
- pushfirst! (stack, enter_call_expr (newcall))
1015
- return maybe_step_through_wrapper! (stack)
1016
- end
1017
- stack
1018
- end
1019
-
1020
998
lower (mod, arg) = false ? expand (arg) : Meta. lower (mod, arg)
1021
999
1022
1000
# This is a version of gen_call_with_extracted_types, except that is passes back the call expression
@@ -1069,25 +1047,6 @@ function extract_args(__module__, ex0)
1069
1047
* " break it down to simpler parts if possible" )
1070
1048
end
1071
1049
1072
- function _make_stack (mod, arg)
1073
- args = try
1074
- extract_args (mod, arg)
1075
- catch e
1076
- return :(throw ($ e))
1077
- end
1078
- quote
1079
- theargs = $ (esc (args))
1080
- stack = [JuliaInterpreter. enter_call_expr (Expr (:call ,theargs... ))]
1081
- JuliaInterpreter. maybe_step_through_wrapper! (stack)
1082
- stack[1 ] = JuliaInterpreter. JuliaStackFrame (stack[1 ], JuliaInterpreter. maybe_next_call! (Compiled (), stack[1 ]))
1083
- stack
1084
- end
1085
- end
1086
-
1087
- macro make_stack (arg)
1088
- _make_stack (__module__, arg)
1089
- end
1090
-
1091
1050
"""
1092
1051
@interpret f(args; kwargs...)
1093
1052
0 commit comments