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

@ -4825,10 +4825,19 @@ ScopePtr LambdaExpr::GetScope() const
return ingredients->Scope();
}
void LambdaExpr::ReplaceBody(StmtPtr new_body)
{
ingredients->ReplaceBody(std::move(new_body));
}
ValPtr LambdaExpr::Eval(Frame* f) const
{
auto lamb = make_intrusive<ScriptFunc>(ingredients->GetID());
// Use the primary function as the source of the frame size
// and function body, rather than the ingredients, since script
// optimization might have changed the former but not the latter.
lamb->SetFrameSize(primary_func->FrameSize());
StmtPtr body = primary_func->GetBodies()[0].stmts;
if ( run_state::is_parsing )