change define SBA to YAPOR_SBA
This commit is contained in:
parent
836f3adc9b
commit
3e148c3541
@ -1322,7 +1322,7 @@ Yap_ArrayToList(register Term *tp, int nof)
|
|||||||
t = MkAtomTerm(AtomNil);
|
t = MkAtomTerm(AtomNil);
|
||||||
while (pt > tp) {
|
while (pt > tp) {
|
||||||
Term tm = *--pt;
|
Term tm = *--pt;
|
||||||
#if SBA
|
#if YAPOR_SBA
|
||||||
if (tm == 0)
|
if (tm == 0)
|
||||||
t = MkPairTerm((CELL)pt, t);
|
t = MkPairTerm((CELL)pt, t);
|
||||||
else
|
else
|
||||||
|
10
C/arith0.c
10
C/arith0.c
@ -114,25 +114,25 @@ eval0(Int fi) {
|
|||||||
case op_heapused:
|
case op_heapused:
|
||||||
RINT(HeapUsed);
|
RINT(HeapUsed);
|
||||||
case op_localsp:
|
case op_localsp:
|
||||||
#if SBA
|
#if YAPOR_SBA
|
||||||
RINT((Int)ASP);
|
RINT((Int)ASP);
|
||||||
#else
|
#else
|
||||||
RINT(LCL0 - ASP);
|
RINT(LCL0 - ASP);
|
||||||
#endif
|
#endif
|
||||||
case op_b:
|
case op_b:
|
||||||
#if SBA
|
#if YAPOR_SBA
|
||||||
RINT((Int)B);
|
RINT((Int)B);
|
||||||
#else
|
#else
|
||||||
RINT(LCL0 - (CELL *)B);
|
RINT(LCL0 - (CELL *)B);
|
||||||
#endif
|
#endif
|
||||||
case op_env:
|
case op_env:
|
||||||
#if SBA
|
#if YAPOR_SBA
|
||||||
RINT((Int)YENV);
|
RINT((Int)YENV);
|
||||||
#else
|
#else
|
||||||
RINT(LCL0 - YENV);
|
RINT(LCL0 - YENV);
|
||||||
#endif
|
#endif
|
||||||
case op_tr:
|
case op_tr:
|
||||||
#if SBA
|
#if YAPOR_SBA
|
||||||
RINT(TR);
|
RINT(TR);
|
||||||
#else
|
#else
|
||||||
RINT(((CELL *)TR)-LCL0);
|
RINT(((CELL *)TR)-LCL0);
|
||||||
@ -140,7 +140,7 @@ eval0(Int fi) {
|
|||||||
case op_stackfree:
|
case op_stackfree:
|
||||||
RINT(Unsigned(ASP) - Unsigned(H));
|
RINT(Unsigned(ASP) - Unsigned(H));
|
||||||
case op_globalsp:
|
case op_globalsp:
|
||||||
#if SBA
|
#if YAPOR_SBA
|
||||||
RINT((Int)H);
|
RINT((Int)H);
|
||||||
#else
|
#else
|
||||||
RINT(H - H0);
|
RINT(H - H0);
|
||||||
|
@ -2837,13 +2837,13 @@ YAP_Init(YAP_init_args *yap_init)
|
|||||||
Yap_init_local();
|
Yap_init_local();
|
||||||
#ifdef YAPOR
|
#ifdef YAPOR
|
||||||
if (worker_id != 0) {
|
if (worker_id != 0) {
|
||||||
#if SBA||YAPOR_COPY
|
#if YAPOR_SBA||YAPOR_COPY
|
||||||
/*
|
/*
|
||||||
In the SBA we cannot just happily inherit registers
|
In the SBA we cannot just happily inherit registers
|
||||||
from the other workers
|
from the other workers
|
||||||
*/
|
*/
|
||||||
Yap_InitYaamRegs();
|
Yap_InitYaamRegs();
|
||||||
#endif /* SBA */
|
#endif /* YAPOR_SBA */
|
||||||
#ifndef THREADS
|
#ifndef THREADS
|
||||||
Yap_InitPreAllocCodeSpace();
|
Yap_InitPreAllocCodeSpace();
|
||||||
#endif
|
#endif
|
||||||
|
@ -2564,7 +2564,7 @@ init_consult(int mode, char *file)
|
|||||||
ConsultSp--;
|
ConsultSp--;
|
||||||
ConsultSp->c = (ConsultBase-ConsultSp);
|
ConsultSp->c = (ConsultBase-ConsultSp);
|
||||||
ConsultBase = ConsultSp;
|
ConsultBase = ConsultSp;
|
||||||
#if !defined(YAPOR) && !defined(SBA)
|
#if !defined(YAPOR) && !defined(YAPOR_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
|
||||||
@ -2608,7 +2608,7 @@ end_consult( USES_REGS1 )
|
|||||||
ConsultSp += 3;
|
ConsultSp += 3;
|
||||||
consult_level--;
|
consult_level--;
|
||||||
LastAssertedPred = NULL;
|
LastAssertedPred = NULL;
|
||||||
#if !defined(YAPOR) && !defined(SBA)
|
#if !defined(YAPOR) && !defined(YAPOR_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
|
||||||
|
@ -328,7 +328,7 @@ check_var(Term t, unsigned int level, Int argno, compiler_struct *cglobs) {
|
|||||||
|
|
||||||
if (IsNewVar(v)) { /* new var */
|
if (IsNewVar(v)) { /* new var */
|
||||||
v = (Ventry *) Yap_AllocCMem(sizeof(*v), &cglobs->cint);
|
v = (Ventry *) Yap_AllocCMem(sizeof(*v), &cglobs->cint);
|
||||||
#if SBA
|
#if YAPOR_SBA
|
||||||
v->SelfOfVE = 0;
|
v->SelfOfVE = 0;
|
||||||
#else
|
#else
|
||||||
v->SelfOfVE = (CELL) v;
|
v->SelfOfVE = (CELL) v;
|
||||||
|
@ -858,7 +858,7 @@ static CELL *MkDBTerm(register CELL *pt0, register CELL *pt0_end,
|
|||||||
deref_var:
|
deref_var:
|
||||||
if (!DB_MARKED(d0)) {
|
if (!DB_MARKED(d0)) {
|
||||||
if (
|
if (
|
||||||
#if SBA
|
#if YAPOR_SBA
|
||||||
d0 != 0
|
d0 != 0
|
||||||
#else
|
#else
|
||||||
d0 != (CELL)ptd0
|
d0 != (CELL)ptd0
|
||||||
@ -884,7 +884,7 @@ static CELL *MkDBTerm(register CELL *pt0, register CELL *pt0_end,
|
|||||||
CheckDBOverflow(1);
|
CheckDBOverflow(1);
|
||||||
/* variables need to be offset at read time */
|
/* variables need to be offset at read time */
|
||||||
*ptd0 = (CELL)StoPoint;
|
*ptd0 = (CELL)StoPoint;
|
||||||
#if SBA
|
#if YAPOR_SBA
|
||||||
/* the copy we keep will be an empty variable */
|
/* the copy we keep will be an empty variable */
|
||||||
*StoPoint++ = 0;
|
*StoPoint++ = 0;
|
||||||
#else
|
#else
|
||||||
|
18
C/exec.c
18
C/exec.c
@ -215,7 +215,7 @@ do_execute(Term t, Term mod USES_REGS)
|
|||||||
might skip a svar */
|
might skip a svar */
|
||||||
pt = RepAppl(t)+1;
|
pt = RepAppl(t)+1;
|
||||||
for (i = 1; i <= arity; i++) {
|
for (i = 1; i <= arity; i++) {
|
||||||
#if SBA
|
#if YAPOR_SBA
|
||||||
Term d0 = *pt++;
|
Term d0 = *pt++;
|
||||||
if (d0 == 0)
|
if (d0 == 0)
|
||||||
` XREGS[i] = (CELL)(pt-1);
|
` XREGS[i] = (CELL)(pt-1);
|
||||||
@ -358,7 +358,7 @@ do_execute_n(Term t, Term mod, unsigned int n USES_REGS)
|
|||||||
otherwise I would dereference the argument and
|
otherwise I would dereference the argument and
|
||||||
might skip a svar */
|
might skip a svar */
|
||||||
for (i = 1; i <= arity-n; i++) {
|
for (i = 1; i <= arity-n; i++) {
|
||||||
#if SBA
|
#if YAPOR_SBA
|
||||||
Term d0 = *pt++;
|
Term d0 = *pt++;
|
||||||
if (d0 == 0)
|
if (d0 == 0)
|
||||||
XREGS[i] = (CELL)(pt-1);
|
XREGS[i] = (CELL)(pt-1);
|
||||||
@ -610,7 +610,7 @@ p_execute_clause( USES_REGS1 )
|
|||||||
might skip a svar */
|
might skip a svar */
|
||||||
pt = RepAppl(t)+1;
|
pt = RepAppl(t)+1;
|
||||||
for (i = 1; i <= arity; ++i) {
|
for (i = 1; i <= arity; ++i) {
|
||||||
#if SBA
|
#if YAPOR_SBA
|
||||||
Term d0 = *pt++;
|
Term d0 = *pt++;
|
||||||
if (d0 == 0)
|
if (d0 == 0)
|
||||||
XREGS[i] = (CELL)(pt-1);
|
XREGS[i] = (CELL)(pt-1);
|
||||||
@ -693,7 +693,7 @@ p_execute0( USES_REGS1 )
|
|||||||
might skip a svar */
|
might skip a svar */
|
||||||
pt = RepAppl(t)+1;
|
pt = RepAppl(t)+1;
|
||||||
for (i = 1; i <= arity; ++i) {
|
for (i = 1; i <= arity; ++i) {
|
||||||
#if SBA
|
#if YAPOR_SBA
|
||||||
Term d0 = *pt++;
|
Term d0 = *pt++;
|
||||||
if (d0 == 0)
|
if (d0 == 0)
|
||||||
XREGS[i] = (CELL)(pt-1);
|
XREGS[i] = (CELL)(pt-1);
|
||||||
@ -764,7 +764,7 @@ p_execute_nonstop( USES_REGS1 )
|
|||||||
might skip a svar */
|
might skip a svar */
|
||||||
pt = RepAppl(t)+1;
|
pt = RepAppl(t)+1;
|
||||||
for (i = 1; i <= arity; ++i) {
|
for (i = 1; i <= arity; ++i) {
|
||||||
#if SBA
|
#if YAPOR_SBA
|
||||||
Term d0 = *pt++;
|
Term d0 = *pt++;
|
||||||
if (d0 == 0)
|
if (d0 == 0)
|
||||||
XREGS[i] = (CELL)(pt-1);
|
XREGS[i] = (CELL)(pt-1);
|
||||||
@ -1341,7 +1341,7 @@ p_restore_regs2( USES_REGS1 )
|
|||||||
if (!IsIntegerTerm(d0)) {
|
if (!IsIntegerTerm(d0)) {
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
#if SBA
|
#if YAPOR_SBA
|
||||||
pt0 = (choiceptr)IntegerOfTerm(d0);
|
pt0 = (choiceptr)IntegerOfTerm(d0);
|
||||||
#else
|
#else
|
||||||
pt0 = (choiceptr)(LCL0-IntOfTerm(d0));
|
pt0 = (choiceptr)(LCL0-IntOfTerm(d0));
|
||||||
@ -1386,7 +1386,7 @@ p_clean_ifcp( USES_REGS1 ) {
|
|||||||
Yap_Error(TYPE_ERROR_INTEGER, t, "cut_at/1");
|
Yap_Error(TYPE_ERROR_INTEGER, t, "cut_at/1");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
#if SBA
|
#if YAPOR_SBA
|
||||||
pt0 = (choiceptr)IntegerOfTerm(t);
|
pt0 = (choiceptr)IntegerOfTerm(t);
|
||||||
#else
|
#else
|
||||||
pt0 = cp_from_integer(t PASS_REGS);
|
pt0 = cp_from_integer(t PASS_REGS);
|
||||||
@ -1633,9 +1633,9 @@ Yap_InitYaamRegs(void)
|
|||||||
STATIC_PREDICATES_MARKED = FALSE;
|
STATIC_PREDICATES_MARKED = FALSE;
|
||||||
#ifdef FROZEN_STACKS
|
#ifdef FROZEN_STACKS
|
||||||
H_FZ = H;
|
H_FZ = H;
|
||||||
#ifdef SBA
|
#ifdef YAPOR_SBA
|
||||||
BSEG =
|
BSEG =
|
||||||
#endif /* SBA */
|
#endif /* YAPOR_SBA */
|
||||||
BBREG = B_FZ = (choiceptr) Yap_LocalBase;
|
BBREG = B_FZ = (choiceptr) Yap_LocalBase;
|
||||||
TR = TR_FZ = (tr_fr_ptr) Yap_TrailBase;
|
TR = TR_FZ = (tr_fr_ptr) Yap_TrailBase;
|
||||||
#endif /* FROZEN_STACKS */
|
#endif /* FROZEN_STACKS */
|
||||||
|
@ -929,7 +929,7 @@ init_dbtable(tr_fr_ptr trail_ptr USES_REGS) {
|
|||||||
#ifdef FROZEN_STACKS /* TRAIL */
|
#ifdef FROZEN_STACKS /* TRAIL */
|
||||||
/* avoid frozen segments */
|
/* avoid frozen segments */
|
||||||
if (
|
if (
|
||||||
#ifdef SBA
|
#ifdef YAPOR_SBA
|
||||||
(ADDR) pt0 >= HeapTop
|
(ADDR) pt0 >= HeapTop
|
||||||
#else
|
#else
|
||||||
(ADDR) pt0 >= Yap_TrailBase && (ADDR) pt0 < Yap_TrailTop
|
(ADDR) pt0 >= Yap_TrailBase && (ADDR) pt0 < Yap_TrailTop
|
||||||
@ -2499,7 +2499,7 @@ sweep_trail(choiceptr gc_B, tr_fr_ptr old_TR USES_REGS)
|
|||||||
#ifdef FROZEN_STACKS /* TRAIL */
|
#ifdef FROZEN_STACKS /* TRAIL */
|
||||||
/* process all segments */
|
/* process all segments */
|
||||||
if (
|
if (
|
||||||
#ifdef SBA
|
#ifdef YAPOR_SBA
|
||||||
(ADDR) pt0 >= Yap_GlobalBase
|
(ADDR) pt0 >= Yap_GlobalBase
|
||||||
#else
|
#else
|
||||||
(ADDR) pt0 >= Yap_TrailBase
|
(ADDR) pt0 >= Yap_TrailBase
|
||||||
|
4
C/init.c
4
C/init.c
@ -1348,9 +1348,9 @@ Yap_InitWorkspace(UInt Heap, UInt Stack, UInt Trail, UInt Atts, UInt max_table_s
|
|||||||
INFORMATION_MESSAGE("YapOr: copy model with %d worker%s", n_workers, n_workers == 1 ? "":"s");
|
INFORMATION_MESSAGE("YapOr: copy model with %d worker%s", n_workers, n_workers == 1 ? "":"s");
|
||||||
#elif ACOW
|
#elif ACOW
|
||||||
INFORMATION_MESSAGE("YapOr: acow model with %d worker%s", n_workers, n_workers == 1 ? "":"s");
|
INFORMATION_MESSAGE("YapOr: acow model with %d worker%s", n_workers, n_workers == 1 ? "":"s");
|
||||||
#else /* SBA */
|
#else /* YAPOR_SBA */
|
||||||
INFORMATION_MESSAGE("YapOr: sba model with %d worker%s", n_workers, n_workers == 1 ? "":"s");
|
INFORMATION_MESSAGE("YapOr: sba model with %d worker%s", n_workers, n_workers == 1 ? "":"s");
|
||||||
#endif /* YAPOR_COPY - ACOW - SBA */
|
#endif /* YAPOR_COPY - ACOW - YAPOR_SBA */
|
||||||
map_memory(Heap, Stack+Atts, Trail, n_workers);
|
map_memory(Heap, Stack+Atts, Trail, n_workers);
|
||||||
#else
|
#else
|
||||||
Yap_InitMemory (Trail, Heap, Stack+Atts);
|
Yap_InitMemory (Trail, Heap, Stack+Atts);
|
||||||
|
@ -442,7 +442,7 @@ p_dif( USES_REGS1 )
|
|||||||
BEGD(d1);
|
BEGD(d1);
|
||||||
d1 = TrailTerm(--TR);
|
d1 = TrailTerm(--TR);
|
||||||
if (IsVarTerm(d1)) {
|
if (IsVarTerm(d1)) {
|
||||||
#if defined(SBA) && defined(YAPOR)
|
#if defined(YAPOR_SBA) && defined(YAPOR)
|
||||||
/* clean up the trail when we backtrack */
|
/* clean up the trail when we backtrack */
|
||||||
if (Unsigned((Int)(d1)-(Int)(H_FZ)) >
|
if (Unsigned((Int)(d1)-(Int)(H_FZ)) >
|
||||||
Unsigned((Int)(B_FZ)-(Int)(H_FZ))) {
|
Unsigned((Int)(B_FZ)-(Int)(H_FZ))) {
|
||||||
@ -767,7 +767,7 @@ p_cut_by( USES_REGS1 )
|
|||||||
d0 = ARG1;
|
d0 = ARG1;
|
||||||
deref_head(d0, cutby_x_unk);
|
deref_head(d0, cutby_x_unk);
|
||||||
cutby_x_nvar:
|
cutby_x_nvar:
|
||||||
#if SBA
|
#if YAPOR_SBA
|
||||||
if (!IsIntegerTerm(d0)) {
|
if (!IsIntegerTerm(d0)) {
|
||||||
#else
|
#else
|
||||||
if (!IsIntTerm(d0)) {
|
if (!IsIntTerm(d0)) {
|
||||||
@ -775,7 +775,7 @@ p_cut_by( USES_REGS1 )
|
|||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
BEGCHO(pt0);
|
BEGCHO(pt0);
|
||||||
#if SBA
|
#if YAPOR_SBA
|
||||||
pt0 = (choiceptr)IntegerOfTerm(d0);
|
pt0 = (choiceptr)IntegerOfTerm(d0);
|
||||||
#else
|
#else
|
||||||
pt0 = (choiceptr)(LCL0-IntOfTerm(d0));
|
pt0 = (choiceptr)(LCL0-IntOfTerm(d0));
|
||||||
|
@ -192,7 +192,7 @@ UpdateTimedVar(Term inv, Term new USES_REGS)
|
|||||||
#endif
|
#endif
|
||||||
) {
|
) {
|
||||||
/* last assignment more recent than last B */
|
/* last assignment more recent than last B */
|
||||||
#if SBA
|
#if YAPOR_SBA
|
||||||
if (Unsigned((Int)(tv)-(Int)(H_FZ)) >
|
if (Unsigned((Int)(tv)-(Int)(H_FZ)) >
|
||||||
Unsigned((Int)(B_FZ)-(Int)(H_FZ)))
|
Unsigned((Int)(B_FZ)-(Int)(H_FZ)))
|
||||||
*STACK_TO_SBA(&(tv->value)) = new;
|
*STACK_TO_SBA(&(tv->value)) = new;
|
||||||
|
8
C/save.c
8
C/save.c
@ -409,14 +409,14 @@ save_regs(int mode USES_REGS)
|
|||||||
return -1;
|
return -1;
|
||||||
if (putcellptr((CELL *)EX) < 0)
|
if (putcellptr((CELL *)EX) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
#if defined(SBA) || defined(TABLING)
|
#if defined(YAPOR_SBA) || defined(TABLING)
|
||||||
if (putcellptr(H_FZ) < 0)
|
if (putcellptr(H_FZ) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
if (putcellptr((CELL *)B_FZ) < 0)
|
if (putcellptr((CELL *)B_FZ) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
if (putcellptr((CELL *)TR_FZ) < 0)
|
if (putcellptr((CELL *)TR_FZ) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
#endif /* SBA || TABLING */
|
#endif /* YAPOR_SBA || TABLING */
|
||||||
}
|
}
|
||||||
if (putout(CurrentModule) < 0)
|
if (putout(CurrentModule) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
@ -851,7 +851,7 @@ get_regs(int flag USES_REGS)
|
|||||||
EX = (struct DB_TERM *)get_cellptr();
|
EX = (struct DB_TERM *)get_cellptr();
|
||||||
if (Yap_ErrorMessage)
|
if (Yap_ErrorMessage)
|
||||||
return -1;
|
return -1;
|
||||||
#if defined(SBA) || defined(TABLING)
|
#if defined(YAPOR_SBA) || defined(TABLING)
|
||||||
H_FZ = get_cellptr();
|
H_FZ = get_cellptr();
|
||||||
if (Yap_ErrorMessage)
|
if (Yap_ErrorMessage)
|
||||||
return -1;
|
return -1;
|
||||||
@ -861,7 +861,7 @@ get_regs(int flag USES_REGS)
|
|||||||
TR_FZ = (tr_fr_ptr)get_cellptr();
|
TR_FZ = (tr_fr_ptr)get_cellptr();
|
||||||
if (Yap_ErrorMessage)
|
if (Yap_ErrorMessage)
|
||||||
return -1;
|
return -1;
|
||||||
#endif /* SBA || TABLING */
|
#endif /* YAPOR_SBA || TABLING */
|
||||||
}
|
}
|
||||||
CurrentModule = get_cell();
|
CurrentModule = get_cell();
|
||||||
if (Yap_ErrorMessage)
|
if (Yap_ErrorMessage)
|
||||||
|
24
H/Regs.h
24
H/Regs.h
@ -90,9 +90,9 @@ typedef struct regstore_t
|
|||||||
Int CurSlot_;
|
Int CurSlot_;
|
||||||
CELL CreepFlag_; /* 13 */
|
CELL CreepFlag_; /* 13 */
|
||||||
CELL *HB_; /* 4 heap (global) stack top at latest c.p. */
|
CELL *HB_; /* 4 heap (global) stack top at latest c.p. */
|
||||||
#if defined(SBA) || defined(TABLING)
|
#if defined(YAPOR_SBA) || defined(TABLING)
|
||||||
choiceptr BB_; /* 4 local stack top at latest c.p. */
|
choiceptr BB_; /* 4 local stack top at latest c.p. */
|
||||||
#endif /* SBA || TABLING */
|
#endif /* YAPOR_SBA || TABLING */
|
||||||
CELL *H0_; /* 2 base of heap (global) stack */
|
CELL *H0_; /* 2 base of heap (global) stack */
|
||||||
tr_fr_ptr TR_; /* 24 top of trail */
|
tr_fr_ptr TR_; /* 24 top of trail */
|
||||||
CELL *H_; /* 25 top of heap (global) stack */
|
CELL *H_; /* 25 top of heap (global) stack */
|
||||||
@ -119,24 +119,24 @@ typedef struct regstore_t
|
|||||||
/* visualc*/
|
/* visualc*/
|
||||||
struct DB_TERM * EX_; /* 18 */
|
struct DB_TERM * EX_; /* 18 */
|
||||||
Term CurrentModule_;
|
Term CurrentModule_;
|
||||||
#if defined(SBA) || defined(TABLING)
|
#if defined(YAPOR_SBA) || defined(TABLING)
|
||||||
CELL *H_FZ_;
|
CELL *H_FZ_;
|
||||||
choiceptr B_FZ_;
|
choiceptr B_FZ_;
|
||||||
tr_fr_ptr TR_FZ_;
|
tr_fr_ptr TR_FZ_;
|
||||||
#endif /* SBA || TABLING */
|
#endif /* YAPOR_SBA || TABLING */
|
||||||
struct pred_entry *PP_;
|
struct pred_entry *PP_;
|
||||||
#if defined(YAPOR) || defined(THREADS)
|
#if defined(YAPOR) || defined(THREADS)
|
||||||
/* recursive write-locks for PredEntry */
|
/* recursive write-locks for PredEntry */
|
||||||
yamop **PREG_ADDR_;
|
yamop **PREG_ADDR_;
|
||||||
unsigned int worker_id_;
|
unsigned int worker_id_;
|
||||||
#ifdef SBA
|
#ifdef YAPOR_SBA
|
||||||
choiceptr BSEG_;
|
choiceptr BSEG_;
|
||||||
struct or_frame *frame_head_, *frame_tail_;
|
struct or_frame *frame_head_, *frame_tail_;
|
||||||
char *binding_array_;
|
char *binding_array_;
|
||||||
int sba_offset_;
|
int sba_offset_;
|
||||||
int sba_end_;
|
int sba_end_;
|
||||||
int sba_size_;
|
int sba_size_;
|
||||||
#endif /* SBA */
|
#endif /* YAPOR_SBA */
|
||||||
#endif /* YAPOR || THREADS */
|
#endif /* YAPOR || THREADS */
|
||||||
#if (defined(YAPOR) || defined(TABLING))
|
#if (defined(YAPOR) || defined(TABLING))
|
||||||
struct local_data *LOCAL_;
|
struct local_data *LOCAL_;
|
||||||
@ -635,16 +635,16 @@ EXTERN inline void restore_B(void) {
|
|||||||
#define AuxTop Yap_REGS.AuxTop_
|
#define AuxTop Yap_REGS.AuxTop_
|
||||||
#define EX Yap_REGS.EX_
|
#define EX Yap_REGS.EX_
|
||||||
#define DEPTH Yap_REGS.DEPTH_
|
#define DEPTH Yap_REGS.DEPTH_
|
||||||
#if defined(SBA) || defined(TABLING)
|
#if defined(YAPOR_SBA) || defined(TABLING)
|
||||||
#define H_FZ Yap_REGS.H_FZ_
|
#define H_FZ Yap_REGS.H_FZ_
|
||||||
#define B_FZ Yap_REGS.B_FZ_
|
#define B_FZ Yap_REGS.B_FZ_
|
||||||
#define TR_FZ Yap_REGS.TR_FZ_
|
#define TR_FZ Yap_REGS.TR_FZ_
|
||||||
#endif /* SBA || TABLING */
|
#endif /* YAPOR_SBA || TABLING */
|
||||||
#define PP (Yap_REGS.PP_)
|
#define PP (Yap_REGS.PP_)
|
||||||
#if defined(YAPOR) || defined(THREADS)
|
#if defined(YAPOR) || defined(THREADS)
|
||||||
#define worker_id (Yap_REGS.worker_id_)
|
#define worker_id (Yap_REGS.worker_id_)
|
||||||
#define PREG_ADDR (Yap_REGS.PREG_ADDR_)
|
#define PREG_ADDR (Yap_REGS.PREG_ADDR_)
|
||||||
#ifdef SBA
|
#ifdef YAPOR_SBA
|
||||||
#define BSEG Yap_REGS.BSEG_
|
#define BSEG Yap_REGS.BSEG_
|
||||||
#define binding_array Yap_REGS.binding_array_
|
#define binding_array Yap_REGS.binding_array_
|
||||||
#define sba_offset Yap_REGS.sba_offset_
|
#define sba_offset Yap_REGS.sba_offset_
|
||||||
@ -652,7 +652,7 @@ EXTERN inline void restore_B(void) {
|
|||||||
#define sba_size Yap_REGS.sba_size_
|
#define sba_size Yap_REGS.sba_size_
|
||||||
#define frame_head Yap_REGS.frame_head_
|
#define frame_head Yap_REGS.frame_head_
|
||||||
#define frame_tail Yap_REGS.frame_tail_
|
#define frame_tail Yap_REGS.frame_tail_
|
||||||
#endif /* SBA */
|
#endif /* YAPOR_SBA */
|
||||||
#endif /* YAPOR */
|
#endif /* YAPOR */
|
||||||
#if defined(YAPOR) || defined(TABLING)
|
#if defined(YAPOR) || defined(TABLING)
|
||||||
#define LOCAL Yap_REGS.LOCAL_
|
#define LOCAL Yap_REGS.LOCAL_
|
||||||
@ -686,10 +686,10 @@ EXTERN inline void restore_B(void) {
|
|||||||
|
|
||||||
#define HBREG HB
|
#define HBREG HB
|
||||||
|
|
||||||
#if defined(SBA) || defined(TABLING)
|
#if defined(YAPOR_SBA) || defined(TABLING)
|
||||||
#define BB Yap_REGS.BB_
|
#define BB Yap_REGS.BB_
|
||||||
#define BBREG BB
|
#define BBREG BB
|
||||||
#endif /* SBA || TABLING */
|
#endif /* YAPOR_SBA || TABLING */
|
||||||
|
|
||||||
#if !defined(THREADS)
|
#if !defined(THREADS)
|
||||||
/* use actual addresses for regs */
|
/* use actual addresses for regs */
|
||||||
|
26
H/Yap.h
26
H/Yap.h
@ -39,23 +39,23 @@
|
|||||||
#error Do not explicitly define YAPOR
|
#error Do not explicitly define YAPOR
|
||||||
#endif /* YAPOR */
|
#endif /* YAPOR */
|
||||||
|
|
||||||
#if (defined(YAPOR_COPY) && (defined(ACOW) || defined(SBA))) || (defined(ACOW) && defined(SBA))
|
#if (defined(YAPOR_COPY) && (defined(ACOW) || defined(YAPOR_SBA))) || (defined(ACOW) && defined(YAPOR_SBA))
|
||||||
#error Do not define multiple or-parallel models
|
#error Do not define multiple or-parallel models
|
||||||
#endif /* (YAPOR_COPY && (ACOW || SBA)) || (ACOW && SBA) */
|
#endif /* (YAPOR_COPY && (ACOW || YAPOR_SBA)) || (ACOW && YAPOR_SBA) */
|
||||||
|
|
||||||
#if defined(YAPOR_COPY) || defined(ACOW) || defined(SBA) || defined(THREADS)
|
#if defined(YAPOR_COPY) || defined(ACOW) || defined(YAPOR_SBA) || defined(THREADS)
|
||||||
#define YAPOR 1
|
#define YAPOR 1
|
||||||
#endif /* YAPOR_COPY || ACOW || SBA */
|
#endif /* YAPOR_COPY || ACOW || YAPOR_SBA */
|
||||||
|
|
||||||
#if defined(TABLING) && (defined(ACOW) || defined(SBA))
|
#if defined(TABLING) && (defined(ACOW) || defined(YAPOR_SBA))
|
||||||
#error Currently TABLING only works with YAPOR_COPY
|
#error Currently TABLING only works with YAPOR_COPY
|
||||||
#endif /* TABLING && (ACOW || SBA) */
|
#endif /* TABLING && (ACOW || YAPOR_SBA) */
|
||||||
|
|
||||||
#ifdef YAPOR
|
#ifdef YAPOR
|
||||||
#define FIXED_STACKS 1
|
#define FIXED_STACKS 1
|
||||||
#ifdef THREADS
|
#ifdef THREADS
|
||||||
#undef ACOW
|
#undef ACOW
|
||||||
#undef SBA
|
#undef YAPOR_SBA
|
||||||
#undef YAPOR_COPY
|
#undef YAPOR_COPY
|
||||||
#endif
|
#endif
|
||||||
#endif /* YAPOR */
|
#endif /* YAPOR */
|
||||||
@ -80,9 +80,9 @@
|
|||||||
#define USE_SYSTEM_MALLOC 1
|
#define USE_SYSTEM_MALLOC 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(TABLING) || defined(SBA)
|
#if defined(TABLING) || defined(YAPOR_YAPOR_SBA)
|
||||||
#define FROZEN_STACKS 1
|
#define FROZEN_STACKS 1
|
||||||
#endif /* TABLING || SBA */
|
#endif /* TABLING || YAPOR_YAPOR_SBA */
|
||||||
|
|
||||||
#ifdef _MSC_VER /* Microsoft's Visual C++ Compiler */
|
#ifdef _MSC_VER /* Microsoft's Visual C++ Compiler */
|
||||||
/* adjust a config.h from mingw32 to work with vc++ */
|
/* adjust a config.h from mingw32 to work with vc++ */
|
||||||
@ -727,7 +727,7 @@ typedef enum
|
|||||||
#else
|
#else
|
||||||
|
|
||||||
#if !GC_NO_TAGS
|
#if !GC_NO_TAGS
|
||||||
#if defined(SBA) && defined(__linux__)
|
#if defined(YAPOR_SBA) && defined(__linux__)
|
||||||
#define MBIT /* 0x20000000 */ MKTAG(0x1,0) /* mark bit */
|
#define MBIT /* 0x20000000 */ MKTAG(0x1,0) /* mark bit */
|
||||||
#else
|
#else
|
||||||
#define RBIT /* 0x20000000 */ MKTAG(0x1,0) /* relocation chain bit */
|
#define RBIT /* 0x20000000 */ MKTAG(0x1,0) /* relocation chain bit */
|
||||||
@ -824,7 +824,7 @@ VarOfTerm (Term t)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef SBA
|
#ifdef YAPOR_SBA
|
||||||
|
|
||||||
inline EXTERN Term MkVarTerm__ ( USES_REGS1 );
|
inline EXTERN Term MkVarTerm__ ( USES_REGS1 );
|
||||||
|
|
||||||
@ -1060,7 +1060,7 @@ IntegerOfTerm (Term t)
|
|||||||
|
|
||||||
/*************** unification routines ***********************************/
|
/*************** unification routines ***********************************/
|
||||||
|
|
||||||
#ifdef SBA
|
#ifdef YAPOR_SBA
|
||||||
#include "or.sbaamiops.h"
|
#include "or.sbaamiops.h"
|
||||||
#else
|
#else
|
||||||
#include "amiops.h"
|
#include "amiops.h"
|
||||||
@ -1299,7 +1299,7 @@ extern char emacs_tmp[], emacs_tmp2[];
|
|||||||
#include "opt.macros.h"
|
#include "opt.macros.h"
|
||||||
#endif /* YAPOR || TABLING */
|
#endif /* YAPOR || TABLING */
|
||||||
|
|
||||||
#ifdef SBA
|
#ifdef YAPOR_SBA
|
||||||
#include "or.sbaunify.h"
|
#include "or.sbaunify.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -690,13 +690,13 @@ Macros to check the limits of stacks
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (defined(SBA) && defined(YAPOR)) || defined(TABLING)
|
#if (defined(YAPOR_SBA) && defined(YAPOR)) || defined(TABLING)
|
||||||
#define check_stack(Label, GLOB) \
|
#define check_stack(Label, GLOB) \
|
||||||
if ( (Int)(Unsigned(YOUNGEST_CP((choiceptr)ENV_YREG,B_FZ)) - Unsigned(YOUNGEST_H(H_FZ,GLOB))) < CreepFlag ) goto Label
|
if ( (Int)(Unsigned(YOUNGEST_CP((choiceptr)ENV_YREG,B_FZ)) - Unsigned(YOUNGEST_H(H_FZ,GLOB))) < CreepFlag ) goto Label
|
||||||
#else
|
#else
|
||||||
#define check_stack(Label, GLOB) \
|
#define check_stack(Label, GLOB) \
|
||||||
if ( (Int)(Unsigned(ENV_YREG) - Unsigned(GLOB)) < CreepFlag ) goto Label
|
if ( (Int)(Unsigned(ENV_YREG) - Unsigned(GLOB)) < CreepFlag ) goto Label
|
||||||
#endif /* SBA && YAPOR */
|
#endif /* YAPOR_SBA && YAPOR */
|
||||||
|
|
||||||
/***************************************************************
|
/***************************************************************
|
||||||
* Macros for choice point manipulation *
|
* Macros for choice point manipulation *
|
||||||
@ -813,7 +813,7 @@ Macros to check the limits of stacks
|
|||||||
|
|
||||||
|
|
||||||
#ifdef FROZEN_STACKS
|
#ifdef FROZEN_STACKS
|
||||||
#ifdef SBA
|
#ifdef YAPOR_SBA
|
||||||
#define PROTECT_FROZEN_H(CPTR) \
|
#define PROTECT_FROZEN_H(CPTR) \
|
||||||
((Unsigned((Int)((CPTR)->cp_h)-(Int)(H_FZ)) < \
|
((Unsigned((Int)((CPTR)->cp_h)-(Int)(H_FZ)) < \
|
||||||
Unsigned((Int)(B_FZ)-(Int)(H_FZ))) ? \
|
Unsigned((Int)(B_FZ)-(Int)(H_FZ))) ? \
|
||||||
@ -830,7 +830,7 @@ Macros to check the limits of stacks
|
|||||||
#else /* TABLING */
|
#else /* TABLING */
|
||||||
#define PROTECT_FROZEN_B(CPTR) (YOUNGER_CP(CPTR, B_FZ) ? CPTR : B_FZ)
|
#define PROTECT_FROZEN_B(CPTR) (YOUNGER_CP(CPTR, B_FZ) ? CPTR : B_FZ)
|
||||||
#define PROTECT_FROZEN_H(CPTR) (((CPTR)->cp_h > H_FZ) ? (CPTR)->cp_h : H_FZ)
|
#define PROTECT_FROZEN_H(CPTR) (((CPTR)->cp_h > H_FZ) ? (CPTR)->cp_h : H_FZ)
|
||||||
#endif /* SBA */
|
#endif /* YAPOR_SBA */
|
||||||
#else
|
#else
|
||||||
#define PROTECT_FROZEN_B(CPTR) (CPTR)
|
#define PROTECT_FROZEN_B(CPTR) (CPTR)
|
||||||
#define PROTECT_FROZEN_H(CPTR) (CPTR)->cp_h
|
#define PROTECT_FROZEN_H(CPTR) (CPTR)->cp_h
|
||||||
|
12
H/amidefs.h
12
H/amidefs.h
@ -66,7 +66,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef FROZEN_STACKS
|
#ifdef FROZEN_STACKS
|
||||||
#ifdef SBA
|
#ifdef YAPOR_SBA
|
||||||
#define PROTECT_FROZEN_H(CPTR) \
|
#define PROTECT_FROZEN_H(CPTR) \
|
||||||
((Unsigned((Int)((CPTR)->cp_h)-(Int)(H_FZ)) < \
|
((Unsigned((Int)((CPTR)->cp_h)-(Int)(H_FZ)) < \
|
||||||
Unsigned((Int)(B_FZ)-(Int)(H_FZ))) ? \
|
Unsigned((Int)(B_FZ)-(Int)(H_FZ))) ? \
|
||||||
@ -83,7 +83,7 @@
|
|||||||
#else /* TABLING */
|
#else /* TABLING */
|
||||||
#define PROTECT_FROZEN_B(CPTR) (YOUNGER_CP(CPTR, B_FZ) ? CPTR : B_FZ)
|
#define PROTECT_FROZEN_B(CPTR) (YOUNGER_CP(CPTR, B_FZ) ? CPTR : B_FZ)
|
||||||
#define PROTECT_FROZEN_H(CPTR) (((CPTR)->cp_h > H_FZ) ? (CPTR)->cp_h : H_FZ)
|
#define PROTECT_FROZEN_H(CPTR) (((CPTR)->cp_h > H_FZ) ? (CPTR)->cp_h : H_FZ)
|
||||||
#endif /* SBA */
|
#endif /* YAPOR_SBA */
|
||||||
#else
|
#else
|
||||||
#define PROTECT_FROZEN_B(CPTR) (CPTR)
|
#define PROTECT_FROZEN_B(CPTR) (CPTR)
|
||||||
#define PROTECT_FROZEN_H(CPTR) (CPTR)->cp_h
|
#define PROTECT_FROZEN_H(CPTR) (CPTR)->cp_h
|
||||||
@ -875,7 +875,7 @@ typedef yamop yamopp;
|
|||||||
|
|
||||||
#define PREVOP(V,TYPE) ((yamop *)((CODEADDR)(V)-(CELL)NEXTOP((yamop *)NULL,TYPE)))
|
#define PREVOP(V,TYPE) ((yamop *)((CODEADDR)(V)-(CELL)NEXTOP((yamop *)NULL,TYPE)))
|
||||||
|
|
||||||
#if defined(TABLING) || defined(SBA)
|
#if defined(TABLING) || defined(YAPOR_SBA)
|
||||||
typedef struct trail_frame {
|
typedef struct trail_frame {
|
||||||
Term term;
|
Term term;
|
||||||
CELL value;
|
CELL value;
|
||||||
@ -888,7 +888,7 @@ typedef Term *tr_fr_ptr;
|
|||||||
|
|
||||||
#define TrailTerm(X) (*(X))
|
#define TrailTerm(X) (*(X))
|
||||||
#define TrailVal(X) OOOOOOPS: this program should not compile
|
#define TrailVal(X) OOOOOOPS: this program should not compile
|
||||||
#endif /* TABLING || SBA */
|
#endif /* TABLING || YAPOR_SBA */
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -978,7 +978,7 @@ typedef struct choicept {
|
|||||||
#define SHOULD_CUT_UP_TO(X,Y) ((X) != (Y))
|
#define SHOULD_CUT_UP_TO(X,Y) ((X) != (Y))
|
||||||
/* #define SHOULD_CUT_UP_TO(X,Y) ((X) (Y)) */
|
/* #define SHOULD_CUT_UP_TO(X,Y) ((X) (Y)) */
|
||||||
|
|
||||||
#ifdef SBA
|
#ifdef YAPOR_SBA
|
||||||
#define SHARED_CP(CP) ((CP) >= B_FZ || (CP) < (choiceptr)H_FZ)
|
#define SHARED_CP(CP) ((CP) >= B_FZ || (CP) < (choiceptr)H_FZ)
|
||||||
|
|
||||||
#define YOUNGER_CP(CP1, CP2) \
|
#define YOUNGER_CP(CP1, CP2) \
|
||||||
@ -1004,7 +1004,7 @@ typedef struct choicept {
|
|||||||
|
|
||||||
#define YOUNGER_H(H1, H2) ((CELL *)(H1) > (CELL *)(H2))
|
#define YOUNGER_H(H1, H2) ((CELL *)(H1) > (CELL *)(H2))
|
||||||
|
|
||||||
#endif /* SBA */
|
#endif /* YAPOR_SBA */
|
||||||
|
|
||||||
#define YOUNGEST_CP(CP1, CP2) (YOUNGER_CP(CP1,CP2) ? (CP1) : (CP2))
|
#define YOUNGEST_CP(CP1, CP2) (YOUNGER_CP(CP1,CP2) ? (CP1) : (CP2))
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@
|
|||||||
#if GC_NO_TAGS
|
#if GC_NO_TAGS
|
||||||
#define Yap_bp WL->b_p
|
#define Yap_bp WL->b_p
|
||||||
#endif
|
#endif
|
||||||
#if defined(TABLING) || defined(SBA)
|
#if defined(TABLING) || defined(YAPOR_SBA)
|
||||||
#define sTR WL->wl_sTR
|
#define sTR WL->wl_sTR
|
||||||
#define sTR0 WL->wl_sTR0
|
#define sTR0 WL->wl_sTR0
|
||||||
#define new_TR WL->new_tr
|
#define new_TR WL->new_tr
|
||||||
|
@ -100,7 +100,7 @@ typedef struct worker_local {
|
|||||||
#if GC_NO_TAGS
|
#if GC_NO_TAGS
|
||||||
char* b_p;
|
char* b_p;
|
||||||
#endif
|
#endif
|
||||||
#if defined(TABLING) || defined(SBA)
|
#if defined(TABLING) || defined(YAPOR_SBA)
|
||||||
struct trail_frame* wl_sTR;
|
struct trail_frame* wl_sTR;
|
||||||
struct trail_frame* wl_sTR0;
|
struct trail_frame* wl_sTR0;
|
||||||
struct trail_frame* new_tr;
|
struct trail_frame* new_tr;
|
||||||
|
@ -98,7 +98,7 @@ static void InitWorker(int wid) {
|
|||||||
#if GC_NO_TAGS
|
#if GC_NO_TAGS
|
||||||
FOREIGN(wid)->b_p = NULL;
|
FOREIGN(wid)->b_p = NULL;
|
||||||
#endif
|
#endif
|
||||||
#if defined(TABLING) || defined(SBA)
|
#if defined(TABLING) || defined(YAPOR_SBA)
|
||||||
FOREIGN(wid)->wl_sTR = NULL;
|
FOREIGN(wid)->wl_sTR = NULL;
|
||||||
FOREIGN(wid)->wl_sTR0 = NULL;
|
FOREIGN(wid)->wl_sTR0 = NULL;
|
||||||
FOREIGN(wid)->new_tr = NULL;
|
FOREIGN(wid)->new_tr = NULL;
|
||||||
|
@ -98,7 +98,7 @@ static void RestoreWorker(int wid USES_REGS) {
|
|||||||
#if GC_NO_TAGS
|
#if GC_NO_TAGS
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#if defined(TABLING) || defined(SBA)
|
#if defined(TABLING) || defined(YAPOR_SBA)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ DOCSDIR=$(SHAREDIR)/doc/Yap
|
|||||||
# very experimental stuff, you'll need to contact the developers
|
# very experimental stuff, you'll need to contact the developers
|
||||||
# if you want to use this:
|
# if you want to use this:
|
||||||
# -DYAPOR_COPY: or-parallelism with environment copying, in Muse style.
|
# -DYAPOR_COPY: or-parallelism with environment copying, in Muse style.
|
||||||
# -DSBA: or-parallelism with sparse binding arrays.
|
# -DYAPOR_SBA: or-parallelism with sparse binding arrays.
|
||||||
# -DACOW: or-parallelism with copy-on-write.
|
# -DACOW: or-parallelism with copy-on-write.
|
||||||
# -DTABLING: support for tabling
|
# -DTABLING: support for tabling
|
||||||
#
|
#
|
||||||
|
@ -87,7 +87,7 @@ void map_memory(long HeapArea, long GlobalLocalArea, long TrailAuxArea, int n_wo
|
|||||||
#if MMAP_MEMORY_MAPPING_SCHEME
|
#if MMAP_MEMORY_MAPPING_SCHEME
|
||||||
long TotalArea;
|
long TotalArea;
|
||||||
#endif /* MMAP_MEMORY_MAPPING_SCHEME */
|
#endif /* MMAP_MEMORY_MAPPING_SCHEME */
|
||||||
#else /* YAPOR_COPY || SBA */
|
#else /* YAPOR_COPY || YAPOR_SBA */
|
||||||
int i;
|
int i;
|
||||||
long WorkerArea;
|
long WorkerArea;
|
||||||
long TotalArea;
|
long TotalArea;
|
||||||
@ -114,7 +114,7 @@ void map_memory(long HeapArea, long GlobalLocalArea, long TrailAuxArea, int n_wo
|
|||||||
/* I need this for MMAP to know what it must allocate */
|
/* I need this for MMAP to know what it must allocate */
|
||||||
TotalArea = HeapArea;
|
TotalArea = HeapArea;
|
||||||
#endif /* MMAP_MEMORY_MAPPING_SCHEME */
|
#endif /* MMAP_MEMORY_MAPPING_SCHEME */
|
||||||
#else /* YAPOR_COPY || SBA */
|
#else /* YAPOR_COPY || YAPOR_SBA */
|
||||||
/* the others need n stacks */
|
/* the others need n stacks */
|
||||||
WorkerArea = ADJUST_SIZE_TO_PAGE(GlobalLocalArea + TrailAuxArea);
|
WorkerArea = ADJUST_SIZE_TO_PAGE(GlobalLocalArea + TrailAuxArea);
|
||||||
TotalArea = HeapArea + WorkerArea * n_workers;
|
TotalArea = HeapArea + WorkerArea * n_workers;
|
||||||
@ -134,7 +134,7 @@ void map_memory(long HeapArea, long GlobalLocalArea, long TrailAuxArea, int n_wo
|
|||||||
#ifdef ACOW
|
#ifdef ACOW
|
||||||
/* single shared segment in ACOW */
|
/* single shared segment in ACOW */
|
||||||
shm_map_memory(0, HeapArea, mmap_addr);
|
shm_map_memory(0, HeapArea, mmap_addr);
|
||||||
#else /* YAPOR_COPY || SBA */
|
#else /* YAPOR_COPY || YAPOR_SBA */
|
||||||
/* place as segment n otherwise (0..n-1 reserved for worker areas */
|
/* place as segment n otherwise (0..n-1 reserved for worker areas */
|
||||||
shm_map_memory(n_workers, HeapArea, mmap_addr);
|
shm_map_memory(n_workers, HeapArea, mmap_addr);
|
||||||
#endif /* YAPOR_MODEL */
|
#endif /* YAPOR_MODEL */
|
||||||
@ -148,7 +148,7 @@ void map_memory(long HeapArea, long GlobalLocalArea, long TrailAuxArea, int n_wo
|
|||||||
MAP_PRIVATE|MAP_FIXED, private_fd_mapfile, 0) == (void *) -1)
|
MAP_PRIVATE|MAP_FIXED, private_fd_mapfile, 0) == (void *) -1)
|
||||||
Yap_Error(FATAL_ERROR, TermNil, "mmap error (map_memory)");
|
Yap_Error(FATAL_ERROR, TermNil, "mmap error (map_memory)");
|
||||||
close(private_fd_mapfile);
|
close(private_fd_mapfile);
|
||||||
#else /* YAPOR_COPY || SBA */
|
#else /* YAPOR_COPY || YAPOR_SBA */
|
||||||
for (i = 0; i < n_workers; i++) {
|
for (i = 0; i < n_workers; i++) {
|
||||||
/* initialize worker vars */
|
/* initialize worker vars */
|
||||||
worker_area(i) = Yap_GlobalBase + i * WorkerArea;
|
worker_area(i) = Yap_GlobalBase + i * WorkerArea;
|
||||||
@ -160,7 +160,7 @@ void map_memory(long HeapArea, long GlobalLocalArea, long TrailAuxArea, int n_wo
|
|||||||
}
|
}
|
||||||
#endif /* YAPOR_MODEL */
|
#endif /* YAPOR_MODEL */
|
||||||
|
|
||||||
#ifdef SBA
|
#ifdef YAPOR_SBA
|
||||||
/* alloc space for the sparse binding array */
|
/* alloc space for the sparse binding array */
|
||||||
sba_size = WorkerArea * n_workers;
|
sba_size = WorkerArea * n_workers;
|
||||||
if ((binding_array = (char *)malloc(sba_size)) == NULL)
|
if ((binding_array = (char *)malloc(sba_size)) == NULL)
|
||||||
@ -170,7 +170,7 @@ void map_memory(long HeapArea, long GlobalLocalArea, long TrailAuxArea, int n_wo
|
|||||||
}
|
}
|
||||||
sba_offset = binding_array - Yap_GlobalBase;
|
sba_offset = binding_array - Yap_GlobalBase;
|
||||||
sba_end = (int)binding_array + sba_size;
|
sba_end = (int)binding_array + sba_size;
|
||||||
#endif /* SBA */
|
#endif /* YAPOR_SBA */
|
||||||
Yap_TrailBase = Yap_GlobalBase + GlobalLocalArea;
|
Yap_TrailBase = Yap_GlobalBase + GlobalLocalArea;
|
||||||
Yap_LocalBase = Yap_TrailBase - CellSize;
|
Yap_LocalBase = Yap_TrailBase - CellSize;
|
||||||
|
|
||||||
@ -226,7 +226,7 @@ void unmap_memory (void) {
|
|||||||
strcpy(MapFile,"./mapfile");
|
strcpy(MapFile,"./mapfile");
|
||||||
#ifdef ACOW
|
#ifdef ACOW
|
||||||
itos(Yap_master_worker, &MapFile[9]);
|
itos(Yap_master_worker, &MapFile[9]);
|
||||||
#else /* YAPOR_COPY || SBA */
|
#else /* YAPOR_COPY || YAPOR_SBA */
|
||||||
itos(Yap_worker_pid(0), &MapFile[9]);
|
itos(Yap_worker_pid(0), &MapFile[9]);
|
||||||
#endif
|
#endif
|
||||||
if (remove(MapFile) == 0)
|
if (remove(MapFile) == 0)
|
||||||
@ -241,7 +241,7 @@ void remap_memory(void) {
|
|||||||
#ifdef ACOW
|
#ifdef ACOW
|
||||||
/* do nothing */
|
/* do nothing */
|
||||||
#endif /* ACOW */
|
#endif /* ACOW */
|
||||||
#ifdef SBA
|
#ifdef YAPOR_SBA
|
||||||
/* setup workers so that they have different areas */
|
/* setup workers so that they have different areas */
|
||||||
long WorkerArea = worker_offset(1);
|
long WorkerArea = worker_offset(1);
|
||||||
|
|
||||||
@ -249,7 +249,7 @@ void remap_memory(void) {
|
|||||||
Yap_TrailBase += worker_id * WorkerArea;
|
Yap_TrailBase += worker_id * WorkerArea;
|
||||||
Yap_LocalBase += worker_id * WorkerArea;
|
Yap_LocalBase += worker_id * WorkerArea;
|
||||||
Yap_TrailTop += worker_id * WorkerArea;
|
Yap_TrailTop += worker_id * WorkerArea;
|
||||||
#endif /* SBA */
|
#endif /* YAPOR_SBA */
|
||||||
#ifdef YAPOR_COPY
|
#ifdef YAPOR_COPY
|
||||||
void *remap_addr;
|
void *remap_addr;
|
||||||
long remap_offset;
|
long remap_offset;
|
||||||
|
@ -135,7 +135,7 @@ STD_PROTO(static inline qg_sol_fr_ptr CUT_prune_solution_frames, (qg_sol_fr_ptr,
|
|||||||
SCHEDULER_GET_WORK(); \
|
SCHEDULER_GET_WORK(); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(YAPOR_COPY) || defined(SBA) || defined(THREADS)
|
#if defined(YAPOR_COPY) || defined(YAPOR_SBA) || defined(THREADS)
|
||||||
#define SCH_check_share_request() \
|
#define SCH_check_share_request() \
|
||||||
if (SCH_any_share_request) { \
|
if (SCH_any_share_request) { \
|
||||||
ASP = YENV; \
|
ASP = YENV; \
|
||||||
@ -149,7 +149,7 @@ STD_PROTO(static inline qg_sol_fr_ptr CUT_prune_solution_frames, (qg_sol_fr_ptr,
|
|||||||
if (! p_share_work()) \
|
if (! p_share_work()) \
|
||||||
goto shared_fail; \
|
goto shared_fail; \
|
||||||
}
|
}
|
||||||
#endif /* YAPOR_COPY || SBA || ACOW */
|
#endif /* YAPOR_COPY || YAPOR_SBA || ACOW */
|
||||||
|
|
||||||
#define SCH_check_requests() \
|
#define SCH_check_requests() \
|
||||||
SCH_check_prune_request(); \
|
SCH_check_prune_request(); \
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
** ------------------ */
|
** ------------------ */
|
||||||
|
|
||||||
#include "Yap.h"
|
#include "Yap.h"
|
||||||
#ifdef SBA
|
#ifdef YAPOR_SBA
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "Yatom.h"
|
#include "Yatom.h"
|
||||||
#include "YapHeap.h"
|
#include "YapHeap.h"
|
||||||
|
@ -54,17 +54,17 @@
|
|||||||
#error Do not explicitly define YAPOR
|
#error Do not explicitly define YAPOR
|
||||||
#endif /* YAPOR */
|
#endif /* YAPOR */
|
||||||
|
|
||||||
#if (defined(YAPOR_COPY) && (defined(ACOW) || defined(SBA))) || (defined(ACOW) && defined(SBA))
|
#if (defined(YAPOR_COPY) && (defined(ACOW) || defined(YAPOR_SBA))) || (defined(ACOW) && defined(YAPOR_SBA))
|
||||||
#error Do not define multiple or-parallel models
|
#error Do not define multiple or-parallel models
|
||||||
#endif /* (YAPOR_COPY && (ACOW || SBA)) || (ACOW && SBA) */
|
#endif /* (YAPOR_COPY && (ACOW || YAPOR_SBA)) || (ACOW && YAPOR_SBA) */
|
||||||
|
|
||||||
#if defined(YAPOR_COPY) || defined(ACOW) || defined(SBA)
|
#if defined(YAPOR_COPY) || defined(ACOW) || defined(YAPOR_SBA)
|
||||||
#define YAPOR 1
|
#define YAPOR 1
|
||||||
#endif /* YAPOR_COPY || ACOW || SBA */
|
#endif /* YAPOR_COPY || ACOW || YAPOR_SBA */
|
||||||
|
|
||||||
#if defined(TABLING) && (defined(ACOW) || defined(SBA))
|
#if defined(TABLING) && (defined(ACOW) || defined(YAPOR_SBA))
|
||||||
#error Currently TABLING only works with YAPOR_COPY
|
#error Currently TABLING only works with YAPOR_COPY
|
||||||
#endif /* TABLING && (ACOW || SBA) */
|
#endif /* TABLING && (ACOW || YAPOR_SBA) */
|
||||||
|
|
||||||
#ifdef YAPOR
|
#ifdef YAPOR
|
||||||
#define FIXED_STACKS 1
|
#define FIXED_STACKS 1
|
||||||
@ -86,7 +86,7 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SBA
|
#ifdef YAPOR_SBA
|
||||||
#ifdef YAPOR
|
#ifdef YAPOR
|
||||||
#ifndef FROZEN_STACKS
|
#ifndef FROZEN_STACKS
|
||||||
#define FROZEN_STACKS 1
|
#define FROZEN_STACKS 1
|
||||||
@ -614,7 +614,7 @@ and RefOfTerm(t) : Term -> DBRef = ...
|
|||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#if defined(SBA) && defined(__linux__)
|
#if defined(YAPOR_SBA) && defined(__linux__)
|
||||||
#define MBIT /* 0x20000000 */ MKTAG(0x1,0) /* mark bit */
|
#define MBIT /* 0x20000000 */ MKTAG(0x1,0) /* mark bit */
|
||||||
#else
|
#else
|
||||||
#define RBIT /* 0x20000000 */ MKTAG(0x1,0) /* relocation chain bit */
|
#define RBIT /* 0x20000000 */ MKTAG(0x1,0) /* relocation chain bit */
|
||||||
@ -643,7 +643,7 @@ inline EXTERN Term * VarOfTerm(Term t)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if SBA
|
#if YAPOR_SBA
|
||||||
|
|
||||||
inline EXTERN Term MkVarTerm(void);
|
inline EXTERN Term MkVarTerm(void);
|
||||||
|
|
||||||
@ -826,7 +826,7 @@ inline EXTERN Int IntegerOfTerm(Term t)
|
|||||||
|
|
||||||
/*************** unification routines ***********************************/
|
/*************** unification routines ***********************************/
|
||||||
|
|
||||||
#if SBA
|
#if YAPOR_SBA
|
||||||
#include "or.sbaamiops.h"
|
#include "or.sbaamiops.h"
|
||||||
#else
|
#else
|
||||||
#include "amiops.h"
|
#include "amiops.h"
|
||||||
@ -1047,7 +1047,7 @@ extern int snoozing;
|
|||||||
#include "opt.proto.h"
|
#include "opt.proto.h"
|
||||||
#endif /* YAPOR || TABLING */
|
#endif /* YAPOR || TABLING */
|
||||||
|
|
||||||
#if SBA
|
#if YAPOR_SBA
|
||||||
#include "or.sbaunify.h"
|
#include "or.sbaunify.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ SDeref (Term a)
|
|||||||
{
|
{
|
||||||
Term *b = (Term *) a;
|
Term *b = (Term *) a;
|
||||||
a = *b;
|
a = *b;
|
||||||
#if SBA
|
#if YAPOR_SBA
|
||||||
if (a == (0))
|
if (a == (0))
|
||||||
return (CELL) b;
|
return (CELL) b;
|
||||||
#else
|
#else
|
||||||
@ -50,7 +50,7 @@ SDerefa (CELL * b)
|
|||||||
Term a = *b;
|
Term a = *b;
|
||||||
while (IsVarTerm (a))
|
while (IsVarTerm (a))
|
||||||
{
|
{
|
||||||
#if SBA
|
#if YAPOR_SBA
|
||||||
if (a == (0))
|
if (a == (0))
|
||||||
return (CELL) b;
|
return (CELL) b;
|
||||||
#else
|
#else
|
||||||
@ -69,7 +69,7 @@ SADerefa (CELL * b)
|
|||||||
Term a = *b;
|
Term a = *b;
|
||||||
while (IsVarTerm (a))
|
while (IsVarTerm (a))
|
||||||
{
|
{
|
||||||
#if SBA
|
#if YAPOR_SBA
|
||||||
if (a == (0))
|
if (a == (0))
|
||||||
return b;
|
return b;
|
||||||
#else
|
#else
|
||||||
|
2
configure
vendored
2
configure
vendored
@ -7492,7 +7492,7 @@ fi
|
|||||||
|
|
||||||
case "$orparallelism" in
|
case "$orparallelism" in
|
||||||
sba)
|
sba)
|
||||||
YAP_EXTRAS="$YAP_EXTRAS -DSBA=1"
|
YAP_EXTRAS="$YAP_EXTRAS -DYAPOR_SBA=1"
|
||||||
;;
|
;;
|
||||||
a-cow)
|
a-cow)
|
||||||
YAP_EXTRAS="$YAP_EXTRAS -DACOW=1"
|
YAP_EXTRAS="$YAP_EXTRAS -DACOW=1"
|
||||||
|
@ -1276,7 +1276,7 @@ fi
|
|||||||
|
|
||||||
case "$orparallelism" in
|
case "$orparallelism" in
|
||||||
sba)
|
sba)
|
||||||
YAP_EXTRAS="$YAP_EXTRAS -DSBA=1"
|
YAP_EXTRAS="$YAP_EXTRAS -DYAPOR_SBA=1"
|
||||||
;;
|
;;
|
||||||
a-cow)
|
a-cow)
|
||||||
YAP_EXTRAS="$YAP_EXTRAS -DACOW=1"
|
YAP_EXTRAS="$YAP_EXTRAS -DACOW=1"
|
||||||
|
@ -149,14 +149,14 @@ print_usage(void)
|
|||||||
#ifdef TABLING
|
#ifdef TABLING
|
||||||
fprintf(stderr," -ts Maximum table space area in Mbytes (default: unlimited)\n");
|
fprintf(stderr," -ts Maximum table space area in Mbytes (default: unlimited)\n");
|
||||||
#endif /* TABLING */
|
#endif /* TABLING */
|
||||||
#if defined(YAPOR_COPY) || defined(ACOW) || defined(SBA)
|
#if defined(YAPOR_COPY) || defined(ACOW) || defined(YAPOR_SBA)
|
||||||
fprintf(stderr," -w Number of workers (default: %d)\n",
|
fprintf(stderr," -w Number of workers (default: %d)\n",
|
||||||
DEFAULT_NUMBERWORKERS);
|
DEFAULT_NUMBERWORKERS);
|
||||||
fprintf(stderr," -sl Loop scheduler executions before look for hiden shared work (default: %d)\n",
|
fprintf(stderr," -sl Loop scheduler executions before look for hiden shared work (default: %d)\n",
|
||||||
DEFAULT_SCHEDULERLOOP);
|
DEFAULT_SCHEDULERLOOP);
|
||||||
fprintf(stderr," -d Value of delayed release of load (default: %d)\n",
|
fprintf(stderr," -d Value of delayed release of load (default: %d)\n",
|
||||||
DEFAULT_DELAYEDRELEASELOAD);
|
DEFAULT_DELAYEDRELEASELOAD);
|
||||||
#endif /* YAPOR_COPY || ACOW || SBA */
|
#endif /* YAPOR_COPY || ACOW || YAPOR_SBA */
|
||||||
/* nf: Preprocessor */
|
/* nf: Preprocessor */
|
||||||
/* fprintf(stderr," -DVar=Name Persistent definition\n"); */
|
/* fprintf(stderr," -DVar=Name Persistent definition\n"); */
|
||||||
fprintf(stderr,"\n");
|
fprintf(stderr,"\n");
|
||||||
@ -245,7 +245,7 @@ parse_yap_arguments(int argc, char *argv[], YAP_init_args *iap)
|
|||||||
case 'q':
|
case 'q':
|
||||||
iap->QuietMode = TRUE;
|
iap->QuietMode = TRUE;
|
||||||
break;
|
break;
|
||||||
#if defined(YAPOR_COPY) || defined(ACOW) || defined(SBA)
|
#if defined(YAPOR_COPY) || defined(ACOW) || defined(YAPOR_SBA)
|
||||||
case 'w':
|
case 'w':
|
||||||
ssize = &(iap->NumberWorkers);
|
ssize = &(iap->NumberWorkers);
|
||||||
goto GetSize;
|
goto GetSize;
|
||||||
@ -258,7 +258,7 @@ parse_yap_arguments(int argc, char *argv[], YAP_init_args *iap)
|
|||||||
case 'd':
|
case 'd':
|
||||||
if (!strcmp("dump-runtime-variables",p))
|
if (!strcmp("dump-runtime-variables",p))
|
||||||
return dump_runtime_variables();
|
return dump_runtime_variables();
|
||||||
#endif /* YAPOR_COPY || ACOW || SBA */
|
#endif /* YAPOR_COPY || ACOW || YAPOR_SBA */
|
||||||
#ifdef USE_SOCKET
|
#ifdef USE_SOCKET
|
||||||
case 'c': /* running as client */
|
case 'c': /* running as client */
|
||||||
{
|
{
|
||||||
@ -386,12 +386,12 @@ parse_yap_arguments(int argc, char *argv[], YAP_init_args *iap)
|
|||||||
case 's':
|
case 's':
|
||||||
case 'S':
|
case 'S':
|
||||||
ssize = &(iap->StackSize);
|
ssize = &(iap->StackSize);
|
||||||
#if defined(YAPOR_COPY) || defined(ACOW) || defined(SBA)
|
#if defined(YAPOR_COPY) || defined(ACOW) || defined(YAPOR_SBA)
|
||||||
if (p[1] == 'l') {
|
if (p[1] == 'l') {
|
||||||
p++;
|
p++;
|
||||||
ssize = &(iap->SchedulerLoop);
|
ssize = &(iap->SchedulerLoop);
|
||||||
}
|
}
|
||||||
#endif /* YAPOR_COPY || ACOW || SBA */
|
#endif /* YAPOR_COPY || ACOW || YAPOR_SBA */
|
||||||
goto GetSize;
|
goto GetSize;
|
||||||
case 'a':
|
case 'a':
|
||||||
case 'A':
|
case 'A':
|
||||||
|
@ -106,7 +106,7 @@ CELL** ip_top iptop =NULL
|
|||||||
#if GC_NO_TAGS
|
#if GC_NO_TAGS
|
||||||
char* b_p Yap_bp =NULL
|
char* b_p Yap_bp =NULL
|
||||||
#endif
|
#endif
|
||||||
#if defined(TABLING) || defined(SBA)
|
#if defined(TABLING) || defined(YAPOR_SBA)
|
||||||
struct trail_frame* wl_sTR sTR =NULL
|
struct trail_frame* wl_sTR sTR =NULL
|
||||||
struct trail_frame* wl_sTR0 sTR0 =NULL
|
struct trail_frame* wl_sTR0 sTR0 =NULL
|
||||||
struct trail_frame* new_tr new_TR =NULL
|
struct trail_frame* new_tr new_TR =NULL
|
||||||
|
Reference in New Issue
Block a user