fixes for a number of ZAM optimization bugs

This commit is contained in:
Vern Paxson 2023-11-05 16:26:38 -08:00 committed by Arne Welzel
parent 9bfe18473d
commit 1dc74eaa9c
11 changed files with 44 additions and 28 deletions

View file

@ -171,9 +171,16 @@ extern bool is_lambda(const ScriptFunc* f);
extern bool is_when_lambda(const ScriptFunc* f);
// Analyze the given top-level statement(s) for optimization. Returns
// a pointer to a FuncInfo for an argument-less quasi-function that can
// be Invoked, or its body executed directly, to execute the statements.
extern const FuncInfo* analyze_global_stmts(Stmt* stmts);
// an opaque value that can be provided to get_global_stmts() to retrieve
// the corresponding FuncInfo, which reflects an argument-less quasi-function
// that can be Invoked, or its body executed directly, to execute the
// statements. This indirection is used in case in between the call to
// analyze_global_stmts() and using the value subsequently, the FuncInfo may
// have been updated or shifted. a pointer to a FuncInfo for an argument-less
// quasi-function that can be Invoked, or its body executed directly, to
// execute the statements.
extern size_t analyze_global_stmts(Stmt* stmts);
extern const FuncInfo& get_global_stmts(size_t handle);
// Add a pattern to the "only_funcs" list.
extern void add_func_analysis_pattern(AnalyOpt& opts, const char* pat);