wake up before cut_e. Still to do: wakeup before cut_t and cut.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@878 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
29
C/absmi.c
29
C/absmi.c
@@ -2159,18 +2159,9 @@ Yap_absmi(int inp)
|
||||
/* also, this is unusual in that I have already done deallocate,
|
||||
so I don't need to redo it.
|
||||
*/
|
||||
NoStackProceed:
|
||||
NoStackDeallocate:
|
||||
if (CFREG == (CELL)(LCL0+2)) {
|
||||
/*
|
||||
we're not actually doing debugging here, just execute
|
||||
instruction and go on.
|
||||
*/
|
||||
PREG = CPREG;
|
||||
YREG = ENV;
|
||||
#ifdef DEPTH_LIMIT
|
||||
DEPTH = YREG[E_DEPTH];
|
||||
#endif
|
||||
JMPNext();
|
||||
GONext();
|
||||
}
|
||||
ASP = YREG;
|
||||
if (CFREG == (CELL)(LCL0+1)) {
|
||||
@@ -2178,7 +2169,13 @@ Yap_absmi(int inp)
|
||||
}
|
||||
if (CFREG == Unsigned(LCL0)) {
|
||||
if (Yap_ReadTimedVar(WokenGoals) != TermNil) {
|
||||
SREG = (CELL *)RepPredProp(Yap_GetPredPropByAtom(AtomTrue,0));
|
||||
if (Yap_op_from_opcode(PREG->opc) == _cut_e) {
|
||||
/* followed by a cut */
|
||||
ARG1 = MkIntegerTerm(LCL0-(CELL *)SREG[E_CB]);
|
||||
SREG = (CELL *)RepPredProp(Yap_GetPredPropByFunc(FunctorCutBy,1));
|
||||
} else {
|
||||
SREG = (CELL *)RepPredProp(Yap_GetPredPropByAtom(AtomTrue,0));
|
||||
}
|
||||
goto creep;
|
||||
} else {
|
||||
CFREG = CalculateStackGap();
|
||||
@@ -2567,10 +2564,6 @@ Yap_absmi(int inp)
|
||||
|
||||
BOp(procceed, e);
|
||||
CACHE_Y_AS_ENV(YREG);
|
||||
#ifndef NO_CHECKING
|
||||
/* check stacks */
|
||||
check_stack(NoStackProceed, H);
|
||||
#endif
|
||||
PREG = CPREG;
|
||||
E_YREG = ENV;
|
||||
#ifdef DEPTH_LIMIT
|
||||
@@ -2622,6 +2615,10 @@ Yap_absmi(int inp)
|
||||
E_YREG = (CELL *) ((CELL) E_YREG + ENV_Size(CPREG));
|
||||
#endif /* FROZEN_STACKS */
|
||||
WRITEBACK_Y_AS_ENV();
|
||||
#ifndef NO_CHECKING
|
||||
/* check stacks */
|
||||
check_stack(NoStackDeallocate, H);
|
||||
#endif
|
||||
ENDCACHE_Y_AS_ENV();
|
||||
GONext();
|
||||
ENDOp();
|
||||
|
28
C/cdmgr.c
28
C/cdmgr.c
@@ -577,20 +577,22 @@ retract_all(PredEntry *p, int in_use)
|
||||
p->StatisticsForPred.NOfHeadSuccesses = 0;
|
||||
p->StatisticsForPred.NOfRetries = 0;
|
||||
} else {
|
||||
yamop *cpt = (yamop *)fclause;
|
||||
cpt->opc = Yap_opcode(TRYCODE(_try_me, _try_me0, PredArity(p)));
|
||||
if (fclause == lclause) {
|
||||
p->cs.p_code.TrueCodeOfPred = p->CodeOfPred = NEXTOP(cpt,ld);
|
||||
p->OpcodeOfPred = NEXTOP(cpt,ld)->opc;
|
||||
} else {
|
||||
p->cs.p_code.TrueCodeOfPred = p->CodeOfPred = fclause;
|
||||
p->OpcodeOfPred = cpt->opc;
|
||||
if (p->PredFlags & ProfiledPredFlag) {
|
||||
((yamop *)lclause)->opc = Yap_opcode(_profiled_trust_me);
|
||||
} else if (p->PredFlags & CountPredFlag) {
|
||||
((yamop *)lclause)->opc = Yap_opcode(_count_trust_me);
|
||||
if (!(p->PredFlags & LogUpdatePredFlag)) {
|
||||
yamop *cpt = (yamop *)fclause;
|
||||
cpt->opc = Yap_opcode(TRYCODE(_try_me, _try_me0, PredArity(p)));
|
||||
if (fclause == lclause) {
|
||||
p->cs.p_code.TrueCodeOfPred = p->CodeOfPred = NEXTOP(cpt,ld);
|
||||
p->OpcodeOfPred = NEXTOP(cpt,ld)->opc;
|
||||
} else {
|
||||
((yamop *)lclause)->opc = Yap_opcode(TRYCODE(_trust_me, _trust_me0, PredArity(p)));
|
||||
p->cs.p_code.TrueCodeOfPred = p->CodeOfPred = fclause;
|
||||
p->OpcodeOfPred = cpt->opc;
|
||||
if (p->PredFlags & ProfiledPredFlag) {
|
||||
((yamop *)lclause)->opc = Yap_opcode(_profiled_trust_me);
|
||||
} else if (p->PredFlags & CountPredFlag) {
|
||||
((yamop *)lclause)->opc = Yap_opcode(_count_trust_me);
|
||||
} else {
|
||||
((yamop *)lclause)->opc = Yap_opcode(TRYCODE(_trust_me, _trust_me0, PredArity(p)));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (p->PredFlags & SpiedPredFlag) {
|
||||
|
Reference in New Issue
Block a user