removed unnecessary cut_c macros (always on)
This commit is contained in:
parent
1d7407ba4d
commit
3cad9c37b1
20
C/absmi.c
20
C/absmi.c
@ -497,9 +497,7 @@
|
||||
#include "absmi.h"
|
||||
#include "heapgc.h"
|
||||
|
||||
#ifdef CUT_C
|
||||
#include "cut_c.h"
|
||||
#endif
|
||||
|
||||
#ifdef PUSH_X
|
||||
#else
|
||||
@ -2688,14 +2686,12 @@ Yap_absmi(int inp)
|
||||
|
||||
/* trust_fail */
|
||||
BOp(trust_fail, e);
|
||||
#ifdef CUT_C
|
||||
{
|
||||
while (POP_CHOICE_POINT(B->cp_b))
|
||||
{
|
||||
POP_EXECUTE();
|
||||
}
|
||||
}
|
||||
#endif /* CUT_C */
|
||||
#ifdef YAPOR
|
||||
{
|
||||
choiceptr cut_pt;
|
||||
@ -3603,11 +3599,9 @@ Yap_absmi(int inp)
|
||||
|
||||
/* cut */
|
||||
BACKUP_B();
|
||||
#ifdef CUT_C
|
||||
while (POP_CHOICE_POINT(B->cp_b)) {
|
||||
POP_EXECUTE();
|
||||
}
|
||||
#endif /* CUT_C */
|
||||
B = B->cp_b; /* cut_fail */
|
||||
HB = B->cp_h; /* cut_fail */
|
||||
RECOVER_B();
|
||||
@ -7659,10 +7653,8 @@ Yap_absmi(int inp)
|
||||
CUT_wait_leftmost();
|
||||
#endif /* YAPOR */
|
||||
CACHE_Y(YREG);
|
||||
#ifdef CUT_C
|
||||
/* Alocate space for the cut_c structure*/
|
||||
CUT_C_PUSH(NEXTOP(NEXTOP(PREG,OtapFs),OtapFs),S_YREG);
|
||||
#endif
|
||||
S_YREG = S_YREG - PREG->u.OtapFs.extra;
|
||||
store_args(PREG->u.OtapFs.s);
|
||||
store_yaam_regs(NEXTOP(PREG, OtapFs), 0);
|
||||
@ -7680,21 +7672,17 @@ Yap_absmi(int inp)
|
||||
saveregs();
|
||||
SREG = (CELL *) ((f) (PASS_REGS1));
|
||||
/* This last instruction changes B B*/
|
||||
#ifdef CUT_C
|
||||
while (POP_CHOICE_POINT(B)){
|
||||
cut_c_pop();
|
||||
}
|
||||
#endif
|
||||
setregs();
|
||||
}
|
||||
if (!SREG) {
|
||||
#ifdef CUT_C
|
||||
/* Removes the cut functions from the stack
|
||||
without executing them because we have fail
|
||||
and not cuted the predicate*/
|
||||
while(POP_CHOICE_POINT(B))
|
||||
cut_c_pop();
|
||||
#endif
|
||||
FAIL();
|
||||
}
|
||||
if ((CELL *) B == YREG && ASP != (CELL *) B) {
|
||||
@ -7727,7 +7715,6 @@ Yap_absmi(int inp)
|
||||
goto TRYCC;
|
||||
ENDBOp();
|
||||
|
||||
#ifdef CUT_C
|
||||
BOp(cut_c, OtapFs);
|
||||
/*This is a phantom instruction. This is not executed by the WAM*/
|
||||
#ifdef DEBUG
|
||||
@ -7736,17 +7723,14 @@ Yap_absmi(int inp)
|
||||
printf ("ERROR: Should not print this message FILE: absmi.c %d\n",__LINE__);
|
||||
#endif /*DEBUG*/
|
||||
ENDBOp();
|
||||
#endif
|
||||
|
||||
BOp(try_userc, OtapFs);
|
||||
#ifdef YAPOR
|
||||
CUT_wait_leftmost();
|
||||
#endif /* YAPOR */
|
||||
CACHE_Y(YREG);
|
||||
#ifdef CUT_C
|
||||
/* Alocate space for the cut_c structure*/
|
||||
CUT_C_PUSH(NEXTOP(NEXTOP(PREG,OtapFs),OtapFs),S_YREG);
|
||||
#endif
|
||||
S_YREG = S_YREG - PREG->u.OtapFs.extra;
|
||||
store_args(PREG->u.OtapFs.s);
|
||||
store_yaam_regs(NEXTOP(PREG, OtapFs), 0);
|
||||
@ -7806,13 +7790,11 @@ Yap_absmi(int inp)
|
||||
setregs();
|
||||
LOCAL_PrologMode &= ~UserCCallMode;
|
||||
if (!SREG) {
|
||||
#ifdef CUT_C
|
||||
/* Removes the cut functions from the stack
|
||||
without executing them because we have fail
|
||||
and not cuted the predicate*/
|
||||
while(POP_CHOICE_POINT(B))
|
||||
cut_c_pop();
|
||||
#endif
|
||||
FAIL();
|
||||
}
|
||||
if ((CELL *) B == YREG && ASP != (CELL *) B) {
|
||||
@ -7828,7 +7810,6 @@ Yap_absmi(int inp)
|
||||
JMPNext();
|
||||
ENDBOp();
|
||||
|
||||
#ifdef CUT_C
|
||||
BOp(cut_userc, OtapFs);
|
||||
/*This is a phantom instruction. This is not executed by the WAM*/
|
||||
#ifdef DEBUG
|
||||
@ -7839,7 +7820,6 @@ Yap_absmi(int inp)
|
||||
CACHE_A1();
|
||||
JMPNext();
|
||||
ENDBOp();
|
||||
#endif
|
||||
|
||||
|
||||
/************************************************************************\
|
||||
|
@ -363,9 +363,7 @@
|
||||
#include "or.macros.h"
|
||||
#endif /* YAPOR */
|
||||
#include "threads.h"
|
||||
#ifdef CUT_C
|
||||
#include "cut_c.h"
|
||||
#endif /* CUT_C */
|
||||
#if HAVE_MALLOC_H
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
@ -515,10 +513,8 @@ X_API void YAP_PredicateInfo(void *,Atom *,UInt *,Term *);
|
||||
X_API void YAP_UserCPredicate(char *,CPredicate,UInt);
|
||||
X_API void YAP_UserBackCPredicate(char *,CPredicate,CPredicate,UInt,unsigned int);
|
||||
X_API void YAP_UserCPredicateWithArgs(char *,CPredicate,UInt,Term);
|
||||
#ifdef CUT_C
|
||||
X_API void YAP_UserBackCutCPredicate(char *,CPredicate,CPredicate,CPredicate,UInt,unsigned int);
|
||||
X_API void *YAP_ExtraSpaceCut(void);
|
||||
#endif
|
||||
X_API Term YAP_SetCurrentModule(Term);
|
||||
X_API Term YAP_CurrentModule(void);
|
||||
X_API Term YAP_CreateModule(Atom);
|
||||
@ -1166,7 +1162,6 @@ YAP_ArityOfFunctor(Functor f)
|
||||
return (ArityOfFunctor(f));
|
||||
}
|
||||
|
||||
#ifdef CUT_C
|
||||
X_API void *
|
||||
YAP_ExtraSpaceCut(void)
|
||||
{
|
||||
@ -1179,7 +1174,6 @@ YAP_ExtraSpaceCut(void)
|
||||
RECOVER_B();
|
||||
return(ptr);
|
||||
}
|
||||
#endif /*CUT_C*/
|
||||
|
||||
X_API void *
|
||||
YAP_ExtraSpace(void)
|
||||
@ -1203,14 +1197,12 @@ YAP_cut_up(void)
|
||||
{
|
||||
CACHE_REGS
|
||||
BACKUP_B();
|
||||
#ifdef CUT_C
|
||||
{
|
||||
while (POP_CHOICE_POINT(B->cp_b))
|
||||
{
|
||||
POP_EXECUTE();
|
||||
}
|
||||
}
|
||||
#endif /* CUT_C */
|
||||
/* This is complicated: make sure we can restore the ASP
|
||||
pointer back to where cut_up called it. Slots depend on it. */
|
||||
if (ENV > B->cp_env) {
|
||||
@ -3505,23 +3497,16 @@ X_API void
|
||||
YAP_UserBackCPredicate(char *name, CPredicate init, CPredicate cont,
|
||||
UInt arity, unsigned int extra)
|
||||
{
|
||||
#ifdef CUT_C
|
||||
Yap_InitCPredBackCut(name, arity, extra, init, cont, NULL ,UserCPredFlag);
|
||||
#else
|
||||
Yap_InitCPredBack(name, arity, extra, init, cont, UserCPredFlag);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#ifdef CUT_C
|
||||
X_API void
|
||||
YAP_UserBackCutCPredicate(char *name, CPredicate init, CPredicate cont, CPredicate cut,
|
||||
UInt arity, unsigned int extra)
|
||||
{
|
||||
Yap_InitCPredBackCut(name, arity, extra, init, cont, cut, UserCPredFlag);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
X_API void
|
||||
YAP_UserCPredicateWithArgs(char *a, CPredicate f, UInt arity, Term mod)
|
||||
|
@ -1,5 +1,3 @@
|
||||
#ifdef CUT_C
|
||||
|
||||
#include "Yap.h"
|
||||
#include "cut_c.h"
|
||||
#include <stdio.h>
|
||||
@ -33,5 +31,3 @@ void cut_c_push(cut_c_str_ptr new_top){
|
||||
Yap_REGS.CUT_C_TOP=new_top;
|
||||
return;
|
||||
}
|
||||
|
||||
#endif /*CUT_C*/
|
||||
|
6
C/exec.c
6
C/exec.c
@ -22,9 +22,7 @@ static char SccsId[] = "@(#)cdmgr.c 1.1 05/02/98";
|
||||
#include "pl-shared.h"
|
||||
#include "yapio.h"
|
||||
#include "attvar.h"
|
||||
#ifdef CUT_C
|
||||
#include "cut_c.h"
|
||||
#endif
|
||||
|
||||
static Int CallPredicate(PredEntry *, choiceptr, yamop * CACHE_TYPE);
|
||||
static Int EnterCreepMode(Term, Term CACHE_TYPE);
|
||||
@ -1229,7 +1227,6 @@ execute_pred(PredEntry *ppe, CELL *pt USES_REGS)
|
||||
/* restore the old environment */
|
||||
/* get to previous environment */
|
||||
cut_B = (choiceptr)ENV[E_CB];
|
||||
#ifdef CUT_C
|
||||
{
|
||||
/* Note that
|
||||
cut_B == (choiceptr)ENV[E_CB] */
|
||||
@ -1238,7 +1235,6 @@ execute_pred(PredEntry *ppe, CELL *pt USES_REGS)
|
||||
POP_EXECUTE();
|
||||
}
|
||||
}
|
||||
#endif /* CUT_C */
|
||||
#ifdef YAPOR
|
||||
CUT_prune_to(cut_B);
|
||||
#endif /* YAPOR */
|
||||
@ -1799,9 +1795,7 @@ Yap_InitYaamRegs( int myworker_id )
|
||||
#endif
|
||||
Yap_AllocateDefaultArena(128*1024, 2, myworker_id);
|
||||
Yap_InitPreAllocCodeSpace( myworker_id );
|
||||
#ifdef CUT_C
|
||||
cut_c_initialize( myworker_id );
|
||||
#endif
|
||||
Yap_PrepGoal(0, NULL, NULL PASS_REGS);
|
||||
#ifdef TABLING
|
||||
/* ensure that LOCAL_top_dep_fr is always valid */
|
||||
|
6
C/grow.c
6
C/grow.c
@ -22,9 +22,7 @@
|
||||
#include "sshift.h"
|
||||
#include "compile.h"
|
||||
#include "attvar.h"
|
||||
#ifdef CUT_C
|
||||
#include "cut_c.h"
|
||||
#endif /* CUT_C */
|
||||
#if HAVE_STRING_H
|
||||
#include <string.h>
|
||||
#endif
|
||||
@ -137,10 +135,8 @@ SetHeapRegs(int copying_threads USES_REGS)
|
||||
UNLOCK(LOCAL_SignalLock);
|
||||
if (HR)
|
||||
HR = PtoGloAdjust(HR);
|
||||
#ifdef CUT_C
|
||||
if (Yap_REGS.CUT_C_TOP)
|
||||
Yap_REGS.CUT_C_TOP = CutCAdjust(Yap_REGS.CUT_C_TOP);
|
||||
#endif
|
||||
if (HB)
|
||||
HB = PtoGloAdjust(HB);
|
||||
if (LOCAL_OpenArray)
|
||||
@ -1986,9 +1982,7 @@ Yap_CopyThreadStacks(int worker_q, int worker_p, int incremental)
|
||||
if (ASP > CellPtr(B))
|
||||
ASP = CellPtr(B);
|
||||
LCL0 = REMOTE_ThreadHandle(worker_p).current_yaam_regs->LCL0_;
|
||||
#ifdef CUT_C
|
||||
Yap_REGS.CUT_C_TOP = REMOTE_ThreadHandle(worker_p).current_yaam_regs->CUT_C_TOP;
|
||||
#endif
|
||||
LOCAL_DynamicArrays = NULL;
|
||||
LOCAL_StaticArrays = NULL;
|
||||
LOCAL_GlobalVariables = NULL;
|
||||
|
14
C/index.c
14
C/index.c
@ -492,9 +492,7 @@ static char SccsId[] = "%W% %G%";
|
||||
#if HAVE_STRING_H
|
||||
#include <string.h>
|
||||
#endif
|
||||
#ifdef CUT_C
|
||||
#include "cut_c.h"
|
||||
#endif
|
||||
|
||||
#if defined(YAPOR) || defined(THREADS)
|
||||
#define SET_JLBL(X) jlbl = &(ipc->u.X)
|
||||
@ -6200,14 +6198,12 @@ Yap_FollowIndexingCode(PredEntry *ap, yamop *ipc, Term Terms[3], yamop *ap_pc, y
|
||||
#if TABLING
|
||||
case _table_trust:
|
||||
#endif
|
||||
#ifdef CUT_C
|
||||
{
|
||||
while (POP_CHOICE_POINT(B->cp_b))
|
||||
{
|
||||
POP_EXECUTE();
|
||||
}
|
||||
}
|
||||
#endif /* CUT_C */
|
||||
#ifdef YAPOR
|
||||
{
|
||||
choiceptr cut_pt;
|
||||
@ -6230,14 +6226,12 @@ Yap_FollowIndexingCode(PredEntry *ap, yamop *ipc, Term Terms[3], yamop *ap_pc, y
|
||||
case _table_trust_me:
|
||||
#endif
|
||||
b0 = B;
|
||||
#ifdef CUT_C
|
||||
{
|
||||
while (POP_CHOICE_POINT(B->cp_b))
|
||||
{
|
||||
POP_EXECUTE();
|
||||
}
|
||||
}
|
||||
#endif /* CUT_C */
|
||||
#ifdef YAPOR
|
||||
{
|
||||
choiceptr cut_pt;
|
||||
@ -6369,7 +6363,7 @@ Yap_FollowIndexingCode(PredEntry *ap, yamop *ipc, Term Terms[3], yamop *ap_pc, y
|
||||
LogUpdClause *lcl = ipc->u.OtILl.d;
|
||||
/* make sure we don't erase the clause we are jumping to, notice that
|
||||
ErLogUpdIndex may remove several references in one go.
|
||||
Notice we only need to do this if we´ re jumping to the clause.
|
||||
Notice we only need to do this if we´ re jumping to the clause.
|
||||
*/
|
||||
if (newpc && !(lcl->ClFlags & (DirtyMask|InUseMask))) {
|
||||
lcl->ClFlags |= InUseMask;
|
||||
@ -6383,14 +6377,12 @@ Yap_FollowIndexingCode(PredEntry *ap, yamop *ipc, Term Terms[3], yamop *ap_pc, y
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#ifdef CUT_C
|
||||
{
|
||||
while (POP_CHOICE_POINT(B->cp_b))
|
||||
{
|
||||
POP_EXECUTE();
|
||||
}
|
||||
}
|
||||
#endif /* CUT_C */
|
||||
#ifdef YAPOR
|
||||
{
|
||||
choiceptr cut_pt;
|
||||
@ -6657,14 +6649,12 @@ Yap_FollowIndexingCode(PredEntry *ap, yamop *ipc, Term Terms[3], yamop *ap_pc, y
|
||||
return NULL;
|
||||
default:
|
||||
if (b0) {
|
||||
#ifdef CUT_C
|
||||
{
|
||||
while (POP_CHOICE_POINT(B->cp_b))
|
||||
{
|
||||
POP_EXECUTE();
|
||||
}
|
||||
}
|
||||
#endif /* CUT_C */
|
||||
#ifdef YAPOR
|
||||
{
|
||||
choiceptr cut_pt;
|
||||
@ -6687,14 +6677,12 @@ Yap_FollowIndexingCode(PredEntry *ap, yamop *ipc, Term Terms[3], yamop *ap_pc, y
|
||||
}
|
||||
if (b0) {
|
||||
/* I did a trust */
|
||||
#ifdef CUT_C
|
||||
{
|
||||
while (POP_CHOICE_POINT(B->cp_b))
|
||||
{
|
||||
POP_EXECUTE();
|
||||
}
|
||||
}
|
||||
#endif /* CUT_C */
|
||||
#ifdef YAPOR
|
||||
{
|
||||
choiceptr cut_pt;
|
||||
|
41
C/init.c
41
C/init.c
@ -69,11 +69,7 @@ static void InTTYLine(char *);
|
||||
static void SetOp(int, int, char *, Term);
|
||||
static void InitOps(void);
|
||||
static void InitDebug(void);
|
||||
#ifdef CUT_C
|
||||
static void CleanBack(PredEntry *, CPredicate, CPredicate, CPredicate);
|
||||
#else
|
||||
static void CleanBack(PredEntry *, CPredicate, CPredicate);
|
||||
#endif
|
||||
static void InitStdPreds(void);
|
||||
static void InitFlags(void);
|
||||
static void InitCodes(void);
|
||||
@ -682,11 +678,7 @@ Yap_InitAsmPred(char *Name, unsigned long int Arity, int code, CPredicate def,
|
||||
|
||||
|
||||
static void
|
||||
#ifdef CUT_C
|
||||
CleanBack(PredEntry *pe, CPredicate Start, CPredicate Cont, CPredicate Cut)
|
||||
#else
|
||||
CleanBack(PredEntry *pe, CPredicate Start, CPredicate Cont)
|
||||
#endif
|
||||
{
|
||||
yamop *code;
|
||||
if (pe->cs.p_code.FirstClause != pe->cs.p_code.LastClause ||
|
||||
@ -717,7 +709,6 @@ CleanBack(PredEntry *pe, CPredicate Start, CPredicate Cont)
|
||||
PUT_YAMOP_SEQ(code);
|
||||
#endif /* YAPOR */
|
||||
code->u.OtapFs.f = Cont;
|
||||
#ifdef CUT_C
|
||||
code = NEXTOP(code,OtapFs);
|
||||
if (pe->PredFlags & UserCPredFlag)
|
||||
code->opc = Yap_opcode(_cut_c);
|
||||
@ -725,11 +716,8 @@ CleanBack(PredEntry *pe, CPredicate Start, CPredicate Cont)
|
||||
code->opc = Yap_opcode(_cut_userc);
|
||||
code->u.OtapFs.p = pe;
|
||||
code->u.OtapFs.f = Cut;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
#ifdef CUT_C
|
||||
void
|
||||
Yap_InitCPredBack(char *Name, unsigned long int Arity,
|
||||
unsigned int Extra, CPredicate Start,
|
||||
@ -743,24 +731,11 @@ Yap_InitCPredBackCut(char *Name, unsigned long int Arity,
|
||||
CPredicate Cont,CPredicate Cut, UInt flags){
|
||||
Yap_InitCPredBack_(Name,Arity,Extra,Start,Cont,Cut,flags);
|
||||
}
|
||||
#else
|
||||
Yap_InitCPredBackCut(char *Name, unsigned long int Arity,
|
||||
unsigned int Extra, CPredicate Start,
|
||||
CPredicate Cont,CPredicate Cut, UInt flags){
|
||||
Yap_InitCPredBack(Name,Arity,Extra,Start,Cont,flags);
|
||||
}
|
||||
#endif /* CUT_C */
|
||||
|
||||
void
|
||||
#ifdef CUT_C
|
||||
Yap_InitCPredBack_(char *Name, unsigned long int Arity,
|
||||
unsigned int Extra, CPredicate Start,
|
||||
CPredicate Cont, CPredicate Cut, UInt flags)
|
||||
#else
|
||||
Yap_InitCPredBack(char *Name, unsigned long int Arity,
|
||||
unsigned int Extra, CPredicate Start,
|
||||
CPredicate Cont, UInt flags)
|
||||
#endif
|
||||
{
|
||||
CACHE_REGS
|
||||
PredEntry *pe = NULL;
|
||||
@ -796,11 +771,7 @@ Yap_InitCPredBack(char *Name, unsigned long int Arity,
|
||||
if (pe->cs.p_code.FirstClause != NIL)
|
||||
{
|
||||
flags = update_flags_from_prolog(flags, pe);
|
||||
#ifdef CUT_C
|
||||
CleanBack(pe, Start, Cont, Cut);
|
||||
#else
|
||||
CleanBack(pe, Start, Cont);
|
||||
#endif /*CUT_C*/
|
||||
}
|
||||
else {
|
||||
StaticClause *cl;
|
||||
@ -814,11 +785,7 @@ Yap_InitCPredBack(char *Name, unsigned long int Arity,
|
||||
pe->PredFlags |= SequentialPredFlag;
|
||||
#endif /* YAPOR */
|
||||
|
||||
#ifdef CUT_C
|
||||
cl = (StaticClause *)Yap_AllocCodeSpace((CELL)NEXTOP(NEXTOP(NEXTOP(NEXTOP(code,OtapFs),OtapFs),OtapFs),l));
|
||||
#else
|
||||
cl = (StaticClause *)Yap_AllocCodeSpace((CELL)NEXTOP(NEXTOP(NEXTOP(code,OtapFs),OtapFs),l));
|
||||
#endif
|
||||
|
||||
if (cl == NULL) {
|
||||
Yap_Error(OUT_OF_HEAP_ERROR,TermNil,"No Heap Space in InitCPredBack");
|
||||
@ -826,15 +793,9 @@ Yap_InitCPredBack(char *Name, unsigned long int Arity,
|
||||
}
|
||||
cl->ClFlags = StaticMask;
|
||||
cl->ClNext = NULL;
|
||||
#ifdef CUT_C
|
||||
Yap_ClauseSpace += (CELL)NEXTOP(NEXTOP(NEXTOP(NEXTOP(code,OtapFs),OtapFs),OtapFs),l);
|
||||
cl->ClSize =
|
||||
(CELL)NEXTOP(NEXTOP(NEXTOP(NEXTOP(code,OtapFs),OtapFs),OtapFs),e);
|
||||
#else
|
||||
Yap_ClauseSpace += (CELL)NEXTOP(NEXTOP(NEXTOP(code,OtapFs),OtapFs),l);
|
||||
cl->ClSize =
|
||||
(CELL)NEXTOP(NEXTOP(NEXTOP(code,OtapFs),OtapFs),e);
|
||||
#endif
|
||||
cl->usc.ClLine = Yap_source_line_no();
|
||||
|
||||
code = cl->ClCode;
|
||||
@ -866,7 +827,6 @@ Yap_InitCPredBack(char *Name, unsigned long int Arity,
|
||||
PUT_YAMOP_SEQ(code);
|
||||
#endif /* YAPOR */
|
||||
code = NEXTOP(code,OtapFs);
|
||||
#ifdef CUT_C
|
||||
if (flags & UserCPredFlag)
|
||||
code->opc = Yap_opcode(_cut_userc);
|
||||
else
|
||||
@ -876,7 +836,6 @@ Yap_InitCPredBack(char *Name, unsigned long int Arity,
|
||||
code->u.OtapFs.s = Arity;
|
||||
code->u.OtapFs.extra = Extra;
|
||||
code = NEXTOP(code,OtapFs);
|
||||
#endif /* CUT_C */
|
||||
code->opc = Yap_opcode(_Ystop);
|
||||
code->u.l.l = cl->ClCode;
|
||||
}
|
||||
|
@ -19,9 +19,7 @@
|
||||
|
||||
#include "absmi.h"
|
||||
|
||||
#ifdef CUT_C
|
||||
#include "cut_c.h"
|
||||
#endif
|
||||
|
||||
static Int p_atom( USES_REGS1 );
|
||||
static Int p_atomic( USES_REGS1 );
|
||||
@ -797,14 +795,12 @@ p_cut_by( USES_REGS1 )
|
||||
#else
|
||||
pt0 = (choiceptr)(LCL0-IntOfTerm(d0));
|
||||
#endif
|
||||
#ifdef CUT_C
|
||||
{
|
||||
while (POP_CHOICE_POINT(pt0))
|
||||
{
|
||||
POP_EXECUTE();
|
||||
}
|
||||
}
|
||||
#endif /* CUT_C */
|
||||
#ifdef YAPOR
|
||||
CUT_prune_to(pt0);
|
||||
#endif /* YAPOR */
|
||||
|
7
H/Regs.h
7
H/Regs.h
@ -16,12 +16,9 @@
|
||||
|
||||
/********* abstract machine registers **********************************/
|
||||
#ifdef YAP_H
|
||||
#ifdef CUT_C
|
||||
#include "cut_c.h"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#define MaxTemps 512
|
||||
#define MaxArithms 32
|
||||
|
||||
@ -104,10 +101,8 @@ typedef struct regstore_t
|
||||
#endif /* DEPTH_LIMIT */
|
||||
yamop *CP_; /* 28 continuation program counter */
|
||||
CELL *ENV_; /* 1 current environment */
|
||||
#ifdef CUT_C
|
||||
struct cut_c_str *CUT_C_TOP;
|
||||
#endif
|
||||
#if defined CUT_C && (defined MYDDAS_ODBC || defined MYDDAS_MYSQL)
|
||||
#if defined MYDDAS_ODBC || defined MYDDAS_MYSQL
|
||||
struct myddas_global *MYDDAS_GLOBAL_POINTER;
|
||||
#endif
|
||||
yamop *P_; /* 7 prolog machine program counter */
|
||||
|
@ -203,14 +203,10 @@
|
||||
OPCODE(call_c_wfail ,slp),
|
||||
OPCODE(try_c ,OtapFs),
|
||||
OPCODE(retry_c ,OtapFs),
|
||||
#ifdef CUT_C
|
||||
OPCODE(cut_c ,OtapFs),
|
||||
#endif
|
||||
OPCODE(try_userc ,OtapFs),
|
||||
OPCODE(retry_userc ,OtapFs),
|
||||
#ifdef CUT_C
|
||||
OPCODE(cut_userc ,OtapFs),
|
||||
#endif
|
||||
OPCODE(lock_pred ,e),
|
||||
OPCODE(index_pred ,e),
|
||||
#ifdef THREADS
|
||||
|
@ -238,9 +238,7 @@ void Yap_InitAsmPred(char *, unsigned long int, int, CPredicate, UInt);
|
||||
void Yap_InitCmpPred(char *, unsigned long int, CmpPredicate, UInt);
|
||||
void Yap_InitCPredBack(char *, unsigned long int, unsigned int, CPredicate,CPredicate,UInt);
|
||||
void Yap_InitCPredBackCut(char *, unsigned long int, unsigned int, CPredicate,CPredicate,CPredicate,UInt);
|
||||
#ifdef CUT_C
|
||||
void Yap_InitCPredBack_(char *, unsigned long int, unsigned int, CPredicate,CPredicate,CPredicate,UInt);
|
||||
#endif
|
||||
void Yap_InitWorkspace(UInt,UInt,UInt,UInt,UInt,int,int,int);
|
||||
|
||||
#ifdef YAPOR
|
||||
|
@ -412,11 +412,9 @@ Yap_unify_constant(register Term a, register Term cons)
|
||||
static inline int
|
||||
do_cut(int i) {
|
||||
CACHE_REGS
|
||||
#ifdef CUT_C
|
||||
if (POP_CHOICE_POINT(B->cp_b)) {
|
||||
cut_c_pop();
|
||||
}
|
||||
#endif
|
||||
Yap_TrimTrail();
|
||||
B = B->cp_b;
|
||||
return i;
|
||||
|
@ -107,12 +107,8 @@ restore_opcodes(yamop *pc, yamop *max USES_REGS)
|
||||
pc = pc->u.OtaLl.n;
|
||||
break;
|
||||
/* instructions type OtapFs */
|
||||
#ifdef CUT_C
|
||||
case _cut_c:
|
||||
#endif
|
||||
#ifdef CUT_C
|
||||
case _cut_userc:
|
||||
#endif
|
||||
case _retry_c:
|
||||
case _retry_userc:
|
||||
case _try_c:
|
||||
|
@ -117,12 +117,8 @@
|
||||
pc = NEXTOP(pc,OtaLl);
|
||||
break;
|
||||
/* instructions type OtapFs */
|
||||
#ifdef CUT_C
|
||||
case _cut_c:
|
||||
#endif
|
||||
#ifdef CUT_C
|
||||
case _cut_userc:
|
||||
#endif
|
||||
case _retry_c:
|
||||
case _retry_userc:
|
||||
case _try_c:
|
||||
|
@ -67,12 +67,8 @@
|
||||
pc = pc->u.OtaLl.n;
|
||||
break;
|
||||
/* instructions type OtapFs */
|
||||
#ifdef CUT_C
|
||||
case _cut_c:
|
||||
#endif
|
||||
#ifdef CUT_C
|
||||
case _cut_userc:
|
||||
#endif
|
||||
case _retry_c:
|
||||
case _retry_userc:
|
||||
case _try_c:
|
||||
|
8
configure
vendored
8
configure
vendored
@ -7085,7 +7085,7 @@ else
|
||||
YAPLIB_CFLAGS="$CFLAGS"
|
||||
fi
|
||||
|
||||
YAP_EXTRAS="$YAP_EXTRAS -DCOROUTINING=1 -DCUT_C=1 -DRATIONAL_TREES=1"
|
||||
YAP_EXTRAS="$YAP_EXTRAS -DCOROUTINING=1 -DRATIONAL_TREES=1"
|
||||
|
||||
if test "$debugyap" = "yes"
|
||||
then
|
||||
@ -7166,12 +7166,6 @@ else
|
||||
esac
|
||||
fi
|
||||
|
||||
|
||||
if test "$cutc" = "yes"
|
||||
then
|
||||
YAP_EXTRAS="$YAP_EXTRAS -DCUT_C=1"
|
||||
fi
|
||||
|
||||
if test "$tabling" = "yes"
|
||||
then
|
||||
YAP_EXTRAS="$YAP_EXTRAS -DTABLING=1"
|
||||
|
@ -1045,7 +1045,7 @@ else
|
||||
YAPLIB_CFLAGS="$CFLAGS"
|
||||
fi
|
||||
|
||||
YAP_EXTRAS="$YAP_EXTRAS -DCOROUTINING=1 -DCUT_C=1 -DRATIONAL_TREES=1"
|
||||
YAP_EXTRAS="$YAP_EXTRAS -DCOROUTINING=1 -DRATIONAL_TREES=1"
|
||||
|
||||
if test "$debugyap" = "yes"
|
||||
then
|
||||
@ -1119,12 +1119,6 @@ else
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
|
||||
if test "$cutc" = "yes"
|
||||
then
|
||||
YAP_EXTRAS="$YAP_EXTRAS -DCUT_C=1"
|
||||
fi
|
||||
|
||||
if test "$tabling" = "yes"
|
||||
then
|
||||
|
@ -19,9 +19,7 @@
|
||||
#include "config.h"
|
||||
#include "YapInterface.h"
|
||||
|
||||
#ifdef CUT_C
|
||||
#include "cut_c.h"
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER /* Microsoft's Visual C++ Compiler */
|
||||
#ifdef HAVE_UNISTD_H
|
||||
|
@ -166,8 +166,8 @@ end_special(_, _).
|
||||
|
||||
special_op("clause_with_cut","TABLING_INNER_CUTS").
|
||||
special_op("table_answer_resolution_completion","THREADS_CONSUMER_SHARING").
|
||||
special_op("cut_c","CUT_C").
|
||||
special_op("cut_userc","CUT_C").
|
||||
/*special_op("cut_c","CUT_C").*/
|
||||
/*special_op("cut_userc","CUT_C").*/
|
||||
special_op("run_eam","BEAM").
|
||||
special_op("retry_eam","BEAM").
|
||||
special_op("thread_local","THREADS").
|
||||
|
@ -15,7 +15,7 @@
|
||||
* *
|
||||
*************************************************************************/
|
||||
|
||||
#if defined MYDDAS_ODBC && defined CUT_C
|
||||
#if defined MYDDAS_ODBC
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@ -765,7 +765,7 @@ c_db_odbc_get_fields_properties( USES_REGS1 ) {
|
||||
list = fields_properties_list;
|
||||
|
||||
SQLSMALLINT bind_prim_key;
|
||||
//por causa de as rows em odbc começam em 1 :)
|
||||
//por causa de as rows em odbc come<EFBFBD>am em 1 :)
|
||||
Short *null=(Short *)malloc(sizeof(Short)*(1+num_fields));
|
||||
|
||||
if (!SQLALLOCHANDLE(SQL_HANDLE_STMT, hdbc, &hstmt2, "db_get_fields_properties"))
|
||||
|
@ -268,7 +268,7 @@ c_db_preds_conn_start ( USES_REGS1 ){
|
||||
MYDDAS_UTIL_CONNECTION node =
|
||||
myddas_util_search_connection(conn);
|
||||
|
||||
/* Caso a ligacao já tenha sido apagada*/
|
||||
/* Caso a ligacao já tenha sido apagada*/
|
||||
if (node == NULL)
|
||||
{
|
||||
cut_fail();
|
||||
@ -699,22 +699,22 @@ void
|
||||
init_myddas(void)
|
||||
{
|
||||
CACHE_REGS
|
||||
#if defined MYDDAS_MYSQL && defined CUT_C
|
||||
#if defined MYDDAS_MYSQL
|
||||
Yap_InitBackMYDDAS_MySQLPreds();
|
||||
#endif
|
||||
#if defined MYDDAS_ODBC && defined CUT_C
|
||||
#if defined MYDDAS_ODBC
|
||||
Yap_InitBackMYDDAS_ODBCPreds();
|
||||
#endif
|
||||
#if defined CUT_C && (defined MYDDAS_ODBC || defined MYDDAS_MYSQL)
|
||||
#if defined MYDDAS_ODBC || defined MYDDAS_MYSQL
|
||||
Yap_InitBackMYDDAS_SharedPreds();
|
||||
#endif
|
||||
#if defined CUT_C && defined MYDDAS_MYSQL
|
||||
#if defined MYDDAS_MYSQL
|
||||
Yap_InitMYDDAS_MySQLPreds();
|
||||
#endif
|
||||
#if defined CUT_C && defined MYDDAS_ODBC
|
||||
#if defined MYDDAS_ODBC
|
||||
Yap_InitMYDDAS_ODBCPreds();
|
||||
#endif
|
||||
#if defined CUT_C && (defined MYDDAS_ODBC || defined MYDDAS_MYSQL)
|
||||
#if defined MYDDAS_ODBC || defined MYDDAS_MYSQL
|
||||
Yap_InitMYDDAS_SharedPreds();
|
||||
#endif
|
||||
#if defined MYDDAS_TOP_LEVEL && defined MYDDAS_MYSQL // && defined HAVE_LIBREADLINE
|
||||
@ -767,4 +767,4 @@ int WINAPI win_myddas(HANDLE hinst, DWORD reason, LPVOID reserved)
|
||||
|
||||
|
||||
|
||||
#endif /*CUT_C && (MYDDAS_MYSQL || MYDDAS_ODBC)*/
|
||||
#endif /*MYDDAS_MYSQL || MYDDAS_ODBC*/
|
||||
|
Reference in New Issue
Block a user