1- using Core . Compiler : AbstractInterpreter, CodeInstance, MethodInstance, WorldView, NativeInterpreter
1+ using . CC : AbstractInterpreter, CodeInstance, MethodInstance, WorldView, NativeInterpreter
22using InteractiveUtils
33
44function infer_function (interp, tt)
@@ -13,23 +13,23 @@ function infer_function(interp, tt)
1313 mtypes, msp, m = mthds[1 ]
1414
1515 # Grab the appropriate method instance for these types
16- mi = Core . Compiler . specialize_method (m, mtypes, msp)
16+ mi = CC . specialize_method (m, mtypes, msp)
1717
1818 # Construct InferenceResult to hold the result,
19- result = Core . Compiler . InferenceResult (mi)
19+ result = CC . InferenceResult (mi)
2020
2121 # Create an InferenceState to begin inference, give it a world that is always newest
22- frame = Core . Compiler . InferenceState (result, #= cached=# true , interp)
22+ frame = CC . InferenceState (result, #= cached=# true , interp)
2323
2424 # Run type inference on this frame. Because the interpreter is embedded
2525 # within this InferenceResult, we don't need to pass the interpreter in.
26- Core . Compiler . typeinf (interp, frame)
26+ CC . typeinf (interp, frame)
2727
2828 # Give the result back
2929 return (mi, result)
3030end
3131
32- struct ExtractingInterpreter <: Core.Compiler .AbstractInterpreter
32+ struct ExtractingInterpreter <: CC .AbstractInterpreter
3333 code:: Dict{MethodInstance, CodeInstance}
3434 native_interpreter:: NativeInterpreter
3535 msgs:: Vector{Tuple{MethodInstance, Int, String}}
@@ -43,7 +43,7 @@ ExtractingInterpreter(;optimize=false) = ExtractingInterpreter(
4343 optimize
4444)
4545
46- import Core . Compiler : InferenceParams, OptimizationParams, #= get_inference_world,=#
46+ import . CC : InferenceParams, OptimizationParams, #= get_inference_world,=#
4747 get_inference_cache, code_cache,
4848 WorldView, lock_mi_inference, unlock_mi_inference, InferenceState
4949InferenceParams (ei:: ExtractingInterpreter ) = InferenceParams (ei. native_interpreter)
@@ -56,18 +56,14 @@ lock_mi_inference(ei::ExtractingInterpreter, mi::MethodInstance) = nothing
5656unlock_mi_inference (ei:: ExtractingInterpreter , mi:: MethodInstance ) = nothing
5757
5858code_cache (ei:: ExtractingInterpreter ) = ei. code
59- Core. Compiler. get (a:: Dict , b, c) = Base. get (a,b,c)
60- Core. Compiler. get (a:: WorldView{<:Dict} , b, c) = Base. get (a. cache,b,c)
61- Core. Compiler. haskey (a:: Dict , b) = Base. haskey (a, b)
62- Core. Compiler. haskey (a:: WorldView{<:Dict} , b) =
63- Core. Compiler. haskey (a. cache, b)
64- Core. Compiler. setindex! (a:: Dict , b, c) = setindex! (a, b, c)
65- Core. Compiler. may_optimize (ei:: ExtractingInterpreter ) = ei. optimize
66- Core. Compiler. may_compress (ei:: ExtractingInterpreter ) = false
67- Core. Compiler. may_discard_trees (ei:: ExtractingInterpreter ) = false
68-
69- function Core. Compiler. add_remark! (ei:: ExtractingInterpreter , sv:: InferenceState , msg)
70- @show msg
59+ CC. get (a:: WorldView{<:Dict} , b, c) = Base. get (a. cache,b,c)
60+ CC. haskey (a:: WorldView{<:Dict} , b) =
61+ CC. haskey (a. cache, b)
62+ CC. may_optimize (ei:: ExtractingInterpreter ) = ei. optimize
63+ CC. may_compress (ei:: ExtractingInterpreter ) = false
64+ CC. may_discard_trees (ei:: ExtractingInterpreter ) = false
65+
66+ function CC. add_remark! (ei:: ExtractingInterpreter , sv:: InferenceState , msg)
7167 push! (ei. msgs, (sv. linfo, sv. currpc, msg))
7268end
7369
0 commit comments