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

Refactor cache logic for easy replacement #35831

Merged
merged 4 commits into from
Jun 9, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Rename always_cache_tree -> !allow_discard_tree
  • Loading branch information
Keno committed Jun 8, 2020
commit 2df4e31e0d3587523210e92c65a510ffe6a40682
4 changes: 2 additions & 2 deletions base/compiler/typeinfer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ end


function CodeInstance(result::InferenceResult, min_valid::UInt, max_valid::UInt,
may_compress=true, always_cache_tree=false)
may_compress=true, allow_discard_tree=true)
inferred_result = result.src
local const_flags::Int32
if inferred_result isa Const
Expand All @@ -103,7 +103,7 @@ function CodeInstance(result::InferenceResult, min_valid::UInt, max_valid::UInt,
def = result.linfo.def
toplevel = !isa(def, Method)
if !toplevel
cache_the_tree = always_cache_tree || (result.src.inferred &&
cache_the_tree = !allow_discard_tree || (result.src.inferred &&
(result.src.inlineable ||
ccall(:jl_isa_compileable_sig, Int32, (Any, Any), result.linfo.specTypes, def) != 0))
if cache_the_tree
Expand Down