more extensive ZAM inlining & compilation of lambdas

This commit is contained in:
Vern Paxson 2023-07-13 12:03:34 -07:00
parent b9949560c6
commit 1ff490b41c
10 changed files with 156 additions and 42 deletions

View file

@ -32,7 +32,10 @@ public:
ExprPtr CheckForInlining(CallExprPtr c);
// True if the given function has been inlined.
bool WasInlined(const Func* f) { return inline_ables.count(f) > 0; }
bool WasInlined(const Func* f)
{
return inline_ables.count(f) > 0 && skipped_inlining.count(f) == 0;
}
protected:
// Driver routine that analyzes all of the script functions and
@ -49,6 +52,10 @@ protected:
// Functions that we've determined to be suitable for inlining.
std::unordered_set<const Func*> inline_ables;
// Functions that we didn't fully inline, so require separate
// compilation.
std::unordered_set<const Func*> skipped_inlining;
// As we do inlining for a given function, this tracks the
// largest frame size of any inlined function.
int max_inlined_frame_size;