skip compilation steps for ground facts.

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1026 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc 2004-03-10 16:27:39 +00:00
parent 52f4e07c49
commit 5d79688b6b

View File

@ -11,8 +11,11 @@
* File: compiler.c * * File: compiler.c *
* comments: Clause compiler * * comments: Clause compiler *
* * * *
* Last rev: $Date: 2004-03-08 19:31:01 $,$Author: vsc $ * * Last rev: $Date: 2004-03-10 16:27:39 $,$Author: vsc $ *
* $Log: not supported by cvs2svn $ * * $Log: not supported by cvs2svn $
* Revision 1.48 2004/03/08 19:31:01 vsc
* move to 4.5.3
* *
* * * *
*************************************************************************/ *************************************************************************/
#ifdef SCCS #ifdef SCCS
@ -2854,6 +2857,21 @@ Yap_cclause(Term inp_clause, int NOfArgs, int mod, Term src)
} }
/* phase 1 : produce skeleton code and variable information */ /* phase 1 : produce skeleton code and variable information */
c_head(head, &cglobs); c_head(head, &cglobs);
if (body == MkAtomTerm(AtomTrue) &&
!cglobs.vtable) {
Yap_emit(procceed_op, Zero, Zero, &cglobs.cint);
/* ground term, do not need much more work */
if (cglobs.cint.BlobsStart != NULL) {
cglobs.cint.cpc->nextInst = cglobs.cint.BlobsStart;
cglobs.cint.BlobsStart = NULL;
}
if (Yap_ErrorMessage)
return (0);
#ifdef DEBUG
if (Yap_Option['g' - 96])
Yap_ShowCode(&cglobs.cint);
#endif
} else {
#ifdef TABLING_INNER_CUTS #ifdef TABLING_INNER_CUTS
Yap_emit(nop_op, Zero, Zero, &cglobs.cint); Yap_emit(nop_op, Zero, Zero, &cglobs.cint);
cglobs->cut_mark = cpc; cglobs->cut_mark = cpc;
@ -2885,6 +2903,7 @@ Yap_cclause(Term inp_clause, int NOfArgs, int mod, Term src)
while (cglobs.cint.cpc->nextInst != NULL) while (cglobs.cint.cpc->nextInst != NULL)
cglobs.cint.cpc = cglobs.cint.cpc->nextInst; cglobs.cint.cpc = cglobs.cint.cpc->nextInst;
} }
}
/* eliminate superfluous pop's and unify_var's */ /* eliminate superfluous pop's and unify_var's */
c_optimize(cglobs.cint.CodeStart); c_optimize(cglobs.cint.CodeStart);
#ifdef DEBUG #ifdef DEBUG