From 62f891dcba19b07635cab6dbfcf732e54917688b Mon Sep 17 00:00:00 2001 From: Vern Paxson Date: Fri, 6 Dec 2024 16:17:44 -0800 Subject: [PATCH] modified AST profiling to mark (and fully skip) non-optimizable functions --- src/script_opt/ProfileFunc.cc | 2 ++ src/script_opt/ScriptOpt.cc | 3 +++ 2 files changed, 5 insertions(+) diff --git a/src/script_opt/ProfileFunc.cc b/src/script_opt/ProfileFunc.cc index 25d6a5e01d..07ee05675c 100644 --- a/src/script_opt/ProfileFunc.cc +++ b/src/script_opt/ProfileFunc.cc @@ -578,6 +578,8 @@ ProfileFuncs::ProfileFuncs(std::vector& funcs, is_compilable_pred pred if ( ! pred || (*pred)(pf.get(), nullptr) ) MergeInProfile(pf.get()); + else if ( pred ) + f.SetSkip(true); // Track the profile even if we're not compiling the function, since // the AST optimizer will still need it to reason about function-call diff --git a/src/script_opt/ScriptOpt.cc b/src/script_opt/ScriptOpt.cc index 47effda307..ce697ef890 100644 --- a/src/script_opt/ScriptOpt.cc +++ b/src/script_opt/ScriptOpt.cc @@ -397,6 +397,9 @@ static void use_CPP() { auto pfs = std::make_unique(funcs, is_CPP_compilable, true, false); for ( auto& f : funcs ) { + if ( f.ShouldSkip() ) + continue; + auto hash = f.Profile()->HashVal(); auto s = compiled_scripts.find(hash);