removed raw frame access for indirect-when-call operations

This commit is contained in:
Vern Paxson 2024-06-03 10:20:40 -07:00
parent fbf4c662b7
commit b62b31846e
2 changed files with 13 additions and 7 deletions

View file

@ -1056,10 +1056,12 @@ const ZAMStmt ZAMCompiler::DoCall(const CallExpr* c, const NameExpr* n) {
default:
if ( in_when ) {
if ( indirect )
op = OP_WHENINDCALLN_Vi;
else
if ( ! indirect )
op = OP_WHENCALLN_V;
else if ( func_id->IsGlobal() )
op = OP_WHEN_ID_INDCALLN_V;
else
op = OP_WHENINDCALLN_VV;
}
else if ( indirect ) {

View file

@ -1594,11 +1594,15 @@ side-effects
eval WhenCall($$, z.aux->func)
internal-op WhenIndCallN
type Vi
type VV
side-effects
eval auto sel = $1;
auto func = (sel < 0) ? z.aux->id_val->GetVal()->AsFunc() : frame[sel].AsFunc();
WhenCall($$, func)
eval WhenCall($$, $1.AsFunc())
# Form for when we need to look up the function value at run-time.
internal-op When-ID-IndCallN
type V
side-effects
eval WhenCall($$, z.aux->id_val->GetVal()->AsFunc())
########## Statements ##########