gc in dexecute should not use current Y, instead if should look at

parent's Y.


git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@393 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc 2002-02-28 18:25:55 +00:00
parent c53dc217bb
commit 20444412f5
4 changed files with 27 additions and 4 deletions

View File

@ -1965,6 +1965,17 @@ absmi(int inp)
#endif
if (CFREG != CalculateStackGap())
goto creepde;
/* try performing garbage collection */
ASP = Y+E_CB;
if (ASP > (CELL *)B)
ASP = (CELL *)B;
saveregs();
gc(((PredEntry *)(SREG))->ArityOfPE, (CELL *)Y[E_E], (yamop *)Y[E_CP]);
setregs();
/* hopefully, gc will succeeded, and we will retry
* the instruction */
JMPNext();
NoStackExec:

View File

@ -292,7 +292,11 @@ GC_ALLOC_NEW_MASPACE(void)
growtrail(64 * 1024L);
gc_ma_h_top++;
cont_top = (cont *)gc_ma_h_top;
#ifdef EASY_SHUNTING
sTR = (tr_fr_ptr)cont_top;
#else
cont_top0 = cont_top;
#endif
return(new);
}
@ -344,7 +348,11 @@ GC_NEW_MAHASH(gc_ma_h_inner_struct *top) {
}
gc_ma_h_top = top;
cont_top = (cont *)gc_ma_h_top;
#ifdef EASY_SHUNTING
sTR = (tr_fr_ptr)cont_top;
#else
cont_top0 = cont_top;
#endif
live_list = NULL;
}
@ -1264,8 +1272,8 @@ mark_trail(tr_fr_ptr trail_ptr, tr_fr_ptr trail_base, CELL *gc_H, choiceptr gc_B
live_list = live_list->ma_list;
}
#endif
sTR = (tr_fr_ptr)old_cont_top0;
#ifdef EASY_SHUNTING
sTR = (tr_fr_ptr)old_cont_top0;
while (begsTR != NULL) {
tr_fr_ptr newsTR = (tr_fr_ptr)TrailTerm(begsTR);
TrailTerm(sTR) = TrailTerm(begsTR+1);
@ -1273,6 +1281,8 @@ mark_trail(tr_fr_ptr trail_ptr, tr_fr_ptr trail_base, CELL *gc_H, choiceptr gc_B
begsTR = newsTR;
sTR += 2;
}
#else
cont_top0 = old_cont_top0;
#endif
cont_top = cont_top0;
}
@ -2549,9 +2559,11 @@ marking_phase(tr_fr_ptr old_TR, CELL *current_env, yamop *curp, CELL *max)
init_dbtable(old_TR);
#ifdef EASY_SHUNTING
sTR0 = (tr_fr_ptr)db_vec;
sTR = (tr_fr_ptr)db_vec;
#else
cont_top0 = (cont *)db_vec;
#endif
cont_top = (cont *)db_vec;
sTR = (tr_fr_ptr)db_vec;
/* These two must be marked first so that our trail optimisation won't lose
values */
mark_regs(old_TR); /* active registers & trail */

View File

@ -112,7 +112,7 @@ low_level_trace(yap_low_level_port port, PredEntry *pred, CELL *args)
/* extern int gc_calls; */
vsc_count++;
/* if (vsc_count < 6000) return;*/
if (vsc_count < 84600) return;
/* if (vsc_count == 6469) {
printf("Here I go\n");
}

View File

@ -252,7 +252,7 @@ IsStringTerm(Term string) /* checks whether this is a string */
if (IsVarTerm(hd)) return(FALSE);
if (!IsIntTerm(hd)) return(FALSE);
ch = IntOfTerm(HeadOfTerm(string));
if (ch < 0 || ch > 255)
if ((ch < ' ' || ch > 255) && ch != '\n' && ch != '\t')
return(FALSE);
string = TailOfTerm(string);
if (IsVarTerm(string)) return(FALSE);