mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
modified AST profiling to mark (and fully skip) non-optimizable functions
This commit is contained in:
parent
7ed3f79c87
commit
62f891dcba
2 changed files with 5 additions and 0 deletions
|
@ -578,6 +578,8 @@ ProfileFuncs::ProfileFuncs(std::vector<FuncInfo>& funcs, is_compilable_pred pred
|
||||||
|
|
||||||
if ( ! pred || (*pred)(pf.get(), nullptr) )
|
if ( ! pred || (*pred)(pf.get(), nullptr) )
|
||||||
MergeInProfile(pf.get());
|
MergeInProfile(pf.get());
|
||||||
|
else if ( pred )
|
||||||
|
f.SetSkip(true);
|
||||||
|
|
||||||
// Track the profile even if we're not compiling the function, since
|
// Track the profile even if we're not compiling the function, since
|
||||||
// the AST optimizer will still need it to reason about function-call
|
// the AST optimizer will still need it to reason about function-call
|
||||||
|
|
|
@ -397,6 +397,9 @@ static void use_CPP() {
|
||||||
auto pfs = std::make_unique<ProfileFuncs>(funcs, is_CPP_compilable, true, false);
|
auto pfs = std::make_unique<ProfileFuncs>(funcs, is_CPP_compilable, true, false);
|
||||||
|
|
||||||
for ( auto& f : funcs ) {
|
for ( auto& f : funcs ) {
|
||||||
|
if ( f.ShouldSkip() )
|
||||||
|
continue;
|
||||||
|
|
||||||
auto hash = f.Profile()->HashVal();
|
auto hash = f.Profile()->HashVal();
|
||||||
auto s = compiled_scripts.find(hash);
|
auto s = compiled_scripts.find(hash);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue