@@ -56,10 +56,17 @@ function breakpointchar(bps::BreakpointState)
56
56
return bps. condition === falsecondition ? ' ' : ' d' # no breakpoint : disabled
57
57
end
58
58
59
- abstract type AbstractFrameInstance end
60
- mutable struct DispatchableMethod
61
- next:: Union{Nothing,DispatchableMethod} # linked-list representation
62
- frameinstance:: Union{Compiled, AbstractFrameInstance} # really a Union{Compiled, FrameInstance} but we have a cyclic dependency
59
+ struct _FrameInstance{FrameCode}
60
+ framecode:: FrameCode
61
+ sparam_vals:: SimpleVector
62
+ enter_generated:: Bool
63
+ end
64
+ Base. show (io:: IO , instance:: _FrameInstance ) =
65
+ print (io, " FrameInstance(" , scopeof (instance. framecode), " , " , instance. sparam_vals, " , " , instance. enter_generated, ' )' )
66
+
67
+ mutable struct _DispatchableMethod{FrameCode}
68
+ next:: Union{Nothing,_DispatchableMethod{FrameCode}} # linked-list representation
69
+ frameinstance:: Union{Compiled,_FrameInstance{FrameCode}} # really a Union{Compiled, FrameInstance} but we have a cyclic dependency
63
70
sig:: Type # for speed of matching, this is a *concrete* signature. `sig <: frameinstance.framecode.scope.sig`
64
71
end
65
72
@@ -91,7 +98,7 @@ Important fields:
91
98
struct FrameCode
92
99
scope:: Union{Method,Module}
93
100
src:: CodeInfo
94
- methodtables:: Vector{Union{Compiled,DispatchableMethod }} # line-by-line method tables for generic-function :call Exprs
101
+ methodtables:: Vector{Union{Compiled,_DispatchableMethod{FrameCode} }} # line-by-line method tables for generic-function :call Exprs
95
102
breakpoints:: Vector{BreakpointState}
96
103
slotnamelists:: Dict{Symbol,Vector{Int}}
97
104
used:: BitSet
@@ -100,6 +107,16 @@ struct FrameCode
100
107
unique_files:: Set{Symbol}
101
108
end
102
109
110
+ """
111
+ `FrameInstance` represents a method specialized for particular argument types.
112
+
113
+ Fields:
114
+ - `framecode`: the [`FrameCode`](@ref) for the method.
115
+ - `sparam_vals`: the static parameter values for the method.
116
+ """
117
+ const FrameInstance = _FrameInstance{FrameCode}
118
+ const DispatchableMethod = _DispatchableMethod{FrameCode}
119
+
103
120
const BREAKPOINT_EXPR = :($ (QuoteNode (getproperty))($ JuliaInterpreter, :__BREAKPOINT_MARKER__ ))
104
121
function is_breakpoint_expr (ex:: Expr )
105
122
# Sadly, comparing QuoteNodes calls isequal(::Any, ::Any), and === seems not to work.
@@ -166,22 +183,6 @@ nstatements(framecode::FrameCode) = length(framecode.src.code)
166
183
167
184
Base. show (io:: IO , framecode:: FrameCode ) = print_framecode (io, framecode)
168
185
169
- """
170
- `FrameInstance` represents a method specialized for particular argument types.
171
-
172
- Fields:
173
- - `framecode`: the [`FrameCode`](@ref) for the method.
174
- - `sparam_vals`: the static parameter values for the method.
175
- """
176
- struct FrameInstance <: AbstractFrameInstance
177
- framecode:: FrameCode
178
- sparam_vals:: SimpleVector
179
- enter_generated:: Bool
180
- end
181
-
182
- Base. show (io:: IO , instance:: FrameInstance ) =
183
- print (io, " FrameInstance(" , scopeof (instance. framecode), " , " , instance. sparam_vals, " , " , instance. enter_generated, ' )' )
184
-
185
186
"""
186
187
`FrameData` holds the arguments, local variables, and intermediate execution state
187
188
in a particular call frame.
0 commit comments