|
80 | 80 |
|
81 | 81 | va_process_argtypes(𝕃::AbstractLattice, given_argtypes::Vector{Any}, mi::MethodInstance) =
|
82 | 82 | va_process_argtypes(Returns(nothing), 𝕃, given_argtypes, mi)
|
83 |
| -function va_process_argtypes(@nospecialize(va_handler!), 𝕃::AbstractLattice, given_argtypes::Vector{Any}, mi::MethodInstance) |
| 83 | +function va_process_argtypes(@specialize(va_handler!), 𝕃::AbstractLattice, given_argtypes::Vector{Any}, mi::MethodInstance) |
84 | 84 | def = mi.def
|
85 | 85 | isva = isa(def, Method) ? def.isva : false
|
86 | 86 | nargs = isa(def, Method) ? Int(def.nargs) : length(mi.specTypes.parameters)
|
@@ -203,31 +203,29 @@ function elim_free_typevars(@nospecialize t)
|
203 | 203 | end
|
204 | 204 | end
|
205 | 205 |
|
206 |
| -function cache_lookup(lattice::AbstractLattice, linfo::MethodInstance, given_argtypes::Vector{Any}, cache::Vector{InferenceResult}) |
| 206 | +function cache_lookup(𝕃::AbstractLattice, linfo::MethodInstance, given_argtypes::Vector{Any}, cache::Vector{InferenceResult}) |
207 | 207 | method = linfo.def::Method
|
208 |
| - nargs::Int = method.nargs |
| 208 | + nargs = Int(method.nargs) |
209 | 209 | method.isva && (nargs -= 1)
|
210 |
| - length(given_argtypes) >= nargs || return nothing |
| 210 | + length(given_argtypes) ≥ nargs || return nothing |
211 | 211 | for cached_result in cache
|
212 | 212 | cached_result.linfo === linfo || continue
|
213 |
| - cache_match = true |
214 | 213 | cache_argtypes = cached_result.argtypes
|
215 | 214 | cache_overridden_by_const = cached_result.overridden_by_const
|
216 | 215 | for i in 1:nargs
|
217 |
| - if !is_argtype_match(lattice, widenmustalias(given_argtypes[i]), |
218 |
| - cache_argtypes[i], |
219 |
| - cache_overridden_by_const[i]) |
220 |
| - cache_match = false |
221 |
| - break |
| 216 | + if !is_argtype_match(𝕃, widenmustalias(given_argtypes[i]), |
| 217 | + cache_argtypes[i], cache_overridden_by_const[i]) |
| 218 | + @goto next_cache |
222 | 219 | end
|
223 | 220 | end
|
224 |
| - if method.isva && cache_match |
225 |
| - cache_match = is_argtype_match(lattice, tuple_tfunc(lattice, given_argtypes[(nargs + 1):end]), |
226 |
| - cache_argtypes[end], |
227 |
| - cache_overridden_by_const[end]) |
| 221 | + if method.isva |
| 222 | + if !is_argtype_match(𝕃, tuple_tfunc(𝕃, given_argtypes[(nargs + 1):end]), |
| 223 | + cache_argtypes[end], cache_overridden_by_const[end]) |
| 224 | + @goto next_cache |
| 225 | + end |
228 | 226 | end
|
229 |
| - cache_match || continue |
230 | 227 | return cached_result
|
| 228 | + @label next_cache |
231 | 229 | end
|
232 | 230 | return nothing
|
233 | 231 | end
|
0 commit comments