disable cache when checking whether static was in use.
heap overflow while storing db term. trust_fail should be preceeded by an sla. make sla point to current pred, get rid of current pred in bitmap. git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@374 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
d605213a38
commit
c771c14b0f
@ -5671,7 +5671,7 @@ absmi(int inp)
|
|||||||
#endif /* FROZEN_REGS */
|
#endif /* FROZEN_REGS */
|
||||||
#ifdef LOW_LEVEL_TRACER
|
#ifdef LOW_LEVEL_TRACER
|
||||||
if (do_low_level_trace)
|
if (do_low_level_trace)
|
||||||
low_level_trace(enter_pred,(PredEntry *)(PREG->u.sla.p),XREGS+1);
|
low_level_trace(enter_pred,PREG->u.sla.p,XREGS+1);
|
||||||
#endif /* LOW_LEVEL_TRACE */
|
#endif /* LOW_LEVEL_TRACE */
|
||||||
BEGD(d0);
|
BEGD(d0);
|
||||||
d0 = (CELL) (PREG->u.sla.l);
|
d0 = (CELL) (PREG->u.sla.l);
|
||||||
@ -5711,15 +5711,15 @@ absmi(int inp)
|
|||||||
#endif /* FROZEN_REGS */
|
#endif /* FROZEN_REGS */
|
||||||
#ifdef LOW_LEVEL_TRACER
|
#ifdef LOW_LEVEL_TRACER
|
||||||
if (do_low_level_trace)
|
if (do_low_level_trace)
|
||||||
low_level_trace(enter_pred,(PredEntry *)(PREG->u.sla.p),XREGS+1);
|
low_level_trace(enter_pred,PREG->u.sla.p,XREGS+1);
|
||||||
#endif /* LOW_LEVEL_TRACE */
|
#endif /* LOW_LEVEL_TRACE */
|
||||||
{
|
{
|
||||||
CODEADDR p = PREG->u.sla.p;
|
PredEntry *p = PREG->u.sla.p;
|
||||||
PREG = NEXTOP(PREG, sla);
|
PREG = NEXTOP(PREG, sla);
|
||||||
saveregs();
|
saveregs();
|
||||||
save_machine_regs();
|
save_machine_regs();
|
||||||
|
|
||||||
SREG = (CELL *) YapExecute((CPredicate)(((PredEntry *)p)->TrueCodeOfPred));
|
SREG = (CELL *) YapExecute((CPredicate)(p->TrueCodeOfPred));
|
||||||
}
|
}
|
||||||
|
|
||||||
restore_machine_regs();
|
restore_machine_regs();
|
||||||
|
10
C/alloc.c
10
C/alloc.c
@ -12,7 +12,7 @@
|
|||||||
* Last rev: *
|
* Last rev: *
|
||||||
* mods: *
|
* mods: *
|
||||||
* comments: allocating space *
|
* comments: allocating space *
|
||||||
* version:$Id: alloc.c,v 1.13 2002-02-22 06:12:18 vsc Exp $ *
|
* version:$Id: alloc.c,v 1.14 2002-02-26 15:51:54 vsc Exp $ *
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
#ifdef SCCS
|
#ifdef SCCS
|
||||||
static char SccsId[] = "%W% %G%";
|
static char SccsId[] = "%W% %G%";
|
||||||
@ -140,6 +140,10 @@ FreeBlock(BlockHeader *b)
|
|||||||
|
|
||||||
/* sanity check */
|
/* sanity check */
|
||||||
sp = &(b->b_size) + (b->b_size & ~InUseFlag);
|
sp = &(b->b_size) + (b->b_size & ~InUseFlag);
|
||||||
|
if (Addr(b) <= 0x90c7a24 && sp >= 0x90c7a24) {
|
||||||
|
extern int do_low_level_trace;
|
||||||
|
fprintf(stderr,"vsc: Here3\n");
|
||||||
|
}
|
||||||
if (*sp != b->b_size) {
|
if (*sp != b->b_size) {
|
||||||
#if !SHORT_INTS
|
#if !SHORT_INTS
|
||||||
YP_fprintf(YP_stderr, "** sanity check failed in FreeBlock %p %x %x\n",
|
YP_fprintf(YP_stderr, "** sanity check failed in FreeBlock %p %x %x\n",
|
||||||
@ -229,6 +233,8 @@ AllocHeap(unsigned int size)
|
|||||||
b->b_size |= InUseFlag;
|
b->b_size |= InUseFlag;
|
||||||
UNLOCK(GLOBAL_LOCKS_alloc_block);
|
UNLOCK(GLOBAL_LOCKS_alloc_block);
|
||||||
UNLOCK(FreeBlocksLock);
|
UNLOCK(FreeBlocksLock);
|
||||||
|
if (Addr(b) <= 0x90c7a24 && Addr(b)+(size*sizeof(CELL)+sizeof(YAP_SEG_SIZE)) >= 0x90c7a24)
|
||||||
|
fprintf(stderr,"vsc: Here1\n");
|
||||||
return (Addr(b) + sizeof(YAP_SEG_SIZE));
|
return (Addr(b) + sizeof(YAP_SEG_SIZE));
|
||||||
}
|
}
|
||||||
UNLOCK(FreeBlocksLock);
|
UNLOCK(FreeBlocksLock);
|
||||||
@ -291,6 +297,8 @@ AllocHeap(unsigned int size)
|
|||||||
if (!HEAPTOP_OWNER(worker_id)) {
|
if (!HEAPTOP_OWNER(worker_id)) {
|
||||||
UNLOCK(HeapTopLock);
|
UNLOCK(HeapTopLock);
|
||||||
}
|
}
|
||||||
|
if (Addr(b) <= 0x90c7a24 && Addr(b)+(size*sizeof(CELL)+sizeof(YAP_SEG_SIZE)) >= 0x90c7a24)
|
||||||
|
fprintf(stderr,"vsc: Here2\nn");
|
||||||
return (Addr(b) + sizeof(YAP_SEG_SIZE));
|
return (Addr(b) + sizeof(YAP_SEG_SIZE));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
28
C/amasm.c
28
C/amasm.c
@ -37,7 +37,7 @@ STATIC_PROTO(AREG emit_xreg2, (void));
|
|||||||
STATIC_PROTO(AREG emit_x, (CELL));
|
STATIC_PROTO(AREG emit_x, (CELL));
|
||||||
STATIC_PROTO(YREG emit_y, (Ventry *));
|
STATIC_PROTO(YREG emit_y, (Ventry *));
|
||||||
STATIC_PROTO(CODEADDR emit_a, (CELL));
|
STATIC_PROTO(CODEADDR emit_a, (CELL));
|
||||||
STATIC_PROTO(CODEADDR emit_bmlabel, (CELL));
|
STATIC_PROTO(CELL *emit_bmlabel, (CELL));
|
||||||
STATIC_PROTO(CODEADDR emit_ilabel, (CELL));
|
STATIC_PROTO(CODEADDR emit_ilabel, (CELL));
|
||||||
STATIC_PROTO(Functor emit_f, (CELL));
|
STATIC_PROTO(Functor emit_f, (CELL));
|
||||||
STATIC_PROTO(CELL emit_c, (CELL));
|
STATIC_PROTO(CELL emit_c, (CELL));
|
||||||
@ -259,10 +259,10 @@ emit_ilabel(register CELL addr)
|
|||||||
return (emit_a(addr));
|
return (emit_a(addr));
|
||||||
}
|
}
|
||||||
|
|
||||||
inline static CODEADDR
|
inline static CELL *
|
||||||
emit_bmlabel(register CELL addr)
|
emit_bmlabel(register CELL addr)
|
||||||
{
|
{
|
||||||
return (emit_a(Unsigned(code_addr) + label_offset[addr]));
|
return ((CELL *)(emit_a(Unsigned(code_addr) + label_offset[addr])));
|
||||||
}
|
}
|
||||||
|
|
||||||
inline static Functor
|
inline static Functor
|
||||||
@ -781,13 +781,13 @@ a_p(op_numbers opcode)
|
|||||||
* (cpc->rnd2));
|
* (cpc->rnd2));
|
||||||
code_p->u.sla.l = emit_a((CELL)
|
code_p->u.sla.l = emit_a((CELL)
|
||||||
RepPredProp(fe)->TrueCodeOfPred);
|
RepPredProp(fe)->TrueCodeOfPred);
|
||||||
code_p->u.sla.p = emit_a((CELL)
|
code_p->u.sla.p = RepPredProp(fe);
|
||||||
RepPredProp(fe));
|
code_p->u.sla.p0 = CurrentPred;
|
||||||
if (cpc->rnd2)
|
if (cpc->rnd2)
|
||||||
code_p->u.sla.l2 = emit_bmlabel(cpc->arnds[1]);
|
code_p->u.sla.l2 = emit_bmlabel(cpc->arnds[1]);
|
||||||
else
|
else
|
||||||
/* there is no bitmap as there are no variables in the environment */
|
/* there is no bitmap as there are no variables in the environment */
|
||||||
code_p->u.sla.l2 = (CELL)NIL;
|
code_p->u.sla.l2 = NULL;
|
||||||
}
|
}
|
||||||
GONEXT(sla);
|
GONEXT(sla);
|
||||||
}
|
}
|
||||||
@ -818,13 +818,13 @@ a_p(op_numbers opcode)
|
|||||||
cpc->rnd2);
|
cpc->rnd2);
|
||||||
code_p->u.sla.l = emit_a((CELL) &
|
code_p->u.sla.l = emit_a((CELL) &
|
||||||
RepPredProp(fe)->StateOfPred);
|
RepPredProp(fe)->StateOfPred);
|
||||||
code_p->u.sla.p = emit_a((CELL)
|
code_p->u.sla.p = RepPredProp(fe);
|
||||||
RepPredProp(fe));
|
code_p->u.sla.p0 = CurrentPred;
|
||||||
if (cpc->rnd2)
|
if (cpc->rnd2)
|
||||||
code_p->u.sla.l2 = emit_bmlabel(cpc->arnds[1]);
|
code_p->u.sla.l2 = emit_bmlabel(cpc->arnds[1]);
|
||||||
else
|
else
|
||||||
/* there is no bitmap as there are no variables in the environment */
|
/* there is no bitmap as there are no variables in the environment */
|
||||||
code_p->u.sla.l2 = (CELL)NIL;
|
code_p->u.sla.l2 = NULL;
|
||||||
}
|
}
|
||||||
GONEXT(sla);
|
GONEXT(sla);
|
||||||
}
|
}
|
||||||
@ -862,12 +862,13 @@ a_empty_call(void)
|
|||||||
code_p->u.sla.s = emit_count(-Signed(RealEnvSize) - CELLSIZE *
|
code_p->u.sla.s = emit_count(-Signed(RealEnvSize) - CELLSIZE *
|
||||||
cpc->rnd2);
|
cpc->rnd2);
|
||||||
code_p->u.sla.l = emit_a((CELL)&(pe->StateOfPred));
|
code_p->u.sla.l = emit_a((CELL)&(pe->StateOfPred));
|
||||||
code_p->u.sla.p = emit_a((CELL)pe);
|
code_p->u.sla.p = pe;
|
||||||
|
code_p->u.sla.p0 = CurrentPred;
|
||||||
if (cpc->rnd2)
|
if (cpc->rnd2)
|
||||||
code_p->u.sla.l2 = emit_bmlabel(cpc->rnd1);
|
code_p->u.sla.l2 = emit_bmlabel(cpc->rnd1);
|
||||||
else
|
else
|
||||||
/* there is no bitmap as there are no variables in the environment */
|
/* there is no bitmap as there are no variables in the environment */
|
||||||
code_p->u.sla.l2 = (CELL)NIL;
|
code_p->u.sla.l2 = NULL;
|
||||||
}
|
}
|
||||||
GONEXT(sla);
|
GONEXT(sla);
|
||||||
}
|
}
|
||||||
@ -1189,8 +1190,8 @@ a_either(op_numbers opcode, CELL opr, CELL lab)
|
|||||||
code_p->u.sla.s = emit_count(opr);
|
code_p->u.sla.s = emit_count(opr);
|
||||||
code_p->u.sla.l = emit_a(lab);
|
code_p->u.sla.l = emit_a(lab);
|
||||||
/* use code for atom true so that we won't try to do anything smart */
|
/* use code for atom true so that we won't try to do anything smart */
|
||||||
code_p->u.sla.p = emit_a((CELL)
|
code_p->u.sla.p = RepPredProp(fe);
|
||||||
RepPredProp(fe));;
|
code_p->u.sla.p0 = CurrentPred;
|
||||||
#ifdef YAPOR
|
#ifdef YAPOR
|
||||||
/* code_p->u.sla.p = (CODEADDR)CurrentPred; */
|
/* code_p->u.sla.p = (CODEADDR)CurrentPred; */
|
||||||
INIT_YAMOP_LTT(code_p, nofalts);
|
INIT_YAMOP_LTT(code_p, nofalts);
|
||||||
@ -1408,7 +1409,6 @@ a_bmap(void)
|
|||||||
{
|
{
|
||||||
/* how much space do we need to reserve */
|
/* how much space do we need to reserve */
|
||||||
int i, max = (cpc->rnd1)/(8*sizeof(CELL));
|
int i, max = (cpc->rnd1)/(8*sizeof(CELL));
|
||||||
fill_a((CELL)CurrentPred);
|
|
||||||
for (i = 0; i <= max; i++) fill_a(cpc->arnds[i]);
|
for (i = 0; i <= max; i++) fill_a(cpc->arnds[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1533,7 +1533,7 @@ p_assign_static(void)
|
|||||||
if (ref != NULL) {
|
if (ref != NULL) {
|
||||||
ReleaseTermFromDB(ref);
|
ReleaseTermFromDB(ref);
|
||||||
}
|
}
|
||||||
ptr->ValueOfVE.terms[indx] = StoreTermInDB(t3,3);
|
ptr->ValueOfVE.terms[indx] = StoreTermInDB(3,3);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
4
C/bb.c
4
C/bb.c
@ -257,7 +257,7 @@ p_bb_put(void)
|
|||||||
if (p->Element != NULL) {
|
if (p->Element != NULL) {
|
||||||
ReleaseTermFromDB(p->Element);
|
ReleaseTermFromDB(p->Element);
|
||||||
}
|
}
|
||||||
p->Element = StoreTermInDB(Deref(ARG2),3);
|
p->Element = StoreTermInDB(2,2);
|
||||||
WRITE_UNLOCK(p->BBRWLock);
|
WRITE_UNLOCK(p->BBRWLock);
|
||||||
return(p->Element != NULL);
|
return(p->Element != NULL);
|
||||||
}
|
}
|
||||||
@ -312,7 +312,7 @@ p_bb_update(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ReleaseTermFromDB(p->Element);
|
ReleaseTermFromDB(p->Element);
|
||||||
p->Element = StoreTermInDB(Deref(ARG3),3);
|
p->Element = StoreTermInDB(3,3);
|
||||||
|
|
||||||
WRITE_UNLOCK(p->BBRWLock);
|
WRITE_UNLOCK(p->BBRWLock);
|
||||||
return(TRUE);
|
return(TRUE);
|
||||||
|
89
C/cdmgr.c
89
C/cdmgr.c
@ -1135,8 +1135,8 @@ init_consult(int mode, char *file)
|
|||||||
ConsultSp->c = (ConsultBase-ConsultSp);
|
ConsultSp->c = (ConsultBase-ConsultSp);
|
||||||
ConsultBase = ConsultSp;
|
ConsultBase = ConsultSp;
|
||||||
#if !defined(YAPOR) && !defined(SBA)
|
#if !defined(YAPOR) && !defined(SBA)
|
||||||
if (consult_level == 0)
|
/* if (consult_level == 0)
|
||||||
do_toggle_static_predicates_in_use(TRUE);
|
do_toggle_static_predicates_in_use(TRUE); */
|
||||||
#endif
|
#endif
|
||||||
consult_level++;
|
consult_level++;
|
||||||
}
|
}
|
||||||
@ -1187,8 +1187,8 @@ end_consult(void)
|
|||||||
ConsultSp += 3;
|
ConsultSp += 3;
|
||||||
consult_level--;
|
consult_level--;
|
||||||
#if !defined(YAPOR) && !defined(SBA)
|
#if !defined(YAPOR) && !defined(SBA)
|
||||||
if (consult_level == 0)
|
/* if (consult_level == 0)
|
||||||
do_toggle_static_predicates_in_use(FALSE);
|
do_toggle_static_predicates_in_use(FALSE);*/
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1749,9 +1749,9 @@ search_for_static_predicate_in_use(PredEntry *p, int check_everything)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
#ifdef YAPOR
|
#ifdef YAPOR
|
||||||
pe = PredFromOr(b_ptr->cp_cp->u.ldl.bl);
|
pe = b_ptr->cp_cp->u.ldl.p;
|
||||||
#else
|
#else
|
||||||
pe = PredFromOr(b_ptr->cp_cp->u.sla.l2);
|
pe = b_ptr->cp_cp->u.sla.p0;
|
||||||
#endif /* YAPOR */
|
#endif /* YAPOR */
|
||||||
break;
|
break;
|
||||||
case _retry_profiled:
|
case _retry_profiled:
|
||||||
@ -1797,6 +1797,18 @@ mark_pred(int mark, PredEntry *pe)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef ANALYST
|
||||||
|
|
||||||
|
static char *op_names[_std_top + 1] =
|
||||||
|
{
|
||||||
|
#define OPCODE(OP,TYPE) #OP
|
||||||
|
#include "YapOpcodes.h"
|
||||||
|
#undef OPCODE
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* go up the chain of choice_points and environments,
|
/* go up the chain of choice_points and environments,
|
||||||
marking all static predicates that current execution is depending
|
marking all static predicates that current execution is depending
|
||||||
upon */
|
upon */
|
||||||
@ -1808,13 +1820,72 @@ do_toggle_static_predicates_in_use(int mask)
|
|||||||
|
|
||||||
if (b_ptr == NULL)
|
if (b_ptr == NULL)
|
||||||
return;
|
return;
|
||||||
|
{
|
||||||
|
op_numbers opnum;
|
||||||
|
register OPCODE op;
|
||||||
|
op = b_ptr->cp_ap->opc;
|
||||||
|
opnum = op_from_opcode(op);
|
||||||
|
if (1) {
|
||||||
|
switch (opnum) {
|
||||||
|
case _or_else:
|
||||||
|
case _or_last:
|
||||||
|
case _Nstop:
|
||||||
|
case _switch_last:
|
||||||
|
case _switch_l_list:
|
||||||
|
case _retry_c:
|
||||||
|
case _retry_userc:
|
||||||
|
case _trust_logical_pred:
|
||||||
|
case _retry_profiled:
|
||||||
|
{
|
||||||
|
Atom at;
|
||||||
|
Int arity;
|
||||||
|
SMALLUNSGN mod;
|
||||||
|
if (PredForCode((CODEADDR)b_ptr->cp_ap, &at, &arity, &mod)) {
|
||||||
|
if (arity)
|
||||||
|
YP_fprintf(YP_stderr,"CP %s/%d (%s)\n", RepAtom(at)->StrOfAE, arity, op_names[opnum]);
|
||||||
|
else
|
||||||
|
YP_fprintf(YP_stderr,"CP %s (%s)\n", RepAtom(at)->StrOfAE, op_names[opnum]);
|
||||||
|
} else
|
||||||
|
YP_fprintf(YP_stderr,"CP (%s)\n", op_names[opnum]);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
PredEntry *pe = (PredEntry *)b_ptr->cp_ap->u.ld.p;
|
||||||
|
if (pe == NULL) {
|
||||||
|
YP_fprintf(YP_stderr,"CP (%s)\n", op_names[opnum]);
|
||||||
|
} else
|
||||||
|
if (pe->ArityOfPE)
|
||||||
|
YP_fprintf(YP_stderr,"CP %s/%d (%s)\n", RepAtom(NameOfFunctor(pe->FunctorOfPred))->StrOfAE, pe->ArityOfPE, op_names[opnum]);
|
||||||
|
else
|
||||||
|
YP_fprintf(YP_stderr,"CP %d (%s)\n", RepAtom((Atom)(pe->FunctorOfPred))->StrOfAE, op_names[opnum]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
do {
|
do {
|
||||||
PredEntry *pe;
|
PredEntry *pe;
|
||||||
/* check first environments that are younger than our latest choicepoint */
|
/* check first environments that are younger than our latest choicepoint */
|
||||||
while (b_ptr > (choiceptr)env_ptr) {
|
while (b_ptr > (choiceptr)env_ptr) {
|
||||||
PredEntry *pe = EnvPreg(env_ptr[E_CP]);
|
PredEntry *pe = EnvPreg(env_ptr[E_CP]);
|
||||||
if (pe != NULL)
|
|
||||||
|
if (pe != NULL && FALSE) {
|
||||||
|
op_numbers op = op_from_opcode(ENV_ToOp(env_ptr[E_CP]));
|
||||||
|
if (pe->ArityOfPE)
|
||||||
|
YP_fprintf(YP_stderr,"ENV %p %s/%d %s\n", env_ptr, RepAtom(NameOfFunctor(pe->FunctorOfPred))->StrOfAE, pe->ArityOfPE, op_names[op]);
|
||||||
|
else
|
||||||
|
YP_fprintf(YP_stderr,"ENV %p %s %s\n", env_ptr, RepAtom((Atom)(pe->FunctorOfPred))->StrOfAE, op_names[op]);
|
||||||
|
if (env_ptr == 0x21d0b24) {
|
||||||
|
CELL *next_ee = (CELL *)(env_ptr[E_E]);
|
||||||
|
do {
|
||||||
|
YP_fprintf(YP_stderr,"looking for parent %p with CP %x value %x\n", next_ee, next_ee[E_CP], EnvPreg(next_ee[E_CP]));
|
||||||
|
next_ee = (CELL *)(next_ee[E_E]);
|
||||||
|
} while (next_ee != 0x21d0f28);
|
||||||
|
}
|
||||||
|
|
||||||
mark_pred(mask, pe);
|
mark_pred(mask, pe);
|
||||||
|
}
|
||||||
env_ptr = (CELL *)(env_ptr[E_E]);
|
env_ptr = (CELL *)(env_ptr[E_E]);
|
||||||
}
|
}
|
||||||
/* now mark the choicepoint */
|
/* now mark the choicepoint */
|
||||||
@ -1827,9 +1898,9 @@ do_toggle_static_predicates_in_use(int mask)
|
|||||||
case _or_else:
|
case _or_else:
|
||||||
case _or_last:
|
case _or_last:
|
||||||
#ifdef YAPOR
|
#ifdef YAPOR
|
||||||
pe = PredFromOr(b_ptr->cp_cp->u.ldl.bl);
|
pe = b_ptr->cp_cp->u.ldl.p;
|
||||||
#else
|
#else
|
||||||
pe = PredFromOr(b_ptr->cp_cp->u.sla.l2);
|
pe = b_ptr->cp_cp->u.sla.p0;
|
||||||
#endif /* YAPOR */
|
#endif /* YAPOR */
|
||||||
break;
|
break;
|
||||||
case _Nstop:
|
case _Nstop:
|
||||||
|
17
C/dbase.c
17
C/dbase.c
@ -3191,7 +3191,7 @@ find_next_clause(DBRef ref0)
|
|||||||
static Int
|
static Int
|
||||||
jump_to_next_dynamic_clause(void)
|
jump_to_next_dynamic_clause(void)
|
||||||
{
|
{
|
||||||
DBRef ref = (DBRef)(DBRef)(((yamop *)((CODEADDR)P-(CELL)NEXTOP((yamop *)NIL,sla)))->u.sla.l2);
|
DBRef ref = (DBRef)(((yamop *)((CODEADDR)P-(CELL)NEXTOP((yamop *)NIL,sla)))->u.sla.l2);
|
||||||
yamop *newp = find_next_clause(ref);
|
yamop *newp = find_next_clause(ref);
|
||||||
|
|
||||||
if (newp == (yamop *)NULL) {
|
if (newp == (yamop *)NULL) {
|
||||||
@ -3493,7 +3493,7 @@ PrepareToEraseClause(Clause *clau, DBRef dbr)
|
|||||||
out what is the next clause, if there is one */
|
out what is the next clause, if there is one */
|
||||||
code_p->opc = opcode(_call_cpred);
|
code_p->opc = opcode(_call_cpred);
|
||||||
code_p->u.sla.l = (CODEADDR)(&jump_to_next_dynamic_clause);
|
code_p->u.sla.l = (CODEADDR)(&jump_to_next_dynamic_clause);
|
||||||
code_p->u.sla.l2 = (CODEADDR)(dbr);
|
code_p->u.sla.l2 = (CELL *)(dbr);
|
||||||
#endif /* DISCONNECT_OLD_ENTRIES */
|
#endif /* DISCONNECT_OLD_ENTRIES */
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3881,9 +3881,10 @@ ReleaseTermFromDB(DBRef ref)
|
|||||||
}
|
}
|
||||||
|
|
||||||
DBRef
|
DBRef
|
||||||
StoreTermInDB(Term t, int nargs)
|
StoreTermInDB(int arg, int nargs)
|
||||||
{
|
{
|
||||||
DBRef x;
|
DBRef x;
|
||||||
|
Term t = Deref(XREGS[arg]);
|
||||||
|
|
||||||
while ((x = CreateDBStruct(t, (DBProp)NIL,
|
while ((x = CreateDBStruct(t, (DBProp)NIL,
|
||||||
InQueue)) == NULL) {
|
InQueue)) == NULL) {
|
||||||
@ -3897,8 +3898,10 @@ StoreTermInDB(Term t, int nargs)
|
|||||||
if (!gc(nargs, ENV, P)) {
|
if (!gc(nargs, ENV, P)) {
|
||||||
Error(SYSTEM_ERROR, TermNil, "YAP could not grow stack in enqueue/2");
|
Error(SYSTEM_ERROR, TermNil, "YAP could not grow stack in enqueue/2");
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
} else
|
} else {
|
||||||
|
t = Deref(XREGS[arg]);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case TOVF_ERROR_IN_DB:
|
case TOVF_ERROR_IN_DB:
|
||||||
Error(SYSTEM_ERROR, TermNil, "YAP could not grow trail in recorda/3");
|
Error(SYSTEM_ERROR, TermNil, "YAP could not grow trail in recorda/3");
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
@ -3906,8 +3909,10 @@ StoreTermInDB(Term t, int nargs)
|
|||||||
if (!growheap(FALSE)) {
|
if (!growheap(FALSE)) {
|
||||||
Error(SYSTEM_ERROR, TermNil, "YAP could not grow heap in enqueue/2");
|
Error(SYSTEM_ERROR, TermNil, "YAP could not grow heap in enqueue/2");
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
} else
|
} else {
|
||||||
|
t = Deref(XREGS[arg]);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
Error(DBErrorNumber, DBErrorTerm, DBErrorMsg);
|
Error(DBErrorNumber, DBErrorTerm, DBErrorMsg);
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
@ -3962,7 +3967,7 @@ p_enqueue(void)
|
|||||||
return(FALSE);
|
return(FALSE);
|
||||||
} else
|
} else
|
||||||
father_key = (db_queue *)DBRefOfTerm(Father);
|
father_key = (db_queue *)DBRefOfTerm(Father);
|
||||||
x = StoreTermInDB(Deref(ARG2), 2);
|
x = StoreTermInDB(2, 2);
|
||||||
x->Parent = NULL;
|
x->Parent = NULL;
|
||||||
WRITE_LOCK(father_key->QRWLock);
|
WRITE_LOCK(father_key->QRWLock);
|
||||||
if (father_key->LastInQueue != NULL)
|
if (father_key->LastInQueue != NULL)
|
||||||
|
18
C/errors.c
18
C/errors.c
@ -151,7 +151,7 @@ DumpActiveGoals (void)
|
|||||||
#ifdef YAPOR
|
#ifdef YAPOR
|
||||||
pe = PredFromOr(b_ptr->cp_cp->u.ldl.bl);
|
pe = PredFromOr(b_ptr->cp_cp->u.ldl.bl);
|
||||||
#else
|
#else
|
||||||
pe = PredFromOr(b_ptr->cp_cp->u.sla.l2);
|
pe = b_ptr->cp_cp->u.sla.p0;
|
||||||
#endif /* YAPOR */
|
#endif /* YAPOR */
|
||||||
break;
|
break;
|
||||||
case _retry_profiled:
|
case _retry_profiled:
|
||||||
@ -200,6 +200,7 @@ exit_yap (int value)
|
|||||||
exit(value);
|
exit(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
detect_bug_location(char *tp, int psize)
|
detect_bug_location(char *tp, int psize)
|
||||||
{
|
{
|
||||||
@ -288,6 +289,21 @@ detect_bug_location(char *tp, int psize)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
void
|
||||||
|
bug_location(yamop *pc)
|
||||||
|
{
|
||||||
|
yamop *oldp = pc;
|
||||||
|
P = pc;
|
||||||
|
detect_bug_location((char *)H, 256);
|
||||||
|
P = oldp;
|
||||||
|
fprintf(stderr,"%s\n",(char *)H);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* This needs to be a static because I can't trust the stack (WIN32), and
|
/* This needs to be a static because I can't trust the stack (WIN32), and
|
||||||
I can't trust the Yap stacks (error) */
|
I can't trust the Yap stacks (error) */
|
||||||
#define YAP_BUF_SIZE 512
|
#define YAP_BUF_SIZE 512
|
||||||
|
41
C/heapgc.c
41
C/heapgc.c
@ -576,6 +576,17 @@ init_dbtable(tr_fr_ptr trail_ptr) {
|
|||||||
|
|
||||||
/* #define INSTRUMENT_GC 1 */
|
/* #define INSTRUMENT_GC 1 */
|
||||||
|
|
||||||
|
#ifndef ANALYST
|
||||||
|
|
||||||
|
static char *op_names[_std_top + 1] =
|
||||||
|
{
|
||||||
|
#define OPCODE(OP,TYPE) #OP
|
||||||
|
#include "YapOpcodes.h"
|
||||||
|
#undef OPCODE
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef INSTRUMENT_GC
|
#ifdef INSTRUMENT_GC
|
||||||
typedef enum {
|
typedef enum {
|
||||||
gc_var,
|
gc_var,
|
||||||
@ -1078,6 +1089,17 @@ mark_environments(CELL_PTR gc_ENV, OPREG size, CELL *pvbmap)
|
|||||||
|
|
||||||
size = EnvSize((CELL_PTR) (gc_ENV[E_CP])); /* size = EnvSize(CP) */
|
size = EnvSize((CELL_PTR) (gc_ENV[E_CP])); /* size = EnvSize(CP) */
|
||||||
pvbmap = EnvBMap((CELL_PTR) (gc_ENV[E_CP]));
|
pvbmap = EnvBMap((CELL_PTR) (gc_ENV[E_CP]));
|
||||||
|
#if 1
|
||||||
|
if (size < 0) {
|
||||||
|
PredEntry *pe = EnvPreg(gc_ENV[E_CP]);
|
||||||
|
op_numbers op = op_from_opcode(ENV_ToOp(gc_ENV[E_CP]));
|
||||||
|
YP_fprintf(YP_stderr,"ENV %p-%p(%d) %s\n", gc_ENV, pvbmap, size-EnvSizeInCells, op_names[op]);
|
||||||
|
if (pe->ArityOfPE)
|
||||||
|
YP_fprintf(YP_stderr," %s/%d\n", RepAtom(NameOfFunctor(pe->FunctorOfPred))->StrOfAE, pe->ArityOfPE);
|
||||||
|
else
|
||||||
|
YP_fprintf(YP_stderr," %s\n", RepAtom((Atom)(pe->FunctorOfPred))->StrOfAE);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
gc_ENV = (CELL_PTR) gc_ENV[E_E]; /* link to prev
|
gc_ENV = (CELL_PTR) gc_ENV[E_E]; /* link to prev
|
||||||
* environment */
|
* environment */
|
||||||
}
|
}
|
||||||
@ -1272,17 +1294,6 @@ mark_trail(tr_fr_ptr trail_ptr, tr_fr_ptr trail_base, CELL *gc_H, choiceptr gc_B
|
|||||||
#endif /* TABLING_SCHEDULING */
|
#endif /* TABLING_SCHEDULING */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef ANALYST
|
|
||||||
|
|
||||||
static char *op_names[_std_top + 1] =
|
|
||||||
{
|
|
||||||
#define OPCODE(OP,TYPE) #OP
|
|
||||||
#include "YapOpcodes.h"
|
|
||||||
#undef OPCODE
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
mark_choicepoints(register choiceptr gc_B, tr_fr_ptr saved_TR, int very_verbose)
|
mark_choicepoints(register choiceptr gc_B, tr_fr_ptr saved_TR, int very_verbose)
|
||||||
@ -1383,10 +1394,10 @@ mark_choicepoints(register choiceptr gc_B, tr_fr_ptr saved_TR, int very_verbose)
|
|||||||
mark_environments((CELL_PTR) (gc_B->cp_a1),
|
mark_environments((CELL_PTR) (gc_B->cp_a1),
|
||||||
#ifdef YAPOR
|
#ifdef YAPOR
|
||||||
-gc_B->cp_cp->u.ldl.s / ((OPREG)sizeof(CELL)),
|
-gc_B->cp_cp->u.ldl.s / ((OPREG)sizeof(CELL)),
|
||||||
EnvBMapOffset((CELL *)(gc_B->cp_cp->u.ldl.bl))
|
(CELL *)(gc_B->cp_cp->u.ldl.bl)
|
||||||
#else
|
#else
|
||||||
-gc_B->cp_cp->u.sla.s / ((OPREG)sizeof(CELL)),
|
-gc_B->cp_cp->u.sla.s / ((OPREG)sizeof(CELL)),
|
||||||
EnvBMapOffset((CELL *)(gc_B->cp_cp->u.sla.l2))
|
gc_B->cp_cp->u.sla.l2
|
||||||
#endif
|
#endif
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
@ -1942,10 +1953,10 @@ sweep_choicepoints(choiceptr gc_B)
|
|||||||
sweep_environments((CELL_PTR)(gc_B->cp_a1),
|
sweep_environments((CELL_PTR)(gc_B->cp_a1),
|
||||||
#ifdef YAPOR
|
#ifdef YAPOR
|
||||||
-gc_B->cp_cp->u.ldl.s / ((OPREG)sizeof(CELL)),
|
-gc_B->cp_cp->u.ldl.s / ((OPREG)sizeof(CELL)),
|
||||||
EnvBMapOffset((CELL *)(gc_B->cp_cp->u.ldl.bl))
|
(CELL *)(gc_B->cp_cp->u.ldl.bl)
|
||||||
#else
|
#else
|
||||||
-gc_B->cp_cp->u.sla.s / ((OPREG)sizeof(CELL)),
|
-gc_B->cp_cp->u.sla.s / ((OPREG)sizeof(CELL)),
|
||||||
EnvBMapOffset((CELL *)(gc_B->cp_cp->u.sla.l2))
|
gc_B->cp_cp->u.sla.l2
|
||||||
#endif
|
#endif
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
23
C/init.c
23
C/init.c
@ -524,9 +524,10 @@ InitCPred(char *Name, int Arity, CPredicate code, int flags)
|
|||||||
p_code->opc = pe->OpcodeOfPred = opcode(_call_usercpred);
|
p_code->opc = pe->OpcodeOfPred = opcode(_call_usercpred);
|
||||||
else
|
else
|
||||||
p_code->opc = pe->OpcodeOfPred = opcode(_call_cpred);
|
p_code->opc = pe->OpcodeOfPred = opcode(_call_cpred);
|
||||||
p_code->u.sla.l2 = (CELL)NIL;
|
p_code->u.sla.l2 = NULL;
|
||||||
p_code->u.sla.s = -Signed(RealEnvSize);
|
p_code->u.sla.s = -Signed(RealEnvSize);
|
||||||
p_code->u.sla.p = (CODEADDR)pe;
|
p_code->u.sla.p = pe;
|
||||||
|
p_code->u.sla.p0 = pe;
|
||||||
p_code = NEXTOP(p_code,sla);
|
p_code = NEXTOP(p_code,sla);
|
||||||
p_code->opc = opcode(_procceed);
|
p_code->opc = opcode(_procceed);
|
||||||
{
|
{
|
||||||
@ -556,9 +557,9 @@ InitCmpPred(char *Name, int Arity, CmpPredicate cmp_code, CPredicate code, int f
|
|||||||
pe->CodeOfPred = pe->FirstClause = pe->LastClause = (CODEADDR) p_code;
|
pe->CodeOfPred = pe->FirstClause = pe->LastClause = (CODEADDR) p_code;
|
||||||
pe->ModuleOfPred = CurrentModule;
|
pe->ModuleOfPred = CurrentModule;
|
||||||
p_code->opc = pe->OpcodeOfPred = opcode(_call_cpred);
|
p_code->opc = pe->OpcodeOfPred = opcode(_call_cpred);
|
||||||
p_code->u.sla.l2 = (CELL)NIL;
|
p_code->u.sla.l2 = NULL;
|
||||||
p_code->u.sla.s = -Signed(RealEnvSize);
|
p_code->u.sla.s = -Signed(RealEnvSize);
|
||||||
p_code->u.sla.p = (CODEADDR)pe;
|
p_code->u.sla.p = p_code->u.sla.p0 = pe;
|
||||||
p_code = NEXTOP(p_code,sla);
|
p_code = NEXTOP(p_code,sla);
|
||||||
p_code->opc = opcode(_procceed);
|
p_code->opc = opcode(_procceed);
|
||||||
c_predicates[NUMBER_OF_CPREDS] = code;
|
c_predicates[NUMBER_OF_CPREDS] = code;
|
||||||
@ -588,9 +589,9 @@ InitAsmPred(char *Name, int Arity, int code, CPredicate def, int flags)
|
|||||||
pe->CodeOfPred = pe->FirstClause = pe->LastClause = (CODEADDR) p_code;
|
pe->CodeOfPred = pe->FirstClause = pe->LastClause = (CODEADDR) p_code;
|
||||||
pe->ModuleOfPred = CurrentModule;
|
pe->ModuleOfPred = CurrentModule;
|
||||||
p_code->opc = pe->OpcodeOfPred = opcode(_call_cpred);
|
p_code->opc = pe->OpcodeOfPred = opcode(_call_cpred);
|
||||||
p_code->u.sla.l2 = (CELL)NIL;
|
p_code->u.sla.l2 = NULL;
|
||||||
p_code->u.sla.s = -Signed(RealEnvSize);
|
p_code->u.sla.s = -Signed(RealEnvSize);
|
||||||
p_code->u.sla.p = (CODEADDR)pe;
|
p_code->u.sla.p = p_code->u.sla.p0 = pe;
|
||||||
p_code = NEXTOP(p_code,sla);
|
p_code = NEXTOP(p_code,sla);
|
||||||
p_code->opc = opcode(_procceed);
|
p_code->opc = opcode(_procceed);
|
||||||
c_predicates[NUMBER_OF_CPREDS] = def;
|
c_predicates[NUMBER_OF_CPREDS] = def;
|
||||||
@ -792,12 +793,22 @@ InitCodes(void)
|
|||||||
heap_regs->failcode_5 = opcode(_op_fail);
|
heap_regs->failcode_5 = opcode(_op_fail);
|
||||||
heap_regs->failcode_6 = opcode(_op_fail);
|
heap_regs->failcode_6 = opcode(_op_fail);
|
||||||
|
|
||||||
|
heap_regs->env_for_trustfail_code.op = opcode(_call);
|
||||||
|
heap_regs->env_for_trustfail_code.s = -Signed(RealEnvSize);
|
||||||
|
heap_regs->env_for_trustfail_code.l = NULL;
|
||||||
|
heap_regs->env_for_trustfail_code.l2 = NULL;
|
||||||
|
heap_regs->env_for_trustfail_code.p =
|
||||||
|
heap_regs->env_for_trustfail_code.p0 =
|
||||||
|
RepPredProp(PredPropByAtom(LookupAtom("false"),0));
|
||||||
heap_regs->trustfailcode = opcode(_trust_fail);
|
heap_regs->trustfailcode = opcode(_trust_fail);
|
||||||
|
|
||||||
heap_regs->env_for_yes_code.op = opcode(_call);
|
heap_regs->env_for_yes_code.op = opcode(_call);
|
||||||
heap_regs->env_for_yes_code.s = -Signed(RealEnvSize);
|
heap_regs->env_for_yes_code.s = -Signed(RealEnvSize);
|
||||||
heap_regs->env_for_yes_code.l = NULL;
|
heap_regs->env_for_yes_code.l = NULL;
|
||||||
heap_regs->env_for_yes_code.l2 = NULL;
|
heap_regs->env_for_yes_code.l2 = NULL;
|
||||||
|
heap_regs->env_for_yes_code.p =
|
||||||
|
heap_regs->env_for_yes_code.p0 =
|
||||||
|
RepPredProp(PredPropByAtom(LookupAtom("true"),0));
|
||||||
heap_regs->yescode = opcode(_Ystop);
|
heap_regs->yescode = opcode(_Ystop);
|
||||||
heap_regs->undef_op = opcode(_undef_p);
|
heap_regs->undef_op = opcode(_undef_p);
|
||||||
heap_regs->index_op = opcode(_index_pred);
|
heap_regs->index_op = opcode(_index_pred);
|
||||||
|
20
C/save.c
20
C/save.c
@ -1748,25 +1748,21 @@ RestoreClause(Clause *Cl)
|
|||||||
case _or_last:
|
case _or_last:
|
||||||
#endif
|
#endif
|
||||||
pc->u.sla.l = CodeAddrAdjust(pc->u.sla.l);
|
pc->u.sla.l = CodeAddrAdjust(pc->u.sla.l);
|
||||||
if (pc->u.sla.l2 != NIL) {
|
if (pc->u.sla.l2 != NULL) {
|
||||||
CELL *p;
|
pc->u.sla.l2 = CellPtoHeapAdjust(pc->u.sla.l2);
|
||||||
p = (CELL *)(pc->u.sla.l2 = CodeAddrAdjust(pc->u.sla.l2));
|
|
||||||
/* restore entry to predicate from bitmap */
|
|
||||||
p[0] = (CELL)PtoPredAdjust((PredEntry *)(p[0]));
|
|
||||||
}
|
}
|
||||||
pc->u.sla.p = CodeAddrAdjust(pc->u.sla.p);
|
pc->u.sla.p = PtoPredAdjust(pc->u.sla.p);
|
||||||
|
pc->u.sla.p0 = PtoPredAdjust(pc->u.sla.p0);
|
||||||
pc = NEXTOP(pc,sla);
|
pc = NEXTOP(pc,sla);
|
||||||
break;
|
break;
|
||||||
/* instructions type sla, but for functions */
|
/* instructions type sla, but for functions */
|
||||||
case _call_cpred:
|
case _call_cpred:
|
||||||
case _call_usercpred:
|
case _call_usercpred:
|
||||||
pc->u.sla.p = CodeAddrAdjust(pc->u.sla.p);
|
pc->u.sla.p = PtoPredAdjust(pc->u.sla.p);
|
||||||
|
pc->u.sla.p0 = PtoPredAdjust(pc->u.sla.p0);
|
||||||
pc->u.sla.l = CCodeAdjust((PredEntry *)(pc->u.sla.p));
|
pc->u.sla.l = CCodeAdjust((PredEntry *)(pc->u.sla.p));
|
||||||
if (pc->u.sla.l2 != NIL) {
|
if (pc->u.sla.l2 != NULL) {
|
||||||
CELL *p;
|
pc->u.sla.l2 = CellPtoHeapAdjust(pc->u.sla.l2);
|
||||||
p = (CELL *)(pc->u.sla.l2 = CodeAddrAdjust(pc->u.sla.l2));
|
|
||||||
/* restore entry to predicate from bitmap */
|
|
||||||
p[0] = (CELL)PtoPredAdjust((PredEntry *)(p[0]));
|
|
||||||
}
|
}
|
||||||
pc = NEXTOP(pc,sla);
|
pc = NEXTOP(pc,sla);
|
||||||
break;
|
break;
|
||||||
|
20
H/Heap.h
20
H/Heap.h
@ -10,7 +10,7 @@
|
|||||||
* File: Heap.h *
|
* File: Heap.h *
|
||||||
* mods: *
|
* mods: *
|
||||||
* comments: Heap Init Structure *
|
* comments: Heap Init Structure *
|
||||||
* version: $Id: Heap.h,v 1.23 2002-01-30 03:49:50 vsc Exp $ *
|
* version: $Id: Heap.h,v 1.24 2002-02-26 15:51:54 vsc Exp $ *
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
|
|
||||||
/* information that can be stored in Code Space */
|
/* information that can be stored in Code Space */
|
||||||
@ -53,6 +53,19 @@ typedef struct various_codes {
|
|||||||
OPCODE failcode_4;
|
OPCODE failcode_4;
|
||||||
OPCODE failcode_5;
|
OPCODE failcode_5;
|
||||||
OPCODE failcode_6;
|
OPCODE failcode_6;
|
||||||
|
struct {
|
||||||
|
OPCODE op;
|
||||||
|
#ifdef YAPOR
|
||||||
|
COUNT ltt;
|
||||||
|
COUNT cut;
|
||||||
|
COUNT seq;
|
||||||
|
#endif /* YAPOR */
|
||||||
|
COUNT s;
|
||||||
|
CODEADDR l;
|
||||||
|
CELL *l2;
|
||||||
|
struct pred_entry *p;
|
||||||
|
struct pred_entry *p0;
|
||||||
|
} env_for_trustfail_code; /* sla */
|
||||||
OPCODE trustfailcode;
|
OPCODE trustfailcode;
|
||||||
struct {
|
struct {
|
||||||
OPCODE op;
|
OPCODE op;
|
||||||
@ -63,8 +76,9 @@ typedef struct various_codes {
|
|||||||
#endif /* YAPOR */
|
#endif /* YAPOR */
|
||||||
COUNT s;
|
COUNT s;
|
||||||
CODEADDR l;
|
CODEADDR l;
|
||||||
CODEADDR l2;
|
CELL *l2;
|
||||||
CODEADDR p;
|
struct pred_entry *p;
|
||||||
|
struct pred_entry *p0;
|
||||||
} env_for_yes_code; /* sla */
|
} env_for_yes_code; /* sla */
|
||||||
OPCODE yescode;
|
OPCODE yescode;
|
||||||
#ifdef YAPOR
|
#ifdef YAPOR
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
* File: Yap.proto *
|
* File: Yap.proto *
|
||||||
* mods: *
|
* mods: *
|
||||||
* comments: Function declarations for YAP *
|
* comments: Function declarations for YAP *
|
||||||
* version: $Id: Yapproto.h,v 1.12 2002-02-22 06:12:18 vsc Exp $ *
|
* version: $Id: Yapproto.h,v 1.13 2002-02-26 15:51:54 vsc Exp $ *
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
|
|
||||||
/* prototype file for Yap */
|
/* prototype file for Yap */
|
||||||
@ -139,7 +139,9 @@ void STD_PROTO(InitDBPreds,(void));
|
|||||||
/* errors.c */
|
/* errors.c */
|
||||||
void STD_PROTO(exit_yap,(int));
|
void STD_PROTO(exit_yap,(int));
|
||||||
yamop *STD_PROTO(Error,(yap_error_number,Term,char *msg, ...));
|
yamop *STD_PROTO(Error,(yap_error_number,Term,char *msg, ...));
|
||||||
|
#if DEBUG
|
||||||
|
void STD_PROTO(bug_location,(yamop *));
|
||||||
|
#endif
|
||||||
|
|
||||||
/* eval.c */
|
/* eval.c */
|
||||||
void STD_PROTO(InitEval,(void));
|
void STD_PROTO(InitEval,(void));
|
||||||
|
14
H/amidefs.h
14
H/amidefs.h
@ -329,10 +329,11 @@ typedef struct yami {
|
|||||||
#endif /* YAPOR */
|
#endif /* YAPOR */
|
||||||
COUNT s;
|
COUNT s;
|
||||||
CODEADDR l;
|
CODEADDR l;
|
||||||
CODEADDR l2;
|
CELL *l2;
|
||||||
CODEADDR p;
|
struct pred_entry *p;
|
||||||
|
struct pred_entry *p0;
|
||||||
CELL next;
|
CELL next;
|
||||||
} sla; /* also check env for yes code before making any changes */
|
} sla; /* also check env for yes and trustfail code before making any changes */
|
||||||
struct {
|
struct {
|
||||||
AREG x;
|
AREG x;
|
||||||
CELL next;
|
CELL next;
|
||||||
@ -547,11 +548,8 @@ typedef struct choicept {
|
|||||||
#define ENV_ToP(cp) ((PredEntry *)(((yamop *)((CODEADDR)(cp) - (CELL)NEXTOP((yamop *)NIL,sla)))->u.sla.p))
|
#define ENV_ToP(cp) ((PredEntry *)(((yamop *)((CODEADDR)(cp) - (CELL)NEXTOP((yamop *)NIL,sla)))->u.sla.p))
|
||||||
#define ENV_ToOp(cp) (((yamop *)((CODEADDR)(cp) - (CELL)NEXTOP((yamop *)NIL,sla)))->opc)
|
#define ENV_ToOp(cp) (((yamop *)((CODEADDR)(cp) - (CELL)NEXTOP((yamop *)NIL,sla)))->opc)
|
||||||
#define EnvSize(cp) ((-ENV_Size(cp))/(OPREG)sizeof(CELL))
|
#define EnvSize(cp) ((-ENV_Size(cp))/(OPREG)sizeof(CELL))
|
||||||
#define EnvPrdBMP(p) ((CELL *)(((yamop *)((CODEADDR)(p) - (CELL)NEXTOP((yamop *)NIL,sla)))->u.sla.l2))
|
#define EnvBMap(p) (((yamop *)((CODEADDR)(p) - (CELL)NEXTOP((yamop *)NIL,sla)))->u.sla.l2)
|
||||||
#define EnvBMapOffset(p) ((p)+1)
|
#define EnvPreg(p) (((yamop *)((CODEADDR)(p) - (CELL)NEXTOP((yamop *)NIL,sla)))->u.sla.p0)
|
||||||
#define EnvBMap(p) EnvBMapOffset(EnvPrdBMP(p))
|
|
||||||
#define EnvPreg(p) ((PredEntry *)(EnvPrdBMP(p) == NIL ? NIL : EnvPrdBMP(p)[0] ))
|
|
||||||
#define PredFromOr(p) ((PredEntry *)(((CELL *)(p))[0] == NIL ? NIL : ((CELL *)(p))[0] ))
|
|
||||||
|
|
||||||
/* access to instructions */
|
/* access to instructions */
|
||||||
|
|
||||||
|
@ -487,7 +487,7 @@ int STD_PROTO(RemoveIndexation,(PredEntry *));
|
|||||||
|
|
||||||
/* dbase.c */
|
/* dbase.c */
|
||||||
void STD_PROTO(ErDBE,(DBRef));
|
void STD_PROTO(ErDBE,(DBRef));
|
||||||
DBRef STD_PROTO(StoreTermInDB,(Term,int));
|
DBRef STD_PROTO(StoreTermInDB,(int,int));
|
||||||
Term STD_PROTO(FetchTermFromDB,(DBRef,int));
|
Term STD_PROTO(FetchTermFromDB,(DBRef,int));
|
||||||
void STD_PROTO(ReleaseTermFromDB,(DBRef));
|
void STD_PROTO(ReleaseTermFromDB,(DBRef));
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user