first cut at call counter.

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@580 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc
2002-09-03 14:28:09 +00:00
parent 89a188d5d7
commit 94e9529128
20 changed files with 459 additions and 16 deletions

View File

@@ -252,6 +252,8 @@ emit_cp_inst(compiler_vm_op op, yamop * Address, int Flag, int NClausesAfter)
indexed_code_for_cut = NIL;
if (op != try_op && profiling)
emit(retry_profiled_op, Unsigned(CurrentPred), Zero);
else if (op != try_op && call_counting)
emit(count_retry_op, Unsigned(CurrentPred), Zero);
if (NGroups == 1)
Flag = Flag | LoneGroup;
else if (Flag & LastGroup) {
@@ -1335,6 +1337,8 @@ PredIsIndexable(PredEntry *ap)
CurrentPred = ap;
if (CurrentPred->PredFlags & ProfiledPredFlag)
profiling = TRUE;
else if (CurrentPred->PredFlags & CountPredFlag)
call_counting = TRUE;
else
profiling = FALSE;
IPredArity = ap->ArityOfPE;