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