Skip to content

Instantly share code, notes, and snippets.

@jrevels
Last active December 5, 2019 02:40
Show Gist options
  • Save jrevels/c29f748c9d18ad323b73399538c462d8 to your computer and use it in GitHub Desktop.
Save jrevels/c29f748c9d18ad323b73399538c462d8 to your computer and use it in GitHub Desktop.
# NOTE: Make sure to run this in a "fresh" session. If the method you're invoking
# has already been compiled, then the compiler might grab its old results instead
# of populating the cache we're constructing here.
mymethod = # callable value you want to check
mysig = Tuple{typeof(mymethod), #= types of arguments here =#}
p = Core.Compiler.Params(typemax(UInt))
Core.Compiler.typeinf_code(methods(mymethod).ms[end], mysig, Core.svec(), false, p)
Core.show(map(((i, x),) -> (i, x.result, x.linfo), enumerate(p.cache)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment