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:
parent
c53dc217bb
commit
20444412f5
11
C/absmi.c
11
C/absmi.c
@ -1965,6 +1965,17 @@ absmi(int inp)
|
|||||||
#endif
|
#endif
|
||||||
if (CFREG != CalculateStackGap())
|
if (CFREG != CalculateStackGap())
|
||||||
goto creepde;
|
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:
|
NoStackExec:
|
||||||
|
|
||||||
|
16
C/heapgc.c
16
C/heapgc.c
@ -292,7 +292,11 @@ GC_ALLOC_NEW_MASPACE(void)
|
|||||||
growtrail(64 * 1024L);
|
growtrail(64 * 1024L);
|
||||||
gc_ma_h_top++;
|
gc_ma_h_top++;
|
||||||
cont_top = (cont *)gc_ma_h_top;
|
cont_top = (cont *)gc_ma_h_top;
|
||||||
|
#ifdef EASY_SHUNTING
|
||||||
sTR = (tr_fr_ptr)cont_top;
|
sTR = (tr_fr_ptr)cont_top;
|
||||||
|
#else
|
||||||
|
cont_top0 = cont_top;
|
||||||
|
#endif
|
||||||
return(new);
|
return(new);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -344,7 +348,11 @@ GC_NEW_MAHASH(gc_ma_h_inner_struct *top) {
|
|||||||
}
|
}
|
||||||
gc_ma_h_top = top;
|
gc_ma_h_top = top;
|
||||||
cont_top = (cont *)gc_ma_h_top;
|
cont_top = (cont *)gc_ma_h_top;
|
||||||
|
#ifdef EASY_SHUNTING
|
||||||
sTR = (tr_fr_ptr)cont_top;
|
sTR = (tr_fr_ptr)cont_top;
|
||||||
|
#else
|
||||||
|
cont_top0 = cont_top;
|
||||||
|
#endif
|
||||||
live_list = NULL;
|
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;
|
live_list = live_list->ma_list;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
sTR = (tr_fr_ptr)old_cont_top0;
|
|
||||||
#ifdef EASY_SHUNTING
|
#ifdef EASY_SHUNTING
|
||||||
|
sTR = (tr_fr_ptr)old_cont_top0;
|
||||||
while (begsTR != NULL) {
|
while (begsTR != NULL) {
|
||||||
tr_fr_ptr newsTR = (tr_fr_ptr)TrailTerm(begsTR);
|
tr_fr_ptr newsTR = (tr_fr_ptr)TrailTerm(begsTR);
|
||||||
TrailTerm(sTR) = TrailTerm(begsTR+1);
|
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;
|
begsTR = newsTR;
|
||||||
sTR += 2;
|
sTR += 2;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
cont_top0 = old_cont_top0;
|
||||||
#endif
|
#endif
|
||||||
cont_top = cont_top0;
|
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);
|
init_dbtable(old_TR);
|
||||||
#ifdef EASY_SHUNTING
|
#ifdef EASY_SHUNTING
|
||||||
sTR0 = (tr_fr_ptr)db_vec;
|
sTR0 = (tr_fr_ptr)db_vec;
|
||||||
|
sTR = (tr_fr_ptr)db_vec;
|
||||||
|
#else
|
||||||
|
cont_top0 = (cont *)db_vec;
|
||||||
#endif
|
#endif
|
||||||
cont_top = (cont *)db_vec;
|
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
|
/* These two must be marked first so that our trail optimisation won't lose
|
||||||
values */
|
values */
|
||||||
mark_regs(old_TR); /* active registers & trail */
|
mark_regs(old_TR); /* active registers & trail */
|
||||||
|
@ -112,7 +112,7 @@ low_level_trace(yap_low_level_port port, PredEntry *pred, CELL *args)
|
|||||||
/* extern int gc_calls; */
|
/* extern int gc_calls; */
|
||||||
|
|
||||||
vsc_count++;
|
vsc_count++;
|
||||||
/* if (vsc_count < 6000) return;*/
|
if (vsc_count < 84600) return;
|
||||||
/* if (vsc_count == 6469) {
|
/* if (vsc_count == 6469) {
|
||||||
printf("Here I go\n");
|
printf("Here I go\n");
|
||||||
}
|
}
|
||||||
|
@ -252,7 +252,7 @@ IsStringTerm(Term string) /* checks whether this is a string */
|
|||||||
if (IsVarTerm(hd)) return(FALSE);
|
if (IsVarTerm(hd)) return(FALSE);
|
||||||
if (!IsIntTerm(hd)) return(FALSE);
|
if (!IsIntTerm(hd)) return(FALSE);
|
||||||
ch = IntOfTerm(HeadOfTerm(string));
|
ch = IntOfTerm(HeadOfTerm(string));
|
||||||
if (ch < 0 || ch > 255)
|
if ((ch < ' ' || ch > 255) && ch != '\n' && ch != '\t')
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
string = TailOfTerm(string);
|
string = TailOfTerm(string);
|
||||||
if (IsVarTerm(string)) return(FALSE);
|
if (IsVarTerm(string)) return(FALSE);
|
||||||
|
Reference in New Issue
Block a user