mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
coalescing of event handlers (ZAM optimization)
This commit is contained in:
parent
a488dcffb6
commit
3d21d80dac
6 changed files with 267 additions and 46 deletions
|
@ -473,17 +473,15 @@ static void analyze_scripts_for_ZAM(std::unique_ptr<ProfileFuncs>& pfs) {
|
|||
bool did_one = false;
|
||||
|
||||
for ( auto& f : funcs ) {
|
||||
if ( ! f.ShouldAnalyze() )
|
||||
continue;
|
||||
|
||||
auto func = f.Func();
|
||||
auto l = lambdas.find(func);
|
||||
bool is_lambda = l != lambdas.end();
|
||||
|
||||
if ( ! analysis_options.only_funcs.empty() || ! analysis_options.only_files.empty() ) {
|
||||
if ( ! should_analyze(f.FuncPtr(), f.Body()) )
|
||||
continue;
|
||||
}
|
||||
|
||||
else if ( ! analysis_options.compile_all && ! is_lambda && inl && inl->WasFullyInlined(func) &&
|
||||
func_used_indirectly.count(func) == 0 ) {
|
||||
if ( ! analysis_options.compile_all && ! is_lambda && inl && inl->WasFullyInlined(func) &&
|
||||
func_used_indirectly.count(func) == 0 ) {
|
||||
// No need to compile as it won't be called directly.
|
||||
// We'd like to zero out the body to recover the
|
||||
// memory, but a *few* such functions do get called,
|
||||
|
@ -563,7 +561,7 @@ void analyze_scripts(bool no_unused_warnings) {
|
|||
if ( should_analyze(func.FuncPtr(), func.Body()) )
|
||||
have_one_to_do = true;
|
||||
else
|
||||
func.SetSkip(true);
|
||||
func.SetShouldNotAnalyze();
|
||||
|
||||
if ( ! have_one_to_do )
|
||||
reporter->FatalError("no matching functions/files for C++ compilation");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue