Skip to content

Commit

Permalink
more adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
aviatesk committed Mar 3, 2024
1 parent 073aba9 commit 8808336
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Manifest.toml
Manifest-*.toml
*.jl.cov
*.jl.*.cov
*.jl.mem
Expand Down
20 changes: 19 additions & 1 deletion src/interpreter.jl
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,25 @@ function CC.transform_result_for_cache(interp::CthulhuInterpreter,
end
end

@static if VERSION v"1.11.0-DEV.879"
@static if VERSION v"1.12.0-DEV.45"
function CC.src_inlining_policy(interp::CthulhuInterpreter,
@nospecialize(src), @nospecialize(info::CCCallInfo), stmt_flag::UInt32)
if isa(src, OptimizedSource)
if CC.is_stmt_inline(stmt_flag) || src.isinlineable
return true
end
return false
else
@assert src isa CC.IRCode || src === nothing "invalid Cthulhu code cache"
# the default inlining policy may try additional effor to find the source in a local cache
return @invoke CC.src_inlining_policy(interp::AbstractInterpreter,
src::Any, info::CCCallInfo, stmt_flag::UInt32)
end
end
CC.retrieve_ir_for_inlining(cached_result::CodeInstance, src::OptimizedSource) = CC.copy(src.ir)
CC.retrieve_ir_for_inlining(mi::Core.MethodInstance, src::OptimizedSource, preserve_local_sources::Bool) =
CC.retrieve_ir_for_inlining(mi, src.ir, preserve_local_sources)
elseif VERSION v"1.11.0-DEV.879"
function CC.inlining_policy(interp::CthulhuInterpreter,
@nospecialize(src), @nospecialize(info::CCCallInfo), stmt_flag::UInt32)
if isa(src, OptimizedSource)
Expand Down

0 comments on commit 8808336

Please sign in to comment.