From 1e78b948ddbc61ad73e4b7c51bbcaa374f87544d Mon Sep 17 00:00:00 2001 From: vsc Date: Wed, 8 Nov 2006 01:53:08 +0000 Subject: [PATCH] avoid generating suspensions on static code. git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1714 b08c6af1-5177-4d33-ba66-4b1c6b8b522a --- C/index.c | 39 ++++++++++++++++++++++++++++++--------- C/tracer.c | 2 -- 2 files changed, 30 insertions(+), 11 deletions(-) diff --git a/C/index.c b/C/index.c index f2080a516..5b6dc186f 100644 --- a/C/index.c +++ b/C/index.c @@ -11,8 +11,11 @@ * File: index.c * * comments: Indexing a Prolog predicate * * * -* Last rev: $Date: 2006-11-06 18:35:04 $,$Author: vsc $ * +* Last rev: $Date: 2006-11-08 01:53:08 $,$Author: vsc $ * * $Log: not supported by cvs2svn $ +* Revision 1.175 2006/11/06 18:35:04 vsc +* 1estranha +* * Revision 1.174 2006/10/25 02:31:07 vsc * fix emulation of trust_logical * @@ -3903,7 +3906,8 @@ static UInt do_var_entries(GroupDef *grp, Term t, struct intermediates *cint, UInt argno, int first, int clleft, UInt nxtlbl){ PredEntry *ap = cint->CurrentPred; - if (!IsVarTerm(t) || t != 0L) { + if ((!IsVarTerm(t) || t != 0L) && + yap_flags[INDEXING_MODE_FLAG] != INDEX_MODE_SINGLE) { return suspend_indexing(grp->FirstClause, grp->LastClause, ap, cint); } return do_var_group(grp, cint, FALSE, first, clleft, nxtlbl, ap->ArityOfPE+1); @@ -3938,12 +3942,21 @@ do_consts(GroupDef *grp, Term t, struct intermediates *cint, int compound_term, max != grp->LastClause) max++; if (min != max) { if (sreg != NULL) { - if (ap->PredFlags & LogUpdatePredFlag && max > min) - ics->Label = suspend_indexing(min, max, ap, cint); - else - ics->Label = do_compound_index(min, max, sreg, cint, compound_term, arity, argno, nxtlbl, first, last_arg, clleft, top, TRUE); + if (ap->PredFlags & LogUpdatePredFlag && max > min) { + if (yap_flags[INDEXING_MODE_FLAG] == INDEX_MODE_SINGLE) { + ics->Label = do_index(min, max, cint, ap->ArityOfPE+1, nxtlbl, first, clleft, top); + } else { + ics->Label = suspend_indexing(min, max, ap, cint); + } + } else { + ics->Label = do_compound_index(min, max, sreg, cint, compound_term, arity, argno, nxtlbl, first, last_arg, clleft, top, TRUE); + } } else if (ap->PredFlags & LogUpdatePredFlag) { - ics->Label = suspend_indexing(min, max, cint->CurrentPred, cint); + if (yap_flags[INDEXING_MODE_FLAG] == INDEX_MODE_SINGLE) { + ics->Label = do_index(min, max, cint, ap->ArityOfPE+1, nxtlbl, first, clleft, top); + } else { + ics->Label = suspend_indexing(min, max, cint->CurrentPred, cint); + } } else { ics->Label = do_index(min, max, cint, argno+1, nxtlbl, first, clleft, top); } @@ -3977,7 +3990,11 @@ do_blobs(GroupDef *grp, Term t, struct intermediates *cint, UInt argno, int firs max != grp->LastClause) max++; if (min != max && (ap->PredFlags & LogUpdatePredFlag)) { - ics->Label = suspend_indexing(min, max, ap, cint); + if (yap_flags[INDEXING_MODE_FLAG] == INDEX_MODE_SINGLE) { + ics->Label = do_index(min, max, cint, ap->ArityOfPE+1, nxtlbl, first, clleft, top); + } else { + ics->Label = suspend_indexing(min, max, ap, cint); + } } else { ics->Label = do_index(min, max, cint, argno+1, nxtlbl, first, clleft, top); } @@ -4060,7 +4077,11 @@ do_pair(GroupDef *grp, Term t, struct intermediates *cint, UInt argno, int first return (UInt)(min->CurrentCode); } if (min != max && !IsPairTerm(t)) { - return suspend_indexing(min, max, cint->CurrentPred, cint); + if (yap_flags[INDEXING_MODE_FLAG] == INDEX_MODE_SINGLE) { + return do_index(min, max, cint, cint->CurrentPred->ArityOfPE+1, nxtlbl, first, clleft, top); + } else { + return suspend_indexing(min, max, cint->CurrentPred, cint); + } } return do_compound_index(min, max, (IsPairTerm(t) ? RepPair(t) : NULL), cint, 0, 2, argno, nxtlbl, first, last_arg, clleft, top, TRUE); } diff --git a/C/tracer.c b/C/tracer.c index 765cd4553..0c2c9c9bf 100644 --- a/C/tracer.c +++ b/C/tracer.c @@ -161,8 +161,6 @@ low_level_trace(yap_low_level_port port, PredEntry *pred, CELL *args) LOCK(Yap_heap_regs->low_level_trace_lock); sc = Yap_heap_regs; vsc_count++; - if (vsc_count < 59000) - return; #ifdef COMMENTED if (worker_id != 04 || worker_id != 03) return; // if (vsc_count == 218280)