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:
vsc 2004-04-29 03:45:50 +00:00
parent 781c89f4b5
commit 9d5c82db6a
6 changed files with 35 additions and 12 deletions

View File

@ -10,8 +10,11 @@
* *
* File: absmi.c *
* 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 $
* 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
* trust_logical should protect the last clause, otherwise it cannot
* jump there.
@ -1239,7 +1242,7 @@ Yap_absmi(int inp)
}
#else
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;
TR = --B->cp_tr;
/* next, recover space for the indexing code if it was erased */
@ -11627,7 +11630,7 @@ Yap_absmi(int inp)
CPREG = NEXTOP(PREG, sla);
goto creep;
BOp(p_execute_tail, e);
BOp(p_execute_tail, sla);
{
PredEntry *pen;
Term mod;
@ -11845,6 +11848,8 @@ Yap_absmi(int inp)
WRITEBACK_Y_AS_ENV();
SREG = (CELL *) pen;
ASP = E_YREG;
if (ASP > (CELL *)B)
ASP = (CELL *)B;
LOCK(SignalLock);
ActiveSignals &= ~YAP_CDOVF_SIGNAL;
UNLOCK(SignalLock);
@ -11863,9 +11868,6 @@ Yap_absmi(int inp)
if (ActiveSignals) {
goto creep;
}
ASP = (CELL *) (((char *) YREG) + PREG->u.sla.s);
if (ASP > (CELL *)B)
ASP = (CELL *)B;
saveregs();
if (!Yap_gc(((PredEntry *)SREG)->ArityOfPE, ENV, NEXTOP(PREG, sla))) {
Yap_Error(OUT_OF_STACK_ERROR,TermNil,Yap_ErrorMessage);

View File

@ -11,8 +11,11 @@
* File: amasm.c *
* 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 $
* 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
* support expand group of clauses
*
@ -2925,6 +2928,11 @@ Yap_InitComma(void)
GONEXT(e);
}
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);
}
}

View File

@ -352,7 +352,6 @@ BuildNewAttVar(Term t, Int i, Term tatt)
H -= 2;
t = H[0];
tatt = H[1];
printf("attv is %p\n", attv);
attv = (attvar_record *)Yap_ReadTimedVar(DelayedVars);
}
time = InitVarTime();

View File

@ -1397,6 +1397,9 @@ mark_choicepoints(register choiceptr gc_B, tr_fr_ptr saved_TR, int very_verbose)
#ifdef EASY_SHUNTING
HB = H;
#endif
yamop *lu_cl0 = NEXTOP(PredLogUpdClause0->CodeOfPred,ld), *lu_cl = NEXTOP(PredLogUpdClause->CodeOfPred,ld), *su_cl = NEXTOP(PredStaticClause->CodeOfPred,ld);
while (gc_B != NULL) {
op_numbers opnum;
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 _retry:
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;
break;
default:

View File

@ -127,6 +127,8 @@ low_level_trace(yap_low_level_port port, PredEntry *pred, CELL *args)
}
#endif
vsc_count++;
if (vsc_count < 16489200)
return;
#ifdef COMMENTED
// if (vsc_count == 218280)
// vsc_xstop = 1;
@ -154,7 +156,7 @@ low_level_trace(yap_low_level_port port, PredEntry *pred, CELL *args)
if (vsc_count < 5530257LL) {
return;
}
if (vsc_count == ) {
if (vsc_count == 9414280LL) {
vsc_xstop = TRUE;
}
if (vsc_count < 3399741LL) {

View File

@ -11,8 +11,11 @@
* File: rheap.h *
* 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 $
* 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
* trim_trail for default machine
* be more aggressive about try-retry-trust chains.
@ -656,7 +659,6 @@ restore_opcodes(yamop *pc)
case _p_dif:
case _p_eq:
case _p_functor:
case _p_execute_tail:
case _enter_a_profiling:
case _count_a_call:
case _index_dbref:
@ -757,6 +759,7 @@ restore_opcodes(yamop *pc)
pc = NEXTOP(pc,yF);
break;
/* instructions type sla */
case _p_execute_tail:
case _p_execute:
pc->u.sla.sla_u.p = PtoPredAdjust(pc->u.sla.sla_u.p);
if (pc->u.sla.sla_u.mod != 0) {