fix garbage collection in execute_tail
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1057 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
781c89f4b5
commit
9d5c82db6a
14
C/absmi.c
14
C/absmi.c
@ -10,8 +10,11 @@
|
|||||||
* *
|
* *
|
||||||
* File: absmi.c *
|
* File: absmi.c *
|
||||||
* comments: Portable abstract machine interpreter *
|
* comments: Portable abstract machine interpreter *
|
||||||
* Last rev: $Date: 2004-04-22 20:07:02 $,$Author: vsc $ *
|
* Last rev: $Date: 2004-04-29 03:45:49 $,$Author: vsc $ *
|
||||||
* $Log: not supported by cvs2svn $
|
* $Log: not supported by cvs2svn $
|
||||||
|
* Revision 1.131 2004/04/22 20:07:02 vsc
|
||||||
|
* more fixes for USE_SYSTEM_MEMORY
|
||||||
|
*
|
||||||
* Revision 1.130 2004/04/22 03:24:17 vsc
|
* Revision 1.130 2004/04/22 03:24:17 vsc
|
||||||
* trust_logical should protect the last clause, otherwise it cannot
|
* trust_logical should protect the last clause, otherwise it cannot
|
||||||
* jump there.
|
* jump there.
|
||||||
@ -1239,7 +1242,7 @@ Yap_absmi(int inp)
|
|||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if (TrailTerm(B->cp_tr-1) == CLREF_TO_TRENTRY(cl) &&
|
if (TrailTerm(B->cp_tr-1) == CLREF_TO_TRENTRY(cl) &&
|
||||||
B->cp_tr > B->cp_b->cp_tr) {
|
B->cp_tr != B->cp_b->cp_tr) {
|
||||||
cl->ClFlags &= ~InUseMask;
|
cl->ClFlags &= ~InUseMask;
|
||||||
TR = --B->cp_tr;
|
TR = --B->cp_tr;
|
||||||
/* next, recover space for the indexing code if it was erased */
|
/* next, recover space for the indexing code if it was erased */
|
||||||
@ -11627,7 +11630,7 @@ Yap_absmi(int inp)
|
|||||||
CPREG = NEXTOP(PREG, sla);
|
CPREG = NEXTOP(PREG, sla);
|
||||||
goto creep;
|
goto creep;
|
||||||
|
|
||||||
BOp(p_execute_tail, e);
|
BOp(p_execute_tail, sla);
|
||||||
{
|
{
|
||||||
PredEntry *pen;
|
PredEntry *pen;
|
||||||
Term mod;
|
Term mod;
|
||||||
@ -11845,6 +11848,8 @@ Yap_absmi(int inp)
|
|||||||
WRITEBACK_Y_AS_ENV();
|
WRITEBACK_Y_AS_ENV();
|
||||||
SREG = (CELL *) pen;
|
SREG = (CELL *) pen;
|
||||||
ASP = E_YREG;
|
ASP = E_YREG;
|
||||||
|
if (ASP > (CELL *)B)
|
||||||
|
ASP = (CELL *)B;
|
||||||
LOCK(SignalLock);
|
LOCK(SignalLock);
|
||||||
ActiveSignals &= ~YAP_CDOVF_SIGNAL;
|
ActiveSignals &= ~YAP_CDOVF_SIGNAL;
|
||||||
UNLOCK(SignalLock);
|
UNLOCK(SignalLock);
|
||||||
@ -11863,9 +11868,6 @@ Yap_absmi(int inp)
|
|||||||
if (ActiveSignals) {
|
if (ActiveSignals) {
|
||||||
goto creep;
|
goto creep;
|
||||||
}
|
}
|
||||||
ASP = (CELL *) (((char *) YREG) + PREG->u.sla.s);
|
|
||||||
if (ASP > (CELL *)B)
|
|
||||||
ASP = (CELL *)B;
|
|
||||||
saveregs();
|
saveregs();
|
||||||
if (!Yap_gc(((PredEntry *)SREG)->ArityOfPE, ENV, NEXTOP(PREG, sla))) {
|
if (!Yap_gc(((PredEntry *)SREG)->ArityOfPE, ENV, NEXTOP(PREG, sla))) {
|
||||||
Yap_Error(OUT_OF_STACK_ERROR,TermNil,Yap_ErrorMessage);
|
Yap_Error(OUT_OF_STACK_ERROR,TermNil,Yap_ErrorMessage);
|
||||||
|
12
C/amasm.c
12
C/amasm.c
@ -11,8 +11,11 @@
|
|||||||
* File: amasm.c *
|
* File: amasm.c *
|
||||||
* comments: abstract machine assembler *
|
* comments: abstract machine assembler *
|
||||||
* *
|
* *
|
||||||
* Last rev: $Date: 2004-04-22 20:07:04 $ *
|
* Last rev: $Date: 2004-04-29 03:45:50 $ *
|
||||||
* $Log: not supported by cvs2svn $
|
* $Log: not supported by cvs2svn $
|
||||||
|
* Revision 1.60 2004/04/22 20:07:04 vsc
|
||||||
|
* more fixes for USE_SYSTEM_MEMORY
|
||||||
|
*
|
||||||
* Revision 1.59 2004/03/31 01:03:09 vsc
|
* Revision 1.59 2004/03/31 01:03:09 vsc
|
||||||
* support expand group of clauses
|
* support expand group of clauses
|
||||||
*
|
*
|
||||||
@ -2925,6 +2928,11 @@ Yap_InitComma(void)
|
|||||||
GONEXT(e);
|
GONEXT(e);
|
||||||
}
|
}
|
||||||
code_p->opc = opcode(_p_execute_tail);
|
code_p->opc = opcode(_p_execute_tail);
|
||||||
GONEXT(e);
|
code_p->u.sla.s = emit_count(-Signed(RealEnvSize)-3*sizeof(CELL));
|
||||||
|
code_p->u.sla.bmap = NULL;
|
||||||
|
code_p->u.sla.sla_u.p =
|
||||||
|
code_p->u.sla.p0 =
|
||||||
|
RepPredProp(PredPropByFunc(FunctorComma,0));
|
||||||
|
GONEXT(sla);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -352,7 +352,6 @@ BuildNewAttVar(Term t, Int i, Term tatt)
|
|||||||
H -= 2;
|
H -= 2;
|
||||||
t = H[0];
|
t = H[0];
|
||||||
tatt = H[1];
|
tatt = H[1];
|
||||||
printf("attv is %p\n", attv);
|
|
||||||
attv = (attvar_record *)Yap_ReadTimedVar(DelayedVars);
|
attv = (attvar_record *)Yap_ReadTimedVar(DelayedVars);
|
||||||
}
|
}
|
||||||
time = InitVarTime();
|
time = InitVarTime();
|
||||||
|
@ -1397,6 +1397,9 @@ mark_choicepoints(register choiceptr gc_B, tr_fr_ptr saved_TR, int very_verbose)
|
|||||||
#ifdef EASY_SHUNTING
|
#ifdef EASY_SHUNTING
|
||||||
HB = H;
|
HB = H;
|
||||||
#endif
|
#endif
|
||||||
|
yamop *lu_cl0 = NEXTOP(PredLogUpdClause0->CodeOfPred,ld), *lu_cl = NEXTOP(PredLogUpdClause->CodeOfPred,ld), *su_cl = NEXTOP(PredStaticClause->CodeOfPred,ld);
|
||||||
|
|
||||||
|
|
||||||
while (gc_B != NULL) {
|
while (gc_B != NULL) {
|
||||||
op_numbers opnum;
|
op_numbers opnum;
|
||||||
register OPCODE op;
|
register OPCODE op;
|
||||||
@ -1701,6 +1704,12 @@ mark_choicepoints(register choiceptr gc_B, tr_fr_ptr saved_TR, int very_verbose)
|
|||||||
case _trust_me4:
|
case _trust_me4:
|
||||||
case _retry:
|
case _retry:
|
||||||
case _trust:
|
case _trust:
|
||||||
|
if (gc_B->cp_ap == lu_cl0 ||
|
||||||
|
gc_B->cp_ap == lu_cl ||
|
||||||
|
gc_B->cp_ap == su_cl) {
|
||||||
|
CELL *pt = (CELL *)IntegerOfTerm(gc_B->cp_args[1]);
|
||||||
|
mark_db_fixed(pt);
|
||||||
|
}
|
||||||
nargs = rtp->u.ld.s;
|
nargs = rtp->u.ld.s;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -127,6 +127,8 @@ low_level_trace(yap_low_level_port port, PredEntry *pred, CELL *args)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
vsc_count++;
|
vsc_count++;
|
||||||
|
if (vsc_count < 16489200)
|
||||||
|
return;
|
||||||
#ifdef COMMENTED
|
#ifdef COMMENTED
|
||||||
// if (vsc_count == 218280)
|
// if (vsc_count == 218280)
|
||||||
// vsc_xstop = 1;
|
// vsc_xstop = 1;
|
||||||
@ -154,7 +156,7 @@ low_level_trace(yap_low_level_port port, PredEntry *pred, CELL *args)
|
|||||||
if (vsc_count < 5530257LL) {
|
if (vsc_count < 5530257LL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (vsc_count == ) {
|
if (vsc_count == 9414280LL) {
|
||||||
vsc_xstop = TRUE;
|
vsc_xstop = TRUE;
|
||||||
}
|
}
|
||||||
if (vsc_count < 3399741LL) {
|
if (vsc_count < 3399741LL) {
|
||||||
|
@ -11,8 +11,11 @@
|
|||||||
* File: rheap.h *
|
* File: rheap.h *
|
||||||
* comments: walk through heap code *
|
* comments: walk through heap code *
|
||||||
* *
|
* *
|
||||||
* Last rev: $Date: 2004-03-31 01:03:10 $,$Author: vsc $ *
|
* Last rev: $Date: 2004-04-29 03:45:50 $,$Author: vsc $ *
|
||||||
* $Log: not supported by cvs2svn $
|
* $Log: not supported by cvs2svn $
|
||||||
|
* Revision 1.40 2004/03/31 01:03:10 vsc
|
||||||
|
* support expand group of clauses
|
||||||
|
*
|
||||||
* Revision 1.39 2004/03/19 11:35:42 vsc
|
* Revision 1.39 2004/03/19 11:35:42 vsc
|
||||||
* trim_trail for default machine
|
* trim_trail for default machine
|
||||||
* be more aggressive about try-retry-trust chains.
|
* be more aggressive about try-retry-trust chains.
|
||||||
@ -656,7 +659,6 @@ restore_opcodes(yamop *pc)
|
|||||||
case _p_dif:
|
case _p_dif:
|
||||||
case _p_eq:
|
case _p_eq:
|
||||||
case _p_functor:
|
case _p_functor:
|
||||||
case _p_execute_tail:
|
|
||||||
case _enter_a_profiling:
|
case _enter_a_profiling:
|
||||||
case _count_a_call:
|
case _count_a_call:
|
||||||
case _index_dbref:
|
case _index_dbref:
|
||||||
@ -757,6 +759,7 @@ restore_opcodes(yamop *pc)
|
|||||||
pc = NEXTOP(pc,yF);
|
pc = NEXTOP(pc,yF);
|
||||||
break;
|
break;
|
||||||
/* instructions type sla */
|
/* instructions type sla */
|
||||||
|
case _p_execute_tail:
|
||||||
case _p_execute:
|
case _p_execute:
|
||||||
pc->u.sla.sla_u.p = PtoPredAdjust(pc->u.sla.sla_u.p);
|
pc->u.sla.sla_u.p = PtoPredAdjust(pc->u.sla.sla_u.p);
|
||||||
if (pc->u.sla.sla_u.mod != 0) {
|
if (pc->u.sla.sla_u.mod != 0) {
|
||||||
|
Reference in New Issue
Block a user