From 6e0ce17c22f7a373d6e238da3e58e839d7297a50 Mon Sep 17 00:00:00 2001 From: Vern Paxson Date: Fri, 8 Dec 2023 15:06:22 -0500 Subject: [PATCH] revert problems with profiling attributes introduced by recent script-opt PR --- src/script_opt/ProfileFunc.cc | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/src/script_opt/ProfileFunc.cc b/src/script_opt/ProfileFunc.cc index fc5abc6cbd..9d13e94812 100644 --- a/src/script_opt/ProfileFunc.cc +++ b/src/script_opt/ProfileFunc.cc @@ -911,8 +911,11 @@ p_hash_type ProfileFuncs::HashType(const Type* t) { // We don't hash the field name, as in some contexts // those are ignored. - if ( f->attrs && do_hash ) - h = merge_p_hashes(h, HashAttrs(f->attrs)); + if ( f->attrs ) { + if ( do_hash ) + h = merge_p_hashes(h, HashAttrs(f->attrs)); + AnalyzeAttrs(f->attrs.get(), ft); + } } } break; @@ -929,24 +932,8 @@ p_hash_type ProfileFuncs::HashType(const Type* t) { auto ft = t->AsFuncType(); auto flv = ft->FlavorString(); h = merge_p_hashes(h, p_hash(flv)); - - // We deal with the parameters individually, rather than just - // recursing into the RecordType that's used (for convenience) - // to represent them. We do so because their properties are - // somewhat different - in particular, an &default on a parameter - // field is resolved in the context of the caller, not the - // function itself, and so we don't want to track those as - // attributes associated with the function body's execution. h = merge_p_hashes(h, p_hash("params")); - auto params = ft->Params()->Types(); - - if ( params ) { - h = merge_p_hashes(h, p_hash(params->length())); - - for ( auto p : *params ) - h = merge_p_hashes(h, HashType(p->type)); - } - + h = merge_p_hashes(h, HashType(ft->Params())); h = merge_p_hashes(h, p_hash("func-yield")); h = merge_p_hashes(h, HashType(ft->Yield())); } break;