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,36 +2857,52 @@ 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);
#ifdef TABLING_INNER_CUTS if (body == MkAtomTerm(AtomTrue) &&
Yap_emit(nop_op, Zero, Zero, &cglobs.cint); !cglobs.vtable) {
cglobs->cut_mark = cpc; Yap_emit(procceed_op, Zero, Zero, &cglobs.cint);
#endif /* TABLING_INNER_CUTS */ /* ground term, do not need much more work */
Yap_emit(allocate_op, Zero, Zero, &cglobs.cint); if (cglobs.cint.BlobsStart != NULL) {
c_body(body, mod, &cglobs); cglobs.cint.cpc->nextInst = cglobs.cint.BlobsStart;
/* Insert blobs at the very end */ cglobs.cint.BlobsStart = NULL;
if (cglobs.cint.BlobsStart != NULL) { }
cglobs.cint.cpc->nextInst = cglobs.cint.BlobsStart; if (Yap_ErrorMessage)
cglobs.cint.BlobsStart = NULL; return (0);
}
reset_vars(cglobs.vtable);
H = HB;
if (B != NULL) {
HB = B->cp_h;
}
if (Yap_ErrorMessage)
return (0);
#ifdef DEBUG #ifdef DEBUG
if (Yap_Option['g' - 96]) if (Yap_Option['g' - 96])
Yap_ShowCode(&cglobs.cint); Yap_ShowCode(&cglobs.cint);
#endif #endif
/* phase 2: classify variables and optimize temporaries */ } else {
c_layout(&cglobs); #ifdef TABLING_INNER_CUTS
/* Insert blobs at the very end */ Yap_emit(nop_op, Zero, Zero, &cglobs.cint);
if (cglobs.cint.BlobsStart != NULL) { cglobs->cut_mark = cpc;
cglobs.cint.cpc->nextInst = cglobs.cint.BlobsStart; #endif /* TABLING_INNER_CUTS */
cglobs.cint.BlobsStart = NULL; Yap_emit(allocate_op, Zero, Zero, &cglobs.cint);
while (cglobs.cint.cpc->nextInst != NULL) c_body(body, mod, &cglobs);
cglobs.cint.cpc = cglobs.cint.cpc->nextInst; /* Insert blobs at the very end */
if (cglobs.cint.BlobsStart != NULL) {
cglobs.cint.cpc->nextInst = cglobs.cint.BlobsStart;
cglobs.cint.BlobsStart = NULL;
}
reset_vars(cglobs.vtable);
H = HB;
if (B != NULL) {
HB = B->cp_h;
}
if (Yap_ErrorMessage)
return (0);
#ifdef DEBUG
if (Yap_Option['g' - 96])
Yap_ShowCode(&cglobs.cint);
#endif
/* phase 2: classify variables and optimize temporaries */
c_layout(&cglobs);
/* Insert blobs at the very end */
if (cglobs.cint.BlobsStart != NULL) {
cglobs.cint.cpc->nextInst = cglobs.cint.BlobsStart;
cglobs.cint.BlobsStart = NULL;
while (cglobs.cint.cpc->nextInst != NULL)
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);