I am looking to identify in the code where after a call of goal and before the execution of the goal, swi-prolog checks if choice points need to be generated.
It was suggested that it might be within i_enter in vmi.c, but i can’t see this relevaled in the code itself, so it seems that whether to create choice points has already been performed.
Edit:
Seems to be somewhere in pl_wam.c
VMI(I_ENTER, VIF_BREAK, 0, ())
{ ARGP = argFrameP(lTop, 0);
if ( unlikely(LD->alerted) )
{
#if O_DEBUGGER
if ( debugstatus.debugging )
{ int action;
SAVE_REGISTERS(qid);
clearUninitialisedVarsFrame(FR, PC);
action = tracePort(FR, BFR, UNIFY_PORT, PC PASS_LD);
LOAD_REGISTERS(qid);
switch( action )
{ case ACTION_RETRY:
goto retry;
case ACTION_FAIL:
FRAME_FAILED;
case ACTION_ABORT:
THROW_EXCEPTION;
}
}
#endif /*O_DEBUGGER*/
CHECK_WAKEUP;
}
NEXT_INSTRUCTION;
}