14 BOp(call_cpred, Osbpp);
15#if __ANDROID__ && STRONG_DEBUG
18 if (PREG->y_u.Osbpp.p->ArityOfPE) {
19 Functor f = PREG->y_u.Osbpp.p->FunctorOfPred;
22 name = (
Atom)(PREG->y_u.Osbpp.p->FunctorOfPred);
29 if (!(PREG->y_u.Osbpp.p->PredFlags &
30 (SafePredFlag | NoTracePredFlag | HiddenPredFlag))) {
32 check_stack(NoStackCCall, HR);
36 SET_ASP(YREG, AS_CELLS(PREG->y_u.Osbpp.s) );
38#ifdef LOW_LEVEL_TRACER
39 if (Yap_do_low_level_trace)
40 low_level_trace(enter_pred, PREG->y_u.Osbpp.p, XREGS + 1);
43 CPredicate f = PREG->y_u.Osbpp.p->cs.f_code;
44 PREG = NEXTOP(PREG, Osbpp);
59 PROCESS_INT(interrupt_c_call, do_c_call);
64 BOp(execute_cpred, Osbpp);
72 check_stack(NoStackExecuteC, HR);
79 if (YREG > (CELL *)top_b || YREG < HR)
82 if (YREG > (CELL *)top_b)
92 pt0 = PREG->y_u.Osbpp.p;
93#ifdef LOW_LEVEL_TRACER
94 if (Yap_do_low_level_trace) {
95 low_level_trace(enter_pred, pt0, XREGS + 1);
106 if (DEPTH <= MkIntTerm(1)) {
107 if (pt0->ModuleOfPred) {
108 if (DEPTH == MkIntTerm(0)) {
111 DEPTH = RESET_DEPTH();
114 }
else if (pt0->ModuleOfPred) {
115 DEPTH -= MkIntConstant(2);
120 CPredicate f = PREG->y_u.Osbpp.p->cs.f_code;
122 yamop *oldPREG = PREG;
132 if (oldPREG == PREG) {
138 DEPTH = ENV_YREG[E_DEPTH];
140 WRITEBACK_Y_AS_ENV();
152 PROCESS_INT(interrupt_executec, do_executec);
161 BOp(call_usercpred, Osbpp);
162 CACHE_Y_AS_ENV(YREG);
163 check_stack(NoStackUserCall, HR);
166#ifdef LOW_LEVEL_TRACER
167 if (Yap_do_low_level_trace) {
168 low_level_trace(enter_pred, PREG->y_u.Osbpp.p, XREGS + 1);
175 if (YREG > (CELL *)top_b || YREG < HR)
178 if (YREG > (CELL *)top_b)
182 ASP = (CELL *)(((
char *)YREG) + PREG->y_u.Osbpp.s);
185 SET_ASP(YREG, AS_CELLS(PREG->y_u.Osbpp.s) );
193 LOCAL_PrologMode |= UserCCallMode;
197 PREG = NEXTOP(PREG, Osbpp);
202 SREG = (CELL *)YAP_Execute(p, p->cs.f_code);
205 LOCAL_PrologMode &= ~UserCCallMode;
206 restore_machine_regs();
209 if (Yap_HasException()) {
222 PROCESS_INT(interrupt_user_call, do_user_call);
226 BOp(call_c_wfail, slpp);
227#ifdef LOW_LEVEL_TRACER
228 if (Yap_do_low_level_trace) {
229 low_level_trace(enter_pred, PREG->y_u.slpp.p, XREGS + 1);
236 if (YREG > (CELL *)top_b || YREG < HR)
239 if (YREG > (CELL *)top_b)
244 d0 = PREG->y_u.slpp.s;
245 ASP = ((CELL *)YREG) + d0;
250 if (YREG > (CELL *)B)
254 d0 = PREG->y_u.slpp.s;
255 ASP = ((CELL *)YREG) + d0;
260 CPredicate f = PREG->y_u.slpp.p->cs.f_code;
262 SREG = (CELL *)((f)(PASS_REGS1));
267 if (PREG != FAILCODE)
268 PREG = PREG->y_u.slpp.l;
270 PREG = NEXTOP(PREG, slpp);
282 CUT_C_PUSH(NEXTOP(NEXTOP(PREG, OtapFs), OtapFs), S_YREG);
283 S_YREG = S_YREG - PREG->y_u.OtapFs.extra;
284 store_args(PREG->y_u.OtapFs.s);
285 store_yaam_regs(NEXTOP(P, OtapFs), 0);
288 SCH_set_load(B_YREG);
296 CPredicate f = (CPredicate)(PREG->y_u.OtapFs.f);
298 SREG = (CELL *)((f)(PASS_REGS1));
300 while (POP_CHOICE_POINT(B)) {
309 while (POP_CHOICE_POINT(B))
313 if ((CELL *)B == YREG && ASP != (CELL *)B) {
318 HBREG = PROTECT_FROZEN_H(B);
326 BOp(retry_c, OtapFs);
331 CPREG = B_YREG->cp_cp;
332 ENV = B_YREG->cp_env;
333 HR = PROTECT_FROZEN_H(B);
338 restore_args(PREG->y_u.OtapFs.s);
348 printf(
"ERROR: Should not print this message FILE: absmi.c %d\n",
353 BOp(try_userc, OtapFs);
359 CUT_C_PUSH(NEXTOP(NEXTOP(PREG, OtapFs), OtapFs), S_YREG);
360 S_YREG = S_YREG - PREG->y_u.OtapFs.extra;
361 store_args(PREG->y_u.OtapFs.s);
362 store_yaam_regs(NEXTOP(PREG, OtapFs), 0);
365 SCH_set_load(B_YREG);
369 LOCAL_PrologMode = UserCCallMode;
373 SREG = (CELL *)YAP_ExecuteFirst(PREG->y_u.OtapFs.p,
374 (CPredicate)(PREG->y_u.OtapFs.f));
375 restore_machine_regs();
377 LOCAL_PrologMode &= UserMode;
381 if ((CELL *)B == YREG && ASP != (CELL *)B) {
386 HBREG = PROTECT_FROZEN_H(B);
394 BOp(retry_userc, OtapFs);
399 CPREG = B_YREG->cp_cp;
400 ENV = B_YREG->cp_env;
401 HR = PROTECT_FROZEN_H(B);
406 restore_args(PREG->y_u.OtapFs.s);
409 LOCAL_PrologMode |= UserCCallMode;
413 SREG = (CELL *)YAP_ExecuteNext(PREG->y_u.OtapFs.p,
414 (CPredicate)(PREG->y_u.OtapFs.f));
415 restore_machine_regs();
417 LOCAL_PrologMode &= ~UserCCallMode;
422 while (POP_CHOICE_POINT(B))
426 if ((CELL *)B == YREG && ASP != (CELL *)B) {
431 HBREG = PROTECT_FROZEN_H(B);
439 BOp(cut_userc, OtapFs);
444 printf(
"ERROR: Should not print this message FILE: absmi.c %d\n",
460 if (!ap->cs.p_code.NOfClauses) {
468 if (ap->cs.p_code.NOfClauses > 1 &&
469 !(ap->PredFlags & IndexedPredFlag)) {
471 SET_ASP(YREG, E_CB );
473 Yap_IPred(ap, 0, CP);
481 PREG = ap->cs.p_code.TrueCodeOfPred;
489#if defined(YAPOR) || defined(THREADS)
497 if (ap->OpcodeOfPred != INDEX_OPCODE) {
502 PREG = ap->CodeOfPred;
511 Yap_IPred(ap, 0, CP);
515 PREG = ap->CodeOfPred;
518#if defined(YAPOR) || defined(THREADS)
527 BOp(
thread_local, e);
530 ap = Yap_GetThreadPred(ap PASS_REGS);
531 PREG = ap->CodeOfPred;
539 BOp(expand_index, e);
541 PredEntry *pe = PredFromExpandCode(PREG);
546#if defined(YAPOR) || defined(THREADS)
550 if (!same_lu_block(PREG_ADDR, PREG)) {
562 pt0 = Yap_ExpandIndex(pe, 0);
569#if defined(YAPOR) || defined(THREADS)
578 BOp(expand_clauses, sssllp);
585#if defined(YAPOR) || defined(THREADS)
589 if (!same_lu_block(PREG_ADDR, PREG)) {
598 pt0 = Yap_ExpandIndex(pe, 0);
602#if defined(YAPOR) || defined(THREADS)
615 LOCAL_DoingUndefp =
true;
617 undef_goal(pe PASS_REGS);
620 LOCAL_DoingUndefp =
false;
628 spy_goal(PASS_REGS1);
bool Yap_RaiseException()
let's go