My first attempt to synchronize OPTYap with CVS

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@919 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
ricroc 2003-11-05 18:55:03 +00:00
parent 5a2d51d07c
commit 17dad3f6f7
6 changed files with 36 additions and 30 deletions

View File

@ -10,7 +10,7 @@
* File: Heap.h *
* mods: *
* comments: Heap Init Structure *
* version: $Id: Heap.h,v 1.45 2003-10-28 01:16:02 vsc Exp $ *
* version: $Id: Heap.h,v 1.46 2003-11-05 18:55:03 ricroc Exp $ *
*************************************************************************/
/* information that can be stored in Code Space */
@ -340,7 +340,7 @@ typedef struct various_codes {
#if defined(YAPOR) || defined(TABLING)
struct global_data global;
struct local_data remote[MAX_WORKERS];
#endif
#endif /* YAPOR || TABLING */
UInt n_of_atoms;
UInt atom_hash_table_size;
AtomHashEntry *hash_chain;
@ -598,9 +598,9 @@ typedef struct various_codes {
#define UndefCode heap_regs->undef_code
#define SpyCode heap_regs->spy_code
#if defined(YAPOR) || defined(TABLING)
#define REMOTE heap_regs->remote
#define GLOBAL heap_regs->global
#endif
#define REMOTE heap_regs->remote
#endif /* YAPOR || TABLING */
#define UPDATE_MODE_IMMEDIATE 0
#define UPDATE_MODE_LOGICAL 1

View File

@ -10,7 +10,7 @@
* File: Regs.h *
* mods: *
* comments: YAP abstract machine registers *
* version: $Id: Regs.h,v 1.20 2003-02-14 12:20:57 vsc Exp $ *
* version: $Id: Regs.h,v 1.21 2003-11-05 18:55:03 ricroc Exp $ *
*************************************************************************/
@ -61,9 +61,9 @@ typedef struct
{
CELL CreepFlag_; /* 13 */
CELL *HB_; /* 4 heap (global) stack top at latest c.p. */
#if (defined(YAPOR) && defined(SBA)) || defined(TABLING)
#if defined(SBA) || defined(TABLING)
choiceptr BB_; /* 4 local stack top at latest c.p. */
#endif
#endif /* 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 */
@ -95,11 +95,11 @@ typedef struct
#endif
#endif
SMALLUNSGN CurrentModule_;
#if (defined(YAPOR) && defined(SBA)) || defined(TABLING)
#if defined(SBA) || defined(TABLING)
CELL *H_FZ_;
choiceptr B_FZ_;
tr_fr_ptr TR_FZ_;
#endif
#endif /* SBA || TABLING */
#if defined(YAPOR) || defined(THREADS)
unsigned int worker_id_;
#ifdef SBA
@ -638,11 +638,11 @@ EXTERN inline void restore_B(void) {
#define FlipFlop Yap_REGS.FlipFlop_
#define EX Yap_REGS.EX_
#define DEPTH Yap_REGS.DEPTH_
#if (defined(YAPOR) && defined(SBA)) || defined(TABLING)
#if defined(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
#endif /* SBA || TABLING */
#if defined(YAPOR) || defined(THREADS)
#define worker_id (Yap_REGS.worker_id_)
#ifdef SBA
@ -687,10 +687,10 @@ EXTERN inline void restore_B(void) {
#define HBREG HB
#if (defined(YAPOR) && defined(SBA)) || defined(TABLING)
#if defined(SBA) || defined(TABLING)
#define BB Yap_REGS.BB_
#define BBREG BB
#endif
#endif /* SBA || TABLING */
#if !THREADS
/* use actual addresses for regs */

View File

@ -58,6 +58,9 @@
OPCODE(trie_try_struct ,e),
OPCODE(trie_retry_struct ,e),
#endif /* TABLING */
#ifdef TABLING_INNER_CUTS
OPCODE(clause_with_cut ,e),
#endif /* TABLING_INNER_CUTS */
OPCODE(try_me ,ld),
OPCODE(retry_me ,ld),
OPCODE(trust_me ,ld),

View File

@ -809,7 +809,7 @@ Macros to check the limits of stacks
#define SET_BB(V) BBREG = (V)
#else
#define SET_BB(V)
#endif
#endif /* FROZEN_STACKS && !BFZ_TRAIL_SCHEME */
#ifdef FROZEN_STACKS
@ -827,13 +827,13 @@ Macros to check the limits of stacks
#define PROTECT_FROZEN_B(CPTR) ((CPTR) < B_FZ && (CPTR) > (choiceptr)H_FZ ? (CPTR) : B_FZ )
*/
#else
#define PROTECT_FROZEN_B(CPTR) (YOUNGER_CP(CPTR, B_FZ) ? CPTR : B_FZ)
#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 */
#else
#define PROTECT_FROZEN_H(CPTR) (CPTR)->cp_h
#endif /* TABLING */
#endif /* FROZEN_STACKS */
#define restore_yaam_regs(AP) \
{ register CELL *x1 = B_YREG->cp_env; \
@ -1099,7 +1099,9 @@ Macros to check the limits of stacks
#endif
#if FROZEN_STACKS
#if defined(SBA) || defined(MULTI_ASSIGNMENT_VARIABLES)
#define trim_trail(B, TR, HBREG) (TR)
#elif FROZEN_STACKS
static inline tr_fr_ptr
trim_trail(choiceptr b, tr_fr_ptr tr, CELL *hbreg)
{
@ -1126,11 +1128,6 @@ trim_trail(choiceptr b, tr_fr_ptr tr, CELL *hbreg)
ENDD(d0);
return(TR);
}
#elif defined(SBA) || defined(MULTI_ASSIGNMENT_VARIABLES)
#define trim_trail(B, TR, HBREG) (TR)
#else
static inline tr_fr_ptr
trim_trail(choiceptr b, tr_fr_ptr tr, CELL *hbreg)
@ -1153,7 +1150,7 @@ trim_trail(choiceptr b, tr_fr_ptr tr, CELL *hbreg)
ENDD(d0);
return(TR);
}
#endif /* FROZEN_STACKS */
#endif
#if IN_ABSMI_C || IN_UNIFY_C

View File

@ -133,12 +133,15 @@ typedef enum compiler_op {
restore_tmps_and_skip_op,
enter_lu_op,
empty_call_op,
#ifdef TABLING
table_new_answer_op,
#endif /* TABLING */
#ifdef YAPOR
sync_op,
#endif /* YAPOR */
#ifdef TABLING
table_new_answer_op,
#endif /* TABLING */
#ifdef TABLING_INNER_CUTS
clause_with_cut_op,
#endif /* TABLING_INNER_CUTS */
fetch_args_for_bccall,
bccall_op,
blob_op

View File

@ -656,7 +656,7 @@ RestoreClause(yamop *pc, PredEntry *pp, int mode)
case _table_trust_me:
case _table_answer_resolution:
case _table_completion:
#endif
#endif /* TABLING */
pc->u.ld.p = PtoPredAdjust(pc->u.ld.p);
pc->u.ld.d = PtoOpAdjust(pc->u.ld.d);
pc = NEXTOP(pc,ld);
@ -750,7 +750,10 @@ RestoreClause(yamop *pc, PredEntry *pp, int mode)
case _trie_trust_struct:
case _trie_try_struct:
case _trie_retry_struct:
#endif
#endif /* TABLING */
#ifdef TABLING_INNER_CUTS
case _clause_with_cut:
#endif /* TABLING_INNER_CUTS */
pc = NEXTOP(pc,e);
break;
/* instructions type x */
@ -1002,7 +1005,7 @@ RestoreClause(yamop *pc, PredEntry *pp, int mode)
case _pop_n:
#ifdef TABLING
case _table_new_answer:
#endif
#endif /* TABLING */
pc = NEXTOP(pc,s);
break;
/* instructions type c */