From 27a93aa02b746459a000a95efd002c869d28065c Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki Date: Fri, 30 Oct 2020 22:01:30 +0900 Subject: [PATCH] remove no-longer needed self profiling switches --- src/JET.jl | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/src/JET.jl b/src/JET.jl index b60dc940e..266dfc038 100644 --- a/src/JET.jl +++ b/src/JET.jl @@ -282,36 +282,6 @@ end # miscellaneous, interactive # ---------------------------- -const __self_profiling__ = Ref(false) - -switch_self_profiling(enable = true) = __self_profiling__[] = enable - -# when self-profiling, we need to invalidate caches for "our" code -@inline function force_invalidate_self_code_cache(mi::MethodInstance) - if __self_profiling__[] - def = mi.def - if isa(def, Method) - mod = def.module - - # ignore cache for code defined in JET - mod == (@__MODULE__) && return true - - # caches for overloaded code also need to be invalidated - mod == JuliaInterpreter && return true - - # ignoring entire cache for `Core.Compiler` slows down performance too bad, so - # let's do more fine-grained, per-file basis check - # XXX: needs more files to be added ? - file = def.file - file === Symbol("compiler/cicache.jl") && return true - file === Symbol("compiler/abstractinterpretation.jl") && return true - file === Symbol("compiler/typeinfer.jl") && return true - end - end - - return false -end - # profile from call expression macro profile_call(ex, kwargs...) @assert isexpr(ex, :call) "function call expression should be given"