diff --git a/H/Heap.h b/H/Heap.h index 5b15b6420..bcedcce4a 100644 --- a/H/Heap.h +++ b/H/Heap.h @@ -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 diff --git a/H/Regs.h b/H/Regs.h index 863af5b6e..eeda3f963 100644 --- a/H/Regs.h +++ b/H/Regs.h @@ -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 */ diff --git a/H/YapOpcodes.h b/H/YapOpcodes.h index 30a156bee..d7fe68613 100644 --- a/H/YapOpcodes.h +++ b/H/YapOpcodes.h @@ -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), diff --git a/H/absmi.h b/H/absmi.h index f877dfb49..71db9c474 100644 --- a/H/absmi.h +++ b/H/absmi.h @@ -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 diff --git a/H/compile.h b/H/compile.h index 7625faa57..b5644c374 100644 --- a/H/compile.h +++ b/H/compile.h @@ -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 diff --git a/H/rheap.h b/H/rheap.h index cb9125427..d6c7c6a5b 100644 --- a/H/rheap.h +++ b/H/rheap.h @@ -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 */