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);