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

@ -406,6 +406,12 @@ public:
// this statement.
ExprOptInfo* GetOptInfo() const { return opt_info; }
// Returns the number of expressions created since the last reset.
static int GetNumExprs() { return num_exprs; }
// Clears the number of expressions created.
static void ResetNumExprs() { num_exprs = 0; }
~Expr() override;
protected:
@ -441,6 +447,9 @@ protected:
// Information associated with the Expr for purposes of
// script optimization.
ExprOptInfo* opt_info;
// Number of expressions created thus far.
static int num_exprs;
};
class NameExpr final : public Expr