Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add mechanism for spoofing inference work-limiting heuristics #24852

Merged
merged 9 commits into from
Jan 12, 2018
Prev Previous commit
Next Next commit
fix method signature to respect caller's choice, even if it's not a m…
…ethod
  • Loading branch information
jrevels committed Jan 11, 2018
commit 8f1b6813b0fcfb428acb55fe550a750a46dce93b
4 changes: 2 additions & 2 deletions base/inference.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2089,7 +2089,7 @@ end

const deprecated_sym = Symbol("deprecated.jl")

function method_for_inference_heuristics(cinfo, default::Method)::Method
function method_for_inference_heuristics(cinfo, default)
if isa(cinfo, CodeInfo)
# appropriate format for `sig` is svec(ftype, argtypes, world)
sig = cinfo.signature_for_inference_heuristics
Expand All @@ -2106,7 +2106,7 @@ function method_for_inference_heuristics(cinfo, default::Method)::Method
return default
end

function method_for_inference_heuristics(method::Method, @nospecialize(sig), sparams, world)::Method
function method_for_inference_heuristics(method::Method, @nospecialize(sig), sparams, world)
if isdefined(method, :generator) && method.generator.expand_early
method_instance = code_for_method(method, sig, sparams, world, false)
if isa(method_instance, MethodInstance)
Expand Down