variant and subsumes with coroutining should always reset to slot, not to
value. git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@906 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
5e4816eb5a
commit
77bb5fed93
44
C/absmi.c
44
C/absmi.c
@ -465,7 +465,7 @@ Yap_absmi(int inp)
|
|||||||
ENDOp();
|
ENDOp();
|
||||||
|
|
||||||
/* profiled_retry Label,NArgs */
|
/* profiled_retry Label,NArgs */
|
||||||
Op(retry_profiled, l);
|
Op(retry_profiled, p);
|
||||||
LOCK(PREG->u.p.p->StatisticsForPred.lock);
|
LOCK(PREG->u.p.p->StatisticsForPred.lock);
|
||||||
PREG->u.p.p->StatisticsForPred.NOfRetries++;
|
PREG->u.p.p->StatisticsForPred.NOfRetries++;
|
||||||
UNLOCK(PREG->u.p.p->StatisticsForPred.lock);
|
UNLOCK(PREG->u.p.p->StatisticsForPred.lock);
|
||||||
@ -1458,8 +1458,12 @@ Yap_absmi(int inp)
|
|||||||
SP = SP0;
|
SP = SP0;
|
||||||
#ifdef LOW_LEVEL_TRACER
|
#ifdef LOW_LEVEL_TRACER
|
||||||
if (Yap_do_low_level_trace) {
|
if (Yap_do_low_level_trace) {
|
||||||
op_numbers opnum = Yap_op_from_opcode(PREG->opc);
|
int go_on = TRUE;
|
||||||
restart_cp:
|
yamop *ipc = PREG;
|
||||||
|
|
||||||
|
while (go_on) {
|
||||||
|
go_on = FALSE;
|
||||||
|
op_numbers opnum = Yap_op_from_opcode(ipc->opc);
|
||||||
switch (opnum) {
|
switch (opnum) {
|
||||||
#ifdef TABLING
|
#ifdef TABLING
|
||||||
case _table_answer_resolution:
|
case _table_answer_resolution:
|
||||||
@ -1499,25 +1503,30 @@ Yap_absmi(int inp)
|
|||||||
break;
|
break;
|
||||||
case _table_retry_me:
|
case _table_retry_me:
|
||||||
case _table_trust_me:
|
case _table_trust_me:
|
||||||
low_level_trace(retry_pred, PREG->u.lds.p, (CELL *)(((gen_cp_ptr)B)+1));
|
low_level_trace(retry_pred, ipc->u.lds.p, (CELL *)(((gen_cp_ptr)B)+1));
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
case _or_else:
|
case _or_else:
|
||||||
case _or_last:
|
case _or_last:
|
||||||
low_level_trace(retry_or, (PredEntry *)PREG, &(B->cp_a1));
|
low_level_trace(retry_or, (PredEntry *)ipc, &(B->cp_a1));
|
||||||
break;
|
break;
|
||||||
case _trust_logical_pred:
|
case _trust_logical_pred:
|
||||||
low_level_trace(retry_pred, NEXTOP(PREG,l)->u.ld.p, B->cp_args);
|
ipc = NEXTOP(ipc,l);
|
||||||
|
go_on = TRUE;
|
||||||
break;
|
break;
|
||||||
case _retry_c:
|
case _retry_c:
|
||||||
case _retry_userc:
|
case _retry_userc:
|
||||||
low_level_trace(retry_pred, PREG->u.lds.p, B->cp_args);
|
low_level_trace(retry_pred, ipc->u.lds.p, B->cp_args);
|
||||||
break;
|
break;
|
||||||
case _retry_profiled:
|
case _retry_profiled:
|
||||||
opnum = Yap_op_from_opcode(NEXTOP(B->cp_ap,l)->opc);
|
case _count_retry:
|
||||||
goto restart_cp;
|
ipc = NEXTOP(ipc,p);
|
||||||
|
go_on = TRUE;
|
||||||
|
break;
|
||||||
case _retry_me:
|
case _retry_me:
|
||||||
case _trust_me:
|
case _trust_me:
|
||||||
|
case _count_retry_me:
|
||||||
|
case _count_trust_me:
|
||||||
case _profiled_retry_me:
|
case _profiled_retry_me:
|
||||||
case _profiled_trust_me:
|
case _profiled_trust_me:
|
||||||
case _retry_me0:
|
case _retry_me0:
|
||||||
@ -1536,12 +1545,17 @@ Yap_absmi(int inp)
|
|||||||
case _retry_killed:
|
case _retry_killed:
|
||||||
case _trust:
|
case _trust:
|
||||||
case _trust_killed:
|
case _trust_killed:
|
||||||
low_level_trace(retry_pred, PREG->u.ld.p, B->cp_args);
|
low_level_trace(retry_pred, ipc->u.ld.p, B->cp_args);
|
||||||
|
break;
|
||||||
|
case _Nstop:
|
||||||
|
case _Ystop:
|
||||||
|
low_level_trace(retry_pred, NULL, B->cp_args);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endif /* LOW_LEVEL_TRACER */
|
#endif /* LOW_LEVEL_TRACER */
|
||||||
GONext();
|
GONext();
|
||||||
}
|
}
|
||||||
@ -6668,7 +6682,7 @@ Yap_absmi(int inp)
|
|||||||
if (IsPairTerm(d0)) {
|
if (IsPairTerm(d0)) {
|
||||||
/* pair */
|
/* pair */
|
||||||
#endif
|
#endif
|
||||||
PREG = (yamop *) (PREG->u.ollll.l1);
|
PREG = PREG->u.ollll.l1;
|
||||||
SREG = RepPair(d0);
|
SREG = RepPair(d0);
|
||||||
ALWAYS_GONext();
|
ALWAYS_GONext();
|
||||||
}
|
}
|
||||||
@ -6677,18 +6691,18 @@ Yap_absmi(int inp)
|
|||||||
#endif
|
#endif
|
||||||
if (d0 == TermNil) {
|
if (d0 == TermNil) {
|
||||||
/* empty list */
|
/* empty list */
|
||||||
PREG = (yamop *) (PREG->u.ollll.l2);
|
PREG = PREG->u.ollll.l2;
|
||||||
JMPNext();
|
JMPNext();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* appl or constant */
|
/* appl or constant */
|
||||||
if (IsApplTerm(d0)) {
|
if (IsApplTerm(d0)) {
|
||||||
SREG = RepAppl(d0);
|
SREG = RepAppl(d0);
|
||||||
PREG = (yamop *) (PREG->u.ollll.l3);
|
PREG = PREG->u.ollll.l3;
|
||||||
JMPNext();
|
JMPNext();
|
||||||
} else {
|
} else {
|
||||||
I_R = d0;
|
I_R = d0;
|
||||||
PREG = (yamop *) (PREG->u.ollll.l3);
|
PREG = PREG->u.ollll.l3;
|
||||||
JMPNext();
|
JMPNext();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -6702,7 +6716,7 @@ Yap_absmi(int inp)
|
|||||||
#endif
|
#endif
|
||||||
ENDP(pt0);
|
ENDP(pt0);
|
||||||
/* variable */
|
/* variable */
|
||||||
PREG = (yamop *) (PREG->u.ollll.l4);
|
PREG = PREG->u.ollll.l4;
|
||||||
JMPNext();
|
JMPNext();
|
||||||
ENDD(d0);
|
ENDD(d0);
|
||||||
}
|
}
|
||||||
|
@ -289,10 +289,12 @@ decrease_log_indices(LogUpdIndex *c, yamop *suspend_code)
|
|||||||
case _index_blob:
|
case _index_blob:
|
||||||
ipc = NEXTOP(ipc,e);
|
ipc = NEXTOP(ipc,e);
|
||||||
break;
|
break;
|
||||||
case _retry:
|
|
||||||
case _retry_killed:
|
|
||||||
case _retry_profiled:
|
case _retry_profiled:
|
||||||
case _count_retry:
|
case _count_retry:
|
||||||
|
ipc = NEXTOP(ipc,p);
|
||||||
|
break;
|
||||||
|
case _retry:
|
||||||
|
case _retry_killed:
|
||||||
case _trust:
|
case _trust:
|
||||||
case _trust_killed:
|
case _trust_killed:
|
||||||
decrease_ref_counter(ipc->u.ld.d, beg, end, suspend_code);
|
decrease_ref_counter(ipc->u.ld.d, beg, end, suspend_code);
|
||||||
|
@ -203,6 +203,7 @@ low_level_trace(yap_low_level_port port, PredEntry *pred, CELL *args)
|
|||||||
break;
|
break;
|
||||||
case retry_pred:
|
case retry_pred:
|
||||||
send_tracer_message("FAIL ", NULL, 0, NULL, args);
|
send_tracer_message("FAIL ", NULL, 0, NULL, args);
|
||||||
|
if (pred != NULL) {
|
||||||
mname = RepAtom(AtomOfTerm(Yap_Module_Name((CODEADDR)pred)))->StrOfAE;
|
mname = RepAtom(AtomOfTerm(Yap_Module_Name((CODEADDR)pred)))->StrOfAE;
|
||||||
arity = pred->ArityOfPE;
|
arity = pred->ArityOfPE;
|
||||||
if (pred->ModuleOfPred == 2) {
|
if (pred->ModuleOfPred == 2) {
|
||||||
@ -214,6 +215,7 @@ low_level_trace(yap_low_level_port port, PredEntry *pred, CELL *args)
|
|||||||
s = RepAtom(NameOfFunctor((pred->FunctorOfPred)))->StrOfAE;
|
s = RepAtom(NameOfFunctor((pred->FunctorOfPred)))->StrOfAE;
|
||||||
}
|
}
|
||||||
send_tracer_message("RETRY: ", s, arity, mname, args);
|
send_tracer_message("RETRY: ", s, arity, mname, args);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1331,7 +1331,7 @@ static int variant_complex(register CELL *pt0, register CELL *pt0_end, register
|
|||||||
to_visit[0] = pt0;
|
to_visit[0] = pt0;
|
||||||
to_visit[1] = pt0_end;
|
to_visit[1] = pt0_end;
|
||||||
to_visit[2] = pt1;
|
to_visit[2] = pt1;
|
||||||
to_visit[3] = (CELL *)d0;
|
to_visit[3] = (CELL *)*pt0;
|
||||||
*pt0 = d1;
|
*pt0 = d1;
|
||||||
#else
|
#else
|
||||||
/* store the terms to visit */
|
/* store the terms to visit */
|
||||||
@ -1372,7 +1372,7 @@ static int variant_complex(register CELL *pt0, register CELL *pt0_end, register
|
|||||||
to_visit[0] = pt0;
|
to_visit[0] = pt0;
|
||||||
to_visit[1] = pt0_end;
|
to_visit[1] = pt0_end;
|
||||||
to_visit[2] = pt1;
|
to_visit[2] = pt1;
|
||||||
to_visit[3] = (CELL *)d0;
|
to_visit[3] = (CELL *)*pt0;
|
||||||
*pt0 = d1;
|
*pt0 = d1;
|
||||||
#else
|
#else
|
||||||
/* store the terms to visit */
|
/* store the terms to visit */
|
||||||
@ -1525,7 +1525,7 @@ static int subsumes_complex(register CELL *pt0, register CELL *pt0_end, register
|
|||||||
to_visit[0] = pt0;
|
to_visit[0] = pt0;
|
||||||
to_visit[1] = pt0_end;
|
to_visit[1] = pt0_end;
|
||||||
to_visit[2] = pt1;
|
to_visit[2] = pt1;
|
||||||
to_visit[3] = (CELL *)d0;
|
to_visit[3] = (CELL *)*pt0;
|
||||||
*pt0 = d1;
|
*pt0 = d1;
|
||||||
#else
|
#else
|
||||||
/* store the terms to visit */
|
/* store the terms to visit */
|
||||||
@ -1566,7 +1566,7 @@ static int subsumes_complex(register CELL *pt0, register CELL *pt0_end, register
|
|||||||
to_visit[0] = pt0;
|
to_visit[0] = pt0;
|
||||||
to_visit[1] = pt0_end;
|
to_visit[1] = pt0_end;
|
||||||
to_visit[2] = pt1;
|
to_visit[2] = pt1;
|
||||||
to_visit[3] = (CELL *)d0;
|
to_visit[3] = (CELL *)*pt0;
|
||||||
*pt0 = d1;
|
*pt0 = d1;
|
||||||
#else
|
#else
|
||||||
/* store the terms to visit */
|
/* store the terms to visit */
|
||||||
|
Reference in New Issue
Block a user