speed up ZAM compilation by capping function size when inlining

This commit is contained in:
Vern Paxson 2022-05-14 14:52:31 -07:00
parent 0c2f04548a
commit 7d00ce0082
13 changed files with 79 additions and 14 deletions

View file

@ -27,8 +27,8 @@ public:
Analyze();
}
// Either returns the original CallExpr if it's not inline-able,
// or an InlineExpr if it is.
// Either returns the original CallExpr if it's not inline-able;
// or an InlineExpr if it is; or nil if further inlining should stop.
ExprPtr CheckForInlining(CallExprPtr c);
// True if the given function has been inlined.
@ -57,6 +57,12 @@ protected:
// prior to increasing it to accommodate inlining.
int curr_frame_size;
// The number of statements and expressions in the function being
// inlined. Dynamically updated as the inlining proceeds. Used
// to cap inlining complexity.
int num_stmts;
int num_exprs;
// Whether to generate a report about functions either directly and
// indirectly recursive.
bool report_recursive;