fix previous module processing fixes
check if predicate is not in use before abolish static git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@763 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
f59cc22c5d
commit
9a032b656a
@ -1279,7 +1279,7 @@ p_purge_clauses(void)
|
|||||||
RemoveIndexation(pred);
|
RemoveIndexation(pred);
|
||||||
Yap_PutValue(AtomAbol, MkAtomTerm(AtomTrue));
|
Yap_PutValue(AtomAbol, MkAtomTerm(AtomTrue));
|
||||||
q = pred->cs.p_code.FirstClause;
|
q = pred->cs.p_code.FirstClause;
|
||||||
in_use = static_in_use(pred,FALSE);
|
in_use = static_in_use(pred,TRUE);
|
||||||
if (q != NIL)
|
if (q != NIL)
|
||||||
do {
|
do {
|
||||||
q1 = q;
|
q1 = q;
|
||||||
@ -1845,6 +1845,12 @@ search_for_static_predicate_in_use(PredEntry *p, int check_everything)
|
|||||||
choiceptr b_ptr = B;
|
choiceptr b_ptr = B;
|
||||||
CELL *env_ptr = ENV;
|
CELL *env_ptr = ENV;
|
||||||
|
|
||||||
|
if (check_everything) {
|
||||||
|
PredEntry *pe = EnvPreg(P);
|
||||||
|
if (p == pe) return(TRUE);
|
||||||
|
pe = EnvPreg(CP);
|
||||||
|
if (p == pe) return(TRUE);
|
||||||
|
}
|
||||||
do {
|
do {
|
||||||
/* check first environments that are younger than our latest choicepoint */
|
/* check first environments that are younger than our latest choicepoint */
|
||||||
if (check_everything) {
|
if (check_everything) {
|
||||||
|
10
C/heapgc.c
10
C/heapgc.c
@ -3161,19 +3161,21 @@ Yap_gc(Int predarity, CELL *current_env, yamop *nextop)
|
|||||||
#endif
|
#endif
|
||||||
if (Yap_GetValue(AtomGc) != TermNil)
|
if (Yap_GetValue(AtomGc) != TermNil)
|
||||||
gc_on = TRUE;
|
gc_on = TRUE;
|
||||||
if (IsIntTerm(Tgc_margin = Yap_GetValue(AtomGcMargin)))
|
if (IsIntTerm(Tgc_margin = Yap_GetValue(AtomGcMargin))) {
|
||||||
gc_margin = IntOfTerm(Tgc_margin);
|
gc_margin = IntOfTerm(Tgc_margin);
|
||||||
else {
|
} else {
|
||||||
if (gc_calls < 8)
|
if (gc_calls < 8)
|
||||||
gc_margin <<= gc_calls;
|
gc_margin <<= gc_calls;
|
||||||
else
|
else
|
||||||
gc_margin <<= 8;
|
gc_margin <<= 8;
|
||||||
}
|
}
|
||||||
if (gc_margin < 0 || gc_margin > 4000)
|
if (gc_margin < 0 || gc_margin > 4000) {
|
||||||
gc_margin = (LCL0 - H0) >> 9;
|
gc_margin = (LCL0 - H0) >> 9;
|
||||||
|
}
|
||||||
gc_margin = gc_margin << 8;
|
gc_margin = gc_margin << 8;
|
||||||
if (gc_on)
|
if (gc_on) {
|
||||||
effectiveness = do_gc(predarity, current_env, nextop);
|
effectiveness = do_gc(predarity, current_env, nextop);
|
||||||
|
}
|
||||||
if (effectiveness > 90) {
|
if (effectiveness > 90) {
|
||||||
while (gc_margin < H-H0)
|
while (gc_margin < H-H0)
|
||||||
gc_margin <<= 1;
|
gc_margin <<= 1;
|
||||||
|
14
C/tracer.c
14
C/tracer.c
@ -112,14 +112,16 @@ low_level_trace(yap_low_level_port port, PredEntry *pred, CELL *args)
|
|||||||
|
|
||||||
vsc_count++;
|
vsc_count++;
|
||||||
/* return;*/
|
/* return;*/
|
||||||
/* if (vsc_count < 38372100LL) return;*/
|
#ifdef COMMENTED
|
||||||
/* if (vsc_count == 80) {
|
if (vsc_count < 414040LL) return;
|
||||||
|
if (vsc_count == 414140LL) {
|
||||||
printf("Here I go\n");
|
printf("Here I go\n");
|
||||||
} */
|
}
|
||||||
/* if (vsc_count > 500000) exit(0); */
|
if (vsc_count > 500000) exit(0);
|
||||||
/* if (gc_calls < 1) return; */
|
if (gc_calls < 1) return;
|
||||||
|
#endif
|
||||||
#if defined(__GNUC__)
|
#if defined(__GNUC__)
|
||||||
fprintf(Yap_stderr,"%llu %p", vsc_count, B);
|
fprintf(Yap_stderr,"%llu ", vsc_count);
|
||||||
#endif
|
#endif
|
||||||
/* check_trail_consistency(); */
|
/* check_trail_consistency(); */
|
||||||
if (pred == NULL) {
|
if (pred == NULL) {
|
||||||
|
@ -423,9 +423,9 @@ module(N) :-
|
|||||||
'$system_predicate'(G,M), !,
|
'$system_predicate'(G,M), !,
|
||||||
'$c_built_in'(G,M,Gi),
|
'$c_built_in'(G,M,Gi),
|
||||||
(Gi \== G ->
|
(Gi \== G ->
|
||||||
'$module_expansion'(Gi,Gi,G2,M,CM,TM,HVars) ;
|
'$module_expansion'(Gi,Gi,G2,M,CM,TM,HVars)
|
||||||
TM = M ->
|
; TM = M ->
|
||||||
G2 = G, G1 = G,
|
G2 = G, G1 = G
|
||||||
;
|
;
|
||||||
G2 = M:G, G1 = M:G % atts:
|
G2 = M:G, G1 = M:G % atts:
|
||||||
).
|
).
|
||||||
|
Reference in New Issue
Block a user