This commit is contained in:
Vitor Santos Costa 2015-01-18 01:32:13 +00:00
parent e40c248c16
commit ce84e60d08
110 changed files with 30269 additions and 29788 deletions

12308
C/absmi.c

File diff suppressed because it is too large Load Diff

View File

@ -1,77 +0,0 @@
/*****************************************************************
* INSTRUCTIONS *
*****************************************************************/
#ifdef INDENT_CODE
{
{
{
#endif /* INDENT_CODE */
BOp(Ystop, l);
SET_ASP(YREG, E_CB*sizeof(CELL));
/* make sure ASP is initialised */
saveregs();
#if PUSH_REGS
restore_absmi_regs(old_regs);
#endif
#if BP_FREE
P1REG = PCBACKUP;
#endif
return 1;
ENDBOp();
BOp(Nstop, e);
SET_ASP(YREG, E_CB*sizeof(CELL));
saveregs();
#if PUSH_REGS
restore_absmi_regs(old_regs);
#endif
#if BP_FREE
P1REG = PCBACKUP;
#endif
return 0;
ENDBOp();
/************************************************************************\
* Native Code Execution *
\************************************************************************/
#if YAP_JIT
/* native_me */
BOp(jit_handler, J);
if (!PREG->y_u.J.jh->fi.bcst.c) PREG->y_u.J.jh->mf.isground = IsGround(PREG);
PREG->y_u.J.jh->fi.bcst.c++;
/* Did PREG reach threshold value to become critical? */
if (PREG->y_u.J.jh->fi.bcst.c == (COUNT)(ExpEnv.config_struc.frequency_bound*(ExpEnv.config_struc.profiling_startp)) && !PREG->y_u.J.jh->mf.isground) {
#if YAP_DBG_PREDS
if (ExpEnv.debug_struc.pprint_me.criticals != 0 && ExpEnv.debug_struc.pprint_me.criticals != 0x1) {
fprintf(stderr, "%s:%d\n", __FILE__, __LINE__);
fprintf(stderr, "%s", (char*)ExpEnv.debug_struc.pprint_me.criticals);
}
#endif
goto critical_lbl;
}
#if YAP_DBG_PREDS
print_main_when_head(PREG, ON_INTERPRETER);
#endif
PREG = NEXTOP(PREG, J);
JMPNext();
ENDBOp();
#endif
#include "cp_absmi_insts.c"
#include "lu_absmi_insts.c"
#include "fail_absmi_insts.c"
#include "control_absmi_insts.c"
#include "unify_absmi_insts.c"
#include "fli_absmi_insts.c"
#include "or_absmi_insts.c"
#include "index_absmi_insts.c"
#include "prim_absmi_insts.c"
#include "meta_absmi_insts.c"

File diff suppressed because it is too large Load Diff

View File

@ -330,6 +330,7 @@
*/
#define Bool int
#define flt double
#define C_INTERFACE
@ -375,20 +376,12 @@
#define strncat(X,Y,Z) strcat(X,Y)
#endif
#ifndef X_API
#if defined(_MSC_VER) && defined(YAP_EXPORTS)
#define X_API __declspec(dllexport)
#else
#define X_API
#endif
#endif
//! @{
/**
@defgroup slotInterface Term Handles or Slots
@defgroup slotInterface Term Handles or Slots
@ingroup ChYInterface
@{
@ -502,25 +495,25 @@ YAP_A(int i)
return(Deref(XREGS[i]));
}
X_API bool
X_API Bool
YAP_IsIntTerm(Term t)
{
return IsIntegerTerm(t);
}
X_API bool
X_API Bool
YAP_IsNumberTerm(Term t)
{
return IsIntegerTerm(t) || IsIntTerm(t) || IsFloatTerm(t) || IsBigIntTerm(t);
}
X_API bool
X_API Bool
YAP_IsLongIntTerm(Term t)
{
return IsLongIntTerm(t);
}
X_API bool
X_API Bool
YAP_IsBigNumTerm(Term t)
{
#if USE_GMP
@ -536,7 +529,7 @@ YAP_IsBigNumTerm(Term t)
#endif
}
X_API bool
X_API Bool
YAP_IsRationalTerm(Term t)
{
#if USE_GMP
@ -552,49 +545,49 @@ YAP_IsRationalTerm(Term t)
#endif
}
X_API bool
X_API Bool
YAP_IsVarTerm(Term t)
{
return (IsVarTerm(t));
}
X_API bool
X_API Bool
YAP_IsNonVarTerm(Term t)
{
return (IsNonVarTerm(t));
}
X_API bool
X_API Bool
YAP_IsFloatTerm(Term t)
{
return (IsFloatTerm(t));
}
X_API bool
X_API Bool
YAP_IsDbRefTerm(Term t)
{
return (IsDBRefTerm(t));
}
X_API bool
X_API Bool
YAP_IsAtomTerm(Term t)
{
return (IsAtomTerm(t));
}
X_API bool
X_API Bool
YAP_IsPairTerm(Term t)
{
return (IsPairTerm(t));
}
X_API bool
X_API Bool
YAP_IsApplTerm(Term t)
{
return (IsApplTerm(t) && !IsExtensionFunctor(FunctorOfTerm(t)));
}
X_API bool
X_API Bool
YAP_IsCompoundTerm(Term t)
{
return (IsApplTerm(t) && !IsExtensionFunctor(FunctorOfTerm(t))) ||
@ -638,7 +631,7 @@ YAP_MkBigNumTerm(void *big)
#endif /* USE_GMP */
}
X_API bool
X_API int
YAP_BigNumOfTerm(Term t, void *b)
{
#if USE_GMP
@ -668,7 +661,7 @@ YAP_MkRationalTerm(void *big)
#endif /* USE_GMP */
}
X_API bool
X_API int
YAP_RationalOfTerm(Term t, void *b)
{
#if USE_GMP
@ -760,7 +753,7 @@ YAP_AtomOfTerm(Term t)
}
X_API bool
X_API int
YAP_IsWideAtom(Atom a)
{
return IsWideAtom(a);
@ -1134,7 +1127,7 @@ YAP_cut_up(void)
RECOVER_B();
}
X_API bool
X_API int
YAP_Unify(Term t1, Term t2)
{
Int out;
@ -1584,15 +1577,12 @@ YAP_Execute(PredEntry *pe, CPredicate exec_code)
if (pe->PredFlags & SWIEnvPredFlag) {
CPredicateV codev = (CPredicateV)exec_code;
struct foreign_context ctx;
UInt i, arity = pe->ArityOfPE;
yhandle_t sl = 0;
UInt i;
Int sl = 0;
ctx.engine = NULL;
if (arity > 0) {
sl = Yap_NewSlots( arity );
for (i= 0; i < arity; i++ ) {
Yap_PutInSlot(sl+i, XREGS[i+1] PASS_REGS);
}
for (i=pe->ArityOfPE; i > 0; i--) {
sl = Yap_InitSlot(XREGS[i] PASS_REGS);
}
PP = pe;
ret = ((codev)(sl,0,&ctx));
@ -1635,7 +1625,7 @@ YAP_ExecuteFirst(PredEntry *pe, CPredicate exec_code)
CACHE_REGS
CELL ocp = LCL0-(CELL *)B;
/* for slots to work */
yhandle_t CurSlot = Yap_StartSlots( PASS_REGS1 );
Int CurSlot = Yap_StartSlots( PASS_REGS1 );
if (pe->PredFlags & (SWIEnvPredFlag|CArgsPredFlag|ModuleTransparentPredFlag)) {
uintptr_t val;
CPredicateV codev = (CPredicateV)exec_code;
@ -1703,7 +1693,7 @@ YAP_ExecuteOnCut(PredEntry *pe, CPredicate exec_code, struct cut_c_str *top)
Int val;
CPredicateV codev = (CPredicateV)exec_code;
struct foreign_context *ctx = (struct foreign_context *)(&EXTRA_CBACK_ARG(pe->ArityOfPE,1));
yhandle_t CurSlot;
Int CurSlot;
CELL *args = B->cp_args;
B = oB;
@ -1736,8 +1726,7 @@ YAP_ExecuteOnCut(PredEntry *pe, CPredicate exec_code, struct cut_c_str *top)
return TRUE;
}
} else {
Int ret;
yhandle_t CurSlot;
Int ret, CurSlot;
B = oB;
/* for slots to work */
CurSlot = Yap_StartSlots( PASS_REGS1 );
@ -1763,7 +1752,7 @@ YAP_ExecuteNext(PredEntry *pe, CPredicate exec_code)
{
CACHE_REGS
/* for slots to work */
yhandle_t CurSlot = Yap_StartSlots( PASS_REGS1 );
Int CurSlot = Yap_StartSlots( PASS_REGS1 );
UInt ocp = LCL0-(CELL *)B;
if (pe->PredFlags & (SWIEnvPredFlag|CArgsPredFlag)) {
Int val;
@ -2289,7 +2278,7 @@ run_emulator(YAP_dogoalinfo *dgi USES_REGS)
return out;
}
X_API bool
X_API int
YAP_EnterGoal(PredEntry *pe, Term *ptr, YAP_dogoalinfo *dgi)
{
CACHE_REGS
@ -2316,7 +2305,7 @@ YAP_EnterGoal(PredEntry *pe, Term *ptr, YAP_dogoalinfo *dgi)
return out;
}
X_API bool
X_API int
YAP_RetryGoal(YAP_dogoalinfo *dgi)
{
CACHE_REGS
@ -2343,7 +2332,7 @@ YAP_RetryGoal(YAP_dogoalinfo *dgi)
return out;
}
X_API bool
X_API int
YAP_LeaveGoal(int backtrack, YAP_dogoalinfo *dgi)
{
CACHE_REGS
@ -2447,7 +2436,7 @@ YAP_AllocExternalDataInStack(size_t bytes)
return t;
}
X_API bool
X_API Bool
YAP_IsExternalDataInStackTerm(Term t)
{
return IsExternalBlobTerm(t, EXTERNAL_BLOB);
@ -2486,7 +2475,7 @@ Term YAP_NewOpaqueObject(YAP_opaque_tag_t tag, size_t bytes)
return t;
}
X_API bool
X_API Bool
YAP_IsOpaqueObjectTerm(Term t, YAP_opaque_tag_t tag)
{
return IsExternalBlobTerm(t, (CELL)tag);
@ -2504,10 +2493,9 @@ YAP_HeapStoreOpaqueTerm(Term t)
return Yap_HeapStoreOpaqueTerm(t);
}
Int
Yap_RunGoalOnce(Term t)
X_API Int
YAP_RunGoalOnce(Term t)
{
return Yap_RunGoalOnce( t );
CACHE_REGS
Term out;
yamop *old_CP = CP;
@ -2559,13 +2547,7 @@ Yap_RunGoalOnce(Term t)
return out;
}
X_API Int
YAP_RunGoalOnce(Term t)
{
return Yap_RunGoalOnce( t );
}
X_API bool
X_API int
YAP_RestartGoal(void)
{
CACHE_REGS
@ -2588,7 +2570,7 @@ YAP_RestartGoal(void)
return(out);
}
X_API bool
X_API int
YAP_ShutdownGoal(int backtrack)
{
CACHE_REGS
@ -2632,7 +2614,7 @@ YAP_ShutdownGoal(int backtrack)
return TRUE;
}
X_API bool
X_API int
YAP_ContinueGoal(void)
{
CACHE_REGS
@ -2669,7 +2651,7 @@ YAP_PruneGoal(YAP_dogoalinfo *gi)
RECOVER_B();
}
X_API bool
X_API int
YAP_GoalHasException(Term *t)
{
CACHE_REGS

652
C/cdmgr.c

File diff suppressed because it is too large Load Diff

View File

@ -1,551 +0,0 @@
/************************************************************************\
* Cut & Commit Instructions *
\************************************************************************/
#ifdef INDENT_CODE
{
{
{
#endif /* INDENT_CODE */
/* cut */
Op(cut, s);
#ifdef COROUTINING
CACHE_Y_AS_ENV(YREG);
check_stack(NoStackCut, HR);
ENDCACHE_Y_AS_ENV();
do_cut:
#endif
SET_ASP(YREG, PREG->y_u.s.s);
PREG = NEXTOP(NEXTOP(NEXTOP(PREG, s),Osbpp),l);
/* assume cut is always in stack */
saveregs();
prune((choiceptr)YREG[E_CB] PASS_REGS);
setregs();
GONext();
#ifdef COROUTINING
NoStackCut:
PROCESS_INT(interrupt_cut, do_cut);
#endif
ENDOp();
/* cut_t */
/* cut_t does the same as cut */
Op(cut_t, s);
#ifdef COROUTINING
CACHE_Y_AS_ENV(YREG);
check_stack(NoStackCutT, HR);
ENDCACHE_Y_AS_ENV();
do_cut_t:
#endif
SET_ASP(YREG, PREG->y_u.s.s);
/* assume cut is always in stack */
saveregs();
prune((choiceptr)YREG[E_CB] PASS_REGS);
setregs();
PREG = NEXTOP(NEXTOP(NEXTOP(PREG, s),Osbpp),l);
GONext();
#ifdef COROUTINING
NoStackCutT:
PROCESS_INT(interrupt_cut_t, do_cut_t);
#endif
ENDOp();
/* cut_e */
Op(cut_e, s);
#ifdef COROUTINING
CACHE_Y_AS_ENV(YREG);
check_stack(NoStackCutE, HR);
ENDCACHE_Y_AS_ENV();
do_cut_e:
#endif
SET_ASP(YREG, PREG->y_u.s.s);
PREG = NEXTOP(NEXTOP(NEXTOP(PREG, s),Osbpp),l);
saveregs();
prune((choiceptr)SREG[E_CB] PASS_REGS);
setregs();
GONext();
#ifdef COROUTINING
NoStackCutE:
PROCESS_INT(interrupt_cut_e, do_cut_e);
#endif
ENDOp();
/* save_b_x Xi */
Op(save_b_x, x);
BEGD(d0);
d0 = PREG->y_u.x.x;
#if defined(YAPOR_SBA) && defined(FROZEN_STACKS)
XREG(d0) = MkIntegerTerm((Int)B);
#else
XREG(d0) = MkIntegerTerm(LCL0-(CELL *) (B));
#endif /* YAPOR_SBA && FROZEN_STACKS */
PREG = NEXTOP(PREG, x);
ENDD(d0);
GONext();
ENDOp();
/* save_b_y Yi */
Op(save_b_y, y);
#if defined(YAPOR_SBA)
INITIALIZE_PERMVAR(YREG+PREG->y_u.y.y,MkIntegerTerm((Int)B));
#else
INITIALIZE_PERMVAR(YREG+PREG->y_u.y.y,MkIntegerTerm(LCL0-(CELL *)(B)));
#endif /* YAPOR_SBA*/
PREG = NEXTOP(PREG, y);
GONext();
ENDOp();
/* commit_b_x Xi */
Op(commit_b_x, xps);
#ifdef COROUTINING
CACHE_Y_AS_ENV(YREG);
check_stack(NoStackCommitX, HR);
ENDCACHE_Y_AS_ENV();
do_commit_b_x:
#endif
BEGD(d0);
d0 = XREG(PREG->y_u.xps.x);
deref_head(d0, commit_b_x_unk);
commit_b_x_nvar:
/* skip a void call and a label */
SET_ASP(YREG, PREG->y_u.xps.s);
PREG = NEXTOP(NEXTOP(NEXTOP(PREG, xps),Osbpp),l);
{
choiceptr pt0;
#if defined(YAPOR_SBA) && defined(FROZEN_STACKS)
pt0 = (choiceptr)IntegerOfTerm(d0);
#else
pt0 = (choiceptr)(LCL0-IntegerOfTerm(d0));
#endif /* YAPOR_SBA && FROZEN_STACKS */
saveregs();
prune(pt0 PASS_REGS);
setregs();
}
GONext();
BEGP(pt1);
deref_body(d0, pt1, commit_b_x_unk, commit_b_x_nvar);
ENDP(pt1);
/* never cut to a variable */
/* Abort */
FAIL();
ENDD(d0);
#ifdef COROUTINING
/* Problem: have I got an environment or not? */
NoStackCommitX:
PROCESS_INT(interrupt_commit_x, do_commit_b_x);
#endif
ENDOp();
/* commit_b_y Yi */
Op(commit_b_y, yps);
#ifdef COROUTINING
CACHE_Y_AS_ENV(YREG);
check_stack(NoStackCommitY, HR);
ENDCACHE_Y_AS_ENV();
do_commit_b_y:
#endif
BEGD(d0);
d0 = YREG[PREG->y_u.yps.y];
deref_head(d0, commit_b_y_unk);
commit_b_y_nvar:
SET_ASP(YREG, PREG->y_u.yps.s);
PREG = NEXTOP(NEXTOP(NEXTOP(PREG, yps),Osbpp),l);
{
choiceptr pt0;
#if defined(YAPOR_SBA) && defined(FROZEN_STACKS)
pt0 = (choiceptr)IntegerOfTerm(d0);
#else
pt0 = (choiceptr)(LCL0-IntegerOfTerm(d0));
#endif
saveregs();
prune(pt0 PASS_REGS);
setregs();
}
GONext();
BEGP(pt1);
deref_body(d0, pt1, commit_b_y_unk, commit_b_y_nvar);
ENDP(pt1);
/* never cut to a variable */
/* Abort */
FAIL();
ENDD(d0);
#ifdef COROUTINING
/* This is easier: I know there is an environment so I cannot do allocate */
NoStackCommitY:
PROCESS_INT(interrupt_commit_y, do_commit_b_y);
#endif
ENDOp();
/*************************************************************************
* Call / Proceed instructions *
*************************************************************************/
/* Macros for stack trimming */
/* execute Label */
BOp(execute, pp);
{
PredEntry *pt0;
CACHE_Y_AS_ENV(YREG);
pt0 = PREG->y_u.pp.p;
#ifndef NO_CHECKING
check_stack(NoStackExecute, HR);
goto skip_do_execute;
#endif
do_execute:
FETCH_Y_FROM_ENV(YREG);
pt0 = PREG->y_u.pp.p;
skip_do_execute:
#ifdef LOW_LEVEL_TRACER
if (Yap_do_low_level_trace) {
low_level_trace(enter_pred,pt0,XREGS+1);
}
#endif /* LOW_LEVEL_TRACE */
CACHE_A1();
ALWAYS_LOOKAHEAD(pt0->OpcodeOfPred);
BEGD(d0);
d0 = (CELL)B;
PREG = pt0->CodeOfPred;
/* for profiler */
save_pc();
ENV_YREG[E_CB] = d0;
ENDD(d0);
#ifdef DEPTH_LIMIT
if (DEPTH <= MkIntTerm(1)) {/* I assume Module==0 is prolog */
if (pt0->ModuleOfPred) {
if (DEPTH == MkIntTerm(0))
FAIL();
else DEPTH = RESET_DEPTH();
}
} else if (pt0->ModuleOfPred)
DEPTH -= MkIntConstant(2);
#endif /* DEPTH_LIMIT */
/* this is the equivalent to setting up the stack */
ALWAYS_GONext();
ALWAYS_END_PREFETCH();
ENDCACHE_Y_AS_ENV();
}
NoStackExecute:
PROCESS_INT(interrupt_execute, do_execute);
ENDBOp();
/* dexecute Label */
/* joint deallocate and execute */
BOp(dexecute, pp);
#ifdef LOW_LEVEL_TRACER
if (Yap_do_low_level_trace)
low_level_trace(enter_pred,PREG->y_u.pp.p,XREGS+1);
#endif /* LOW_LEVEL_TRACER */
CACHE_Y_AS_ENV(YREG);
{
PredEntry *pt0;
CACHE_A1();
pt0 = PREG->y_u.pp.p;
#ifndef NO_CHECKING
/* check stacks */
check_stack(NoStackDExecute, HR);
goto skip_dexecute;
#endif
continue_dexecute:
FETCH_Y_FROM_ENV(YREG);
pt0 = PREG->y_u.pp.p;
skip_dexecute:
#ifdef DEPTH_LIMIT
if (DEPTH <= MkIntTerm(1)) {/* I assume Module==0 is primitives */
if (pt0->ModuleOfPred) {
if (DEPTH == MkIntTerm(0))
FAIL();
else DEPTH = RESET_DEPTH();
}
} else if (pt0->ModuleOfPred)
DEPTH -= MkIntConstant(2);
#endif /* DEPTH_LIMIT */
PREG = pt0->CodeOfPred;
/* for profiler */
save_pc();
ALWAYS_LOOKAHEAD(pt0->OpcodeOfPred);
/* do deallocate */
CPREG = (yamop *) ENV_YREG[E_CP];
ENV_YREG = ENV = (CELL *) ENV_YREG[E_E];
#ifdef FROZEN_STACKS
{
choiceptr top_b = PROTECT_FROZEN_B(B);
#ifdef YAPOR_SBA
if (ENV_YREG > (CELL *) top_b || ENV_YREG < HR) ENV_YREG = (CELL *) top_b;
#else
if (ENV_YREG > (CELL *) top_b) ENV_YREG = (CELL *) top_b;
#endif /* YAPOR_SBA */
else ENV_YREG = (CELL *)((CELL)ENV_YREG + ENV_Size(CPREG));
}
#else
if (ENV_YREG > (CELL *)B) {
ENV_YREG = (CELL *)B;
}
else {
ENV_YREG = (CELL *) ((CELL) ENV_YREG + ENV_Size(CPREG));
}
#endif /* FROZEN_STACKS */
WRITEBACK_Y_AS_ENV();
/* setup GB */
ENV_YREG[E_CB] = (CELL) B;
ALWAYS_GONext();
ALWAYS_END_PREFETCH();
}
ENDCACHE_Y_AS_ENV();
NoStackDExecute:
PROCESS_INT(interrupt_dexecute, continue_dexecute);
ENDBOp();
BOp(fcall, Osbpp);
CACHE_Y_AS_ENV(YREG);
ENV_YREG[E_CP] = (CELL) CPREG;
ENV_YREG[E_E] = (CELL) ENV;
#ifdef DEPTH_LIMIT
ENV_YREG[E_DEPTH] = DEPTH;
#endif /* DEPTH_LIMIT */
ENDCACHE_Y_AS_ENV();
ENDBOp();
BOp(call, Osbpp);
#ifdef LOW_LEVEL_TRACER
if (Yap_do_low_level_trace) {
low_level_trace(enter_pred,PREG->y_u.Osbpp.p,XREGS+1);
}
#endif /* LOW_LEVEL_TRACER */
CACHE_Y_AS_ENV(YREG);
{
PredEntry *pt;
CACHE_A1();
pt = PREG->y_u.Osbpp.p;
#ifndef NO_CHECKING
check_stack(NoStackCall, HR);
goto skip_call;
#endif
call_body:
/* external jump if we don;t want to creep */
FETCH_Y_FROM_ENV(YREG);
pt = PREG->y_u.Osbpp.p;
skip_call:
ENV = ENV_YREG;
/* Try to preserve the environment */
ENV_YREG = (CELL *) (((char *) ENV_YREG) + PREG->y_u.Osbpp.s);
CPREG = NEXTOP(PREG, Osbpp);
ALWAYS_LOOKAHEAD(pt->OpcodeOfPred);
PREG = pt->CodeOfPred;
/* for profiler */
save_pc();
#ifdef DEPTH_LIMIT
if (DEPTH <= MkIntTerm(1)) {/* I assume Module==0 is primitives */
if (pt->ModuleOfPred) {
if (DEPTH == MkIntTerm(0))
FAIL();
else DEPTH = RESET_DEPTH();
}
} else if (pt->ModuleOfPred)
DEPTH -= MkIntConstant(2);
#endif /* DEPTH_LIMIT */
#ifdef FROZEN_STACKS
{
choiceptr top_b = PROTECT_FROZEN_B(B);
#ifdef YAPOR_SBA
if (ENV_YREG > (CELL *) top_b || ENV_YREG < HR) ENV_YREG = (CELL *) top_b;
#else
if (ENV_YREG > (CELL *) top_b) ENV_YREG = (CELL *) top_b;
#endif /* YAPOR_SBA */
}
#else
if (ENV_YREG > (CELL *) B) {
ENV_YREG = (CELL *) B;
}
#endif /* FROZEN_STACKS */
WRITEBACK_Y_AS_ENV();
/* setup GB */
ENV_YREG[E_CB] = (CELL) B;
#ifdef YAPOR
SCH_check_requests();
#endif /* YAPOR */
ALWAYS_GONext();
ALWAYS_END_PREFETCH();
}
ENDCACHE_Y_AS_ENV();
ENDBOp();
BOp(procceed, p);
CACHE_Y_AS_ENV(YREG);
ALWAYS_LOOKAHEAD(CPREG->opc);
PREG = CPREG;
/* for profiler */
save_pc();
ENV_YREG = ENV;
#ifdef DEPTH_LIMIT
DEPTH = ENV_YREG[E_DEPTH];
#endif
WRITEBACK_Y_AS_ENV();
ALWAYS_GONext();
ALWAYS_END_PREFETCH();
ENDCACHE_Y_AS_ENV();
NoStackCall:
PROCESS_INT(interrupt_call, call_body);
ENDBOp();
Op(allocate, e);
CACHE_Y_AS_ENV(YREG);
PREG = NEXTOP(PREG, e);
ENV_YREG[E_CP] = (CELL) CPREG;
ENV_YREG[E_E] = (CELL) ENV;
#ifdef DEPTH_LIMIT
ENV_YREG[E_DEPTH] = DEPTH;
#endif /* DEPTH_LIMIT */
ENV = ENV_YREG;
ENDCACHE_Y_AS_ENV();
GONext();
ENDOp();
Op(deallocate, p);
CACHE_Y_AS_ENV(YREG);
check_trail(TR);
PREG = NEXTOP(PREG, p);
/* other instructions do depend on S being set by deallocate
:-( */
SREG = YREG;
CPREG = (yamop *) ENV_YREG[E_CP];
ENV = ENV_YREG = (CELL *) ENV_YREG[E_E];
#ifdef DEPTH_LIMIT
DEPTH = ENV_YREG[E_DEPTH];
#endif /* DEPTH_LIMIT */
#ifdef FROZEN_STACKS
{
choiceptr top_b = PROTECT_FROZEN_B(B);
#ifdef YAPOR_SBA
if (ENV_YREG > (CELL *) top_b || ENV_YREG < HR) ENV_YREG = (CELL *) top_b;
#else
if (ENV_YREG > (CELL *) top_b) ENV_YREG = (CELL *) top_b;
#endif /* YAPOR_SBA */
else ENV_YREG = (CELL *)((CELL) ENV_YREG + ENV_Size(CPREG));
}
#else
if (ENV_YREG > (CELL *) B)
ENV_YREG = (CELL *) B;
else
ENV_YREG = (CELL *) ((CELL) ENV_YREG + ENV_Size(CPREG));
#endif /* FROZEN_STACKS */
WRITEBACK_Y_AS_ENV();
#ifndef NO_CHECKING
/* check stacks */
check_stack(NoStackDeallocate, HR);
#endif
ENDCACHE_Y_AS_ENV();
GONext();
NoStackDeallocate:
BEGD(d0);
#ifdef SHADOW_S
Yap_REGS.S_ = SREG;
#endif
saveregs();
d0 = interrupt_deallocate( PASS_REGS1 );
setregs();
#ifdef SHADOW_S
SREG = Yap_REGS.S_;
#endif
if (!d0) FAIL();
JMPNext();
ENDD(d0);
ENDOp();
/**********************************************
* OPTYap instructions *
**********************************************/
#ifdef YAPOR
#include "or.insts.i"
#endif /* YAPOR */
#ifdef TABLING
#include "tab.insts.i"
#include "tab.tries.insts.i"
#endif /* TABLING */
#ifdef BEAM
extern int eam_am(PredEntry *);
Op(retry_eam, e);
printf("Aqui estou eu..................\n");
if (!eam_am(2)) {
abort_eam("Falhei\n");
FAIL();
}
goto procceed;
PREG = NEXTOP(PREG, e);
GONext();
ENDOp();
Op(run_eam, os);
if (inp==-9000) { /* use indexing to find out valid alternatives */
extern CELL *beam_ALTERNATIVES;
*beam_ALTERNATIVES= (CELL *) PREG->y_u.os.opcw;
beam_ALTERNATIVES++;
if (OLD_B!=B) goto fail;
#if PUSH_REGS
Yap_regp=old_regs;
#endif
return(0);
}
saveregs();
if (!eam_am((PredEntry *) PREG->y_u.os.s)) FAIL();
setregs();
/* cut */
BACKUP_B();
while (POP_CHOICE_POINT(B->cp_b)) {
POP_EXECUTE();
}
B = B->cp_b; /* cut_fail */
HB = B->cp_h; /* cut_fail */
RECOVER_B();
if (0) { register choiceptr ccp;
/* initialize ccp */
#define NORM_CP(CP) ((choiceptr)(CP))
YREG = (CELL *) (NORM_CP(YREG) - 1);
ccp = NORM_CP(YREG);
store_yaam_reg_cpdepth(ccp);
ccp->cp_tr = TR;
ccp->cp_ap = BEAM_RETRY_CODE;
ccp->cp_h = HR;
ccp->cp_b = B;
ccp->cp_env= ENV;
ccp->cp_cp = CPREG;
B = ccp;
SET_BB(B);
}
goto procceed;
PREG = NEXTOP(PREG, os);
GONext();
ENDOp();
#endif

File diff suppressed because it is too large Load Diff

View File

@ -530,7 +530,7 @@ Yap_bug_location(yamop *pc)
static char tmpbuf[YAP_BUF_SIZE];
yamop *
Yap_NilError(yap_error_number type, const char *format,...)
Yap_NilError(yap_error_number type, char *format,...)
{
va_list ap;
yamop *res;
@ -544,7 +544,7 @@ Yap_NilError(yap_error_number type, const char *format,...)
}
yamop *
Yap_Error(yap_error_number type, Term where, const char *format,...)
Yap_Error(yap_error_number type, Term where, char *format,...)
{
CACHE_REGS
va_list ap;

View File

@ -193,7 +193,7 @@ do_execute(Term t, Term mod USES_REGS)
Yap_get_signal( YAP_CREEP_SIGNAL ) ) {
CalculateStackGap( PASS_REGS1 );
}
return CallMetaCall(t, mod PASS_REGS);
return CallMetaCall(ARG1, mod PASS_REGS);
} else if (Yap_has_a_signal() &&
!LOCAL_InterruptsDisabled &&
!(LOCAL_PrologMode & (AbortMode|InterruptMode|SystemMode))) {
@ -406,14 +406,7 @@ do_execute_n(Term t, Term mod, unsigned int n USES_REGS)
static Int
EnterCreepMode(Term t, Term mod USES_REGS) {
PredEntry *PredCreep;
if ( Yap_only_has_signal( YAP_CREEP_SIGNAL ) ) {
PredEntry *pen = Yap_Pred( t, mod, " creep" );
if (pen->PredFlags & NoTracePredFlag) {
Yap_get_signal( YAP_CREEP_SIGNAL );
return do_execute(ARG1, mod PASS_REGS);
}
}
if (Yap_get_signal( YAP_CDOVF_SIGNAL ) ) {
ARG1 = t;
if (!Yap_locked_growheap(FALSE, 0, NULL)) {

View File

@ -1,414 +0,0 @@
/*****************************************************************
* Failure *
*****************************************************************/
#ifdef INDENT_CODE
{
{
{
#endif /* INDENT_CODE */
/* trust_fail */
BOp(trust_fail, e);
{
while (POP_CHOICE_POINT(B->cp_b))
{
POP_EXECUTE();
}
}
#ifdef YAPOR
{
choiceptr cut_pt;
cut_pt = B->cp_b;
CUT_prune_to(cut_pt);
B = cut_pt;
}
#else
B = B->cp_b;
#endif /* YAPOR */
goto fail;
ENDBOp();
#ifdef YAPOR
shared_fail:
B = Get_LOCAL_top_cp();
SET_BB(PROTECT_FROZEN_B(B));
goto fail;
#endif /* YAPOR */
/* fail */
PBOp(op_fail, e);
if (PP) {
UNLOCK(PP->PELock);
PP = NULL;
}
#ifdef COROUTINING
CACHE_Y_AS_ENV(YREG);
check_stack(NoStackFail, HR);
ENDCACHE_Y_AS_ENV();
#endif
fail:
{
register tr_fr_ptr pt0 = TR;
#if defined(YAPOR) || defined(THREADS)
if (PP) {
UNLOCK(PP->PELock);
PP = NULL;
}
#endif
PREG = B->cp_ap;
save_pc();
CACHE_TR(B->cp_tr);
PREFETCH_OP(PREG);
failloop:
if (pt0 == S_TR) {
SP = SP0;
#ifdef LOW_LEVEL_TRACER
if (Yap_do_low_level_trace) {
int go_on = true;
yamop *ipc = PREG;
while (go_on) {
op_numbers opnum = Yap_op_from_opcode(ipc->opc);
go_on = false;
switch (opnum) {
#ifdef TABLING
case _table_load_answer:
low_level_trace(retry_table_loader, LOAD_CP(B)->cp_pred_entry, NULL);
break;
case _table_try_answer:
case _table_retry_me:
case _table_trust_me:
case _table_retry:
case _table_trust:
case _table_completion:
#ifdef THREADS_CONSUMER_SHARING
case _table_answer_resolution_completion:
#endif /* THREADS_CONSUMER_SHARING */
#ifdef DETERMINISTIC_TABLING
if (IS_DET_GEN_CP(B))
low_level_trace(retry_table_generator, DET_GEN_CP(B)->cp_pred_entry, NULL);
else
#endif /* DETERMINISTIC_TABLING */
low_level_trace(retry_table_generator, GEN_CP(B)->cp_pred_entry, (CELL *)(GEN_CP(B) + 1));
break;
case _table_answer_resolution:
low_level_trace(retry_table_consumer, CONS_CP(B)->cp_pred_entry, NULL);
break;
case _trie_trust_var:
case _trie_retry_var:
case _trie_trust_var_in_pair:
case _trie_retry_var_in_pair:
case _trie_trust_val:
case _trie_retry_val:
case _trie_trust_val_in_pair:
case _trie_retry_val_in_pair:
case _trie_trust_atom:
case _trie_retry_atom:
case _trie_trust_atom_in_pair:
case _trie_retry_atom_in_pair:
case _trie_trust_null:
case _trie_retry_null:
case _trie_trust_null_in_pair:
case _trie_retry_null_in_pair:
case _trie_trust_pair:
case _trie_retry_pair:
case _trie_trust_appl:
case _trie_retry_appl:
case _trie_trust_appl_in_pair:
case _trie_retry_appl_in_pair:
case _trie_trust_extension:
case _trie_retry_extension:
case _trie_trust_double:
case _trie_retry_double:
case _trie_trust_longint:
case _trie_retry_longint:
case _trie_trust_gterm:
case _trie_retry_gterm:
low_level_trace(retry_table_loader, UndefCode, NULL);
break;
#endif /* TABLING */
case _or_else:
case _or_last:
low_level_trace(retry_or, (PredEntry *)ipc, &(B->cp_a1));
break;
case _retry2:
case _retry3:
case _retry4:
ipc = NEXTOP(ipc,l);
go_on = true;
break;
case _jump:
ipc = ipc->y_u.l.l;
go_on = true;
break;
case _retry_c:
case _retry_userc:
low_level_trace(retry_pred, ipc->y_u.OtapFs.p, B->cp_args);
break;
case _retry_profiled:
case _count_retry:
ipc = NEXTOP(ipc,p);
go_on = true;
break;
case _retry_me:
case _trust_me:
case _count_retry_me:
case _count_trust_me:
case _profiled_retry_me:
case _profiled_trust_me:
case _retry_and_mark:
case _profiled_retry_and_mark:
case _retry:
case _trust:
low_level_trace(retry_pred, ipc->y_u.Otapl.p, B->cp_args);
break;
case _try_logical:
case _retry_logical:
case _profiled_retry_logical:
case _count_retry_logical:
case _trust_logical:
case _profiled_trust_logical:
case _count_trust_logical:
low_level_trace(retry_pred, ipc->y_u.OtILl.d->ClPred, B->cp_args);
break;
case _Nstop:
case _Ystop:
low_level_trace(retry_pred, NULL, B->cp_args);
break;
default:
break;
}
}
}
#endif /* LOW_LEVEL_TRACER */
#ifdef FROZEN_STACKS
#ifdef YAPOR_SBA
if (pt0 < TR_FZ || pt0 > (ADDR)CurrentTrailTop+MinTrailGap)
#else
if (pt0 < TR_FZ)
#endif /* YAPOR_SBA */
{
TR = TR_FZ;
TRAIL_LINK(pt0);
} else
#endif /* FROZEN_STACKS */
RESTORE_TR();
GONext();
}
BEGD(d1);
d1 = TrailTerm(pt0-1);
pt0--;
if (IsVarTerm(d1)) {
#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))) {
RESET_VARIABLE(STACK_TO_SBA(d1));
} else
#endif
/* normal variable */
RESET_VARIABLE(d1);
goto failloop;
}
/* pointer to code space */
/* or updatable variable */
#if defined(TERM_EXTENSIONS) || defined(FROZEN_STACKS) || defined(MULTI_ASSIGNMENT_VARIABLES)
if (IsPairTerm(d1))
#endif /* TERM_EXTENSIONS || FROZEN_STACKS || MULTI_ASSIGNMENT_VARIABLES */
{
register CELL flags;
CELL *pt1 = RepPair(d1);
#ifdef LIMIT_TABLING
if ((ADDR) pt1 == LOCAL_TrailBase) {
sg_fr_ptr sg_fr = (sg_fr_ptr) TrailVal(pt0);
TrailTerm(pt0) = AbsPair((CELL *)(pt0 - 1));
SgFr_state(sg_fr)--; /* complete_in_use --> complete : compiled_in_use --> compiled */
insert_into_global_sg_fr_list(sg_fr);
goto failloop;
}
#endif /* LIMIT_TABLING */
#ifdef FROZEN_STACKS /* TRAIL */
/* avoid frozen segments */
if (
#ifdef YAPOR_SBA
(ADDR) pt1 >= HeapTop
#else
IN_BETWEEN(LOCAL_TrailBase, pt1, (ADDR)CurrentTrailTop+MinTrailGap)
#endif /* YAPOR_SBA */
)
{
pt0 = (tr_fr_ptr) pt1;
goto failloop;
} else
#endif /* FROZEN_STACKS */
if (IN_BETWEEN(H0,pt1,HR)) {
if (IsAttVar(pt1)) {
goto failloop;
} else if (*pt1 == (CELL)FunctorBigInt) {
Yap_CleanOpaqueVariable(pt1);
goto failloop;
}
}
#ifdef FROZEN_STACKS /* TRAIL */
/* don't reset frozen variables */
if (pt0 < TR_FZ)
goto failloop;
#endif
flags = *pt1;
#if MULTIPLE_STACKS
if (FlagOn(DBClMask, flags)) {
DBRef dbr = DBStructFlagsToDBStruct(pt1);
int erase;
LOCK(dbr->lock);
DEC_DBREF_COUNT(dbr);
erase = (dbr->Flags & ErasedMask) && (dbr->ref_count == 0);
UNLOCK(dbr->lock);
if (erase) {
saveregs();
Yap_ErDBE(dbr);
setregs();
}
} else {
if (flags & LogUpdMask) {
if (flags & IndexMask) {
LogUpdIndex *cl = ClauseFlagsToLogUpdIndex(pt1);
int erase;
#if PARALLEL_YAP
PredEntry *ap = cl->ClPred;
#endif
PELOCK(8,ap);
DEC_CLREF_COUNT(cl);
erase = (cl->ClFlags & ErasedMask) && !(cl->ClRefCount);
if (erase) {
saveregs();
/* at this point,
we are the only ones accessing the clause,
hence we don't need to have a lock it */
Yap_ErLogUpdIndex(cl);
setregs();
} else if (cl->ClFlags & DirtyMask) {
saveregs();
/* at this point,
we are the only ones accessing the clause,
hence we don't need to have a lock it */
Yap_CleanUpIndex(cl);
setregs();
}
UNLOCK(ap->PELock);
} else {
LogUpdClause *cl = ClauseFlagsToLogUpdClause(pt1);
int erase;
#if PARALLEL_YAP
PredEntry *ap = cl->ClPred;
#endif
/* BB support */
if (ap) {
PELOCK(9,ap);
DEC_CLREF_COUNT(cl);
erase = (cl->ClFlags & ErasedMask) && !(cl->ClRefCount);
if (erase) {
saveregs();
/* at this point,
we are the only ones accessing the clause,
hence we don't need to have a lock it */
Yap_ErLogUpdCl(cl);
setregs();
}
UNLOCK(ap->PELock);
}
}
} else {
DynamicClause *cl = ClauseFlagsToDynamicClause(pt1);
int erase;
LOCK(cl->ClLock);
DEC_CLREF_COUNT(cl);
erase = (cl->ClFlags & ErasedMask) && !(cl->ClRefCount);
UNLOCK(cl->ClLock);
if (erase) {
saveregs();
/* at this point,
we are the only ones accessing the clause,
hence we don't need to have a lock it */
Yap_ErCl(cl);
setregs();
}
}
}
#else
ResetFlag(InUseMask, flags);
*pt1 = flags;
if (FlagOn((ErasedMask|DirtyMask), flags)) {
if (FlagOn(DBClMask, flags)) {
saveregs();
Yap_ErDBE(DBStructFlagsToDBStruct(pt1));
setregs();
} else {
saveregs();
if (flags & LogUpdMask) {
if (flags & IndexMask) {
if (FlagOn(ErasedMask, flags)) {
Yap_ErLogUpdIndex(ClauseFlagsToLogUpdIndex(pt1));
} else {
Yap_CleanUpIndex(ClauseFlagsToLogUpdIndex(pt1));
}
} else {
Yap_ErLogUpdCl(ClauseFlagsToLogUpdClause(pt1));
}
} else {
Yap_ErCl(ClauseFlagsToDynamicClause(pt1));
}
setregs();
}
}
#endif
goto failloop;
}
#ifdef MULTI_ASSIGNMENT_VARIABLES
else /* if (IsApplTerm(d1)) */ {
CELL *pt = RepAppl(d1);
/* AbsAppl means */
/* multi-assignment variable */
/* so the next cell is the old value */
#ifdef FROZEN_STACKS
--pt0;
pt[0] = TrailVal(pt0);
#else
pt[0] = TrailTerm(pt0-1);
pt0 -= 2;
#endif /* FROZEN_STACKS */
goto failloop;
}
#endif
ENDD(d1);
ENDCACHE_TR();
}
#ifdef COROUTINING
NoStackFail:
BEGD(d0);
#ifdef SHADOW_S
Yap_REGS.S_ = SREG;
#endif
saveregs();
d0 = interrupt_fail( PASS_REGS1 );
setregs();
#ifdef SHADOW_S
SREG = Yap_REGS.S_;
#endif
if (!d0) FAIL();
JMPNext();
ENDD(d0);
#endif /* COROUTINING */
ENDPBOp();

View File

@ -1,614 +0,0 @@
/************************************************************************\
* Call C predicates instructions *
\************************************************************************/
#ifdef INDENT_CODE
{
{
{
#endif /* INDENT_CODE */
BOp(call_cpred, Osbpp);
check_trail(TR);
if (!(PREG->y_u.Osbpp.p->PredFlags & (SafePredFlag|NoTracePredFlag|HiddenPredFlag))) {
CACHE_Y_AS_ENV(YREG);
check_stack(NoStackCCall, HR);
ENDCACHE_Y_AS_ENV();
}
do_c_call:
#ifdef FROZEN_STACKS
{
choiceptr top_b = PROTECT_FROZEN_B(B);
#ifdef YAPOR_SBA
if (YREG > (CELL *) top_b || YREG < HR) ASP = (CELL *)top_b;
#else
if (YREG > (CELL *) top_b) ASP = (CELL *)top_b;
#endif /* YAPOR_SBA */
else ASP = (CELL *)(((char *)YREG) + PREG->y_u.Osbpp.s);
}
#else
SET_ASP(YREG, PREG->y_u.Osbpp.s);
/* for slots to work */
#endif /* FROZEN_STACKS */
#ifdef LOW_LEVEL_TRACER
if (Yap_do_low_level_trace)
low_level_trace(enter_pred,PREG->y_u.Osbpp.p,XREGS+1);
#endif /* LOW_LEVEL_TRACE */
BEGD(d0);
CPredicate f = PREG->y_u.Osbpp.p->cs.f_code;
PREG = NEXTOP(PREG, Osbpp);
saveregs();
d0 = (f)(PASS_REGS1);
setregs();
#ifdef SHADOW_S
SREG = Yap_REGS.S_;
#endif
if (!d0) {
FAIL();
}
CACHE_A1();
ENDD(d0);
JMPNext();
NoStackCCall:
PROCESS_INT(interrupt_call, do_c_call);
ENDBOp();
/* execute Label */
BOp(execute_cpred, pp);
check_trail(TR);
{
PredEntry *pt0;
BEGD(d0);
CACHE_Y_AS_ENV(YREG);
#ifndef NO_CHECKING
check_stack(NoStackExecuteC, HR);
do_executec:
#endif
#ifdef FROZEN_STACKS
{
choiceptr top_b = PROTECT_FROZEN_B(B);
#ifdef YAPOR_SBA
if (YREG > (CELL *) top_b || YREG < HR) ASP = (CELL *)top_b;
#else
if (YREG > (CELL *) top_b) ASP = (CELL *)top_b;
#endif /* YAPOR_SBA */
else ASP = YREG+E_CB;
}
#else
SET_ASP(YREG, E_CB*sizeof(CELL));
/* for slots to work */
#endif /* FROZEN_STACKS */
pt0 = PREG->y_u.pp.p;
#ifdef LOW_LEVEL_TRACER
if (Yap_do_low_level_trace) {
low_level_trace(enter_pred,pt0,XREGS+1);
}
#endif /* LOW_LEVEL_TRACE */
CACHE_A1();
BEGD(d0);
d0 = (CELL)B;
/* for profiler */
save_pc();
ENV_YREG[E_CB] = d0;
ENDD(d0);
#ifdef DEPTH_LIMIT
if (DEPTH <= MkIntTerm(1)) {/* I assume Module==0 is prolog */
if (pt0->ModuleOfPred) {
if (DEPTH == MkIntTerm(0))
FAIL();
else DEPTH = RESET_DEPTH();
}
} else if (pt0->ModuleOfPred) {
DEPTH -= MkIntConstant(2);
}
#endif /* DEPTH_LIMIT */
/* now call C-Code */
{
CPredicate f = PREG->y_u.pp.p->cs.f_code;
yamop *oldPREG = PREG;
saveregs();
d0 = (f)(PASS_REGS1);
setregs();
#ifdef SHADOW_S
SREG = Yap_REGS.S_;
#endif
if (!d0) {
FAIL();
}
if (oldPREG == PREG) {
/* we did not update PREG */
/* we can proceed */
PREG = CPREG;
ENV_YREG = ENV;
#ifdef DEPTH_LIMIT
DEPTH = ENV_YREG[E_DEPTH];
#endif
WRITEBACK_Y_AS_ENV();
} else {
/* call the new code */
CACHE_A1();
}
}
JMPNext();
ENDCACHE_Y_AS_ENV();
ENDD(d0);
}
NoStackExecuteC:
PROCESS_INT(interrupt_execute, do_executec);
ENDBOp();
/* Like previous, the only difference is that we do not */
/* trust the C-function we are calling and hence we must */
/* guarantee that *all* machine registers are saved and */
/* restored */
BOp(call_usercpred, Osbpp);
CACHE_Y_AS_ENV(YREG);
check_stack(NoStackUserCall, HR);
ENDCACHE_Y_AS_ENV();
do_user_call:
#ifdef LOW_LEVEL_TRACER
if (Yap_do_low_level_trace) {
low_level_trace(enter_pred,PREG->y_u.Osbpp.p,XREGS+1);
}
#endif /* LOW_LEVEL_TRACE */
#ifdef FROZEN_STACKS
{
choiceptr top_b = PROTECT_FROZEN_B(B);
#ifdef YAPOR_SBA
if (YREG > (CELL *) top_b || YREG < HR) ASP = (CELL *) top_b;
#else
if (YREG > (CELL *) top_b) ASP = (CELL *) top_b;
#endif /* YAPOR_SBA */
else ASP = (CELL *)(((char *)YREG) + PREG->y_u.Osbpp.s);
}
#else
SET_ASP(YREG, PREG->y_u.Osbpp.s);
/* for slots to work */
#endif /* FROZEN_STACKS */
{
/* make sure that we can still have access to our old PREG after calling user defined goals and backtracking or failing */
yamop *savedP;
LOCAL_PrologMode |= UserCCallMode;
{
PredEntry *p = PREG->y_u.Osbpp.p;
PREG = NEXTOP(PREG, Osbpp);
savedP = PREG;
saveregs();
save_machine_regs();
SREG = (CELL *) YAP_Execute(p, p->cs.f_code);
}
setregs();
LOCAL_PrologMode &= ~UserCCallMode;
restore_machine_regs();
PREG = savedP;
}
if (EX) {
struct DB_TERM *exp = EX;
EX = NULL;
Yap_JumpToEnv(Yap_PopTermFromDB(exp));
SREG = NULL;
}
if (!SREG) {
FAIL();
}
/* in case we call Execute */
YENV = ENV;
YREG = ENV;
JMPNext();
NoStackUserCall:
PROCESS_INT(interrupt_call, do_user_call);
ENDBOp();
BOp(call_c_wfail, slp);
#ifdef LOW_LEVEL_TRACER
if (Yap_do_low_level_trace) {
low_level_trace(enter_pred,PREG->y_u.slp.p,XREGS+1);
}
#endif /* LOW_LEVEL_TRACE */
#ifdef FROZEN_STACKS
{
choiceptr top_b = PROTECT_FROZEN_B(B);
#ifdef YAPOR_SBA
if (YREG > (CELL *) top_b || YREG < HR) ASP = (CELL *) top_b;
#else
if (YREG > (CELL *) top_b) ASP = (CELL *) top_b;
#endif /* YAPOR_SBA */
else {
BEGD(d0);
d0 = PREG->y_u.slp.s;
ASP = ((CELL *)YREG) + d0;
ENDD(d0);
}
}
#else
if (YREG > (CELL *) B)
ASP = (CELL *) B;
else {
BEGD(d0);
d0 = PREG->y_u.slp.s;
ASP = ((CELL *) YREG) + d0;
ENDD(d0);
}
#endif /* FROZEN_STACKS */
{
CPredicate f = PREG->y_u.slp.p->cs.f_code;
saveregs();
SREG = (CELL *)((f)(PASS_REGS1));
setregs();
}
if (!SREG) {
/* be careful about error handling */
if (PREG != FAILCODE)
PREG = PREG->y_u.slp.l;
} else {
PREG = NEXTOP(PREG, slp);
}
CACHE_A1();
JMPNext();
ENDBOp();
BOp(try_c, OtapFs);
#ifdef YAPOR
CUT_wait_leftmost();
#endif /* YAPOR */
CACHE_Y(YREG);
/* Alocate space for the cut_c structure*/
CUT_C_PUSH(NEXTOP(NEXTOP(PREG,OtapFs),OtapFs),S_YREG);
S_YREG = S_YREG - PREG->y_u.OtapFs.extra;
store_args(PREG->y_u.OtapFs.s);
store_yaam_regs(NEXTOP(PREG, OtapFs), 0);
B = B_YREG;
#ifdef YAPOR
SCH_set_load(B_YREG);
#endif /* YAPOR */
SET_BB(B_YREG);
ENDCACHE_Y();
TRYCC:
ASP = (CELL *)B;
{
CPredicate f = (CPredicate)(PREG->y_u.OtapFs.f);
saveregs();
SREG = (CELL *) ((f) (PASS_REGS1));
/* This last instruction changes B B*/
while (POP_CHOICE_POINT(B)){
cut_c_pop();
}
setregs();
}
if (!SREG) {
/* 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();
FAIL();
}
if ((CELL *) B == YREG && ASP != (CELL *) B) {
/* as Luis says, the predicate that did the try C might
* have left some data on the stack. We should preserve
* it, unless the builtin also did cut */
YREG = ASP;
HBREG = PROTECT_FROZEN_H(B);
SET_BB(B);
}
PREG = CPREG;
YREG = ENV;
JMPNext();
ENDBOp();
BOp(retry_c, OtapFs);
#ifdef YAPOR
CUT_wait_leftmost();
#endif /* YAPOR */
CACHE_Y(B);
CPREG = B_YREG->cp_cp;
ENV = B_YREG->cp_env;
HR = PROTECT_FROZEN_H(B);
#ifdef DEPTH_LIMIT
DEPTH =B->cp_depth;
#endif
HBREG = HR;
restore_args(PREG->y_u.OtapFs.s);
ENDCACHE_Y();
goto TRYCC;
ENDBOp();
BOp(cut_c, OtapFs);
/*This is a phantom instruction. This is not executed by the WAM*/
#ifdef DEBUG
/*If WAM executes this instruction, probably there's an error
when we put this instruction, cut_c, after retry_c*/
printf ("ERROR: Should not print this message FILE: absmi.c %d\n",__LINE__);
#endif /*DEBUG*/
ENDBOp();
BOp(try_userc, OtapFs);
#ifdef YAPOR
CUT_wait_leftmost();
#endif /* YAPOR */
CACHE_Y(YREG);
/* Alocate space for the cut_c structure*/
CUT_C_PUSH(NEXTOP(NEXTOP(PREG,OtapFs),OtapFs),S_YREG);
S_YREG = S_YREG - PREG->y_u.OtapFs.extra;
store_args(PREG->y_u.OtapFs.s);
store_yaam_regs(NEXTOP(PREG, OtapFs), 0);
B = B_YREG;
#ifdef YAPOR
SCH_set_load(B_YREG);
#endif
SET_BB(B_YREG);
ENDCACHE_Y();
LOCAL_PrologMode |= UserCCallMode;
ASP = YREG;
saveregs();
save_machine_regs();
SREG = (CELL *) YAP_ExecuteFirst(PREG->y_u.OtapFs.p, (CPredicate)(PREG->y_u.OtapFs.f));
EX = NULL;
restore_machine_regs();
setregs();
LOCAL_PrologMode &= ~UserCCallMode;
if (!SREG) {
FAIL();
}
if ((CELL *) B == YREG && ASP != (CELL *) B) {
/* as Luis says, the predicate that did the try C might
* have left some data on the stack. We should preserve
* it, unless the builtin also did cut */
YREG = ASP;
HBREG = PROTECT_FROZEN_H(B);
}
PREG = CPREG;
YREG = ENV;
CACHE_A1();
JMPNext();
ENDBOp();
BOp(retry_userc, OtapFs);
#ifdef YAPOR
CUT_wait_leftmost();
#endif /* YAPOR */
CACHE_Y(B);
CPREG = B_YREG->cp_cp;
ENV = B_YREG->cp_env;
HR = PROTECT_FROZEN_H(B);
#ifdef DEPTH_LIMIT
DEPTH =B->cp_depth;
#endif
HBREG = HR;
restore_args(PREG->y_u.OtapFs.s);
ENDCACHE_Y();
LOCAL_PrologMode |= UserCCallMode;
SET_ASP(YREG, E_CB*sizeof(CELL));
saveregs();
save_machine_regs();
SREG = (CELL *) YAP_ExecuteNext(PREG->y_u.OtapFs.p, (CPredicate)(PREG->y_u.OtapFs.f));
EX = NULL;
restore_machine_regs();
setregs();
LOCAL_PrologMode &= ~UserCCallMode;
if (!SREG) {
/* 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();
FAIL();
}
if ((CELL *) B == YREG && ASP != (CELL *) B) {
/* as Luis says, the predicate that did the try C might
* have left some data on the stack. We should preserve
* it, unless the builtin also did cut */
YREG = ASP;
HBREG = PROTECT_FROZEN_H(B);
}
PREG = CPREG;
YREG = ENV;
CACHE_A1();
JMPNext();
ENDBOp();
BOp(cut_userc, OtapFs);
/*This is a phantom instruction. This is not executed by the WAM*/
#ifdef DEBUG
/*If WAM executes this instruction, probably there's an error
when we put this instruction, cut_userc, after retry_userc*/
printf ("ERROR: Should not print this message FILE: absmi.c %d\n",__LINE__);
#endif /*DEBUG*/
CACHE_A1();
JMPNext();
ENDBOp();
/************************************************************************\
* support instructions *
\************************************************************************/
BOp(lock_pred, e);
{
PredEntry *ap = PredFromDefCode(PREG);
PELOCK(10,ap);
PP = ap;
if (!ap->cs.p_code.NOfClauses) {
UNLOCKPE(11,ap);
FAIL();
}
/*
we do not lock access to the predicate,
we must take extra care here
*/
if (ap->cs.p_code.NOfClauses > 1 &&
!(ap->PredFlags & IndexedPredFlag)) {
/* update ASP before calling IPred */
SET_ASP(YREG, E_CB*sizeof(CELL));
saveregs();
Yap_IPred(ap, 0, CP);
/* IPred can generate errors, it thus must get rid of the lock itself */
setregs();
CACHE_A1();
/* for profiler */
save_pc();
}
PREG = ap->cs.p_code.TrueCodeOfPred;
}
JMPNext();
ENDBOp();
BOp(index_pred, e);
{
PredEntry *ap = PredFromDefCode(PREG);
#if defined(YAPOR) || defined(THREADS)
/*
we do not lock access to the predicate,
we must take extra care here
*/
if (!PP) {
PELOCK(11,ap);
}
if (ap->OpcodeOfPred != INDEX_OPCODE) {
/* someone was here before we were */
if (!PP) {
UNLOCKPE(11,ap);
}
PREG = ap->CodeOfPred;
/* for profiler */
save_pc();
JMPNext();
}
#endif
/* update ASP before calling IPred */
SET_ASP(YREG, E_CB*sizeof(CELL));
saveregs();
Yap_IPred(ap, 0, CP);
/* IPred can generate errors, it thus must get rid of the lock itself */
setregs();
CACHE_A1();
PREG = ap->CodeOfPred;
/* for profiler */
save_pc();
#if defined(YAPOR) || defined(THREADS)
if (!PP)
#endif
UNLOCKPE(14,ap);
}
JMPNext();
ENDBOp();
#if THREADS
BOp(thread_local, e);
{
PredEntry *ap = PredFromDefCode(PREG);
ap = Yap_GetThreadPred(ap PASS_REGS);
PREG = ap->CodeOfPred;
/* for profiler */
save_pc();
}
JMPNext();
ENDBOp();
#endif
BOp(expand_index, e);
{
PredEntry *pe = PredFromExpandCode(PREG);
yamop *pt0;
/* update ASP before calling IPred */
SET_ASP(YREG, E_CB*sizeof(CELL));
#if defined(YAPOR) || defined(THREADS)
if (!PP) {
PELOCK(12,pe);
}
if (!same_lu_block(PREG_ADDR, PREG)) {
PREG = *PREG_ADDR;
if (!PP) {
UNLOCKPE(15,pe);
}
JMPNext();
}
#endif
#ifdef SHADOW_S
S = SREG;
#endif /* SHADOW_S */
saveregs();
pt0 = Yap_ExpandIndex(pe, 0);
/* restart index */
setregs();
#ifdef SHADOW_S
SREG = S;
#endif /* SHADOW_S */
PREG = pt0;
#if defined(YAPOR) || defined(THREADS)
if (!PP) {
UNLOCKPE(12,pe);
}
#endif
JMPNext();
}
ENDBOp();
BOp(expand_clauses, sssllp);
{
PredEntry *pe = PREG->y_u.sssllp.p;
yamop *pt0;
/* update ASP before calling IPred */
SET_ASP(YREG, E_CB*sizeof(CELL));
#if defined(YAPOR) || defined(THREADS)
if (PP == NULL) {
PELOCK(13,pe);
}
if (!same_lu_block(PREG_ADDR, PREG)) {
PREG = *PREG_ADDR;
if (!PP) {
UNLOCKPE(16,pe);
}
JMPNext();
}
#endif
saveregs();
pt0 = Yap_ExpandIndex(pe, 0);
/* restart index */
setregs();
PREG = pt0;
#if defined(YAPOR) || defined(THREADS)
if (!PP) {
UNLOCKPE(18,pe);
}
#endif
JMPNext();
}
ENDBOp();
BOp(undef_p, e);
/* save S for module name */
saveregs();
undef_goal( PASS_REGS1 );
setregs();
/* for profiler */
CACHE_A1();
JMPNext();
ENDBOp();
BOp(spy_pred, e);
saveregs();
spy_goal( PASS_REGS1 );
setregs();
CACHE_A1();
JMPNext();
ENDBOp();

View File

@ -1027,34 +1027,22 @@ Yap_gmp_exp_big_big(Term t1, Term t2)
Term
Yap_gmp_big_from_64bits(int64_t i)
Yap_gmp_big_from_64bits(YAP_LONG_LONG i)
{
char s[65];
char s[64];
MP_INT new;
#ifdef _WIN32
snprintf(s,64,"%I64d", (long long int)i);
#elif HAVE_SNPRINTF
snprintf(s, 64, "%lld", (int64_t)i);
snprintf(s, 64, "%lld", (long long int)i);
#else
sprintf(s, "%lld", (int64_t)i);
sprintf(s, "%lld", (long long int)i);
#endif
mpz_init_set_str (&new, s, 10);
return MkBigAndClose(&new);
}
int64_t
Yap_gmp_big_to_64bits(Term t)
{
MP_INT *b = Yap_BigIntOfTerm(t);
int64_t rc;
mpz_export( &rc, NULL, 0, sizeof(int64_t), 0, 0, b);
if ( mpz_sgn(b) < 0 ) {
rc = -rc;
}
return rc;
}
Term
Yap_gmq_rdiv_int_int(Int i1, Int i2)
{
@ -1764,7 +1752,6 @@ Yap_term_to_existing_rat(Term t, MP_RAT *b)
return FALSE;
}
#endif

View File

@ -4179,7 +4179,7 @@ p_inform_gc( USES_REGS1 )
{
Term tn = MkIntegerTerm(LOCAL_TotGcTime);
Term tt = MkIntegerTerm(LOCAL_GcCalls);
Term ts = Yap_MkInt64Term((LOCAL_TotGcRecovered*sizeof(CELL)));
Term ts = Yap_Mk64IntegerTerm((LOCAL_TotGcRecovered*sizeof(CELL)));
return(Yap_unify(tn, ARG2) && Yap_unify(tt, ARG1) && Yap_unify(ts, ARG3));

View File

@ -1,459 +0,0 @@
/************************************************************************\
* Indexing in ARG1 *
\************************************************************************/
#ifdef INDENT_CODE
{
{
{
#endif /* INDENT_CODE */
BOp(user_switch, lp);
{
yamop *new = Yap_udi_search(PREG->y_u.lp.p);
if (!new) {
PREG = PREG->y_u.lp.l;
JMPNext();
}
PREG = new;
JMPNext();
}
ENDBOp();
BOp(switch_on_type, llll);
BEGD(d0);
d0 = CACHED_A1();
deref_head(d0, swt_unk);
/* nonvar */
swt_nvar:
if (IsPairTerm(d0)) {
/* pair */
SREG = RepPair(d0);
copy_jmp_address(PREG->y_u.llll.l1);
PREG = PREG->y_u.llll.l1;
JMPNext();
}
else if (!IsApplTerm(d0)) {
/* constant */
copy_jmp_address(PREG->y_u.llll.l2);
PREG = PREG->y_u.llll.l2;
I_R = d0;
JMPNext();
}
else {
/* appl */
copy_jmp_address(PREG->y_u.llll.l3);
PREG = PREG->y_u.llll.l3;
SREG = RepAppl(d0);
JMPNext();
}
BEGP(pt0);
deref_body(d0, pt0, swt_unk, swt_nvar);
/* variable */
copy_jmp_address(PREG->y_u.llll.l4);
PREG = PREG->y_u.llll.l4;
JMPNext();
ENDP(pt0);
ENDD(d0);
ENDBOp();
/* specialised case where the arguments may be:
* a list;
* the empty list;
* some other atom;
* a variable;
*
*/
BOp(switch_list_nl, ollll);
ALWAYS_LOOKAHEAD(PREG->y_u.ollll.pop);
BEGD(d0);
d0 = CACHED_A1();
#if UNIQUE_TAG_FOR_PAIRS
deref_list_head(d0, swlnl_unk_p);
swlnl_list_p:
{
#else
deref_head(d0, swlnl_unk_p);
/* non variable */
swlnl_nvar_p:
if (__builtin_expect(IsPairTerm(d0),1)) {
/* pair */
#endif
copy_jmp_address(PREG->y_u.ollll.l1);
PREG = PREG->y_u.ollll.l1;
SREG = RepPair(d0);
ALWAYS_GONext();
}
#if UNIQUE_TAG_FOR_PAIRS
swlnl_nlist_p:
#endif
if (d0 == TermNil) {
/* empty list */
PREG = PREG->y_u.ollll.l2;
JMPNext();
}
else {
/* appl or constant */
if (IsApplTerm(d0)) {
copy_jmp_address(PREG->y_u.ollll.l3);
PREG = PREG->y_u.ollll.l3;
SREG = RepAppl(d0);
JMPNext();
} else {
copy_jmp_address(PREG->y_u.ollll.l3);
PREG = PREG->y_u.ollll.l3;
I_R = d0;
JMPNext();
}
}
BEGP(pt0);
#if UNIQUE_TAG_FOR_PAIRS
swlnl_unk_p:
deref_list_body(d0, pt0, swlnl_list_p, swlnl_nlist_p);
#else
deref_body(d0, pt0, swlnl_unk_p, swlnl_nvar_p);
#endif
ENDP(pt0);
/* variable */
copy_jmp_address(PREG->y_u.ollll.l4);
PREG = PREG->y_u.ollll.l4;
JMPNext();
ENDD(d0);
}
ENDBOp();
BOp(switch_on_arg_type, xllll);
BEGD(d0);
d0 = XREG(PREG->y_u.xllll.x);
deref_head(d0, arg_swt_unk);
/* nonvar */
arg_swt_nvar:
if (IsPairTerm(d0)) {
/* pair */
copy_jmp_address(PREG->y_u.xllll.l1);
PREG = PREG->y_u.xllll.l1;
SREG = RepPair(d0);
JMPNext();
}
else if (!IsApplTerm(d0)) {
/* constant */
copy_jmp_address(PREG->y_u.xllll.l2);
PREG = PREG->y_u.xllll.l2;
I_R = d0;
JMPNext();
}
else {
/* appl */
copy_jmp_address(PREG->y_u.xllll.l3);
PREG = PREG->y_u.xllll.l3;
SREG = RepAppl(d0);
JMPNext();
}
BEGP(pt0);
deref_body(d0, pt0, arg_swt_unk, arg_swt_nvar);
/* variable */
copy_jmp_address(PREG->y_u.xllll.l4);
PREG = PREG->y_u.xllll.l4;
JMPNext();
ENDP(pt0);
ENDD(d0);
ENDBOp();
BOp(switch_on_sub_arg_type, sllll);
BEGD(d0);
d0 = SREG[PREG->y_u.sllll.s];
deref_head(d0, sub_arg_swt_unk);
/* nonvar */
sub_arg_swt_nvar:
if (IsPairTerm(d0)) {
/* pair */
copy_jmp_address(PREG->y_u.sllll.l1);
PREG = PREG->y_u.sllll.l1;
SREG = RepPair(d0);
JMPNext();
}
else if (!IsApplTerm(d0)) {
/* constant */
copy_jmp_address(PREG->y_u.sllll.l2);
PREG = PREG->y_u.sllll.l2;
I_R = d0;
JMPNext();
}
else {
/* appl */
copy_jmp_address(PREG->y_u.sllll.l3);
PREG = PREG->y_u.sllll.l3;
SREG = RepAppl(d0);
JMPNext();
}
BEGP(pt0);
deref_body(d0, pt0, sub_arg_swt_unk, sub_arg_swt_nvar);
/* variable */
copy_jmp_address(PREG->y_u.sllll.l4);
PREG = PREG->y_u.sllll.l4;
JMPNext();
ENDP(pt0);
ENDD(d0);
ENDBOp();
BOp(jump_if_var, l);
BEGD(d0);
d0 = CACHED_A1();
deref_head(d0, jump_if_unk);
/* non var */
jump0_if_nonvar:
PREG = NEXTOP(PREG, l);
JMPNext();
BEGP(pt0);
deref_body(d0, pt0, jump_if_unk, jump0_if_nonvar);
/* variable */
copy_jmp_address(PREG->y_u.l.l);
PREG = PREG->y_u.l.l;
ENDP(pt0);
JMPNext();
ENDD(d0);
ENDBOp();
BOp(jump_if_nonvar, xll);
BEGD(d0);
d0 = XREG(PREG->y_u.xll.x);
deref_head(d0, jump2_if_unk);
/* non var */
jump2_if_nonvar:
copy_jmp_address(PREG->y_u.xll.l1);
PREG = PREG->y_u.xll.l1;
JMPNext();
BEGP(pt0);
deref_body(d0, pt0, jump2_if_unk, jump2_if_nonvar);
/* variable */
PREG = NEXTOP(PREG, xll);
ENDP(pt0);
JMPNext();
ENDD(d0);
ENDBOp();
BOp(if_not_then, clll);
BEGD(d0);
d0 = CACHED_A1();
deref_head(d0, if_n_unk);
if_n_nvar:
/* not variable */
if (d0 == PREG->y_u.clll.c) {
/* equal to test value */
copy_jmp_address(PREG->y_u.clll.l2);
PREG = PREG->y_u.clll.l2;
JMPNext();
}
else {
/* different from test value */
/* the case to optimise */
copy_jmp_address(PREG->y_u.clll.l1);
PREG = PREG->y_u.clll.l1;
JMPNext();
}
BEGP(pt0);
deref_body(d0, pt0, if_n_unk, if_n_nvar);
ENDP(pt0);
/* variable */
copy_jmp_address(PREG->y_u.clll.l3);
PREG = PREG->y_u.clll.l3;
JMPNext();
ENDD(d0);
ENDBOp();
/************************************************************************\
* Indexing on ARG1 *
\************************************************************************/
#define HASH_SHIFT 6
BOp(switch_on_func, sssl);
BEGD(d1);
d1 = *SREG++;
/* we use a very simple hash function to find elements in a
* switch table */
{
CELL
/* first, calculate the mask */
Mask = (PREG->y_u.sssl.s - 1) << 1, /* next, calculate the hash function */
hash = d1 >> (HASH_SHIFT - 1) & Mask;
CELL *base;
base = (CELL *)PREG->y_u.sssl.l;
/* PREG now points at the beginning of the hash table */
BEGP(pt0);
/* pt0 will always point at the item */
pt0 = base + hash;
BEGD(d0);
d0 = pt0[0];
/* a match happens either if we found the value, or if we
* found an empty slot */
if (d0 == d1 || d0 == 0) {
copy_jmp_addressa(pt0+1);
PREG = (yamop *) (pt0[1]);
JMPNext();
}
else {
/* ooops, collision, look for other items */
register CELL d = ((d1 | 1) << 1) & Mask;
while (1) {
hash = (hash + d) & Mask;
pt0 = base + hash;
d0 = pt0[0];
if (d0 == d1 || d0 == 0) {
copy_jmp_addressa(pt0+1);
PREG = (yamop *) pt0[1];
JMPNext();
}
}
}
ENDD(d0);
ENDP(pt0);
}
ENDD(d1);
ENDBOp();
BOp(switch_on_cons, sssl);
BEGD(d1);
d1 = I_R;
/* we use a very simple hash function to find elements in a
* switch table */
{
CELL
/* first, calculate the mask */
Mask = (PREG->y_u.sssl.s - 1) << 1, /* next, calculate the hash function */
hash = d1 >> (HASH_SHIFT - 1) & Mask;
CELL *base;
base = (CELL *)PREG->y_u.sssl.l;
/* PREG now points at the beginning of the hash table */
BEGP(pt0);
/* pt0 will always point at the item */
pt0 = base + hash;
BEGD(d0);
d0 = pt0[0];
/* a match happens either if we found the value, or if we
* found an empty slot */
if (d0 == d1 || d0 == 0) {
copy_jmp_addressa(pt0+1);
PREG = (yamop *) (pt0[1]);
JMPNext();
}
else {
/* ooops, collision, look for other items */
register CELL d = ((d1 | 1) << 1) & Mask;
while (1) {
hash = (hash + d) & Mask;
pt0 = base + hash;
d0 = pt0[0];
if (d0 == d1 || d0 == 0) {
copy_jmp_addressa(pt0+1);
PREG = (yamop *) pt0[1];
JMPNext();
}
}
}
ENDD(d0);
ENDP(pt0);
}
ENDD(d1);
ENDBOp();
BOp(go_on_func, sssl);
BEGD(d0);
{
CELL *pt = (CELL *)(PREG->y_u.sssl.l);
d0 = *SREG++;
if (d0 == pt[0]) {
copy_jmp_addressa(pt+1);
PREG = (yamop *) pt[1];
JMPNext();
} else {
copy_jmp_addressa(pt+3);
PREG = (yamop *) pt[3];
JMPNext();
}
}
ENDD(d0);
ENDBOp();
BOp(go_on_cons, sssl);
BEGD(d0);
{
CELL *pt = (CELL *)(PREG->y_u.sssl.l);
d0 = I_R;
if (d0 == pt[0]) {
copy_jmp_addressa(pt+1);
PREG = (yamop *) pt[1];
JMPNext();
} else {
copy_jmp_addressa(pt+3);
PREG = (yamop *) pt[3];
JMPNext();
}
}
ENDD(d0);
ENDBOp();
BOp(if_func, sssl);
BEGD(d1);
BEGP(pt0);
pt0 = (CELL *) PREG->y_u.sssl.l;
d1 = *SREG++;
while (pt0[0] != d1 && pt0[0] != (CELL)NULL ) {
pt0 += 2;
}
copy_jmp_addressa(pt0+1);
PREG = (yamop *) (pt0[1]);
JMPNext();
ENDP(pt0);
ENDD(d1);
ENDBOp();
BOp(if_cons, sssl);
BEGD(d1);
BEGP(pt0);
pt0 = (CELL *) PREG->y_u.sssl.l;
d1 = I_R;
while (pt0[0] != d1 && pt0[0] != 0L ) {
pt0 += 2;
}
copy_jmp_addressa(pt0+1);
PREG = (yamop *) (pt0[1]);
JMPNext();
ENDP(pt0);
ENDD(d1);
ENDBOp();
Op(index_dbref, e);
PREG = NEXTOP(PREG, e);
I_R = AbsAppl(SREG-1);
GONext();
ENDOp();
Op(index_blob, e);
PREG = NEXTOP(PREG, e);
I_R = Yap_DoubleP_key(SREG);
GONext();
ENDOp();
Op(index_long, e);
PREG = NEXTOP(PREG, e);
I_R = Yap_IntP_key(SREG);
GONext();
ENDOp();

View File

@ -1,368 +0,0 @@
/************************************************************************\
* Logical Updates *
\************************************************************************/
#ifdef INDENT_CODE
{
{
{
#endif /* INDENT_CODE */
BOp(profiled_retry_logical, OtaLl);
check_trail(TR);
{
UInt timestamp;
CACHE_Y(B);
#if defined(YAPOR) || defined(THREADS)
if (PP != PREG->y_u.OtaLl.d->ClPred) {
if (PP) UNLOCKPE(15,PP);
PP = PREG->y_u.OtaLl.d->ClPred;
PELOCK(15,PP);
}
#endif
timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[PREG->y_u.OtaLl.s]);
if (!VALID_TIMESTAMP(timestamp, PREG->y_u.OtaLl.d)) {
/* jump to next instruction */
PREG=PREG->y_u.OtaLl.n;
JMPNext();
}
restore_yaam_regs(PREG->y_u.OtaLl.n);
restore_args(PREG->y_u.OtaLl.s);
LOCK(PREG->y_u.OtaLl.d->ClPred->StatisticsForPred.lock);
PREG->y_u.OtaLl.d->ClPred->StatisticsForPred.NOfRetries++;
UNLOCK(PREG->y_u.OtaLl.d->ClPred->StatisticsForPred.lock);
#ifdef THREADS
PP = PREG->y_u.OtaLl.d->ClPred;
#endif
PREG = PREG->y_u.OtaLl.d->ClCode;
#ifdef FROZEN_STACKS
S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG);
set_cut(S_YREG, B->cp_b);
#else
set_cut(S_YREG, B_YREG->cp_b);
#endif /* FROZEN_STACKS */
SET_BB(B_YREG);
ENDCACHE_Y();
}
JMPNext();
ENDBOp();
BOp(profiled_trust_logical, OtILl);
CACHE_Y(B);
{
LogUpdIndex *cl = PREG->y_u.OtILl.block;
PredEntry *ap = cl->ClPred;
LogUpdClause *lcl = PREG->y_u.OtILl.d;
UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]);
#if defined(YAPOR) || defined(THREADS)
if (PP != ap) {
if (PP) UNLOCKPE(16,PP);
PP = ap;
PELOCK(16,PP);
}
#endif
if (!VALID_TIMESTAMP(timestamp, lcl)) {
/* jump to next alternative */
PREG = FAILCODE;
} else {
LOCK(ap->StatisticsForPred.lock);
ap->StatisticsForPred.NOfRetries++;
UNLOCK(ap->StatisticsForPred.lock);
PREG = lcl->ClCode;
}
/* HEY, leave indexing block alone!! */
/* check if we are the ones using this code */
#if MULTIPLE_STACKS
DEC_CLREF_COUNT(cl);
/* clear the entry from the trail */
B->cp_tr--;
TR = B->cp_tr;
/* actually get rid of the code */
if (cl->ClRefCount == 0 && (cl->ClFlags & (ErasedMask|DirtyMask))) {
if (PREG != FAILCODE) {
/* I am the last one using this clause, hence I don't need a lock
to dispose of it
*/
if (lcl->ClRefCount == 1) {
/* make sure the clause isn't destroyed */
/* always add an extra reference */
INC_CLREF_COUNT(lcl);
TRAIL_CLREF(lcl);
}
}
if (cl->ClFlags & ErasedMask) {
saveregs();
Yap_ErLogUpdIndex(cl);
setregs();
} else {
saveregs();
Yap_CleanUpIndex(cl);
setregs();
}
save_pc();
}
#else
if (TrailTerm(B->cp_tr-1) == CLREF_TO_TRENTRY(cl) &&
B->cp_tr != B->cp_b->cp_tr) {
cl->ClFlags &= ~InUseMask;
--B->cp_tr;
#if FROZEN_STACKS
if (B->cp_tr > TR_FZ)
#endif
{
TR = B->cp_tr;
}
/* next, recover space for the indexing code if it was erased */
if (cl->ClFlags & (ErasedMask|DirtyMask)) {
if (PREG != FAILCODE) {
/* make sure we don't erase the clause we are jumping to,
notice that we can erase a number of refs in one go. */
if (!(lcl->ClFlags & InUseMask)) {
lcl->ClFlags |= InUseMask;
TRAIL_CLREF(lcl);
}
}
if (cl->ClFlags & ErasedMask) {
saveregs();
Yap_ErLogUpdIndex(cl);
setregs();
} else {
saveregs();
Yap_CleanUpIndex(cl);
setregs();
}
save_pc();
}
}
#endif
#ifdef YAPOR
if (SCH_top_shared_cp(B)) {
SCH_last_alternative(PREG, B_YREG);
restore_args(ap->ArityOfPE);
#ifdef FROZEN_STACKS
S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG);
#else
S_YREG++;
#endif /* FROZEN_STACKS */
set_cut(S_YREG, B->cp_b);
} else
#endif /* YAPOR */
{
pop_yaam_regs();
pop_args(ap->ArityOfPE);
S_YREG--;
#ifdef FROZEN_STACKS
S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG);
#endif /* FROZEN_STACKS */
set_cut(S_YREG, B);
}
SET_BB(B_YREG);
ENDCACHE_Y();
JMPNext();
}
ENDBOp();
S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG);
#endif /* FROZEN_STACKS */
set_cut(S_YREG, B);
}
SET_BB(B_YREG);
ENDCACHE_Y();
JMPNext();
}
ENDBOp();
/*****************************************************************
* enter a logical semantics dynamic predicate *
*****************************************************************/
/* only meaningful with THREADS on! */
/* lock logical updates predicate. */
Op(lock_lu, p);
#if PARALLEL_YAP
if (PP) {
GONext();
}
PP = PREG->y_u.p.p;
PELOCK(3, PP);
#endif
PREG = NEXTOP(PREG, p);
GONext();
ENDOp();
/* only meaningful with THREADS on! */
/* lock logical updates predicate. */
Op(unlock_lu, e);
#if defined(YAPOR) || defined(THREADS)
if (PP) {
UNLOCKPE(1,PP);
PP = NULL;
}
#endif
PREG = NEXTOP(PREG, e);
GONext();
ENDOp();
/* enter logical pred */
BOp(alloc_for_logical_pred, L);
check_trail(TR);
/* say that an environment is using this clause */
/* we have our own copy for the clause */
#if MULTIPLE_STACKS
{
LogUpdClause *cl = PREG->y_u.L.ClBase;
#if PARALLEL_YAP
PredEntry *ap = cl->ClPred;
#endif
/* always add an extra reference */
INC_CLREF_COUNT(cl);
TRAIL_CLREF(cl);
UNLOCKPE(2,ap);
PP = NULL;
}
#else
{
LogUpdClause *cl = (LogUpdClause *)PREG->y_u.L.ClBase;
if (!(cl->ClFlags & InUseMask)) {
cl->ClFlags |= InUseMask;
TRAIL_CLREF(cl);
}
}
#endif
PREG = NEXTOP(PREG, L);
JMPNext();
ENDBOp();
/* copy database term */
BOp(copy_idb_term, e);
{
LogUpdClause *cl = ClauseCodeToLogUpdClause(PREG);
Term t;
SET_ASP(YREG, E_CB*sizeof(CELL));
saveregs();
while ((t = Yap_FetchTermFromDB(cl->lusl.ClSource)) == 0L) {
if (PP) UNLOCKPE(3,PP);
#if defined(YAPOR) || defined(THREADS)
PP = NULL;
#endif
if (LOCAL_Error_TYPE == OUT_OF_ATTVARS_ERROR) {
LOCAL_Error_TYPE = YAP_NO_ERROR;
if (!Yap_growglobal(NULL)) {
Yap_NilError(OUT_OF_ATTVARS_ERROR, LOCAL_ErrorMessage);
FAIL();
}
} else {
LOCAL_Error_TYPE = YAP_NO_ERROR;
if (!Yap_gc(3, ENV, CP)) {
Yap_NilError(OUT_OF_STACK_ERROR, LOCAL_ErrorMessage);
FAIL();
}
}
#if defined(YAPOR) || defined(THREADS)
PELOCK(5,ClauseCodeToLogUpdClause(PREG)->ClPred);
PP = ClauseCodeToLogUpdClause(PREG)->ClPred;
#endif
}
if (!Yap_IUnify(ARG2, t)) {
setregs();
#if defined(YAPOR) || defined(THREADS)
if (PP) UNLOCKPE(6,PP);
PP = NULL;
#endif
FAIL();
}
if (!Yap_IUnify(ARG3, MkDBRefTerm((DBRef)cl))) {
setregs();
#if defined(YAPOR) || defined(THREADS)
if (PP) UNLOCKPE(5,PP);
PP = NULL;
#endif
FAIL();
}
setregs();
#if MULTIPLE_STACKS
/* always add an extra reference */
INC_CLREF_COUNT(cl);
TRAIL_CLREF(cl);
if (PP) UNLOCKPE(7,PP);
PP = NULL;
#else
if (!(cl->ClFlags & InUseMask)) {
/* Clause *cl = (Clause *)PREG->y_u.EC.ClBase;
PREG->y_u.EC.ClTrail = TR-(tr_fr_ptr)LOCAL_TrailBase;
PREG->y_u.EC.ClENV = LCL0-YREG;*/
cl->ClFlags |= InUseMask;
TRAIL_CLREF(cl);
}
#endif
}
PREG = CPREG;
YREG = ENV;
#ifdef DEPTH_LIMIT
DEPTH = YREG[E_DEPTH];
#endif
JMPNext();
ENDBOp();
/* unify with database term */
BOp(unify_idb_term, e);
{
LogUpdClause *cl = ClauseCodeToLogUpdClause(PREG);
saveregs();
if (!Yap_IUnify(ARG2, cl->lusl.ClSource->Entry)) {
setregs();
UNLOCKPE(8,PP);
#if defined(YAPOR) || defined(THREADS)
PP = NULL;
#endif
FAIL();
}
if (!Yap_IUnify(ARG3, MkDBRefTerm((DBRef)cl))) {
setregs();
UNLOCKPE(9,PP);
#if defined(YAPOR) || defined(THREADS)
PP = NULL;
#endif
FAIL();
}
setregs();
/* say that an environment is using this clause */
/* we have our own copy for the clause */
#if MULTIPLE_STACKS
/* always add an extra reference */
INC_CLREF_COUNT(cl);
TRAIL_CLREF(cl);
UNLOCKPE(10,PP);
PP = NULL;
#else
if (!(cl->ClFlags & InUseMask)) {
/* Clause *cl = (Clause *)PREG->y_u.EC.ClBase;
PREG->y_u.EC.ClTrail = TR-(tr_fr_ptr)LOCAL_TrailBase;
PREG->y_u.EC.ClENV = LCL0-YREG;*/
cl->ClFlags |= InUseMask;
TRAIL_CLREF(cl);
}
#endif
}
PREG = CPREG;
YREG = ENV;
#ifdef DEPTH_LIMIT
DEPTH = YREG[E_DEPTH];
#endif
JMPNext();
ENDBOp();

View File

@ -1,301 +0,0 @@
#ifdef INDENT_CODE
{
{
{
#endif /* INDENT_CODE */
/* join all the meta-call code into a single procedure with three entry points */
{
CACHE_Y_AS_ENV(YREG);
BEGD(d0); /* term to be meta-called */
Term mod; /* module to be used */
PredEntry *pen; /* predicate */
choiceptr b_ptr; /* cut point */
Functor f;
/* we are doing the rhs of a , */
BOp(p_execute_tail, Osbmp);
FETCH_Y_FROM_ENV(YREG);
/* place to cut to */
b_ptr = (choiceptr)ENV_YREG[E_CB];
/* original goal */
d0 = ENV_YREG[-EnvSizeInCells-1];
/* predicate we had used */
pen = RepPredProp((Prop)IntegerOfTerm(ENV_YREG[-EnvSizeInCells-2]));
/* current module at the time */
mod = ENV_YREG[-EnvSizeInCells-3];
/* set YREG */
/* Try to preserve the environment */
ENV_YREG = (CELL *) (((char *) YREG) + PREG->y_u.Osbmp.s);
#ifdef FROZEN_STACKS
{
choiceptr top_b = PROTECT_FROZEN_B(B);
#ifdef YAPOR_SBA
if (ENV_YREG > (CELL *) top_b || ENV_YREG < HR) ENV_YREG = (CELL *) top_b;
#else
if (ENV_YREG > (CELL *) top_b) ENV_YREG = (CELL *) top_b;
#endif /* YAPOR_SBA */
}
#else
if (ENV_YREG > (CELL *) B) {
ENV_YREG = (CELL *) B;
}
#endif /* FROZEN_STACKS */
/* now, jump to actual execution */
if (pen->ArityOfPE) {
f = pen->FunctorOfPred;
/* reuse environment if we are continuining a comma, ie, (g1,g2,g3) */
/* can only do it deterministically */
/* broken
if (f == FunctorComma && (CELL *)B >= ENV) {
ENV_YREG = ENV;
ENV = (CELL *)ENV[E_E];
}
*/
goto execute_pred_f;
} else
goto execute_pred_a;
ENDBOp();
/* fetch the module from ARG2 */
BOp(p_execute2, Osbpp);
mod = ARG2;
deref_head(mod, execute2_unk0);
execute2_nvar0:
if (!IsAtomTerm(mod)) {
saveregs();
Yap_Error(TYPE_ERROR_ATOM, mod, "call/2");
setregs();
}
goto start_execute;
BEGP(pt1);
deref_body(mod, pt1, execute2_unk0, execute2_nvar0);
saveregs();
Yap_Error(INSTANTIATION_ERROR, mod, "call/2");
setregs();
ENDP(pt1);
/* Oops, second argument was unbound too */
FAIL();
ENDBOp();
BOp(p_execute, Osbmp);
/* fetch the module from PREG */
mod = PREG->y_u.Osbmp.mod;
start_execute:
/* place to cut to */
b_ptr = B;
/* we have mod, and ARG1 has the goal, let us roll */
/* Try to preserve the environment */
ENV_YREG = (CELL *) (((char *) YREG) + PREG->y_u.Osbmp.s);
#ifdef FROZEN_STACKS
{
choiceptr top_b = PROTECT_FROZEN_B(B);
#ifdef YAPOR_SBA
if (ENV_YREG > (CELL *) top_b || ENV_YREG < HR) ENV_YREG = (CELL *) top_b;
#else
if (ENV_YREG > (CELL *) top_b) ENV_YREG = (CELL *) top_b;
#endif /* YAPOR_SBA */
}
#else
if (ENV_YREG > (CELL *) B) {
ENV_YREG = (CELL *) B;
}
#endif /* FROZEN_STACKS */
d0 = ARG1;
if (PRED_GOAL_EXPANSION_ALL) {
goto execute_metacall;
}
restart_execute:
deref_head(d0, execute_unk);
execute_nvar:
if (IsApplTerm(d0)) {
f = FunctorOfTerm(d0);
if (IsExtensionFunctor(f)) {
goto execute_metacall;
}
pen = RepPredProp(PredPropByFunc(f, mod));
execute_pred_f:
if (pen->PredFlags & (MetaPredFlag|GoalExPredFlag)) {
/* just strip all of M:G */
if (f == FunctorModule) {
Term tmod = ArgOfTerm(1,d0);
/* loop on modules */
if (!IsVarTerm(tmod) && IsAtomTerm(tmod)) {
d0 = ArgOfTerm(2,d0);
mod = tmod;
goto execute_nvar;
}
goto execute_metacall;
}
if (f == FunctorComma) {
Term nmod = mod;
/* optimise conj */
SREG = RepAppl(d0);
BEGD(d1);
d1 = SREG[2];
/* create an environment to execute the call */
deref_head(d1, execute_comma_unk);
execute_comma_nvar:
if (IsAtomTerm(d1)) {
/* atomic goal is simpler */
ENV_YREG[-EnvSizeInCells-2] = MkIntegerTerm((Int)PredPropByAtom(AtomOfTerm(d1),nmod));
} else if (IsApplTerm(d1)) {
Functor f1 = FunctorOfTerm(d1);
if (IsExtensionFunctor(f1)) {
goto execute_metacall;
} else {
/* check for modules when looking up */
if (f1 == FunctorModule) {
Term tmod = ArgOfTerm(1,d1);
/* loop on modules */
if (!IsVarTerm(tmod) && IsAtomTerm(tmod)) {
d1 = ArgOfTerm(2,d1);
nmod = tmod;
goto execute_comma_nvar;
}
goto execute_metacall;
}
ENV_YREG[-EnvSizeInCells-2] = MkIntegerTerm((Int)PredPropByFunc(f1,nmod));
}
} else {
goto execute_metacall;
}
ENV_YREG[-EnvSizeInCells-3] = mod;
/* now, we can create the new environment for the meta-call */
/* notice that we are at a call, so we should ignore CP */
ENV_YREG[E_CP] = (CELL)NEXTOP(PREG,Osbmp);
ENV_YREG[E_CB] = (CELL)b_ptr;
ENV_YREG[E_E] = (CELL)ENV;
#ifdef DEPTH_LIMIT
ENV_YREG[E_DEPTH] = DEPTH;
#endif /* DEPTH_LIMIT */
ENV_YREG[-EnvSizeInCells-1] = d1;
ENV = ENV_YREG;
ENV_YREG -= EnvSizeInCells+3;
CPREG = NEXTOP(PREG, Osbmp);
PREG = COMMA_CODE;
/* for profiler */
save_pc();
d0 = SREG[1];
goto restart_execute;
BEGP(pt1);
deref_body(d1, pt1, execute_comma_unk, execute_comma_nvar);
goto execute_metacall;
ENDP(pt1);
ENDD(d1);
} else if (mod != CurrentModule) {
goto execute_metacall;
}
}
/* copy arguments of meta-call to XREGS */
BEGP(pt1);
pt1 = RepAppl(d0);
BEGD(d2);
for (d2 = ArityOfFunctor(f); d2; d2--) {
#ifdef YAPOR_SBA
BEGD(d1);
d1 = pt1[d2];
if (d1 == 0) {
XREGS[d2] = (CELL)(pt1+d2);
} else {
XREGS[d2] = d1;
}
#else
XREGS[d2] = pt1[d2];
#endif
}
ENDD(d2);
ENDP(pt1);
CACHE_A1();
} else if (IsAtomTerm(d0)) {
pen = RepPredProp(PredPropByAtom(AtomOfTerm(d0), mod));
execute_pred_a:
/* handle extra pruning */
if (pen->FunctorOfPred == (Functor)AtomCut) {
if (b_ptr != B) {
saveregs();
prune(b_ptr PASS_REGS);
setregs();
}
}
} else {
goto execute_metacall;
}
/* execute, but test first for interrupts */
execute_end:
/* code copied from call */
#ifndef NO_CHECKING
check_stack(NoStackPExecute, HR);
#endif
execute_stack_checked:
CPREG = NEXTOP(PREG, Osbmp);
ALWAYS_LOOKAHEAD(pen->OpcodeOfPred);
PREG = pen->CodeOfPred;
/* for profiler */
save_pc();
#ifdef DEPTH_LIMIT
if (DEPTH <= MkIntTerm(1)) {/* I assume Module==0 is primitives */
if (pen->ModuleOfPred) {
if (DEPTH == MkIntTerm(0))
FAIL();
else DEPTH = RESET_DEPTH();
}
} else if (pen->ModuleOfPred)
DEPTH -= MkIntConstant(2);
#endif /* DEPTH_LIMIT */
#ifdef LOW_LEVEL_TRACER
if (Yap_do_low_level_trace)
low_level_trace(enter_pred,pen,XREGS+1);
#endif /* LOW_LEVEL_TRACER */
WRITEBACK_Y_AS_ENV();
/* setup GB */
ENV_YREG[E_CB] = (CELL) B;
#ifdef YAPOR
SCH_check_requests();
#endif /* YAPOR */
CACHE_A1();
ALWAYS_GONext();
ALWAYS_END_PREFETCH();
/* meta-call: Prolog to the rescue */
BEGP(pt1);
deref_body(d0, pt1, execute_unk, execute_nvar);
execute_metacall:
ARG1 = ARG3 = d0;
pen = PredMetaCall;
ARG2 = Yap_cp_as_integer(b_ptr);
if (mod)
ARG4 = mod;
else
ARG4 = TermProlog;
goto execute_end;
ENDP(pt1);
/* at this point, we have the arguments all set in the argument registers, pen says who is the current predicate. don't remove. */
NoStackPExecute:
WRITEBACK_Y_AS_ENV();
#ifdef SHADOW_S
Yap_REGS.S_ = SREG;
#endif
saveregs_and_ycache();
d0 = interrupt_pexecute( pen PASS_REGS );
setregs_and_ycache();
#ifdef SHADOW_S
SREG = Yap_REGS.S_;
#endif
if (!d0) FAIL();
if (d0 == 2) goto execute_stack_checked;
goto execute_end;
ENDBOp();
ENDD(d0);
ENDCACHE_Y_AS_ENV();
}

View File

@ -1,192 +0,0 @@
/************************************************************************ \
* Instructions for implemeting 'or;' *
\************************************************************************/
#ifdef INDENT_CODE
{
{
{
#endif /* INDENT_CODE */
BOp(jump, l);
PREG = PREG->y_u.l.l;
JMPNext();
ENDBOp();
/* This instruction is called when the previous goal
was interrupted when waking up goals
*/
BOp(move_back, l);
PREG = (yamop *)(((char *)PREG)-(Int)(NEXTOP((yamop *)NULL,Osbpp)));
JMPNext();
ENDBOp();
/* This instruction is called when the previous goal
was interrupted when waking up goals
*/
BOp(skip, l);
PREG = NEXTOP(PREG,l);
JMPNext();
ENDBOp();
Op(either, Osblp);
#ifdef LOW_LEVEL_TRACER
if (Yap_do_low_level_trace) {
low_level_trace(try_or, (PredEntry *)PREG, NULL);
}
#endif
#ifdef COROUTINING
CACHE_Y_AS_ENV(YREG);
check_stack(NoStackEither, HR);
ENDCACHE_Y_AS_ENV();
either_notest:
#endif
BEGD(d0);
/* Try to preserve the environment */
d0 = PREG->y_u.Osblp.s;
BEGCHO(pt1);
pt1 = (choiceptr) ((char *) YREG + (yslot) d0);
#ifdef FROZEN_STACKS
{
choiceptr top_b = PROTECT_FROZEN_B(B);
#ifdef YAPOR_SBA
if (pt1 > top_b || pt1 < (choiceptr)HR) pt1 = top_b;
#else
if (pt1 > top_b) pt1 = top_b;
#endif /* YAPOR_SBA */
}
#else
if (pt1 > B) {
pt1 = B;
}
#endif /* FROZEN_STACKS */
pt1 = (choiceptr)(((CELL *) pt1)-1);
*(CELL **) pt1 = YREG;
store_yaam_regs_for_either(PREG->y_u.Osblp.l, PREG);
SREG = (CELL *) (B = pt1);
#ifdef YAPOR
SCH_set_load(pt1);
#endif /* YAPOR */
SET_BB(pt1);
ENDCHO(pt1);
/* skip the current instruction plus the next one */
PREG = NEXTOP(NEXTOP(PREG, Osblp),l);
GONext();
ENDD(d0);
#ifdef COROUTINING
NoStackEither:
PROCESS_INT(interrupt_either, either_notest);
#endif
ENDOp();
Op(or_else, Osblp);
HR = HBREG = PROTECT_FROZEN_H(B);
ENV = B->cp_env;
B->cp_cp = PREG;
#ifdef DEPTH_LIMIT
DEPTH = B->cp_depth;
#endif /* DEPTH_LIMIT */
SET_BB(PROTECT_FROZEN_B(B));
#ifdef YAPOR
if (SCH_top_shared_cp(B)) {
SCH_new_alternative(PREG, PREG->y_u.Osblp.l);
} else
#endif /* YAPOR */
B->cp_ap = PREG->y_u.Osblp.l;
PREG = NEXTOP(PREG, Osblp);
YREG = (CELL *) B->cp_a1;
GONext();
ENDOp();
#ifdef YAPOR
Op(or_last, Osblp);
#else
Op(or_last, p);
#endif /* YAPOR */
BEGCHO(pt0);
pt0 = B;
#ifdef YAPOR
if (SCH_top_shared_cp(B)) {
HR = HBREG = PROTECT_FROZEN_H(pt0);
YREG = (CELL *) pt0->cp_a1;
ENV = pt0->cp_env;
#ifdef DEPTH_LIMIT
DEPTH = pt0->cp_depth;
#endif /* DEPTH_LIMIT */
SCH_new_alternative(PREG, NULL);
}
else
#endif /* YAPOR */
{
B = pt0->cp_b;
HR = PROTECT_FROZEN_H(pt0);
YREG = (CELL *) pt0->cp_a1;
ENV = pt0->cp_env;
#ifdef DEPTH_LIMIT
DEPTH = pt0->cp_depth;
#endif /* DEPTH_LIMIT */
HBREG = PROTECT_FROZEN_H(B);
}
#ifdef YAPOR
PREG = NEXTOP(PREG, Osblp);
#else
PREG = NEXTOP(PREG, p);
#endif /* YAPOR */
SET_BB(PROTECT_FROZEN_B(B));
GONext();
ENDCHO(pt0);
ENDOp();
/************************************************************************\
* Pop operations *
\************************************************************************/
OpRW(pop_n, s);
/* write mode might have been called from read mode */
BEGD(d0);
d0 = PREG->y_u.os.s;
SP = (CELL *) (((char *) SP) + d0);
ENDD(d0);
BEGD(d0);
d0 = SP[0];
if (d0) {
START_PREFETCH(s);
SREG = (CELL *) (SP[1]);
SP += 2;
PREG = NEXTOP(PREG, s);
GONext();
END_PREFETCH();
}
else {
START_PREFETCH_W(s);
SREG = (CELL *) (SP[1]);
SP += 2;
PREG = NEXTOP(PREG, s);
GONextW();
END_PREFETCH_W();
}
ENDD(d0);
ENDOpRW();
OpRW(pop, e);
BEGD(d0);
d0 = SP[0];
SREG = (CELL *) (SP[1]);
SP += 2;
if (d0) {
START_PREFETCH(e);
PREG = NEXTOP(PREG, e);
GONext();
END_PREFETCH();
}
else {
START_PREFETCH_W(e);
PREG = NEXTOP(PREG, e);
GONextW();
END_PREFETCH_W();
}
ENDD(d0);
ENDOpRW();

File diff suppressed because it is too large Load Diff

View File

@ -693,7 +693,7 @@ read_tag(IOSTREAM *stream)
return ch;
}
static pred_flags_t
static UInt
read_predFlags(IOSTREAM *stream)
{
pred_flags_t v;
@ -1005,9 +1005,8 @@ read_clauses(IOSTREAM *stream, PredEntry *pp, UInt nclauses, UInt flags) {
static void
read_pred(IOSTREAM *stream, Term mod) {
pred_flags_t flags;
UInt nclauses;
pred_flags_t fl1;
UInt flags;
UInt nclauses, fl1;
PredEntry *ap;
ap = LookupPredEntry((PredEntry *)read_UInt(stream));
@ -1020,8 +1019,8 @@ read_pred(IOSTREAM *stream, Term mod) {
// printf(" %s/%ld\n", NameOfFunctor(ap->FunctorOfPred)->StrOfAE, ap->ArityOfPE);
//else if (ap->ModuleOfPred != IDB_MODULE)
// printf(" %s/%ld\n", ((Atom)(ap->FunctorOfPred))->StrOfAE, ap->ArityOfPE);
fl1 = flags & ((pred_flags_t)STATIC_PRED_FLAGS|(pred_flags_t)EXTRA_PRED_FLAGS);
ap->PredFlags &= ~((pred_flags_t)STATIC_PRED_FLAGS|(pred_flags_t)EXTRA_PRED_FLAGS);
fl1 = flags & ((UInt)STATIC_PRED_FLAGS|(UInt)EXTRA_PRED_FLAGS);
ap->PredFlags &= ~((UInt)STATIC_PRED_FLAGS|(UInt)EXTRA_PRED_FLAGS);
ap->PredFlags |= fl1;
if (flags & NumberDBPredFlag) {
ap->src.IndxId = read_UInt(stream);
@ -1038,7 +1037,7 @@ read_pred(IOSTREAM *stream, Term mod) {
}
read_clauses(stream, ap, nclauses, flags);
if (flags & HiddenPredFlag) {
Yap_HidePred(ap, false);
Yap_HidePred(ap);
}
}

View File

@ -837,14 +837,12 @@ get_num(int *chp, int *chbuffp, IOSTREAM *inp_stream, char *s, UInt max_size, in
GET_LD
char *sp = s;
int ch = *chp;
Int val = 0L;
int base = ch-'0';
bool might_be_float = true, has_overflow = false;
Int val = 0L, base = ch - '0';
int might_be_float = TRUE, has_overflow = FALSE;
const unsigned char *decimalpoint;
*sp++ = ch;
ch = getchr(inp_stream);
/*
* because of things like 00'2, 03'2 and even better 12'2, I need to
* do this (have mercy)
@ -854,97 +852,103 @@ get_num(int *chp, int *chbuffp, IOSTREAM *inp_stream, char *s, UInt max_size, in
if (--max_size == 0) {
return num_send_error_message("Number Too Long");
}
base = base*10+ ch - '0';
base = 10 * base + ch - '0';
ch = getchr(inp_stream);
}
if (base == 0) {
if (ch <= '9' && ch >= '0') {
*sp++ = ch;
val = base;
base = 10;
// go scan a number
} else if (ch == '\'') {
int scan_extra;
wchar_t ascii;
if (ch == '\'') {
if (base > 36) {
return num_send_error_message("Admissible bases are 0..36");
}
might_be_float = FALSE;
if (--max_size == 0) {
return num_send_error_message("Number Too Long");
}
*sp++ = ch;
ch = getchr(inp_stream);
if (base == 0) {
wchar_t ascii = ch;
int scan_extra = TRUE;
ch = getchr(inp_stream);
if (ch == '\\' &&
Yap_GetModuleEntry(CurrentModule)->flags & M_CHARESCAPE) {
/* a quick way to represent ASCII */
ascii = read_quoted_char(&scan_extra, inp_stream);
} else {
ascii = ch;
}
ch = getchr(inp_stream);
*chp = ch;
/* a quick way to represent ASCII */
if (scan_extra)
*chp = getchr(inp_stream);
if (sign == -1) {
return MkIntegerTerm(-ascii);
}
return MkIntegerTerm(ascii);
} else {
switch (ch) {
case 'b':
base = 2;
} else if (base >= 10 && base <= 36) {
int upper_case = 'A' - 11 + base;
int lower_case = 'a' - 11 + base;
while (my_isxdigit(ch, upper_case, lower_case)) {
Int oval = val;
int chval = (chtype(ch) == NU ? ch - '0' :
(my_isupper(ch) ? ch - 'A' : ch - 'a') + 10);
if (--max_size == 0) {
return num_send_error_message("Number Too Long");
}
*sp++ = ch;
val = oval * base + chval;
if (oval != (val-chval)/base) /* overflow */
has_overflow = (has_overflow || TRUE);
ch = getchr(inp_stream);
break;
case 'o':
base = 8;
ch = getchr(inp_stream);
break;
case 'x':
base = 16;
ch = getchr(inp_stream);
break;
default:
/* floating point */
base = 10;
}
}
} else {
/* base > 0, must be a number */
if (ch == '\'') {
} else if (ch == 'x' && base == 0) {
might_be_float = FALSE;
if (--max_size == 0) {
return num_send_error_message("Number Too Long");
}
*sp++ = ch;
ch = getchr(inp_stream);
while (my_isxdigit(ch, 'F', 'f')) {
Int oval = val;
int chval = (chtype(ch) == NU ? ch - '0' :
(my_isupper(ch) ? ch - 'A' : ch - 'a') + 10);
if (--max_size == 0) {
return num_send_error_message("Number Too Long");
}
sp = s;
}
*sp++ = ch;
val = val * 16 + chval;
if (oval != (val-chval)/16) /* overflow */
has_overflow = TRUE;
ch = getchr(inp_stream);
} else {
val = base;
base = 10;
}
*chp = ch;
}
if (base <= 10) {
// do this fast, it is most important */
while ( ch >= '0' && ch <= base+('0'- 1)) {
Int oval = val;
if (!has_overflow) {
val = val * base + ch - '0';
if (val/base != oval || val -oval*base != ch-'0') /* overflow */
has_overflow = true;
}
*sp++ = ch;
if (--max_size == 0) {
return num_send_error_message("Number Too Long");
}
ch = getchr(inp_stream);
}
else if (ch == 'o' && base == 0) {
might_be_float = FALSE;
base = 8;
ch = getchr(inp_stream);
} else if (ch == 'b' && base == 0) {
might_be_float = FALSE;
base = 2;
ch = getchr(inp_stream);
} else {
while (chtype(ch) == NU ||my_isxdigit(ch, 'a'+(base-10), 'A'+(base-10))) {
Int oval = val;
if (!has_overflow) {
int dig =
(ch >= '0' && ch <= '9' ? ch - '0' :
ch >= 'a' ? ch +10 - 'a' : ch+10-'A' );
val = val * base + dig;
if (val/base != oval || val -oval*base != dig) /* overflow */
has_overflow = true;
}
*sp++ = ch;
val = base;
base = 10;
}
while (chtype(ch) == NU) {
Int oval = val;
if (!(val == 0 && ch == '0') || has_overflow) {
if (--max_size == 0) {
return num_send_error_message("Number Too Long");
}
ch = getchr(inp_stream);
*sp++ = ch;
}
if (ch - '0' >= base) {
if (sign == -1)
return MkIntegerTerm(-val);
return MkIntegerTerm(val);
}
val = val * base + ch - '0';
if (val/base != oval || val -oval*base != ch-'0') /* overflow */
has_overflow = TRUE;
ch = getchr(inp_stream);
}
if (might_be_float && ( ch == '.' || ch == 'e' || ch == 'E')) {
int has_dot = ( ch == '.' );
@ -1024,7 +1028,7 @@ get_num(int *chp, int *chbuffp, IOSTREAM *inp_stream, char *s, UInt max_size, in
*sp = '\0';
/* skip base */
*chp = ch;
if (s[0] == '0' && (s[1] == 'x'|| s[1] == 'X'))
if (s[0] == '0' && s[1] == 'x')
return read_int_overflow(s+2,16,val,sign);
else if (s[0] == '0' && s[1] == 'o')
return read_int_overflow(s+2,8,val,sign);

View File

@ -156,7 +156,7 @@ get_signal(yap_signals sig USES_REGS)
#if THREADS
uint64_t old;
// first, clear the Interrupted Marker, now if someone sets it it is their problem
// first, clear the Creep Flag, now if someone sets it it is their problem
CalculateStackGap( PASS_REGS1 );
// reset the flag
if ( (old =__sync_fetch_and_and( &LOCAL_Signals, ~SIGNAL_TO_BIT(sig) ) ) !=

View File

@ -827,41 +827,52 @@ static Int cont_current_predicate(USES_REGS1) {
Functor f;
if (IsNonVarTerm(t1)) {
PropEntry *p = AddressOfTerm(EXTRA_CBACK_ARG(4, 1)), *p0 = p;
PropEntry *q = AddressOfTerm(EXTRA_CBACK_ARG(4, 2)), *q0 = q;
PredEntry *pp0;
if (q) pp0 = RepPredProp(q);
else pp0 = RepPredProp(p);
while (!pp && p ) {
if ( p->KindOfPE == PEProp && p != p0) {
pp = RepPredProp(p);
q = NULL;
} else if ( p->KindOfPE == FunctorProperty ) {
if (q0) {
q = q0->NextOfPE;
q0 = NULL;
} else {
q = RepFunctorProp(p)->PropsOfFE;
}
while (!pp && q ) {
if ( q->KindOfPE == PEProp )
pp = RepPredProp(q);
else
q = q->NextOfPE;
}
if (!q)
p = p->NextOfPE;
} else {
p = p->NextOfPE;
PropEntry *p = AddressOfTerm(EXTRA_CBACK_ARG(4, 1));
PropEntry *q = AddressOfTerm(EXTRA_CBACK_ARG(4, 2));
// restart inner loop
for (; q; q = q->NextOfPE) {
if (q->KindOfPE == PEProp) {
pp = RepPredProp(q);
q = q->NextOfPE;
if (q == NIL)
p = p->NextOfPE;
if (!p)
is_det = true;
// we are done with this loop.
break;
}
}
if (!pp && p) {
// try using outer loop
for (; p; p = p->NextOfPE) {
if (p->KindOfPE == PEProp) {
q = NULL;
pp = RepPredProp(p);
p = p->NextOfPE;
if (!p)
is_det = true;
break;
} else if (p->KindOfPE == FunctorProperty) {
// looping on p/n
for (q = RepFunctorProp(p)->PropsOfFE; q; q = q->NextOfPE) {
if (q->KindOfPE == PEProp) {
pp = RepPredProp(q);
q = q->NextOfPE;
if (!q && !p->NextOfPE)
is_det = true;
break;
}
}
break;
}
}
}
if (pp == NULL) // nothing more
is_det = true;
cut_fail();
if (!is_det) {
EXTRA_CBACK_ARG(4, 1) = MkAddressTerm(p);
EXTRA_CBACK_ARG(4, 2) = MkAddressTerm(q);
}
pp = pp0;
} else if (IsNonVarTerm(t2)) {
// operating within the same module.
PredEntry *npp;
@ -1003,25 +1014,12 @@ static Int init_current_predicate(USES_REGS1) {
cut_fail();
} else {
PropEntry *p = RepAtom(AtomOfTerm(t1))->PropsOfAE, *q = NIL;
while (!pp && p ) {
if ( p->KindOfPE == PEProp ) {
pp = RepPredProp(p);
} else if ( p->KindOfPE == FunctorProperty ) {
q = RepFunctorProp(p)->PropsOfFE;
while (!pp && q ) {
if ( q->KindOfPE == PEProp )
pp = RepPredProp(q);
else
q = q->NextOfPE;
}
if (!q)
p = p->NextOfPE;
} else {
p = p->NextOfPE;
}
while (p && p->KindOfPE == FunctorProperty &&
(q = RepFunctorProp(p)->PropsOfFE) == NIL) {
p = p->NextOfPE;
}
if (!pp)
cut_fail();
if (!p)
cut_fail();
EXTRA_CBACK_ARG(4, 1) = MkAddressTerm(p);
EXTRA_CBACK_ARG(4, 2) = MkAddressTerm(q);
}
@ -1197,7 +1195,7 @@ static Int p_flags(USES_REGS1) { /* $flags(+Functor,+Mod,?OldFlags,?NewFlags) */
if (EndOfPAEntr(pe))
return (FALSE);
PELOCK(92, pe);
if (!Yap_unify_constant(ARG3, Yap_MkInt64Term(pe->PredFlags))) {
if (!Yap_unify_constant(ARG3, MkIntegerTerm(pe->PredFlags))) {
UNLOCK(pe->PELock);
return (FALSE);
}
@ -1205,18 +1203,18 @@ static Int p_flags(USES_REGS1) { /* $flags(+Functor,+Mod,?OldFlags,?NewFlags) */
if (IsVarTerm(ARG4)) {
UNLOCK(pe->PELock);
return (TRUE);
} else if (!IsInt64Term(ARG4)) {
} else if (!IsIntegerTerm(ARG4)) {
Term te = Yap_Eval(ARG4);
if (IsInt64Term(te)) {
newFl = Yap_Int64OfTerm(te);
if (IsIntegerTerm(te)) {
newFl = IntegerOfTerm(te);
} else {
UNLOCK(pe->PELock);
Yap_Error(TYPE_ERROR_INTEGER, ARG4, "flags");
return (FALSE);
}
} else
newFl = Yap_Int64OfTerm(ARG4);
newFl = IntegerOfTerm(ARG4);
pe->PredFlags = newFl;
UNLOCK(pe->PELock);
return TRUE;
@ -1270,7 +1268,7 @@ static Int
if (IsVarTerm(ARG4)) {
UNLOCK(pe->PELock);
return (FALSE);
} else if (!IsInt64Term(v)) {
} else if (!IsIntTerm(v)) {
Yap_Error(TYPE_ERROR_ATOM, v, "set_property/1");
return (FALSE);
}

File diff suppressed because it is too large Load Diff

View File

@ -4559,7 +4559,7 @@ p_is_list( USES_REGS1 )
return Yap_IsListTerm(Deref(ARG1));
}
int
bool
Yap_IsListOrPartialListTerm(Term t)
{
Term *tailp, tail;

View File

@ -556,7 +556,7 @@ write_quoted(wchar_t ch, wchar_t quote, wrf stream)
char esc[8];
/* last backslash in ISO mode */
snprintf(esc, 7, "\\%03o\\", (unsigned int)ch);
sprintf(esc, "\\%03o\\", ch);
wrputs(esc, stream);
}
}

View File

@ -112,7 +112,7 @@ Yap_PutInSlot(yhandle_t slot, Term t USES_REGS)
/// @brief allocate n empty new slots
static inline yhandle_t
Yap_NewSlots(size_t n USES_REGS)
Yap_NewSlots(int n USES_REGS)
{
yhandle_t old_slots = IntOfTerm(ASP[0]), oldn = n;
while (n > 0) {
@ -132,7 +132,7 @@ Yap_countSlots( USES_REGS1 )
}
/// @brief create a new slot with term t
static inline yhandle_t
static inline Int
Yap_InitSlot(Term t USES_REGS)
{
yhandle_t old_slots = IntOfTerm(ASP[0]);
@ -143,8 +143,8 @@ Yap_InitSlot(Term t USES_REGS)
}
/// @brief Succeeds if it is to recover the space allocated for $n$ contiguos slots starting at topSlot.
static inline bool
Yap_RecoverSlots(size_t n, yhandle_t topSlot USES_REGS)
static inline int
Yap_RecoverSlots(int n, yhandle_t topSlot USES_REGS)
{
yhandle_t old_slots = IntOfTerm(ASP[0]),
new_slots = old_slots-n;
@ -152,10 +152,10 @@ Yap_RecoverSlots(size_t n, yhandle_t topSlot USES_REGS)
return FALSE;
}
if (ASP+1 != LCL0+topSlot)
return false;
return FALSE;
ASP += n;
ASP[new_slots+1] = ASP[0] = MkIntTerm(new_slots);
return true;
return TRUE;
}
#endif

View File

@ -115,7 +115,7 @@ Int YAP_Execute(struct pred_entry *, CPredicate);
Int YAP_ExecuteFirst(struct pred_entry *, CPredicate);
Int YAP_ExecuteNext(struct pred_entry *, CPredicate);
Int YAP_ExecuteOnCut(struct pred_entry *, CPredicate, struct cut_c_str *);
extern Int Yap_RunGoalOnce(Term);
Int YAP_RunGoalOnce(Term);
#endif
/* cdmgr.c */
@ -133,10 +133,8 @@ void Yap_BuildMegaClause(struct pred_entry *);
void Yap_EraseMegaClause(yamop *,struct pred_entry *);
void Yap_ResetConsultStack(void);
void Yap_AssertzClause(struct pred_entry *, yamop *);
void Yap_HidePred(struct pred_entry *pe, bool offline);
void Yap_HidePred(struct pred_entry *pe);
int Yap_SetNoTrace(char *name, UInt arity, Term tmod);
struct pred_entry* Yap_getPred(Term t, Term tmod, char *msg);
struct pred_entry* Yap_Pred(Term t, Term tmod, char *msg);
/* cmppreds.c */
Int Yap_compare_terms(Term,Term);
@ -169,8 +167,8 @@ Yap_PrintPredName( struct pred_entry *ap );
#endif
void Yap_RestartYap(int);
void Yap_exit(int);
yamop *Yap_Error(yap_error_number,Term, const char *msg, ...);
yamop *Yap_NilError(yap_error_number, const char *msg, ...);
yamop *Yap_Error(yap_error_number,Term,char *msg, ...);
yamop *Yap_NilError(yap_error_number,char *msg, ...);
int Yap_HandleError( const char *msg, ... );
int Yap_SWIHandleError( const char *, ... );
@ -421,7 +419,7 @@ size_t Yap_ExportTerm(Term, char *, size_t, UInt);
size_t Yap_SizeOfExportedTerm(char *);
Term Yap_ImportTerm(char *);
int Yap_IsListTerm(Term);
int Yap_IsListOrPartialListTerm(Term);
bool Yap_IsListOrPartialListTerm(Term);
Term Yap_CopyTermNoShare(Term);
int Yap_SizeGroundTerm(Term, int);
int Yap_IsGroundTerm(Term);
@ -430,6 +428,7 @@ void Yap_InitUtilCPreds(void);
Int Yap_TermHash(Term, Int, Int, int);
Int Yap_NumberVars(Term, Int, int);
Term Yap_TermVariables( Term t, UInt arity USES_REGS );
int Yap_IsListOrPartialListTerm( UInt arity USES_REGS );
Term Yap_UnNumberTerm(Term, int);
Int Yap_SkipList(Term *, Term **);
/* yap.c */

116
H/Yatom.h
View File

@ -651,39 +651,39 @@ IsValProperty (int flags)
don't forget to also add in qly.h
*/
#define DiscontiguousPredFlag ((pred_flags_t)0x1000000000LL) /* predicates whose clauses may be all-over the place.. */
#define SysExportPredFlag ((pred_flags_t)0x800000000LL)
#define DiscontiguousPredFlag ((pred_flags_t)0x1000000000) /* predicates whose clauses may be all-over the place.. */
#define SysExportPredFlag ((pred_flags_t)0x800000000)
/* reuse export list to prolog module. */
#define NoTracePredFlag ((pred_flags_t)0x400000000LL) /* cannot trace this predicate */
#define NoSpyPredFlag ((pred_flags_t)0x200000000LL) /* cannot spy this predicate */
#define QuasiQuotationPredFlag ((pred_flags_t)0x100000000LL) /* SWI-like quasi quotations */
#define MegaClausePredFlag ((pred_flags_t)0x80000000LL) /* predicate is implemented as a mega-clause */
#define ThreadLocalPredFlag ((pred_flags_t)0x40000000LL) /* local to a thread */
#define MultiFileFlag ((pred_flags_t)0x20000000LL) /* is multi-file */
#define UserCPredFlag ((pred_flags_t)0x10000000LL) /* CPred defined by the user */
#define LogUpdatePredFlag ((pred_flags_t)0x08000000LL) /* dynamic predicate with log. upd. sem. */
#define InUsePredFlag ((pred_flags_t)0x04000000LL) /* count calls to pred */
#define CountPredFlag ((pred_flags_t)0x02000000LL) /* count calls to pred */
#define HiddenPredFlag ((pred_flags_t)0x01000000LL) /* invisible predicate */
#define CArgsPredFlag ((pred_flags_t)0x00800000LL) /* SWI-like C-interface pred. */
#define SourcePredFlag ((pred_flags_t)0x00400000LL) /* static predicate with source declaration */
#define MetaPredFlag ((pred_flags_t)0x00200000LL) /* predicate subject to a meta declaration */
#define SyncPredFlag ((pred_flags_t)0x00100000LL) /* has to synch before it can execute */
#define NumberDBPredFlag ((pred_flags_t)0x00080000LL) /* entry for a number key */
#define AtomDBPredFlag ((pred_flags_t)0x00040000LL) /* entry for an atom key */
#define GoalExPredFlag ((pred_flags_t)0x00020000LL) /* predicate that is called by goal_expand */
#define TestPredFlag ((pred_flags_t)0x00010000LL) /* is a test (optim. comit) */
#define AsmPredFlag ((pred_flags_t)0x00008000LL) /* inline */
#define StandardPredFlag ((pred_flags_t)0x00004000LL) /* system predicate */
#define DynamicPredFlag ((pred_flags_t)0x00002000LL) /* dynamic predicate */
#define CPredFlag ((pred_flags_t)0x00001000LL) /* written in C */
#define SafePredFlag ((pred_flags_t)0x00000800LL) /* does not alter arguments */
#define CompiledPredFlag ((pred_flags_t)0x00000400LL) /* is static */
#define IndexedPredFlag ((pred_flags_t)0x00000200LL) /* has indexing code */
#define SpiedPredFlag ((pred_flags_t)0x00000100LL) /* is a spy point */
#define BinaryPredFlag ((pred_flags_t)0x00000080LL) /* test predicate */
#define TabledPredFlag ((pred_flags_t)0x00000040LL) /* is tabled */
#define SequentialPredFlag ((pred_flags_t)0x00000020LL) /* may not create parallel choice points! */
#define NoTracePredFlag ((pred_flags_t)0x400000000) /* cannot trace this predicate */
#define NoSpyPredFlag ((pred_flags_t)0x200000000) /* cannot spy this predicate */
#define QuasiQuotationPredFlag ((pred_flags_t)0x100000000) /* SWI-like quasi quotations */
#define MegaClausePredFlag ((pred_flags_t)0x80000000) /* predicate is implemented as a mega-clause */
#define ThreadLocalPredFlag ((pred_flags_t)0x40000000) /* local to a thread */
#define MultiFileFlag ((pred_flags_t)0x20000000) /* is multi-file */
#define UserCPredFlag ((pred_flags_t)0x10000000) /* CPred defined by the user */
#define LogUpdatePredFlag ((pred_flags_t)0x08000000) /* dynamic predicate with log. upd. sem. */
#define InUsePredFlag ((pred_flags_t)0x04000000) /* count calls to pred */
#define CountPredFlag ((pred_flags_t)0x02000000) /* count calls to pred */
#define HiddenPredFlag ((pred_flags_t)0x01000000) /* invisible predicate */
#define CArgsPredFlag ((pred_flags_t)0x00800000) /* SWI-like C-interface pred. */
#define SourcePredFlag ((pred_flags_t)0x00400000) /* static predicate with source declaration */
#define MetaPredFlag ((pred_flags_t)0x00200000) /* predicate subject to a meta declaration */
#define SyncPredFlag ((pred_flags_t)0x00100000) /* has to synch before it can execute */
#define NumberDBPredFlag ((pred_flags_t)0x00080000) /* entry for a number key */
#define AtomDBPredFlag ((pred_flags_t)0x00040000) /* entry for an atom key */
#define GoalExPredFlag ((pred_flags_t)0x00020000) /* predicate that is called by goal_expand */
#define TestPredFlag ((pred_flags_t)0x00010000) /* is a test (optim. comit) */
#define AsmPredFlag ((pred_flags_t)0x00008000) /* inline */
#define StandardPredFlag ((pred_flags_t)0x00004000) /* system predicate */
#define DynamicPredFlag ((pred_flags_t)0x00002000) /* dynamic predicate */
#define CPredFlag ((pred_flags_t)0x00001000) /* written in C */
#define SafePredFlag ((pred_flags_t)0x00000800) /* does not alter arguments */
#define CompiledPredFlag ((pred_flags_t)0x00000400) /* is static */
#define IndexedPredFlag ((pred_flags_t)0x00000200) /* has indexing code */
#define SpiedPredFlag ((pred_flags_t)0x00000100) /* is a spy point */
#define BinaryPredFlag ((pred_flags_t)0x00000080) /* test predicate */
#define TabledPredFlag ((pred_flags_t)0x00000040) /* is tabled */
#define SequentialPredFlag ((pred_flags_t)0x00000020) /* may not create parallel choice points! */
#define ProfiledPredFlag ((pred_flags_t)0x00000010) /* pred is being profiled */
#define BackCPredFlag ((pred_flags_t)0x00000008) /* Myddas Imported pred */
#define ModuleTransparentPredFlag ((pred_flags_t)0x00000004) /* ModuleTransparent pred */
@ -1865,58 +1865,6 @@ PredPropByAtomAndMod (Atom at, Term cur_mod)
return Yap_NewPredPropByAtom (ae, cur_mod);
}
//
// report arity, name, and module for a predicate.
//
INLINE_ONLY inline EXTERN
UInt IndicatorOfPred(PredEntry * ap, const char **name, const char **module);
INLINE_ONLY inline EXTERN
UInt IndicatorOfPred(PredEntry * ap, const char **name, const char **module)
{
if (module) {
Term tmod = ap->ModuleOfPred;
if (!tmod) *module = "prolog";
else *module = RepAtom(AtomOfTerm( tmod ))->StrOfAE;
}
if (ap->ModuleOfPred == IDB_MODULE) {
if (ap->PredFlags & NumberDBPredFlag ) {
if (name) {
Int id = ap->src.IndxId;
char *s = (char *)malloc(16);
snprintf(s, 15, Int_FORMAT, id);
*name = s;
}
return 0;
} else if (ap->PredFlags & AtomDBPredFlag) {
if (name) {
Atom At = (Atom)ap->FunctorOfPred;
*name = RepAtom(At)->StrOfAE;
}
return 0;
} else {
Functor f = ap->FunctorOfPred;
if (name) {
Atom At = NameOfFunctor(f);
*name = RepAtom(At)->StrOfAE;
}
return ArityOfFunctor(f);
}
} else {
if (name) {
if (ap->ArityOfPE == 0) {
Atom At = (Atom)ap->FunctorOfPred;
*name = RepAtom(At)->StrOfAE;
} else {
Functor f = ap->FunctorOfPred;
Atom At = NameOfFunctor(f);
*name = RepAtom(At)->StrOfAE;
}
}
return ap->ArityOfPE;
}
}
#if DEBUG_PELOCKING
#define PELOCK(I,Z) \
{ LOCK((Z)->PELock); (Z)->StatisticsForPred.NOfEntries=(I);(Z)->StatisticsForPred.NOfHeadSuccesses=pthread_self(); }

View File

@ -489,8 +489,7 @@ Term Yap_gmp_exp_big_big(Term,Term);
Term Yap_gmp_gcd_int_big(Int,Term);
Term Yap_gmp_gcd_big_big(Term,Term);
Term Yap_gmp_big_from_64bits(int64_t);
int64_t Yap_gmp_big_to_64bits(Term);
Term Yap_gmp_big_from_64bits(YAP_LONG_LONG);
Term Yap_gmp_float_to_big(Float);
Term Yap_gmp_float_to_rational(Float);
@ -539,12 +538,12 @@ int Yap_term_to_existing_rat(Term, MP_RAT *);
void Yap_gmp_set_bit(Int i, Term t);
#endif
#define Yap_MkInt64Term(i) __Yap_MkInt64Term((i) PASS_REGS)
#define Yap_Mk64IntegerTerm(i) __Yap_Mk64IntegerTerm((i) PASS_REGS)
INLINE_ONLY inline EXTERN Term __Yap_MkInt64Term(YAP_LONG_LONG USES_REGS);
INLINE_ONLY inline EXTERN Term __Yap_Mk64IntegerTerm(YAP_LONG_LONG USES_REGS);
INLINE_ONLY inline EXTERN Term
__Yap_MkInt64Term(YAP_LONG_LONG i USES_REGS)
__Yap_Mk64IntegerTerm(YAP_LONG_LONG i USES_REGS)
{
if (i <= Int_MAX && i >= Int_MIN) {
return MkIntegerTerm((Int)i);
@ -557,37 +556,6 @@ __Yap_MkInt64Term(YAP_LONG_LONG i USES_REGS)
}
}
INLINE_ONLY inline EXTERN bool IsInt64Term (Term);
INLINE_ONLY inline EXTERN bool
IsInt64Term (Term t)
{
CELL *pt;
return IsIntegerTerm (t)
||(FunctorOfTerm (t) == FunctorBigInt &&
( pt = RepAppl(t)) &&
pt[1] == BIG_INT &&
mpz_sizeinbase(Yap_BigIntOfTerm(t), 2) < 64);
}
#define Yap_Int64OfTerm(i) __Yap_Int64OfTerm((i) PASS_REGS)
INLINE_ONLY inline EXTERN int64_t __Yap_Int64OfTerm(Term t USES_REGS);
INLINE_ONLY inline EXTERN int64_t
__Yap_Int64OfTerm( Term t USES_REGS)
{
if (IsIntegerTerm( t )) {
return IntegerOfTerm(t);
} else {
#if USE_GMP
return Yap_gmp_big_to_64bits(t);
#else
return 0;
#endif
}
}
#if __clang__ && FALSE /* not in OSX yet */
#define DO_ADD() if (__builtin_sadd_overflow( i1, i2, & z ) ) { goto overflow; }

View File

@ -101,14 +101,9 @@ typedef enum {
QLY_ATOM_BLOB = 17
} qlf_tag_t;
#define STATIC_PRED_FLAGS (HiddenPredFlag|AtomDBPredFlag|NumberDBPredFlag|MetaPredFlag|SyncPredFlag|SYSTEM_PRED_FLAGS|PROP_PRED_FLAGS|SWI_PRED_FLAGS|EXTRA_PRED_FLAGS)
#define STATIC_PRED_FLAGS (SourcePredFlag|DynamicPredFlag|LogUpdatePredFlag|CompiledPredFlag|MultiFileFlag|TabledPredFlag|MegaClausePredFlag|CountPredFlag|ProfiledPredFlag|ThreadLocalPredFlag|AtomDBPredFlag|ModuleTransparentPredFlag|NumberDBPredFlag|MetaPredFlag|SyncPredFlag|BackCPredFlag)
#define EXTRA_PRED_FLAGS (QuasiQuotationPredFlag|NoTracePredFlag|NoSpyPredFlag)
#define PROP_PRED_FLAGS (SourcePredFlag|DynamicPredFlag|LogUpdatePredFlag|CompiledPredFlag|MultiFileFlag|TabledPredFlag|MegaClausePredFlag|ModuleTransparentPredFlag|CountPredFlag|ProfiledPredFlag|ThreadLocalPredFlag)
#define SWI_PRED_FLAGS (SWIEnvPredFlag|CArgsPredFlag)
#define SYSTEM_PRED_FLAGS (BackCPredFlag|UserCPredFlag|CArgsPredFlag|AsmPredFlag|CPredFlag|BinaryPredFlag)
#define CHECK(F) { size_t r = (F); if (!r) return r; }

View File

@ -13,19 +13,19 @@
extern Environment ExpEnv;
#if YAP_JIT
Int Get_N_Cores(void);
X_API Int Init_Analysis_Struc(void);
X_API Int Init_Transform_Struc(void);
X_API Int Init_Codegen_Struc(void);
X_API Int Init_Config_Struc(void);
Int STD_PROTO(Get_N_Cores,(void));
X_API Int STD_PROTO(Init_Analysis_Struc,(void));
X_API Int STD_PROTO(Init_Transform_Struc,(void));
X_API Int STD_PROTO(Init_Codegen_Struc,(void));
X_API Int STD_PROTO(Init_Config_Struc,(void));
#if YAP_STAT_PREDS
X_API Int Init_Stats_Struc(void);
X_API Int STD_PROTO(Init_Stats_Struc, (void));
#endif
#endif /* YAP_JIT */
#if YAP_DBG_PREDS
X_API Int Init_Debug_Struc(void);
X_API Int STD_PROTO(Init_Debug_Struc,(void));
#endif
X_API Int YAP_Init_ExpEnv(void);
X_API Int STD_PROTO(YAP_Init_ExpEnv,(void));
#if YAP_JIT
Int
@ -39,11 +39,11 @@ Get_N_Cores() {
size_t len = 4;
uint32_t count;
nm[0] = CTL_HW; nm[1] = HW_AVAILCPU;
nm[0] = CTL_HW; nm[1] = HRW_AVAILCPU;
sysctl(nm, 2, &count, &len, NULL, 0);
if(count < 1) {
nm[1] = HW_NCPU;
nm[1] = HRW_NCPU;
sysctl(nm, 2, &count, &len, NULL, 0);
if(count < 1) { count = 1; }
}
@ -119,7 +119,7 @@ Init_Config_Struc()
ExpEnv.config_struc.frequency_type = COUNTER;
ExpEnv.config_struc.frequency_bound = 1024.0;
ExpEnv.config_struc.profiling_startp = 0.72;
ExpEnv.config_struc.mainclause_ty = HOT_AND_CALLEE;
ExpEnv.config_struc.mainclause_ty = HROT_AND_CALLEE;
ExpEnv.config_struc.torecompile = 1;
}
else {

File diff suppressed because it is too large Load Diff

24
JIT/HPP/JIT.hh Normal file
View File

@ -0,0 +1,24 @@
#ifndef JIT_HPP
#define JIT_HPP
#ifdef __cplusplus
#include <vector>
#include <string>
#include <cstdio>
#include <iostream>
#include <fstream>
#include <time.h>
#include <dlfcn.h>
#include "config.h"
#include "absmi.h"
using namespace std;
#else
#define LIMIT_COUNT 4096
#endif
#endif

104
JIT/HPP/JIT_Compiler.hh Normal file
View File

@ -0,0 +1,104 @@
#ifndef JIT_COMPILER_HPP
#define JIT_COMPILER_HPP
#ifdef __cplusplus
#include "llvm/LLVMContext.h"
#include "llvm/Module.h"
#include "llvm/Constants.h"
#include "llvm/DerivedTypes.h"
#include "llvm/Instructions.h"
#include "llvm/Linker.h"
#include "llvm/PassManager.h"
#include "llvm/CallGraphSCCPass.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/StringSet.h"
#include "llvm/ADT/Triple.h"
#include "llvm/Assembly/PrintModulePass.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/CodeGen/MachineCodeInfo.h"
#include "llvm/ExecutionEngine/JIT.h"
#include "llvm/ExecutionEngine/Interpreter.h"
#include "llvm/ExecutionEngine/GenericValue.h"
#include "llvm/ExecutionEngine/JITMemoryManager.h"
#include "llvm/ExecutionEngine/JITEventListener.h"
#include "llvm/Support/DataStream.h"
#include "llvm/Support/IRReader.h"
#include "llvm/Support/Host.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/TargetSelect.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/raw_os_ostream.h"
#include "llvm/Support/IRBuilder.h"
#include "llvm/Support/PathV1.h"
#include "llvm/Support/TypeBuilder.h"
#include "llvm/Support/ToolOutputFile.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetOptions.h"
#include "llvm/Target/TargetLibraryInfo.h"
#include "llvm/Analysis/Passes.h"
#include "llvm/Analysis/IVUsers.h"
#include "llvm/Analysis/Lint.h"
#include "llvm/Analysis/DebugInfo.h"
#include "llvm/Analysis/Verifier.h"
#include "llvm/Analysis/LoopPass.h"
#include "llvm/Analysis/RegionPass.h"
#include "llvm/Analysis/CFGPrinter.h"
#include "llvm/Analysis/DomPrinter.h"
#include "llvm/Analysis/BranchProbabilityInfo.h"
#include "llvm/Analysis/RegionPrinter.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/system_error.h"
#include "llvm/Support/Process.h"
#include "llvm/Bitcode/ReaderWriter.h"
#include "llvm/Transforms/IPO.h"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Transforms/Vectorize.h"
#include "llvm/Transforms/IPO/PassManagerBuilder.h"
#include "llvm/Transforms/Utils/Cloning.h"
using namespace llvm;
#include <fcntl.h>
#include <errno.h>
#include "JIT.hpp"
using namespace std;
extern short global;
extern Environment ExpEnv;
extern NativeContext *NativeArea;
class JIT_Compiler {
private:
/* main method of JIT Compiler: compiles by clang, analyzes, optimizs and generates code accordingly the user choices */
void* compile_all(LLVMContext* &Context, yamop* p);
/* aid method to 'compile_all': adds register allocator pass to be used.
WARNING: don't use! For some reasons llvm crashes when I use it */
void set_regalloc_pass(PassManager &PM);
/* aid method to 'compile_all': optimizes module by individual transform passes or transform level */
void optimize_module(llvm::Module* &M);
/* aid method to 'compile_all': analyzes module by individual analysis passes */
void analyze_module(llvm::Module* &M);
public:
/* method invoked by wrapper 'call_JIT_Compiler' */
void* compile(yamop*);
};
#else
struct JIT_Compiler{}; // Doing this, I can call class 'JIT_Compiler' from C code
#endif
#ifdef __cplusplus
extern "C" void* call_JIT_Compiler(JIT_Compiler* jc, yamop* p) { return jc->compile(p); }
extern "C" void shutdown_llvm() { llvm_shutdown(); }
#endif //#ifdef __cplusplus
#endif

183
JIT/HPP/PassPrinters.hh Normal file
View File

@ -0,0 +1,183 @@
/**
* The code below is adapted from opt tool according to clearance and conditions established in NCSA license as follows:
* Copyright (c) 2003 University of Illinois. All rights reserved.
* Developed by: LLVM Developer Group
* University of Illinois
* http://llvm.org/
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation
* files (the "Software"), to deal with the Software without restriction, including without limitation the rights to use, copy,
* modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software
* is furnished to do so, subject to the following conditions:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimers.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimers
* in the documentation and/or other materials provided with the distribution.
* Neither the names of LLVM Developer Group, University of Illinois, nor the names of its contributors may be used to endorse or
* promote products derived from this Software without specific prior written permission.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT HROLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
* IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE.
**/
struct CallGraphSCCPassPrinter : public CallGraphSCCPass {
static char ID;
const PassInfo *PassToPrint;
std::string PassName;
CallGraphSCCPassPrinter(const PassInfo *PI) :
CallGraphSCCPass(ID), PassToPrint(PI) {
std::string PassToPrintName = PassToPrint->getPassName();
PassName = "CallGraphSCCPass Printer: " + PassToPrintName;
}
virtual bool runOnSCC(CallGraphSCC &SCC) {
errs() << "Printing analysis '" << PassToPrint->getPassName() << "':\n";
// Get and print pass...
for (CallGraphSCC::iterator I = SCC.begin(), E = SCC.end(); I != E; ++I) {
Function *F = (*I)->getFunction();
if (F)
getAnalysisID<Pass>(PassToPrint->getTypeInfo()).print(errs(),
F->getParent());
}
return false;
}
virtual const char *getPassName() const { return PassName.c_str(); }
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequiredID(PassToPrint->getTypeInfo());
AU.setPreservesAll();
}
};
char CallGraphSCCPassPrinter::ID = 0;
struct ModulePassPrinter : public ModulePass {
static char ID;
const PassInfo *PassToPrint;
std::string PassName;
ModulePassPrinter(const PassInfo *PI)
: ModulePass(ID), PassToPrint(PI) {
std::string PassToPrintName = PassToPrint->getPassName();
PassName = "ModulePass Printer: " + PassToPrintName;
}
virtual bool runOnModule(Module &M) {
errs() << "Printing analysis '" << PassToPrint->getPassName() << "':\n";
// Get and print pass...
getAnalysisID<Pass>(PassToPrint->getTypeInfo()).print(errs(), &M);
return false;
}
virtual const char *getPassName() const { return PassName.c_str(); }
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequiredID(PassToPrint->getTypeInfo());
AU.setPreservesAll();
}
};
char ModulePassPrinter::ID = 0;
struct FunctionPassPrinter : public FunctionPass {
const PassInfo *PassToPrint;
static char ID;
std::string PassName;
FunctionPassPrinter(const PassInfo *PI)
: FunctionPass(ID), PassToPrint(PI) {
std::string PassToPrintName = PassToPrint->getPassName();
PassName = "FunctionPass Printer: " + PassToPrintName;
}
virtual bool runOnFunction(Function &F) {
errs() << "Printing analysis '" << PassToPrint->getPassName()
<< "' for function '" << F.getName() << "':\n";
// Get and print pass...
getAnalysisID<Pass>(PassToPrint->getTypeInfo()).print(errs(),
F.getParent());
return false;
}
virtual const char *getPassName() const { return PassName.c_str(); }
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequiredID(PassToPrint->getTypeInfo());
AU.setPreservesAll();
}
};
char FunctionPassPrinter::ID = 0;
struct LoopPassPrinter : public LoopPass {
static char ID;
const PassInfo *PassToPrint;
std::string PassName;
LoopPassPrinter(const PassInfo *PI) :
LoopPass(ID), PassToPrint(PI) {
std::string PassToPrintName = PassToPrint->getPassName();
PassName = "LoopPass Printer: " + PassToPrintName;
}
virtual bool runOnLoop(Loop *L, LPPassManager &LPM) {
errs() << "Printing analysis '" << PassToPrint->getPassName() << "':\n";
// Get and print pass...
getAnalysisID<Pass>(PassToPrint->getTypeInfo()).print(errs(),
L->getHeader()->getParent()->getParent());
return false;
}
virtual const char *getPassName() const { return PassName.c_str(); }
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequiredID(PassToPrint->getTypeInfo());
AU.setPreservesAll();
}
};
char LoopPassPrinter::ID = 0;
struct RegionPassPrinter : public RegionPass {
static char ID;
const PassInfo *PassToPrint;
std::string PassName;
RegionPassPrinter(const PassInfo *PI) : RegionPass(ID),
PassToPrint(PI) {
std::string PassToPrintName = PassToPrint->getPassName();
PassName = "RegionPass Printer: " + PassToPrintName;
}
virtual bool runOnRegion(Region *R, RGPassManager &RGM) {
errs() << "Printing analysis '" << PassToPrint->getPassName() << "' for "
<< "region: '" << R->getNameStr() << "' in function '"
<< R->getEntry()->getParent()->getName() << "':\n";
// Get and print pass...
getAnalysisID<Pass>(PassToPrint->getTypeInfo()).print(errs(),
R->getEntry()->getParent()->getParent());
return false;
}
virtual const char *getPassName() const { return PassName.c_str(); }
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequiredID(PassToPrint->getTypeInfo());
AU.setPreservesAll();
}
};
char RegionPassPrinter::ID = 0;

View File

@ -358,7 +358,7 @@
#ifdef USE_GMP
GET_BIGINT_INSTINIT,
GET_BIGINT_GBIGINT_NONVAR,
GET_BIGINT_GBIGINT_UNK,
GET_BIGINT_GBIGINT_UNK
#endif
GET_DBTERM_INSTINIT,
GET_DBTERM_GDBTERM_NONVAR,

View File

@ -1,9 +1,9 @@
#define USER_SWITCH_INSTINIT \
BLOCKADDRESS = (CELL)(*_PREG); \
{ \
yamop *new = Yap_udi_search((*_PREG)->y_u.lp.p); \
yamop *new = Yap_udi_search((*_PREG)->u.lp.p); \
if (!new) { \
(*_PREG) = (*_PREG)->y_u.lp.l; \
(*_PREG) = (*_PREG)->u.lp.l; \
JMPNext(); \
} \
else { \
@ -34,27 +34,27 @@
(d0) = *(CELL *)(d0); \
} \
if (!nonvar) { \
copy_jmp_address((*_PREG)->y_u.llll.l4); \
(*_PREG) = (*_PREG)->y_u.llll.l4; \
copy_jmp_address((*_PREG)->u.llll.l4); \
(*_PREG) = (*_PREG)->u.llll.l4; \
JMPNext(); \
} \
} \
if (nonvar) { \
if (IsPairTerm(d0)) { \
(*_SREG) = RepPair(d0); \
copy_jmp_address((*_PREG)->y_u.llll.l1); \
(*_PREG) = (*_PREG)->y_u.llll.l1; \
copy_jmp_address((*_PREG)->u.llll.l1); \
(*_PREG) = (*_PREG)->u.llll.l1; \
JMPNext(); \
} \
else if (!IsApplTerm(d0)) { \
copy_jmp_address((*_PREG)->y_u.llll.l2); \
(*_PREG) = (*_PREG)->y_u.llll.l2; \
copy_jmp_address((*_PREG)->u.llll.l2); \
(*_PREG) = (*_PREG)->u.llll.l2; \
I_R = d0; \
JMPNext(); \
} \
else { \
copy_jmp_address((*_PREG)->y_u.llll.l3); \
(*_PREG) = (*_PREG)->y_u.llll.l3; \
copy_jmp_address((*_PREG)->u.llll.l3); \
(*_PREG) = (*_PREG)->u.llll.l3; \
(*_SREG) = RepAppl(d0); \
JMPNext(); \
} \
@ -68,7 +68,7 @@
BLOCKADDRESS = (CELL)(*_PREG); \
register CELL d0; \
register CELL *pt0; \
ALWAYS_LOOKAHEAD((*_PREG)->y_u.ollll.pop); \
ALWAYS_LOOKAHEAD((*_PREG)->u.ollll.pop); \
d0 = CACHED_A1(); \
Int nonvar = 0; \
Int pair = 1; \
@ -77,18 +77,18 @@
do { \
if (!IsVarTerm(d0)) { \
if (d0 == TermNil) { \
(*_PREG) = (*_PREG)->y_u.ollll.l2; \
(*_PREG) = (*_PREG)->u.ollll.l2; \
JMPNext(); \
} \
else { \
if (IsApplTerm(d0)) { \
copy_jmp_address((*_PREG)->y_u.ollll.l3); \
(*_PREG) = (*_PREG)->y_u.ollll.l3; \
copy_jmp_address((*_PREG)->u.ollll.l3); \
(*_PREG) = (*_PREG)->u.ollll.l3; \
(*_SREG) = RepAppl(d0); \
JMPNext(); \
} else { \
copy_jmp_address((*_PREG)->y_u.ollll.l3); \
(*_PREG) = (*_PREG)->y_u.ollll.l3; \
copy_jmp_address((*_PREG)->u.ollll.l3); \
(*_PREG) = (*_PREG)->u.ollll.l3; \
I_R = d0; \
JMPNext(); \
} \
@ -105,14 +105,14 @@
} \
} while (TRUE); \
if (!nonvar && !pair) { \
copy_jmp_address((*_PREG)->y_u.ollll.l4); \
(*_PREG) = (*_PREG)->y_u.ollll.l4; \
copy_jmp_address((*_PREG)->u.ollll.l4); \
(*_PREG) = (*_PREG)->u.ollll.l4; \
JMPNext(); \
} \
} \
if (!nonvar && pair) { \
copy_jmp_address((*_PREG)->y_u.ollll.l1); \
(*_PREG) = (*_PREG)->y_u.ollll.l1; \
copy_jmp_address((*_PREG)->u.ollll.l1); \
(*_PREG) = (*_PREG)->u.ollll.l1; \
(*_SREG) = RepPair(d0); \
ALWAYS_GONext(); \
}
@ -121,7 +121,7 @@
BLOCKADDRESS = (CELL)(*_PREG); \
register CELL d0; \
register CELL *pt0; \
ALWAYS_LOOKAHEAD((*_PREG)->y_u.ollll.pop); \
ALWAYS_LOOKAHEAD((*_PREG)->u.ollll.pop); \
d0 = CACHED_A1(); \
Int nonvar = 0; \
if (IsVarTerm(d0)) { \
@ -136,31 +136,31 @@
(d0) = *(CELL *)(d0); \
} \
if (!nonvar) { \
copy_jmp_address((*_PREG)->y_u.ollll.l4); \
(*_PREG) = (*_PREG)->y_u.ollll.l4; \
copy_jmp_address((*_PREG)->u.ollll.l4); \
(*_PREG) = (*_PREG)->u.ollll.l4; \
JMPNext(); \
} \
} \
if (nonvar) { \
if (__builtin_expect(IsPairTerm(d0),1)) { \
copy_jmp_address((*_PREG)->y_u.ollll.l1); \
(*_PREG) = (*_PREG)->y_u.ollll.l1; \
copy_jmp_address((*_PREG)->u.ollll.l1); \
(*_PREG) = (*_PREG)->u.ollll.l1; \
(*_SREG) = RepPair(d0); \
ALWAYS_GONext(); \
} \
if (d0 == TermNil) { \
(*_PREG) = (*_PREG)->y_u.ollll.l2; \
(*_PREG) = (*_PREG)->u.ollll.l2; \
JMPNext(); \
} \
else { \
if (IsApplTerm(d0)) { \
copy_jmp_address((*_PREG)->y_u.ollll.l3); \
(*_PREG) = (*_PREG)->y_u.ollll.l3; \
copy_jmp_address((*_PREG)->u.ollll.l3); \
(*_PREG) = (*_PREG)->u.ollll.l3; \
(*_SREG) = RepAppl(d0); \
JMPNext(); \
} else { \
copy_jmp_address((*_PREG)->y_u.ollll.l3); \
(*_PREG) = (*_PREG)->y_u.ollll.l3; \
copy_jmp_address((*_PREG)->u.ollll.l3); \
(*_PREG) = (*_PREG)->u.ollll.l3; \
I_R = d0; \
JMPNext(); \
} \
@ -175,7 +175,7 @@
BLOCKADDRESS = (CELL)(*_PREG); \
register CELL d0; \
register CELL *pt0; \
d0 = XREG((*_PREG)->y_u.xllll.x); \
d0 = XREG((*_PREG)->u.xllll.x); \
Int nonvar = 1; \
if (IsVarTerm(d0)) { \
nonvar = 0; \
@ -190,27 +190,27 @@
(d0) = *(CELL *)(d0); \
} \
if (!nonvar) { \
copy_jmp_address((*_PREG)->y_u.xllll.l4); \
(*_PREG) = (*_PREG)->y_u.xllll.l4; \
copy_jmp_address((*_PREG)->u.xllll.l4); \
(*_PREG) = (*_PREG)->u.xllll.l4; \
JMPNext(); \
} \
} \
if (nonvar) { \
if (IsPairTerm(d0)) { \
copy_jmp_address((*_PREG)->y_u.xllll.l1); \
(*_PREG) = (*_PREG)->y_u.xllll.l1; \
copy_jmp_address((*_PREG)->u.xllll.l1); \
(*_PREG) = (*_PREG)->u.xllll.l1; \
(*_SREG) = RepPair(d0); \
JMPNext(); \
} \
else if (!IsApplTerm(d0)) { \
copy_jmp_address((*_PREG)->y_u.xllll.l2); \
(*_PREG) = (*_PREG)->y_u.xllll.l2; \
copy_jmp_address((*_PREG)->u.xllll.l2); \
(*_PREG) = (*_PREG)->u.xllll.l2; \
I_R = d0; \
JMPNext(); \
} \
else { \
copy_jmp_address((*_PREG)->y_u.xllll.l3); \
(*_PREG) = (*_PREG)->y_u.xllll.l3; \
copy_jmp_address((*_PREG)->u.xllll.l3); \
(*_PREG) = (*_PREG)->u.xllll.l3; \
(*_SREG) = RepAppl(d0); \
JMPNext(); \
} \
@ -223,7 +223,7 @@
BLOCKADDRESS = (CELL)(*_PREG); \
register CELL d0; \
register CELL *pt0; \
d0 = (*_SREG)[(*_PREG)->y_u.sllll.s]; \
d0 = (*_SREG)[(*_PREG)->u.sllll.s]; \
Int nonvar = 1; \
if (IsVarTerm(d0)) { \
nonvar = 0; \
@ -238,27 +238,27 @@
(d0) = *(CELL *)(d0); \
} \
if (!nonvar) { \
copy_jmp_address((*_PREG)->y_u.sllll.l4); \
(*_PREG) = (*_PREG)->y_u.sllll.l4; \
copy_jmp_address((*_PREG)->u.sllll.l4); \
(*_PREG) = (*_PREG)->u.sllll.l4; \
JMPNext(); \
} \
} \
if (nonvar) { \
if (IsPairTerm(d0)) { \
copy_jmp_address((*_PREG)->y_u.sllll.l1); \
(*_PREG) = (*_PREG)->y_u.sllll.l1; \
copy_jmp_address((*_PREG)->u.sllll.l1); \
(*_PREG) = (*_PREG)->u.sllll.l1; \
(*_SREG) = RepPair(d0); \
JMPNext(); \
} \
else if (!IsApplTerm(d0)) { \
copy_jmp_address((*_PREG)->y_u.sllll.l2); \
(*_PREG) = (*_PREG)->y_u.sllll.l2; \
copy_jmp_address((*_PREG)->u.sllll.l2); \
(*_PREG) = (*_PREG)->u.sllll.l2; \
I_R = d0; \
JMPNext(); \
} \
else { \
copy_jmp_address((*_PREG)->y_u.sllll.l3); \
(*_PREG) = (*_PREG)->y_u.sllll.l3; \
copy_jmp_address((*_PREG)->u.sllll.l3); \
(*_PREG) = (*_PREG)->u.sllll.l3; \
(*_SREG) = RepAppl(d0); \
JMPNext(); \
} \
@ -286,8 +286,8 @@
(d0) = *(CELL *)(d0); \
} \
if (!nonvar) { \
copy_jmp_address((*_PREG)->y_u.l.l); \
(*_PREG) = (*_PREG)->y_u.l.l; \
copy_jmp_address((*_PREG)->u.l.l); \
(*_PREG) = (*_PREG)->u.l.l; \
JMPNext(); \
} \
} \
@ -303,7 +303,7 @@
BLOCKADDRESS = (CELL)(*_PREG); \
register CELL d0; \
register CELL *pt0; \
d0 = XREG((*_PREG)->y_u.xll.x); \
d0 = XREG((*_PREG)->u.xll.x); \
Int nonvar = 0; \
if (IsVarTerm(d0)) { \
(pt0) = (CELL *)(d0); \
@ -322,8 +322,8 @@
} \
} \
if (nonvar) { \
copy_jmp_address((*_PREG)->y_u.xll.l1); \
(*_PREG) = (*_PREG)->y_u.xll.l1; \
copy_jmp_address((*_PREG)->u.xll.l1); \
(*_PREG) = (*_PREG)->u.xll.l1; \
JMPNext(); \
}
@ -349,20 +349,20 @@
(d0) = *(CELL *)(d0); \
} \
if (!nonvar) { \
copy_jmp_address((*_PREG)->y_u.clll.l3); \
(*_PREG) = (*_PREG)->y_u.clll.l3; \
copy_jmp_address((*_PREG)->u.clll.l3); \
(*_PREG) = (*_PREG)->u.clll.l3; \
JMPNext(); \
} \
} \
if (nonvar) { \
if (d0 == (*_PREG)->y_u.clll.c) { \
copy_jmp_address((*_PREG)->y_u.clll.l2); \
(*_PREG) = (*_PREG)->y_u.clll.l2; \
if (d0 == (*_PREG)->u.clll.c) { \
copy_jmp_address((*_PREG)->u.clll.l2); \
(*_PREG) = (*_PREG)->u.clll.l2; \
JMPNext(); \
} \
else { \
copy_jmp_address((*_PREG)->y_u.clll.l1); \
(*_PREG) = (*_PREG)->y_u.clll.l1; \
copy_jmp_address((*_PREG)->u.clll.l1); \
(*_PREG) = (*_PREG)->u.clll.l1; \
JMPNext(); \
} \
}
@ -370,7 +370,7 @@
#define IF_NOT_THEN_END \
BLOCK = (CELL)IF_NOT_THEN_END;
#define HASH_SHIFT 6
#define HRASH_SHIFT 6
#define SWITCH_ON_FUNC_INSTINIT \
BLOCKADDRESS = (CELL)(*_PREG); \
@ -379,10 +379,10 @@
d1 = *(*_SREG)++; \
{ \
CELL \
Mask = ((*_PREG)->y_u.sssl.s - 1) << 1, \
hash = d1 >> (HASH_SHIFT - 1) & Mask; \
Mask = ((*_PREG)->u.sssl.s - 1) << 1, \
hash = d1 >> (HRASH_SHIFT - 1) & Mask; \
CELL *base; \
base = (CELL *)(*_PREG)->y_u.sssl.l; \
base = (CELL *)(*_PREG)->u.sssl.l; \
pt0 = base + hash; \
d0 = pt0[0]; \
if (d0 == d1 || d0 == 0) { \
@ -415,10 +415,10 @@
d1 = I_R; \
{ \
CELL \
Mask = ((*_PREG)->y_u.sssl.s - 1) << 1, \
hash = d1 >> (HASH_SHIFT - 1) & Mask; \
Mask = ((*_PREG)->u.sssl.s - 1) << 1, \
hash = d1 >> (HRASH_SHIFT - 1) & Mask; \
CELL *base; \
base = (CELL *)(*_PREG)->y_u.sssl.l; \
base = (CELL *)(*_PREG)->u.sssl.l; \
pt0 = base + hash; \
d0 = pt0[0]; \
if (d0 == d1 || d0 == 0) { \
@ -448,7 +448,7 @@
BLOCKADDRESS = (CELL)(*_PREG); \
register CELL d0; \
{ \
CELL *pt = (CELL *)((*_PREG)->y_u.sssl.l); \
CELL *pt = (CELL *)((*_PREG)->u.sssl.l); \
d0 = *(*_SREG)++; \
if (d0 == pt[0]) { \
copy_jmp_addressa(pt+1); \
@ -468,7 +468,7 @@
BLOCKADDRESS = (CELL)(*_PREG); \
register CELL d0; \
{ \
CELL *pt = (CELL *)((*_PREG)->y_u.sssl.l); \
CELL *pt = (CELL *)((*_PREG)->u.sssl.l); \
d0 = I_R; \
if (d0 == pt[0]) { \
copy_jmp_addressa(pt+1); \
@ -488,7 +488,7 @@
BLOCKADDRESS = (CELL)(*_PREG); \
register CELL d1; \
register CELL *pt0; \
pt0 = (CELL *) (*_PREG)->y_u.sssl.l; \
pt0 = (CELL *) (*_PREG)->u.sssl.l; \
d1 = *(*_SREG)++; \
while (pt0[0] != d1 && pt0[0] != (CELL)NULL ) { \
pt0 += 2; \
@ -504,7 +504,7 @@
BLOCKADDRESS = (CELL)(*_PREG); \
register CELL d1; \
register CELL *pt0; \
pt0 = (CELL *) (*_PREG)->y_u.sssl.l; \
pt0 = (CELL *) (*_PREG)->u.sssl.l; \
d1 = I_R; \
while (pt0[0] != d1 && pt0[0] != 0L ) { \
pt0 += 2; \

View File

@ -2,9 +2,9 @@
print_instruction((*_PREG), ON_NATIVE); \
BLOCKADDRESS = (CELL)(*_PREG); \
{ \
yamop *new = Yap_udi_search((*_PREG)->y_u.lp.p); \
yamop *new = Yap_udi_search((*_PREG)->u.lp.p); \
if (!new) { \
(*_PREG) = (*_PREG)->y_u.lp.l; \
(*_PREG) = (*_PREG)->u.lp.l; \
JMPNext(); \
} \
else { \
@ -36,27 +36,27 @@
(d0) = *(CELL *)(d0); \
} \
if (!nonvar) { \
copy_jmp_address((*_PREG)->y_u.llll.l4); \
(*_PREG) = (*_PREG)->y_u.llll.l4; \
copy_jmp_address((*_PREG)->u.llll.l4); \
(*_PREG) = (*_PREG)->u.llll.l4; \
JMPNext(); \
} \
} \
if (nonvar) { \
if (IsPairTerm(d0)) { \
(*_SREG) = RepPair(d0); \
copy_jmp_address((*_PREG)->y_u.llll.l1); \
(*_PREG) = (*_PREG)->y_u.llll.l1; \
copy_jmp_address((*_PREG)->u.llll.l1); \
(*_PREG) = (*_PREG)->u.llll.l1; \
JMPNext(); \
} \
else if (!IsApplTerm(d0)) { \
copy_jmp_address((*_PREG)->y_u.llll.l2); \
(*_PREG) = (*_PREG)->y_u.llll.l2; \
copy_jmp_address((*_PREG)->u.llll.l2); \
(*_PREG) = (*_PREG)->u.llll.l2; \
I_R = d0; \
JMPNext(); \
} \
else { \
copy_jmp_address((*_PREG)->y_u.llll.l3); \
(*_PREG) = (*_PREG)->y_u.llll.l3; \
copy_jmp_address((*_PREG)->u.llll.l3); \
(*_PREG) = (*_PREG)->u.llll.l3; \
(*_SREG) = RepAppl(d0); \
JMPNext(); \
} \
@ -71,7 +71,7 @@
BLOCKADDRESS = (CELL)(*_PREG); \
register CELL d0; \
register CELL *pt0; \
ALWAYS_LOOKAHEAD((*_PREG)->y_u.ollll.pop); \
ALWAYS_LOOKAHEAD((*_PREG)->u.ollll.pop); \
d0 = CACHED_A1(); \
Int nonvar = 0; \
Int pair = 1; \
@ -80,18 +80,18 @@
do { \
if (!IsVarTerm(d0)) { \
if (d0 == TermNil) { \
(*_PREG) = (*_PREG)->y_u.ollll.l2; \
(*_PREG) = (*_PREG)->u.ollll.l2; \
JMPNext(); \
} \
else { \
if (IsApplTerm(d0)) { \
copy_jmp_address((*_PREG)->y_u.ollll.l3); \
(*_PREG) = (*_PREG)->y_u.ollll.l3; \
copy_jmp_address((*_PREG)->u.ollll.l3); \
(*_PREG) = (*_PREG)->u.ollll.l3; \
(*_SREG) = RepAppl(d0); \
JMPNext(); \
} else { \
copy_jmp_address((*_PREG)->y_u.ollll.l3); \
(*_PREG) = (*_PREG)->y_u.ollll.l3; \
copy_jmp_address((*_PREG)->u.ollll.l3); \
(*_PREG) = (*_PREG)->u.ollll.l3; \
I_R = d0; \
JMPNext(); \
} \
@ -108,14 +108,14 @@
} \
} while (TRUE); \
if (!nonvar && !pair) { \
copy_jmp_address((*_PREG)->y_u.ollll.l4); \
(*_PREG) = (*_PREG)->y_u.ollll.l4; \
copy_jmp_address((*_PREG)->u.ollll.l4); \
(*_PREG) = (*_PREG)->u.ollll.l4; \
JMPNext(); \
} \
} \
if (!nonvar && pair) { \
copy_jmp_address((*_PREG)->y_u.ollll.l1); \
(*_PREG) = (*_PREG)->y_u.ollll.l1; \
copy_jmp_address((*_PREG)->u.ollll.l1); \
(*_PREG) = (*_PREG)->u.ollll.l1; \
(*_SREG) = RepPair(d0); \
ALWAYS_GONext(); \
}
@ -125,7 +125,7 @@
BLOCKADDRESS = (CELL)(*_PREG); \
register CELL d0; \
register CELL *pt0; \
ALWAYS_LOOKAHEAD((*_PREG)->y_u.ollll.pop); \
ALWAYS_LOOKAHEAD((*_PREG)->u.ollll.pop); \
d0 = CACHED_A1(); \
Int nonvar = 0; \
if (IsVarTerm(d0)) { \
@ -140,31 +140,31 @@
(d0) = *(CELL *)(d0); \
} \
if (!nonvar) { \
copy_jmp_address((*_PREG)->y_u.ollll.l4); \
(*_PREG) = (*_PREG)->y_u.ollll.l4; \
copy_jmp_address((*_PREG)->u.ollll.l4); \
(*_PREG) = (*_PREG)->u.ollll.l4; \
JMPNext(); \
} \
} \
if (nonvar) { \
if (__builtin_expect(IsPairTerm(d0),1)) { \
copy_jmp_address((*_PREG)->y_u.ollll.l1); \
(*_PREG) = (*_PREG)->y_u.ollll.l1; \
copy_jmp_address((*_PREG)->u.ollll.l1); \
(*_PREG) = (*_PREG)->u.ollll.l1; \
(*_SREG) = RepPair(d0); \
ALWAYS_GONext(); \
} \
if (d0 == TermNil) { \
(*_PREG) = (*_PREG)->y_u.ollll.l2; \
(*_PREG) = (*_PREG)->u.ollll.l2; \
JMPNext(); \
} \
else { \
if (IsApplTerm(d0)) { \
copy_jmp_address((*_PREG)->y_u.ollll.l3); \
(*_PREG) = (*_PREG)->y_u.ollll.l3; \
copy_jmp_address((*_PREG)->u.ollll.l3); \
(*_PREG) = (*_PREG)->u.ollll.l3; \
(*_SREG) = RepAppl(d0); \
JMPNext(); \
} else { \
copy_jmp_address((*_PREG)->y_u.ollll.l3); \
(*_PREG) = (*_PREG)->y_u.ollll.l3; \
copy_jmp_address((*_PREG)->u.ollll.l3); \
(*_PREG) = (*_PREG)->u.ollll.l3; \
I_R = d0; \
JMPNext(); \
} \
@ -180,7 +180,7 @@
BLOCKADDRESS = (CELL)(*_PREG); \
register CELL d0; \
register CELL *pt0; \
d0 = XREG((*_PREG)->y_u.xllll.x); \
d0 = XREG((*_PREG)->u.xllll.x); \
Int nonvar = 1; \
if (IsVarTerm(d0)) { \
nonvar = 0; \
@ -195,27 +195,27 @@
(d0) = *(CELL *)(d0); \
} \
if (!nonvar) { \
copy_jmp_address((*_PREG)->y_u.xllll.l4); \
(*_PREG) = (*_PREG)->y_u.xllll.l4; \
copy_jmp_address((*_PREG)->u.xllll.l4); \
(*_PREG) = (*_PREG)->u.xllll.l4; \
JMPNext(); \
} \
} \
if (nonvar) { \
if (IsPairTerm(d0)) { \
copy_jmp_address((*_PREG)->y_u.xllll.l1); \
(*_PREG) = (*_PREG)->y_u.xllll.l1; \
copy_jmp_address((*_PREG)->u.xllll.l1); \
(*_PREG) = (*_PREG)->u.xllll.l1; \
(*_SREG) = RepPair(d0); \
JMPNext(); \
} \
else if (!IsApplTerm(d0)) { \
copy_jmp_address((*_PREG)->y_u.xllll.l2); \
(*_PREG) = (*_PREG)->y_u.xllll.l2; \
copy_jmp_address((*_PREG)->u.xllll.l2); \
(*_PREG) = (*_PREG)->u.xllll.l2; \
I_R = d0; \
JMPNext(); \
} \
else { \
copy_jmp_address((*_PREG)->y_u.xllll.l3); \
(*_PREG) = (*_PREG)->y_u.xllll.l3; \
copy_jmp_address((*_PREG)->u.xllll.l3); \
(*_PREG) = (*_PREG)->u.xllll.l3; \
(*_SREG) = RepAppl(d0); \
JMPNext(); \
} \
@ -229,7 +229,7 @@
BLOCKADDRESS = (CELL)(*_PREG); \
register CELL d0; \
register CELL *pt0; \
d0 = (*_SREG)[(*_PREG)->y_u.sllll.s]; \
d0 = (*_SREG)[(*_PREG)->u.sllll.s]; \
Int nonvar = 1; \
if (IsVarTerm(d0)) { \
nonvar = 0; \
@ -244,27 +244,27 @@
(d0) = *(CELL *)(d0); \
} \
if (!nonvar) { \
copy_jmp_address((*_PREG)->y_u.sllll.l4); \
(*_PREG) = (*_PREG)->y_u.sllll.l4; \
copy_jmp_address((*_PREG)->u.sllll.l4); \
(*_PREG) = (*_PREG)->u.sllll.l4; \
JMPNext(); \
} \
} \
if (nonvar) { \
if (IsPairTerm(d0)) { \
copy_jmp_address((*_PREG)->y_u.sllll.l1); \
(*_PREG) = (*_PREG)->y_u.sllll.l1; \
copy_jmp_address((*_PREG)->u.sllll.l1); \
(*_PREG) = (*_PREG)->u.sllll.l1; \
(*_SREG) = RepPair(d0); \
JMPNext(); \
} \
else if (!IsApplTerm(d0)) { \
copy_jmp_address((*_PREG)->y_u.sllll.l2); \
(*_PREG) = (*_PREG)->y_u.sllll.l2; \
copy_jmp_address((*_PREG)->u.sllll.l2); \
(*_PREG) = (*_PREG)->u.sllll.l2; \
I_R = d0; \
JMPNext(); \
} \
else { \
copy_jmp_address((*_PREG)->y_u.sllll.l3); \
(*_PREG) = (*_PREG)->y_u.sllll.l3; \
copy_jmp_address((*_PREG)->u.sllll.l3); \
(*_PREG) = (*_PREG)->u.sllll.l3; \
(*_SREG) = RepAppl(d0); \
JMPNext(); \
} \
@ -293,8 +293,8 @@
(d0) = *(CELL *)(d0); \
} \
if (!nonvar) { \
copy_jmp_address((*_PREG)->y_u.l.l); \
(*_PREG) = (*_PREG)->y_u.l.l; \
copy_jmp_address((*_PREG)->u.l.l); \
(*_PREG) = (*_PREG)->u.l.l; \
JMPNext(); \
} \
} \
@ -311,7 +311,7 @@
BLOCKADDRESS = (CELL)(*_PREG); \
register CELL d0; \
register CELL *pt0; \
d0 = XREG((*_PREG)->y_u.xll.x); \
d0 = XREG((*_PREG)->u.xll.x); \
Int nonvar = 0; \
if (IsVarTerm(d0)) { \
(pt0) = (CELL *)(d0); \
@ -330,8 +330,8 @@
} \
} \
if (nonvar) { \
copy_jmp_address((*_PREG)->y_u.xll.l1); \
(*_PREG) = (*_PREG)->y_u.xll.l1; \
copy_jmp_address((*_PREG)->u.xll.l1); \
(*_PREG) = (*_PREG)->u.xll.l1; \
JMPNext(); \
}
@ -358,20 +358,20 @@
(d0) = *(CELL *)(d0); \
} \
if (!nonvar) { \
copy_jmp_address((*_PREG)->y_u.clll.l3); \
(*_PREG) = (*_PREG)->y_u.clll.l3; \
copy_jmp_address((*_PREG)->u.clll.l3); \
(*_PREG) = (*_PREG)->u.clll.l3; \
JMPNext(); \
} \
} \
if (nonvar) { \
if (d0 == (*_PREG)->y_u.clll.c) { \
copy_jmp_address((*_PREG)->y_u.clll.l2); \
(*_PREG) = (*_PREG)->y_u.clll.l2; \
if (d0 == (*_PREG)->u.clll.c) { \
copy_jmp_address((*_PREG)->u.clll.l2); \
(*_PREG) = (*_PREG)->u.clll.l2; \
JMPNext(); \
} \
else { \
copy_jmp_address((*_PREG)->y_u.clll.l1); \
(*_PREG) = (*_PREG)->y_u.clll.l1; \
copy_jmp_address((*_PREG)->u.clll.l1); \
(*_PREG) = (*_PREG)->u.clll.l1; \
JMPNext(); \
} \
}
@ -379,7 +379,7 @@
#define IF_NOT_THEN_END \
BLOCK = (CELL)IF_NOT_THEN_END;
#define HASH_SHIFT 6
#define HRASH_SHIFT 6
#define SWITCH_ON_FUNC_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
@ -389,10 +389,10 @@
d1 = *(*_SREG)++; \
{ \
CELL \
Mask = ((*_PREG)->y_u.sssl.s - 1) << 1, \
hash = d1 >> (HASH_SHIFT - 1) & Mask; \
Mask = ((*_PREG)->u.sssl.s - 1) << 1, \
hash = d1 >> (HRASH_SHIFT - 1) & Mask; \
CELL *base; \
base = (CELL *)(*_PREG)->y_u.sssl.l; \
base = (CELL *)(*_PREG)->u.sssl.l; \
pt0 = base + hash; \
d0 = pt0[0]; \
if (d0 == d1 || d0 == 0) { \
@ -426,10 +426,10 @@
d1 = I_R; \
{ \
CELL \
Mask = ((*_PREG)->y_u.sssl.s - 1) << 1, \
hash = d1 >> (HASH_SHIFT - 1) & Mask; \
Mask = ((*_PREG)->u.sssl.s - 1) << 1, \
hash = d1 >> (HRASH_SHIFT - 1) & Mask; \
CELL *base; \
base = (CELL *)(*_PREG)->y_u.sssl.l; \
base = (CELL *)(*_PREG)->u.sssl.l; \
pt0 = base + hash; \
d0 = pt0[0]; \
if (d0 == d1 || d0 == 0) { \
@ -460,7 +460,7 @@
BLOCKADDRESS = (CELL)(*_PREG); \
register CELL d0; \
{ \
CELL *pt = (CELL *)((*_PREG)->y_u.sssl.l); \
CELL *pt = (CELL *)((*_PREG)->u.sssl.l); \
d0 = *(*_SREG)++; \
if (d0 == pt[0]) { \
copy_jmp_addressa(pt+1); \
@ -481,7 +481,7 @@
BLOCKADDRESS = (CELL)(*_PREG); \
register CELL d0; \
{ \
CELL *pt = (CELL *)((*_PREG)->y_u.sssl.l); \
CELL *pt = (CELL *)((*_PREG)->u.sssl.l); \
d0 = I_R; \
if (d0 == pt[0]) { \
copy_jmp_addressa(pt+1); \
@ -502,7 +502,7 @@
BLOCKADDRESS = (CELL)(*_PREG); \
register CELL d1; \
register CELL *pt0; \
pt0 = (CELL *) (*_PREG)->y_u.sssl.l; \
pt0 = (CELL *) (*_PREG)->u.sssl.l; \
d1 = *(*_SREG)++; \
while (pt0[0] != d1 && pt0[0] != (CELL)NULL ) { \
pt0 += 2; \
@ -519,7 +519,7 @@
BLOCKADDRESS = (CELL)(*_PREG); \
register CELL d1; \
register CELL *pt0; \
pt0 = (CELL *) (*_PREG)->y_u.sssl.l; \
pt0 = (CELL *) (*_PREG)->u.sssl.l; \
d1 = I_R; \
while (pt0[0] != d1 && pt0[0] != 0L ) { \
pt0 += 2; \

View File

@ -2,8 +2,8 @@
BLOCKADDRESS = (CELL)(*_PREG); \
check_trail(TR); \
CACHE_Y(YREG); \
store_at_least_one_arg((*_PREG)->y_u.Otapl.s); \
store_yaam_regs((*_PREG)->y_u.Otapl.d, 0); \
store_at_least_one_arg((*_PREG)->u.Otapl.s); \
store_yaam_regs((*_PREG)->u.Otapl.d, 0); \
set_cut(S_YREG, B); \
B = B_YREG;
@ -21,8 +21,8 @@
#define RETRY_ME_INSTINIT \
CACHE_Y(B); \
restore_yaam_regs((*_PREG)->y_u.Otapl.d); \
restore_at_least_one_arg((*_PREG)->y_u.Otapl.s);
restore_yaam_regs((*_PREG)->u.Otapl.d); \
restore_at_least_one_arg((*_PREG)->u.Otapl.s);
#ifdef FROZEN_STACKS
#define RETRY_ME_FROZEN \
@ -47,14 +47,14 @@
#define TRUST_ME_YAPOR_IF \
if (SCH_top_shared_cp(B)) { \
SCH_last_alternative((*_PREG), B_YREG); \
restore_at_least_one_arg((*_PREG)->y_u.Otapl.s); \
restore_at_least_one_arg((*_PREG)->u.Otapl.s); \
S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG); \
set_cut(S_YREG, B->cp_b); \
} \
else \
{ \
pop_yaam_regs(); \
pop_at_least_one_arg((*_PREG)->y_u.Otapl.s); \
pop_at_least_one_arg((*_PREG)->u.Otapl.s); \
S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG); \
set_cut(S_YREG, B); \
}
@ -62,13 +62,13 @@
#define TRUST_ME_YAPOR_IF \
if (SCH_top_shared_cp(B)) { \
SCH_last_alternative((*_PREG), B_YREG); \
restore_at_least_one_arg((*_PREG)->y_u.Otapl.s); \
restore_at_least_one_arg((*_PREG)->u.Otapl.s); \
set_cut(S_YREG, B->cp_b); \
} \
else \
{ \
pop_yaam_regs(); \
pop_at_least_one_arg((*_PREG)->y_u.Otapl.s); \
pop_at_least_one_arg((*_PREG)->u.Otapl.s); \
set_cut(S_YREG, B); \
}
#endif /* FROZEN STACKS */
@ -77,7 +77,7 @@
#define TRUST_ME_YAPOR_IF \
{ \
pop_yaam_regs(); \
pop_at_least_one_arg((*_PREG)->y_u.Otapl.s); \
pop_at_least_one_arg((*_PREG)->u.Otapl.s); \
S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG); \
set_cut(S_YREG, B); \
}
@ -85,7 +85,7 @@
#define TRUST_ME_IF \
{ \
pop_yaam_regs(); \
pop_at_least_one_arg((*_PREG)->y_u.Otapl.s); \
pop_at_least_one_arg((*_PREG)->u.Otapl.s); \
set_cut(S_YREG, B); \
}
#endif /* FROZEN STACKS */
@ -98,26 +98,26 @@
GONext();
#define ENTER_PROFILING_INSTINIT \
LOCK((*_PREG)->y_u.p.p->StatisticsForPred.lock); \
(*_PREG)->y_u.p.p->StatisticsForPred.NOfEntries++; \
UNLOCK((*_PREG)->y_u.p.p->StatisticsForPred.lock); \
LOCK((*_PREG)->u.p.p->StatisticsForPred.lock); \
(*_PREG)->u.p.p->StatisticsForPred.NOfEntries++; \
UNLOCK((*_PREG)->u.p.p->StatisticsForPred.lock); \
(*_PREG) = NEXTOP((*_PREG), p); \
GONext();
#define RETRY_PROFILED_INSTINIT \
LOCK((*_PREG)->y_u.p.p->StatisticsForPred.lock); \
(*_PREG)->y_u.p.p->StatisticsForPred.NOfRetries++; \
UNLOCK((*_PREG)->y_u.p.p->StatisticsForPred.lock); \
LOCK((*_PREG)->u.p.p->StatisticsForPred.lock); \
(*_PREG)->u.p.p->StatisticsForPred.NOfRetries++; \
UNLOCK((*_PREG)->u.p.p->StatisticsForPred.lock); \
(*_PREG) = NEXTOP((*_PREG), p); \
GONext();
#define PROFILED_RETRY_ME_INSTINIT \
CACHE_Y(B); \
LOCK((*_PREG)->y_u.Otapl.p->StatisticsForPred.lock); \
(*_PREG)->y_u.Otapl.p->StatisticsForPred.NOfRetries++; \
UNLOCK((*_PREG)->y_u.Otapl.p->StatisticsForPred.lock); \
restore_yaam_regs((*_PREG)->y_u.Otapl.d); \
restore_args((*_PREG)->y_u.Otapl.s);
LOCK((*_PREG)->u.Otapl.p->StatisticsForPred.lock); \
(*_PREG)->u.Otapl.p->StatisticsForPred.NOfRetries++; \
UNLOCK((*_PREG)->u.Otapl.p->StatisticsForPred.lock); \
restore_yaam_regs((*_PREG)->u.Otapl.d); \
restore_args((*_PREG)->u.Otapl.s);
#ifdef FROZEN_STACKS
#define PROFILED_RETRY_ME_FROZEN \
@ -142,14 +142,14 @@
#define PROFILED_TRUST_ME_IF \
if (SCH_top_shared_cp(B)) { \
SCH_last_alternative((*_PREG), B_YREG); \
restore_args((*_PREG)->y_u.Otapl.s); \
restore_args((*_PREG)->u.Otapl.s); \
S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG); \
set_cut(S_YREG, B->cp_b); \
} \
else \
{ \
pop_yaam_regs(); \
pop_args((*_PREG)->y_u.Otapl.s); \
pop_args((*_PREG)->u.Otapl.s); \
S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG); \
set_cut(S_YREG, B); \
}
@ -157,13 +157,13 @@
#define PROFILED_TRUST_ME_IF \
if (SCH_top_shared_cp(B)) { \
SCH_last_alternative((*_PREG), B_YREG); \
restore_args((*_PREG)->y_u.Otapl.s); \
restore_args((*_PREG)->u.Otapl.s); \
set_cut(S_YREG, B->cp_b); \
} \
else \
{ \
pop_yaam_regs(); \
pop_args((*_PREG)->y_u.Otapl.s); \
pop_args((*_PREG)->u.Otapl.s); \
set_cut(S_YREG, B); \
}
#endif /* FROZEN_STACKS */
@ -172,7 +172,7 @@
#define PROFILED_TRUST_ME_IF \
{ \
pop_yaam_regs(); \
pop_args((*_PREG)->y_u.Otapl.s); \
pop_args((*_PREG)->u.Otapl.s); \
S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG); \
set_cut(S_YREG, B); \
}
@ -180,7 +180,7 @@
#define PROFILED_TRUST_ME_IF \
{ \
pop_yaam_regs(); \
pop_args((*_PREG)->y_u.Otapl.s); \
pop_args((*_PREG)->u.Otapl.s); \
set_cut(S_YREG, B); \
}
#endif /* FROZEN_STACKS */
@ -189,9 +189,9 @@
#define PROFILED_TRUST_ME_END \
SET_BB(B_YREG); \
ENDCACHE_Y(); \
LOCK((*_PREG)->y_u.Otapl.p->StatisticsForPred.lock); \
(*_PREG)->y_u.Otapl.p->StatisticsForPred.NOfRetries++; \
UNLOCK((*_PREG)->y_u.Otapl.p->StatisticsForPred.lock); \
LOCK((*_PREG)->u.Otapl.p->StatisticsForPred.lock); \
(*_PREG)->u.Otapl.p->StatisticsForPred.NOfRetries++; \
UNLOCK((*_PREG)->u.Otapl.p->StatisticsForPred.lock); \
(*_PREG) = NEXTOP((*_PREG), Otapl); \
GONext();
@ -200,26 +200,26 @@
{ \
UInt timestamp; \
CACHE_Y(B); \
timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[(*_PREG)->y_u.OtaLl.s]); \
if (!VALID_TIMESTAMP(timestamp, (*_PREG)->y_u.OtaLl.d)) { \
(*_PREG)=(*_PREG)->y_u.OtaLl.n; \
timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[(*_PREG)->u.OtaLl.s]); \
if (!VALID_TIMESTAMP(timestamp, (*_PREG)->u.OtaLl.d)) { \
(*_PREG)=(*_PREG)->u.OtaLl.n; \
JMPNext(); \
} \
else { \
restore_yaam_regs((*_PREG)->y_u.OtaLl.n); \
restore_args((*_PREG)->y_u.OtaLl.s); \
LOCK((*_PREG)->y_u.OtaLl.d->ClPred->StatisticsForPred.lock); \
(*_PREG)->y_u.OtaLl.d->ClPred->StatisticsForPred.NOfRetries++; \
UNLOCK((*_PREG)->y_u.OtaLl.d->ClPred->StatisticsForPred.lock); \
restore_yaam_regs((*_PREG)->u.OtaLl.n); \
restore_args((*_PREG)->u.OtaLl.s); \
LOCK((*_PREG)->u.OtaLl.d->ClPred->StatisticsForPred.lock); \
(*_PREG)->u.OtaLl.d->ClPred->StatisticsForPred.NOfRetries++; \
UNLOCK((*_PREG)->u.OtaLl.d->ClPred->StatisticsForPred.lock); \
}
#ifdef THREADS
#define PROFILED_RETRY_LOGICAL_THREADS \
PP = (*_PREG)->y_u.OtaLl.d->ClPred;
PP = (*_PREG)->u.OtaLl.d->ClPred;
#endif
#define PROFILED_RETRY_LOGICAL_POST_THREADS \
(*_PREG) = (*_PREG)->y_u.OtaLl.d->ClCode;
(*_PREG) = (*_PREG)->u.OtaLl.d->ClCode;
#ifdef FROZEN_STACKS
#define PROFILED_RETRY_LOGICAL_FROZEN \
@ -245,9 +245,9 @@
BLOCKADDRESS = (CELL)(*_PREG); \
CACHE_Y(B); \
{ \
LogUpdIndex *cl = (*_PREG)->y_u.OtILl.block; \
LogUpdIndex *cl = (*_PREG)->u.OtILl.block; \
PredEntry *ap = cl->ClPred; \
LogUpdClause *lcl = (*_PREG)->y_u.OtILl.d; \
LogUpdClause *lcl = (*_PREG)->u.OtILl.d; \
UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]); \
if (!VALID_TIMESTAMP(timestamp, lcl)) { \
(*_PREG) = FAILCODE; \
@ -302,9 +302,9 @@
BLOCKADDRESS = (CELL)(*_PREG); \
CACHE_Y(B); \
{ \
LogUpdIndex *cl = (*_PREG)->y_u.OtILl.block; \
LogUpdIndex *cl = (*_PREG)->u.OtILl.block; \
PredEntry *ap = cl->ClPred; \
LogUpdClause *lcl = (*_PREG)->y_u.OtILl.d; \
LogUpdClause *lcl = (*_PREG)->u.OtILl.d; \
UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]); \
if (!VALID_TIMESTAMP(timestamp, lcl)) { \
(*_PREG) = FAILCODE; \
@ -360,9 +360,9 @@
BLOCKADDRESS = (CELL)(*_PREG); \
CACHE_Y(B); \
{ \
LogUpdIndex *cl = (*_PREG)->y_u.OtILl.block; \
LogUpdIndex *cl = (*_PREG)->u.OtILl.block; \
PredEntry *ap = cl->ClPred; \
LogUpdClause *lcl = (*_PREG)->y_u.OtILl.d; \
LogUpdClause *lcl = (*_PREG)->u.OtILl.d; \
UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]); \
if (!VALID_TIMESTAMP(timestamp, lcl)) { \
(*_PREG) = FAILCODE; \
@ -411,9 +411,9 @@
BLOCKADDRESS = (CELL)(*_PREG); \
CACHE_Y(B); \
{ \
LogUpdIndex *cl = (*_PREG)->y_u.OtILl.block; \
LogUpdIndex *cl = (*_PREG)->u.OtILl.block; \
PredEntry *ap = cl->ClPred; \
LogUpdClause *lcl = (*_PREG)->y_u.OtILl.d; \
LogUpdClause *lcl = (*_PREG)->u.OtILl.d; \
UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]); \
if (!VALID_TIMESTAMP(timestamp, lcl)) { \
(*_PREG) = FAILCODE; \
@ -466,9 +466,9 @@
BLOCKADDRESS = (CELL)(*_PREG); \
CACHE_Y(B); \
{ \
LogUpdIndex *cl = (*_PREG)->y_u.OtILl.block; \
LogUpdIndex *cl = (*_PREG)->u.OtILl.block; \
PredEntry *ap = cl->ClPred; \
LogUpdClause *lcl = (*_PREG)->y_u.OtILl.d; \
LogUpdClause *lcl = (*_PREG)->u.OtILl.d; \
UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]); \
\
if (!VALID_TIMESTAMP(timestamp, lcl)) { \
@ -528,9 +528,9 @@
BLOCKADDRESS = (CELL)(*_PREG); \
CACHE_Y(B); \
{ \
LogUpdIndex *cl = (*_PREG)->y_u.OtILl.block; \
LogUpdIndex *cl = (*_PREG)->u.OtILl.block; \
PredEntry *ap = cl->ClPred; \
LogUpdClause *lcl = (*_PREG)->y_u.OtILl.d; \
LogUpdClause *lcl = (*_PREG)->u.OtILl.d; \
UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]); \
if (!VALID_TIMESTAMP(timestamp, lcl)) { \
(*_PREG) = FAILCODE; \
@ -590,9 +590,9 @@
BLOCKADDRESS = (CELL)(*_PREG); \
CACHE_Y(B); \
{ \
LogUpdIndex *cl = (*_PREG)->y_u.OtILl.block; \
LogUpdIndex *cl = (*_PREG)->u.OtILl.block; \
PredEntry *ap = cl->ClPred; \
LogUpdClause *lcl = (*_PREG)->y_u.OtILl.d; \
LogUpdClause *lcl = (*_PREG)->u.OtILl.d; \
UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]); \
if (!VALID_TIMESTAMP(timestamp, lcl)) { \
(*_PREG) = FAILCODE; \
@ -645,9 +645,9 @@
BLOCKADDRESS = (CELL)(*_PREG); \
CACHE_Y(B); \
{ \
LogUpdIndex *cl = (*_PREG)->y_u.OtILl.block; \
LogUpdIndex *cl = (*_PREG)->u.OtILl.block; \
PredEntry *ap = cl->ClPred; \
LogUpdClause *lcl = (*_PREG)->y_u.OtILl.d; \
LogUpdClause *lcl = (*_PREG)->u.OtILl.d; \
UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]); \
\
if (!VALID_TIMESTAMP(timestamp, lcl)) { \
@ -704,9 +704,9 @@
BLOCKADDRESS = (CELL)(*_PREG); \
CACHE_Y(B); \
{ \
LogUpdIndex *cl = (*_PREG)->y_u.OtILl.block; \
LogUpdIndex *cl = (*_PREG)->u.OtILl.block; \
PredEntry *ap = cl->ClPred; \
LogUpdClause *lcl = (*_PREG)->y_u.OtILl.d; \
LogUpdClause *lcl = (*_PREG)->u.OtILl.d; \
UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]); \
if (!VALID_TIMESTAMP(timestamp, lcl)) { \
(*_PREG) = FAILCODE; \
@ -764,9 +764,9 @@
BLOCKADDRESS = (CELL)(*_PREG); \
CACHE_Y(B); \
{ \
LogUpdIndex *cl = (*_PREG)->y_u.OtILl.block; \
LogUpdIndex *cl = (*_PREG)->u.OtILl.block; \
PredEntry *ap = cl->ClPred; \
LogUpdClause *lcl = (*_PREG)->y_u.OtILl.d; \
LogUpdClause *lcl = (*_PREG)->u.OtILl.d; \
UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]); \
if (!VALID_TIMESTAMP(timestamp, lcl)) { \
(*_PREG) = FAILCODE; \
@ -825,9 +825,9 @@
BLOCKADDRESS = (CELL)(*_PREG); \
CACHE_Y(B); \
{ \
LogUpdIndex *cl = (*_PREG)->y_u.OtILl.block; \
LogUpdIndex *cl = (*_PREG)->u.OtILl.block; \
PredEntry *ap = cl->ClPred; \
LogUpdClause *lcl = (*_PREG)->y_u.OtILl.d; \
LogUpdClause *lcl = (*_PREG)->u.OtILl.d; \
UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]); \
if (!VALID_TIMESTAMP(timestamp, lcl)) { \
(*_PREG) = FAILCODE; \
@ -879,9 +879,9 @@
BLOCKADDRESS = (CELL)(*_PREG); \
CACHE_Y(B); \
{ \
LogUpdIndex *cl = (*_PREG)->y_u.OtILl.block; \
LogUpdIndex *cl = (*_PREG)->u.OtILl.block; \
PredEntry *ap = cl->ClPred; \
LogUpdClause *lcl = (*_PREG)->y_u.OtILl.d; \
LogUpdClause *lcl = (*_PREG)->u.OtILl.d; \
UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]); \
if (!VALID_TIMESTAMP(timestamp, lcl)) { \
(*_PREG) = FAILCODE; \
@ -939,9 +939,9 @@
BLOCKADDRESS = (CELL)(*_PREG); \
check_trail(TR); \
CACHE_Y(YREG); \
store_at_least_one_arg((*_PREG)->y_u.Otapl.s); \
store_at_least_one_arg((*_PREG)->u.Otapl.s); \
store_yaam_regs(NEXTOP((*_PREG), Otapl), 0); \
(*_PREG) = (*_PREG)->y_u.Otapl.d; \
(*_PREG) = (*_PREG)->u.Otapl.d; \
set_cut(S_YREG, B); \
B = B_YREG;
@ -967,7 +967,7 @@
B_YREG->cp_a1 = x1; \
B_YREG->cp_a2 = x2; \
} \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
set_cut(S_YREG, B); \
B = B_YREG;
@ -993,7 +993,7 @@
B_YREG->cp_a2 = ARG2; \
B_YREG->cp_a3 = ARG3; \
} \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
set_cut(S_YREG, B); \
B = B_YREG;
@ -1019,7 +1019,7 @@
B_YREG->cp_a3 = ARG3; \
B_YREG->cp_a4 = ARG4; \
} \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
set_cut(S_YREG, B); \
B = B_YREG;
@ -1038,7 +1038,7 @@
BLOCKADDRESS = (CELL)(*_PREG); \
CACHE_Y(B); \
restore_yaam_regs(NEXTOP((*_PREG), Otapl)); \
restore_at_least_one_arg((*_PREG)->y_u.Otapl.s);
restore_at_least_one_arg((*_PREG)->u.Otapl.s);
#ifdef FROZEN_STACKS
#define RETRY_FROZEN \
@ -1053,14 +1053,14 @@
BLOCK = (CELL)RETRY_END; \
SET_BB(B_YREG); \
ENDCACHE_Y(); \
(*_PREG) = (*_PREG)->y_u.Otapl.d; \
(*_PREG) = (*_PREG)->u.Otapl.d; \
JMPNext();
#define RETRY2_INSTINIT \
BLOCKADDRESS = (CELL)(*_PREG); \
CACHE_Y(B); \
restore_yaam_regs(NEXTOP((*_PREG), l)); \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
ARG1 = B_YREG->cp_a1; \
ARG2 = B_YREG->cp_a2;
@ -1083,7 +1083,7 @@
BLOCKADDRESS = (CELL)(*_PREG); \
CACHE_Y(B); \
restore_yaam_regs(NEXTOP((*_PREG), l)); \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
ARG1 = B_YREG->cp_a1; \
ARG2 = B_YREG->cp_a2; \
ARG3 = B_YREG->cp_a3;
@ -1107,7 +1107,7 @@
BLOCKADDRESS = (CELL)(*_PREG); \
CACHE_Y(B); \
restore_yaam_regs(NEXTOP((*_PREG), l)); \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
ARG1 = B_YREG->cp_a1; \
ARG2 = B_YREG->cp_a2; \
ARG3 = B_YREG->cp_a3; \
@ -1136,7 +1136,7 @@
#define TRUST_IFOK_INIT \
if (SCH_top_shared_cp(B)) { \
SCH_last_alternative((*_PREG), B_YREG); \
restore_at_least_one_arg((*_PREG)->y_u.Otapl.s);
restore_at_least_one_arg((*_PREG)->u.Otapl.s);
#ifdef FROZEN_STACKS
#define TRUST_IFOK_FROZEN \
S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG);
@ -1150,7 +1150,7 @@
#define TRUST_NOIF_INIT \
{ \
pop_yaam_regs(); \
pop_at_least_one_arg((*_PREG)->y_u.Otapl.s);
pop_at_least_one_arg((*_PREG)->u.Otapl.s);
#ifdef FROZEN_STACKS
#define TRUST_NOIF_FROZEN \
@ -1163,22 +1163,22 @@
} \
SET_BB(B_YREG); \
ENDCACHE_Y(); \
(*_PREG) = (*_PREG)->y_u.Otapl.d; \
(*_PREG) = (*_PREG)->u.Otapl.d; \
JMPNext();
#define TRY_IN_INSTINIT \
BLOCKADDRESS = (CELL)(*_PREG); \
B->cp_ap = NEXTOP((*_PREG), l); \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
JMPNext();
#define TRY_IN_END \
BLOCK = (CELL)TRY_IN_END;
#define SPY_OR_TRYMARK_INSTINIT \
PELOCK(5, ((PredEntry *)((*_PREG)->y_u.Otapl.p))); \
(*_PREG) = (yamop *)(&(((PredEntry *)((*_PREG)->y_u.Otapl.p))->OpcodeOfPred)); \
UNLOCKPE(11,(PredEntry *)((*_PREG)->y_u.Otapl.p)); \
PELOCK(5, ((PredEntry *)((*_PREG)->u.Otapl.p))); \
(*_PREG) = (yamop *)(&(((PredEntry *)((*_PREG)->u.Otapl.p))->OpcodeOfPred)); \
UNLOCKPE(11,(PredEntry *)((*_PREG)->u.Otapl.p)); \
return external_labels[12];
#define TRY_AND_MARK_INSTINIT \
@ -1193,14 +1193,14 @@
#define TRY_AND_MARK_YAPOR_THREADS_NOYAPOR_IF \
BLOCK = (CELL)TRY_AND_MARK_YAPOR_THREADS_NOYAPOR_IF; \
if ((*_PREG)->y_u.Otapl.p->PredFlags & LogUpdatePredFlag) { \
PELOCK(6,(*_PREG)->y_u.Otapl.p); \
PP = (*_PREG)->y_u.Otapl.p; \
if ((*_PREG)->u.Otapl.p->PredFlags & LogUpdatePredFlag) { \
PELOCK(6,(*_PREG)->u.Otapl.p); \
PP = (*_PREG)->u.Otapl.p; \
} \
if ((*_PREG)->y_u.Otapl.p->CodeOfPred != (*_PREG)) { \
if ((*_PREG)->u.Otapl.p->CodeOfPred != (*_PREG)) { \
PP = NULL; \
(*_PREG) = (*_PREG)->y_u.Otapl.p->CodeOfPred; \
UNLOCKPE(12,(*_PREG)->y_u.Otapl.p); \
(*_PREG) = (*_PREG)->u.Otapl.p->CodeOfPred; \
UNLOCKPE(12,(*_PREG)->u.Otapl.p); \
save_pc(); \
JMPNext(); \
}
@ -1208,11 +1208,11 @@
#define TRY_AND_MARK_NOYAPOR_NOTHREADS \
CACHE_Y(YREG); \
(*_PREG) = (*_PREG)->y_u.Otapl.d; \
(*_PREG) = (*_PREG)->u.Otapl.d; \
LOCK(DynamicLock((*_PREG))); \
UNLOCKPE(13,((PredEntry *)((*_PREG)->y_u.Otapl.p))); \
UNLOCKPE(13,((PredEntry *)((*_PREG)->u.Otapl.p))); \
BEGD(d1); \
d1 = (*_PREG)->y_u.Otapl.s; \
d1 = (*_PREG)->u.Otapl.s; \
store_args(d1); \
store_yaam_regs((*_PREG), 0); \
ENDD(d1); \
@ -1264,9 +1264,9 @@
}
#define PROFILED_RETRY_AND_MARK_INSTINIT \
LOCK(((PredEntry *)((*_PREG)->y_u.Otapl.p))->StatisticsForPred.lock); \
((PredEntry *)((*_PREG)->y_u.Otapl.p))->StatisticsForPred.NOfRetries++; \
UNLOCK(((PredEntry *)((*_PREG)->y_u.Otapl.p))->StatisticsForPred.lock); \
LOCK(((PredEntry *)((*_PREG)->u.Otapl.p))->StatisticsForPred.lock); \
((PredEntry *)((*_PREG)->u.Otapl.p))->StatisticsForPred.NOfRetries++; \
UNLOCK(((PredEntry *)((*_PREG)->u.Otapl.p))->StatisticsForPred.lock); \
#define RETRY_AND_MARK_INSTINIT
@ -1276,13 +1276,13 @@
#endif
#define RETRY_AND_MARK_POST_YAPOR \
PELOCK(7,(*_PREG)->y_u.Otapl.p); \
PELOCK(7,(*_PREG)->u.Otapl.p); \
CACHE_Y(B); \
(*_PREG) = (*_PREG)->y_u.Otapl.d; \
(*_PREG) = (*_PREG)->u.Otapl.d; \
LOCK(DynamicLock((*_PREG))); \
UNLOCK((*_PREG)->y_u.Otapl.p->PELock); \
UNLOCK((*_PREG)->u.Otapl.p->PELock); \
restore_yaam_regs((*_PREG)); \
restore_args((*_PREG)->y_u.Otapl.s);
restore_args((*_PREG)->u.Otapl.s);
#ifdef FROZEN_STACKS
#define RETRY_AND_MARK_FROZEN \

View File

@ -3,8 +3,8 @@
BLOCKADDRESS = (CELL)(*_PREG); \
check_trail(TR); \
CACHE_Y(YREG); \
store_at_least_one_arg((*_PREG)->y_u.Otapl.s); \
store_yaam_regs((*_PREG)->y_u.Otapl.d, 0); \
store_at_least_one_arg((*_PREG)->u.Otapl.s); \
store_yaam_regs((*_PREG)->u.Otapl.d, 0); \
set_cut(S_YREG, B); \
B = B_YREG;
@ -23,8 +23,8 @@
#define RETRY_ME_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
CACHE_Y(B); \
restore_yaam_regs((*_PREG)->y_u.Otapl.d); \
restore_at_least_one_arg((*_PREG)->y_u.Otapl.s);
restore_yaam_regs((*_PREG)->u.Otapl.d); \
restore_at_least_one_arg((*_PREG)->u.Otapl.s);
#ifdef FROZEN_STACKS
#define RETRY_ME_FROZEN \
@ -50,14 +50,14 @@
#define TRUST_ME_YAPOR_IF \
if (SCH_top_shared_cp(B)) { \
SCH_last_alternative((*_PREG), B_YREG); \
restore_at_least_one_arg((*_PREG)->y_u.Otapl.s); \
restore_at_least_one_arg((*_PREG)->u.Otapl.s); \
S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG); \
set_cut(S_YREG, B->cp_b); \
} \
else \
{ \
pop_yaam_regs(); \
pop_at_least_one_arg((*_PREG)->y_u.Otapl.s); \
pop_at_least_one_arg((*_PREG)->u.Otapl.s); \
S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG); \
set_cut(S_YREG, B); \
}
@ -65,13 +65,13 @@
#define TRUST_ME_YAPOR_IF \
if (SCH_top_shared_cp(B)) { \
SCH_last_alternative((*_PREG), B_YREG); \
restore_at_least_one_arg((*_PREG)->y_u.Otapl.s); \
restore_at_least_one_arg((*_PREG)->u.Otapl.s); \
set_cut(S_YREG, B->cp_b); \
} \
else \
{ \
pop_yaam_regs(); \
pop_at_least_one_arg((*_PREG)->y_u.Otapl.s); \
pop_at_least_one_arg((*_PREG)->u.Otapl.s); \
set_cut(S_YREG, B); \
}
#endif /* FROZEN STACKS */
@ -80,7 +80,7 @@
#define TRUST_ME_YAPOR_IF \
{ \
pop_yaam_regs(); \
pop_at_least_one_arg((*_PREG)->y_u.Otapl.s); \
pop_at_least_one_arg((*_PREG)->u.Otapl.s); \
S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG); \
set_cut(S_YREG, B); \
}
@ -88,7 +88,7 @@
#define TRUST_ME_IF \
{ \
pop_yaam_regs(); \
pop_at_least_one_arg((*_PREG)->y_u.Otapl.s); \
pop_at_least_one_arg((*_PREG)->u.Otapl.s); \
set_cut(S_YREG, B); \
}
#endif /* FROZEN STACKS */
@ -102,28 +102,28 @@
#define ENTER_PROFILING_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
LOCK((*_PREG)->y_u.p.p->StatisticsForPred.lock); \
(*_PREG)->y_u.p.p->StatisticsForPred.NOfEntries++; \
UNLOCK((*_PREG)->y_u.p.p->StatisticsForPred.lock); \
LOCK((*_PREG)->u.p.p->StatisticsForPred.lock); \
(*_PREG)->u.p.p->StatisticsForPred.NOfEntries++; \
UNLOCK((*_PREG)->u.p.p->StatisticsForPred.lock); \
(*_PREG) = NEXTOP((*_PREG), p); \
GONext();
#define RETRY_PROFILED_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
LOCK((*_PREG)->y_u.p.p->StatisticsForPred.lock); \
(*_PREG)->y_u.p.p->StatisticsForPred.NOfRetries++; \
UNLOCK((*_PREG)->y_u.p.p->StatisticsForPred.lock); \
LOCK((*_PREG)->u.p.p->StatisticsForPred.lock); \
(*_PREG)->u.p.p->StatisticsForPred.NOfRetries++; \
UNLOCK((*_PREG)->u.p.p->StatisticsForPred.lock); \
(*_PREG) = NEXTOP((*_PREG), p); \
GONext();
#define PROFILED_RETRY_ME_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
CACHE_Y(B); \
LOCK((*_PREG)->y_u.Otapl.p->StatisticsForPred.lock); \
(*_PREG)->y_u.Otapl.p->StatisticsForPred.NOfRetries++; \
UNLOCK((*_PREG)->y_u.Otapl.p->StatisticsForPred.lock); \
restore_yaam_regs((*_PREG)->y_u.Otapl.d); \
restore_args((*_PREG)->y_u.Otapl.s);
LOCK((*_PREG)->u.Otapl.p->StatisticsForPred.lock); \
(*_PREG)->u.Otapl.p->StatisticsForPred.NOfRetries++; \
UNLOCK((*_PREG)->u.Otapl.p->StatisticsForPred.lock); \
restore_yaam_regs((*_PREG)->u.Otapl.d); \
restore_args((*_PREG)->u.Otapl.s);
#ifdef FROZEN_STACKS
#define PROFILED_RETRY_ME_FROZEN \
@ -149,14 +149,14 @@
#define PROFILED_TRUST_ME_IF \
if (SCH_top_shared_cp(B)) { \
SCH_last_alternative((*_PREG), B_YREG); \
restore_args((*_PREG)->y_u.Otapl.s); \
restore_args((*_PREG)->u.Otapl.s); \
S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG); \
set_cut(S_YREG, B->cp_b); \
} \
else \
{ \
pop_yaam_regs(); \
pop_args((*_PREG)->y_u.Otapl.s); \
pop_args((*_PREG)->u.Otapl.s); \
S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG); \
set_cut(S_YREG, B); \
}
@ -164,13 +164,13 @@
#define PROFILED_TRUST_ME_IF \
if (SCH_top_shared_cp(B)) { \
SCH_last_alternative((*_PREG), B_YREG); \
restore_args((*_PREG)->y_u.Otapl.s); \
restore_args((*_PREG)->u.Otapl.s); \
set_cut(S_YREG, B->cp_b); \
} \
else \
{ \
pop_yaam_regs(); \
pop_args((*_PREG)->y_u.Otapl.s); \
pop_args((*_PREG)->u.Otapl.s); \
set_cut(S_YREG, B); \
}
#endif /* FROZEN_STACKS */
@ -179,7 +179,7 @@
#define PROFILED_TRUST_ME_IF \
{ \
pop_yaam_regs(); \
pop_args((*_PREG)->y_u.Otapl.s); \
pop_args((*_PREG)->u.Otapl.s); \
S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG); \
set_cut(S_YREG, B); \
}
@ -187,7 +187,7 @@
#define PROFILED_TRUST_ME_IF \
{ \
pop_yaam_regs(); \
pop_args((*_PREG)->y_u.Otapl.s); \
pop_args((*_PREG)->u.Otapl.s); \
set_cut(S_YREG, B); \
}
#endif /* FROZEN_STACKS */
@ -196,9 +196,9 @@
#define PROFILED_TRUST_ME_END \
SET_BB(B_YREG); \
ENDCACHE_Y(); \
LOCK((*_PREG)->y_u.Otapl.p->StatisticsForPred.lock); \
(*_PREG)->y_u.Otapl.p->StatisticsForPred.NOfRetries++; \
UNLOCK((*_PREG)->y_u.Otapl.p->StatisticsForPred.lock); \
LOCK((*_PREG)->u.Otapl.p->StatisticsForPred.lock); \
(*_PREG)->u.Otapl.p->StatisticsForPred.NOfRetries++; \
UNLOCK((*_PREG)->u.Otapl.p->StatisticsForPred.lock); \
(*_PREG) = NEXTOP((*_PREG), Otapl); \
GONext();
@ -208,26 +208,26 @@
{ \
UInt timestamp; \
CACHE_Y(B); \
timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[(*_PREG)->y_u.OtaLl.s]); \
if (!VALID_TIMESTAMP(timestamp, (*_PREG)->y_u.OtaLl.d)) { \
(*_PREG)=(*_PREG)->y_u.OtaLl.n; \
timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[(*_PREG)->u.OtaLl.s]); \
if (!VALID_TIMESTAMP(timestamp, (*_PREG)->u.OtaLl.d)) { \
(*_PREG)=(*_PREG)->u.OtaLl.n; \
JMPNext(); \
} \
else { \
restore_yaam_regs((*_PREG)->y_u.OtaLl.n); \
restore_args((*_PREG)->y_u.OtaLl.s); \
LOCK((*_PREG)->y_u.OtaLl.d->ClPred->StatisticsForPred.lock); \
(*_PREG)->y_u.OtaLl.d->ClPred->StatisticsForPred.NOfRetries++; \
UNLOCK((*_PREG)->y_u.OtaLl.d->ClPred->StatisticsForPred.lock); \
restore_yaam_regs((*_PREG)->u.OtaLl.n); \
restore_args((*_PREG)->u.OtaLl.s); \
LOCK((*_PREG)->u.OtaLl.d->ClPred->StatisticsForPred.lock); \
(*_PREG)->u.OtaLl.d->ClPred->StatisticsForPred.NOfRetries++; \
UNLOCK((*_PREG)->u.OtaLl.d->ClPred->StatisticsForPred.lock); \
}
#ifdef THREADS
#define PROFILED_RETRY_LOGICAL_THREADS \
PP = (*_PREG)->y_u.OtaLl.d->ClPred;
PP = (*_PREG)->u.OtaLl.d->ClPred;
#endif
#define PROFILED_RETRY_LOGICAL_POST_THREADS \
(*_PREG) = (*_PREG)->y_u.OtaLl.d->ClCode;
(*_PREG) = (*_PREG)->u.OtaLl.d->ClCode;
#ifdef FROZEN_STACKS
#define PROFILED_RETRY_LOGICAL_FROZEN \
@ -254,9 +254,9 @@
BLOCKADDRESS = (CELL)(*_PREG); \
CACHE_Y(B); \
{ \
LogUpdIndex *cl = (*_PREG)->y_u.OtILl.block; \
LogUpdIndex *cl = (*_PREG)->u.OtILl.block; \
PredEntry *ap = cl->ClPred; \
LogUpdClause *lcl = (*_PREG)->y_u.OtILl.d; \
LogUpdClause *lcl = (*_PREG)->u.OtILl.d; \
UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]); \
if (!VALID_TIMESTAMP(timestamp, lcl)) { \
(*_PREG) = FAILCODE; \
@ -312,9 +312,9 @@
BLOCKADDRESS = (CELL)(*_PREG); \
CACHE_Y(B); \
{ \
LogUpdIndex *cl = (*_PREG)->y_u.OtILl.block; \
LogUpdIndex *cl = (*_PREG)->u.OtILl.block; \
PredEntry *ap = cl->ClPred; \
LogUpdClause *lcl = (*_PREG)->y_u.OtILl.d; \
LogUpdClause *lcl = (*_PREG)->u.OtILl.d; \
UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]); \
if (!VALID_TIMESTAMP(timestamp, lcl)) { \
(*_PREG) = FAILCODE; \
@ -371,9 +371,9 @@
BLOCKADDRESS = (CELL)(*_PREG); \
CACHE_Y(B); \
{ \
LogUpdIndex *cl = (*_PREG)->y_u.OtILl.block; \
LogUpdIndex *cl = (*_PREG)->u.OtILl.block; \
PredEntry *ap = cl->ClPred; \
LogUpdClause *lcl = (*_PREG)->y_u.OtILl.d; \
LogUpdClause *lcl = (*_PREG)->u.OtILl.d; \
UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]); \
if (!VALID_TIMESTAMP(timestamp, lcl)) { \
(*_PREG) = FAILCODE; \
@ -423,9 +423,9 @@
BLOCKADDRESS = (CELL)(*_PREG); \
CACHE_Y(B); \
{ \
LogUpdIndex *cl = (*_PREG)->y_u.OtILl.block; \
LogUpdIndex *cl = (*_PREG)->u.OtILl.block; \
PredEntry *ap = cl->ClPred; \
LogUpdClause *lcl = (*_PREG)->y_u.OtILl.d; \
LogUpdClause *lcl = (*_PREG)->u.OtILl.d; \
UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]); \
if (!VALID_TIMESTAMP(timestamp, lcl)) { \
(*_PREG) = FAILCODE; \
@ -479,9 +479,9 @@
BLOCKADDRESS = (CELL)(*_PREG); \
CACHE_Y(B); \
{ \
LogUpdIndex *cl = (*_PREG)->y_u.OtILl.block; \
LogUpdIndex *cl = (*_PREG)->u.OtILl.block; \
PredEntry *ap = cl->ClPred; \
LogUpdClause *lcl = (*_PREG)->y_u.OtILl.d; \
LogUpdClause *lcl = (*_PREG)->u.OtILl.d; \
UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]); \
\
if (!VALID_TIMESTAMP(timestamp, lcl)) { \
@ -542,9 +542,9 @@
BLOCKADDRESS = (CELL)(*_PREG); \
CACHE_Y(B); \
{ \
LogUpdIndex *cl = (*_PREG)->y_u.OtILl.block; \
LogUpdIndex *cl = (*_PREG)->u.OtILl.block; \
PredEntry *ap = cl->ClPred; \
LogUpdClause *lcl = (*_PREG)->y_u.OtILl.d; \
LogUpdClause *lcl = (*_PREG)->u.OtILl.d; \
UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]); \
if (!VALID_TIMESTAMP(timestamp, lcl)) { \
(*_PREG) = FAILCODE; \
@ -605,9 +605,9 @@
BLOCKADDRESS = (CELL)(*_PREG); \
CACHE_Y(B); \
{ \
LogUpdIndex *cl = (*_PREG)->y_u.OtILl.block; \
LogUpdIndex *cl = (*_PREG)->u.OtILl.block; \
PredEntry *ap = cl->ClPred; \
LogUpdClause *lcl = (*_PREG)->y_u.OtILl.d; \
LogUpdClause *lcl = (*_PREG)->u.OtILl.d; \
UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]); \
if (!VALID_TIMESTAMP(timestamp, lcl)) { \
(*_PREG) = FAILCODE; \
@ -661,9 +661,9 @@
BLOCKADDRESS = (CELL)(*_PREG); \
CACHE_Y(B); \
{ \
LogUpdIndex *cl = (*_PREG)->y_u.OtILl.block; \
LogUpdIndex *cl = (*_PREG)->u.OtILl.block; \
PredEntry *ap = cl->ClPred; \
LogUpdClause *lcl = (*_PREG)->y_u.OtILl.d; \
LogUpdClause *lcl = (*_PREG)->u.OtILl.d; \
UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]); \
\
if (!VALID_TIMESTAMP(timestamp, lcl)) { \
@ -721,9 +721,9 @@
BLOCKADDRESS = (CELL)(*_PREG); \
CACHE_Y(B); \
{ \
LogUpdIndex *cl = (*_PREG)->y_u.OtILl.block; \
LogUpdIndex *cl = (*_PREG)->u.OtILl.block; \
PredEntry *ap = cl->ClPred; \
LogUpdClause *lcl = (*_PREG)->y_u.OtILl.d; \
LogUpdClause *lcl = (*_PREG)->u.OtILl.d; \
UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]); \
if (!VALID_TIMESTAMP(timestamp, lcl)) { \
(*_PREG) = FAILCODE; \
@ -782,9 +782,9 @@
BLOCKADDRESS = (CELL)(*_PREG); \
CACHE_Y(B); \
{ \
LogUpdIndex *cl = (*_PREG)->y_u.OtILl.block; \
LogUpdIndex *cl = (*_PREG)->u.OtILl.block; \
PredEntry *ap = cl->ClPred; \
LogUpdClause *lcl = (*_PREG)->y_u.OtILl.d; \
LogUpdClause *lcl = (*_PREG)->u.OtILl.d; \
UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]); \
if (!VALID_TIMESTAMP(timestamp, lcl)) { \
(*_PREG) = FAILCODE; \
@ -844,9 +844,9 @@
BLOCKADDRESS = (CELL)(*_PREG); \
CACHE_Y(B); \
{ \
LogUpdIndex *cl = (*_PREG)->y_u.OtILl.block; \
LogUpdIndex *cl = (*_PREG)->u.OtILl.block; \
PredEntry *ap = cl->ClPred; \
LogUpdClause *lcl = (*_PREG)->y_u.OtILl.d; \
LogUpdClause *lcl = (*_PREG)->u.OtILl.d; \
UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]); \
if (!VALID_TIMESTAMP(timestamp, lcl)) { \
(*_PREG) = FAILCODE; \
@ -899,9 +899,9 @@
BLOCKADDRESS = (CELL)(*_PREG); \
CACHE_Y(B); \
{ \
LogUpdIndex *cl = (*_PREG)->y_u.OtILl.block; \
LogUpdIndex *cl = (*_PREG)->u.OtILl.block; \
PredEntry *ap = cl->ClPred; \
LogUpdClause *lcl = (*_PREG)->y_u.OtILl.d; \
LogUpdClause *lcl = (*_PREG)->u.OtILl.d; \
UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]); \
if (!VALID_TIMESTAMP(timestamp, lcl)) { \
(*_PREG) = FAILCODE; \
@ -960,9 +960,9 @@
BLOCKADDRESS = (CELL)(*_PREG); \
check_trail(TR); \
CACHE_Y(YREG); \
store_at_least_one_arg((*_PREG)->y_u.Otapl.s); \
store_at_least_one_arg((*_PREG)->u.Otapl.s); \
store_yaam_regs(NEXTOP((*_PREG), Otapl), 0); \
(*_PREG) = (*_PREG)->y_u.Otapl.d; \
(*_PREG) = (*_PREG)->u.Otapl.d; \
set_cut(S_YREG, B); \
B = B_YREG;
@ -989,7 +989,7 @@
B_YREG->cp_a1 = x1; \
B_YREG->cp_a2 = x2; \
} \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
set_cut(S_YREG, B); \
B = B_YREG;
@ -1016,7 +1016,7 @@
B_YREG->cp_a2 = ARG2; \
B_YREG->cp_a3 = ARG3; \
} \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
set_cut(S_YREG, B); \
B = B_YREG;
@ -1043,7 +1043,7 @@
B_YREG->cp_a3 = ARG3; \
B_YREG->cp_a4 = ARG4; \
} \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
set_cut(S_YREG, B); \
B = B_YREG;
@ -1063,7 +1063,7 @@
BLOCKADDRESS = (CELL)(*_PREG); \
CACHE_Y(B); \
restore_yaam_regs(NEXTOP((*_PREG), Otapl)); \
restore_at_least_one_arg((*_PREG)->y_u.Otapl.s);
restore_at_least_one_arg((*_PREG)->u.Otapl.s);
#ifdef FROZEN_STACKS
#define RETRY_FROZEN \
@ -1078,7 +1078,7 @@
BLOCK = (CELL)RETRY_END; \
SET_BB(B_YREG); \
ENDCACHE_Y(); \
(*_PREG) = (*_PREG)->y_u.Otapl.d; \
(*_PREG) = (*_PREG)->u.Otapl.d; \
JMPNext();
#define RETRY2_INSTINIT \
@ -1086,7 +1086,7 @@
BLOCKADDRESS = (CELL)(*_PREG); \
CACHE_Y(B); \
restore_yaam_regs(NEXTOP((*_PREG), l)); \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
ARG1 = B_YREG->cp_a1; \
ARG2 = B_YREG->cp_a2;
@ -1110,7 +1110,7 @@
BLOCKADDRESS = (CELL)(*_PREG); \
CACHE_Y(B); \
restore_yaam_regs(NEXTOP((*_PREG), l)); \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
ARG1 = B_YREG->cp_a1; \
ARG2 = B_YREG->cp_a2; \
ARG3 = B_YREG->cp_a3;
@ -1135,7 +1135,7 @@
BLOCKADDRESS = (CELL)(*_PREG); \
CACHE_Y(B); \
restore_yaam_regs(NEXTOP((*_PREG), l)); \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
ARG1 = B_YREG->cp_a1; \
ARG2 = B_YREG->cp_a2; \
ARG3 = B_YREG->cp_a3; \
@ -1165,7 +1165,7 @@
#define TRUST_IFOK_INIT \
if (SCH_top_shared_cp(B)) { \
SCH_last_alternative((*_PREG), B_YREG); \
restore_at_least_one_arg((*_PREG)->y_u.Otapl.s);
restore_at_least_one_arg((*_PREG)->u.Otapl.s);
#ifdef FROZEN_STACKS
#define TRUST_IFOK_FROZEN \
S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG);
@ -1179,7 +1179,7 @@
#define TRUST_NOIF_INIT \
{ \
pop_yaam_regs(); \
pop_at_least_one_arg((*_PREG)->y_u.Otapl.s);
pop_at_least_one_arg((*_PREG)->u.Otapl.s);
#ifdef FROZEN_STACKS
#define TRUST_NOIF_FROZEN \
@ -1192,14 +1192,14 @@
} \
SET_BB(B_YREG); \
ENDCACHE_Y(); \
(*_PREG) = (*_PREG)->y_u.Otapl.d; \
(*_PREG) = (*_PREG)->u.Otapl.d; \
JMPNext();
#define TRY_IN_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
BLOCKADDRESS = (CELL)(*_PREG); \
B->cp_ap = NEXTOP((*_PREG), l); \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
JMPNext();
#define TRY_IN_END \
@ -1207,9 +1207,9 @@
#define SPY_OR_TRYMARK_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
PELOCK(5, ((PredEntry *)((*_PREG)->y_u.Otapl.p))); \
(*_PREG) = (yamop *)(&(((PredEntry *)((*_PREG)->y_u.Otapl.p))->OpcodeOfPred)); \
UNLOCKPE(11,(PredEntry *)((*_PREG)->y_u.Otapl.p)); \
PELOCK(5, ((PredEntry *)((*_PREG)->u.Otapl.p))); \
(*_PREG) = (yamop *)(&(((PredEntry *)((*_PREG)->u.Otapl.p))->OpcodeOfPred)); \
UNLOCKPE(11,(PredEntry *)((*_PREG)->u.Otapl.p)); \
return external_labels[12];
#define TRY_AND_MARK_INSTINIT \
@ -1225,14 +1225,14 @@
#define TRY_AND_MARK_YAPOR_THREADS_NOYAPOR_IF \
BLOCK = (CELL)TRY_AND_MARK_YAPOR_THREADS_NOYAPOR_IF; \
if ((*_PREG)->y_u.Otapl.p->PredFlags & LogUpdatePredFlag) { \
PELOCK(6,(*_PREG)->y_u.Otapl.p); \
PP = (*_PREG)->y_u.Otapl.p; \
if ((*_PREG)->u.Otapl.p->PredFlags & LogUpdatePredFlag) { \
PELOCK(6,(*_PREG)->u.Otapl.p); \
PP = (*_PREG)->u.Otapl.p; \
} \
if ((*_PREG)->y_u.Otapl.p->CodeOfPred != (*_PREG)) { \
if ((*_PREG)->u.Otapl.p->CodeOfPred != (*_PREG)) { \
PP = NULL; \
(*_PREG) = (*_PREG)->y_u.Otapl.p->CodeOfPred; \
UNLOCKPE(12,(*_PREG)->y_u.Otapl.p); \
(*_PREG) = (*_PREG)->u.Otapl.p->CodeOfPred; \
UNLOCKPE(12,(*_PREG)->u.Otapl.p); \
save_pc(); \
JMPNext(); \
}
@ -1240,11 +1240,11 @@
#define TRY_AND_MARK_NOYAPOR_NOTHREADS \
CACHE_Y(YREG); \
(*_PREG) = (*_PREG)->y_u.Otapl.d; \
(*_PREG) = (*_PREG)->u.Otapl.d; \
LOCK(DynamicLock((*_PREG))); \
UNLOCKPE(13,((PredEntry *)((*_PREG)->y_u.Otapl.p))); \
UNLOCKPE(13,((PredEntry *)((*_PREG)->u.Otapl.p))); \
BEGD(d1); \
d1 = (*_PREG)->y_u.Otapl.s; \
d1 = (*_PREG)->u.Otapl.s; \
store_args(d1); \
store_yaam_regs((*_PREG), 0); \
ENDD(d1); \
@ -1298,9 +1298,9 @@
#define PROFILED_RETRY_AND_MARK_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
LOCK(((PredEntry *)((*_PREG)->y_u.Otapl.p))->StatisticsForPred.lock); \
((PredEntry *)((*_PREG)->y_u.Otapl.p))->StatisticsForPred.NOfRetries++; \
UNLOCK(((PredEntry *)((*_PREG)->y_u.Otapl.p))->StatisticsForPred.lock); \
LOCK(((PredEntry *)((*_PREG)->u.Otapl.p))->StatisticsForPred.lock); \
((PredEntry *)((*_PREG)->u.Otapl.p))->StatisticsForPred.NOfRetries++; \
UNLOCK(((PredEntry *)((*_PREG)->u.Otapl.p))->StatisticsForPred.lock); \
#define RETRY_AND_MARK_INSTINIT
@ -1310,13 +1310,13 @@
#endif
#define RETRY_AND_MARK_POST_YAPOR \
PELOCK(7,(*_PREG)->y_u.Otapl.p); \
PELOCK(7,(*_PREG)->u.Otapl.p); \
CACHE_Y(B); \
(*_PREG) = (*_PREG)->y_u.Otapl.d; \
(*_PREG) = (*_PREG)->u.Otapl.d; \
LOCK(DynamicLock((*_PREG))); \
UNLOCK((*_PREG)->y_u.Otapl.p->PELock); \
UNLOCK((*_PREG)->u.Otapl.p->PELock); \
restore_yaam_regs((*_PREG)); \
restore_args((*_PREG)->y_u.Otapl.s);
restore_args((*_PREG)->u.Otapl.s);
#ifdef FROZEN_STACKS
#define RETRY_AND_MARK_FROZEN \

45
JIT/HPP/jit_predicates.hh Normal file
View File

@ -0,0 +1,45 @@
#include "Yap.h"
#include "clause.h"
#include "eval.h"
#if HRAVE_ERRNO_H
#include <errno.h>
#else
extern int errno;
#endif
#include <string.h>
#include <ctype.h>
#define UPPER_ENTRY(S) \
tmp = (char*)malloc((strlen(S)+1)*sizeof(char)); \
while (S[i]) { \
if (S[i] != '-' && S[i] != '_' && S[i] != ' ') { \
if ((S[i] >= '0' && S[i] <= '9') || (S[i] == '.')) \
tmp[j] = S[i]; \
else \
tmp[j] = toupper(S[i]); \
j++; \
} \
i++; \
} \
tmp[j] = 0; \
strcpy(S, tmp); \
free(tmp);
#if YAP_JIT
void Yap_InitJitAnalysisPreds( void );
void Yap_InitJitCodegenPreds( void );
void Yap_InitJitConfigPreds( void );
void Yap_InitJitTransformPreds( void );
#if YAP_STAT_PREDS
void Yap_InitJitStatisticPreds( void );
#endif
#endif /* YAP_JIT */
#if YAP_DBG_PREDS
void Yap_InitJitDebugPreds( void );
#endif
Environment ExpEnv;
#if YAP_JIT
extern NativeContext *NativeArea;
extern IntermediatecodeContext *IntermediatecodeArea;
#endif

File diff suppressed because it is too large Load Diff

View File

@ -14,4 +14,4 @@
#include <yaam_unify.h>
#include <yaam_write.h>
extern void print_block(YAP_BBs block, enumPlace place);
extern void print_block(YAP_BBs block, enumPlace place);

2390
JIT/HPP/nextof.hh Normal file

File diff suppressed because it is too large Load Diff

View File

@ -21,7 +21,7 @@
#define P_DIF_DIF_NVAR1_NVAR2 \
BLOCK = (CELL)P_DIF_DIF_NVAR1_NVAR2; \
if (d0 == d1) { \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
GONext(); \
} \
else { \
@ -36,7 +36,7 @@
pt0 = TR; \
BEGCHO(pt1); \
pt1 = B; \
HBREG = HR; \
HRBREG = HR; \
B = (choiceptr) HR; \
B->cp_h = HR; \
SET_BB(B); \
@ -48,8 +48,8 @@
}\
B = pt1; \
SET_BB(PROTECT_FROZEN_B(pt1)); \
HR = HBREG; \
HBREG = B->cp_h; \
HR = HRBREG; \
HRBREG = B->cp_h; \
while (TR != pt0) { \
d1 = TrailTerm(--TR); \
if (IsVarTerm(d1)) { \
@ -64,7 +64,7 @@
} \
} \
if (opresult) { \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
GONext(); \
} \
else { \
@ -78,7 +78,7 @@
#define P_DIF_DIF_NVAR1_NVAR2 \
BLOCK = (CELL)P_DIF_DIF_NVAR1_NVAR2; \
if (d0 == d1) { \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
GONext(); \
} \
else { \
@ -93,7 +93,7 @@
pt0 = TR; \
BEGCHO(pt1); \
pt1 = B; \
HBREG = HR; \
HRBREG = HR; \
B = (choiceptr) HR; \
B->cp_h = HR; \
SET_BB(B); \
@ -105,8 +105,8 @@
}\
B = pt1; \
SET_BB(PROTECT_FROZEN_B(pt1)); \
HR = HBREG; \
HBREG = B->cp_h; \
HR = HRBREG; \
HRBREG = B->cp_h; \
while (TR != pt0) { \
d1 = TrailTerm(--TR); \
if (IsVarTerm(d1)) { \
@ -122,7 +122,7 @@
} \
} \
if (opresult) { \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
GONext(); \
} \
else { \
@ -137,7 +137,7 @@
#define P_DIF_DIF_NVAR1_NVAR2 \
BLOCK = (CELL)P_DIF_DIF_NVAR1_NVAR2; \
if (d0 == d1) { \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
GONext(); \
} \
else { \
@ -152,7 +152,7 @@
pt0 = TR; \
BEGCHO(pt1); \
pt1 = B; \
HBREG = HR; \
HRBREG = HR; \
B = (choiceptr) HR; \
B->cp_h = HR; \
SET_BB(B); \
@ -164,8 +164,8 @@
}\
B = pt1; \
SET_BB(PROTECT_FROZEN_B(pt1)); \
HR = HBREG; \
HBREG = B->cp_h; \
HR = HRBREG; \
HRBREG = B->cp_h; \
while (TR != pt0) { \
d1 = TrailTerm(--TR); \
if (IsVarTerm(d1)) { \
@ -177,7 +177,7 @@
} \
} \
if (opresult) { \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
GONext(); \
} \
else { \
@ -194,7 +194,7 @@
#define P_DIF_DIF_NVAR1_NVAR2 \
BLOCK = (CELL)P_DIF_DIF_NVAR1_NVAR2; \
if (d0 == d1) { \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
GONext(); \
} \
else { \
@ -209,7 +209,7 @@
pt0 = TR; \
BEGCHO(pt1); \
pt1 = B; \
HBREG = HR; \
HRBREG = HR; \
B = (choiceptr) HR; \
B->cp_h = HR; \
SET_BB(B); \
@ -221,8 +221,8 @@
} \
B = pt1; \
SET_BB(PROTECT_FROZEN_B(pt1)); \
HR = HBREG; \
HBREG = B->cp_h; \
HR = HRBREG; \
HRBREG = B->cp_h; \
while (TR != pt0) { \
d1 = TrailTerm(--TR); \
if (IsVarTerm(d1)) { \
@ -233,7 +233,7 @@
} \
} \
if (opresult) { \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
GONext(); \
} \
else { \
@ -247,7 +247,7 @@
#define P_DIF_DIF_NVAR1_NVAR2 \
BLOCK = (CELL)P_DIF_DIF_NVAR1_NVAR2; \
if (d0 == d1) { \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
GONext(); \
} \
else { \
@ -262,7 +262,7 @@
pt0 = TR; \
BEGCHO(pt1); \
pt1 = B; \
HBREG = HR; \
HRBREG = HR; \
B = (choiceptr) HR; \
B->cp_h = HR; \
SET_BB(B); \
@ -274,8 +274,8 @@
}\
B = pt1; \
SET_BB(PROTECT_FROZEN_B(pt1)); \
HR = HBREG; \
HBREG = B->cp_h; \
HR = HRBREG; \
HRBREG = B->cp_h; \
while (TR != pt0) { \
d1 = TrailTerm(--TR); \
if (IsVarTerm(d1)) { \
@ -287,7 +287,7 @@
} \
} \
if (opresult) { \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
GONext(); \
} \
else { \
@ -302,7 +302,7 @@
#define P_DIF_DIF_NVAR1_NVAR2 \
BLOCK = (CELL)P_DIF_DIF_NVAR1_NVAR2; \
if (d0 == d1) { \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
GONext(); \
} \
else { \
@ -317,7 +317,7 @@
pt0 = TR; \
BEGCHO(pt1); \
pt1 = B; \
HBREG = HR; \
HRBREG = HR; \
B = (choiceptr) HR; \
B->cp_h = HR; \
SET_BB(B); \
@ -329,8 +329,8 @@
}\
B = pt1; \
SET_BB(PROTECT_FROZEN_B(pt1)); \
HR = HBREG; \
HBREG = B->cp_h; \
HR = HRBREG; \
HRBREG = B->cp_h; \
while (TR != pt0) { \
d1 = TrailTerm(--TR); \
if (IsVarTerm(d1)) { \
@ -338,7 +338,7 @@
} \
} \
if (opresult) { \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
GONext(); \
} \
else { \
@ -357,7 +357,7 @@
#define P_DIF_DIF_NVAR1_NVAR2 \
BLOCK = (CELL)P_DIF_DIF_NVAR1_NVAR2; \
if (d0 == d1) { \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
GONext(); \
} \
else { \
@ -371,7 +371,7 @@
pt0 = TR; \
BEGCHO(pt1); \
pt1 = B; \
HBREG = HR; \
HRBREG = HR; \
B = (choiceptr) HR; \
B->cp_h = HR; \
SET_BB(B); \
@ -379,7 +379,7 @@
opresult = Yap_IUnify(d0, d1); \
B = pt1; \
SET_BB(PROTECT_FROZEN_B(pt1)); \
HBREG = B->cp_h; \
HRBREG = B->cp_h; \
while (TR != pt0) { \
d1 = TrailTerm(--TR); \
if (IsVarTerm(d1)) { \
@ -394,7 +394,7 @@
} \
} \
if (opresult) { \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
GONext(); \
} \
else { \
@ -408,7 +408,7 @@
#define P_DIF_DIF_NVAR1_NVAR2 \
BLOCK = (CELL)P_DIF_DIF_NVAR1_NVAR2; \
if (d0 == d1) { \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
GONext(); \
} \
else { \
@ -422,7 +422,7 @@
pt0 = TR; \
BEGCHO(pt1); \
pt1 = B; \
HBREG = HR; \
HRBREG = HR; \
B = (choiceptr) HR; \
B->cp_h = HR; \
SET_BB(B); \
@ -430,7 +430,7 @@
opresult = Yap_IUnify(d0, d1); \
B = pt1; \
SET_BB(PROTECT_FROZEN_B(pt1)); \
HBREG = B->cp_h; \
HRBREG = B->cp_h; \
while (TR != pt0) { \
d1 = TrailTerm(--TR); \
if (IsVarTerm(d1)) { \
@ -446,7 +446,7 @@
} \
} \
if (opresult) { \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
GONext(); \
} \
else { \
@ -461,7 +461,7 @@
#define P_DIF_DIF_NVAR1_NVAR2 \
BLOCK = (CELL)P_DIF_DIF_NVAR1_NVAR2; \
if (d0 == d1) { \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
GONext(); \
} \
else { \
@ -475,7 +475,7 @@
pt0 = TR; \
BEGCHO(pt1); \
pt1 = B; \
HBREG = HR; \
HRBREG = HR; \
B = (choiceptr) HR; \
B->cp_h = HR; \
SET_BB(B); \
@ -483,7 +483,7 @@
opresult = Yap_IUnify(d0, d1); \
B = pt1; \
SET_BB(PROTECT_FROZEN_B(pt1)); \
HBREG = B->cp_h; \
HRBREG = B->cp_h; \
while (TR != pt0) { \
d1 = TrailTerm(--TR); \
if (IsVarTerm(d1)) { \
@ -495,7 +495,7 @@
} \
} \
if (opresult) { \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
GONext(); \
} \
else { \
@ -512,7 +512,7 @@
#define P_DIF_DIF_NVAR1_NVAR2 \
BLOCK = (CELL)P_DIF_DIF_NVAR1_NVAR2; \
if (d0 == d1) { \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
GONext(); \
} \
else { \
@ -526,7 +526,7 @@
pt0 = TR; \
BEGCHO(pt1); \
pt1 = B; \
HBREG = HR; \
HRBREG = HR; \
B = (choiceptr) HR; \
B->cp_h = HR; \
SET_BB(B); \
@ -534,7 +534,7 @@
opresult = Yap_IUnify(d0, d1); \
B = pt1; \
SET_BB(PROTECT_FROZEN_B(pt1)); \
HBREG = B->cp_h; \
HRBREG = B->cp_h; \
while (TR != pt0) { \
d1 = TrailTerm(--TR); \
if (IsVarTerm(d1)) { \
@ -545,7 +545,7 @@
} \
} \
if (opresult) { \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
GONext(); \
} \
else { \
@ -559,7 +559,7 @@
#define P_DIF_DIF_NVAR1_NVAR2 \
BLOCK = (CELL)P_DIF_DIF_NVAR1_NVAR2; \
if (d0 == d1) { \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
GONext(); \
} \
else { \
@ -573,7 +573,7 @@
pt0 = TR; \
BEGCHO(pt1); \
pt1 = B; \
HBREG = HR; \
HRBREG = HR; \
B = (choiceptr) HR; \
B->cp_h = HR; \
SET_BB(B); \
@ -581,7 +581,7 @@
opresult = Yap_IUnify(d0, d1); \
B = pt1; \
SET_BB(PROTECT_FROZEN_B(pt1)); \
HBREG = B->cp_h; \
HRBREG = B->cp_h; \
while (TR != pt0) { \
d1 = TrailTerm(--TR); \
if (IsVarTerm(d1)) { \
@ -593,7 +593,7 @@
} \
} \
if (opresult) { \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
GONext(); \
} \
else { \
@ -608,7 +608,7 @@
#define P_DIF_DIF_NVAR1_NVAR2 \
BLOCK = (CELL)P_DIF_DIF_NVAR1_NVAR2; \
if (d0 == d1) { \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
GONext(); \
} \
else { \
@ -622,7 +622,7 @@
pt0 = TR; \
BEGCHO(pt1); \
pt1 = B; \
HBREG = HR; \
HRBREG = HR; \
B = (choiceptr) HR; \
B->cp_h = HR; \
SET_BB(B); \
@ -630,7 +630,7 @@
opresult = Yap_IUnify(d0, d1); \
B = pt1; \
SET_BB(PROTECT_FROZEN_B(pt1)); \
HBREG = B->cp_h; \
HRBREG = B->cp_h; \
while (TR != pt0) { \
d1 = TrailTerm(--TR); \
if (IsVarTerm(d1)) { \
@ -638,7 +638,7 @@
} \
} \
if (opresult) { \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
GONext(); \
} \
else { \
@ -653,9 +653,9 @@
#endif /* COROUTINING */
#define P_DIF_DIF_UNK1 \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
GONext();
#define P_DIF_DIF_NVAR1_UNK2 \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
GONext();

View File

@ -25,14 +25,14 @@
else { \
if (IsPairTerm(d0)) { \
if (!IsPairTerm(d1)) { \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
GONext(); \
} \
else { \
always_save_pc(); \
d2 = iequ_complex(RepPair(d0)-1, RepPair(d0)+1,RepPair(d1)-1); \
if (d2 == FALSE) { \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
GONext(); \
} \
else { \
@ -46,7 +46,7 @@
Functor f0 = FunctorOfTerm(d0); \
Functor f1; \
if (!IsApplTerm(d1)) { \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
GONext(); \
} \
else { \
@ -59,13 +59,13 @@
GONext(); \
} \
else { \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
GONext(); \
} \
break; \
case (CELL)FunctorLongInt: \
if (f1 != FunctorLongInt) { \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
GONext(); \
} \
else if (LongIntOfTerm(d0) == LongIntOfTerm(d1)) { \
@ -73,13 +73,13 @@
GONext(); \
} \
else { \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
GONext(); \
} \
break; \
case (CELL)FunctorBigInt: \
if (f1 != FunctorBigInt) { \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
GONext(); \
} \
else if (Yap_gmp_tcmp_big_big(d0,d1) == 0) { \
@ -87,13 +87,13 @@
GONext(); \
} \
else { \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
GONext(); \
} \
break; \
case (CELL)FunctorDouble: \
if (f1 != FunctorDouble) { \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
GONext(); \
} \
else if (FloatOfTerm(d0) == FloatOfTerm(d1)) { \
@ -102,20 +102,20 @@
} \
break; \
default: \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
GONext(); \
} \
} \
else { \
if (f0 != f1) { \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
GONext(); \
} \
else { \
always_save_pc(); \
d2 = iequ_complex(RepAppl(d0), RepAppl(d0)+ArityOfFunctor(f0), RepAppl(d1)); \
if (d2 == FALSE) { \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
GONext(); \
} \
else { \
@ -128,7 +128,7 @@
} \
} \
else { \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
GONext(); \
} \
}
@ -143,14 +143,14 @@
else { \
if (IsPairTerm(d0)) { \
if (!IsPairTerm(d1)) { \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
GONext(); \
} \
else { \
always_save_pc(); \
d2 = iequ_complex(RepPair(d0)-1, RepPair(d0)+1,RepPair(d1)-1); \
if (d2 == FALSE) { \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
GONext(); \
} \
else { \
@ -164,7 +164,7 @@
Functor f0 = FunctorOfTerm(d0); \
Functor f1; \
if (!IsApplTerm(d1)) { \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
GONext(); \
} \
else { \
@ -177,13 +177,13 @@
GONext(); \
} \
else { \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
GONext(); \
} \
break; \
case (CELL)FunctorLongInt: \
if (f1 != FunctorLongInt) { \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
GONext(); \
} \
else if (LongIntOfTerm(d0) == LongIntOfTerm(d1)) { \
@ -191,13 +191,13 @@
GONext(); \
} \
else { \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
GONext(); \
} \
break; \
case (CELL)FunctorDouble: \
if (f1 != FunctorDouble) { \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
GONext(); \
} \
else if (FloatOfTerm(d0) == FloatOfTerm(d1)) { \
@ -206,20 +206,20 @@
} \
break; \
default: \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
GONext(); \
} \
} \
else { \
if (f0 != f1) { \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
GONext(); \
} \
else { \
always_save_pc(); \
d2 = iequ_complex(RepAppl(d0), RepAppl(d0)+ArityOfFunctor(f0), RepAppl(d1)); \
if (d2 == FALSE) { \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
GONext(); \
} \
else { \
@ -232,27 +232,27 @@
} \
} \
else { \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
GONext(); \
} \
}
#endif /* USE_GMP */
#define P_EQ_P_EQ_NVAR1_UNK2 \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
GONext();
#define P_EQ_P_EQ_UNK1 \
d1 = ARG2;
#define P_EQ_P_EQ_VAR1_NVAR2 \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
GONext();
#define P_EQ_P_EQ_VAR1_UNK2_END \
BLOCK = (CELL)P_EQ_P_EQ_VAR1_UNK2_END; \
if (pt1 != pt0) { \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
GONext(); \
} \
else { \

3181
JIT/HPP/print_op.hh Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
#if (defined(YAPOR_SBA) && defined(YAPOR)) || defined(TABLING)
#define check_stack_on_fail \
if (__builtin_expect( ((Int)(Unsigned(YOUNGEST_CP((choiceptr)ENV_YREG,B_FZ)) - Unsigned(YOUNGEST_H(H_FZ,HR))) < CreepFlag), 0) ) return external_labels[10];
if (__builtin_expect( ((Int)(Unsigned(YOUNGEST_CP((choiceptr)ENV_YREG,B_FZ)) - Unsigned(YOUNGEST_H(H_FZ,H))) < CreepFlag), 0) ) return external_labels[10];
#else
#define check_stack_on_fail \
if (__builtin_expect(((Int)(Unsigned(ENV_YREG) - Unsigned(HR)) < CreepFlag ), 0) ) return external_labels[10];
@ -49,6 +49,10 @@
else { FAIL(); } \
} \
else { FAIL(); }
#define _native_me_instinit \
(*_PREG) = NEXTOP((*_PREG), aFlp); \
GONEXT();
#ifdef COROUTINING
#define _op_fail_instinit \

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
#if (defined(YAPOR_SBA) && defined(YAPOR)) || defined(TABLING)
#define check_stack_on_cut \
if (__builtin_expect( ((Int)(Unsigned(YOUNGEST_CP((choiceptr)ENV_YREG,B_FZ)) - Unsigned(YOUNGEST_H(H_FZ,HR))) < CreepFlag), 0) ) return external_labels[1];
if (__builtin_expect( ((Int)(Unsigned(YOUNGEST_CP((choiceptr)ENV_YREG,B_FZ)) - Unsigned(YOUNGEST_H(H_FZ,H))) < CreepFlag), 0) ) return external_labels[1];
#else
#define check_stack_on_cut \
if (__builtin_expect(((Int)(Unsigned(ENV_YREG) - Unsigned(HR)) < CreepFlag ), 0) ) return external_labels[1];
@ -8,7 +8,7 @@
#if (defined(YAPOR_SBA) && defined(YAPOR)) || defined(TABLING)
#define check_stack_on_cutt \
if (__builtin_expect( ((Int)(Unsigned(YOUNGEST_CP((choiceptr)ENV_YREG,B_FZ)) - Unsigned(YOUNGEST_H(H_FZ,HR))) < CreepFlag), 0) ) return external_labels[3];
if (__builtin_expect( ((Int)(Unsigned(YOUNGEST_CP((choiceptr)ENV_YREG,B_FZ)) - Unsigned(YOUNGEST_H(H_FZ,H))) < CreepFlag), 0) ) return external_labels[3];
#else
#define check_stack_on_cutt \
if (__builtin_expect(((Int)(Unsigned(ENV_YREG) - Unsigned(HR)) < CreepFlag ), 0) ) return external_labels[3];
@ -16,7 +16,7 @@
#if (defined(YAPOR_SBA) && defined(YAPOR)) || defined(TABLING)
#define check_stack_on_commitx \
if (__builtin_expect( ((Int)(Unsigned(YOUNGEST_CP((choiceptr)ENV_YREG,B_FZ)) - Unsigned(YOUNGEST_H(H_FZ,HR))) < CreepFlag), 0) ) return external_labels[11];
if (__builtin_expect( ((Int)(Unsigned(YOUNGEST_CP((choiceptr)ENV_YREG,B_FZ)) - Unsigned(YOUNGEST_H(H_FZ,H))) < CreepFlag), 0) ) return external_labels[11];
#else
#define check_stack_on_commitx \
if (__builtin_expect(((Int)(Unsigned(ENV_YREG) - Unsigned(HR)) < CreepFlag ), 0) ) return external_labels[11];
@ -30,7 +30,7 @@
ENDCACHE_Y_AS_ENV(); \
} \
do_cut: \
SET_ASP(YREG, (*_PREG)->y_u.s.s); \
SET_ASP(YREG, (*_PREG)->u.s.s); \
(*_PREG) = NEXTOP(NEXTOP(NEXTOP((*_PREG), s),Osbpp),l); \
saveregs(); \
prune((choiceptr)YREG[E_CB]); \
@ -38,7 +38,7 @@
GONEXT();
#else /* COROUTINING */
#define _cut_instinit \
SET_ASP(YREG, (*_PREG)->y_u.s.s); \
SET_ASP(YREG, (*_PREG)->u.s.s); \
(*_PREG) = NEXTOP(NEXTOP(NEXTOP((*_PREG), s),Osbpp),l); \
saveregs(); \
prune((choiceptr)YREG[E_CB]); \
@ -54,7 +54,7 @@
ENDCACHE_Y_AS_ENV(); \
} \
do_cut_t: \
SET_ASP(YREG, (*_PREG)->y_u.s.s); \
SET_ASP(YREG, (*_PREG)->u.s.s); \
saveregs(); \
prune((choiceptr)YREG[E_CB]); \
setregs(); \
@ -62,7 +62,7 @@
GONEXT();
#else /* COROUTINING */
#define _cut_t_instinit \
SET_ASP(YREG, (*_PREG)->y_u.s.s); \
SET_ASP(YREG, (*_PREG)->u.s.s); \
saveregs(); \
prune((choiceptr)YREG[E_CB]); \
setregs(); \
@ -80,7 +80,7 @@
#endif
#define CUT_E_NOCOROUTINING \
SET_ASP(YREG, (*_PREG)->y_u.s.s); \
SET_ASP(YREG, (*_PREG)->u.s.s); \
(*_PREG) = NEXTOP(NEXTOP(NEXTOP((*_PREG), s),Osbpp),l); \
saveregs(); \
prune((choiceptr)(*_SREG)[E_CB]); \
@ -90,7 +90,7 @@
#if defined(YAPOR_SBA) && defined(FROZEN_STACKS)
#define _save_b_x_instinit \
BEGD(d0); \
d0 = (*_PREG)->y_u.x.x; \
d0 = (*_PREG)->u.x.x; \
XREG(d0) = MkIntegerTerm((Int)B); \
(*_PREG) = NEXTOP((*_PREG), x); \
ENDD(d0); \
@ -98,7 +98,7 @@
#else /* defined(YAPOR_SBA) && defined(FROZEN_STACKS) */
#define _save_b_x_instinit \
BEGD(d0); \
d0 = (*_PREG)->y_u.x.x; \
d0 = (*_PREG)->u.x.x; \
XREG(d0) = MkIntegerTerm(LCL0-(CELL *) (B)); \
(*_PREG) = NEXTOP((*_PREG), x); \
ENDD(d0); \
@ -107,12 +107,12 @@
#if defined(YAPOR_SBA)
#define _save_b_y_instinit \
INITIALIZE_PERMVAR(YREG+(*_PREG)->y_u.y.y,MkIntegerTerm((Int)B)); \
INITIALIZE_PERMVAR(YREG+(*_PREG)->u.y.y,MkIntegerTerm((Int)B)); \
(*_PREG) = NEXTOP((*_PREG), y); \
GONEXT();
#else /* defined(YAPOR_SBA) */
#define _save_b_y_instinit \
INITIALIZE_PERMVAR(YREG+(*_PREG)->y_u.y.y,MkIntegerTerm(LCL0-(CELL *)(B))); \
INITIALIZE_PERMVAR(YREG+(*_PREG)->u.y.y,MkIntegerTerm(LCL0-(CELL *)(B))); \
(*_PREG) = NEXTOP((*_PREG), y); \
GONEXT();
#endif /* defined(YAPOR_SBA) */
@ -125,10 +125,10 @@
ENDCACHE_Y_AS_ENV(); \
do_commit_b_x: \
BEGD(d0); \
d0 = XREG((*_PREG)->y_u.xps.x); \
d0 = XREG((*_PREG)->u.xps.x); \
deref_head(d0, commit_b_x_unk); \
commit_b_x_nvar: \
SET_ASP(YREG, (*_PREG)->y_u.xps.s); \
SET_ASP(YREG, (*_PREG)->u.xps.s); \
(*_PREG) = NEXTOP(NEXTOP(NEXTOP((*_PREG), xps),Osbpp),l); \
{ \
choiceptr pt0; \
@ -151,10 +151,10 @@
ENDCACHE_Y_AS_ENV(); \
do_commit_b_x: \
BEGD(d0); \
d0 = XREG((*_PREG)->y_u.xps.x); \
d0 = XREG((*_PREG)->u.xps.x); \
deref_head(d0, commit_b_x_unk); \
commit_b_x_nvar: \
SET_ASP(YREG, (*_PREG)->y_u.xps.s); \
SET_ASP(YREG, (*_PREG)->u.xps.s); \
(*_PREG) = NEXTOP(NEXTOP(NEXTOP((*_PREG), xps),Osbpp),l); \
{ \
choiceptr pt0; \
@ -175,10 +175,10 @@
#if defined(YAPOR_SBA) && defined(FROZEN_STACKS)
#define _commit_b_x_instinit \
BEGD(d0); \
d0 = XREG((*_PREG)->y_u.xps.x); \
d0 = XREG((*_PREG)->u.xps.x); \
deref_head(d0, commit_b_x_unk); \
commit_b_x_nvar: \
SET_ASP(YREG, (*_PREG)->y_u.xps.s); \
SET_ASP(YREG, (*_PREG)->u.xps.s); \
(*_PREG) = NEXTOP(NEXTOP(NEXTOP((*_PREG), xps),Osbpp),l); \
{ \
choiceptr pt0; \
@ -197,10 +197,10 @@
#else /* defined(YAPOR_SBA) && defined(FROZEN_STACKS) */
#define _commit_b_x_instinit \
BEGD(d0); \
d0 = XREG((*_PREG)->y_u.xps.x); \
d0 = XREG((*_PREG)->u.xps.x); \
deref_head(d0, commit_b_x_unk); \
commit_b_x_nvar: \
SET_ASP(YREG, (*_PREG)->y_u.xps.s); \
SET_ASP(YREG, (*_PREG)->u.xps.s); \
(*_PREG) = NEXTOP(NEXTOP(NEXTOP((*_PREG), xps),Osbpp),l); \
{ \
choiceptr pt0; \
@ -224,10 +224,10 @@
register CELL *pt1;
#define COMMIT_B_Y_DO_COMMIT_B_Y \
d0 = YREG[(*_PREG)->y_u.yps.y];
d0 = YREG[(*_PREG)->u.yps.y];
#define COMMIT_B_Y_COMMIT_B_Y_NVAR \
SET_ASP(YREG, (*_PREG)->y_u.yps.s); \
SET_ASP(YREG, (*_PREG)->u.yps.s); \
(*_PREG) = NEXTOP(NEXTOP(NEXTOP((*_PREG), yps),Osbpp),l); \
choiceptr pt0;

View File

@ -1,15 +1,15 @@
#define _get_x_var_instinit \
register CELL d0; \
d0 = XREG((*_PREG)->y_u.xx.xr); \
XREG((*_PREG)->y_u.xx.xl) = d0; \
d0 = XREG((*_PREG)->u.xx.xr); \
XREG((*_PREG)->u.xx.xl) = d0; \
(*_PREG) = NEXTOP((*_PREG), xx); \
GONEXT();
#define _get_y_var_instinit \
register CELL d0; \
register CELL *pt0; \
pt0 = YREG + (*_PREG)->y_u.yx.y; \
d0 = XREG((*_PREG)->y_u.yx.x); \
pt0 = YREG + (*_PREG)->u.yx.y; \
d0 = XREG((*_PREG)->u.yx.x); \
(*_PREG) = NEXTOP((*_PREG), yx); \
INITIALIZE_PERMVAR(pt0,d0); \
GONEXT();
@ -18,10 +18,10 @@
register CELL d0, d1; \
register CELL *pt0, *pt1; \
CACHE_Y(YREG); \
pt0 = S_YREG + (*_PREG)->y_u.yyxx.y1; \
d0 = XREG((*_PREG)->y_u.yyxx.x1); \
pt1 = S_YREG + (*_PREG)->y_u.yyx.y2; \
d1 = XREG((*_PREG)->y_u.yyxx.x2); \
pt0 = S_YREG + (*_PREG)->u.yyxx.y1; \
d0 = XREG((*_PREG)->u.yyxx.x1); \
pt1 = S_YREG + (*_PREG)->u.yyx.y2; \
d1 = XREG((*_PREG)->u.yyxx.x2); \
(*_PREG) = NEXTOP((*_PREG), yyxx); \
INITIALIZE_PERMVAR(pt0,d0); \
INITIALIZE_PERMVAR(pt1,d1); \
@ -30,12 +30,12 @@
#define _get_x_val_instinit \
BEGD(d0); \
d0 = XREG((*_PREG)->y_u.xx.xl); \
d0 = XREG((*_PREG)->u.xx.xl); \
deref_head(d0, gvalx_unk); \
\
gvalx_nonvar: \
BEGD(d1); \
d1 = XREG((*_PREG)->y_u.xx.xr); \
d1 = XREG((*_PREG)->u.xx.xr); \
deref_head(d1, gvalx_nonvar_unk); \
\
gvalx_nonvar_nonvar: \
@ -53,7 +53,7 @@
BEGP(pt0); \
deref_body(d0, pt0, gvalx_unk, gvalx_nonvar); \
BEGD(d1); \
d1 = XREG((*_PREG)->y_u.xx.xr); \
d1 = XREG((*_PREG)->u.xx.xr); \
deref_head(d1, gvalx_var_unk); \
\
gvalx_var_nonvar: \
@ -75,12 +75,12 @@
BEGD(d0); \
BEGD(d1); \
BEGP(pt0); \
pt0 = YREG + (*_PREG)->y_u.yx.y; \
pt0 = YREG + (*_PREG)->u.yx.y; \
d0 = *pt0; \
\
deref_head(d0, gvaly_unk); \
gvaly_nonvar: \
d1 = XREG((*_PREG)->y_u.yx.x); \
d1 = XREG((*_PREG)->u.yx.x); \
deref_head(d1, gvaly_nonvar_unk); \
\
gvaly_nonvar_nonvar: \
@ -95,7 +95,7 @@
ENDP(pt1); \
\
derefa_body(d0, pt0, gvaly_unk, gvaly_nonvar); \
d1 = XREG((*_PREG)->y_u.yx.x); \
d1 = XREG((*_PREG)->u.yx.x); \
deref_head(d1, gvaly_var_unk); \
gvaly_var_nonvar: \
(*_PREG) = NEXTOP((*_PREG), yx); \
@ -115,8 +115,8 @@
#define _get_atom_instinit \
BEGD(d0); \
BEGD(d1); \
d0 = XREG((*_PREG)->y_u.xc.x); \
d1 = (*_PREG)->y_u.xc.c; \
d0 = XREG((*_PREG)->u.xc.x); \
d1 = (*_PREG)->u.xc.c; \
\
BEGP(pt0); \
deref_head(d0, gatom_unk); \
@ -145,7 +145,7 @@
BEGP(pt0); \
deref_head(d0, gatom_2unk); \
gatom_2nonvar: \
if (d0 == (*_PREG)->y_u.cc.c1) { \
if (d0 == (*_PREG)->u.cc.c1) { \
goto gatom_2b; \
} \
else { \
@ -153,11 +153,11 @@
} \
\
deref_body(d0, pt0, gatom_2unk, gatom_2nonvar); \
Bind(pt0, (*_PREG)->y_u.cc.c1); \
Bind(pt0, (*_PREG)->u.cc.c1); \
ENDP(pt0); \
gatom_2b: \
d0 = ARG2; \
d1 = (*_PREG)->y_u.cc.c2; \
d1 = (*_PREG)->u.cc.c2; \
\
BEGP(pt0); \
deref_head(d0, gatom_2bunk); \
@ -186,7 +186,7 @@
BEGP(pt0); \
deref_head(d0, gatom_3unk); \
gatom_3nonvar: \
if (d0 == (*_PREG)->y_u.ccc.c1) { \
if (d0 == (*_PREG)->u.ccc.c1) { \
goto gatom_3b; \
} \
else { \
@ -194,7 +194,7 @@
} \
\
deref_body(d0, pt0, gatom_3unk, gatom_3nonvar); \
Bind(pt0, (*_PREG)->y_u.ccc.c1); \
Bind(pt0, (*_PREG)->u.ccc.c1); \
ENDP(pt0); \
gatom_3b: \
d0 = ARG2; \
@ -202,7 +202,7 @@
BEGP(pt0); \
deref_head(d0, gatom_3bunk); \
gatom_3bnonvar: \
if (d0 == (*_PREG)->y_u.ccc.c2) { \
if (d0 == (*_PREG)->u.ccc.c2) { \
goto gatom_3c; \
} \
else { \
@ -210,11 +210,11 @@
} \
\
deref_body(d0, pt0, gatom_3bunk, gatom_3bnonvar); \
Bind(pt0, (*_PREG)->y_u.ccc.c2); \
Bind(pt0, (*_PREG)->u.ccc.c2); \
ENDP(pt0); \
gatom_3c: \
d0 = ARG3; \
d1 = (*_PREG)->y_u.ccc.c3; \
d1 = (*_PREG)->u.ccc.c3; \
\
BEGP(pt0); \
deref_head(d0, gatom_3cunk); \
@ -241,23 +241,23 @@
d0 = ARG1;
#define GET_4ATOMS_GATOM_4UNK \
Bind(pt0, (*_PREG)->y_u.cccc.c1);
Bind(pt0, (*_PREG)->u.cccc.c1);
#define GET_4ATOMS_GATOM_4B \
d0 = ARG2;
#define GET_4ATOMS_GATOM_4BUNK \
Bind(pt0, (*_PREG)->y_u.cccc.c2);
Bind(pt0, (*_PREG)->u.cccc.c2);
#define GET_4ATOMS_GATOM_4C \
d0 = ARG3;
#define GET_4ATOMS_GATOM_4CUNK \
Bind(pt0, (*_PREG)->y_u.cccc.c3);
Bind(pt0, (*_PREG)->u.cccc.c3);
#define GET_4ATOMS_GATOM_4D \
d0 = ARG4; \
d1 = (*_PREG)->y_u.cccc.c4;
d1 = (*_PREG)->u.cccc.c4;
#define GET_4ATOMS_EQUALS \
(*_PREG) = NEXTOP((*_PREG), cccc); \
@ -274,29 +274,29 @@
d0 = ARG1;
#define GET_5ATOMS_GATOM_5UNK \
Bind(pt0, (*_PREG)->y_u.ccccc.c1);
Bind(pt0, (*_PREG)->u.ccccc.c1);
#define GET_5ATOMS_GATOM_5B \
d0 = ARG2;
#define GET_5ATOMS_GATOM_5BUNK \
Bind(pt0, (*_PREG)->y_u.ccccc.c2);
Bind(pt0, (*_PREG)->u.ccccc.c2);
#define GET_5ATOMS_GATOM_5C \
d0 = ARG3;
#define GET_5ATOMS_GATOM_5CUNK \
Bind(pt0, (*_PREG)->y_u.ccccc.c3);
Bind(pt0, (*_PREG)->u.ccccc.c3);
#define GET_5ATOMS_GATOM_5D \
d0 = ARG4;
#define GET_5ATOMS_GATOM_5DUNK \
Bind(pt0, (*_PREG)->y_u.ccccc.c4);
Bind(pt0, (*_PREG)->u.ccccc.c4);
#define GET_5ATOMS_GATOM_5E \
d0 = ARG5; \
d1 = (*_PREG)->y_u.ccccc.c5;
d1 = (*_PREG)->u.ccccc.c5;
#define GET_5ATOMS_EQUALS \
(*_PREG) = NEXTOP((*_PREG), ccccc); \
@ -313,35 +313,35 @@
d0 = ARG1;
#define GET_6ATOMS_GATOM_6UNK \
Bind(pt0, (*_PREG)->y_u.cccccc.c1);
Bind(pt0, (*_PREG)->u.cccccc.c1);
#define GET_6ATOMS_GATOM_6B \
d0 = ARG2;
#define GET_6ATOMS_GATOM_6BUNK \
Bind(pt0, (*_PREG)->y_u.cccccc.c2);
Bind(pt0, (*_PREG)->u.cccccc.c2);
#define GET_6ATOMS_GATOM_6C \
d0 = ARG3;
#define GET_6ATOMS_GATOM_6CUNK \
Bind(pt0, (*_PREG)->y_u.cccccc.c3);
Bind(pt0, (*_PREG)->u.cccccc.c3);
#define GET_6ATOMS_GATOM_6D \
d0 = ARG4;
#define GET_6ATOMS_GATOM_6DUNK \
Bind(pt0, (*_PREG)->y_u.cccccc.c4);
Bind(pt0, (*_PREG)->u.cccccc.c4);
#define GET_6ATOMS_GATOM_6E \
d0 = ARG5;
#define GET_6ATOMS_GATOM_6EUNK \
Bind(pt0, (*_PREG)->y_u.cccccc.c5);
Bind(pt0, (*_PREG)->u.cccccc.c5);
#define GET_6ATOMS_GATOM_6F \
d0 = ARG6; \
d1 = (*_PREG)->y_u.cccccc.c6;
d1 = (*_PREG)->u.cccccc.c6;
#define GET_6ATOMS_EQUALS \
(*_PREG) = NEXTOP((*_PREG), cccccc); \
@ -354,7 +354,7 @@
#define _get_list_instinit \
BEGD(d0); \
d0 = XREG((*_PREG)->y_u.x.x); \
d0 = XREG((*_PREG)->u.x.x); \
deref_head(d0, glist_unk); \
\
glist_nonvar: \
@ -384,7 +384,7 @@
#define _get_struct_instinit \
BEGD(d0); \
d0 = XREG((*_PREG)->y_u.xfa.x); \
d0 = XREG((*_PREG)->u.xfa.x); \
deref_head(d0, gstruct_unk); \
\
gstruct_nonvar: \
@ -393,7 +393,7 @@
} \
CACHE_S(); \
S_SREG = RepAppl(d0); \
d0 = (CELL) ((*_PREG)->y_u.xfa.f); \
d0 = (CELL) ((*_PREG)->u.xfa.f); \
if (*S_SREG != d0) { \
FAIL(); \
} \
@ -409,9 +409,9 @@
Bind(pt0, d1); \
pt0 = HR; \
ENDD(d1); \
d0 = (CELL) ((*_PREG)->y_u.xfa.f); \
d0 = (CELL) ((*_PREG)->u.xfa.f); \
*pt0++ = d0; \
HR = pt0 + (*_PREG)->y_u.xfa.a; \
HR = pt0 + (*_PREG)->u.xfa.a; \
(*_PREG) = NEXTOP((*_PREG), xfa); \
(*_SREG) = pt0; \
GONEXTW(); \
@ -421,7 +421,7 @@
#if SIZEOF_DOUBLE == 2*SIZEOF_INT_P
#define _get_float_instinit \
BEGD(d0); \
d0 = XREG((*_PREG)->y_u.xd.x); \
d0 = XREG((*_PREG)->u.xd.x); \
deref_head(d0, gfloat_unk); \
\
gfloat_nonvar: \
@ -434,7 +434,7 @@
FAIL(); \
} \
BEGP(pt1); \
pt1 = (*_PREG)->y_u.xd.d; \
pt1 = (*_PREG)->u.xd.d; \
(*_PREG) = NEXTOP((*_PREG), xd); \
if ( \
pt1[1] != pt0[1] \
@ -449,7 +449,7 @@
BEGP(pt0); \
deref_body(d0, pt0, gfloat_unk, gfloat_nonvar); \
BEGD(d1); \
d1 = AbsAppl((*_PREG)->y_u.xd.d); \
d1 = AbsAppl((*_PREG)->u.xd.d); \
(*_PREG) = NEXTOP((*_PREG), xd); \
Bind(pt0, d1); \
GONEXT(); \
@ -459,7 +459,7 @@
#else /* SIZEOF_DOUBLE == 2*SIZEOF_INT_P */
#define _get_float_instinit \
BEGD(d0); \
d0 = XREG((*_PREG)->y_u.xd.x); \
d0 = XREG((*_PREG)->u.xd.x); \
deref_head(d0, gfloat_unk); \
\
gfloat_nonvar: \
@ -472,7 +472,7 @@
FAIL(); \
} \
BEGP(pt1); \
pt1 = (*_PREG)->y_u.xd.d; \
pt1 = (*_PREG)->u.xd.d; \
(*_PREG) = NEXTOP((*_PREG), xd); \
if ( \
pt1[1] != pt0[1] \
@ -486,7 +486,7 @@
BEGP(pt0); \
deref_body(d0, pt0, gfloat_unk, gfloat_nonvar); \
BEGD(d1); \
d1 = AbsAppl((*_PREG)->y_u.xd.d); \
d1 = AbsAppl((*_PREG)->u.xd.d); \
(*_PREG) = NEXTOP((*_PREG), xd); \
Bind(pt0, d1); \
GONEXT(); \
@ -498,7 +498,7 @@
#define GET_LONGINT_INSTINIT \
register CELL d0, d1; \
register CELL *pt0; \
d0 = XREG((*_PREG)->y_u.xi.x);
d0 = XREG((*_PREG)->u.xi.x);
#define GET_LONGINT_GLONGINT_NONVAR_INIT \
START_PREFETCH(xi); \
@ -511,7 +511,7 @@
#define GET_LONGINT_GLONGINT_UNK \
START_PREFETCH(xi); \
d1 = AbsAppl((*_PREG)->y_u.xi.i); \
d1 = AbsAppl((*_PREG)->u.xi.i); \
(*_PREG) = NEXTOP((*_PREG), xi); \
Bind(pt0, d1); \
GONext(); \
@ -521,7 +521,7 @@
#define GET_BIGINT_INSTINIT \
register CELL d0, d1; \
register CELL *pt0; \
d0 = XREG((*_PREG)->y_u.xN.x);
d0 = XREG((*_PREG)->u.xN.x);
#define GET_BIGINT_GBIGINT_NONVAR_INIT \
START_PREFETCH(xN); \
@ -534,7 +534,7 @@
#define GET_BIGINT_GBIGINT_UNK \
START_PREFETCH(xN); \
d1 = (*_PREG)->y_u.xN.b; \
d1 = (*_PREG)->u.xN.b; \
(*_PREG) = NEXTOP((*_PREG), xN); \
Bind(pt0, d1); \
GONext(); \
@ -544,17 +544,17 @@
#define GET_DBTERM_INSTINIT \
register CELL d0, d1; \
register CELL *pt0; \
d0 = XREG((*_PREG)->y_u.xD.x);
d0 = XREG((*_PREG)->u.xD.x);
#define GET_DBTERM_GDBTERM_NONVAR \
BLOCK = (CELL)GET_DBTERM_GDBTERM_NONVAR; \
d1 = (*_PREG)->y_u.xD.D; \
d1 = (*_PREG)->u.xD.D; \
(*_PREG) = NEXTOP((*_PREG), xD); \
YAAM_UNIFYBOUND;
#define GET_DBTERM_GDBTERM_UNK \
START_PREFETCH(xD); \
d1 = (*_PREG)->y_u.xD.D; \
d1 = (*_PREG)->u.xD.D; \
(*_PREG) = NEXTOP((*_PREG), xD); \
Bind(pt0, d1); \
GONext(); \
@ -562,7 +562,7 @@
#define _glist_valx_instinit \
BEGD(d0); \
d0 = XREG((*_PREG)->y_u.xx.xl); \
d0 = XREG((*_PREG)->u.xx.xl); \
deref_head(d0, glist_valx_write); \
glist_valx_read: \
BEGP(pt0); \
@ -576,7 +576,7 @@
\
glist_valx_nonvar: \
BEGD(d1); \
d1 = XREG((*_PREG)->y_u.xx.xr); \
d1 = XREG((*_PREG)->u.xx.xr); \
deref_head(d1, glist_valx_nonvar_unk); \
\
glist_valx_nonvar_nonvar: \
@ -592,7 +592,7 @@
ENDD(d1); \
\
derefa_body(d0, pt0, glist_valx_unk, glist_valx_nonvar); \
d0 = XREG((*_PREG)->y_u.xx.xr); \
d0 = XREG((*_PREG)->u.xx.xr); \
deref_head(d0, glist_valx_var_unk); \
\
glist_valx_var_nonvar: \
@ -613,7 +613,7 @@
CACHE_S(); \
S_SREG = HR; \
BEGD(d1); \
d1 = XREG((*_PREG)->y_u.xx.xr); \
d1 = XREG((*_PREG)->u.xx.xr); \
d0 = AbsPair(S_SREG); \
S_SREG[0] = d1; \
ENDD(d1); \
@ -629,7 +629,7 @@
#define GLIST_VALY_INSTINIT \
register CELL d0, d1; \
register CELL *pt0, *pt1; \
d0 = XREG((*_PREG)->y_u.yx.x);
d0 = XREG((*_PREG)->u.yx.x);
#define GLIST_VALY_GLIST_VALY_READ \
if (!IsPairTerm(d0)) { \
@ -641,7 +641,7 @@
d0 = *pt0;
#define GLIST_VALY_GLIST_VALY_NONVAR \
pt1 = YREG + (*_PREG)->y_u.yx.y; \
pt1 = YREG + (*_PREG)->u.yx.y; \
d1 = *pt1; \
(*_PREG) = NEXTOP((*_PREG), yx);
@ -655,7 +655,7 @@
GONext();
#define GLIST_VALY_GLIST_VALY_UNK \
pt1 = YREG+(*_PREG)->y_u.yx.y; \
pt1 = YREG+(*_PREG)->u.yx.y; \
d1 = *pt1;
#define GLIST_VALY_GLIST_VALY_VAR_NONVAR \
@ -674,7 +674,7 @@
pt1 = HR; \
d0 = AbsPair(pt1); \
Bind(pt0, d0); \
d0 = YREG[(*_PREG)->y_u.yx.y]; \
d0 = YREG[(*_PREG)->u.yx.y]; \
pt1[0] = d0; \
HR = pt1 + 2; \
(*_SREG) = pt1 + 1; \
@ -684,7 +684,7 @@
#define _gl_void_varx_instinit \
BEGD(d0); \
d0 = XREG((*_PREG)->y_u.xx.xl); \
d0 = XREG((*_PREG)->u.xx.xl); \
deref_head(d0, glist_void_varx_write); \
glist_void_varx_read: \
if (!IsPairTerm(d0)) { \
@ -693,7 +693,7 @@
BEGP(pt0); \
pt0 = RepPair(d0); \
d0 = pt0[1]; \
XREG((*_PREG)->y_u.xx.xr) = d0; \
XREG((*_PREG)->u.xx.xr) = d0; \
(*_PREG) = NEXTOP((*_PREG), xx); \
GONEXT(); \
ENDP(pt0); \
@ -702,7 +702,7 @@
deref_body(d0, pt0, glist_void_varx_write, glist_void_varx_read); \
BEGP(pt1); \
pt1 = HR; \
XREG((*_PREG)->y_u.xx.xr) = \
XREG((*_PREG)->u.xx.xr) = \
Unsigned(pt1 + 1); \
RESET_VARIABLE(pt1); \
RESET_VARIABLE(pt1+1); \
@ -721,7 +721,7 @@
BLOCKADDRESS = (CELL)(*_PREG); \
register CELL d0; \
register CELL *pt0, *pt1; \
d0 = XREG((*_PREG)->y_u.yx.x);
d0 = XREG((*_PREG)->u.yx.x);
#define GL_VOID_VARY_GLIST_VOID_VARY_READ \
BLOCK = (CELL)GL_VOID_VARY_GLIST_VOID_VARY_READ; \
@ -732,14 +732,14 @@
else { \
pt0 = RepPair(d0); \
d0 = pt0[1]; \
INITIALIZE_PERMVAR(YREG+(*_PREG)->y_u.yx.y,d0); \
INITIALIZE_PERMVAR(YREG+(*_PREG)->u.yx.y,d0); \
(*_PREG) = NEXTOP((*_PREG), yx); \
GONext(); \
}
#define GL_VOID_VARY_GLIST_VOID_VARY_WRITE \
pt1 = HR; \
INITIALIZE_PERMVAR(YREG+(*_PREG)->y_u.yx.y,Unsigned(pt1 + 1)); \
INITIALIZE_PERMVAR(YREG+(*_PREG)->u.yx.y,Unsigned(pt1 + 1)); \
(*_PREG) = NEXTOP((*_PREG), yx); \
RESET_VARIABLE(pt1); \
RESET_VARIABLE(pt1+1); \
@ -752,7 +752,7 @@
BLOCKADDRESS = (CELL)(*_PREG); \
register CELL d0, d1; \
register CELL *pt0, *pt1; \
d0 = XREG((*_PREG)->y_u.xx.xl);
d0 = XREG((*_PREG)->u.xx.xl);
#define GL_VOID_VALX_GLIST_VOID_VALX_READ \
BLOCK = (CELL)GL_VOID_VALX_GLIST_VOID_VALX_READ; \
@ -766,7 +766,7 @@
}
#define GL_VOID_VALX_GLIST_VOID_VALX_NONVAR \
d1 = XREG((*_PREG)->y_u.xx.xr);
d1 = XREG((*_PREG)->u.xx.xr);
#define GL_VOID_VALX_GLIST_VOID_VALX_NONVAR_NONVAR \
BLOCK = (CELL)GL_VOID_VALX_GLIST_VOID_VALX_NONVAR_NONVAR; \
@ -779,7 +779,7 @@
GONext();
#define GL_VOID_VALX_GLIST_VOID_VALX_UNK \
d1 = XREG((*_PREG)->y_u.xx.xr);
d1 = XREG((*_PREG)->u.xx.xr);
#define GL_VOID_VALX_GLIST_VOID_VALX_VAR_NONVAR \
(*_PREG) = NEXTOP((*_PREG), xx); \
@ -796,7 +796,7 @@
d0 = AbsPair(pt1); \
Bind(pt0, d0); \
pt1 = HR; \
d0 = XREG((*_PREG)->y_u.xx.xr); \
d0 = XREG((*_PREG)->u.xx.xr); \
RESET_VARIABLE(pt1); \
pt1[1] = d0; \
HR = pt1 + 2; \
@ -807,7 +807,7 @@
BLOCKADDRESS = (CELL)(*_PREG); \
register CELL d0, d1; \
register CELL *pt0, *pt1; \
d0 = XREG((*_PREG)->y_u.yx.x);
d0 = XREG((*_PREG)->u.yx.x);
#define GL_VOID_VALY_GLIST_VOID_VALY_READ \
BLOCK = (CELL)GL_VOID_VALY_GLIST_VOID_VALY_READ; \
@ -821,7 +821,7 @@
}
#define GL_VOID_VALY_GLIST_VOID_VALY_NONVAR \
pt1 = YREG+(*_PREG)->y_u.yx.y; \
pt1 = YREG+(*_PREG)->u.yx.y; \
d1 = *pt1;
#define GL_VOID_VALY_GLIST_VOID_VALY_NONVAR_NONVAR \
@ -835,7 +835,7 @@
GONext();
#define GL_VOID_VALY_GLIST_VOID_VALY_UNK \
pt1 = YREG+(*_PREG)->y_u.yx.y; \
pt1 = YREG+(*_PREG)->u.yx.y; \
d1 = *pt1;
#define GL_VOID_VALY_GLIST_VOID_VALY_VAR_NONVAR \
@ -854,7 +854,7 @@
d0 = AbsPair(S_SREG); \
Bind(pt0, d0); \
S_SREG = HR; \
d1 = YREG[(*_PREG)->y_u.yx.y]; \
d1 = YREG[(*_PREG)->u.yx.y]; \
RESET_VARIABLE(S_SREG); \
S_SREG[1] = d1; \
(*_PREG) = NEXTOP((*_PREG), yx); \

View File

@ -1,6 +1,6 @@
#if (defined(YAPOR_SBA) && defined(YAPOR)) || defined(TABLING)
#define check_stack_on_either \
if (__builtin_expect( ((Int)(Unsigned(YOUNGEST_CP((choiceptr)ENV_YREG,B_FZ)) - Unsigned(YOUNGEST_H(H_FZ,HR))) < CreepFlag), 0) ) return external_labels[4];
if (__builtin_expect( ((Int)(Unsigned(YOUNGEST_CP((choiceptr)ENV_YREG,B_FZ)) - Unsigned(YOUNGEST_H(H_FZ,H))) < CreepFlag), 0) ) return external_labels[4];
#else
#define check_stack_on_either \
if (__builtin_expect(((Int)(Unsigned(ENV_YREG) - Unsigned(HR)) < CreepFlag ), 0) ) return external_labels[4];
@ -13,7 +13,7 @@
GONext();
#define LOCK_LU_PARALLEL \
PP = (*_PREG)->y_u.p.p; \
PP = (*_PREG)->u.p.p; \
PELOCK(3, PP);
#endif
@ -37,7 +37,7 @@
#if MULTIPLE_STACKS
#define ALLOC_FOR_LOGICAL_PRED_MULTIPLE_STACKS \
LogUpdClause *cl = (*_PREG)->y_u.L.ClBase;
LogUpdClause *cl = (*_PREG)->u.L.ClBase;
#if PARALLEL_YAP
#define ALLOC_FOR_LOGICAL_PRED_MULTIPLE_STACKS_PARALLEL \
PredEntry *ap = cl->ClPred;
@ -49,7 +49,7 @@
PP = NULL;
#else
#define ALLOC_FOR_LOGICAL_PRED_NOMULTIPLE_STACKS_INIT \
LogUpdClause *cl = (LogUpdClause *)(*_PREG)->y_u.L.ClBase;
LogUpdClause *cl = (LogUpdClause *)(*_PREG)->u.L.ClBase;
#define ALLOC_FOR_LOGICAL_PRED_NOMULTIPLE_STACKS_IFOK \
cl->ClFlags |= InUseMask; \
@ -539,8 +539,8 @@
JMPNext();
#define ENSURE_SPACE_INSTINIT \
Int sz = (*_PREG)->y_u.Osbpa.i; \
UInt arity = (*_PREG)->y_u.Osbpa.p->ArityOfPE;
Int sz = (*_PREG)->u.Osbpa.i; \
UInt arity = (*_PREG)->u.Osbpa.p->ArityOfPE;
#define ENSURE_SPACE_FIRSTIFOK_INIT \
YENV[E_CP] = (CELL) (*_CPREG); \
@ -552,7 +552,7 @@
#endif
#define ENSURE_SPACE_FIRSTIFOK_END \
SET_ASP(YREG, (*_PREG)->y_u.Osbpa.s); \
SET_ASP(YREG, (*_PREG)->u.Osbpa.s); \
(*_PREG) = NEXTOP((*_PREG),Osbpa); \
saveregs();
@ -571,7 +571,7 @@
JMPNext();
#define _jump_instinit \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
BACK();
#define MOVE_BACK_INSTINIT \
@ -596,7 +596,7 @@
ENDCACHE_Y_AS_ENV(); \
either_notest: \
BEGD(d0); \
d0 = (*_PREG)->y_u.Osblp.s; \
d0 = (*_PREG)->u.Osblp.s; \
BEGCHO(pt1); \
pt1 = (choiceptr) ((char *) YREG + (yslot) d0); \
choiceptr top_b = PROTECT_FROZEN_B(B); \
@ -604,7 +604,7 @@
pt1 = top_b; \
pt1 = (choiceptr)(((CELL *) pt1)-1); \
*(CELL **) pt1 = YREG; \
store_yaam_regs_for_either((*_PREG)->y_u.Osblp.l, (*_PREG)); \
store_yaam_regs_for_either((*_PREG)->u.Osblp.l, (*_PREG)); \
(*_SREG) = (CELL *) (B = pt1); \
SCH_set_load(pt1); \
SET_BB(pt1); \
@ -622,7 +622,7 @@
ENDCACHE_Y_AS_ENV(); \
either_notest: \
BEGD(d0); \
d0 = (*_PREG)->y_u.Osblp.s; \
d0 = (*_PREG)->u.Osblp.s; \
BEGCHO(pt1); \
pt1 = (choiceptr) ((char *) YREG + (yslot) d0); \
choiceptr top_b = PROTECT_FROZEN_B(B); \
@ -630,7 +630,7 @@
pt1 = top_b; \
pt1 = (choiceptr)(((CELL *) pt1)-1); \
*(CELL **) pt1 = YREG; \
store_yaam_regs_for_either((*_PREG)->y_u.Osblp.l, (*_PREG)); \
store_yaam_regs_for_either((*_PREG)->u.Osblp.l, (*_PREG)); \
(*_SREG) = (CELL *) (B = pt1); \
SCH_set_load(pt1); \
SET_BB(pt1); \
@ -649,14 +649,14 @@
ENDCACHE_Y_AS_ENV(); \
either_notest: \
BEGD(d0); \
d0 = (*_PREG)->y_u.Osblp.s; \
d0 = (*_PREG)->u.Osblp.s; \
BEGCHO(pt1); \
pt1 = (choiceptr) ((char *) YREG + (yslot) d0); \
if (pt1 > B) \
pt1 = B; \
pt1 = (choiceptr)(((CELL *) pt1)-1); \
*(CELL **) pt1 = YREG; \
store_yaam_regs_for_either((*_PREG)->y_u.Osblp.l, (*_PREG)); \
store_yaam_regs_for_either((*_PREG)->u.Osblp.l, (*_PREG)); \
(*_SREG) = (CELL *) (B = pt1); \
SCH_set_load(pt1); \
SET_BB(pt1); \
@ -674,7 +674,7 @@
ENDCACHE_Y_AS_ENV(); \
either_notest: \
BEGD(d0); \
d0 = (*_PREG)->y_u.Osblp.s; \
d0 = (*_PREG)->u.Osblp.s; \
BEGCHO(pt1); \
pt1 = (choiceptr) ((char *) YREG + (yslot) d0); \
choiceptr top_b = PROTECT_FROZEN_B(B); \
@ -682,7 +682,7 @@
pt1 = top_b; \
pt1 = (choiceptr)(((CELL *) pt1)-1); \
*(CELL **) pt1 = YREG; \
store_yaam_regs_for_either((*_PREG)->y_u.Osblp.l, (*_PREG)); \
store_yaam_regs_for_either((*_PREG)->u.Osblp.l, (*_PREG)); \
(*_SREG) = (CELL *) (B = pt1); \
SCH_set_load(pt1); \
SET_BB(pt1); \
@ -697,7 +697,7 @@
ENDCACHE_Y_AS_ENV(); \
either_notest: \
BEGD(d0); \
d0 = (*_PREG)->y_u.Osblp.s; \
d0 = (*_PREG)->u.Osblp.s; \
BEGCHO(pt1); \
pt1 = (choiceptr) ((char *) YREG + (yslot) d0); \
choiceptr top_b = PROTECT_FROZEN_B(B); \
@ -705,7 +705,7 @@
pt1 = top_b; \
pt1 = (choiceptr)(((CELL *) pt1)-1); \
*(CELL **) pt1 = YREG; \
store_yaam_regs_for_either((*_PREG)->y_u.Osblp.l, (*_PREG)); \
store_yaam_regs_for_either((*_PREG)->u.Osblp.l, (*_PREG)); \
(*_SREG) = (CELL *) (B = pt1); \
SCH_set_load(pt1); \
SET_BB(pt1); \
@ -721,14 +721,14 @@
ENDCACHE_Y_AS_ENV(); \
either_notest: \
BEGD(d0); \
d0 = (*_PREG)->y_u.Osblp.s; \
d0 = (*_PREG)->u.Osblp.s; \
BEGCHO(pt1); \
pt1 = (choiceptr) ((char *) YREG + (yslot) d0); \
if (pt1 > B) \
pt1 = B; \
pt1 = (choiceptr)(((CELL *) pt1)-1); \
*(CELL **) pt1 = YREG; \
store_yaam_regs_for_either((*_PREG)->y_u.Osblp.l, (*_PREG)); \
store_yaam_regs_for_either((*_PREG)->u.Osblp.l, (*_PREG)); \
(*_SREG) = (CELL *) (B = pt1); \
SCH_set_load(pt1); \
SET_BB(pt1); \
@ -747,7 +747,7 @@
low_level_trace(try_or, (PredEntry *)(*_PREG), NULL); \
} \
BEGD(d0); \
d0 = (*_PREG)->y_u.Osblp.s; \
d0 = (*_PREG)->u.Osblp.s; \
BEGCHO(pt1); \
pt1 = (choiceptr) ((char *) YREG + (yslot) d0); \
choiceptr top_b = PROTECT_FROZEN_B(B); \
@ -755,7 +755,7 @@
pt1 = top_b; \
pt1 = (choiceptr)(((CELL *) pt1)-1); \
*(CELL **) pt1 = YREG; \
store_yaam_regs_for_either((*_PREG)->y_u.Osblp.l, (*_PREG)); \
store_yaam_regs_for_either((*_PREG)->u.Osblp.l, (*_PREG)); \
(*_SREG) = (CELL *) (B = pt1); \
SCH_set_load(pt1); \
SET_BB(pt1); \
@ -769,7 +769,7 @@
low_level_trace(try_or, (PredEntry *)(*_PREG), NULL); \
} \
BEGD(d0); \
d0 = (*_PREG)->y_u.Osblp.s; \
d0 = (*_PREG)->u.Osblp.s; \
BEGCHO(pt1); \
pt1 = (choiceptr) ((char *) YREG + (yslot) d0); \
choiceptr top_b = PROTECT_FROZEN_B(B); \
@ -777,7 +777,7 @@
pt1 = top_b; \
pt1 = (choiceptr)(((CELL *) pt1)-1); \
*(CELL **) pt1 = YREG; \
store_yaam_regs_for_either((*_PREG)->y_u.Osblp.l, (*_PREG)); \
store_yaam_regs_for_either((*_PREG)->u.Osblp.l, (*_PREG)); \
(*_SREG) = (CELL *) (B = pt1); \
SCH_set_load(pt1); \
SET_BB(pt1); \
@ -792,14 +792,14 @@
low_level_trace(try_or, (PredEntry *)(*_PREG), NULL); \
} \
BEGD(d0); \
d0 = (*_PREG)->y_u.Osblp.s; \
d0 = (*_PREG)->u.Osblp.s; \
BEGCHO(pt1); \
pt1 = (choiceptr) ((char *) YREG + (yslot) d0); \
if (pt1 > B) \
pt1 = B; \
pt1 = (choiceptr)(((CELL *) pt1)-1); \
*(CELL **) pt1 = YREG; \
store_yaam_regs_for_either((*_PREG)->y_u.Osblp.l, (*_PREG)); \
store_yaam_regs_for_either((*_PREG)->u.Osblp.l, (*_PREG)); \
(*_SREG) = (CELL *) (B = pt1); \
SCH_set_load(pt1); \
SET_BB(pt1); \
@ -813,7 +813,7 @@
#ifdef YAPOR_SBA
#define _either_instinit \
BEGD(d0); \
d0 = (*_PREG)->y_u.Osblp.s; \
d0 = (*_PREG)->u.Osblp.s; \
BEGCHO(pt1); \
pt1 = (choiceptr) ((char *) YREG + (yslot) d0); \
choiceptr top_b = PROTECT_FROZEN_B(B); \
@ -821,7 +821,7 @@
pt1 = top_b; \
pt1 = (choiceptr)(((CELL *) pt1)-1); \
*(CELL **) pt1 = YREG; \
store_yaam_regs_for_either((*_PREG)->y_u.Osblp.l, (*_PREG)); \
store_yaam_regs_for_either((*_PREG)->u.Osblp.l, (*_PREG)); \
(*_SREG) = (CELL *) (B = pt1); \
SCH_set_load(pt1); \
SET_BB(pt1); \
@ -832,7 +832,7 @@
#else /* YAPOR_SBA */
#define _either_instinit \
BEGD(d0); \
d0 = (*_PREG)->y_u.Osblp.s; \
d0 = (*_PREG)->u.Osblp.s; \
BEGCHO(pt1); \
pt1 = (choiceptr) ((char *) YREG + (yslot) d0); \
choiceptr top_b = PROTECT_FROZEN_B(B); \
@ -840,7 +840,7 @@
pt1 = top_b; \
pt1 = (choiceptr)(((CELL *) pt1)-1); \
*(CELL **) pt1 = YREG; \
store_yaam_regs_for_either((*_PREG)->y_u.Osblp.l, (*_PREG)); \
store_yaam_regs_for_either((*_PREG)->u.Osblp.l, (*_PREG)); \
(*_SREG) = (CELL *) (B = pt1); \
SCH_set_load(pt1); \
SET_BB(pt1); \
@ -852,14 +852,14 @@
#else /* FROZEN_STACKS */
#define _either_instinit \
BEGD(d0); \
d0 = (*_PREG)->y_u.Osblp.s; \
d0 = (*_PREG)->u.Osblp.s; \
BEGCHO(pt1); \
pt1 = (choiceptr) ((char *) YREG + (yslot) d0); \
if (pt1 > B) \
pt1 = B; \
pt1 = (choiceptr)(((CELL *) pt1)-1); \
*(CELL **) pt1 = YREG; \
store_yaam_regs_for_either((*_PREG)->y_u.Osblp.l, (*_PREG)); \
store_yaam_regs_for_either((*_PREG)->u.Osblp.l, (*_PREG)); \
(*_SREG) = (CELL *) (B = pt1); \
SCH_set_load(pt1); \
SET_BB(pt1); \
@ -884,7 +884,7 @@
ENDCACHE_Y_AS_ENV(); \
either_notest: \
BEGD(d0); \
d0 = (*_PREG)->y_u.Osblp.s; \
d0 = (*_PREG)->u.Osblp.s; \
BEGCHO(pt1); \
pt1 = (choiceptr) ((char *) YREG + (yslot) d0); \
choiceptr top_b = PROTECT_FROZEN_B(B); \
@ -892,7 +892,7 @@
pt1 = top_b; \
pt1 = (choiceptr)(((CELL *) pt1)-1); \
*(CELL **) pt1 = YREG; \
store_yaam_regs_for_either((*_PREG)->y_u.Osblp.l, (*_PREG)); \
store_yaam_regs_for_either((*_PREG)->u.Osblp.l, (*_PREG)); \
(*_SREG) = (CELL *) (B = pt1); \
SET_BB(pt1); \
ENDCHO(pt1); \
@ -909,7 +909,7 @@
ENDCACHE_Y_AS_ENV(); \
either_notest: \
BEGD(d0); \
d0 = (*_PREG)->y_u.Osblp.s; \
d0 = (*_PREG)->u.Osblp.s; \
BEGCHO(pt1); \
pt1 = (choiceptr) ((char *) YREG + (yslot) d0); \
choiceptr top_b = PROTECT_FROZEN_B(B); \
@ -917,7 +917,7 @@
pt1 = top_b; \
pt1 = (choiceptr)(((CELL *) pt1)-1); \
*(CELL **) pt1 = YREG; \
store_yaam_regs_for_either((*_PREG)->y_u.Osblp.l, (*_PREG)); \
store_yaam_regs_for_either((*_PREG)->u.Osblp.l, (*_PREG)); \
(*_SREG) = (CELL *) (B = pt1); \
SET_BB(pt1); \
ENDCHO(pt1); \
@ -935,14 +935,14 @@
ENDCACHE_Y_AS_ENV(); \
either_notest: \
BEGD(d0); \
d0 = (*_PREG)->y_u.Osblp.s; \
d0 = (*_PREG)->u.Osblp.s; \
BEGCHO(pt1); \
pt1 = (choiceptr) ((char *) YREG + (yslot) d0); \
if (pt1 > B) \
pt1 = B; \
pt1 = (choiceptr)(((CELL *) pt1)-1); \
*(CELL **) pt1 = YREG; \
store_yaam_regs_for_either((*_PREG)->y_u.Osblp.l, (*_PREG)); \
store_yaam_regs_for_either((*_PREG)->u.Osblp.l, (*_PREG)); \
(*_SREG) = (CELL *) (B = pt1); \
SET_BB(pt1); \
ENDCHO(pt1); \
@ -959,7 +959,7 @@
ENDCACHE_Y_AS_ENV(); \
either_notest: \
BEGD(d0); \
d0 = (*_PREG)->y_u.Osblp.s; \
d0 = (*_PREG)->u.Osblp.s; \
BEGCHO(pt1); \
pt1 = (choiceptr) ((char *) YREG + (yslot) d0); \
choiceptr top_b = PROTECT_FROZEN_B(B); \
@ -967,7 +967,7 @@
pt1 = top_b; \
pt1 = (choiceptr)(((CELL *) pt1)-1); \
*(CELL **) pt1 = YREG; \
store_yaam_regs_for_either((*_PREG)->y_u.Osblp.l, (*_PREG)); \
store_yaam_regs_for_either((*_PREG)->u.Osblp.l, (*_PREG)); \
(*_SREG) = (CELL *) (B = pt1); \
SET_BB(pt1); \
ENDCHO(pt1); \
@ -981,7 +981,7 @@
ENDCACHE_Y_AS_ENV(); \
either_notest: \
BEGD(d0); \
d0 = (*_PREG)->y_u.Osblp.s; \
d0 = (*_PREG)->u.Osblp.s; \
BEGCHO(pt1); \
pt1 = (choiceptr) ((char *) YREG + (yslot) d0); \
choiceptr top_b = PROTECT_FROZEN_B(B); \
@ -989,7 +989,7 @@
pt1 = top_b; \
pt1 = (choiceptr)(((CELL *) pt1)-1); \
*(CELL **) pt1 = YREG; \
store_yaam_regs_for_either((*_PREG)->y_u.Osblp.l, (*_PREG)); \
store_yaam_regs_for_either((*_PREG)->u.Osblp.l, (*_PREG)); \
(*_SREG) = (CELL *) (B = pt1); \
SET_BB(pt1); \
ENDCHO(pt1); \
@ -1004,14 +1004,14 @@
ENDCACHE_Y_AS_ENV(); \
either_notest: \
BEGD(d0); \
d0 = (*_PREG)->y_u.Osblp.s; \
d0 = (*_PREG)->u.Osblp.s; \
BEGCHO(pt1); \
pt1 = (choiceptr) ((char *) YREG + (yslot) d0); \
if (pt1 > B) \
pt1 = B; \
pt1 = (choiceptr)(((CELL *) pt1)-1); \
*(CELL **) pt1 = YREG; \
store_yaam_regs_for_either((*_PREG)->y_u.Osblp.l, (*_PREG)); \
store_yaam_regs_for_either((*_PREG)->u.Osblp.l, (*_PREG)); \
(*_SREG) = (CELL *) (B = pt1); \
SET_BB(pt1); \
ENDCHO(pt1); \
@ -1029,7 +1029,7 @@
low_level_trace(try_or, (PredEntry *)(*_PREG), NULL); \
} \
BEGD(d0); \
d0 = (*_PREG)->y_u.Osblp.s; \
d0 = (*_PREG)->u.Osblp.s; \
BEGCHO(pt1); \
pt1 = (choiceptr) ((char *) YREG + (yslot) d0); \
choiceptr top_b = PROTECT_FROZEN_B(B); \
@ -1037,7 +1037,7 @@
pt1 = top_b; \
pt1 = (choiceptr)(((CELL *) pt1)-1); \
*(CELL **) pt1 = YREG; \
store_yaam_regs_for_either((*_PREG)->y_u.Osblp.l, (*_PREG)); \
store_yaam_regs_for_either((*_PREG)->u.Osblp.l, (*_PREG)); \
(*_SREG) = (CELL *) (B = pt1); \
SET_BB(pt1); \
ENDCHO(pt1); \
@ -1050,7 +1050,7 @@
low_level_trace(try_or, (PredEntry *)(*_PREG), NULL); \
} \
BEGD(d0); \
d0 = (*_PREG)->y_u.Osblp.s; \
d0 = (*_PREG)->u.Osblp.s; \
BEGCHO(pt1); \
pt1 = (choiceptr) ((char *) YREG + (yslot) d0); \
choiceptr top_b = PROTECT_FROZEN_B(B); \
@ -1058,7 +1058,7 @@
pt1 = top_b; \
pt1 = (choiceptr)(((CELL *) pt1)-1); \
*(CELL **) pt1 = YREG; \
store_yaam_regs_for_either((*_PREG)->y_u.Osblp.l, (*_PREG)); \
store_yaam_regs_for_either((*_PREG)->u.Osblp.l, (*_PREG)); \
(*_SREG) = (CELL *) (B = pt1); \
SET_BB(pt1); \
ENDCHO(pt1); \
@ -1072,14 +1072,14 @@
low_level_trace(try_or, (PredEntry *)(*_PREG), NULL); \
} \
BEGD(d0); \
d0 = (*_PREG)->y_u.Osblp.s; \
d0 = (*_PREG)->u.Osblp.s; \
BEGCHO(pt1); \
pt1 = (choiceptr) ((char *) YREG + (yslot) d0); \
if (pt1 > B) \
pt1 = B; \
pt1 = (choiceptr)(((CELL *) pt1)-1); \
*(CELL **) pt1 = YREG; \
store_yaam_regs_for_either((*_PREG)->y_u.Osblp.l, (*_PREG)); \
store_yaam_regs_for_either((*_PREG)->u.Osblp.l, (*_PREG)); \
(*_SREG) = (CELL *) (B = pt1); \
SET_BB(pt1); \
ENDCHO(pt1); \
@ -1092,7 +1092,7 @@
#ifdef YAPOR_SBA
#define _either_instinit \
BEGD(d0); \
d0 = (*_PREG)->y_u.Osblp.s; \
d0 = (*_PREG)->u.Osblp.s; \
BEGCHO(pt1); \
pt1 = (choiceptr) ((char *) YREG + (yslot) d0); \
choiceptr top_b = PROTECT_FROZEN_B(B); \
@ -1100,7 +1100,7 @@
pt1 = top_b; \
pt1 = (choiceptr)(((CELL *) pt1)-1); \
*(CELL **) pt1 = YREG; \
store_yaam_regs_for_either((*_PREG)->y_u.Osblp.l, (*_PREG)); \
store_yaam_regs_for_either((*_PREG)->u.Osblp.l, (*_PREG)); \
(*_SREG) = (CELL *) (B = pt1); \
SET_BB(pt1); \
ENDCHO(pt1); \
@ -1110,7 +1110,7 @@
#else /* YAPOR_SBA */
#define _either_instinit \
BEGD(d0); \
d0 = (*_PREG)->y_u.Osblp.s; \
d0 = (*_PREG)->u.Osblp.s; \
BEGCHO(pt1); \
pt1 = (choiceptr) ((char *) YREG + (yslot) d0); \
choiceptr top_b = PROTECT_FROZEN_B(B); \
@ -1118,7 +1118,7 @@
pt1 = top_b; \
pt1 = (choiceptr)(((CELL *) pt1)-1); \
*(CELL **) pt1 = YREG; \
store_yaam_regs_for_either((*_PREG)->y_u.Osblp.l, (*_PREG)); \
store_yaam_regs_for_either((*_PREG)->u.Osblp.l, (*_PREG)); \
(*_SREG) = (CELL *) (B = pt1); \
SET_BB(pt1); \
ENDCHO(pt1); \
@ -1129,14 +1129,14 @@
#else /* FROZEN_STACKS */
#define _either_instinit \
BEGD(d0); \
d0 = (*_PREG)->y_u.Osblp.s; \
d0 = (*_PREG)->u.Osblp.s; \
BEGCHO(pt1); \
pt1 = (choiceptr) ((char *) YREG + (yslot) d0); \
if (pt1 > B) \
pt1 = B; \
pt1 = (choiceptr)(((CELL *) pt1)-1); \
*(CELL **) pt1 = YREG; \
store_yaam_regs_for_either((*_PREG)->y_u.Osblp.l, (*_PREG)); \
store_yaam_regs_for_either((*_PREG)->u.Osblp.l, (*_PREG)); \
(*_SREG) = (CELL *) (B = pt1); \
SET_BB(pt1); \
ENDCHO(pt1); \
@ -1149,7 +1149,7 @@
#endif /* YAPOR */
#define OR_ELSE_INSTINIT \
HR = HBREG = PROTECT_FROZEN_H(B); \
HR = HRBREG = PROTECT_FROZEN_H(B); \
ENV = B->cp_env; \
B->cp_cp = (*_PREG);
@ -1163,11 +1163,11 @@
#ifdef YAPOR
#define OR_ELSE_YAPOR \
SCH_new_alternative((*_PREG), (*_PREG)->y_u.Osblp.l);
SCH_new_alternative((*_PREG), (*_PREG)->u.Osblp.l);
#endif
#define OR_ELSE_END \
B->cp_ap = (*_PREG)->y_u.Osblp.l; \
B->cp_ap = (*_PREG)->u.Osblp.l; \
(*_PREG) = NEXTOP((*_PREG), Osblp); \
YREG = (CELL *) B->cp_a1; \
GONext();
@ -1178,7 +1178,7 @@
#ifdef YAPOR
#define OR_LAST_IFOK_INIT \
HR = HBREG = PROTECT_FROZEN_H(pt0); \
H = HRBREG = PROTECT_FROZEN_H(pt0); \
YREG = (CELL *) pt0->cp_a1; \
ENV = pt0->cp_env;
@ -1193,7 +1193,7 @@
#define OR_LAST_NOIF_INIT \
B = pt0->cp_b; \
HR = PROTECT_FROZEN_H(pt0); \
H = PROTECT_FROZEN_H(pt0); \
YREG = (CELL *) pt0->cp_a1; \
ENV = pt0->cp_env;
@ -1346,7 +1346,7 @@
JMPNext();
#define EXPAND_CLAUSES_INSTINIT \
PredEntry *pe = (*_PREG)->y_u.sssllp.p; \
PredEntry *pe = (*_PREG)->u.sssllp.p; \
yamop *pt0; \
SET_ASP(YREG, E_CB*sizeof(CELL));
@ -1400,7 +1400,7 @@
} \
else { \
HR[d0 + 2] = AbsAppl(HR); \
*HR = (CELL) pe->FunctorOfPred; \
*H = (CELL) pe->FunctorOfPred; \
HR++; \
pt1 = XREGS + 1; \
for (; d0 > 0; --d0) { \
@ -1412,14 +1412,14 @@
(pt0) = (CELL *)(d1); \
(d1) = *(CELL *)(d1); \
if(!IsVarTerm(d1)) { \
*HR++ = d1; \
*H++ = d1; \
setHwithd1 = 1; \
break; \
} \
} \
if (setHwithd1) { continue; } \
if (pt0 <= HR) { \
*HR++ = (CELL)pt0; \
*H++ = (CELL)pt0; \
} else { \
d1 = Unsigned(HR); \
RESET_VARIABLE(HR); \
@ -1428,7 +1428,7 @@
} \
} \
else { \
*HR++ = d1; \
*H++ = d1; \
} \
} \
} \
@ -1463,7 +1463,7 @@
} \
else { \
HR[d0 + 2] = AbsAppl(HR); \
*HR = (CELL) pe->FunctorOfPred; \
*H = (CELL) pe->FunctorOfPred; \
HR++; \
pt1 = XREGS + 1; \
for (; d0 > 0; --d0) { \
@ -1475,14 +1475,14 @@
(pt0) = (CELL *)(d1); \
(d1) = *(CELL *)(d1); \
if(!IsVarTerm(d1)) { \
*HR++ = d1; \
*H++ = d1; \
setHwithd1 = 1; \
break; \
} \
} \
if (setHwithd1) { continue; } \
if (pt0 <= HR) { \
*HR++ = (CELL)pt0; \
*H++ = (CELL)pt0; \
} else { \
d1 = Unsigned(HR); \
RESET_VARIABLE(HR); \
@ -1491,7 +1491,7 @@
} \
} \
else { \
*HR++ = d1; \
*H++ = d1; \
} \
} \
} \
@ -1525,7 +1525,7 @@
} \
else { \
HR[d0 + 2] = AbsAppl(HR); \
*HR = (CELL) pe->FunctorOfPred; \
*H = (CELL) pe->FunctorOfPred; \
HR++; \
pt1 = XREGS + 1; \
for (; d0 > 0; --d0) { \
@ -1537,14 +1537,14 @@
(pt0) = (CELL *)(d1); \
(d1) = *(CELL *)(d1); \
if(!IsVarTerm(d1)) { \
*HR++ = d1; \
*H++ = d1; \
setHwithd1 = 1; \
break; \
} \
} \
if (setHwithd1) { continue; } \
if (pt0 <= HR) { \
*HR++ = (CELL)pt0; \
*H++ = (CELL)pt0; \
} else { \
d1 = Unsigned(HR); \
RESET_VARIABLE(HR); \
@ -1553,7 +1553,7 @@
} \
} \
else { \
*HR++ = d1; \
*H++ = d1; \
} \
} \
} \
@ -1588,7 +1588,7 @@
} \
else { \
HR[d0 + 2] = AbsAppl(HR); \
*HR = (CELL) pe->FunctorOfPred; \
*H = (CELL) pe->FunctorOfPred; \
HR++; \
pt1 = XREGS + 1; \
for (; d0 > 0; --d0) { \
@ -1600,14 +1600,14 @@
(pt0) = (CELL *)(d1); \
(d1) = *(CELL *)(d1); \
if(!IsVarTerm(d1)) { \
*HR++ = d1; \
*H++ = d1; \
setHwithd1 = 1; \
break; \
} \
} \
if (setHwithd1) { continue; } \
if (pt0 <= HR) { \
*HR++ = (CELL)pt0; \
*H++ = (CELL)pt0; \
} else { \
d1 = Unsigned(HR); \
RESET_VARIABLE(HR); \
@ -1616,7 +1616,7 @@
} \
} \
else { \
*HR++ = d1; \
*H++ = d1; \
} \
} \
} \
@ -1697,7 +1697,7 @@
HR[1] = MkAtomTerm((Atom)(pe->FunctorOfPred));
#define SPY_PRED_D0ISNOZERO_INIT \
*HR = (CELL) pe->FunctorOfPred; \
*H = (CELL) pe->FunctorOfPred; \
HR[d0 + 2] = AbsAppl(HR); \
HR++; \
pt1 = XREGS + 1;
@ -1707,10 +1707,10 @@
d1 = *pt0;
#define SPY_PRED_D0ISNOZERO_INSIDEFOR_DOSPY_NONVAR \
*HR++ = d1;
*H++ = d1;
#define SPY_PRED_D0ISNOZERO_INSIDEFOR_SAFEVAR \
*HR++ = (CELL)pt0;
*H++ = (CELL)pt0;
#define SPY_PRED_D0ISNOZERO_INSIDEFOR_UNSAFEVAR \
d1 = Unsigned(HR); \
@ -1719,7 +1719,7 @@
Bind_Local(pt0, d1);
#define SPY_PRED_POST_IFS \
HR[0] = Yap_Module_Name(pe); \
H[0] = Yap_Module_Name(pe); \
ARG1 = (Term) AbsPair(HR); \
HR += 2; \
PredEntry *pt0;

View File

@ -1,7 +1,7 @@
#define POP_N_INIT \
BLOCKADDRESS = (CELL)(*_PREG); \
register CELL d0; \
d0 = (*_PREG)->y_u.os.s; \
d0 = (*_PREG)->u.os.s; \
SP = (CELL *) (((char *) SP) + d0); \
d0 = SP[0]; \
if (d0) { \

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +1,9 @@
#define _put_x_var_instinit \
register CELL *pt0; \
pt0 = HR; \
XREG((*_PREG)->y_u.xx.xl) = Unsigned(pt0); \
XREG((*_PREG)->u.xx.xl) = Unsigned(pt0); \
HR = pt0 + 1; \
XREG((*_PREG)->y_u.xx.xr) = Unsigned(pt0); \
XREG((*_PREG)->u.xx.xr) = Unsigned(pt0); \
(*_PREG) = NEXTOP((*_PREG), xx); \
RESET_VARIABLE(pt0); \
GONEXT();
@ -11,8 +11,8 @@
#if defined(YAPOR_SBA) && defined(FROZEN_STACKS)
#define _put_y_var_instinit \
register CELL *pt0; \
pt0 = YREG + (*_PREG)->y_u.yx.y; \
XREG((*_PREG)->y_u.yx.x) = (CELL) pt0; \
pt0 = YREG + (*_PREG)->u.yx.y; \
XREG((*_PREG)->u.yx.x) = (CELL) pt0; \
(*_PREG) = NEXTOP((*_PREG), yx); \
if (Unsigned((Int)(pt0)-(Int)(H_FZ)) > \
Unsigned((Int)(B_FZ)-(Int)(H_FZ))) { \
@ -23,8 +23,8 @@
#else /* defined(YAPOR_SBA) && defined(FROZEN_STACKS) */
#define _put_y_var_instinit \
register CELL *pt0; \
pt0 = YREG + (*_PREG)->y_u.yx.y; \
XREG((*_PREG)->y_u.yx.x) = (CELL) pt0; \
pt0 = YREG + (*_PREG)->u.yx.y; \
XREG((*_PREG)->u.yx.x) = (CELL) pt0; \
(*_PREG) = NEXTOP((*_PREG), yx); \
INITIALIZE_PERMVAR(pt0, (CELL)pt0); \
GONEXT();
@ -32,35 +32,35 @@
#define _put_x_val_instinit \
register CELL d0; \
d0 = XREG((*_PREG)->y_u.xx.xl); \
XREG((*_PREG)->y_u.xx.xr) = d0; \
d0 = XREG((*_PREG)->u.xx.xl); \
XREG((*_PREG)->u.xx.xr) = d0; \
(*_PREG) = NEXTOP((*_PREG), xx); \
GONEXT();
#define _put_xx_val_instinit \
register CELL d0, d1; \
d0 = XREG((*_PREG)->y_u.xxxx.xl1); \
d1 = XREG((*_PREG)->y_u.xxxx.xl2); \
XREG((*_PREG)->y_u.xxxx.xr1) = d0; \
XREG((*_PREG)->y_u.xxxx.xr2) = d1; \
d0 = XREG((*_PREG)->u.xxxx.xl1); \
d1 = XREG((*_PREG)->u.xxxx.xl2); \
XREG((*_PREG)->u.xxxx.xr1) = d0; \
XREG((*_PREG)->u.xxxx.xr2) = d1; \
(*_PREG) = NEXTOP((*_PREG), xxxx); \
GONEXT();
#ifdef YAPOR_SBA
#define _put_y_val_instinit \
register CELL d0; \
d0 = YREG[(*_PREG)->y_u.yx.y]; \
d0 = YREG[(*_PREG)->u.yx.y]; \
if (d0 == 0) { \
XREG((*_PREG)->y_u.yx.x) = (CELL)(YREG+(*_PREG)->y_u.yx.y); \
XREG((*_PREG)->u.yx.x) = (CELL)(YREG+(*_PREG)->u.yx.y); \
} else \
XREG((*_PREG)->y_u.yx.x) = d0; \
XREG((*_PREG)->u.yx.x) = d0; \
(*_PREG) = NEXTOP((*_PREG), yx); \
GONEXT();
#else /* YAPOR_SBA */
#define _put_y_val_instinit \
register CELL d0; \
d0 = YREG[(*_PREG)->y_u.yx.y]; \
XREG((*_PREG)->y_u.yx.x) = d0; \
d0 = YREG[(*_PREG)->u.yx.y]; \
XREG((*_PREG)->u.yx.x) = d0; \
(*_PREG) = NEXTOP((*_PREG), yx); \
GONEXT();
#endif /* YAPOR_SBA */
@ -68,51 +68,51 @@
#ifdef YAPOR_SBA
#define _put_y_vals_instinit \
register CELL d0, d1; \
d0 = YREG[(*_PREG)->y_u.yyxx.y1]; \
d0 = YREG[(*_PREG)->u.yyxx.y1]; \
if (d0 == 0) \
XREG((*_PREG)->y_u.yyxx.x1) = (CELL)(YREG+(*_PREG)->y_u.yyxx.y1); \
XREG((*_PREG)->u.yyxx.x1) = (CELL)(YREG+(*_PREG)->u.yyxx.y1); \
else \
XREG((*_PREG)->y_u.yyxx.x1) = d0; \
XREG((*_PREG)->u.yyxx.x1) = d0; \
(*_PREG) = NEXTOP((*_PREG), yyxx); \
d1 = YREG[PREVOP((*_PREG),yyxx)->y_u.yyxx.y2]; \
d1 = YREG[PREVOP((*_PREG),yyxx)->u.yyxx.y2]; \
if (d1 == 0) \
XREG(PREVOP((*_PREG)->y_u.yyxx,yyxx).x2) = (CELL)(YREG+(*_PREG)->y_u.yyxx.y2); \
XREG(PREVOP((*_PREG)->u.yyxx,yyxx).x2) = (CELL)(YREG+(*_PREG)->u.yyxx.y2); \
else \
XREG(PREVOP((*_PREG),yyxx)->y_u.yyxx.x2) = d1; \
XREG(PREVOP((*_PREG),yyxx)->u.yyxx.x2) = d1; \
GONEXT();
#else /* YAPOR_SBA */
#define _put_y_vals_instinit \
register CELL d0, d1; \
d0 = YREG[(*_PREG)->y_u.yyxx.y1]; \
XREG((*_PREG)->y_u.yyxx.x1) = d0; \
d0 = YREG[(*_PREG)->u.yyxx.y1]; \
XREG((*_PREG)->u.yyxx.x1) = d0; \
(*_PREG) = NEXTOP((*_PREG), yyxx); \
d1 = YREG[PREVOP((*_PREG),yyxx)->y_u.yyxx.y2]; \
XREG(PREVOP((*_PREG),yyxx)->y_u.yyxx.x2) = d1; \
d1 = YREG[PREVOP((*_PREG),yyxx)->u.yyxx.y2]; \
XREG(PREVOP((*_PREG),yyxx)->u.yyxx.x2) = d1; \
GONEXT();
#endif /* YAPOR_SBA */
#define _put_unsafe_instinit \
BEGD(d0); \
BEGP(pt0); \
pt0 = YREG+(*_PREG)->y_u.yx.y; \
pt0 = YREG+(*_PREG)->u.yx.y; \
d0 = *pt0; \
deref_head(d0, punsafe_unk); \
punsafe_nonvar: \
XREG((*_PREG)->y_u.yx.x) = d0; \
XREG((*_PREG)->u.yx.x) = d0; \
(*_PREG) = NEXTOP((*_PREG), yx); \
GONEXT(); \
\
derefa_body(d0, pt0, punsafe_unk, punsafe_nonvar); \
if (pt0 <= HR || pt0 >= YREG) { \
XREG((*_PREG)->y_u.yx.x) = Unsigned(pt0); \
XREG((*_PREG)->u.yx.x) = Unsigned(pt0); \
(*_PREG) = NEXTOP((*_PREG), yx); \
GONEXT(); \
} \
else { \
Bind_Local(pt0, Unsigned(HR)); \
XREG((*_PREG)->y_u.yx.x) = (CELL) HR; \
XREG((*_PREG)->u.yx.x) = (CELL) HR; \
RESET_VARIABLE(HR); \
HR++; \
H++; \
(*_PREG) = NEXTOP((*_PREG), yx); \
GONEXT(); \
} \
@ -121,36 +121,36 @@
#define _put_atom_instinit \
register CELL d0; \
d0 = (*_PREG)->y_u.xc.c; \
XREG((*_PREG)->y_u.xc.x) = d0; \
d0 = (*_PREG)->u.xc.c; \
XREG((*_PREG)->u.xc.x) = d0; \
(*_PREG) = NEXTOP((*_PREG), xc); \
GONEXT();
#define PUT_DBTERM_INSTINIT \
register CELL d0; \
d0 = (*_PREG)->y_u.xD.D; \
XREG((*_PREG)->y_u.xD.x) = d0; \
d0 = (*_PREG)->u.xD.D; \
XREG((*_PREG)->u.xD.x) = d0; \
(*_PREG) = NEXTOP((*_PREG), xD); \
GONext();
#define PUT_BIGINT_INSTINIT \
register CELL d0; \
d0 = (*_PREG)->y_u.xN.b; \
XREG((*_PREG)->y_u.xN.x) = d0; \
d0 = (*_PREG)->u.xN.b; \
XREG((*_PREG)->u.xN.x) = d0; \
(*_PREG) = NEXTOP((*_PREG), xN); \
GONext();
#define _put_float_instinit \
register CELL d0; \
d0 = AbsAppl((*_PREG)->y_u.xd.d); \
XREG((*_PREG)->y_u.xd.x) = d0; \
d0 = AbsAppl((*_PREG)->u.xd.d); \
XREG((*_PREG)->u.xd.x) = d0; \
(*_PREG) = NEXTOP((*_PREG), xd); \
GONEXT();
#define PUT_LONGINT_INSTINIT \
register CELL d0; \
d0 = AbsAppl((*_PREG)->y_u.xi.i); \
XREG((*_PREG)->y_u.xi.x) = d0; \
d0 = AbsAppl((*_PREG)->u.xi.i); \
XREG((*_PREG)->u.xi.x) = d0; \
(*_PREG) = NEXTOP((*_PREG), xi); \
GONext();
@ -161,7 +161,7 @@
S_SREG = HR; \
HR += 2; \
d0 = AbsPair(S_SREG); \
XREG((*_PREG)->y_u.x.x) = d0; \
XREG((*_PREG)->u.x.x) = d0; \
(*_PREG) = NEXTOP((*_PREG), x); \
WRITEBACK_S(S_SREG); \
ENDCACHE_S(); \
@ -170,11 +170,11 @@
#define _put_struct_instinit \
register CELL d0; \
d0 = AbsAppl(HR); \
XREG((*_PREG)->y_u.xfa.x) = d0; \
d0 = (CELL) ((*_PREG)->y_u.xfa.f); \
*HR++ = d0; \
XREG((*_PREG)->u.xfa.x) = d0; \
d0 = (CELL) ((*_PREG)->u.xfa.f); \
*H++ = d0; \
(*_SREG) = HR; \
HR += (*_PREG)->y_u.xfa.a; \
HR += (*_PREG)->u.xfa.a; \
(*_PREG) = NEXTOP((*_PREG), xfa); \
GONEXT();

View File

@ -8,7 +8,7 @@
d0 = (CELL)S_SREG; \
} \
WRITEBACK_S(S_SREG+1); \
XREG((*_PREG)->y_u.ox.x) = d0; \
XREG((*_PREG)->u.ox.x) = d0; \
(*_PREG) = NEXTOP((*_PREG), ox); \
GONEXT(); \
ENDD(d0); \
@ -20,7 +20,7 @@
BEGD(d0); \
d0 = *S_SREG; \
WRITEBACK_S(S_SREG+1); \
XREG((*_PREG)->y_u.ox.x) = d0; \
XREG((*_PREG)->u.ox.x) = d0; \
(*_PREG) = NEXTOP((*_PREG), ox); \
GONEXT(); \
ENDD(d0); \
@ -31,7 +31,7 @@
register CELL *pt0; \
CACHE_S(); \
READ_IN_S(); \
pt0 = &XREG((*_PREG)->y_u.ox.x); \
pt0 = &XREG((*_PREG)->u.ox.x); \
(*_PREG) = NEXTOP((*_PREG), ox); \
RESET_VARIABLE(S_SREG); \
*pt0 = (CELL) S_SREG; \
@ -44,7 +44,7 @@
BEGP(pt0); \
BEGD(d0); \
d0 = SREG[0]; \
pt0 = &XREG((*_PREG)->y_u.ox.x); \
pt0 = &XREG((*_PREG)->u.ox.x); \
(*_PREG) = NEXTOP((*_PREG), ox); \
if (d0 == 0) { \
d0 = (CELL)SREG; \
@ -58,7 +58,7 @@
BEGP(pt0); \
BEGD(d0); \
d0 = (*_SREG)[0]; \
pt0 = &XREG((*_PREG)->y_u.ox.x); \
pt0 = &XREG((*_PREG)->u.ox.x); \
(*_PREG) = NEXTOP((*_PREG), ox); \
*pt0 = d0; \
GONEXT(); \
@ -70,7 +70,7 @@
register CELL *pt0; \
CACHE_S(); \
READ_IN_S(); \
pt0 = &XREG((*_PREG)->y_u.ox.x); \
pt0 = &XREG((*_PREG)->u.ox.x); \
(*_PREG) = NEXTOP((*_PREG), ox); \
RESET_VARIABLE(S_SREG); \
*pt0 = (CELL)S_SREG; \
@ -82,7 +82,7 @@
CACHE_S(); \
READ_IN_S(); \
BEGP(pt0); \
pt0 = &XREG((*_PREG)->y_u.oxx.xr); \
pt0 = &XREG((*_PREG)->u.oxx.xr); \
BEGD(d0); \
d0 = S_SREG[0]; \
BEGD(d1); \
@ -94,7 +94,7 @@
d1 = (CELL)(S_SREG+1); \
} \
WRITEBACK_S(S_SREG+2); \
XREG((*_PREG)->y_u.oxx.xl) = d0; \
XREG((*_PREG)->u.oxx.xl) = d0; \
(*_PREG) = NEXTOP((*_PREG), oxx); \
*pt0 = d1; \
ENDD(d0); \
@ -107,13 +107,13 @@
CACHE_S(); \
READ_IN_S(); \
BEGP(pt0); \
pt0 = &XREG((*_PREG)->y_u.oxx.xr); \
pt0 = &XREG((*_PREG)->u.oxx.xr); \
BEGD(d0); \
d0 = S_SREG[0]; \
BEGD(d1); \
d1 = S_SREG[1]; \
WRITEBACK_S(S_SREG+2); \
XREG((*_PREG)->y_u.oxx.xl) = d0; \
XREG((*_PREG)->u.oxx.xl) = d0; \
(*_PREG) = NEXTOP((*_PREG), oxx); \
*pt0 = d1; \
ENDD(d0); \
@ -127,9 +127,9 @@
register CELL *pt0; \
CACHE_S(); \
READ_IN_S(); \
pt0 = &XREG((*_PREG)->y_u.oxx.xr); \
pt0 = &XREG((*_PREG)->u.oxx.xr); \
RESET_VARIABLE(S_SREG); \
XREG((*_PREG)->y_u.oxx.xl) = (CELL) S_SREG; \
XREG((*_PREG)->u.oxx.xl) = (CELL) S_SREG; \
S_SREG++; \
(*_PREG) = NEXTOP((*_PREG), oxx); \
RESET_VARIABLE(S_SREG); \
@ -144,13 +144,13 @@
register CELL *pt0; \
CACHE_S(); \
READ_IN_S(); \
pt0 = &XREG((*_PREG)->y_u.oxx.xr); \
pt0 = &XREG((*_PREG)->u.oxx.xr); \
d0 = S_SREG[0]; \
d1 = S_SREG[1]; \
if (d0 == 0) \
XREG((*_PREG)->y_u.oxx.xl) = (CELL)S_SREG; \
XREG((*_PREG)->u.oxx.xl) = (CELL)S_SREG; \
else \
XREG((*_PREG)->y_u.oxx.xl) = d0; \
XREG((*_PREG)->u.oxx.xl) = d0; \
(*_PREG) = NEXTOP((*_PREG), oxx); \
if (d1 == 0) \
*pt0 = (CELL)(S_SREG+1); \
@ -164,11 +164,11 @@
register CELL *pt0; \
CACHE_S(); \
READ_IN_S(); \
pt0 = &XREG((*_PREG)->y_u.oxx.xr); \
pt0 = &XREG((*_PREG)->u.oxx.xr); \
d0 = S_SREG[0]; \
d1 = S_SREG[1]; \
{ \
XREG((*_PREG)->y_u.oxx.xl) = d0; \
XREG((*_PREG)->u.oxx.xl) = d0; \
} \
(*_PREG) = NEXTOP((*_PREG), oxx); \
{ \
@ -182,8 +182,8 @@
register CELL *pt0; \
CACHE_S(); \
READ_IN_S(); \
pt0 = &XREG((*_PREG)->y_u.oxx.xr); \
XREG((*_PREG)->y_u.oxx.xl) = (CELL) S_SREG; \
pt0 = &XREG((*_PREG)->u.oxx.xr); \
XREG((*_PREG)->u.oxx.xl) = (CELL) S_SREG; \
RESET_VARIABLE(S_SREG); \
S_SREG++; \
*pt0 = (CELL) S_SREG; \
@ -197,7 +197,7 @@
register CELL d0; \
d0 = *(*_SREG)++; \
if (d0 == 0) { \
INITIALIZE_PERMVAR(YREG+(*_PREG)->y_u.oy.y,(CELL)((*_SREG)-1)); \
INITIALIZE_PERMVAR(YREG+(*_PREG)->u.oy.y,(CELL)((*_SREG)-1)); \
} else \
(*_PREG) = NEXTOP((*_PREG), oy); \
GONEXT();
@ -205,7 +205,7 @@
#define _unify_y_var_instinit \
register CELL d0; \
d0 = *(*_SREG)++; \
INITIALIZE_PERMVAR(YREG+(*_PREG)->y_u.oy.y,d0); \
INITIALIZE_PERMVAR(YREG+(*_PREG)->u.oy.y,d0); \
(*_PREG) = NEXTOP((*_PREG), oy); \
GONEXT();
#endif /* YAPOR_SBA */
@ -213,7 +213,7 @@
#define _unify_y_var_write_instinit \
CACHE_S(); \
READ_IN_S(); \
INITIALIZE_PERMVAR(YREG+(*_PREG)->y_u.oy.y,(CELL) S_SREG); \
INITIALIZE_PERMVAR(YREG+(*_PREG)->u.oy.y,(CELL) S_SREG); \
(*_PREG) = NEXTOP((*_PREG), oy); \
RESET_VARIABLE(S_SREG); \
WRITEBACK_S(S_SREG+1); \
@ -225,7 +225,7 @@
register CELL d0; \
d0 = (*_SREG)[0]; \
if (d0 == 0) { \
INITIALIZE_PERMVAR(YREG+(*_PREG)->y_u.oy.y,(CELL)(*_SREG)); \
INITIALIZE_PERMVAR(YREG+(*_PREG)->u.oy.y,(CELL)(*_SREG)); \
} else \
(*_PREG) = NEXTOP((*_PREG), oy); \
GONEXT();
@ -233,7 +233,7 @@
#define _unify_l_y_var_instinit \
register CELL d0; \
d0 = (*_SREG)[0]; \
INITIALIZE_PERMVAR(YREG+(*_PREG)->y_u.oy.y,d0); \
INITIALIZE_PERMVAR(YREG+(*_PREG)->u.oy.y,d0); \
(*_PREG) = NEXTOP((*_PREG), oy); \
GONEXT();
#endif /* YAPOR_SBA */
@ -241,7 +241,7 @@
#define _unify_l_y_var_write_instinit \
CACHE_S(); \
READ_IN_S(); \
INITIALIZE_PERMVAR(YREG+(*_PREG)->y_u.oy.y,(CELL) S_SREG); \
INITIALIZE_PERMVAR(YREG+(*_PREG)->u.oy.y,(CELL) S_SREG); \
(*_PREG) = NEXTOP((*_PREG), oy); \
RESET_VARIABLE(S_SREG); \
ENDCACHE_S(); \
@ -256,7 +256,7 @@
deref_head(d0, uvalx_unk); \
\
uvalx_nonvar: \
d1 = XREG((*_PREG)->y_u.ox.x); \
d1 = XREG((*_PREG)->u.ox.x); \
deref_head(d1, uvalx_nonvar_unk); \
\
uvalx_nonvar_nonvar: \
@ -273,7 +273,7 @@
ENDP(pt1); \
\
derefa_body(d0, pt0, uvalx_unk, uvalx_nonvar); \
d1 = XREG((*_PREG)->y_u.ox.x); \
d1 = XREG((*_PREG)->u.ox.x); \
deref_head(d1, uvalx_var_unk); \
\
uvalx_var_nonvar: \
@ -294,7 +294,7 @@
ENDD(d0);
#define _unify_x_val_write_instinit \
*(*_SREG)++ = XREG((*_PREG)->y_u.ox.x); \
*(*_SREG)++ = XREG((*_PREG)->u.ox.x); \
(*_PREG) = NEXTOP((*_PREG), ox); \
GONEXTW();
@ -307,7 +307,7 @@
deref_head(d0, ulvalx_unk); \
\
ulvalx_nonvar: \
d1 = XREG((*_PREG)->y_u.ox.x); \
d1 = XREG((*_PREG)->u.ox.x); \
deref_head(d1, ulvalx_nonvar_unk); \
\
ulvalx_nonvar_nonvar: \
@ -322,7 +322,7 @@
ENDP(pt1); \
\
derefa_body(d0, pt0, ulvalx_unk, ulvalx_nonvar); \
d1 = XREG((*_PREG)->y_u.ox.x); \
d1 = XREG((*_PREG)->u.ox.x); \
deref_head(d1, ulvalx_var_unk); \
\
ulvalx_var_nonvar: \
@ -341,7 +341,7 @@
ENDD(d0);
#define _unify_l_x_val_write_instinit \
(*_SREG)[0] = XREG((*_PREG)->y_u.ox.x); \
(*_SREG)[0] = XREG((*_PREG)->u.ox.x); \
(*_PREG) = NEXTOP((*_PREG), ox); \
GONEXT();
@ -352,7 +352,7 @@
d0 = *pt0;
#define UNIFY_Y_VAL_UVALY_NONVAR \
pt1 = YREG+(*_PREG)->y_u.oy.y; \
pt1 = YREG+(*_PREG)->u.oy.y; \
d1 = *pt1;
#define UNIFY_Y_VAL_UVALY_NONVAR_NONVAR \
@ -368,7 +368,7 @@
GONext();
#define UNIFY_Y_VAL_UVALY_UNK \
pt1 = YREG+(*_PREG)->y_u.oy.y; \
pt1 = YREG+(*_PREG)->u.oy.y; \
d1 = *pt1;
#define UNIFY_Y_VAL_UVALY_VAR_NONVAR \
@ -386,9 +386,9 @@
#ifdef YAPOR_SBA
#define UNIFY_Y_VAL_WRITE_INSTINIT \
register CELL d0; \
d0 = YREG[(*_PREG)->y_u.oy.y]; \
d0 = YREG[(*_PREG)->u.oy.y]; \
if (d0 == 0) \
*(*_SREG)++ = (CELL)(YREG+(*_PREG)->y_u.oy.y); \
*(*_SREG)++ = (CELL)(YREG+(*_PREG)->u.oy.y); \
else \
*(*_SREG)++ = d0; \
(*_PREG) = NEXTOP((*_PREG), oy); \
@ -396,7 +396,7 @@
#else /* YAPOR_SBA */
#define UNIFY_Y_VAL_WRITE_INSTINIT \
register CELL d0; \
d0 = YREG[(*_PREG)->y_u.oy.y]; \
d0 = YREG[(*_PREG)->u.oy.y]; \
*(*_SREG)++ = d0; \
(*_PREG) = NEXTOP((*_PREG), oy); \
GONextW();
@ -409,7 +409,7 @@
d0 = *pt0;
#define UNIFY_L_Y_VAL_ULVALY_NONVAR \
pt1 = YREG+(*_PREG)->y_u.oy.y; \
pt1 = YREG+(*_PREG)->u.oy.y; \
d1 = *pt1;
#define UNIFY_L_Y_VAL_ULVALY_NONVAR_NONVAR \
@ -423,7 +423,7 @@
GONext();
#define UNIFY_L_Y_VAL_ULVALY_UNK \
pt1 = YREG+(*_PREG)->y_u.oy.y; \
pt1 = YREG+(*_PREG)->u.oy.y; \
d1 = *pt1;
#define UNIFY_L_Y_VAL_ULVALY_VAR_NONVAR \
@ -439,9 +439,9 @@
#ifdef YAPOR_SBA
#define UNIFY_L_Y_VAL_WRITE_INSTINIT \
register CELL d0; \
d0 = YREG[(*_PREG)->y_u.oy.y]; \
d0 = YREG[(*_PREG)->u.oy.y]; \
if (d0 == 0) \
(*_SREG)[0] = (CELL)(YREG+(*_PREG)->y_u.oy.y); \
(*_SREG)[0] = (CELL)(YREG+(*_PREG)->u.oy.y); \
else \
(*_SREG)[0] = d0; \
(*_PREG) = NEXTOP((*_PREG), oy); \
@ -449,7 +449,7 @@
#else /* YAPOR_SBA */
#define UNIFY_L_Y_VAL_WRITE_INSTINIT \
register CELL d0; \
d0 = YREG[(*_PREG)->y_u.oy.y]; \
d0 = YREG[(*_PREG)->u.oy.y]; \
(*_SREG)[0] = d0; \
(*_PREG) = NEXTOP((*_PREG), oy); \
GONext();
@ -464,7 +464,7 @@
deref_head(d0, uvalx_loc_unk); \
\
uvalx_loc_nonvar: \
d1 = XREG((*_PREG)->y_u.ox.x); \
d1 = XREG((*_PREG)->u.ox.x); \
deref_head(d1, uvalx_loc_nonvar_unk); \
\
uvalx_loc_nonvar_nonvar: \
@ -481,7 +481,7 @@
ENDP(pt1); \
\
derefa_body(d0, pt0, uvalx_loc_unk, uvalx_loc_nonvar); \
d1 = XREG((*_PREG)->y_u.ox.x); \
d1 = XREG((*_PREG)->u.ox.x); \
deref_head(d1, uvalx_loc_var_unk); \
\
uvalx_loc_var_nonvar: \
@ -503,7 +503,7 @@
#define _unify_x_loc_write_instinit \
BEGD(d0); \
d0 = XREG((*_PREG)->y_u.ox.x); \
d0 = XREG((*_PREG)->u.ox.x); \
deref_head(d0, unify_x_loc_unk); \
unify_x_loc_nonvar: \
*(*_SREG)++ = d0; \
@ -538,7 +538,7 @@
deref_head(d0, ulvalx_loc_unk); \
\
ulvalx_loc_nonvar: \
d1 = XREG((*_PREG)->y_u.ox.x); \
d1 = XREG((*_PREG)->u.ox.x); \
deref_head(d1, ulvalx_loc_nonvar_unk); \
\
ulvalx_loc_nonvar_nonvar: \
@ -551,7 +551,7 @@
GONEXT(); \
\
derefa_body(d0, pt0, ulvalx_loc_unk, ulvalx_loc_nonvar); \
d1 = XREG((*_PREG)->y_u.ox.x); \
d1 = XREG((*_PREG)->u.ox.x); \
deref_head(d1, ulvalx_loc_var_unk); \
\
ulvalx_loc_var_nonvar: \
@ -571,7 +571,7 @@
#define _unify_l_x_loc_write_instinit \
BEGD(d0); \
d0 = XREG((*_PREG)->y_u.ox.x); \
d0 = XREG((*_PREG)->u.ox.x); \
deref_head(d0, ulnify_x_loc_unk); \
ulnify_x_loc_nonvar: \
(*_SREG)[0] = d0; \
@ -600,7 +600,7 @@
d0 = *pt0;
#define UNIFY_Y_LOC_UVALY_LOC_NONVAR \
pt1 = YREG+(*_PREG)->y_u.oy.y; \
pt1 = YREG+(*_PREG)->u.oy.y; \
d1 = *pt1;
#define UNIFY_Y_LOC_UVALY_LOC_NONVAR_NONVAR \
@ -616,7 +616,7 @@
GONext();
#define UNIFY_Y_LOC_UVALY_LOC_UNK \
pt1 = YREG+(*_PREG)->y_u.oy.y; \
pt1 = YREG+(*_PREG)->u.oy.y; \
d1 = *pt1;
#define UNIFY_Y_LOC_UVALY_LOC_VAR_NONVAR \
@ -634,7 +634,7 @@
#define UNIFY_Y_LOC_WRITE_INSTINIT \
register CELL d0; \
register CELL *pt0; \
pt0 = YREG+(*_PREG)->y_u.oy.y; \
pt0 = YREG+(*_PREG)->u.oy.y; \
d0 = *pt0;
#define UNIFY_Y_LOC_WRITE_UNIFY_Y_LOC_NONVAR \
@ -665,7 +665,7 @@
d0 = *pt0;
#define UNIFY_L_Y_LOC_ULVALY_LOC_NONVAR \
pt1 = YREG+(*_PREG)->y_u.oy.y; \
pt1 = YREG+(*_PREG)->u.oy.y; \
d1 = *pt1;
#define UNIFY_L_Y_LOC_ULVALY_LOC_NONVAR_NONVAR \
@ -679,7 +679,7 @@
GONext();
#define UNIFY_L_Y_LOC_ULVALY_LOC_UNK \
pt1 = YREG+(*_PREG)->y_u.oy.y; \
pt1 = YREG+(*_PREG)->u.oy.y; \
d1 = *pt1;
#define UNIFY_L_Y_LOC_ULVALY_LOC_VAR_NONVAR \
@ -695,7 +695,7 @@
#define UNIFY_L_Y_LOC_WRITE_INSTINIT \
register CELL d0; \
register CELL *pt0; \
pt0 = YREG+(*_PREG)->y_u.oy.y; \
pt0 = YREG+(*_PREG)->u.oy.y; \
d0 = *pt0;
#define UNIFY_L_Y_LOC_WRITE_ULUNIFY_Y_LOC_NONVAR \
@ -742,14 +742,14 @@
GONext();
#define _unify_n_voids_instinit \
(*_SREG) += (*_PREG)->y_u.os.s; \
(*_SREG) += (*_PREG)->u.os.s; \
(*_PREG) = NEXTOP((*_PREG), os); \
GONEXT();
#define _unify_n_voids_write_instinit \
register CELL d0; \
CACHE_S(); \
d0 = (*_PREG)->y_u.os.s; \
d0 = (*_PREG)->u.os.s; \
READ_IN_S(); \
(*_PREG) = NEXTOP((*_PREG), os); \
for (; d0 > 0; d0--) { \
@ -766,7 +766,7 @@
#define _unify_l_n_voids_write_instinit \
register CELL d0; \
d0 = (*_PREG)->y_u.os.s; \
d0 = (*_PREG)->u.os.s; \
(*_PREG) = NEXTOP((*_PREG), os); \
CACHE_S(); \
READ_IN_S(); \
@ -784,14 +784,14 @@
d0 = *pt0; \
deref_head(d0, uatom_unk); \
uatom_nonvar: \
if (d0 != (*_PREG)->y_u.oc.c) { \
if (d0 != (*_PREG)->u.oc.c) { \
FAIL(); \
} \
(*_PREG) = NEXTOP((*_PREG), oc); \
GONEXT(); \
\
derefa_body(d0, pt0, uatom_unk, uatom_nonvar); \
d0 = (*_PREG)->y_u.oc.c; \
d0 = (*_PREG)->u.oc.c; \
(*_PREG) = NEXTOP((*_PREG), oc); \
Bind_Global(pt0, d0); \
GONEXT(); \
@ -799,7 +799,7 @@
ENDD(d0);
#define _unify_atom_write_instinit \
* (*_SREG)++ = (*_PREG)->y_u.oc.c; \
* (*_SREG)++ = (*_PREG)->u.oc.c; \
(*_PREG) = NEXTOP((*_PREG), oc); \
GONEXTW();
@ -810,14 +810,14 @@
d0 = *(*_SREG); \
deref_head(d0, ulatom_unk); \
ulatom_nonvar: \
if (d0 != (*_PREG)->y_u.oc.c) { \
if (d0 != (*_PREG)->u.oc.c) { \
FAIL(); \
} \
(*_PREG) = NEXTOP((*_PREG), oc); \
GONEXT(); \
\
derefa_body(d0, pt0, ulatom_unk, ulatom_nonvar); \
d0 = (*_PREG)->y_u.oc.c; \
d0 = (*_PREG)->u.oc.c; \
(*_PREG) = NEXTOP((*_PREG), oc); \
Bind_Global(pt0, d0); \
GONEXT(); \
@ -825,15 +825,15 @@
ENDD(d0);
#define _unify_l_atom_write_instinit \
(*_SREG)[0] = (*_PREG)->y_u.oc.c; \
(*_SREG)[0] = (*_PREG)->u.oc.c; \
(*_PREG) = NEXTOP((*_PREG), oc); \
GONEXT();
#define UNIFY_N_ATOMS_INSTINIT \
register Int i = (*_PREG)->y_u.osc.s; \
register Int i = (*_PREG)->u.osc.s; \
register CELL d0, d1; \
register CELL *pt0; \
d1 = (*_PREG)->y_u.osc.c; \
d1 = (*_PREG)->u.osc.c; \
for (; i > 0; i--) { \
pt0 = (*_SREG)++; \
d0 = *pt0; \
@ -865,8 +865,8 @@
#define UNIFY_N_ATOMS_WRITE_INSTINIT \
register CELL d0, d1; \
d0 = (*_PREG)->y_u.osc.s; \
d1 = (*_PREG)->y_u.osc.c; \
d0 = (*_PREG)->u.osc.s; \
d1 = (*_PREG)->u.osc.c; \
CACHE_S(); \
READ_IN_S(); \
(*_PREG) = NEXTOP((*_PREG), osc); \
@ -888,20 +888,20 @@
d0 = *pt0;
#define UNIFY_FLOAT_UFLOAT_NONVAR_D0ISFUNCTOR \
pt1 = (*_PREG)->y_u.od.d; \
pt1 = (*_PREG)->u.od.d; \
(*_PREG) = NEXTOP((*_PREG), od);
#define UNIFY_FLOAT_UFLOAT_NONVAR_END \
GONext();
#define UNIFY_FLOAT_UFLOAT_UNK \
d1 = AbsAppl((*_PREG)->y_u.od.d); \
d1 = AbsAppl((*_PREG)->u.od.d); \
(*_PREG) = NEXTOP((*_PREG), od); \
Bind_Global(pt0, d1); \
GONext();
#define UNIFY_FLOAT_WRITE_INSTINIT \
* (*_SREG)++ = AbsAppl((*_PREG)->y_u.od.d); \
* (*_SREG)++ = AbsAppl((*_PREG)->u.od.d); \
(*_PREG) = NEXTOP((*_PREG), od); \
GONextW();
@ -925,7 +925,7 @@
} \
ENDD(d0); \
BEGP(pt1); \
pt1 = (*_PREG)->y_u.od.d; \
pt1 = (*_PREG)->u.od.d; \
(*_PREG) = NEXTOP((*_PREG), od); \
if ( \
pt1[1] != pt0[1] \
@ -939,7 +939,7 @@
\
derefa_body(d0, S_SREG, ulfloat_unk, ulfloat_nonvar); \
BEGD(d1); \
d1 = AbsAppl((*_PREG)->y_u.od.d); \
d1 = AbsAppl((*_PREG)->u.od.d); \
(*_PREG) = NEXTOP((*_PREG), od); \
Bind_Global(S_SREG, d1); \
GONEXT(); \
@ -966,7 +966,7 @@
} \
ENDD(d0); \
BEGP(pt1); \
pt1 = (*_PREG)->y_u.od.d; \
pt1 = (*_PREG)->u.od.d; \
(*_PREG) = NEXTOP((*_PREG), od); \
if ( \
pt1[1] != pt0[1] \
@ -979,7 +979,7 @@
\
derefa_body(d0, S_SREG, ulfloat_unk, ulfloat_nonvar); \
BEGD(d1); \
d1 = AbsAppl((*_PREG)->y_u.od.d); \
d1 = AbsAppl((*_PREG)->u.od.d); \
(*_PREG) = NEXTOP((*_PREG), od); \
Bind_Global(S_SREG, d1); \
GONEXT(); \
@ -989,7 +989,7 @@
#endif /* SIZEOF_DOUBLE == 2*SIZEOF_INT_P */
#define _unify_l_float_write_instinit \
(*_SREG)[0] = AbsAppl((*_PREG)->y_u.od.d); \
(*_SREG)[0] = AbsAppl((*_PREG)->u.od.d); \
(*_PREG) = NEXTOP((*_PREG), od); \
GONEXT();
@ -1004,20 +1004,20 @@
d0 = *pt0;
#define UNIFY_LONGINT_D0ISFUNC \
pt1 = (*_PREG)->y_u.oi.i; \
pt1 = (*_PREG)->u.oi.i; \
(*_PREG) = NEXTOP((*_PREG), oi);
#define UNIFY_LONGINT_EQUALS \
GONext();
#define UNIFY_LONGINT_ULONGINT_UNK \
d1 = AbsAppl((*_PREG)->y_u.oi.i); \
d1 = AbsAppl((*_PREG)->u.oi.i); \
(*_PREG) = NEXTOP((*_PREG), oi); \
Bind_Global(pt0, d1); \
GONext();
#define UNIFY_LONGINT_WRITE_INSTINIT \
* (*_SREG)++ = AbsAppl((*_PREG)->y_u.oi.i); \
* (*_SREG)++ = AbsAppl((*_PREG)->u.oi.i); \
(*_PREG) = NEXTOP((*_PREG), oi); \
GONextW();
@ -1033,20 +1033,20 @@
d0 = *pt0;
#define UNIFY_L_LONGINT_D0ISFUNC \
pt1 = (*_PREG)->y_u.oi.i; \
pt1 = (*_PREG)->u.oi.i; \
(*_PREG) = NEXTOP((*_PREG), oi);
#define UNIFY_L_LONGINT_EQUALS \
GONext();
#define UNIFY_L_LONGINT_ULLONGINT_UNK \
d1 = AbsAppl((*_PREG)->y_u.oi.i); \
d1 = AbsAppl((*_PREG)->u.oi.i); \
(*_PREG) = NEXTOP((*_PREG), oi); \
Bind_Global(S_SREG, d1); \
GONext();
#define UNIFY_L_LONGINT_WRITE_INSTINIT \
(*_SREG)[0] = AbsAppl((*_PREG)->y_u.oi.i); \
(*_SREG)[0] = AbsAppl((*_PREG)->u.oi.i); \
(*_PREG) = NEXTOP((*_PREG), oi); \
GONext();
@ -1066,7 +1066,7 @@
GONext();
#define UNIFY_BIGINT_UBIGINT_UNK \
d1 = (*_PREG)->y_u.oN.b; \
d1 = (*_PREG)->u.oN.b; \
(*_PREG) = NEXTOP((*_PREG), oN); \
Bind_Global(pt0, d1); \
GONext();
@ -1089,7 +1089,7 @@
GONext();
#define UNIFY_L_BIGINT_ULBIGINT_UNK \
d1 = (*_PREG)->y_u.oN.b; \
d1 = (*_PREG)->u.oN.b; \
(*_PREG) = NEXTOP((*_PREG), oN); \
Bind_Global(S_SREG, d1); \
GONext(); \
@ -1104,12 +1104,12 @@
#define UNIFY_DBTERM_UDBTERM_NONVAR \
BLOCK = (CELL)UNIFY_DBTERM_UDBTERM_NONVAR; \
d1 = (*_PREG)->y_u.oD.D; \
d1 = (*_PREG)->u.oD.D; \
(*_PREG) = NEXTOP((*_PREG), oD); \
YAAM_UNIFYBOUND;
#define UNIFY_DBTERM_UDBTERM_UNK \
d1 = (*_PREG)->y_u.oD.D; \
d1 = (*_PREG)->u.oD.D; \
(*_PREG) = NEXTOP((*_PREG), oD); \
Bind_Global(pt0, d1); \
GONext();
@ -1123,12 +1123,12 @@
#define UNIFY_L_DBTERM_ULDBTERM_NONVAR \
BLOCK = (CELL)UNIFY_L_DBTERM_ULDBTERM_NONVAR; \
d1 = (*_PREG)->y_u.oD.D; \
d1 = (*_PREG)->u.oD.D; \
(*_PREG) = NEXTOP((*_PREG), oD); \
YAAM_UNIFYBOUND;
#define UNIFY_L_DBTERM_ULDBTERM_UNK \
d1 = (*_PREG)->y_u.oD.D; \
d1 = (*_PREG)->u.oD.D; \
(*_PREG) = NEXTOP((*_PREG), oD); \
Bind_Global(S_SREG, d1); \
GONext(); \
@ -1241,7 +1241,7 @@
CACHE_S(); \
READ_IN_S(); \
S_SREG = RepAppl(d0); \
d0 = (CELL) ((*_PREG)->y_u.ofa.f); \
d0 = (CELL) ((*_PREG)->u.ofa.f); \
if (*S_SREG != d0) { \
FAIL(); \
} \
@ -1256,9 +1256,9 @@
Bind_Global(pt0, d1); \
pt0 = HR; \
ENDD(d1); \
d0 = (CELL) ((*_PREG)->y_u.ofa.f); \
d0 = (CELL) ((*_PREG)->u.ofa.f); \
*pt0++ = d0; \
HR = pt0 + (*_PREG)->y_u.ofa.a; \
HR = pt0 + (*_PREG)->u.ofa.a; \
(*_PREG) = NEXTOP((*_PREG), ofa); \
(*_SREG) = pt0; \
GONEXTW(); \
@ -1274,9 +1274,9 @@
d0 = AbsAppl(HR); \
S_SREG[0] = d0; \
S_SREG = HR; \
d0 = (CELL) ((*_PREG)->y_u.ofa.f); \
d0 = (CELL) ((*_PREG)->u.ofa.f); \
*S_SREG++ = d0; \
HR = S_SREG + (*_PREG)->y_u.ofa.a; \
HR = S_SREG + (*_PREG)->u.ofa.a; \
(*_PREG) = NEXTOP((*_PREG), ofa); \
WRITEBACK_S(S_SREG); \
ENDCACHE_S(); \
@ -1294,7 +1294,7 @@
FAIL(); \
} \
(*_SREG) = RepAppl(d0); \
d0 = (CELL) ((*_PREG)->y_u.ofa.f); \
d0 = (CELL) ((*_PREG)->u.ofa.f); \
if (*(*_SREG)++ != d0) { \
FAIL(); \
} \
@ -1307,9 +1307,9 @@
Bind_Global(pt0, d1); \
pt0 = HR; \
ENDD(d1); \
d0 = (CELL) ((*_PREG)->y_u.ofa.f); \
d0 = (CELL) ((*_PREG)->u.ofa.f); \
*pt0++ = d0; \
HR = pt0 + (*_PREG)->y_u.ofa.a; \
HR = pt0 + (*_PREG)->u.ofa.a; \
(*_PREG) = NEXTOP((*_PREG), ofa); \
(*_SREG) = pt0; \
GONEXTW(); \
@ -1323,51 +1323,51 @@
READ_IN_S(); \
S_SREG[0] = d0; \
S_SREG = HR; \
d0 = (CELL) ((*_PREG)->y_u.ofa.f); \
d0 = (CELL) ((*_PREG)->u.ofa.f); \
*S_SREG++ = d0; \
HR = S_SREG + (*_PREG)->y_u.ofa.a; \
HR = S_SREG + (*_PREG)->u.ofa.a; \
(*_PREG) = NEXTOP((*_PREG), ofa); \
WRITEBACK_S(S_SREG); \
ENDCACHE_S(); \
GONEXTW();
#define _save_pair_x_instinit \
XREG((*_PREG)->y_u.ox.x) = AbsPair((*_SREG)); \
XREG((*_PREG)->u.ox.x) = AbsPair((*_SREG)); \
(*_PREG) = NEXTOP((*_PREG), ox); \
GONEXT();
#define _save_pair_x_write_instinit \
XREG((*_PREG)->y_u.ox.x) = AbsPair((*_SREG)); \
XREG((*_PREG)->u.ox.x) = AbsPair((*_SREG)); \
(*_PREG) = NEXTOP((*_PREG), ox); \
GONEXTW();
#define SAVE_PAIR_Y_INSTINIT \
INITIALIZE_PERMVAR(YREG+(*_PREG)->y_u.oy.y,AbsPair((*_SREG))); \
INITIALIZE_PERMVAR(YREG+(*_PREG)->u.oy.y,AbsPair((*_SREG))); \
(*_PREG) = NEXTOP((*_PREG), oy); \
GONext();
#define SAVE_PAIR_Y_WRITE_INSTINIT \
INITIALIZE_PERMVAR(YREG+(*_PREG)->y_u.oy.y,AbsPair((*_SREG))); \
INITIALIZE_PERMVAR(YREG+(*_PREG)->u.oy.y,AbsPair((*_SREG))); \
(*_PREG) = NEXTOP((*_PREG), oy); \
GONextW();
#define _save_appl_x_instinit \
XREG((*_PREG)->y_u.ox.x) = AbsAppl((*_SREG) - 1); \
XREG((*_PREG)->u.ox.x) = AbsAppl((*_SREG) - 1); \
(*_PREG) = NEXTOP((*_PREG), ox); \
GONEXT();
#define _save_appl_x_write_instinit \
XREG((*_PREG)->y_u.ox.x) = AbsAppl((*_SREG) - 1); \
XREG((*_PREG)->u.ox.x) = AbsAppl((*_SREG) - 1); \
(*_PREG) = NEXTOP((*_PREG), ox); \
GONEXTW();
#define SAVE_APPL_Y_INSTINIT \
INITIALIZE_PERMVAR(YREG+(*_PREG)->y_u.oy.y,AbsAppl((*_SREG)-1)); \
INITIALIZE_PERMVAR(YREG+(*_PREG)->u.oy.y,AbsAppl((*_SREG)-1)); \
(*_PREG) = NEXTOP((*_PREG), oy); \
GONext();
#define SAVE_APPL_Y_WRITE_INSTINIT \
INITIALIZE_PERMVAR(YREG+(*_PREG)->y_u.oy.y,AbsAppl((*_SREG)-1)); \
INITIALIZE_PERMVAR(YREG+(*_PREG)->u.oy.y,AbsAppl((*_SREG)-1)); \
(*_PREG) = NEXTOP((*_PREG), oy); \
GONextW();

View File

@ -1,5 +1,5 @@
#define WRITE_X_VAR_INSTINIT \
XREG((*_PREG)->y_u.x.x) = Unsigned((*_SREG)); \
XREG((*_PREG)->u.x.x) = Unsigned((*_SREG)); \
(*_PREG) = NEXTOP((*_PREG), x); \
RESET_VARIABLE((*_SREG)); \
(*_SREG)++; \
@ -13,7 +13,7 @@
#define WRITE_N_VOIDS_INSTINIT \
register CELL d0; \
d0 = (*_PREG)->y_u.s.s; \
d0 = (*_PREG)->u.s.s; \
(*_PREG) = NEXTOP((*_PREG), s); \
for (; d0 > 0; d0--) { \
RESET_VARIABLE((*_SREG)); \
@ -22,7 +22,7 @@
GONext();
#define _write_y_var_instinit \
INITIALIZE_PERMVAR(YREG+(*_PREG)->y_u.y.y,Unsigned((*_SREG))); \
INITIALIZE_PERMVAR(YREG+(*_PREG)->u.y.y,Unsigned((*_SREG))); \
(*_PREG) = NEXTOP((*_PREG), y); \
RESET_VARIABLE((*_SREG)); \
(*_SREG)++; \
@ -30,7 +30,7 @@
#define _write_x_val_instinit \
register CELL d0; \
d0 = XREG((*_PREG)->y_u.x.x); \
d0 = XREG((*_PREG)->u.x.x); \
*(*_SREG)++ = d0; \
(*_PREG) = NEXTOP((*_PREG), x); \
GONEXT();
@ -39,7 +39,7 @@
#ifdef FROZEN_STACKS
#define _write_x_loc_instinit \
BEGD(d0); \
d0 = XREG((*_PREG)->y_u.x.x); \
d0 = XREG((*_PREG)->u.x.x); \
(*_PREG) = NEXTOP((*_PREG), x); \
deref_head(d0, w_x_unk); \
w_x_bound: \
@ -63,7 +63,7 @@
#else /* FROZEN_STACKS */
#define _write_x_loc_instinit \
BEGD(d0); \
d0 = XREG((*_PREG)->y_u.x.x); \
d0 = XREG((*_PREG)->u.x.x); \
(*_PREG) = NEXTOP((*_PREG), x); \
deref_head(d0, w_x_unk); \
w_x_bound: \
@ -90,7 +90,7 @@
#ifdef FROZEN_STACKS
#define _write_x_loc_instinit \
BEGD(d0); \
d0 = XREG((*_PREG)->y_u.x.x); \
d0 = XREG((*_PREG)->u.x.x); \
(*_PREG) = NEXTOP((*_PREG), x); \
deref_head(d0, w_x_unk); \
w_x_bound: \
@ -114,7 +114,7 @@
#else /* FROZEN_STACKS */
#define _write_x_loc_instinit \
BEGD(d0); \
d0 = XREG((*_PREG)->y_u.x.x); \
d0 = XREG((*_PREG)->u.x.x); \
(*_PREG) = NEXTOP((*_PREG), x); \
deref_head(d0, w_x_unk); \
w_x_bound: \
@ -142,9 +142,9 @@
#ifdef YAPOR_SBA
#define _write_y_val_instinit \
register CELL d0; \
d0 = YREG[(*_PREG)->y_u.y.y]; \
d0 = YREG[(*_PREG)->u.y.y]; \
if (d0 == 0) \
*(*_SREG)++ = (CELL)(YREG+(*_PREG)->y_u.y.y); \
*(*_SREG)++ = (CELL)(YREG+(*_PREG)->u.y.y); \
else \
*(*_SREG)++ = d0; \
(*_PREG) = NEXTOP((*_PREG), y); \
@ -152,7 +152,7 @@
#else /* YAPOR_SBA */
#define _write_y_val_instinit \
register CELL d0; \
d0 = YREG[(*_PREG)->y_u.y.y]; \
d0 = YREG[(*_PREG)->u.y.y]; \
*(*_SREG)++ = d0; \
(*_PREG) = NEXTOP((*_PREG), y); \
GONEXT();
@ -163,7 +163,7 @@
#define _write_y_loc_instinit \
BEGD(d0); \
BEGP(pt0); \
pt0 = YREG+(*_PREG)->y_u.y.y; \
pt0 = YREG+(*_PREG)->u.y.y; \
d0 = *pt0; \
deref_head(d0, w_y_unk); \
w_y_bound: \
@ -191,7 +191,7 @@
#define _write_y_loc_instinit \
BEGD(d0); \
BEGP(pt0); \
pt0 = YREG+(*_PREG)->y_u.y.y; \
pt0 = YREG+(*_PREG)->u.y.y; \
d0 = *pt0; \
deref_head(d0, w_y_unk); \
w_y_bound: \
@ -222,7 +222,7 @@
#define _write_y_loc_instinit \
BEGD(d0); \
BEGP(pt0); \
pt0 = YREG+(*_PREG)->y_u.y.y; \
pt0 = YREG+(*_PREG)->u.y.y; \
d0 = *pt0; \
deref_head(d0, w_y_unk); \
w_y_bound: \
@ -249,7 +249,7 @@
#define _write_y_loc_instinit \
BEGD(d0); \
BEGP(pt0); \
pt0 = YREG+(*_PREG)->y_u.y.y; \
pt0 = YREG+(*_PREG)->u.y.y; \
d0 = *pt0; \
deref_head(d0, w_y_unk); \
w_y_bound: \
@ -278,43 +278,43 @@
#define _write_atom_instinit \
register CELL d0; \
d0 = (*_PREG)->y_u.c.c; \
d0 = (*_PREG)->u.c.c; \
*(*_SREG)++ = d0; \
(*_PREG) = NEXTOP((*_PREG), c); \
GONEXT();
#define WRITE_BIGINT_INSTINIT \
register CELL d0; \
d0 = (*_PREG)->y_u.N.b; \
d0 = (*_PREG)->u.N.b; \
*(*_SREG)++ = d0; \
(*_PREG) = NEXTOP((*_PREG), N); \
GONext();
#define _write_dbterm_instinit \
register CELL d0; \
d0 = (*_PREG)->y_u.D.D; \
d0 = (*_PREG)->u.D.D; \
*(*_SREG)++ = d0; \
(*_PREG) = NEXTOP((*_PREG), D); \
GONEXT();
#define _write_float_instinit \
register CELL d0; \
d0 = AbsAppl((*_PREG)->y_u.d.d); \
d0 = AbsAppl((*_PREG)->u.d.d); \
*(*_SREG)++ = d0; \
(*_PREG) = NEXTOP((*_PREG), d); \
GONEXT();
#define WRITE_LONGIT_INSTINIT \
register CELL d0; \
d0 = AbsAppl((*_PREG)->y_u.i.i); \
d0 = AbsAppl((*_PREG)->u.i.i); \
*(*_SREG)++ = d0; \
(*_PREG) = NEXTOP((*_PREG), i); \
GONext();
#define WRITE_N_ATOMS_INSTINIT \
register CELL d0, d1; \
d0 = (*_PREG)->y_u.sc.s; \
d1 = (*_PREG)->y_u.sc.c; \
d0 = (*_PREG)->u.sc.s; \
d1 = (*_PREG)->u.sc.c; \
for (; d0 > 0; d0--) { \
*(*_SREG)++ = d1; \
} \
@ -352,9 +352,9 @@
SP[-1] = Unsigned((*_SREG)); \
SP[-2] = 1; \
SP -= 2; \
d0 = (CELL) ((*_PREG)->y_u.fa.f); \
*HR++ = d0; \
d0 = (*_PREG)->y_u.fa.a; \
d0 = (CELL) ((*_PREG)->u.fa.f); \
*H++ = d0; \
d0 = (*_PREG)->u.fa.a; \
(*_PREG) = NEXTOP((*_PREG), fa); \
(*_SREG) = HR; \
HR += d0; \
@ -364,10 +364,10 @@
register CELL d0; \
d0 = AbsAppl(HR); \
*(*_SREG) = d0; \
d0 = (CELL) ((*_PREG)->y_u.fa.f); \
*HR++ = d0; \
d0 = (CELL) ((*_PREG)->u.fa.f); \
*H++ = d0; \
(*_SREG) = HR; \
d0 = (*_PREG)->y_u.fa.a; \
d0 = (*_PREG)->u.fa.a; \
(*_PREG) = NEXTOP((*_PREG), fa); \
HR += d0; \
GONEXT();

3182
JIT/HPP/sprint_op.hh Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -89,53 +89,53 @@
#if (defined(YAPOR_SBA) && defined(YAPOR)) || defined(TABLING)
#define NoStackDeallocate_Exception \
if (__builtin_expect( ((Int)(Unsigned(YOUNGEST_CP((choiceptr)ENV_YREG,B_FZ)) - Unsigned(YOUNGEST_H(H_FZ,HR))) < CreepFlag), 0) ) { \
if (__builtin_expect( ((Int)(Unsigned(YOUNGEST_CP((choiceptr)ENV_YREG,B_FZ)) - Unsigned(YOUNGEST_H(H_FZ,H))) < CreepFlag), 0) ) { \
return external_labels[8]; \
}
#define NoStackCall_Exception \
CACHE_Y_AS_ENV(YREG); \
if (__builtin_expect( ((Int)(Unsigned(YOUNGEST_CP((choiceptr)ENV_YREG,B_FZ)) - Unsigned(YOUNGEST_H(H_FZ,HR))) < CreepFlag), 0) ) { \
if (__builtin_expect( ((Int)(Unsigned(YOUNGEST_CP((choiceptr)ENV_YREG,B_FZ)) - Unsigned(YOUNGEST_H(H_FZ,H))) < CreepFlag), 0) ) { \
return external_labels[6]; \
} \
ENDCACHE_Y_AS_ENV();
#define NoStackDExecute_Exception \
if (__builtin_expect( ((Int)(Unsigned(YOUNGEST_CP((choiceptr)ENV_YREG,B_FZ)) - Unsigned(YOUNGEST_H(H_FZ,HR))) < CreepFlag), 0) ) { \
if (__builtin_expect( ((Int)(Unsigned(YOUNGEST_CP((choiceptr)ENV_YREG,B_FZ)) - Unsigned(YOUNGEST_H(H_FZ,H))) < CreepFlag), 0) ) { \
return external_labels[7]; \
}
#define NoStackExecute_Exception \
CACHE_Y_AS_ENV(YREG); \
if (__builtin_expect( ((Int)(Unsigned(YOUNGEST_CP((choiceptr)ENV_YREG,B_FZ)) - Unsigned(YOUNGEST_H(H_FZ,HR))) < CreepFlag), 0) ) { \
if (__builtin_expect( ((Int)(Unsigned(YOUNGEST_CP((choiceptr)ENV_YREG,B_FZ)) - Unsigned(YOUNGEST_H(H_FZ,H))) < CreepFlag), 0) ) { \
return external_labels[5]; \
} \
ENDCACHE_Y_AS_ENV();
#define NoStackFail_Exception \
CACHE_Y_AS_ENV(YREG); \
if (__builtin_expect( ((Int)(Unsigned(YOUNGEST_CP((choiceptr)ENV_YREG,B_FZ)) - Unsigned(YOUNGEST_H(H_FZ,HR))) < CreepFlag), 0) ) { \
if (__builtin_expect( ((Int)(Unsigned(YOUNGEST_CP((choiceptr)ENV_YREG,B_FZ)) - Unsigned(YOUNGEST_H(H_FZ,H))) < CreepFlag), 0) ) { \
return external_labels[10]; \
} \
ENDCACHE_Y_AS_ENV();
#define NoStackEither_Exception \
CACHE_Y_AS_ENV(YREG); \
if (__builtin_expect( ((Int)(Unsigned(YOUNGEST_CP((choiceptr)ENV_YREG,B_FZ)) - Unsigned(YOUNGEST_H(H_FZ,HR))) < CreepFlag), 0) ) { \
if (__builtin_expect( ((Int)(Unsigned(YOUNGEST_CP((choiceptr)ENV_YREG,B_FZ)) - Unsigned(YOUNGEST_H(H_FZ,H))) < CreepFlag), 0) ) { \
return external_labels[4]; \
} \
ENDCACHE_Y_AS_ENV();
#define NoStackCommitY_Exception \
CACHE_Y_AS_ENV(YREG); \
if (__builtin_expect( ((Int)(Unsigned(YOUNGEST_CP((choiceptr)ENV_YREG,B_FZ)) - Unsigned(YOUNGEST_H(H_FZ,HR))) < CreepFlag), 0) ) { \
if (__builtin_expect( ((Int)(Unsigned(YOUNGEST_CP((choiceptr)ENV_YREG,B_FZ)) - Unsigned(YOUNGEST_H(H_FZ,H))) < CreepFlag), 0) ) { \
return external_labels[2]; \
} \
ENDCACHE_Y_AS_ENV();
#define NoStackCommitX_Exception \
CACHE_Y_AS_ENV(YREG); \
if (__builtin_expect( ((Int)(Unsigned(YOUNGEST_CP((choiceptr)ENV_YREG,B_FZ)) - Unsigned(YOUNGEST_H(H_FZ,HR))) < CreepFlag), 0) ) { \
if (__builtin_expect( ((Int)(Unsigned(YOUNGEST_CP((choiceptr)ENV_YREG,B_FZ)) - Unsigned(YOUNGEST_H(H_FZ,H))) < CreepFlag), 0) ) { \
return external_labels[11]; \
} \
ENDCACHE_Y_AS_ENV();

View File

@ -91,7 +91,7 @@
#if (defined(YAPOR_SBA) && defined(YAPOR)) || defined(TABLING)
#define NoStackDeallocate_Exception \
if (__builtin_expect( ((Int)(Unsigned(YOUNGEST_CP((choiceptr)ENV_YREG,B_FZ)) - Unsigned(YOUNGEST_H(H_FZ,HR))) < CreepFlag), 0) ) { \
if (__builtin_expect( ((Int)(Unsigned(YOUNGEST_CP((choiceptr)ENV_YREG,B_FZ)) - Unsigned(YOUNGEST_H(H_FZ,H))) < CreepFlag), 0) ) { \
if ((char*)ExpEnv.debug_struc.pprint_me.native_treat_heap != 0 && (char*)ExpEnv.debug_struc.pprint_me.native_treat_heap != (char*)0x1) { \
fprintf(stderr, "%s:%d\n", __FILE__, __LINE__); \
fprintf(stderr, "%s", (char*)ExpEnv.debug_struc.pprint_me.native_treat_heap); \
@ -101,7 +101,7 @@
#define NoStackCall_Exception \
CACHE_Y_AS_ENV(YREG); \
if (__builtin_expect( ((Int)(Unsigned(YOUNGEST_CP((choiceptr)ENV_YREG,B_FZ)) - Unsigned(YOUNGEST_H(H_FZ,HR))) < CreepFlag), 0) ) { \
if (__builtin_expect( ((Int)(Unsigned(YOUNGEST_CP((choiceptr)ENV_YREG,B_FZ)) - Unsigned(YOUNGEST_H(H_FZ,H))) < CreepFlag), 0) ) { \
if ((char*)ExpEnv.debug_struc.pprint_me.native_treat_heap != 0 && (char*)ExpEnv.debug_struc.pprint_me.native_treat_heap != (char*)0x1) { \
fprintf(stderr, "%s:%d\n", __FILE__, __LINE__); \
fprintf(stderr, "%s", (char*)ExpEnv.debug_struc.pprint_me.native_treat_heap); \
@ -111,7 +111,7 @@
ENDCACHE_Y_AS_ENV();
#define NoStackDExecute_Exception \
if (__builtin_expect( ((Int)(Unsigned(YOUNGEST_CP((choiceptr)ENV_YREG,B_FZ)) - Unsigned(YOUNGEST_H(H_FZ,HR))) < CreepFlag), 0) ) { \
if (__builtin_expect( ((Int)(Unsigned(YOUNGEST_CP((choiceptr)ENV_YREG,B_FZ)) - Unsigned(YOUNGEST_H(H_FZ,H))) < CreepFlag), 0) ) { \
if ((char*)ExpEnv.debug_struc.pprint_me.native_treat_heap != 0 && (char*)ExpEnv.debug_struc.pprint_me.native_treat_heap != (char*)0x1) { \
fprintf(stderr, "%s:%d\n", __FILE__, __LINE__); \
fprintf(stderr, "%s", (char*)ExpEnv.debug_struc.pprint_me.native_treat_heap); \
@ -121,7 +121,7 @@
#define NoStackExecute_Exception \
CACHE_Y_AS_ENV(YREG); \
if (__builtin_expect( ((Int)(Unsigned(YOUNGEST_CP((choiceptr)ENV_YREG,B_FZ)) - Unsigned(YOUNGEST_H(H_FZ,HR))) < CreepFlag), 0) ) { \
if (__builtin_expect( ((Int)(Unsigned(YOUNGEST_CP((choiceptr)ENV_YREG,B_FZ)) - Unsigned(YOUNGEST_H(H_FZ,H))) < CreepFlag), 0) ) { \
if ((char*)ExpEnv.debug_struc.pprint_me.native_treat_heap != 0 && (char*)ExpEnv.debug_struc.pprint_me.native_treat_heap != (char*)0x1) { \
fprintf(stderr, "%s:%d\n", __FILE__, __LINE__); \
fprintf(stderr, "%s", (char*)ExpEnv.debug_struc.pprint_me.native_treat_heap); \
@ -132,7 +132,7 @@
#define NoStackFail_Exception \
CACHE_Y_AS_ENV(YREG); \
if (__builtin_expect( ((Int)(Unsigned(YOUNGEST_CP((choiceptr)ENV_YREG,B_FZ)) - Unsigned(YOUNGEST_H(H_FZ,HR))) < CreepFlag), 0) ) { \
if (__builtin_expect( ((Int)(Unsigned(YOUNGEST_CP((choiceptr)ENV_YREG,B_FZ)) - Unsigned(YOUNGEST_H(H_FZ,H))) < CreepFlag), 0) ) { \
if ((char*)ExpEnv.debug_struc.pprint_me.native_treat_heap != 0 && (char*)ExpEnv.debug_struc.pprint_me.native_treat_heap != (char*)0x1) { \
fprintf(stderr, "%s:%d\n", __FILE__, __LINE__); \
fprintf(stderr, "%s", (char*)ExpEnv.debug_struc.pprint_me.native_treat_heap); \
@ -143,7 +143,7 @@
#define NoStackEither_Exception \
CACHE_Y_AS_ENV(YREG); \
if (__builtin_expect( ((Int)(Unsigned(YOUNGEST_CP((choiceptr)ENV_YREG,B_FZ)) - Unsigned(YOUNGEST_H(H_FZ,HR))) < CreepFlag), 0) ) { \
if (__builtin_expect( ((Int)(Unsigned(YOUNGEST_CP((choiceptr)ENV_YREG,B_FZ)) - Unsigned(YOUNGEST_H(H_FZ,H))) < CreepFlag), 0) ) { \
if ((char*)ExpEnv.debug_struc.pprint_me.native_treat_heap != 0 && (char*)ExpEnv.debug_struc.pprint_me.native_treat_heap != (char*)0x1) { \
fprintf(stderr, "%s:%d\n", __FILE__, __LINE__); \
fprintf(stderr, "%s", (char*)ExpEnv.debug_struc.pprint_me.native_treat_heap); \
@ -154,7 +154,7 @@
#define NoStackCommitY_Exception \
CACHE_Y_AS_ENV(YREG); \
if (__builtin_expect( ((Int)(Unsigned(YOUNGEST_CP((choiceptr)ENV_YREG,B_FZ)) - Unsigned(YOUNGEST_H(H_FZ,HR))) < CreepFlag), 0) ) { \
if (__builtin_expect( ((Int)(Unsigned(YOUNGEST_CP((choiceptr)ENV_YREG,B_FZ)) - Unsigned(YOUNGEST_H(H_FZ,H))) < CreepFlag), 0) ) { \
if ((char*)ExpEnv.debug_struc.pprint_me.native_treat_heap != 0 && (char*)ExpEnv.debug_struc.pprint_me.native_treat_heap != (char*)0x1) { \
fprintf(stderr, "%s:%d\n", __FILE__, __LINE__); \
fprintf(stderr, "%s", (char*)ExpEnv.debug_struc.pprint_me.native_treat_heap); \
@ -165,7 +165,7 @@
#define NoStackCommitX_Exception \
CACHE_Y_AS_ENV(YREG); \
if (__builtin_expect( ((Int)(Unsigned(YOUNGEST_CP((choiceptr)ENV_YREG,B_FZ)) - Unsigned(YOUNGEST_H(H_FZ,HR))) < CreepFlag), 0) ) { \
if (__builtin_expect( ((Int)(Unsigned(YOUNGEST_CP((choiceptr)ENV_YREG,B_FZ)) - Unsigned(YOUNGEST_H(H_FZ,H))) < CreepFlag), 0) ) { \
if ((char*)ExpEnv.debug_struc.pprint_me.native_treat_heap != 0 && (char*)ExpEnv.debug_struc.pprint_me.native_treat_heap != (char*)0x1) { \
fprintf(stderr, "%s:%d\n", __FILE__, __LINE__); \
fprintf(stderr, "%s", (char*)ExpEnv.debug_struc.pprint_me.native_treat_heap); \

View File

@ -3,7 +3,7 @@
register CELL d0; \
PredEntry *pt0; \
register CELL *ENV_YREG = (YREG); \
pt0 = (*_PREG)->y_u.pp.p;
pt0 = (*_PREG)->u.pp.p;
#ifdef LOW_LEVEL_TRACER
#define EXECUTE_LOW_LEVEL_TRACER \
@ -51,14 +51,14 @@
#ifdef LOW_LEVEL_TRACER
#define DEXECUTE_LOW_LEVEL_TRACER \
low_level_trace(enter_pred,(*_PREG)->y_u.pp.p,XREGS+1);
low_level_trace(enter_pred,(*_PREG)->u.pp.p,XREGS+1);
#endif
#define DEXECUTE_POST_LOW_LEVEL_TRACER \
CACHE_Y_AS_ENV(YREG); \
PredEntry *pt0; \
CACHE_A1(); \
pt0 = (*_PREG)->y_u.pp.p;
pt0 = (*_PREG)->u.pp.p;
#ifdef DEPTH_LIMIT
#define DEXECUTE_DEPTH_MINOR \
@ -166,18 +166,18 @@
#ifdef LOW_LEVEL_TRACER
#define CALL_LOW_LEVEL_TRACER \
low_level_trace(enter_pred,(*_PREG)->y_u.Osbpp.p,XREGS+1);
low_level_trace(enter_pred,(*_PREG)->u.Osbpp.p,XREGS+1);
#endif
#define CALL_POST_LOW_LEVEL_TRACER \
register CELL *ENV_YREG = (YREG); \
PredEntry *pt; \
pt = (*_PREG)->y_u.Osbpp.p; \
pt = (*_PREG)->u.Osbpp.p; \
CACHE_A1();
#define CALL_POST_NO_CHECKING \
ENV = ENV_YREG; \
ENV_YREG = (CELL *) (((char *) ENV_YREG) + (*_PREG)->y_u.Osbpp.s); \
ENV_YREG = (CELL *) (((char *) ENV_YREG) + (*_PREG)->u.Osbpp.s); \
(*_CPREG) = NEXTOP((*_PREG), Osbpp); \
(*_PREG) = pt->CodeOfPred; \
save_pc(); \

View File

@ -1,7 +1,7 @@
#define COUNT_CALL_INSTINIT \
LOCK((*_PREG)->y_u.p.p->StatisticsForPred.lock); \
(*_PREG)->y_u.p.p->StatisticsForPred.NOfEntries++; \
UNLOCK((*_PREG)->y_u.p.p->StatisticsForPred.lock); \
LOCK((*_PREG)->u.p.p->StatisticsForPred.lock); \
(*_PREG)->u.p.p->StatisticsForPred.NOfEntries++; \
UNLOCK((*_PREG)->u.p.p->StatisticsForPred.lock); \
LOCAL_ReductionsCounter--;
#define COUNT_CALL_MIDDLE \
@ -26,9 +26,9 @@
GONext();
#define COUNT_RETRY_INSTINIT \
LOCK((*_PREG)->y_u.p.p->StatisticsForPred.lock); \
(*_PREG)->y_u.p.p->StatisticsForPred.NOfRetries++; \
UNLOCK((*_PREG)->y_u.p.p->StatisticsForPred.lock); \
LOCK((*_PREG)->u.p.p->StatisticsForPred.lock); \
(*_PREG)->u.p.p->StatisticsForPred.NOfRetries++; \
UNLOCK((*_PREG)->u.p.p->StatisticsForPred.lock); \
LOCAL_RetriesCounter--;
#define COUNT_RETRY_MIDDLE \
@ -56,8 +56,8 @@
#define COUNT_RETRY_ME_INSTINIT \
CACHE_Y(B); \
restore_yaam_regs((*_PREG)->y_u.Otapl.d); \
restore_args((*_PREG)->y_u.Otapl.s);
restore_yaam_regs((*_PREG)->u.Otapl.d); \
restore_args((*_PREG)->u.Otapl.s);
#ifdef FROZEN_STACKS
#define COUNT_RETRY_ME_MIDDLE \
@ -65,9 +65,9 @@
set_cut(S_YREG, B->cp_b); \
SET_BB(B_YREG); \
ENDCACHE_Y(); \
LOCK(((PredEntry *)((*_PREG)->y_u.Otapl.p))->StatisticsForPred.lock); \
((PredEntry *)((*_PREG)->y_u.Otapl.p))->StatisticsForPred.NOfRetries++; \
UNLOCK(((PredEntry *)((*_PREG)->y_u.Otapl.p))->StatisticsForPred.lock); \
LOCK(((PredEntry *)((*_PREG)->u.Otapl.p))->StatisticsForPred.lock); \
((PredEntry *)((*_PREG)->u.Otapl.p))->StatisticsForPred.NOfRetries++; \
UNLOCK(((PredEntry *)((*_PREG)->u.Otapl.p))->StatisticsForPred.lock); \
LOCAL_RetriesCounter--; \
if (LOCAL_RetriesCounter == 0 && LOCAL_RetriesCounterOn) { \
saveregs(); \
@ -87,9 +87,9 @@
set_cut(S_YREG, B_YREG->cp_b); \
SET_BB(B_YREG); \
ENDCACHE_Y(); \
LOCK(((PredEntry *)((*_PREG)->y_u.Otapl.p))->StatisticsForPred.lock); \
((PredEntry *)((*_PREG)->y_u.Otapl.p))->StatisticsForPred.NOfRetries++; \
UNLOCK(((PredEntry *)((*_PREG)->y_u.Otapl.p))->StatisticsForPred.lock); \
LOCK(((PredEntry *)((*_PREG)->u.Otapl.p))->StatisticsForPred.lock); \
((PredEntry *)((*_PREG)->u.Otapl.p))->StatisticsForPred.NOfRetries++; \
UNLOCK(((PredEntry *)((*_PREG)->u.Otapl.p))->StatisticsForPred.lock); \
LOCAL_RetriesCounter--; \
if (LOCAL_RetriesCounter == 0 && LOCAL_RetriesCounterOn) { \
saveregs(); \
@ -118,14 +118,14 @@
#define COUNT_TRUST_ME_MIDDLE \
if (SCH_top_shared_cp(B)) { \
SCH_last_alternative((*_PREG), B_YREG); \
restore_args((*_PREG)->y_u.Otapl.s); \
restore_args((*_PREG)->u.Otapl.s); \
S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG); \
set_cut(S_YREG, B->cp_b); \
} \
else \
{ \
pop_yaam_regs(); \
pop_args((*_PREG)->y_u.Otapl.s); \
pop_args((*_PREG)->u.Otapl.s); \
S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG); \
set_cut(S_YREG, B); \
} \
@ -149,13 +149,13 @@
#define COUNT_TRUST_ME_MIDDLE \
if (SCH_top_shared_cp(B)) { \
SCH_last_alternative((*_PREG), B_YREG); \
restore_args((*_PREG)->y_u.Otapl.s); \
restore_args((*_PREG)->u.Otapl.s); \
set_cut(S_YREG, B->cp_b); \
} \
else \
{ \
pop_yaam_regs(); \
pop_args((*_PREG)->y_u.Otapl.s); \
pop_args((*_PREG)->u.Otapl.s); \
set_cut(S_YREG, B); \
} \
SET_BB(B_YREG); \
@ -180,7 +180,7 @@
#define COUNT_TRUST_ME_MIDDLE \
{ \
pop_yaam_regs(); \
pop_args((*_PREG)->y_u.Otapl.s); \
pop_args((*_PREG)->u.Otapl.s); \
S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG); \
set_cut(S_YREG, B); \
} \
@ -204,7 +204,7 @@
#define COUNT_TRUST_ME_MIDDLE \
{ \
pop_yaam_regs(); \
pop_args((*_PREG)->y_u.Otapl.s); \
pop_args((*_PREG)->u.Otapl.s); \
set_cut(S_YREG, B); \
} \
SET_BB(B_YREG); \
@ -227,9 +227,9 @@
#endif /* YAPOR */
#define COUNT_TRUST_ME_END \
LOCK(((PredEntry *)((*_PREG)->y_u.Otapl.p))->StatisticsForPred.lock); \
((PredEntry *)((*_PREG)->y_u.Otapl.p))->StatisticsForPred.NOfRetries++; \
UNLOCK(((PredEntry *)((*_PREG)->y_u.Otapl.p))->StatisticsForPred.lock); \
LOCK(((PredEntry *)((*_PREG)->u.Otapl.p))->StatisticsForPred.lock); \
((PredEntry *)((*_PREG)->u.Otapl.p))->StatisticsForPred.NOfRetries++; \
UNLOCK(((PredEntry *)((*_PREG)->u.Otapl.p))->StatisticsForPred.lock); \
(*_PREG) = NEXTOP((*_PREG), Otapl); \
GONext();
@ -241,13 +241,13 @@
{ \
UInt timestamp; \
CACHE_Y(B); \
timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[(*_PREG)->y_u.OtaLl.s]); \
if (!VALID_TIMESTAMP(timestamp, (*_PREG)->y_u.OtaLl.d)) { \
(*_PREG)=(*_PREG)->y_u.OtaLl.n; \
timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[(*_PREG)->u.OtaLl.s]); \
if (!VALID_TIMESTAMP(timestamp, (*_PREG)->u.OtaLl.d)) { \
(*_PREG)=(*_PREG)->u.OtaLl.n; \
JMPNext(); \
} \
restore_yaam_regs((*_PREG)->y_u.OtaLl.n); \
restore_args((*_PREG)->y_u.OtaLl.s); \
restore_yaam_regs((*_PREG)->u.OtaLl.n); \
restore_args((*_PREG)->u.OtaLl.s); \
LOCAL_RetriesCounter--; \
if (LOCAL_RetriesCounter == 0) { \
saveregs(); \
@ -262,11 +262,11 @@
setregs(); \
JMPNext(); \
} \
LOCK((*_PREG)->y_u.OtaLl.d->ClPred->StatisticsForPred.lock); \
(*_PREG)->y_u.OtaLl.d->ClPred->StatisticsForPred.NOfRetries++; \
UNLOCK((*_PREG)->y_u.OtaLl.d->ClPred->StatisticsForPred.lock); \
PP = (*_PREG)->y_u.OtaLl.d->ClPred; \
(*_PREG) = (*_PREG)->y_u.OtaLl.d->ClCode; \
LOCK((*_PREG)->u.OtaLl.d->ClPred->StatisticsForPred.lock); \
(*_PREG)->u.OtaLl.d->ClPred->StatisticsForPred.NOfRetries++; \
UNLOCK((*_PREG)->u.OtaLl.d->ClPred->StatisticsForPred.lock); \
PP = (*_PREG)->u.OtaLl.d->ClPred; \
(*_PREG) = (*_PREG)->u.OtaLl.d->ClCode; \
S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG); \
set_cut(S_YREG, B->cp_b); \
SET_BB(B_YREG); \
@ -280,13 +280,13 @@
{ \
UInt timestamp; \
CACHE_Y(B); \
timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[(*_PREG)->y_u.OtaLl.s]); \
if (!VALID_TIMESTAMP(timestamp, (*_PREG)->y_u.OtaLl.d)) { \
(*_PREG)=(*_PREG)->y_u.OtaLl.n; \
timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[(*_PREG)->u.OtaLl.s]); \
if (!VALID_TIMESTAMP(timestamp, (*_PREG)->u.OtaLl.d)) { \
(*_PREG)=(*_PREG)->u.OtaLl.n; \
JMPNext(); \
} \
restore_yaam_regs((*_PREG)->y_u.OtaLl.n); \
restore_args((*_PREG)->y_u.OtaLl.s); \
restore_yaam_regs((*_PREG)->u.OtaLl.n); \
restore_args((*_PREG)->u.OtaLl.s); \
LOCAL_RetriesCounter--; \
if (LOCAL_RetriesCounter == 0) { \
saveregs(); \
@ -301,11 +301,11 @@
setregs(); \
JMPNext(); \
} \
LOCK((*_PREG)->y_u.OtaLl.d->ClPred->StatisticsForPred.lock); \
(*_PREG)->y_u.OtaLl.d->ClPred->StatisticsForPred.NOfRetries++; \
UNLOCK((*_PREG)->y_u.OtaLl.d->ClPred->StatisticsForPred.lock); \
PP = (*_PREG)->y_u.OtaLl.d->ClPred; \
(*_PREG) = (*_PREG)->y_u.OtaLl.d->ClCode; \
LOCK((*_PREG)->u.OtaLl.d->ClPred->StatisticsForPred.lock); \
(*_PREG)->u.OtaLl.d->ClPred->StatisticsForPred.NOfRetries++; \
UNLOCK((*_PREG)->u.OtaLl.d->ClPred->StatisticsForPred.lock); \
PP = (*_PREG)->u.OtaLl.d->ClPred; \
(*_PREG) = (*_PREG)->u.OtaLl.d->ClCode; \
set_cut(S_YREG, B_YREG->cp_b); \
SET_BB(B_YREG); \
ENDCACHE_Y(); \
@ -320,13 +320,13 @@
{ \
UInt timestamp; \
CACHE_Y(B); \
timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[(*_PREG)->y_u.OtaLl.s]); \
if (!VALID_TIMESTAMP(timestamp, (*_PREG)->y_u.OtaLl.d)) { \
(*_PREG)=(*_PREG)->y_u.OtaLl.n; \
timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[(*_PREG)->u.OtaLl.s]); \
if (!VALID_TIMESTAMP(timestamp, (*_PREG)->u.OtaLl.d)) { \
(*_PREG)=(*_PREG)->u.OtaLl.n; \
JMPNext(); \
} \
restore_yaam_regs((*_PREG)->y_u.OtaLl.n); \
restore_args((*_PREG)->y_u.OtaLl.s); \
restore_yaam_regs((*_PREG)->u.OtaLl.n); \
restore_args((*_PREG)->u.OtaLl.s); \
LOCAL_RetriesCounter--; \
if (LOCAL_RetriesCounter == 0) { \
saveregs(); \
@ -341,10 +341,10 @@
setregs(); \
JMPNext(); \
} \
LOCK((*_PREG)->y_u.OtaLl.d->ClPred->StatisticsForPred.lock); \
(*_PREG)->y_u.OtaLl.d->ClPred->StatisticsForPred.NOfRetries++; \
UNLOCK((*_PREG)->y_u.OtaLl.d->ClPred->StatisticsForPred.lock); \
(*_PREG) = (*_PREG)->y_u.OtaLl.d->ClCode; \
LOCK((*_PREG)->u.OtaLl.d->ClPred->StatisticsForPred.lock); \
(*_PREG)->u.OtaLl.d->ClPred->StatisticsForPred.NOfRetries++; \
UNLOCK((*_PREG)->u.OtaLl.d->ClPred->StatisticsForPred.lock); \
(*_PREG) = (*_PREG)->u.OtaLl.d->ClCode; \
S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG); \
set_cut(S_YREG, B->cp_b); \
SET_BB(B_YREG); \
@ -358,13 +358,13 @@
{ \
UInt timestamp; \
CACHE_Y(B); \
timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[(*_PREG)->y_u.OtaLl.s]); \
if (!VALID_TIMESTAMP(timestamp, (*_PREG)->y_u.OtaLl.d)) { \
(*_PREG)=(*_PREG)->y_u.OtaLl.n; \
timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[(*_PREG)->u.OtaLl.s]); \
if (!VALID_TIMESTAMP(timestamp, (*_PREG)->u.OtaLl.d)) { \
(*_PREG)=(*_PREG)->u.OtaLl.n; \
JMPNext(); \
} \
restore_yaam_regs((*_PREG)->y_u.OtaLl.n); \
restore_args((*_PREG)->y_u.OtaLl.s); \
restore_yaam_regs((*_PREG)->u.OtaLl.n); \
restore_args((*_PREG)->u.OtaLl.s); \
LOCAL_RetriesCounter--; \
if (LOCAL_RetriesCounter == 0) { \
saveregs(); \
@ -379,10 +379,10 @@
setregs(); \
JMPNext(); \
} \
LOCK((*_PREG)->y_u.OtaLl.d->ClPred->StatisticsForPred.lock); \
(*_PREG)->y_u.OtaLl.d->ClPred->StatisticsForPred.NOfRetries++; \
UNLOCK((*_PREG)->y_u.OtaLl.d->ClPred->StatisticsForPred.lock); \
(*_PREG) = (*_PREG)->y_u.OtaLl.d->ClCode; \
LOCK((*_PREG)->u.OtaLl.d->ClPred->StatisticsForPred.lock); \
(*_PREG)->u.OtaLl.d->ClPred->StatisticsForPred.NOfRetries++; \
UNLOCK((*_PREG)->u.OtaLl.d->ClPred->StatisticsForPred.lock); \
(*_PREG) = (*_PREG)->u.OtaLl.d->ClCode; \
set_cut(S_YREG, B_YREG->cp_b); \
SET_BB(B_YREG); \
ENDCACHE_Y(); \
@ -401,9 +401,9 @@
BLOCKADDRESS = (CELL)(*_PREG); \
CACHE_Y(B); \
{ \
LogUpdIndex *cl = (*_PREG)->y_u.OtILl.block; \
LogUpdIndex *cl = (*_PREG)->u.OtILl.block; \
PredEntry *ap = cl->ClPred; \
LogUpdClause *lcl = (*_PREG)->y_u.OtILl.d; \
LogUpdClause *lcl = (*_PREG)->u.OtILl.d; \
UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]); \
if (!VALID_TIMESTAMP(timestamp, lcl)) { \
(*_PREG) = FAILCODE; \
@ -472,9 +472,9 @@
BLOCKADDRESS = (CELL)(*_PREG); \
CACHE_Y(B); \
{ \
LogUpdIndex *cl = (*_PREG)->y_u.OtILl.block; \
LogUpdIndex *cl = (*_PREG)->u.OtILl.block; \
PredEntry *ap = cl->ClPred; \
LogUpdClause *lcl = (*_PREG)->y_u.OtILl.d; \
LogUpdClause *lcl = (*_PREG)->u.OtILl.d; \
UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]); \
if (!VALID_TIMESTAMP(timestamp, lcl)) { \
(*_PREG) = FAILCODE; \
@ -544,9 +544,9 @@
BLOCKADDRESS = (CELL)(*_PREG); \
CACHE_Y(B); \
{ \
LogUpdIndex *cl = (*_PREG)->y_u.OtILl.block; \
LogUpdIndex *cl = (*_PREG)->u.OtILl.block; \
PredEntry *ap = cl->ClPred; \
LogUpdClause *lcl = (*_PREG)->y_u.OtILl.d; \
LogUpdClause *lcl = (*_PREG)->u.OtILl.d; \
UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]); \
if (!VALID_TIMESTAMP(timestamp, lcl)) { \
(*_PREG) = FAILCODE; \
@ -609,9 +609,9 @@
BLOCKADDRESS = (CELL)(*_PREG); \
CACHE_Y(B); \
{ \
LogUpdIndex *cl = (*_PREG)->y_u.OtILl.block; \
LogUpdIndex *cl = (*_PREG)->u.OtILl.block; \
PredEntry *ap = cl->ClPred; \
LogUpdClause *lcl = (*_PREG)->y_u.OtILl.d; \
LogUpdClause *lcl = (*_PREG)->u.OtILl.d; \
UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]); \
if (!VALID_TIMESTAMP(timestamp, lcl)) { \
(*_PREG) = FAILCODE; \
@ -678,9 +678,9 @@
BLOCKADDRESS = (CELL)(*_PREG); \
CACHE_Y(B); \
{ \
LogUpdIndex *cl = (*_PREG)->y_u.OtILl.block; \
LogUpdIndex *cl = (*_PREG)->u.OtILl.block; \
PredEntry *ap = cl->ClPred; \
LogUpdClause *lcl = (*_PREG)->y_u.OtILl.d; \
LogUpdClause *lcl = (*_PREG)->u.OtILl.d; \
UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]); \
if (!VALID_TIMESTAMP(timestamp, lcl)) { \
(*_PREG) = FAILCODE; \
@ -752,9 +752,9 @@
BLOCKADDRESS = (CELL)(*_PREG); \
CACHE_Y(B); \
{ \
LogUpdIndex *cl = (*_PREG)->y_u.OtILl.block; \
LogUpdIndex *cl = (*_PREG)->u.OtILl.block; \
PredEntry *ap = cl->ClPred; \
LogUpdClause *lcl = (*_PREG)->y_u.OtILl.d; \
LogUpdClause *lcl = (*_PREG)->u.OtILl.d; \
UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]); \
if (!VALID_TIMESTAMP(timestamp, lcl)) { \
(*_PREG) = FAILCODE; \
@ -827,9 +827,9 @@
BLOCKADDRESS = (CELL)(*_PREG); \
CACHE_Y(B); \
{ \
LogUpdIndex *cl = (*_PREG)->y_u.OtILl.block; \
LogUpdIndex *cl = (*_PREG)->u.OtILl.block; \
PredEntry *ap = cl->ClPred; \
LogUpdClause *lcl = (*_PREG)->y_u.OtILl.d; \
LogUpdClause *lcl = (*_PREG)->u.OtILl.d; \
UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]); \
if (!VALID_TIMESTAMP(timestamp, lcl)) { \
(*_PREG) = FAILCODE; \
@ -895,9 +895,9 @@
BLOCKADDRESS = (CELL)(*_PREG); \
CACHE_Y(B); \
{ \
LogUpdIndex *cl = (*_PREG)->y_u.OtILl.block; \
LogUpdIndex *cl = (*_PREG)->u.OtILl.block; \
PredEntry *ap = cl->ClPred; \
LogUpdClause *lcl = (*_PREG)->y_u.OtILl.d; \
LogUpdClause *lcl = (*_PREG)->u.OtILl.d; \
UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]); \
if (!VALID_TIMESTAMP(timestamp, lcl)) { \
(*_PREG) = FAILCODE; \
@ -966,9 +966,9 @@
BLOCKADDRESS = (CELL)(*_PREG); \
CACHE_Y(B); \
{ \
LogUpdIndex *cl = (*_PREG)->y_u.OtILl.block; \
LogUpdIndex *cl = (*_PREG)->u.OtILl.block; \
PredEntry *ap = cl->ClPred; \
LogUpdClause *lcl = (*_PREG)->y_u.OtILl.d; \
LogUpdClause *lcl = (*_PREG)->u.OtILl.d; \
UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]); \
if (!VALID_TIMESTAMP(timestamp, lcl)) { \
(*_PREG) = FAILCODE; \
@ -1039,9 +1039,9 @@
BLOCKADDRESS = (CELL)(*_PREG); \
CACHE_Y(B); \
{ \
LogUpdIndex *cl = (*_PREG)->y_u.OtILl.block; \
LogUpdIndex *cl = (*_PREG)->u.OtILl.block; \
PredEntry *ap = cl->ClPred; \
LogUpdClause *lcl = (*_PREG)->y_u.OtILl.d; \
LogUpdClause *lcl = (*_PREG)->u.OtILl.d; \
UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]); \
if (!VALID_TIMESTAMP(timestamp, lcl)) { \
(*_PREG) = FAILCODE; \
@ -1113,9 +1113,9 @@
BLOCKADDRESS = (CELL)(*_PREG); \
CACHE_Y(B); \
{ \
LogUpdIndex *cl = (*_PREG)->y_u.OtILl.block; \
LogUpdIndex *cl = (*_PREG)->u.OtILl.block; \
PredEntry *ap = cl->ClPred; \
LogUpdClause *lcl = (*_PREG)->y_u.OtILl.d; \
LogUpdClause *lcl = (*_PREG)->u.OtILl.d; \
UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]); \
if (!VALID_TIMESTAMP(timestamp, lcl)) { \
(*_PREG) = FAILCODE; \
@ -1180,9 +1180,9 @@
BLOCKADDRESS = (CELL)(*_PREG); \
CACHE_Y(B); \
{ \
LogUpdIndex *cl = (*_PREG)->y_u.OtILl.block; \
LogUpdIndex *cl = (*_PREG)->u.OtILl.block; \
PredEntry *ap = cl->ClPred; \
LogUpdClause *lcl = (*_PREG)->y_u.OtILl.d; \
LogUpdClause *lcl = (*_PREG)->u.OtILl.d; \
UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]); \
if (!VALID_TIMESTAMP(timestamp, lcl)) { \
(*_PREG) = FAILCODE; \

View File

@ -1,8 +1,8 @@
#define COUNT_CALL_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
LOCK((*_PREG)->y_u.p.p->StatisticsForPred.lock); \
(*_PREG)->y_u.p.p->StatisticsForPred.NOfEntries++; \
UNLOCK((*_PREG)->y_u.p.p->StatisticsForPred.lock); \
LOCK((*_PREG)->u.p.p->StatisticsForPred.lock); \
(*_PREG)->u.p.p->StatisticsForPred.NOfEntries++; \
UNLOCK((*_PREG)->u.p.p->StatisticsForPred.lock); \
LOCAL_ReductionsCounter--;
#define COUNT_CALL_MIDDLE \
@ -28,9 +28,9 @@
#define COUNT_RETRY_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
LOCK((*_PREG)->y_u.p.p->StatisticsForPred.lock); \
(*_PREG)->y_u.p.p->StatisticsForPred.NOfRetries++; \
UNLOCK((*_PREG)->y_u.p.p->StatisticsForPred.lock); \
LOCK((*_PREG)->u.p.p->StatisticsForPred.lock); \
(*_PREG)->u.p.p->StatisticsForPred.NOfRetries++; \
UNLOCK((*_PREG)->u.p.p->StatisticsForPred.lock); \
LOCAL_RetriesCounter--;
#define COUNT_RETRY_MIDDLE \
@ -59,8 +59,8 @@
#define COUNT_RETRY_ME_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
CACHE_Y(B); \
restore_yaam_regs((*_PREG)->y_u.Otapl.d); \
restore_args((*_PREG)->y_u.Otapl.s);
restore_yaam_regs((*_PREG)->u.Otapl.d); \
restore_args((*_PREG)->u.Otapl.s);
#ifdef FROZEN_STACKS
#define COUNT_RETRY_ME_MIDDLE \
@ -68,9 +68,9 @@
set_cut(S_YREG, B->cp_b); \
SET_BB(B_YREG); \
ENDCACHE_Y(); \
LOCK(((PredEntry *)((*_PREG)->y_u.Otapl.p))->StatisticsForPred.lock); \
((PredEntry *)((*_PREG)->y_u.Otapl.p))->StatisticsForPred.NOfRetries++; \
UNLOCK(((PredEntry *)((*_PREG)->y_u.Otapl.p))->StatisticsForPred.lock); \
LOCK(((PredEntry *)((*_PREG)->u.Otapl.p))->StatisticsForPred.lock); \
((PredEntry *)((*_PREG)->u.Otapl.p))->StatisticsForPred.NOfRetries++; \
UNLOCK(((PredEntry *)((*_PREG)->u.Otapl.p))->StatisticsForPred.lock); \
LOCAL_RetriesCounter--; \
if (LOCAL_RetriesCounter == 0 && LOCAL_RetriesCounterOn) { \
saveregs(); \
@ -90,9 +90,9 @@
set_cut(S_YREG, B_YREG->cp_b); \
SET_BB(B_YREG); \
ENDCACHE_Y(); \
LOCK(((PredEntry *)((*_PREG)->y_u.Otapl.p))->StatisticsForPred.lock); \
((PredEntry *)((*_PREG)->y_u.Otapl.p))->StatisticsForPred.NOfRetries++; \
UNLOCK(((PredEntry *)((*_PREG)->y_u.Otapl.p))->StatisticsForPred.lock); \
LOCK(((PredEntry *)((*_PREG)->u.Otapl.p))->StatisticsForPred.lock); \
((PredEntry *)((*_PREG)->u.Otapl.p))->StatisticsForPred.NOfRetries++; \
UNLOCK(((PredEntry *)((*_PREG)->u.Otapl.p))->StatisticsForPred.lock); \
LOCAL_RetriesCounter--; \
if (LOCAL_RetriesCounter == 0 && LOCAL_RetriesCounterOn) { \
saveregs(); \
@ -122,14 +122,14 @@
#define COUNT_TRUST_ME_MIDDLE \
if (SCH_top_shared_cp(B)) { \
SCH_last_alternative((*_PREG), B_YREG); \
restore_args((*_PREG)->y_u.Otapl.s); \
restore_args((*_PREG)->u.Otapl.s); \
S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG); \
set_cut(S_YREG, B->cp_b); \
} \
else \
{ \
pop_yaam_regs(); \
pop_args((*_PREG)->y_u.Otapl.s); \
pop_args((*_PREG)->u.Otapl.s); \
S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG); \
set_cut(S_YREG, B); \
} \
@ -153,13 +153,13 @@
#define COUNT_TRUST_ME_MIDDLE \
if (SCH_top_shared_cp(B)) { \
SCH_last_alternative((*_PREG), B_YREG); \
restore_args((*_PREG)->y_u.Otapl.s); \
restore_args((*_PREG)->u.Otapl.s); \
set_cut(S_YREG, B->cp_b); \
} \
else \
{ \
pop_yaam_regs(); \
pop_args((*_PREG)->y_u.Otapl.s); \
pop_args((*_PREG)->u.Otapl.s); \
set_cut(S_YREG, B); \
} \
SET_BB(B_YREG); \
@ -184,7 +184,7 @@
#define COUNT_TRUST_ME_MIDDLE \
{ \
pop_yaam_regs(); \
pop_args((*_PREG)->y_u.Otapl.s); \
pop_args((*_PREG)->u.Otapl.s); \
S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG); \
set_cut(S_YREG, B); \
} \
@ -208,7 +208,7 @@
#define COUNT_TRUST_ME_MIDDLE \
{ \
pop_yaam_regs(); \
pop_args((*_PREG)->y_u.Otapl.s); \
pop_args((*_PREG)->u.Otapl.s); \
set_cut(S_YREG, B); \
} \
SET_BB(B_YREG); \
@ -231,9 +231,9 @@
#endif /* YAPOR */
#define COUNT_TRUST_ME_END \
LOCK(((PredEntry *)((*_PREG)->y_u.Otapl.p))->StatisticsForPred.lock); \
((PredEntry *)((*_PREG)->y_u.Otapl.p))->StatisticsForPred.NOfRetries++; \
UNLOCK(((PredEntry *)((*_PREG)->y_u.Otapl.p))->StatisticsForPred.lock); \
LOCK(((PredEntry *)((*_PREG)->u.Otapl.p))->StatisticsForPred.lock); \
((PredEntry *)((*_PREG)->u.Otapl.p))->StatisticsForPred.NOfRetries++; \
UNLOCK(((PredEntry *)((*_PREG)->u.Otapl.p))->StatisticsForPred.lock); \
(*_PREG) = NEXTOP((*_PREG), Otapl); \
GONext();
@ -246,13 +246,13 @@
{ \
UInt timestamp; \
CACHE_Y(B); \
timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[(*_PREG)->y_u.OtaLl.s]); \
if (!VALID_TIMESTAMP(timestamp, (*_PREG)->y_u.OtaLl.d)) { \
(*_PREG)=(*_PREG)->y_u.OtaLl.n; \
timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[(*_PREG)->u.OtaLl.s]); \
if (!VALID_TIMESTAMP(timestamp, (*_PREG)->u.OtaLl.d)) { \
(*_PREG)=(*_PREG)->u.OtaLl.n; \
JMPNext(); \
} \
restore_yaam_regs((*_PREG)->y_u.OtaLl.n); \
restore_args((*_PREG)->y_u.OtaLl.s); \
restore_yaam_regs((*_PREG)->u.OtaLl.n); \
restore_args((*_PREG)->u.OtaLl.s); \
LOCAL_RetriesCounter--; \
if (LOCAL_RetriesCounter == 0) { \
saveregs(); \
@ -267,11 +267,11 @@
setregs(); \
JMPNext(); \
} \
LOCK((*_PREG)->y_u.OtaLl.d->ClPred->StatisticsForPred.lock); \
(*_PREG)->y_u.OtaLl.d->ClPred->StatisticsForPred.NOfRetries++; \
UNLOCK((*_PREG)->y_u.OtaLl.d->ClPred->StatisticsForPred.lock); \
PP = (*_PREG)->y_u.OtaLl.d->ClPred; \
(*_PREG) = (*_PREG)->y_u.OtaLl.d->ClCode; \
LOCK((*_PREG)->u.OtaLl.d->ClPred->StatisticsForPred.lock); \
(*_PREG)->u.OtaLl.d->ClPred->StatisticsForPred.NOfRetries++; \
UNLOCK((*_PREG)->u.OtaLl.d->ClPred->StatisticsForPred.lock); \
PP = (*_PREG)->u.OtaLl.d->ClPred; \
(*_PREG) = (*_PREG)->u.OtaLl.d->ClCode; \
S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG); \
set_cut(S_YREG, B->cp_b); \
SET_BB(B_YREG); \
@ -286,13 +286,13 @@
{ \
UInt timestamp; \
CACHE_Y(B); \
timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[(*_PREG)->y_u.OtaLl.s]); \
if (!VALID_TIMESTAMP(timestamp, (*_PREG)->y_u.OtaLl.d)) { \
(*_PREG)=(*_PREG)->y_u.OtaLl.n; \
timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[(*_PREG)->u.OtaLl.s]); \
if (!VALID_TIMESTAMP(timestamp, (*_PREG)->u.OtaLl.d)) { \
(*_PREG)=(*_PREG)->u.OtaLl.n; \
JMPNext(); \
} \
restore_yaam_regs((*_PREG)->y_u.OtaLl.n); \
restore_args((*_PREG)->y_u.OtaLl.s); \
restore_yaam_regs((*_PREG)->u.OtaLl.n); \
restore_args((*_PREG)->u.OtaLl.s); \
LOCAL_RetriesCounter--; \
if (LOCAL_RetriesCounter == 0) { \
saveregs(); \
@ -307,11 +307,11 @@
setregs(); \
JMPNext(); \
} \
LOCK((*_PREG)->y_u.OtaLl.d->ClPred->StatisticsForPred.lock); \
(*_PREG)->y_u.OtaLl.d->ClPred->StatisticsForPred.NOfRetries++; \
UNLOCK((*_PREG)->y_u.OtaLl.d->ClPred->StatisticsForPred.lock); \
PP = (*_PREG)->y_u.OtaLl.d->ClPred; \
(*_PREG) = (*_PREG)->y_u.OtaLl.d->ClCode; \
LOCK((*_PREG)->u.OtaLl.d->ClPred->StatisticsForPred.lock); \
(*_PREG)->u.OtaLl.d->ClPred->StatisticsForPred.NOfRetries++; \
UNLOCK((*_PREG)->u.OtaLl.d->ClPred->StatisticsForPred.lock); \
PP = (*_PREG)->u.OtaLl.d->ClPred; \
(*_PREG) = (*_PREG)->u.OtaLl.d->ClCode; \
set_cut(S_YREG, B_YREG->cp_b); \
SET_BB(B_YREG); \
ENDCACHE_Y(); \
@ -327,13 +327,13 @@
{ \
UInt timestamp; \
CACHE_Y(B); \
timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[(*_PREG)->y_u.OtaLl.s]); \
if (!VALID_TIMESTAMP(timestamp, (*_PREG)->y_u.OtaLl.d)) { \
(*_PREG)=(*_PREG)->y_u.OtaLl.n; \
timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[(*_PREG)->u.OtaLl.s]); \
if (!VALID_TIMESTAMP(timestamp, (*_PREG)->u.OtaLl.d)) { \
(*_PREG)=(*_PREG)->u.OtaLl.n; \
JMPNext(); \
} \
restore_yaam_regs((*_PREG)->y_u.OtaLl.n); \
restore_args((*_PREG)->y_u.OtaLl.s); \
restore_yaam_regs((*_PREG)->u.OtaLl.n); \
restore_args((*_PREG)->u.OtaLl.s); \
LOCAL_RetriesCounter--; \
if (LOCAL_RetriesCounter == 0) { \
saveregs(); \
@ -348,10 +348,10 @@
setregs(); \
JMPNext(); \
} \
LOCK((*_PREG)->y_u.OtaLl.d->ClPred->StatisticsForPred.lock); \
(*_PREG)->y_u.OtaLl.d->ClPred->StatisticsForPred.NOfRetries++; \
UNLOCK((*_PREG)->y_u.OtaLl.d->ClPred->StatisticsForPred.lock); \
(*_PREG) = (*_PREG)->y_u.OtaLl.d->ClCode; \
LOCK((*_PREG)->u.OtaLl.d->ClPred->StatisticsForPred.lock); \
(*_PREG)->u.OtaLl.d->ClPred->StatisticsForPred.NOfRetries++; \
UNLOCK((*_PREG)->u.OtaLl.d->ClPred->StatisticsForPred.lock); \
(*_PREG) = (*_PREG)->u.OtaLl.d->ClCode; \
S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG); \
set_cut(S_YREG, B->cp_b); \
SET_BB(B_YREG); \
@ -366,13 +366,13 @@
{ \
UInt timestamp; \
CACHE_Y(B); \
timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[(*_PREG)->y_u.OtaLl.s]); \
if (!VALID_TIMESTAMP(timestamp, (*_PREG)->y_u.OtaLl.d)) { \
(*_PREG)=(*_PREG)->y_u.OtaLl.n; \
timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[(*_PREG)->u.OtaLl.s]); \
if (!VALID_TIMESTAMP(timestamp, (*_PREG)->u.OtaLl.d)) { \
(*_PREG)=(*_PREG)->u.OtaLl.n; \
JMPNext(); \
} \
restore_yaam_regs((*_PREG)->y_u.OtaLl.n); \
restore_args((*_PREG)->y_u.OtaLl.s); \
restore_yaam_regs((*_PREG)->u.OtaLl.n); \
restore_args((*_PREG)->u.OtaLl.s); \
LOCAL_RetriesCounter--; \
if (LOCAL_RetriesCounter == 0) { \
saveregs(); \
@ -387,10 +387,10 @@
setregs(); \
JMPNext(); \
} \
LOCK((*_PREG)->y_u.OtaLl.d->ClPred->StatisticsForPred.lock); \
(*_PREG)->y_u.OtaLl.d->ClPred->StatisticsForPred.NOfRetries++; \
UNLOCK((*_PREG)->y_u.OtaLl.d->ClPred->StatisticsForPred.lock); \
(*_PREG) = (*_PREG)->y_u.OtaLl.d->ClCode; \
LOCK((*_PREG)->u.OtaLl.d->ClPred->StatisticsForPred.lock); \
(*_PREG)->u.OtaLl.d->ClPred->StatisticsForPred.NOfRetries++; \
UNLOCK((*_PREG)->u.OtaLl.d->ClPred->StatisticsForPred.lock); \
(*_PREG) = (*_PREG)->u.OtaLl.d->ClCode; \
set_cut(S_YREG, B_YREG->cp_b); \
SET_BB(B_YREG); \
ENDCACHE_Y(); \
@ -410,9 +410,9 @@
BLOCKADDRESS = (CELL)(*_PREG); \
CACHE_Y(B); \
{ \
LogUpdIndex *cl = (*_PREG)->y_u.OtILl.block; \
LogUpdIndex *cl = (*_PREG)->u.OtILl.block; \
PredEntry *ap = cl->ClPred; \
LogUpdClause *lcl = (*_PREG)->y_u.OtILl.d; \
LogUpdClause *lcl = (*_PREG)->u.OtILl.d; \
UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]); \
if (!VALID_TIMESTAMP(timestamp, lcl)) { \
(*_PREG) = FAILCODE; \
@ -482,9 +482,9 @@
BLOCKADDRESS = (CELL)(*_PREG); \
CACHE_Y(B); \
{ \
LogUpdIndex *cl = (*_PREG)->y_u.OtILl.block; \
LogUpdIndex *cl = (*_PREG)->u.OtILl.block; \
PredEntry *ap = cl->ClPred; \
LogUpdClause *lcl = (*_PREG)->y_u.OtILl.d; \
LogUpdClause *lcl = (*_PREG)->u.OtILl.d; \
UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]); \
if (!VALID_TIMESTAMP(timestamp, lcl)) { \
(*_PREG) = FAILCODE; \
@ -555,9 +555,9 @@
BLOCKADDRESS = (CELL)(*_PREG); \
CACHE_Y(B); \
{ \
LogUpdIndex *cl = (*_PREG)->y_u.OtILl.block; \
LogUpdIndex *cl = (*_PREG)->u.OtILl.block; \
PredEntry *ap = cl->ClPred; \
LogUpdClause *lcl = (*_PREG)->y_u.OtILl.d; \
LogUpdClause *lcl = (*_PREG)->u.OtILl.d; \
UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]); \
if (!VALID_TIMESTAMP(timestamp, lcl)) { \
(*_PREG) = FAILCODE; \
@ -621,9 +621,9 @@
BLOCKADDRESS = (CELL)(*_PREG); \
CACHE_Y(B); \
{ \
LogUpdIndex *cl = (*_PREG)->y_u.OtILl.block; \
LogUpdIndex *cl = (*_PREG)->u.OtILl.block; \
PredEntry *ap = cl->ClPred; \
LogUpdClause *lcl = (*_PREG)->y_u.OtILl.d; \
LogUpdClause *lcl = (*_PREG)->u.OtILl.d; \
UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]); \
if (!VALID_TIMESTAMP(timestamp, lcl)) { \
(*_PREG) = FAILCODE; \
@ -691,9 +691,9 @@
BLOCKADDRESS = (CELL)(*_PREG); \
CACHE_Y(B); \
{ \
LogUpdIndex *cl = (*_PREG)->y_u.OtILl.block; \
LogUpdIndex *cl = (*_PREG)->u.OtILl.block; \
PredEntry *ap = cl->ClPred; \
LogUpdClause *lcl = (*_PREG)->y_u.OtILl.d; \
LogUpdClause *lcl = (*_PREG)->u.OtILl.d; \
UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]); \
if (!VALID_TIMESTAMP(timestamp, lcl)) { \
(*_PREG) = FAILCODE; \
@ -766,9 +766,9 @@
BLOCKADDRESS = (CELL)(*_PREG); \
CACHE_Y(B); \
{ \
LogUpdIndex *cl = (*_PREG)->y_u.OtILl.block; \
LogUpdIndex *cl = (*_PREG)->u.OtILl.block; \
PredEntry *ap = cl->ClPred; \
LogUpdClause *lcl = (*_PREG)->y_u.OtILl.d; \
LogUpdClause *lcl = (*_PREG)->u.OtILl.d; \
UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]); \
if (!VALID_TIMESTAMP(timestamp, lcl)) { \
(*_PREG) = FAILCODE; \
@ -842,9 +842,9 @@
BLOCKADDRESS = (CELL)(*_PREG); \
CACHE_Y(B); \
{ \
LogUpdIndex *cl = (*_PREG)->y_u.OtILl.block; \
LogUpdIndex *cl = (*_PREG)->u.OtILl.block; \
PredEntry *ap = cl->ClPred; \
LogUpdClause *lcl = (*_PREG)->y_u.OtILl.d; \
LogUpdClause *lcl = (*_PREG)->u.OtILl.d; \
UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]); \
if (!VALID_TIMESTAMP(timestamp, lcl)) { \
(*_PREG) = FAILCODE; \
@ -911,9 +911,9 @@
BLOCKADDRESS = (CELL)(*_PREG); \
CACHE_Y(B); \
{ \
LogUpdIndex *cl = (*_PREG)->y_u.OtILl.block; \
LogUpdIndex *cl = (*_PREG)->u.OtILl.block; \
PredEntry *ap = cl->ClPred; \
LogUpdClause *lcl = (*_PREG)->y_u.OtILl.d; \
LogUpdClause *lcl = (*_PREG)->u.OtILl.d; \
UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]); \
if (!VALID_TIMESTAMP(timestamp, lcl)) { \
(*_PREG) = FAILCODE; \
@ -983,9 +983,9 @@
BLOCKADDRESS = (CELL)(*_PREG); \
CACHE_Y(B); \
{ \
LogUpdIndex *cl = (*_PREG)->y_u.OtILl.block; \
LogUpdIndex *cl = (*_PREG)->u.OtILl.block; \
PredEntry *ap = cl->ClPred; \
LogUpdClause *lcl = (*_PREG)->y_u.OtILl.d; \
LogUpdClause *lcl = (*_PREG)->u.OtILl.d; \
UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]); \
if (!VALID_TIMESTAMP(timestamp, lcl)) { \
(*_PREG) = FAILCODE; \
@ -1057,9 +1057,9 @@
BLOCKADDRESS = (CELL)(*_PREG); \
CACHE_Y(B); \
{ \
LogUpdIndex *cl = (*_PREG)->y_u.OtILl.block; \
LogUpdIndex *cl = (*_PREG)->u.OtILl.block; \
PredEntry *ap = cl->ClPred; \
LogUpdClause *lcl = (*_PREG)->y_u.OtILl.d; \
LogUpdClause *lcl = (*_PREG)->u.OtILl.d; \
UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]); \
if (!VALID_TIMESTAMP(timestamp, lcl)) { \
(*_PREG) = FAILCODE; \
@ -1132,9 +1132,9 @@
BLOCKADDRESS = (CELL)(*_PREG); \
CACHE_Y(B); \
{ \
LogUpdIndex *cl = (*_PREG)->y_u.OtILl.block; \
LogUpdIndex *cl = (*_PREG)->u.OtILl.block; \
PredEntry *ap = cl->ClPred; \
LogUpdClause *lcl = (*_PREG)->y_u.OtILl.d; \
LogUpdClause *lcl = (*_PREG)->u.OtILl.d; \
UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]); \
if (!VALID_TIMESTAMP(timestamp, lcl)) { \
(*_PREG) = FAILCODE; \
@ -1200,9 +1200,9 @@
BLOCKADDRESS = (CELL)(*_PREG); \
CACHE_Y(B); \
{ \
LogUpdIndex *cl = (*_PREG)->y_u.OtILl.block; \
LogUpdIndex *cl = (*_PREG)->u.OtILl.block; \
PredEntry *ap = cl->ClPred; \
LogUpdClause *lcl = (*_PREG)->y_u.OtILl.d; \
LogUpdClause *lcl = (*_PREG)->u.OtILl.d; \
UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]); \
if (!VALID_TIMESTAMP(timestamp, lcl)) { \
(*_PREG) = FAILCODE; \

View File

@ -4,7 +4,7 @@
register CELL d0; \
PredEntry *pt0; \
register CELL *ENV_YREG = (YREG); \
pt0 = (*_PREG)->y_u.pp.p;
pt0 = (*_PREG)->u.pp.p;
#ifdef LOW_LEVEL_TRACER
#define EXECUTE_LOW_LEVEL_TRACER \
@ -53,14 +53,14 @@
#ifdef LOW_LEVEL_TRACER
#define DEXECUTE_LOW_LEVEL_TRACER \
low_level_trace(enter_pred,(*_PREG)->y_u.pp.p,XREGS+1);
low_level_trace(enter_pred,(*_PREG)->u.pp.p,XREGS+1);
#endif
#define DEXECUTE_POST_LOW_LEVEL_TRACER \
CACHE_Y_AS_ENV(YREG); \
PredEntry *pt0; \
CACHE_A1(); \
pt0 = (*_PREG)->y_u.pp.p;
pt0 = (*_PREG)->u.pp.p;
#ifdef DEPTH_LIMIT
#define DEXECUTE_DEPTH_MINOR \
@ -169,18 +169,18 @@
#ifdef LOW_LEVEL_TRACER
#define CALL_LOW_LEVEL_TRACER \
low_level_trace(enter_pred,(*_PREG)->y_u.Osbpp.p,XREGS+1);
low_level_trace(enter_pred,(*_PREG)->u.Osbpp.p,XREGS+1);
#endif
#define CALL_POST_LOW_LEVEL_TRACER \
register CELL *ENV_YREG = (YREG); \
PredEntry *pt; \
pt = (*_PREG)->y_u.Osbpp.p; \
pt = (*_PREG)->u.Osbpp.p; \
CACHE_A1();
#define CALL_POST_NO_CHECKING \
ENV = ENV_YREG; \
ENV_YREG = (CELL *) (((char *) ENV_YREG) + (*_PREG)->y_u.Osbpp.s); \
ENV_YREG = (CELL *) (((char *) ENV_YREG) + (*_PREG)->u.Osbpp.s); \
(*_CPREG) = NEXTOP((*_PREG), Osbpp); \
(*_PREG) = pt->CodeOfPred; \
save_pc(); \

View File

@ -4,14 +4,14 @@
#if (defined(YAPOR_SBA) && defined(YAPOR)) || defined(TABLING)
#define CALL_CPRED_TEST_STACK \
if (!((*_PREG)->y_u.Osbpp.p->PredFlags & (SafePredFlag|HiddenPredFlag))) { \
if (!((*_PREG)->u.Osbpp.p->PredFlags & (SafePredFlag|HiddenPredFlag))) { \
CACHE_Y_AS_ENV(YREG); \
if (__builtin_expect( ((Int)(Unsigned(YOUNGEST_CP((choiceptr)ENV_YREG,B_FZ)) - Unsigned(YOUNGEST_H(H_FZ,HR))) < CreepFlag), 0) ) { return external_labels[6]; } \
if (__builtin_expect( ((Int)(Unsigned(YOUNGEST_CP((choiceptr)ENV_YREG,B_FZ)) - Unsigned(YOUNGEST_H(H_FZ,H))) < CreepFlag), 0) ) { return external_labels[6]; } \
ENDCACHE_Y_AS_ENV(); \
}
#else
#define CALL_CPRED_TEST_STACK \
if (!((*_PREG)->y_u.Osbpp.p->PredFlags & (SafePredFlag|HiddenPredFlag))) { \
if (!((*_PREG)->u.Osbpp.p->PredFlags & (SafePredFlag|HiddenPredFlag))) { \
CACHE_Y_AS_ENV(YREG); \
if (__builtin_expect(((Int)(Unsigned(ENV_YREG) - Unsigned(HR)) < CreepFlag ), 0) ) { return external_labels[6]; } \
ENDCACHE_Y_AS_ENV(); \
@ -27,27 +27,27 @@
if (YREG > (CELL *) top_b || YREG < HR) \
ASP = (CELL *)top_b; \
else \
ASP = (CELL *)(((char *)YREG) + (*_PREG)->y_u.Osbpp.s);
ASP = (CELL *)(((char *)YREG) + (*_PREG)->u.Osbpp.s);
#else /* YAPOR_SBA */
#define CALL_CPRED_TOPB \
if (YREG > (CELL *) top_b) \
ASP = (CELL *)top_b; \
else \
ASP = (CELL *)(((char *)YREG) + (*_PREG)->y_u.Osbpp.s);
ASP = (CELL *)(((char *)YREG) + (*_PREG)->u.Osbpp.s);
#endif /* YAPOR_SBA */
#else
#define CALL_CPRED_NOFROZEN \
SET_ASP(YREG, (*_PREG)->y_u.Osbpp.s);
SET_ASP(YREG, (*_PREG)->u.Osbpp.s);
#endif
#ifdef LOW_LEVEL_TRACER
#define CALL_CPRED_LOW_LEVEL_TRACER \
low_level_trace(enter_pred,(*_PREG)->y_u.Osbpp.p,XREGS+1);
low_level_trace(enter_pred,(*_PREG)->u.Osbpp.p,XREGS+1);
#endif
#define CALL_CPRED_POST_LOW_LEVEL_TRACER \
CPredicate f = (*_PREG)->y_u.Osbpp.p->cs.f_code; \
CPredicate f = (*_PREG)->u.Osbpp.p->cs.f_code; \
(*_PREG) = NEXTOP((*_PREG), Osbpp); \
saveregs(); \
d0 = (f)(PASS_REGS1); \
@ -105,7 +105,7 @@
#endif
#define EXECUTE_CPRED_POST_FROZEN \
pt0 = (*_PREG)->y_u.pp.p;
pt0 = (*_PREG)->u.pp.p;
#ifdef LOW_LEVEL_TRACER
#define EXECUTE_CPRED_LOW_LEVEL_TRACER \
@ -146,7 +146,7 @@
#define EXECUTE_CPRED_END \
BLOCK = (CELL)EXECUTE_CPRED_END; \
if (!FAILED) { \
CPredicate f = (*_PREG)->y_u.pp.p->cs.f_code; \
CPredicate f = (*_PREG)->u.pp.p->cs.f_code; \
yamop *oldPREG = (*_PREG); \
saveregs(); \
d0 = (f)(PASS_REGS1); \
@ -172,7 +172,7 @@
#define EXECUTE_CPRED_END \
BLOCK = (CELL)EXECUTE_CPRED_END; \
if (!FAILED) { \
CPredicate f = (*_PREG)->y_u.pp.p->cs.f_code; \
CPredicate f = (*_PREG)->u.pp.p->cs.f_code; \
yamop *oldPREG = (*_PREG); \
saveregs(); \
d0 = (f)(PASS_REGS1); \
@ -199,7 +199,7 @@
#define EXECUTE_CPRED_END \
BLOCK = (CELL)EXECUTE_CPRED_END; \
if (!FAILED) { \
CPredicate f = (*_PREG)->y_u.pp.p->cs.f_code; \
CPredicate f = (*_PREG)->u.pp.p->cs.f_code; \
yamop *oldPREG = (*_PREG); \
saveregs(); \
d0 = (f)(PASS_REGS1); \
@ -224,7 +224,7 @@
#define EXECUTE_CPRED_END \
BLOCK = (CELL)EXECUTE_CPRED_END; \
if (!FAILED) { \
CPredicate f = (*_PREG)->y_u.pp.p->cs.f_code; \
CPredicate f = (*_PREG)->u.pp.p->cs.f_code; \
yamop *oldPREG = (*_PREG); \
saveregs(); \
d0 = (f)(PASS_REGS1); \
@ -251,7 +251,7 @@
#define CALL_USERCPRED_INSTINIT \
BLOCKADDRESS = (CELL)(*_PREG); \
CACHE_Y_AS_ENV(YREG); \
if (__builtin_expect( ((Int)(Unsigned(YOUNGEST_CP((choiceptr)ENV_YREG,B_FZ)) - Unsigned(YOUNGEST_H(H_FZ,HR))) < CreepFlag), 0) ) { return external_labels[6]; } \
if (__builtin_expect( ((Int)(Unsigned(YOUNGEST_CP((choiceptr)ENV_YREG,B_FZ)) - Unsigned(YOUNGEST_H(H_FZ,H))) < CreepFlag), 0) ) { return external_labels[6]; } \
ENDCACHE_Y_AS_ENV();
#else
#define CALL_USERCPRED_INSTINIT \
@ -263,7 +263,7 @@
#ifdef LOW_LEVEL_TRACER
#define CALL_USERCPRED_LOW_LEVEL_TRACER \
low_level_trace(enter_pred,(*_PREG)->y_u.Osbpp.p,XREGS+1);
low_level_trace(enter_pred,(*_PREG)->u.Osbpp.p,XREGS+1);
#endif
#ifdef FROZEN_STACKS
@ -273,18 +273,18 @@
if (YREG > (CELL *) top_b || YREG < HR) \
ASP = (CELL *) top_b; \
else \
ASP = (CELL *)(((char *)YREG) + (*_PREG)->y_u.Osbpp.s);
ASP = (CELL *)(((char *)YREG) + (*_PREG)->u.Osbpp.s);
#else /* YAPOR_SBA */
#define CALL_USERCPRED_FROZEN \
choiceptr top_b = PROTECT_FROZEN_B(B); \
if (YREG > (CELL *) top_b) \
ASP = (CELL *) top_b; \
else \
ASP = (CELL *)(((char *)YREG) + (*_PREG)->y_u.Osbpp.s);
ASP = (CELL *)(((char *)YREG) + (*_PREG)->u.Osbpp.s);
#endif /* YAPOR_SBA */
#else /* FROZEN_STACKS */
#define CALL_USERCPRED_FROZEN \
SET_ASP(YREG, (*_PREG)->y_u.Osbpp.s);
SET_ASP(YREG, (*_PREG)->u.Osbpp.s);
#endif /* FROZEN_STACKS */
#define CALL_USERCPRED_POST_FROZEN \
@ -292,7 +292,7 @@
Yap_StartSlots( PASS_REGS1 ); \
LOCAL_PrologMode = UserCCallMode; \
{ \
PredEntry *p = (*_PREG)->y_u.Osbpp.p; \
PredEntry *p = (*_PREG)->u.Osbpp.p; \
(*_PREG) = NEXTOP((*_PREG), Osbpp); \
savedP = (*_PREG); \
saveregs(); \

View File

@ -5,14 +5,14 @@
#if (defined(YAPOR_SBA) && defined(YAPOR)) || defined(TABLING)
#define CALL_CPRED_TEST_STACK \
if (!((*_PREG)->y_u.Osbpp.p->PredFlags & (SafePredFlag|HiddenPredFlag))) { \
if (!((*_PREG)->u.Osbpp.p->PredFlags & (SafePredFlag|HiddenPredFlag))) { \
CACHE_Y_AS_ENV(YREG); \
if (__builtin_expect( ((Int)(Unsigned(YOUNGEST_CP((choiceptr)ENV_YREG,B_FZ)) - Unsigned(YOUNGEST_H(H_FZ,HR))) < CreepFlag), 0) ) { return external_labels[6]; } \
if (__builtin_expect( ((Int)(Unsigned(YOUNGEST_CP((choiceptr)ENV_YREG,B_FZ)) - Unsigned(YOUNGEST_H(H_FZ,H))) < CreepFlag), 0) ) { return external_labels[6]; } \
ENDCACHE_Y_AS_ENV(); \
}
#else
#define CALL_CPRED_TEST_STACK \
if (!((*_PREG)->y_u.Osbpp.p->PredFlags & (SafePredFlag|HiddenPredFlag))) { \
if (!((*_PREG)->u.Osbpp.p->PredFlags & (SafePredFlag|HiddenPredFlag))) { \
CACHE_Y_AS_ENV(YREG); \
if (__builtin_expect(((Int)(Unsigned(ENV_YREG) - Unsigned(HR)) < CreepFlag ), 0) ) { return external_labels[6]; } \
ENDCACHE_Y_AS_ENV(); \
@ -28,27 +28,27 @@
if (YREG > (CELL *) top_b || YREG < HR) \
ASP = (CELL *)top_b; \
else \
ASP = (CELL *)(((char *)YREG) + (*_PREG)->y_u.Osbpp.s);
ASP = (CELL *)(((char *)YREG) + (*_PREG)->u.Osbpp.s);
#else /* YAPOR_SBA */
#define CALL_CPRED_TOPB \
if (YREG > (CELL *) top_b) \
ASP = (CELL *)top_b; \
else \
ASP = (CELL *)(((char *)YREG) + (*_PREG)->y_u.Osbpp.s);
ASP = (CELL *)(((char *)YREG) + (*_PREG)->u.Osbpp.s);
#endif /* YAPOR_SBA */
#else
#define CALL_CPRED_NOFROZEN \
SET_ASP(YREG, (*_PREG)->y_u.Osbpp.s);
SET_ASP(YREG, (*_PREG)->u.Osbpp.s);
#endif
#ifdef LOW_LEVEL_TRACER
#define CALL_CPRED_LOW_LEVEL_TRACER \
low_level_trace(enter_pred,(*_PREG)->y_u.Osbpp.p,XREGS+1);
low_level_trace(enter_pred,(*_PREG)->u.Osbpp.p,XREGS+1);
#endif
#define CALL_CPRED_POST_LOW_LEVEL_TRACER \
CPredicate f = (*_PREG)->y_u.Osbpp.p->cs.f_code; \
CPredicate f = (*_PREG)->u.Osbpp.p->cs.f_code; \
(*_PREG) = NEXTOP((*_PREG), Osbpp); \
saveregs(); \
d0 = (f)(PASS_REGS1); \
@ -107,7 +107,7 @@
#endif
#define EXECUTE_CPRED_POST_FROZEN \
pt0 = (*_PREG)->y_u.pp.p;
pt0 = (*_PREG)->u.pp.p;
#ifdef LOW_LEVEL_TRACER
#define EXECUTE_CPRED_LOW_LEVEL_TRACER \
@ -148,7 +148,7 @@
#define EXECUTE_CPRED_END \
BLOCK = (CELL)EXECUTE_CPRED_END; \
if (!FAILED) { \
CPredicate f = (*_PREG)->y_u.pp.p->cs.f_code; \
CPredicate f = (*_PREG)->u.pp.p->cs.f_code; \
yamop *oldPREG = (*_PREG); \
saveregs(); \
d0 = (f)(PASS_REGS1); \
@ -174,7 +174,7 @@
#define EXECUTE_CPRED_END \
BLOCK = (CELL)EXECUTE_CPRED_END; \
if (!FAILED) { \
CPredicate f = (*_PREG)->y_u.pp.p->cs.f_code; \
CPredicate f = (*_PREG)->u.pp.p->cs.f_code; \
yamop *oldPREG = (*_PREG); \
saveregs(); \
d0 = (f)(PASS_REGS1); \
@ -201,7 +201,7 @@
#define EXECUTE_CPRED_END \
BLOCK = (CELL)EXECUTE_CPRED_END; \
if (!FAILED) { \
CPredicate f = (*_PREG)->y_u.pp.p->cs.f_code; \
CPredicate f = (*_PREG)->u.pp.p->cs.f_code; \
yamop *oldPREG = (*_PREG); \
saveregs(); \
d0 = (f)(PASS_REGS1); \
@ -226,7 +226,7 @@
#define EXECUTE_CPRED_END \
BLOCK = (CELL)EXECUTE_CPRED_END; \
if (!FAILED) { \
CPredicate f = (*_PREG)->y_u.pp.p->cs.f_code; \
CPredicate f = (*_PREG)->u.pp.p->cs.f_code; \
yamop *oldPREG = (*_PREG); \
saveregs(); \
d0 = (f)(PASS_REGS1); \
@ -254,7 +254,7 @@
print_instruction((*_PREG), ON_NATIVE); \
BLOCKADDRESS = (CELL)(*_PREG); \
CACHE_Y_AS_ENV(YREG); \
if (__builtin_expect( ((Int)(Unsigned(YOUNGEST_CP((choiceptr)ENV_YREG,B_FZ)) - Unsigned(YOUNGEST_H(H_FZ,HR))) < CreepFlag), 0) ) { return external_labels[6]; } \
if (__builtin_expect( ((Int)(Unsigned(YOUNGEST_CP((choiceptr)ENV_YREG,B_FZ)) - Unsigned(YOUNGEST_H(H_FZ,H))) < CreepFlag), 0) ) { return external_labels[6]; } \
ENDCACHE_Y_AS_ENV();
#else
#define CALL_USERCPRED_INSTINIT \
@ -267,7 +267,7 @@
#ifdef LOW_LEVEL_TRACER
#define CALL_USERCPRED_LOW_LEVEL_TRACER \
low_level_trace(enter_pred,(*_PREG)->y_u.Osbpp.p,XREGS+1);
low_level_trace(enter_pred,(*_PREG)->u.Osbpp.p,XREGS+1);
#endif
#ifdef FROZEN_STACKS
@ -277,18 +277,18 @@
if (YREG > (CELL *) top_b || YREG < HR) \
ASP = (CELL *) top_b; \
else \
ASP = (CELL *)(((char *)YREG) + (*_PREG)->y_u.Osbpp.s);
ASP = (CELL *)(((char *)YREG) + (*_PREG)->u.Osbpp.s);
#else /* YAPOR_SBA */
#define CALL_USERCPRED_FROZEN \
choiceptr top_b = PROTECT_FROZEN_B(B); \
if (YREG > (CELL *) top_b) \
ASP = (CELL *) top_b; \
else \
ASP = (CELL *)(((char *)YREG) + (*_PREG)->y_u.Osbpp.s);
ASP = (CELL *)(((char *)YREG) + (*_PREG)->u.Osbpp.s);
#endif /* YAPOR_SBA */
#else /* FROZEN_STACKS */
#define CALL_USERCPRED_FROZEN \
SET_ASP(YREG, (*_PREG)->y_u.Osbpp.s);
SET_ASP(YREG, (*_PREG)->u.Osbpp.s);
#endif /* FROZEN_STACKS */
#define CALL_USERCPRED_POST_FROZEN \
@ -296,7 +296,7 @@
Yap_StartSlots( PASS_REGS1 ); \
LOCAL_PrologMode = UserCCallMode; \
{ \
PredEntry *p = (*_PREG)->y_u.Osbpp.p; \
PredEntry *p = (*_PREG)->u.Osbpp.p; \
(*_PREG) = NEXTOP((*_PREG), Osbpp); \
savedP = (*_PREG); \
saveregs(); \

View File

@ -8,7 +8,7 @@
#endif
#define CUT_NOCOROUTINING \
SET_ASP(YREG, (*_PREG)->y_u.s.s); \
SET_ASP(YREG, (*_PREG)->u.s.s); \
(*_PREG) = NEXTOP(NEXTOP(NEXTOP((*_PREG), s),Osbpp),l); \
saveregs(); \
prune((choiceptr)YREG[E_CB]); \
@ -25,7 +25,7 @@
#endif
#define CUT_T_NOCOROUTINING \
SET_ASP(YREG, (*_PREG)->y_u.s.s); \
SET_ASP(YREG, (*_PREG)->u.s.s); \
saveregs(); \
prune((choiceptr)YREG[E_CB]); \
setregs(); \
@ -42,7 +42,7 @@
#endif
#define CUT_E_NOCOROUTINING \
SET_ASP(YREG, (*_PREG)->y_u.s.s); \
SET_ASP(YREG, (*_PREG)->u.s.s); \
(*_PREG) = NEXTOP(NEXTOP(NEXTOP((*_PREG), s),Osbpp),l); \
saveregs(); \
prune((choiceptr)(*_SREG)[E_CB]); \
@ -51,7 +51,7 @@
#define SAVE_B_X_INSTINIT \
register CELL d0; \
d0 = (*_PREG)->y_u.x.x;
d0 = (*_PREG)->u.x.x;
#if defined(YAPOR_SBA) && defined(FROZEN_STACKS)
#define SAVE_B_X_YSBA_FROZEN \
@ -69,10 +69,10 @@
#if defined(YAPOR_SBA)
#define SAVE_B_Y_YSBA \
INITIALIZE_PERMVAR(YREG+(*_PREG)->y_u.y.y,MkIntegerTerm((Int)B));
INITIALIZE_PERMVAR(YREG+(*_PREG)->u.y.y,MkIntegerTerm((Int)B));
#else
#define SAVE_B_Y_NOYSBA \
INITIALIZE_PERMVAR(YREG+(*_PREG)->y_u.y.y,MkIntegerTerm(LCL0-(CELL *)(B)));
INITIALIZE_PERMVAR(YREG+(*_PREG)->u.y.y,MkIntegerTerm(LCL0-(CELL *)(B)));
#endif
#define SAVE_B_Y_END \
@ -84,10 +84,10 @@
register CELL *pt1;
#define COMMIT_B_X_DO_COMMIT_B_X \
d0 = XREG((*_PREG)->y_u.xps.x);
d0 = XREG((*_PREG)->u.xps.x);
#define COMMIT_B_X_COMMIT_B_X_NVAR \
SET_ASP(YREG, (*_PREG)->y_u.xps.s); \
SET_ASP(YREG, (*_PREG)->u.xps.s); \
(*_PREG) = NEXTOP(NEXTOP(NEXTOP((*_PREG), xps),Osbpp),l); \
choiceptr pt0;
@ -112,10 +112,10 @@
register CELL *pt1;
#define COMMIT_B_Y_DO_COMMIT_B_Y \
d0 = YREG[(*_PREG)->y_u.yps.y];
d0 = YREG[(*_PREG)->u.yps.y];
#define COMMIT_B_Y_COMMIT_B_Y_NVAR \
SET_ASP(YREG, (*_PREG)->y_u.yps.s); \
SET_ASP(YREG, (*_PREG)->u.yps.s); \
(*_PREG) = NEXTOP(NEXTOP(NEXTOP((*_PREG), yps),Osbpp),l); \
choiceptr pt0;

View File

@ -9,7 +9,7 @@
#endif
#define CUT_NOCOROUTINING \
SET_ASP(YREG, (*_PREG)->y_u.s.s); \
SET_ASP(YREG, (*_PREG)->u.s.s); \
(*_PREG) = NEXTOP(NEXTOP(NEXTOP((*_PREG), s),Osbpp),l); \
saveregs(); \
prune((choiceptr)YREG[E_CB]); \
@ -27,7 +27,7 @@
#endif
#define CUT_T_NOCOROUTINING \
SET_ASP(YREG, (*_PREG)->y_u.s.s); \
SET_ASP(YREG, (*_PREG)->u.s.s); \
saveregs(); \
prune((choiceptr)YREG[E_CB]); \
setregs(); \
@ -45,7 +45,7 @@
#endif
#define CUT_E_NOCOROUTINING \
SET_ASP(YREG, (*_PREG)->y_u.s.s); \
SET_ASP(YREG, (*_PREG)->u.s.s); \
(*_PREG) = NEXTOP(NEXTOP(NEXTOP((*_PREG), s),Osbpp),l); \
saveregs(); \
prune((choiceptr)(*_SREG)[E_CB]); \
@ -55,7 +55,7 @@
#define SAVE_B_X_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
register CELL d0; \
d0 = (*_PREG)->y_u.x.x;
d0 = (*_PREG)->u.x.x;
#if defined(YAPOR_SBA) && defined(FROZEN_STACKS)
#define SAVE_B_X_YSBA_FROZEN \
@ -73,10 +73,10 @@
#if defined(YAPOR_SBA)
#define SAVE_B_Y_YSBA \
INITIALIZE_PERMVAR(YREG+(*_PREG)->y_u.y.y,MkIntegerTerm((Int)B));
INITIALIZE_PERMVAR(YREG+(*_PREG)->u.y.y,MkIntegerTerm((Int)B));
#else
#define SAVE_B_Y_NOYSBA \
INITIALIZE_PERMVAR(YREG+(*_PREG)->y_u.y.y,MkIntegerTerm(LCL0-(CELL *)(B)));
INITIALIZE_PERMVAR(YREG+(*_PREG)->u.y.y,MkIntegerTerm(LCL0-(CELL *)(B)));
#endif
#define SAVE_B_Y_END \
@ -89,10 +89,10 @@
register CELL *pt1;
#define COMMIT_B_X_DO_COMMIT_B_X \
d0 = XREG((*_PREG)->y_u.xps.x);
d0 = XREG((*_PREG)->u.xps.x);
#define COMMIT_B_X_COMMIT_B_X_NVAR \
SET_ASP(YREG, (*_PREG)->y_u.xps.s); \
SET_ASP(YREG, (*_PREG)->u.xps.s); \
(*_PREG) = NEXTOP(NEXTOP(NEXTOP((*_PREG), xps),Osbpp),l); \
choiceptr pt0;
@ -118,10 +118,10 @@
register CELL *pt1;
#define COMMIT_B_Y_DO_COMMIT_B_Y \
d0 = YREG[(*_PREG)->y_u.yps.y];
d0 = YREG[(*_PREG)->u.yps.y];
#define COMMIT_B_Y_COMMIT_B_Y_NVAR \
SET_ASP(YREG, (*_PREG)->y_u.yps.s); \
SET_ASP(YREG, (*_PREG)->u.yps.s); \
(*_PREG) = NEXTOP(NEXTOP(NEXTOP((*_PREG), yps),Osbpp),l); \
choiceptr pt0;

View File

@ -392,14 +392,14 @@
} \
case _jump: \
{ \
ipc = ipc->y_u.l.l; \
ipc = ipc->u.l.l; \
go_on = TRUE; \
break; \
} \
case _retry_c: \
case _retry_userc: \
{ \
low_level_trace(retry_pred, ipc->y_u.OtapFs.p, B->cp_args); \
low_level_trace(retry_pred, ipc->u.OtapFs.p, B->cp_args); \
break; \
} \
case _retry_profiled: \
@ -420,7 +420,7 @@
case _retry: \
case _trust: \
{ \
low_level_trace(retry_pred, ipc->y_u.Otapl.p, B->cp_args); \
low_level_trace(retry_pred, ipc->u.Otapl.p, B->cp_args); \
break; \
} \
case _try_logical: \
@ -431,7 +431,7 @@
case _profiled_trust_logical: \
case _count_trust_logical: \
{ \
low_level_trace(retry_pred, ipc->y_u.OtILl.d->ClPred, B->cp_args); \
low_level_trace(retry_pred, ipc->u.OtILl.d->ClPred, B->cp_args); \
break; \
} \
case _Nstop: \
@ -543,7 +543,7 @@
pt0 = (tr_fr_ptr) pt1; \
continue; \
} else \
if (IN_BETWEEN(H0,pt1,HR)) { \
if (IN_BETWEEN(H0,pt1,H)) { \
if (IsAttVar(pt1)) { \
continue; \
} else if (*pt1 == (CELL)FunctorBigInt) { \
@ -574,7 +574,7 @@
pt0 = (tr_fr_ptr) pt1; \
continue; \
} else \
if (IN_BETWEEN(H0,pt1,HR)) { \
if (IN_BETWEEN(H0,pt1,H)) { \
if (IsAttVar(pt1)) { \
continue; \
} else if (*pt1 == (CELL)FunctorBigInt) { \
@ -599,7 +599,7 @@
insert_into_global_sg_fr_list(sg_fr); \
continue; \
} \
if (IN_BETWEEN(H0,pt1,HR)) { \
if (IN_BETWEEN(H0,pt1,H)) { \
if (IsAttVar(pt1)) { \
continue; \
} else if (*pt1 == (CELL)FunctorBigInt) { \
@ -623,7 +623,7 @@
pt0 = (tr_fr_ptr) pt1; \
continue; \
} else \
if (IN_BETWEEN(H0,pt1,HR)) { \
if (IN_BETWEEN(H0,pt1,H)) { \
if (IsAttVar(pt1)) { \
continue; \
} else if (*pt1 == (CELL)FunctorBigInt) { \
@ -647,7 +647,7 @@
pt0 = (tr_fr_ptr) pt1; \
continue; \
} else \
if (IN_BETWEEN(H0,pt1,HR)) { \
if (IN_BETWEEN(H0,pt1,H)) { \
if (IsAttVar(pt1)) { \
continue; \
} else if (*pt1 == (CELL)FunctorBigInt) { \
@ -665,7 +665,7 @@
{ \
register CELL flags; \
CELL *pt1 = RepPair(d1); \
if (IN_BETWEEN(H0,pt1,HR)) { \
if (IN_BETWEEN(H0,pt1,H)) { \
if (IsAttVar(pt1)) { \
continue; \
} else if (*pt1 == (CELL)FunctorBigInt) { \
@ -697,7 +697,7 @@
pt0 = (tr_fr_ptr) pt1; \
continue; \
} else \
if (IN_BETWEEN(H0,pt1,HR)) { \
if (IN_BETWEEN(H0,pt1,H)) { \
if (IsAttVar(pt1)) { \
continue; \
} else if (*pt1 == (CELL)FunctorBigInt) { \
@ -727,7 +727,7 @@
pt0 = (tr_fr_ptr) pt1; \
continue; \
} else \
if (IN_BETWEEN(H0,pt1,HR)) { \
if (IN_BETWEEN(H0,pt1,H)) { \
if (IsAttVar(pt1)) { \
continue; \
} else if (*pt1 == (CELL)FunctorBigInt) { \
@ -751,7 +751,7 @@
insert_into_global_sg_fr_list(sg_fr); \
continue; \
} \
if (IN_BETWEEN(H0,pt1,HR)) { \
if (IN_BETWEEN(H0,pt1,H)) { \
if (IsAttVar(pt1)) { \
continue; \
} else if (*pt1 == (CELL)FunctorBigInt) { \
@ -774,7 +774,7 @@
pt0 = (tr_fr_ptr) pt1; \
continue; \
} else \
if (IN_BETWEEN(H0,pt1,HR)) { \
if (IN_BETWEEN(H0,pt1,H)) { \
if (IsAttVar(pt1)) { \
continue; \
} else if (*pt1 == (CELL)FunctorBigInt) { \
@ -797,7 +797,7 @@
pt0 = (tr_fr_ptr) pt1; \
continue; \
} else \
if (IN_BETWEEN(H0,pt1,HR)) { \
if (IN_BETWEEN(H0,pt1,H)) { \
if (IsAttVar(pt1)) { \
continue; \
} else if (*pt1 == (CELL)FunctorBigInt) { \
@ -814,7 +814,7 @@
{ \
register CELL flags; \
CELL *pt1 = RepPair(d1); \
if (IN_BETWEEN(H0,pt1,HR)) { \
if (IN_BETWEEN(H0,pt1,H)) { \
if (IsAttVar(pt1)) { \
continue; \
} else if (*pt1 == (CELL)FunctorBigInt) { \

View File

@ -413,14 +413,14 @@
} \
case _jump: \
{ \
ipc = ipc->y_u.l.l; \
ipc = ipc->u.l.l; \
go_on = TRUE; \
break; \
} \
case _retry_c: \
case _retry_userc: \
{ \
low_level_trace(retry_pred, ipc->y_u.OtapFs.p, B->cp_args); \
low_level_trace(retry_pred, ipc->u.OtapFs.p, B->cp_args); \
break; \
} \
case _retry_profiled: \
@ -441,7 +441,7 @@
case _retry: \
case _trust: \
{ \
low_level_trace(retry_pred, ipc->y_u.Otapl.p, B->cp_args); \
low_level_trace(retry_pred, ipc->u.Otapl.p, B->cp_args); \
break; \
} \
case _try_logical: \
@ -452,7 +452,7 @@
case _profiled_trust_logical: \
case _count_trust_logical: \
{ \
low_level_trace(retry_pred, ipc->y_u.OtILl.d->ClPred, B->cp_args); \
low_level_trace(retry_pred, ipc->u.OtILl.d->ClPred, B->cp_args); \
break; \
} \
case _Nstop: \
@ -564,7 +564,7 @@
pt0 = (tr_fr_ptr) pt1; \
continue; \
} else \
if (IN_BETWEEN(H0,pt1,HR)) { \
if (IN_BETWEEN(H0,pt1,H)) { \
if (IsAttVar(pt1)) { \
continue; \
} else if (*pt1 == (CELL)FunctorBigInt) { \
@ -595,7 +595,7 @@
pt0 = (tr_fr_ptr) pt1; \
continue; \
} else \
if (IN_BETWEEN(H0,pt1,HR)) { \
if (IN_BETWEEN(H0,pt1,H)) { \
if (IsAttVar(pt1)) { \
continue; \
} else if (*pt1 == (CELL)FunctorBigInt) { \
@ -620,7 +620,7 @@
insert_into_global_sg_fr_list(sg_fr); \
continue; \
} \
if (IN_BETWEEN(H0,pt1,HR)) { \
if (IN_BETWEEN(H0,pt1,H)) { \
if (IsAttVar(pt1)) { \
continue; \
} else if (*pt1 == (CELL)FunctorBigInt) { \
@ -644,7 +644,7 @@
pt0 = (tr_fr_ptr) pt1; \
continue; \
} else \
if (IN_BETWEEN(H0,pt1,HR)) { \
if (IN_BETWEEN(H0,pt1,H)) { \
if (IsAttVar(pt1)) { \
continue; \
} else if (*pt1 == (CELL)FunctorBigInt) { \
@ -668,7 +668,7 @@
pt0 = (tr_fr_ptr) pt1; \
continue; \
} else \
if (IN_BETWEEN(H0,pt1,HR)) { \
if (IN_BETWEEN(H0,pt1,H)) { \
if (IsAttVar(pt1)) { \
continue; \
} else if (*pt1 == (CELL)FunctorBigInt) { \
@ -686,7 +686,7 @@
{ \
register CELL flags; \
CELL *pt1 = RepPair(d1); \
if (IN_BETWEEN(H0,pt1,HR)) { \
if (IN_BETWEEN(H0,pt1,H)) { \
if (IsAttVar(pt1)) { \
continue; \
} else if (*pt1 == (CELL)FunctorBigInt) { \
@ -718,7 +718,7 @@
pt0 = (tr_fr_ptr) pt1; \
continue; \
} else \
if (IN_BETWEEN(H0,pt1,HR)) { \
if (IN_BETWEEN(H0,pt1,H)) { \
if (IsAttVar(pt1)) { \
continue; \
} else if (*pt1 == (CELL)FunctorBigInt) { \
@ -748,7 +748,7 @@
pt0 = (tr_fr_ptr) pt1; \
continue; \
} else \
if (IN_BETWEEN(H0,pt1,HR)) { \
if (IN_BETWEEN(H0,pt1,H)) { \
if (IsAttVar(pt1)) { \
continue; \
} else if (*pt1 == (CELL)FunctorBigInt) { \
@ -772,7 +772,7 @@
insert_into_global_sg_fr_list(sg_fr); \
continue; \
} \
if (IN_BETWEEN(H0,pt1,HR)) { \
if (IN_BETWEEN(H0,pt1,H)) { \
if (IsAttVar(pt1)) { \
continue; \
} else if (*pt1 == (CELL)FunctorBigInt) { \
@ -795,7 +795,7 @@
pt0 = (tr_fr_ptr) pt1; \
continue; \
} else \
if (IN_BETWEEN(H0,pt1,HR)) { \
if (IN_BETWEEN(H0,pt1,H)) { \
if (IsAttVar(pt1)) { \
continue; \
} else if (*pt1 == (CELL)FunctorBigInt) { \
@ -818,7 +818,7 @@
pt0 = (tr_fr_ptr) pt1; \
continue; \
} else \
if (IN_BETWEEN(H0,pt1,HR)) { \
if (IN_BETWEEN(H0,pt1,H)) { \
if (IsAttVar(pt1)) { \
continue; \
} else if (*pt1 == (CELL)FunctorBigInt) { \
@ -835,7 +835,7 @@
{ \
register CELL flags; \
CELL *pt1 = RepPair(d1); \
if (IN_BETWEEN(H0,pt1,HR)) { \
if (IN_BETWEEN(H0,pt1,H)) { \
if (IsAttVar(pt1)) { \
continue; \
} else if (*pt1 == (CELL)FunctorBigInt) { \

View File

@ -1,15 +1,15 @@
#define GET_X_VAR_INSTINIT \
register CELL d0; \
d0 = XREG((*_PREG)->y_u.xx.xr); \
XREG((*_PREG)->y_u.xx.xl) = d0; \
d0 = XREG((*_PREG)->u.xx.xr); \
XREG((*_PREG)->u.xx.xl) = d0; \
(*_PREG) = NEXTOP((*_PREG), xx); \
GONext();
#define GET_Y_VAR_INSTINIT \
register CELL d0; \
register CELL *pt0; \
pt0 = YREG + (*_PREG)->y_u.yx.y; \
d0 = XREG((*_PREG)->y_u.yx.x); \
pt0 = YREG + (*_PREG)->u.yx.y; \
d0 = XREG((*_PREG)->u.yx.x); \
(*_PREG) = NEXTOP((*_PREG), yx); \
INITIALIZE_PERMVAR(pt0,d0); \
GONext();
@ -18,10 +18,10 @@
register CELL d0, d1; \
register CELL *pt0, *pt1; \
CACHE_Y(YREG); \
pt0 = S_YREG + (*_PREG)->y_u.yyxx.y1; \
d0 = XREG((*_PREG)->y_u.yyxx.x1); \
pt1 = S_YREG + (*_PREG)->y_u.yyx.y2; \
d1 = XREG((*_PREG)->y_u.yyxx.x2); \
pt0 = S_YREG + (*_PREG)->u.yyxx.y1; \
d0 = XREG((*_PREG)->u.yyxx.x1); \
pt1 = S_YREG + (*_PREG)->u.yyx.y2; \
d1 = XREG((*_PREG)->u.yyxx.x2); \
(*_PREG) = NEXTOP((*_PREG), yyxx); \
INITIALIZE_PERMVAR(pt0,d0); \
INITIALIZE_PERMVAR(pt1,d1); \
@ -32,10 +32,10 @@
BLOCKADDRESS = (CELL)(*_PREG); \
register CELL d0, d1; \
register CELL *pt0, *pt1; \
d0 = XREG((*_PREG)->y_u.xx.xl);
d0 = XREG((*_PREG)->u.xx.xl);
#define GET_X_VAL_GVALX_NONVAR \
d1 = XREG((*_PREG)->y_u.xx.xr);
d1 = XREG((*_PREG)->u.xx.xr);
#define GET_X_VAL_GVALX_NONVAR_NONVAR \
BLOCK = (CELL)GET_X_VAL_GVALX_NONVAR_NONVAR; \
@ -48,7 +48,7 @@
GONext();
#define GET_X_VAL_GVALX_UNK \
d1 = XREG((*_PREG)->y_u.xx.xr);
d1 = XREG((*_PREG)->u.xx.xr);
#define GET_X_VAL_GVALX_VAR_NONVAR \
(*_PREG) = NEXTOP((*_PREG), xx); \
@ -63,11 +63,11 @@
#define GET_Y_VAL_INSTINIT \
register CELL d0, d1; \
register CELL *pt0, *pt1; \
pt0 = YREG + (*_PREG)->y_u.yx.y; \
pt0 = YREG + (*_PREG)->u.yx.y; \
d0 = *pt0;
#define GET_Y_VAL_GVALY_NONVAR \
d1 = XREG((*_PREG)->y_u.yx.x);
d1 = XREG((*_PREG)->u.yx.x);
#define GET_Y_VAL_GVALY_NONVAR_NONVAR \
BLOCK = (CELL)GET_Y_VAL_GVALY_NONVAR_NONVAR; \
@ -80,7 +80,7 @@
GONext();
#define GET_Y_VAL_GVALY_UNK \
d1 = XREG((*_PREG)->y_u.yx.x);
d1 = XREG((*_PREG)->u.yx.x);
#define GET_Y_VAL_GVALY_VAR_NONVAR \
(*_PREG) = NEXTOP((*_PREG), yx); \
@ -96,8 +96,8 @@
BLOCKADDRESS = (CELL)(*_PREG); \
register CELL d0, d1; \
register CELL *pt0; \
d0 = XREG((*_PREG)->y_u.xc.x); \
d1 = (*_PREG)->y_u.xc.c;
d0 = XREG((*_PREG)->u.xc.x); \
d1 = (*_PREG)->u.xc.c;
#define GET_ATOM_GATOM_NONVAR \
BLOCK = (CELL)GET_ATOM_GATOM_NONVAR; \
@ -121,11 +121,11 @@
d0 = ARG1;
#define GET_2ATOMS_GATOM_2UNK \
Bind(pt0, (*_PREG)->y_u.cc.c1);
Bind(pt0, (*_PREG)->u.cc.c1);
#define GET_2ATOMS_GATOM_2B \
d0 = ARG2; \
d1 = (*_PREG)->y_u.cc.c2;
d1 = (*_PREG)->u.cc.c2;
#define GET_2ATOMS_GATOM_2BNONVAR \
BLOCK = (CELL)GET_2ATOMS_GATOM_2BNONVAR; \
@ -149,17 +149,17 @@
d0 = ARG1;
#define GET_3ATOMS_GATOM_3UNK \
Bind(pt0, (*_PREG)->y_u.ccc.c1);
Bind(pt0, (*_PREG)->u.ccc.c1);
#define GET_3ATOMS_GATOM_3B \
d0 = ARG2;
#define GET_3ATOMS_GATOM_3BUNK \
Bind(pt0, (*_PREG)->y_u.ccc.c2);
Bind(pt0, (*_PREG)->u.ccc.c2);
#define GET_3ATOMS_GATOM_3C \
d0 = ARG3; \
d1 = (*_PREG)->y_u.ccc.c3;
d1 = (*_PREG)->u.ccc.c3;
#define GET_3ATOMS_GATOM_3CNONVAR \
BLOCK = (CELL)GET_3ATOMS_GATOM_3CNONVAR; \
@ -183,23 +183,23 @@
d0 = ARG1;
#define GET_4ATOMS_GATOM_4UNK \
Bind(pt0, (*_PREG)->y_u.cccc.c1);
Bind(pt0, (*_PREG)->u.cccc.c1);
#define GET_4ATOMS_GATOM_4B \
d0 = ARG2;
#define GET_4ATOMS_GATOM_4BUNK \
Bind(pt0, (*_PREG)->y_u.cccc.c2);
Bind(pt0, (*_PREG)->u.cccc.c2);
#define GET_4ATOMS_GATOM_4C \
d0 = ARG3;
#define GET_4ATOMS_GATOM_4CUNK \
Bind(pt0, (*_PREG)->y_u.cccc.c3);
Bind(pt0, (*_PREG)->u.cccc.c3);
#define GET_4ATOMS_GATOM_4D \
d0 = ARG4; \
d1 = (*_PREG)->y_u.cccc.c4;
d1 = (*_PREG)->u.cccc.c4;
#define GET_4ATOMS_GATOM_4DNONVAR \
BLOCK = (CELL)GET_4ATOMS_GATOM_4DNONVAR; \
@ -223,29 +223,29 @@
d0 = ARG1;
#define GET_5ATOMS_GATOM_5UNK \
Bind(pt0, (*_PREG)->y_u.ccccc.c1);
Bind(pt0, (*_PREG)->u.ccccc.c1);
#define GET_5ATOMS_GATOM_5B \
d0 = ARG2;
#define GET_5ATOMS_GATOM_5BUNK \
Bind(pt0, (*_PREG)->y_u.ccccc.c2);
Bind(pt0, (*_PREG)->u.ccccc.c2);
#define GET_5ATOMS_GATOM_5C \
d0 = ARG3;
#define GET_5ATOMS_GATOM_5CUNK \
Bind(pt0, (*_PREG)->y_u.ccccc.c3);
Bind(pt0, (*_PREG)->u.ccccc.c3);
#define GET_5ATOMS_GATOM_5D \
d0 = ARG4;
#define GET_5ATOMS_GATOM_5DUNK \
Bind(pt0, (*_PREG)->y_u.ccccc.c4);
Bind(pt0, (*_PREG)->u.ccccc.c4);
#define GET_5ATOMS_GATOM_5E \
d0 = ARG5; \
d1 = (*_PREG)->y_u.ccccc.c5;
d1 = (*_PREG)->u.ccccc.c5;
#define GET_5ATOMS_GATOM_5ENONVAR \
BLOCK = (CELL)GET_5ATOMS_GATOM_5ENONVAR; \
@ -269,35 +269,35 @@
d0 = ARG1;
#define GET_6ATOMS_GATOM_6UNK \
Bind(pt0, (*_PREG)->y_u.cccccc.c1);
Bind(pt0, (*_PREG)->u.cccccc.c1);
#define GET_6ATOMS_GATOM_6B \
d0 = ARG2;
#define GET_6ATOMS_GATOM_6BUNK \
Bind(pt0, (*_PREG)->y_u.cccccc.c2);
Bind(pt0, (*_PREG)->u.cccccc.c2);
#define GET_6ATOMS_GATOM_6C \
d0 = ARG3;
#define GET_6ATOMS_GATOM_6CUNK \
Bind(pt0, (*_PREG)->y_u.cccccc.c3);
Bind(pt0, (*_PREG)->u.cccccc.c3);
#define GET_6ATOMS_GATOM_6D \
d0 = ARG4;
#define GET_6ATOMS_GATOM_6DUNK \
Bind(pt0, (*_PREG)->y_u.cccccc.c4);
Bind(pt0, (*_PREG)->u.cccccc.c4);
#define GET_6ATOMS_GATOM_6E \
d0 = ARG5;
#define GET_6ATOMS_GATOM_6EUNK \
Bind(pt0, (*_PREG)->y_u.cccccc.c5);
Bind(pt0, (*_PREG)->u.cccccc.c5);
#define GET_6ATOMS_GATOM_6F \
d0 = ARG6; \
d1 = (*_PREG)->y_u.cccccc.c6;
d1 = (*_PREG)->u.cccccc.c6;
#define GET_6ATOMS_GATOM_6FNONVAR \
BLOCK = (CELL)GET_6ATOMS_GATOM_6FNONVAR; \
@ -319,7 +319,7 @@
BLOCKADDRESS = (CELL)(*_PREG); \
register CELL d0; \
register CELL *pt0; \
d0 = XREG((*_PREG)->y_u.x.x);
d0 = XREG((*_PREG)->u.x.x);
#define GET_LIST_GLIST_NONVAR \
BLOCK = (CELL)GET_LIST_GLIST_NONVAR; \
@ -351,7 +351,7 @@
BLOCKADDRESS = (CELL)(*_PREG); \
register CELL d0, d1; \
register CELL *pt0; \
d0 = XREG((*_PREG)->y_u.xfa.x);
d0 = XREG((*_PREG)->u.xfa.x);
#define GET_STRUCT_GSTRUCT_NONVAR \
BLOCK = (CELL)GET_STRUCT_GSTRUCT_NONVAR; \
@ -362,7 +362,7 @@
else { \
register CELL * S_SREG; \
S_SREG = RepAppl(d0); \
d0 = (CELL) ((*_PREG)->y_u.xfa.f); \
d0 = (CELL) ((*_PREG)->u.xfa.f); \
if (*S_SREG != d0) { \
YAAM_FAIL; \
} \
@ -378,9 +378,9 @@
d1 = AbsAppl(HR); \
Bind(pt0, d1); \
pt0 = HR; \
d0 = (CELL) ((*_PREG)->y_u.xfa.f); \
d0 = (CELL) ((*_PREG)->u.xfa.f); \
*pt0++ = d0; \
HR = pt0 + (*_PREG)->y_u.xfa.a; \
HR = pt0 + (*_PREG)->u.xfa.a; \
(*_PREG) = NEXTOP((*_PREG), xfa); \
(*_SREG) = pt0; \
GONextW(); \
@ -390,7 +390,7 @@
BLOCKADDRESS = (CELL)(*_PREG); \
register CELL d0, d1; \
register CELL *pt0, *pt1; \
d0 = XREG((*_PREG)->y_u.xd.x);
d0 = XREG((*_PREG)->u.xd.x);
#if SIZEOF_DOUBLE == 2*SIZEOF_INT_P
#define GET_FLOAT_GFLOAT_NONVAR \
@ -405,7 +405,7 @@
YAAM_FAIL; \
} \
else { \
pt1 = (*_PREG)->y_u.xd.d; \
pt1 = (*_PREG)->u.xd.d; \
(*_PREG) = NEXTOP((*_PREG), xd); \
if ( \
pt1[1] != pt0[1] \
@ -431,7 +431,7 @@
YAAM_FAIL; \
} \
else { \
pt1 = (*_PREG)->y_u.xd.d; \
pt1 = (*_PREG)->u.xd.d; \
(*_PREG) = NEXTOP((*_PREG), xd); \
if ( \
pt1[1] != pt0[1] \
@ -447,7 +447,7 @@
#define GET_FLOAT_GFLOAT_UNK \
START_PREFETCH(xc); \
d1 = AbsAppl((*_PREG)->y_u.xd.d); \
d1 = AbsAppl((*_PREG)->u.xd.d); \
(*_PREG) = NEXTOP((*_PREG), xd); \
Bind(pt0, d1); \
GONext(); \
@ -456,7 +456,7 @@
#define GET_LONGINT_INSTINIT \
register CELL d0, d1; \
register CELL *pt0; \
d0 = XREG((*_PREG)->y_u.xi.x);
d0 = XREG((*_PREG)->u.xi.x);
#define GET_LONGINT_GLONGINT_NONVAR \
BLOCK = (CELL)GET_LONGINT_GLONGINT_NONVAR; \
@ -469,7 +469,7 @@
if (*pt0 != (CELL)FunctorLongInt) { \
YAAM_FAIL; \
} \
if ((*_PREG)->y_u.xi.i[1] != (CELL)pt0[1]) { \
if ((*_PREG)->u.xi.i[1] != (CELL)pt0[1]) { \
YAAM_FAIL; \
} \
} \
@ -480,7 +480,7 @@
#define GET_LONGINT_GLONGINT_UNK \
START_PREFETCH(xi); \
d1 = AbsAppl((*_PREG)->y_u.xi.i); \
d1 = AbsAppl((*_PREG)->u.xi.i); \
(*_PREG) = NEXTOP((*_PREG), xi); \
Bind(pt0, d1); \
GONext(); \
@ -490,7 +490,7 @@
#define GET_BIGINT_INSTINIT \
register CELL d0, d1; \
register CELL *pt0; \
d0 = XREG((*_PREG)->y_u.xN.x);
d0 = XREG((*_PREG)->u.xN.x);
#define GET_BIGINT_GBIGINT_NONVAR \
BLOCK = (CELL)GET_BIGINT_GBIGINT_NONVAR; \
@ -503,7 +503,7 @@
if (*pt0 != (CELL)FunctorBigInt) { \
YAAM_FAIL; \
} \
if (Yap_gmp_tcmp_big_big(d0,(*_PREG)->y_u.xN.b)) { \
if (Yap_gmp_tcmp_big_big(d0,(*_PREG)->u.xN.b)) { \
YAAM_FAIL; \
} \
} \
@ -514,7 +514,7 @@
#define GET_BIGINT_GBIGINT_UNK \
START_PREFETCH(xN); \
d1 = (*_PREG)->y_u.xN.b; \
d1 = (*_PREG)->u.xN.b; \
(*_PREG) = NEXTOP((*_PREG), xN); \
Bind(pt0, d1); \
GONext(); \
@ -524,17 +524,17 @@
#define GET_DBTERM_INSTINIT \
register CELL d0, d1; \
register CELL *pt0; \
d0 = XREG((*_PREG)->y_u.xD.x);
d0 = XREG((*_PREG)->u.xD.x);
#define GET_DBTERM_GDBTERM_NONVAR \
BLOCK = (CELL)GET_DBTERM_GDBTERM_NONVAR; \
d1 = (*_PREG)->y_u.xD.D; \
d1 = (*_PREG)->u.xD.D; \
(*_PREG) = NEXTOP((*_PREG), xD); \
YAAM_UNIFYBOUND;
#define GET_DBTERM_GDBTERM_UNK \
START_PREFETCH(xD); \
d1 = (*_PREG)->y_u.xD.D; \
d1 = (*_PREG)->u.xD.D; \
(*_PREG) = NEXTOP((*_PREG), xD); \
Bind(pt0, d1); \
GONext(); \
@ -544,7 +544,7 @@
BLOCKADDRESS = (CELL)(*_PREG); \
register CELL d0, d1; \
register CELL *pt0, *pt1; \
d0 = XREG((*_PREG)->y_u.xx.xl); \
d0 = XREG((*_PREG)->u.xx.xl); \
if (!IsVarTerm(d0)) { \
printf("Oops!\n"); \
exit(1); \
@ -563,7 +563,7 @@
}
#define GLIST_VALX_GLIST_VALX_NONVAR \
d1 = XREG((*_PREG)->y_u.xx.xr);
d1 = XREG((*_PREG)->u.xx.xr);
#define GLIST_VALX_GLIST_VALX_NONVAR_NONVAR \
BLOCK = (CELL)GLIST_VALX_GLIST_VALX_NONVAR_NONVAR; \
@ -576,7 +576,7 @@
GONext();
#define GLIST_VALX_GLIST_VALX_UNK \
d0 = XREG((*_PREG)->y_u.xx.xr);
d0 = XREG((*_PREG)->u.xx.xr);
#define GLIST_VALX_GLIST_VALX_VAR_NONVAR \
(*_PREG) = NEXTOP((*_PREG), xx); \
@ -591,7 +591,7 @@
#define GLIST_VALX_GLIST_VALX_WRITE \
CACHE_S(); \
S_SREG = HR; \
d1 = XREG((*_PREG)->y_u.xx.xr); \
d1 = XREG((*_PREG)->u.xx.xr); \
d0 = AbsPair(S_SREG); \
S_SREG[0] = d1; \
ALWAYS_START_PREFETCH_W(xx); \
@ -606,7 +606,7 @@
#define GLIST_VALY_INSTINIT \
register CELL d0, d1; \
register CELL *pt0, *pt1; \
d0 = XREG((*_PREG)->y_u.yx.x);
d0 = XREG((*_PREG)->u.yx.x);
#define GLIST_VALY_GLIST_VALY_READ \
if (!IsPairTerm(d0)) { \
@ -618,7 +618,7 @@
d0 = *pt0;
#define GLIST_VALY_GLIST_VALY_NONVAR \
pt1 = YREG + (*_PREG)->y_u.yx.y; \
pt1 = YREG + (*_PREG)->u.yx.y; \
d1 = *pt1; \
(*_PREG) = NEXTOP((*_PREG), yx);
@ -632,7 +632,7 @@
GONext();
#define GLIST_VALY_GLIST_VALY_UNK \
pt1 = YREG+(*_PREG)->y_u.yx.y; \
pt1 = YREG+(*_PREG)->u.yx.y; \
d1 = *pt1;
#define GLIST_VALY_GLIST_VALY_VAR_NONVAR \
@ -651,7 +651,7 @@
pt1 = HR; \
d0 = AbsPair(pt1); \
Bind(pt0, d0); \
d0 = YREG[(*_PREG)->y_u.yx.y]; \
d0 = YREG[(*_PREG)->u.yx.y]; \
pt1[0] = d0; \
HR = pt1 + 2; \
(*_SREG) = pt1 + 1; \
@ -663,7 +663,7 @@
BLOCKADDRESS = (CELL)(*_PREG); \
register CELL d0; \
register CELL *pt0, *pt1; \
d0 = XREG((*_PREG)->y_u.xx.xl);
d0 = XREG((*_PREG)->u.xx.xl);
#define GL_VOID_VARX_GLIST_VOID_VARX_READ \
BLOCK = (CELL)GL_VOID_VARX_GLIST_VOID_VARX_READ; \
@ -674,14 +674,14 @@
else { \
pt0 = RepPair(d0); \
d0 = pt0[1]; \
XREG((*_PREG)->y_u.xx.xr) = d0; \
XREG((*_PREG)->u.xx.xr) = d0; \
(*_PREG) = NEXTOP((*_PREG), xx); \
ALWAYS_GONext(); \
}
#define GL_VOID_VARX_GLIST_VOID_VAR_WRITE \
pt1 = HR; \
XREG((*_PREG)->y_u.xx.xr) = \
XREG((*_PREG)->u.xx.xr) = \
Unsigned(pt1 + 1); \
RESET_VARIABLE(pt1); \
RESET_VARIABLE(pt1+1); \
@ -695,7 +695,7 @@
BLOCKADDRESS = (CELL)(*_PREG); \
register CELL d0; \
register CELL *pt0, *pt1; \
d0 = XREG((*_PREG)->y_u.yx.x);
d0 = XREG((*_PREG)->u.yx.x);
#define GL_VOID_VARY_GLIST_VOID_VARY_READ \
BLOCK = (CELL)GL_VOID_VARY_GLIST_VOID_VARY_READ; \
@ -706,14 +706,14 @@
else { \
pt0 = RepPair(d0); \
d0 = pt0[1]; \
INITIALIZE_PERMVAR(YREG+(*_PREG)->y_u.yx.y,d0); \
INITIALIZE_PERMVAR(YREG+(*_PREG)->u.yx.y,d0); \
(*_PREG) = NEXTOP((*_PREG), yx); \
GONext(); \
}
#define GL_VOID_VARY_GLIST_VOID_VARY_WRITE \
pt1 = HR; \
INITIALIZE_PERMVAR(YREG+(*_PREG)->y_u.yx.y,Unsigned(pt1 + 1)); \
INITIALIZE_PERMVAR(YREG+(*_PREG)->u.yx.y,Unsigned(pt1 + 1)); \
(*_PREG) = NEXTOP((*_PREG), yx); \
RESET_VARIABLE(pt1); \
RESET_VARIABLE(pt1+1); \
@ -726,7 +726,7 @@
BLOCKADDRESS = (CELL)(*_PREG); \
register CELL d0, d1; \
register CELL *pt0, *pt1; \
d0 = XREG((*_PREG)->y_u.xx.xl);
d0 = XREG((*_PREG)->u.xx.xl);
#define GL_VOID_VALX_GLIST_VOID_VALX_READ \
BLOCK = (CELL)GL_VOID_VALX_GLIST_VOID_VALX_READ; \
@ -740,7 +740,7 @@
}
#define GL_VOID_VALX_GLIST_VOID_VALX_NONVAR \
d1 = XREG((*_PREG)->y_u.xx.xr);
d1 = XREG((*_PREG)->u.xx.xr);
#define GL_VOID_VALX_GLIST_VOID_VALX_NONVAR_NONVAR \
BLOCK = (CELL)GL_VOID_VALX_GLIST_VOID_VALX_NONVAR_NONVAR; \
@ -753,7 +753,7 @@
GONext();
#define GL_VOID_VALX_GLIST_VOID_VALX_UNK \
d1 = XREG((*_PREG)->y_u.xx.xr);
d1 = XREG((*_PREG)->u.xx.xr);
#define GL_VOID_VALX_GLIST_VOID_VALX_VAR_NONVAR \
(*_PREG) = NEXTOP((*_PREG), xx); \
@ -770,7 +770,7 @@
d0 = AbsPair(pt1); \
Bind(pt0, d0); \
pt1 = HR; \
d0 = XREG((*_PREG)->y_u.xx.xr); \
d0 = XREG((*_PREG)->u.xx.xr); \
RESET_VARIABLE(pt1); \
pt1[1] = d0; \
HR = pt1 + 2; \
@ -781,7 +781,7 @@
BLOCKADDRESS = (CELL)(*_PREG); \
register CELL d0, d1; \
register CELL *pt0, *pt1; \
d0 = XREG((*_PREG)->y_u.yx.x);
d0 = XREG((*_PREG)->u.yx.x);
#define GL_VOID_VALY_GLIST_VOID_VALY_READ \
BLOCK = (CELL)GL_VOID_VALY_GLIST_VOID_VALY_READ; \
@ -795,7 +795,7 @@
}
#define GL_VOID_VALY_GLIST_VOID_VALY_NONVAR \
pt1 = YREG+(*_PREG)->y_u.yx.y; \
pt1 = YREG+(*_PREG)->u.yx.y; \
d1 = *pt1;
#define GL_VOID_VALY_GLIST_VOID_VALY_NONVAR_NONVAR \
@ -809,7 +809,7 @@
GONext();
#define GL_VOID_VALY_GLIST_VOID_VALY_UNK \
pt1 = YREG+(*_PREG)->y_u.yx.y; \
pt1 = YREG+(*_PREG)->u.yx.y; \
d1 = *pt1;
#define GL_VOID_VALY_GLIST_VOID_VALY_VAR_NONVAR \
@ -828,7 +828,7 @@
d0 = AbsPair(S_SREG); \
Bind(pt0, d0); \
S_SREG = HR; \
d1 = YREG[(*_PREG)->y_u.yx.y]; \
d1 = YREG[(*_PREG)->u.yx.y]; \
RESET_VARIABLE(S_SREG); \
S_SREG[1] = d1; \
(*_PREG) = NEXTOP((*_PREG), yx); \

View File

@ -1,8 +1,8 @@
#define GET_X_VAR_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
register CELL d0; \
d0 = XREG((*_PREG)->y_u.xx.xr); \
XREG((*_PREG)->y_u.xx.xl) = d0; \
d0 = XREG((*_PREG)->u.xx.xr); \
XREG((*_PREG)->u.xx.xl) = d0; \
(*_PREG) = NEXTOP((*_PREG), xx); \
GONext();
@ -10,8 +10,8 @@
print_instruction((*_PREG), ON_NATIVE); \
register CELL d0; \
register CELL *pt0; \
pt0 = YREG + (*_PREG)->y_u.yx.y; \
d0 = XREG((*_PREG)->y_u.yx.x); \
pt0 = YREG + (*_PREG)->u.yx.y; \
d0 = XREG((*_PREG)->u.yx.x); \
(*_PREG) = NEXTOP((*_PREG), yx); \
INITIALIZE_PERMVAR(pt0,d0); \
GONext();
@ -21,10 +21,10 @@
register CELL d0, d1; \
register CELL *pt0, *pt1; \
CACHE_Y(YREG); \
pt0 = S_YREG + (*_PREG)->y_u.yyxx.y1; \
d0 = XREG((*_PREG)->y_u.yyxx.x1); \
pt1 = S_YREG + (*_PREG)->y_u.yyx.y2; \
d1 = XREG((*_PREG)->y_u.yyxx.x2); \
pt0 = S_YREG + (*_PREG)->u.yyxx.y1; \
d0 = XREG((*_PREG)->u.yyxx.x1); \
pt1 = S_YREG + (*_PREG)->u.yyx.y2; \
d1 = XREG((*_PREG)->u.yyxx.x2); \
(*_PREG) = NEXTOP((*_PREG), yyxx); \
INITIALIZE_PERMVAR(pt0,d0); \
INITIALIZE_PERMVAR(pt1,d1); \
@ -36,10 +36,10 @@
BLOCKADDRESS = (CELL)(*_PREG); \
register CELL d0, d1; \
register CELL *pt0, *pt1; \
d0 = XREG((*_PREG)->y_u.xx.xl);
d0 = XREG((*_PREG)->u.xx.xl);
#define GET_X_VAL_GVALX_NONVAR \
d1 = XREG((*_PREG)->y_u.xx.xr);
d1 = XREG((*_PREG)->u.xx.xr);
#define GET_X_VAL_GVALX_NONVAR_NONVAR \
BLOCK = (CELL)GET_X_VAL_GVALX_NONVAR_NONVAR; \
@ -52,7 +52,7 @@
GONext();
#define GET_X_VAL_GVALX_UNK \
d1 = XREG((*_PREG)->y_u.xx.xr);
d1 = XREG((*_PREG)->u.xx.xr);
#define GET_X_VAL_GVALX_VAR_NONVAR \
(*_PREG) = NEXTOP((*_PREG), xx); \
@ -68,11 +68,11 @@
print_instruction((*_PREG), ON_NATIVE); \
register CELL d0, d1; \
register CELL *pt0, *pt1; \
pt0 = YREG + (*_PREG)->y_u.yx.y; \
pt0 = YREG + (*_PREG)->u.yx.y; \
d0 = *pt0;
#define GET_Y_VAL_GVALY_NONVAR \
d1 = XREG((*_PREG)->y_u.yx.x);
d1 = XREG((*_PREG)->u.yx.x);
#define GET_Y_VAL_GVALY_NONVAR_NONVAR \
BLOCK = (CELL)GET_Y_VAL_GVALY_NONVAR_NONVAR; \
@ -85,7 +85,7 @@
GONext();
#define GET_Y_VAL_GVALY_UNK \
d1 = XREG((*_PREG)->y_u.yx.x);
d1 = XREG((*_PREG)->u.yx.x);
#define GET_Y_VAL_GVALY_VAR_NONVAR \
(*_PREG) = NEXTOP((*_PREG), yx); \
@ -102,8 +102,8 @@
BLOCKADDRESS = (CELL)(*_PREG); \
register CELL d0, d1; \
register CELL *pt0; \
d0 = XREG((*_PREG)->y_u.xc.x); \
d1 = (*_PREG)->y_u.xc.c;
d0 = XREG((*_PREG)->u.xc.x); \
d1 = (*_PREG)->u.xc.c;
#define GET_ATOM_GATOM_NONVAR \
BLOCK = (CELL)GET_ATOM_GATOM_NONVAR; \
@ -128,11 +128,11 @@
d0 = ARG1;
#define GET_2ATOMS_GATOM_2UNK \
Bind(pt0, (*_PREG)->y_u.cc.c1);
Bind(pt0, (*_PREG)->u.cc.c1);
#define GET_2ATOMS_GATOM_2B \
d0 = ARG2; \
d1 = (*_PREG)->y_u.cc.c2;
d1 = (*_PREG)->u.cc.c2;
#define GET_2ATOMS_GATOM_2BNONVAR \
BLOCK = (CELL)GET_2ATOMS_GATOM_2BNONVAR; \
@ -157,17 +157,17 @@
d0 = ARG1;
#define GET_3ATOMS_GATOM_3UNK \
Bind(pt0, (*_PREG)->y_u.ccc.c1);
Bind(pt0, (*_PREG)->u.ccc.c1);
#define GET_3ATOMS_GATOM_3B \
d0 = ARG2;
#define GET_3ATOMS_GATOM_3BUNK \
Bind(pt0, (*_PREG)->y_u.ccc.c2);
Bind(pt0, (*_PREG)->u.ccc.c2);
#define GET_3ATOMS_GATOM_3C \
d0 = ARG3; \
d1 = (*_PREG)->y_u.ccc.c3;
d1 = (*_PREG)->u.ccc.c3;
#define GET_3ATOMS_GATOM_3CNONVAR \
BLOCK = (CELL)GET_3ATOMS_GATOM_3CNONVAR; \
@ -192,23 +192,23 @@
d0 = ARG1;
#define GET_4ATOMS_GATOM_4UNK \
Bind(pt0, (*_PREG)->y_u.cccc.c1);
Bind(pt0, (*_PREG)->u.cccc.c1);
#define GET_4ATOMS_GATOM_4B \
d0 = ARG2;
#define GET_4ATOMS_GATOM_4BUNK \
Bind(pt0, (*_PREG)->y_u.cccc.c2);
Bind(pt0, (*_PREG)->u.cccc.c2);
#define GET_4ATOMS_GATOM_4C \
d0 = ARG3;
#define GET_4ATOMS_GATOM_4CUNK \
Bind(pt0, (*_PREG)->y_u.cccc.c3);
Bind(pt0, (*_PREG)->u.cccc.c3);
#define GET_4ATOMS_GATOM_4D \
d0 = ARG4; \
d1 = (*_PREG)->y_u.cccc.c4;
d1 = (*_PREG)->u.cccc.c4;
#define GET_4ATOMS_GATOM_4DNONVAR \
BLOCK = (CELL)GET_4ATOMS_GATOM_4DNONVAR; \
@ -233,29 +233,29 @@
d0 = ARG1;
#define GET_5ATOMS_GATOM_5UNK \
Bind(pt0, (*_PREG)->y_u.ccccc.c1);
Bind(pt0, (*_PREG)->u.ccccc.c1);
#define GET_5ATOMS_GATOM_5B \
d0 = ARG2;
#define GET_5ATOMS_GATOM_5BUNK \
Bind(pt0, (*_PREG)->y_u.ccccc.c2);
Bind(pt0, (*_PREG)->u.ccccc.c2);
#define GET_5ATOMS_GATOM_5C \
d0 = ARG3;
#define GET_5ATOMS_GATOM_5CUNK \
Bind(pt0, (*_PREG)->y_u.ccccc.c3);
Bind(pt0, (*_PREG)->u.ccccc.c3);
#define GET_5ATOMS_GATOM_5D \
d0 = ARG4;
#define GET_5ATOMS_GATOM_5DUNK \
Bind(pt0, (*_PREG)->y_u.ccccc.c4);
Bind(pt0, (*_PREG)->u.ccccc.c4);
#define GET_5ATOMS_GATOM_5E \
d0 = ARG5; \
d1 = (*_PREG)->y_u.ccccc.c5;
d1 = (*_PREG)->u.ccccc.c5;
#define GET_5ATOMS_GATOM_5ENONVAR \
BLOCK = (CELL)GET_5ATOMS_GATOM_5ENONVAR; \
@ -280,35 +280,35 @@
d0 = ARG1;
#define GET_6ATOMS_GATOM_6UNK \
Bind(pt0, (*_PREG)->y_u.cccccc.c1);
Bind(pt0, (*_PREG)->u.cccccc.c1);
#define GET_6ATOMS_GATOM_6B \
d0 = ARG2;
#define GET_6ATOMS_GATOM_6BUNK \
Bind(pt0, (*_PREG)->y_u.cccccc.c2);
Bind(pt0, (*_PREG)->u.cccccc.c2);
#define GET_6ATOMS_GATOM_6C \
d0 = ARG3;
#define GET_6ATOMS_GATOM_6CUNK \
Bind(pt0, (*_PREG)->y_u.cccccc.c3);
Bind(pt0, (*_PREG)->u.cccccc.c3);
#define GET_6ATOMS_GATOM_6D \
d0 = ARG4;
#define GET_6ATOMS_GATOM_6DUNK \
Bind(pt0, (*_PREG)->y_u.cccccc.c4);
Bind(pt0, (*_PREG)->u.cccccc.c4);
#define GET_6ATOMS_GATOM_6E \
d0 = ARG5;
#define GET_6ATOMS_GATOM_6EUNK \
Bind(pt0, (*_PREG)->y_u.cccccc.c5);
Bind(pt0, (*_PREG)->u.cccccc.c5);
#define GET_6ATOMS_GATOM_6F \
d0 = ARG6; \
d1 = (*_PREG)->y_u.cccccc.c6;
d1 = (*_PREG)->u.cccccc.c6;
#define GET_6ATOMS_GATOM_6FNONVAR \
BLOCK = (CELL)GET_6ATOMS_GATOM_6FNONVAR; \
@ -331,7 +331,7 @@
BLOCKADDRESS = (CELL)(*_PREG); \
register CELL d0; \
register CELL *pt0; \
d0 = XREG((*_PREG)->y_u.x.x);
d0 = XREG((*_PREG)->u.x.x);
#define GET_LIST_GLIST_NONVAR \
BLOCK = (CELL)GET_LIST_GLIST_NONVAR; \
@ -364,7 +364,7 @@
BLOCKADDRESS = (CELL)(*_PREG); \
register CELL d0, d1; \
register CELL *pt0; \
d0 = XREG((*_PREG)->y_u.xfa.x);
d0 = XREG((*_PREG)->u.xfa.x);
#define GET_STRUCT_GSTRUCT_NONVAR \
BLOCK = (CELL)GET_STRUCT_GSTRUCT_NONVAR; \
@ -375,7 +375,7 @@
else { \
register CELL * S_SREG; \
S_SREG = RepAppl(d0); \
d0 = (CELL) ((*_PREG)->y_u.xfa.f); \
d0 = (CELL) ((*_PREG)->u.xfa.f); \
if (*S_SREG != d0) { \
YAAM_FAIL; \
} \
@ -391,9 +391,9 @@
d1 = AbsAppl(HR); \
Bind(pt0, d1); \
pt0 = HR; \
d0 = (CELL) ((*_PREG)->y_u.xfa.f); \
d0 = (CELL) ((*_PREG)->u.xfa.f); \
*pt0++ = d0; \
HR = pt0 + (*_PREG)->y_u.xfa.a; \
HR = pt0 + (*_PREG)->u.xfa.a; \
(*_PREG) = NEXTOP((*_PREG), xfa); \
(*_SREG) = pt0; \
GONextW(); \
@ -404,7 +404,7 @@
BLOCKADDRESS = (CELL)(*_PREG); \
register CELL d0, d1; \
register CELL *pt0, *pt1; \
d0 = XREG((*_PREG)->y_u.xd.x);
d0 = XREG((*_PREG)->u.xd.x);
#if SIZEOF_DOUBLE == 2*SIZEOF_INT_P
#define GET_FLOAT_GFLOAT_NONVAR \
@ -419,7 +419,7 @@
YAAM_FAIL; \
} \
else { \
pt1 = (*_PREG)->y_u.xd.d; \
pt1 = (*_PREG)->u.xd.d; \
(*_PREG) = NEXTOP((*_PREG), xd); \
if ( \
pt1[1] != pt0[1] \
@ -445,7 +445,7 @@
YAAM_FAIL; \
} \
else { \
pt1 = (*_PREG)->y_u.xd.d; \
pt1 = (*_PREG)->u.xd.d; \
(*_PREG) = NEXTOP((*_PREG), xd); \
if ( \
pt1[1] != pt0[1] \
@ -461,7 +461,7 @@
#define GET_FLOAT_GFLOAT_UNK \
START_PREFETCH(xc); \
d1 = AbsAppl((*_PREG)->y_u.xd.d); \
d1 = AbsAppl((*_PREG)->u.xd.d); \
(*_PREG) = NEXTOP((*_PREG), xd); \
Bind(pt0, d1); \
GONext(); \
@ -471,7 +471,7 @@
print_instruction((*_PREG), ON_NATIVE); \
register CELL d0, d1; \
register CELL *pt0; \
d0 = XREG((*_PREG)->y_u.xi.x);
d0 = XREG((*_PREG)->u.xi.x);
#define GET_LONGINT_GLONGINT_NONVAR \
BLOCK = (CELL)GET_LONGINT_GLONGINT_NONVAR; \
@ -484,7 +484,7 @@
if (*pt0 != (CELL)FunctorLongInt) { \
YAAM_FAIL; \
} \
if ((*_PREG)->y_u.xi.i[1] != (CELL)pt0[1]) { \
if ((*_PREG)->u.xi.i[1] != (CELL)pt0[1]) { \
YAAM_FAIL; \
} \
} \
@ -495,7 +495,7 @@
#define GET_LONGINT_GLONGINT_UNK \
START_PREFETCH(xi); \
d1 = AbsAppl((*_PREG)->y_u.xi.i); \
d1 = AbsAppl((*_PREG)->u.xi.i); \
(*_PREG) = NEXTOP((*_PREG), xi); \
Bind(pt0, d1); \
GONext(); \
@ -506,7 +506,7 @@
print_instruction((*_PREG), ON_NATIVE); \
register CELL d0, d1; \
register CELL *pt0; \
d0 = XREG((*_PREG)->y_u.xN.x);
d0 = XREG((*_PREG)->u.xN.x);
#define GET_BIGINT_GBIGINT_NONVAR \
BLOCK = (CELL)GET_BIGINT_GBIGINT_NONVAR; \
@ -519,7 +519,7 @@
if (*pt0 != (CELL)FunctorBigInt) { \
YAAM_FAIL; \
} \
if (Yap_gmp_tcmp_big_big(d0,(*_PREG)->y_u.xN.b)) { \
if (Yap_gmp_tcmp_big_big(d0,(*_PREG)->u.xN.b)) { \
YAAM_FAIL; \
} \
} \
@ -530,7 +530,7 @@
#define GET_BIGINT_GBIGINT_UNK \
START_PREFETCH(xN); \
d1 = (*_PREG)->y_u.xN.b; \
d1 = (*_PREG)->u.xN.b; \
(*_PREG) = NEXTOP((*_PREG), xN); \
Bind(pt0, d1); \
GONext(); \
@ -541,17 +541,17 @@
print_instruction((*_PREG), ON_NATIVE); \
register CELL d0, d1; \
register CELL *pt0; \
d0 = XREG((*_PREG)->y_u.xD.x);
d0 = XREG((*_PREG)->u.xD.x);
#define GET_DBTERM_GDBTERM_NONVAR \
BLOCK = (CELL)GET_DBTERM_GDBTERM_NONVAR; \
d1 = (*_PREG)->y_u.xD.D; \
d1 = (*_PREG)->u.xD.D; \
(*_PREG) = NEXTOP((*_PREG), xD); \
YAAM_UNIFYBOUND;
#define GET_DBTERM_GDBTERM_UNK \
START_PREFETCH(xD); \
d1 = (*_PREG)->y_u.xD.D; \
d1 = (*_PREG)->u.xD.D; \
(*_PREG) = NEXTOP((*_PREG), xD); \
Bind(pt0, d1); \
GONext(); \
@ -562,7 +562,7 @@
BLOCKADDRESS = (CELL)(*_PREG); \
register CELL d0, d1; \
register CELL *pt0, *pt1; \
d0 = XREG((*_PREG)->y_u.xx.xl); \
d0 = XREG((*_PREG)->u.xx.xl); \
if (!IsVarTerm(d0)) { \
printf("Oops!\n"); \
exit(1); \
@ -581,7 +581,7 @@
}
#define GLIST_VALX_GLIST_VALX_NONVAR \
d1 = XREG((*_PREG)->y_u.xx.xr);
d1 = XREG((*_PREG)->u.xx.xr);
#define GLIST_VALX_GLIST_VALX_NONVAR_NONVAR \
BLOCK = (CELL)GLIST_VALX_GLIST_VALX_NONVAR_NONVAR; \
@ -594,7 +594,7 @@
GONext();
#define GLIST_VALX_GLIST_VALX_UNK \
d0 = XREG((*_PREG)->y_u.xx.xr);
d0 = XREG((*_PREG)->u.xx.xr);
#define GLIST_VALX_GLIST_VALX_VAR_NONVAR \
(*_PREG) = NEXTOP((*_PREG), xx); \
@ -609,7 +609,7 @@
#define GLIST_VALX_GLIST_VALX_WRITE \
CACHE_S(); \
S_SREG = HR; \
d1 = XREG((*_PREG)->y_u.xx.xr); \
d1 = XREG((*_PREG)->u.xx.xr); \
d0 = AbsPair(S_SREG); \
S_SREG[0] = d1; \
ALWAYS_START_PREFETCH_W(xx); \
@ -625,7 +625,7 @@
print_instruction((*_PREG), ON_NATIVE); \
register CELL d0, d1; \
register CELL *pt0, *pt1; \
d0 = XREG((*_PREG)->y_u.yx.x);
d0 = XREG((*_PREG)->u.yx.x);
#define GLIST_VALY_GLIST_VALY_READ \
if (!IsPairTerm(d0)) { \
@ -637,7 +637,7 @@
d0 = *pt0;
#define GLIST_VALY_GLIST_VALY_NONVAR \
pt1 = YREG + (*_PREG)->y_u.yx.y; \
pt1 = YREG + (*_PREG)->u.yx.y; \
d1 = *pt1; \
(*_PREG) = NEXTOP((*_PREG), yx);
@ -651,7 +651,7 @@
GONext();
#define GLIST_VALY_GLIST_VALY_UNK \
pt1 = YREG+(*_PREG)->y_u.yx.y; \
pt1 = YREG+(*_PREG)->u.yx.y; \
d1 = *pt1;
#define GLIST_VALY_GLIST_VALY_VAR_NONVAR \
@ -670,7 +670,7 @@
pt1 = HR; \
d0 = AbsPair(pt1); \
Bind(pt0, d0); \
d0 = YREG[(*_PREG)->y_u.yx.y]; \
d0 = YREG[(*_PREG)->u.yx.y]; \
pt1[0] = d0; \
HR = pt1 + 2; \
(*_SREG) = pt1 + 1; \
@ -683,7 +683,7 @@
BLOCKADDRESS = (CELL)(*_PREG); \
register CELL d0; \
register CELL *pt0, *pt1; \
d0 = XREG((*_PREG)->y_u.xx.xl);
d0 = XREG((*_PREG)->u.xx.xl);
#define GL_VOID_VARX_GLIST_VOID_VARX_READ \
BLOCK = (CELL)GL_VOID_VARX_GLIST_VOID_VARX_READ; \
@ -694,14 +694,14 @@
else { \
pt0 = RepPair(d0); \
d0 = pt0[1]; \
XREG((*_PREG)->y_u.xx.xr) = d0; \
XREG((*_PREG)->u.xx.xr) = d0; \
(*_PREG) = NEXTOP((*_PREG), xx); \
ALWAYS_GONext(); \
}
#define GL_VOID_VARX_GLIST_VOID_VAR_WRITE \
pt1 = HR; \
XREG((*_PREG)->y_u.xx.xr) = \
XREG((*_PREG)->u.xx.xr) = \
Unsigned(pt1 + 1); \
RESET_VARIABLE(pt1); \
RESET_VARIABLE(pt1+1); \
@ -716,7 +716,7 @@
BLOCKADDRESS = (CELL)(*_PREG); \
register CELL d0; \
register CELL *pt0, *pt1; \
d0 = XREG((*_PREG)->y_u.yx.x);
d0 = XREG((*_PREG)->u.yx.x);
#define GL_VOID_VARY_GLIST_VOID_VARY_READ \
BLOCK = (CELL)GL_VOID_VARY_GLIST_VOID_VARY_READ; \
@ -727,14 +727,14 @@
else { \
pt0 = RepPair(d0); \
d0 = pt0[1]; \
INITIALIZE_PERMVAR(YREG+(*_PREG)->y_u.yx.y,d0); \
INITIALIZE_PERMVAR(YREG+(*_PREG)->u.yx.y,d0); \
(*_PREG) = NEXTOP((*_PREG), yx); \
GONext(); \
}
#define GL_VOID_VARY_GLIST_VOID_VARY_WRITE \
pt1 = HR; \
INITIALIZE_PERMVAR(YREG+(*_PREG)->y_u.yx.y,Unsigned(pt1 + 1)); \
INITIALIZE_PERMVAR(YREG+(*_PREG)->u.yx.y,Unsigned(pt1 + 1)); \
(*_PREG) = NEXTOP((*_PREG), yx); \
RESET_VARIABLE(pt1); \
RESET_VARIABLE(pt1+1); \
@ -748,7 +748,7 @@
BLOCKADDRESS = (CELL)(*_PREG); \
register CELL d0, d1; \
register CELL *pt0, *pt1; \
d0 = XREG((*_PREG)->y_u.xx.xl);
d0 = XREG((*_PREG)->u.xx.xl);
#define GL_VOID_VALX_GLIST_VOID_VALX_READ \
BLOCK = (CELL)GL_VOID_VALX_GLIST_VOID_VALX_READ; \
@ -762,7 +762,7 @@
}
#define GL_VOID_VALX_GLIST_VOID_VALX_NONVAR \
d1 = XREG((*_PREG)->y_u.xx.xr);
d1 = XREG((*_PREG)->u.xx.xr);
#define GL_VOID_VALX_GLIST_VOID_VALX_NONVAR_NONVAR \
BLOCK = (CELL)GL_VOID_VALX_GLIST_VOID_VALX_NONVAR_NONVAR; \
@ -775,7 +775,7 @@
GONext();
#define GL_VOID_VALX_GLIST_VOID_VALX_UNK \
d1 = XREG((*_PREG)->y_u.xx.xr);
d1 = XREG((*_PREG)->u.xx.xr);
#define GL_VOID_VALX_GLIST_VOID_VALX_VAR_NONVAR \
(*_PREG) = NEXTOP((*_PREG), xx); \
@ -792,7 +792,7 @@
d0 = AbsPair(pt1); \
Bind(pt0, d0); \
pt1 = HR; \
d0 = XREG((*_PREG)->y_u.xx.xr); \
d0 = XREG((*_PREG)->u.xx.xr); \
RESET_VARIABLE(pt1); \
pt1[1] = d0; \
HR = pt1 + 2; \
@ -804,7 +804,7 @@
BLOCKADDRESS = (CELL)(*_PREG); \
register CELL d0, d1; \
register CELL *pt0, *pt1; \
d0 = XREG((*_PREG)->y_u.yx.x);
d0 = XREG((*_PREG)->u.yx.x);
#define GL_VOID_VALY_GLIST_VOID_VALY_READ \
BLOCK = (CELL)GL_VOID_VALY_GLIST_VOID_VALY_READ; \
@ -818,7 +818,7 @@
}
#define GL_VOID_VALY_GLIST_VOID_VALY_NONVAR \
pt1 = YREG+(*_PREG)->y_u.yx.y; \
pt1 = YREG+(*_PREG)->u.yx.y; \
d1 = *pt1;
#define GL_VOID_VALY_GLIST_VOID_VALY_NONVAR_NONVAR \
@ -832,7 +832,7 @@
GONext();
#define GL_VOID_VALY_GLIST_VOID_VALY_UNK \
pt1 = YREG+(*_PREG)->y_u.yx.y; \
pt1 = YREG+(*_PREG)->u.yx.y; \
d1 = *pt1;
#define GL_VOID_VALY_GLIST_VOID_VALY_VAR_NONVAR \
@ -851,7 +851,7 @@
d0 = AbsPair(S_SREG); \
Bind(pt0, d0); \
S_SREG = HR; \
d1 = YREG[(*_PREG)->y_u.yx.y]; \
d1 = YREG[(*_PREG)->u.yx.y]; \
RESET_VARIABLE(S_SREG); \
S_SREG[1] = d1; \
(*_PREG) = NEXTOP((*_PREG), yx); \

1309
JIT/HPP/yaam_macros.hh Normal file

File diff suppressed because it is too large Load Diff

View File

@ -5,7 +5,7 @@
GONext(); \
} \
else { \
PP = (*_PREG)->y_u.p.p; \
PP = (*_PREG)->u.p.p; \
PELOCK(3, PP); \
(*_PREG) = NEXTOP((*_PREG), p); \
GONext(); \
@ -35,7 +35,7 @@
#if MULTIPLE_STACKS
#define ALLOC_FOR_LOGICAL_PRED_MULTIPLE_STACKS \
LogUpdClause *cl = (*_PREG)->y_u.L.ClBase;
LogUpdClause *cl = (*_PREG)->u.L.ClBase;
#if PARALLEL_YAP
#define ALLOC_FOR_LOGICAL_PRED_MULTIPLE_STACKS_PARALLEL \
PredEntry *ap = cl->ClPred;
@ -47,7 +47,7 @@
PP = NULL;
#else
#define ALLOC_FOR_LOGICAL_PRED_NOMULTIPLE_STACKS_INIT \
LogUpdClause *cl = (LogUpdClause *)(*_PREG)->y_u.L.ClBase;
LogUpdClause *cl = (LogUpdClause *)(*_PREG)->u.L.ClBase;
#define ALLOC_FOR_LOGICAL_PRED_NOMULTIPLE_STACKS_IF \
if (!(cl->ClFlags & InUseMask)) { \
@ -562,13 +562,13 @@
#ifdef DEPTH_LIMIT
#define ENSURE_SPACE_INSTINIT \
{ \
Int sz = (*_PREG)->y_u.Osbpa.i; \
UInt arity = (*_PREG)->y_u.Osbpa.p->ArityOfPE; \
Int sz = (*_PREG)->u.Osbpa.i; \
UInt arity = (*_PREG)->u.Osbpa.p->ArityOfPE; \
if (Unsigned(HR) + sz > Unsigned(YREG)-CreepFlag) { \
YENV[E_CP] = (CELL) (*_C(*_PREG)); \
YENV[E_E] = (CELL) ENV; \
YENV[E_DEPTH] = DEPTH; \
SET_ASP(YREG, (*_PREG)->y_u.Osbpa.s); \
SET_ASP(YREG, (*_PREG)->u.Osbpa.s); \
(*_PREG) = NEXTOP((*_PREG),Osbpa); \
saveregs(); \
setregs(); \
@ -580,12 +580,12 @@
#else /* DEPTH_LIMIT */
#define ENSURE_SPACE_INSTINIT \
{ \
Int sz = (*_PREG)->y_u.Osbpa.i; \
UInt arity = (*_PREG)->y_u.Osbpa.p->ArityOfPE; \
Int sz = (*_PREG)->u.Osbpa.i; \
UInt arity = (*_PREG)->u.Osbpa.p->ArityOfPE; \
if (Unsigned(HR) + sz > Unsigned(YREG)-CreepFlag) { \
YENV[E_CP] = (CELL) (*_C(*_PREG)); \
YENV[E_E] = (CELL) ENV; \
SET_ASP(YREG, (*_PREG)->y_u.Osbpa.s); \
SET_ASP(YREG, (*_PREG)->u.Osbpa.s); \
(*_PREG) = NEXTOP((*_PREG),Osbpa); \
saveregs(); \
setregs(); \
@ -599,7 +599,7 @@
#define ENSURE_SPACE_END
#define JUMP_INSTINIT \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
JMPNext();
#define MOVE_BACK_INSTINIT \
@ -620,7 +620,7 @@
#define EITHER_POST_COROUTINING \
register CELL d0; \
register choiceptr pt1; \
d0 = (*_PREG)->y_u.Osblp.s; \
d0 = (*_PREG)->u.Osblp.s; \
pt1 = (choiceptr) ((char *) YREG + (yslot) d0);
#ifdef FROZEN_STACKS
@ -644,7 +644,7 @@
#define EITHER_POST_FROZEN_YSBA \
pt1 = (choiceptr)(((CELL *) pt1)-1); \
*(CELL **) pt1 = YREG; \
store_yaam_regs_for_either((*_PREG)->y_u.Osblp.l, (*_PREG)); \
store_yaam_regs_for_either((*_PREG)->u.Osblp.l, (*_PREG)); \
(*_SREG) = (CELL *) (B = pt1);
#ifdef YAPOR
@ -658,7 +658,7 @@
GONext();
#define OR_ELSE_INSTINIT \
HR = HBREG = PROTECT_FROZEN_H(B); \
HR = HRBREG = PROTECT_FROZEN_H(B); \
ENV = B->cp_env; \
B->cp_cp = (*_PREG);
@ -672,11 +672,11 @@
#ifdef YAPOR
#define OR_ELSE_YAPOR \
SCH_new_alternative((*_PREG), (*_PREG)->y_u.Osblp.l);
SCH_new_alternative((*_PREG), (*_PREG)->u.Osblp.l);
#endif
#define OR_ELSE_END \
B->cp_ap = (*_PREG)->y_u.Osblp.l; \
B->cp_ap = (*_PREG)->u.Osblp.l; \
(*_PREG) = NEXTOP((*_PREG), Osblp); \
YREG = (CELL *) B->cp_a1; \
GONext();
@ -687,7 +687,7 @@
#ifdef YAPOR
#define OR_LAST_IFOK_INIT \
HR = HBREG = PROTECT_FROZEN_H(pt0); \
H = HRBREG = PROTECT_FROZEN_H(pt0); \
YREG = (CELL *) pt0->cp_a1; \
ENV = pt0->cp_env;
@ -702,7 +702,7 @@
#define OR_LAST_NOIF_INIT \
B = pt0->cp_b; \
HR = PROTECT_FROZEN_H(pt0); \
H = PROTECT_FROZEN_H(pt0); \
YREG = (CELL *) pt0->cp_a1; \
ENV = pt0->cp_env;
@ -855,7 +855,7 @@
JMPNext();
#define EXPAND_CLAUSES_INSTINIT \
PredEntry *pe = (*_PREG)->y_u.sssllp.p; \
PredEntry *pe = (*_PREG)->u.sssllp.p; \
yamop *pt0; \
SET_ASP(YREG, E_CB*sizeof(CELL));
@ -909,7 +909,7 @@
} \
else { \
HR[d0 + 2] = AbsAppl(HR); \
*HR = (CELL) pe->FunctorOfPred; \
*H = (CELL) pe->FunctorOfPred; \
HR++; \
pt1 = XREGS + 1; \
for (; d0 > 0; --d0) { \
@ -921,14 +921,14 @@
(pt0) = (CELL *)(d1); \
(d1) = *(CELL *)(d1); \
if(!IsVarTerm(d1)) { \
*HR++ = d1; \
*H++ = d1; \
setHwithd1 = 1; \
break; \
} \
} \
if (setHwithd1) { continue; } \
if (pt0 <= HR) { \
*HR++ = (CELL)pt0; \
*H++ = (CELL)pt0; \
} else { \
d1 = Unsigned(HR); \
RESET_VARIABLE(HR); \
@ -937,7 +937,7 @@
} \
} \
else { \
*HR++ = d1; \
*H++ = d1; \
} \
} \
} \
@ -972,7 +972,7 @@
} \
else { \
HR[d0 + 2] = AbsAppl(HR); \
*HR = (CELL) pe->FunctorOfPred; \
*H = (CELL) pe->FunctorOfPred; \
HR++; \
pt1 = XREGS + 1; \
for (; d0 > 0; --d0) { \
@ -984,14 +984,14 @@
(pt0) = (CELL *)(d1); \
(d1) = *(CELL *)(d1); \
if(!IsVarTerm(d1)) { \
*HR++ = d1; \
*H++ = d1; \
setHwithd1 = 1; \
break; \
} \
} \
if (setHwithd1) { continue; } \
if (pt0 <= HR) { \
*HR++ = (CELL)pt0; \
*H++ = (CELL)pt0; \
} else { \
d1 = Unsigned(HR); \
RESET_VARIABLE(HR); \
@ -1000,7 +1000,7 @@
} \
} \
else { \
*HR++ = d1; \
*H++ = d1; \
} \
} \
} \
@ -1034,7 +1034,7 @@
} \
else { \
HR[d0 + 2] = AbsAppl(HR); \
*HR = (CELL) pe->FunctorOfPred; \
*H = (CELL) pe->FunctorOfPred; \
HR++; \
pt1 = XREGS + 1; \
for (; d0 > 0; --d0) { \
@ -1046,14 +1046,14 @@
(pt0) = (CELL *)(d1); \
(d1) = *(CELL *)(d1); \
if(!IsVarTerm(d1)) { \
*HR++ = d1; \
*H++ = d1; \
setHwithd1 = 1; \
break; \
} \
} \
if (setHwithd1) { continue; } \
if (pt0 <= HR) { \
*HR++ = (CELL)pt0; \
*H++ = (CELL)pt0; \
} else { \
d1 = Unsigned(HR); \
RESET_VARIABLE(HR); \
@ -1062,7 +1062,7 @@
} \
} \
else { \
*HR++ = d1; \
*H++ = d1; \
} \
} \
} \
@ -1097,7 +1097,7 @@
} \
else { \
HR[d0 + 2] = AbsAppl(HR); \
*HR = (CELL) pe->FunctorOfPred; \
*H = (CELL) pe->FunctorOfPred; \
HR++; \
pt1 = XREGS + 1; \
for (; d0 > 0; --d0) { \
@ -1109,14 +1109,14 @@
(pt0) = (CELL *)(d1); \
(d1) = *(CELL *)(d1); \
if(!IsVarTerm(d1)) { \
*HR++ = d1; \
*H++ = d1; \
setHwithd1 = 1; \
break; \
} \
} \
if (setHwithd1) { continue; } \
if (pt0 <= HR) { \
*HR++ = (CELL)pt0; \
*H++ = (CELL)pt0; \
} else { \
d1 = Unsigned(HR); \
RESET_VARIABLE(HR); \
@ -1125,7 +1125,7 @@
} \
} \
else { \
*HR++ = d1; \
*H++ = d1; \
} \
} \
} \
@ -1206,7 +1206,7 @@
HR[1] = MkAtomTerm((Atom)(pe->FunctorOfPred));
#define SPY_PRED_D0ISNOZERO_INIT \
*HR = (CELL) pe->FunctorOfPred; \
*H = (CELL) pe->FunctorOfPred; \
HR[d0 + 2] = AbsAppl(HR); \
HR++; \
pt1 = XREGS + 1;
@ -1216,10 +1216,10 @@
d1 = *pt0;
#define SPY_PRED_D0ISNOZERO_INSIDEFOR_DOSPY_NONVAR \
*HR++ = d1;
*H++ = d1;
#define SPY_PRED_D0ISNOZERO_INSIDEFOR_SAFEVAR \
*HR++ = (CELL)pt0;
*H++ = (CELL)pt0;
#define SPY_PRED_D0ISNOZERO_INSIDEFOR_UNSAFEVAR \
d1 = Unsigned(HR); \
@ -1228,7 +1228,7 @@
Bind_Local(pt0, d1);
#define SPY_PRED_POST_IFS \
HR[0] = Yap_Module_Name(pe); \
H[0] = Yap_Module_Name(pe); \
ARG1 = (Term) AbsPair(HR); \
HR += 2; \
PredEntry *pt0;

View File

@ -6,7 +6,7 @@
GONext(); \
} \
else { \
PP = (*_PREG)->y_u.p.p; \
PP = (*_PREG)->u.p.p; \
PELOCK(3, PP); \
(*_PREG) = NEXTOP((*_PREG), p); \
GONext(); \
@ -39,7 +39,7 @@
#if MULTIPLE_STACKS
#define ALLOC_FOR_LOGICAL_PRED_MULTIPLE_STACKS \
LogUpdClause *cl = (*_PREG)->y_u.L.ClBase;
LogUpdClause *cl = (*_PREG)->u.L.ClBase;
#if PARALLEL_YAP
#define ALLOC_FOR_LOGICAL_PRED_MULTIPLE_STACKS_PARALLEL \
PredEntry *ap = cl->ClPred;
@ -51,7 +51,7 @@
PP = NULL;
#else
#define ALLOC_FOR_LOGICAL_PRED_NOMULTIPLE_STACKS_INIT \
LogUpdClause *cl = (LogUpdClause *)(*_PREG)->y_u.L.ClBase;
LogUpdClause *cl = (LogUpdClause *)(*_PREG)->u.L.ClBase;
#define ALLOC_FOR_LOGICAL_PRED_NOMULTIPLE_STACKS_IF \
if (!(cl->ClFlags & InUseMask)) { \
@ -583,13 +583,13 @@
#define ENSURE_SPACE_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
{ \
Int sz = (*_PREG)->y_u.Osbpa.i; \
UInt arity = (*_PREG)->y_u.Osbpa.p->ArityOfPE; \
Int sz = (*_PREG)->u.Osbpa.i; \
UInt arity = (*_PREG)->u.Osbpa.p->ArityOfPE; \
if (Unsigned(HR) + sz > Unsigned(YREG)-CreepFlag) { \
YENV[E_CP] = (CELL) (*_C(*_PREG)); \
YENV[E_E] = (CELL) ENV; \
YENV[E_DEPTH] = DEPTH; \
SET_ASP(YREG, (*_PREG)->y_u.Osbpa.s); \
SET_ASP(YREG, (*_PREG)->u.Osbpa.s); \
(*_PREG) = NEXTOP((*_PREG),Osbpa); \
saveregs(); \
setregs(); \
@ -602,12 +602,12 @@
#define ENSURE_SPACE_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
{ \
Int sz = (*_PREG)->y_u.Osbpa.i; \
UInt arity = (*_PREG)->y_u.Osbpa.p->ArityOfPE; \
Int sz = (*_PREG)->u.Osbpa.i; \
UInt arity = (*_PREG)->u.Osbpa.p->ArityOfPE; \
if (Unsigned(HR) + sz > Unsigned(YREG)-CreepFlag) { \
YENV[E_CP] = (CELL) (*_C(*_PREG)); \
YENV[E_E] = (CELL) ENV; \
SET_ASP(YREG, (*_PREG)->y_u.Osbpa.s); \
SET_ASP(YREG, (*_PREG)->u.Osbpa.s); \
(*_PREG) = NEXTOP((*_PREG),Osbpa); \
saveregs(); \
setregs(); \
@ -622,7 +622,7 @@
#define JUMP_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
(*_PREG) = (*_PREG)->y_u.l.l; \
(*_PREG) = (*_PREG)->u.l.l; \
JMPNext();
#define MOVE_BACK_INSTINIT \
@ -646,7 +646,7 @@
#define EITHER_POST_COROUTINING \
register CELL d0; \
register choiceptr pt1; \
d0 = (*_PREG)->y_u.Osblp.s; \
d0 = (*_PREG)->u.Osblp.s; \
pt1 = (choiceptr) ((char *) YREG + (yslot) d0);
#ifdef FROZEN_STACKS
@ -670,7 +670,7 @@
#define EITHER_POST_FROZEN_YSBA \
pt1 = (choiceptr)(((CELL *) pt1)-1); \
*(CELL **) pt1 = YREG; \
store_yaam_regs_for_either((*_PREG)->y_u.Osblp.l, (*_PREG)); \
store_yaam_regs_for_either((*_PREG)->u.Osblp.l, (*_PREG)); \
(*_SREG) = (CELL *) (B = pt1);
#ifdef YAPOR
@ -685,7 +685,7 @@
#define OR_ELSE_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
HR = HBREG = PROTECT_FROZEN_H(B); \
HR = HRBREG = PROTECT_FROZEN_H(B); \
ENV = B->cp_env; \
B->cp_cp = (*_PREG);
@ -699,11 +699,11 @@
#ifdef YAPOR
#define OR_ELSE_YAPOR \
SCH_new_alternative((*_PREG), (*_PREG)->y_u.Osblp.l);
SCH_new_alternative((*_PREG), (*_PREG)->u.Osblp.l);
#endif
#define OR_ELSE_END \
B->cp_ap = (*_PREG)->y_u.Osblp.l; \
B->cp_ap = (*_PREG)->u.Osblp.l; \
(*_PREG) = NEXTOP((*_PREG), Osblp); \
YREG = (CELL *) B->cp_a1; \
GONext();
@ -715,7 +715,7 @@
#ifdef YAPOR
#define OR_LAST_IFOK_INIT \
HR = HBREG = PROTECT_FROZEN_H(pt0); \
H = HRBREG = PROTECT_FROZEN_H(pt0); \
YREG = (CELL *) pt0->cp_a1; \
ENV = pt0->cp_env;
@ -730,7 +730,7 @@
#define OR_LAST_NOIF_INIT \
B = pt0->cp_b; \
HR = PROTECT_FROZEN_H(pt0); \
H = PROTECT_FROZEN_H(pt0); \
YREG = (CELL *) pt0->cp_a1; \
ENV = pt0->cp_env;
@ -889,7 +889,7 @@
#define EXPAND_CLAUSES_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
PredEntry *pe = (*_PREG)->y_u.sssllp.p; \
PredEntry *pe = (*_PREG)->u.sssllp.p; \
yamop *pt0; \
SET_ASP(YREG, E_CB*sizeof(CELL));
@ -944,7 +944,7 @@
} \
else { \
HR[d0 + 2] = AbsAppl(HR); \
*HR = (CELL) pe->FunctorOfPred; \
*H = (CELL) pe->FunctorOfPred; \
HR++; \
pt1 = XREGS + 1; \
for (; d0 > 0; --d0) { \
@ -956,14 +956,14 @@
(pt0) = (CELL *)(d1); \
(d1) = *(CELL *)(d1); \
if(!IsVarTerm(d1)) { \
*HR++ = d1; \
*H++ = d1; \
setHwithd1 = 1; \
break; \
} \
} \
if (setHwithd1) { continue; } \
if (pt0 <= HR) { \
*HR++ = (CELL)pt0; \
*H++ = (CELL)pt0; \
} else { \
d1 = Unsigned(HR); \
RESET_VARIABLE(HR); \
@ -972,7 +972,7 @@
} \
} \
else { \
*HR++ = d1; \
*H++ = d1; \
} \
} \
} \
@ -1008,7 +1008,7 @@
} \
else { \
HR[d0 + 2] = AbsAppl(HR); \
*HR = (CELL) pe->FunctorOfPred; \
*H = (CELL) pe->FunctorOfPred; \
HR++; \
pt1 = XREGS + 1; \
for (; d0 > 0; --d0) { \
@ -1020,14 +1020,14 @@
(pt0) = (CELL *)(d1); \
(d1) = *(CELL *)(d1); \
if(!IsVarTerm(d1)) { \
*HR++ = d1; \
*H++ = d1; \
setHwithd1 = 1; \
break; \
} \
} \
if (setHwithd1) { continue; } \
if (pt0 <= HR) { \
*HR++ = (CELL)pt0; \
*H++ = (CELL)pt0; \
} else { \
d1 = Unsigned(HR); \
RESET_VARIABLE(HR); \
@ -1036,7 +1036,7 @@
} \
} \
else { \
*HR++ = d1; \
*H++ = d1; \
} \
} \
} \
@ -1071,7 +1071,7 @@
} \
else { \
HR[d0 + 2] = AbsAppl(HR); \
*HR = (CELL) pe->FunctorOfPred; \
*H = (CELL) pe->FunctorOfPred; \
HR++; \
pt1 = XREGS + 1; \
for (; d0 > 0; --d0) { \
@ -1083,14 +1083,14 @@
(pt0) = (CELL *)(d1); \
(d1) = *(CELL *)(d1); \
if(!IsVarTerm(d1)) { \
*HR++ = d1; \
*H++ = d1; \
setHwithd1 = 1; \
break; \
} \
} \
if (setHwithd1) { continue; } \
if (pt0 <= HR) { \
*HR++ = (CELL)pt0; \
*H++ = (CELL)pt0; \
} else { \
d1 = Unsigned(HR); \
RESET_VARIABLE(HR); \
@ -1099,7 +1099,7 @@
} \
} \
else { \
*HR++ = d1; \
*H++ = d1; \
} \
} \
} \
@ -1135,7 +1135,7 @@
} \
else { \
HR[d0 + 2] = AbsAppl(HR); \
*HR = (CELL) pe->FunctorOfPred; \
*H = (CELL) pe->FunctorOfPred; \
HR++; \
pt1 = XREGS + 1; \
for (; d0 > 0; --d0) { \
@ -1147,14 +1147,14 @@
(pt0) = (CELL *)(d1); \
(d1) = *(CELL *)(d1); \
if(!IsVarTerm(d1)) { \
*HR++ = d1; \
*H++ = d1; \
setHwithd1 = 1; \
break; \
} \
} \
if (setHwithd1) { continue; } \
if (pt0 <= HR) { \
*HR++ = (CELL)pt0; \
*H++ = (CELL)pt0; \
} else { \
d1 = Unsigned(HR); \
RESET_VARIABLE(HR); \
@ -1163,7 +1163,7 @@
} \
} \
else { \
*HR++ = d1; \
*H++ = d1; \
} \
} \
} \
@ -1245,7 +1245,7 @@
HR[1] = MkAtomTerm((Atom)(pe->FunctorOfPred));
#define SPY_PRED_D0ISNOZERO_INIT \
*HR = (CELL) pe->FunctorOfPred; \
*H = (CELL) pe->FunctorOfPred; \
HR[d0 + 2] = AbsAppl(HR); \
HR++; \
pt1 = XREGS + 1;
@ -1255,10 +1255,10 @@
d1 = *pt0;
#define SPY_PRED_D0ISNOZERO_INSIDEFOR_DOSPY_NONVAR \
*HR++ = d1;
*H++ = d1;
#define SPY_PRED_D0ISNOZERO_INSIDEFOR_SAFEVAR \
*HR++ = (CELL)pt0;
*H++ = (CELL)pt0;
#define SPY_PRED_D0ISNOZERO_INSIDEFOR_UNSAFEVAR \
d1 = Unsigned(HR); \
@ -1267,7 +1267,7 @@
Bind_Local(pt0, d1);
#define SPY_PRED_POST_IFS \
HR[0] = Yap_Module_Name(pe); \
H[0] = Yap_Module_Name(pe); \
ARG1 = (Term) AbsPair(HR); \
HR += 2; \
PredEntry *pt0;

View File

@ -1,7 +1,7 @@
#define POP_N_INSTINIT \
BLOCKADDRESS = (CELL)(*_PREG); \
register CELL d0; \
d0 = (*_PREG)->y_u.os.s; \
d0 = (*_PREG)->u.os.s; \
SP = (CELL *) (((char *) SP) + d0); \
d0 = SP[0]; \
if (d0) { \

View File

@ -2,7 +2,7 @@
print_instruction((*_PREG), ON_NATIVE); \
BLOCKADDRESS = (CELL)(*_PREG); \
register CELL d0; \
d0 = (*_PREG)->y_u.os.s; \
d0 = (*_PREG)->u.os.s; \
SP = (CELL *) (((char *) SP) + d0); \
d0 = SP[0]; \
if (d0) { \

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +1,9 @@
#define PUT_X_VAR_INSTINIT \
register CELL *pt0; \
pt0 = HR; \
XREG((*_PREG)->y_u.xx.xl) = Unsigned(pt0); \
XREG((*_PREG)->u.xx.xl) = Unsigned(pt0); \
HR = pt0 + 1; \
XREG((*_PREG)->y_u.xx.xr) = Unsigned(pt0); \
XREG((*_PREG)->u.xx.xr) = Unsigned(pt0); \
(*_PREG) = NEXTOP((*_PREG), xx); \
RESET_VARIABLE(pt0); \
GONext();
@ -11,8 +11,8 @@
#if defined(YAPOR_SBA) && defined(FROZEN_STACKS)
#define PUT_Y_VAR_INSTINIT \
register CELL *pt0; \
pt0 = YREG + (*_PREG)->y_u.yx.y; \
XREG((*_PREG)->y_u.yx.x) = (CELL) pt0; \
pt0 = YREG + (*_PREG)->u.yx.y; \
XREG((*_PREG)->u.yx.x) = (CELL) pt0; \
(*_PREG) = NEXTOP((*_PREG), yx); \
if (Unsigned((Int)(pt0)-(Int)(H_FZ)) > \
Unsigned((Int)(B_FZ)-(Int)(H_FZ))) { \
@ -23,8 +23,8 @@
#else /* defined(YAPOR_SBA) && defined(FROZEN_STACKS) */
#define PUT_Y_VAR_INSTINIT \
register CELL *pt0; \
pt0 = YREG + (*_PREG)->y_u.yx.y; \
XREG((*_PREG)->y_u.yx.x) = (CELL) pt0; \
pt0 = YREG + (*_PREG)->u.yx.y; \
XREG((*_PREG)->u.yx.x) = (CELL) pt0; \
(*_PREG) = NEXTOP((*_PREG), yx); \
INITIALIZE_PERMVAR(pt0, (CELL)pt0); \
GONext();
@ -32,35 +32,35 @@
#define PUT_X_VAL_INSTINIT \
register CELL d0; \
d0 = XREG((*_PREG)->y_u.xx.xl); \
XREG((*_PREG)->y_u.xx.xr) = d0; \
d0 = XREG((*_PREG)->u.xx.xl); \
XREG((*_PREG)->u.xx.xr) = d0; \
(*_PREG) = NEXTOP((*_PREG), xx); \
GONext();
#define PUT_XX_VAL_INSTINIT \
register CELL d0, d1; \
d0 = XREG((*_PREG)->y_u.xxxx.xl1); \
d1 = XREG((*_PREG)->y_u.xxxx.xl2); \
XREG((*_PREG)->y_u.xxxx.xr1) = d0; \
XREG((*_PREG)->y_u.xxxx.xr2) = d1; \
d0 = XREG((*_PREG)->u.xxxx.xl1); \
d1 = XREG((*_PREG)->u.xxxx.xl2); \
XREG((*_PREG)->u.xxxx.xr1) = d0; \
XREG((*_PREG)->u.xxxx.xr2) = d1; \
(*_PREG) = NEXTOP((*_PREG), xxxx); \
GONext();
#ifdef YAPOR_SBA
#define PUT_Y_VAL_INSTINIT \
register CELL d0; \
d0 = YREG[(*_PREG)->y_u.yx.y]; \
d0 = YREG[(*_PREG)->u.yx.y]; \
if (d0 == 0) { \
XREG((*_PREG)->y_u.yx.x) = (CELL)(YREG+(*_PREG)->y_u.yx.y); \
XREG((*_PREG)->u.yx.x) = (CELL)(YREG+(*_PREG)->u.yx.y); \
} else \
XREG((*_PREG)->y_u.yx.x) = d0; \
XREG((*_PREG)->u.yx.x) = d0; \
(*_PREG) = NEXTOP((*_PREG), yx); \
GONext();
#else /* YAPOR_SBA */
#define PUT_Y_VAL_INSTINIT \
register CELL d0; \
d0 = YREG[(*_PREG)->y_u.yx.y]; \
XREG((*_PREG)->y_u.yx.x) = d0; \
d0 = YREG[(*_PREG)->u.yx.y]; \
XREG((*_PREG)->u.yx.x) = d0; \
(*_PREG) = NEXTOP((*_PREG), yx); \
GONext();
#endif /* YAPOR_SBA */
@ -69,28 +69,28 @@
#define PUT_Y_VALS_INSTINIT \
register CELL d0, d1; \
ALWAYS_START_PREFETCH(yyxx); \
d0 = YREG[(*_PREG)->y_u.yyxx.y1]; \
d0 = YREG[(*_PREG)->u.yyxx.y1]; \
if (d0 == 0) \
XREG((*_PREG)->y_u.yyxx.x1) = (CELL)(YREG+(*_PREG)->y_u.yyxx.y1); \
XREG((*_PREG)->u.yyxx.x1) = (CELL)(YREG+(*_PREG)->u.yyxx.y1); \
else \
XREG((*_PREG)->y_u.yyxx.x1) = d0; \
XREG((*_PREG)->u.yyxx.x1) = d0; \
(*_PREG) = NEXTOP((*_PREG), yyxx); \
d1 = YREG[PREVOP((*_PREG),yyxx)->y_u.yyxx.y2]; \
d1 = YREG[PREVOP((*_PREG),yyxx)->u.yyxx.y2]; \
if (d1 == 0) \
XREG(PREVOP((*_PREG)->y_u.yyxx,yyxx).x2) = (CELL)(YREG+(*_PREG)->y_u.yyxx.y2); \
XREG(PREVOP((*_PREG)->u.yyxx,yyxx).x2) = (CELL)(YREG+(*_PREG)->u.yyxx.y2); \
else \
XREG(PREVOP((*_PREG),yyxx)->y_u.yyxx.x2) = d1; \
XREG(PREVOP((*_PREG),yyxx)->u.yyxx.x2) = d1; \
ALWAYS_GONext(); \
ALWAYS_END_PREFETCH();
#else /* YAPOR_SBA */
#define PUT_Y_VALS_INSTINIT \
register CELL d0, d1; \
ALWAYS_START_PREFETCH(yyxx); \
d0 = YREG[(*_PREG)->y_u.yyxx.y1]; \
XREG((*_PREG)->y_u.yyxx.x1) = d0; \
d0 = YREG[(*_PREG)->u.yyxx.y1]; \
XREG((*_PREG)->u.yyxx.x1) = d0; \
(*_PREG) = NEXTOP((*_PREG), yyxx); \
d1 = YREG[PREVOP((*_PREG),yyxx)->y_u.yyxx.y2]; \
XREG(PREVOP((*_PREG),yyxx)->y_u.yyxx.x2) = d1; \
d1 = YREG[PREVOP((*_PREG),yyxx)->u.yyxx.y2]; \
XREG(PREVOP((*_PREG),yyxx)->u.yyxx.x2) = d1; \
ALWAYS_GONext(); \
ALWAYS_END_PREFETCH();
#endif /* YAPOR_SBA */
@ -98,61 +98,61 @@
#define PUT_UNSAFE_INSTINIT \
register CELL d0; \
register CELL *pt0; \
pt0 = YREG+(*_PREG)->y_u.yx.y; \
pt0 = YREG+(*_PREG)->u.yx.y; \
d0 = *pt0;
#define PUT_UNSAFE_PUNSAFE_NONVAR \
XREG((*_PREG)->y_u.yx.x) = d0; \
XREG((*_PREG)->u.yx.x) = d0; \
(*_PREG) = NEXTOP((*_PREG), yx); \
GONext();
#define PUT_UNSAFE_PUNSAFE_UNK \
if (pt0 <= HR || pt0 >= YREG) { \
XREG((*_PREG)->y_u.yx.x) = Unsigned(pt0); \
XREG((*_PREG)->u.yx.x) = Unsigned(pt0); \
(*_PREG) = NEXTOP((*_PREG), yx); \
GONext(); \
} \
else { \
Bind_Local(pt0, Unsigned(HR)); \
XREG((*_PREG)->y_u.yx.x) = (CELL) HR; \
XREG((*_PREG)->u.yx.x) = (CELL) HR; \
RESET_VARIABLE(HR); \
HR++; \
H++; \
(*_PREG) = NEXTOP((*_PREG), yx); \
GONext(); \
}
#define PUT_ATOM_INSTINIT \
register CELL d0; \
d0 = (*_PREG)->y_u.xc.c; \
XREG((*_PREG)->y_u.xc.x) = d0; \
d0 = (*_PREG)->u.xc.c; \
XREG((*_PREG)->u.xc.x) = d0; \
(*_PREG) = NEXTOP((*_PREG), xc); \
GONext();
#define PUT_DBTERM_INSTINIT \
register CELL d0; \
d0 = (*_PREG)->y_u.xD.D; \
XREG((*_PREG)->y_u.xD.x) = d0; \
d0 = (*_PREG)->u.xD.D; \
XREG((*_PREG)->u.xD.x) = d0; \
(*_PREG) = NEXTOP((*_PREG), xD); \
GONext();
#define PUT_BIGINT_INSTINIT \
register CELL d0; \
d0 = (*_PREG)->y_u.xN.b; \
XREG((*_PREG)->y_u.xN.x) = d0; \
d0 = (*_PREG)->u.xN.b; \
XREG((*_PREG)->u.xN.x) = d0; \
(*_PREG) = NEXTOP((*_PREG), xN); \
GONext();
#define PUT_FLOAT_INSTINIT \
register CELL d0; \
d0 = AbsAppl((*_PREG)->y_u.xd.d); \
XREG((*_PREG)->y_u.xd.x) = d0; \
d0 = AbsAppl((*_PREG)->u.xd.d); \
XREG((*_PREG)->u.xd.x) = d0; \
(*_PREG) = NEXTOP((*_PREG), xd); \
GONext();
#define PUT_LONGINT_INSTINIT \
register CELL d0; \
d0 = AbsAppl((*_PREG)->y_u.xi.i); \
XREG((*_PREG)->y_u.xi.x) = d0; \
d0 = AbsAppl((*_PREG)->u.xi.i); \
XREG((*_PREG)->u.xi.x) = d0; \
(*_PREG) = NEXTOP((*_PREG), xi); \
GONext();
@ -163,7 +163,7 @@
S_SREG = HR; \
HR += 2; \
d0 = AbsPair(S_SREG); \
XREG((*_PREG)->y_u.x.x) = d0; \
XREG((*_PREG)->u.x.x) = d0; \
(*_PREG) = NEXTOP((*_PREG), x); \
WRITEBACK_S(S_SREG); \
ENDCACHE_S(); \
@ -172,11 +172,11 @@
#define PUT_STRUCT_INSTINIT \
register CELL d0; \
d0 = AbsAppl(HR); \
XREG((*_PREG)->y_u.xfa.x) = d0; \
d0 = (CELL) ((*_PREG)->y_u.xfa.f); \
*HR++ = d0; \
XREG((*_PREG)->u.xfa.x) = d0; \
d0 = (CELL) ((*_PREG)->u.xfa.f); \
*H++ = d0; \
(*_SREG) = HR; \
HR += (*_PREG)->y_u.xfa.a; \
HR += (*_PREG)->u.xfa.a; \
(*_PREG) = NEXTOP((*_PREG), xfa); \
GONext();

View File

@ -2,9 +2,9 @@
print_instruction((*_PREG), ON_NATIVE); \
register CELL *pt0; \
pt0 = HR; \
XREG((*_PREG)->y_u.xx.xl) = Unsigned(pt0); \
XREG((*_PREG)->u.xx.xl) = Unsigned(pt0); \
HR = pt0 + 1; \
XREG((*_PREG)->y_u.xx.xr) = Unsigned(pt0); \
XREG((*_PREG)->u.xx.xr) = Unsigned(pt0); \
(*_PREG) = NEXTOP((*_PREG), xx); \
RESET_VARIABLE(pt0); \
GONext();
@ -13,8 +13,8 @@
#define PUT_Y_VAR_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
register CELL *pt0; \
pt0 = YREG + (*_PREG)->y_u.yx.y; \
XREG((*_PREG)->y_u.yx.x) = (CELL) pt0; \
pt0 = YREG + (*_PREG)->u.yx.y; \
XREG((*_PREG)->u.yx.x) = (CELL) pt0; \
(*_PREG) = NEXTOP((*_PREG), yx); \
if (Unsigned((Int)(pt0)-(Int)(H_FZ)) > \
Unsigned((Int)(B_FZ)-(Int)(H_FZ))) { \
@ -26,8 +26,8 @@
#define PUT_Y_VAR_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
register CELL *pt0; \
pt0 = YREG + (*_PREG)->y_u.yx.y; \
XREG((*_PREG)->y_u.yx.x) = (CELL) pt0; \
pt0 = YREG + (*_PREG)->u.yx.y; \
XREG((*_PREG)->u.yx.x) = (CELL) pt0; \
(*_PREG) = NEXTOP((*_PREG), yx); \
INITIALIZE_PERMVAR(pt0, (CELL)pt0); \
GONext();
@ -36,18 +36,18 @@
#define PUT_X_VAL_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
register CELL d0; \
d0 = XREG((*_PREG)->y_u.xx.xl); \
XREG((*_PREG)->y_u.xx.xr) = d0; \
d0 = XREG((*_PREG)->u.xx.xl); \
XREG((*_PREG)->u.xx.xr) = d0; \
(*_PREG) = NEXTOP((*_PREG), xx); \
GONext();
#define PUT_XX_VAL_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
register CELL d0, d1; \
d0 = XREG((*_PREG)->y_u.xxxx.xl1); \
d1 = XREG((*_PREG)->y_u.xxxx.xl2); \
XREG((*_PREG)->y_u.xxxx.xr1) = d0; \
XREG((*_PREG)->y_u.xxxx.xr2) = d1; \
d0 = XREG((*_PREG)->u.xxxx.xl1); \
d1 = XREG((*_PREG)->u.xxxx.xl2); \
XREG((*_PREG)->u.xxxx.xr1) = d0; \
XREG((*_PREG)->u.xxxx.xr2) = d1; \
(*_PREG) = NEXTOP((*_PREG), xxxx); \
GONext();
@ -55,19 +55,19 @@
#define PUT_Y_VAL_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
register CELL d0; \
d0 = YREG[(*_PREG)->y_u.yx.y]; \
d0 = YREG[(*_PREG)->u.yx.y]; \
if (d0 == 0) { \
XREG((*_PREG)->y_u.yx.x) = (CELL)(YREG+(*_PREG)->y_u.yx.y); \
XREG((*_PREG)->u.yx.x) = (CELL)(YREG+(*_PREG)->u.yx.y); \
} else \
XREG((*_PREG)->y_u.yx.x) = d0; \
XREG((*_PREG)->u.yx.x) = d0; \
(*_PREG) = NEXTOP((*_PREG), yx); \
GONext();
#else /* YAPOR_SBA */
#define PUT_Y_VAL_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
register CELL d0; \
d0 = YREG[(*_PREG)->y_u.yx.y]; \
XREG((*_PREG)->y_u.yx.x) = d0; \
d0 = YREG[(*_PREG)->u.yx.y]; \
XREG((*_PREG)->u.yx.x) = d0; \
(*_PREG) = NEXTOP((*_PREG), yx); \
GONext();
#endif /* YAPOR_SBA */
@ -77,17 +77,17 @@
print_instruction((*_PREG), ON_NATIVE); \
register CELL d0, d1; \
ALWAYS_START_PREFETCH(yyxx); \
d0 = YREG[(*_PREG)->y_u.yyxx.y1]; \
d0 = YREG[(*_PREG)->u.yyxx.y1]; \
if (d0 == 0) \
XREG((*_PREG)->y_u.yyxx.x1) = (CELL)(YREG+(*_PREG)->y_u.yyxx.y1); \
XREG((*_PREG)->u.yyxx.x1) = (CELL)(YREG+(*_PREG)->u.yyxx.y1); \
else \
XREG((*_PREG)->y_u.yyxx.x1) = d0; \
XREG((*_PREG)->u.yyxx.x1) = d0; \
(*_PREG) = NEXTOP((*_PREG), yyxx); \
d1 = YREG[PREVOP((*_PREG),yyxx)->y_u.yyxx.y2]; \
d1 = YREG[PREVOP((*_PREG),yyxx)->u.yyxx.y2]; \
if (d1 == 0) \
XREG(PREVOP((*_PREG)->y_u.yyxx,yyxx).x2) = (CELL)(YREG+(*_PREG)->y_u.yyxx.y2); \
XREG(PREVOP((*_PREG)->u.yyxx,yyxx).x2) = (CELL)(YREG+(*_PREG)->u.yyxx.y2); \
else \
XREG(PREVOP((*_PREG),yyxx)->y_u.yyxx.x2) = d1; \
XREG(PREVOP((*_PREG),yyxx)->u.yyxx.x2) = d1; \
ALWAYS_GONext(); \
ALWAYS_END_PREFETCH();
#else /* YAPOR_SBA */
@ -95,11 +95,11 @@
print_instruction((*_PREG), ON_NATIVE); \
register CELL d0, d1; \
ALWAYS_START_PREFETCH(yyxx); \
d0 = YREG[(*_PREG)->y_u.yyxx.y1]; \
XREG((*_PREG)->y_u.yyxx.x1) = d0; \
d0 = YREG[(*_PREG)->u.yyxx.y1]; \
XREG((*_PREG)->u.yyxx.x1) = d0; \
(*_PREG) = NEXTOP((*_PREG), yyxx); \
d1 = YREG[PREVOP((*_PREG),yyxx)->y_u.yyxx.y2]; \
XREG(PREVOP((*_PREG),yyxx)->y_u.yyxx.x2) = d1; \
d1 = YREG[PREVOP((*_PREG),yyxx)->u.yyxx.y2]; \
XREG(PREVOP((*_PREG),yyxx)->u.yyxx.x2) = d1; \
ALWAYS_GONext(); \
ALWAYS_END_PREFETCH();
#endif /* YAPOR_SBA */
@ -108,25 +108,25 @@
print_instruction((*_PREG), ON_NATIVE); \
register CELL d0; \
register CELL *pt0; \
pt0 = YREG+(*_PREG)->y_u.yx.y; \
pt0 = YREG+(*_PREG)->u.yx.y; \
d0 = *pt0;
#define PUT_UNSAFE_PUNSAFE_NONVAR \
XREG((*_PREG)->y_u.yx.x) = d0; \
XREG((*_PREG)->u.yx.x) = d0; \
(*_PREG) = NEXTOP((*_PREG), yx); \
GONext();
#define PUT_UNSAFE_PUNSAFE_UNK \
if (pt0 <= HR || pt0 >= YREG) { \
XREG((*_PREG)->y_u.yx.x) = Unsigned(pt0); \
XREG((*_PREG)->u.yx.x) = Unsigned(pt0); \
(*_PREG) = NEXTOP((*_PREG), yx); \
GONext(); \
} \
else { \
Bind_Local(pt0, Unsigned(HR)); \
XREG((*_PREG)->y_u.yx.x) = (CELL) HR; \
XREG((*_PREG)->u.yx.x) = (CELL) HR; \
RESET_VARIABLE(HR); \
HR++; \
H++; \
(*_PREG) = NEXTOP((*_PREG), yx); \
GONext(); \
}
@ -134,40 +134,40 @@
#define PUT_ATOM_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
register CELL d0; \
d0 = (*_PREG)->y_u.xc.c; \
XREG((*_PREG)->y_u.xc.x) = d0; \
d0 = (*_PREG)->u.xc.c; \
XREG((*_PREG)->u.xc.x) = d0; \
(*_PREG) = NEXTOP((*_PREG), xc); \
GONext();
#define PUT_DBTERM_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
register CELL d0; \
d0 = (*_PREG)->y_u.xD.D; \
XREG((*_PREG)->y_u.xD.x) = d0; \
d0 = (*_PREG)->u.xD.D; \
XREG((*_PREG)->u.xD.x) = d0; \
(*_PREG) = NEXTOP((*_PREG), xD); \
GONext();
#define PUT_BIGINT_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
register CELL d0; \
d0 = (*_PREG)->y_u.xN.b; \
XREG((*_PREG)->y_u.xN.x) = d0; \
d0 = (*_PREG)->u.xN.b; \
XREG((*_PREG)->u.xN.x) = d0; \
(*_PREG) = NEXTOP((*_PREG), xN); \
GONext();
#define PUT_FLOAT_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
register CELL d0; \
d0 = AbsAppl((*_PREG)->y_u.xd.d); \
XREG((*_PREG)->y_u.xd.x) = d0; \
d0 = AbsAppl((*_PREG)->u.xd.d); \
XREG((*_PREG)->u.xd.x) = d0; \
(*_PREG) = NEXTOP((*_PREG), xd); \
GONext();
#define PUT_LONGINT_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
register CELL d0; \
d0 = AbsAppl((*_PREG)->y_u.xi.i); \
XREG((*_PREG)->y_u.xi.x) = d0; \
d0 = AbsAppl((*_PREG)->u.xi.i); \
XREG((*_PREG)->u.xi.x) = d0; \
(*_PREG) = NEXTOP((*_PREG), xi); \
GONext();
@ -179,7 +179,7 @@
S_SREG = HR; \
HR += 2; \
d0 = AbsPair(S_SREG); \
XREG((*_PREG)->y_u.x.x) = d0; \
XREG((*_PREG)->u.x.x) = d0; \
(*_PREG) = NEXTOP((*_PREG), x); \
WRITEBACK_S(S_SREG); \
ENDCACHE_S(); \
@ -189,11 +189,11 @@
print_instruction((*_PREG), ON_NATIVE); \
register CELL d0; \
d0 = AbsAppl(HR); \
XREG((*_PREG)->y_u.xfa.x) = d0; \
d0 = (CELL) ((*_PREG)->y_u.xfa.f); \
*HR++ = d0; \
XREG((*_PREG)->u.xfa.x) = d0; \
d0 = (CELL) ((*_PREG)->u.xfa.f); \
*H++ = d0; \
(*_SREG) = HR; \
HR += (*_PREG)->y_u.xfa.a; \
HR += (*_PREG)->u.xfa.a; \
(*_PREG) = NEXTOP((*_PREG), xfa); \
GONext();

View File

@ -14,7 +14,7 @@
#define UNIFY_X_VAR_END \
WRITEBACK_S(S_SREG+1); \
ALWAYS_START_PREFETCH(ox); \
XREG((*_PREG)->y_u.ox.x) = d0; \
XREG((*_PREG)->u.ox.x) = d0; \
(*_PREG) = NEXTOP((*_PREG), ox); \
ALWAYS_GONext(); \
ALWAYS_END_PREFETCH(); \
@ -24,7 +24,7 @@
register CELL *pt0; \
CACHE_S(); \
READ_IN_S(); \
pt0 = &XREG((*_PREG)->y_u.ox.x); \
pt0 = &XREG((*_PREG)->u.ox.x); \
(*_PREG) = NEXTOP((*_PREG), ox); \
RESET_VARIABLE(S_SREG); \
*pt0 = (CELL) S_SREG; \
@ -37,7 +37,7 @@
register CELL *pt0; \
ALWAYS_START_PREFETCH(ox); \
d0 = (*_SREG)[0]; \
pt0 = &XREG((*_PREG)->y_u.ox.x); \
pt0 = &XREG((*_PREG)->u.ox.x); \
(*_PREG) = NEXTOP((*_PREG), ox);
#ifdef YAPOR_SBA
@ -57,7 +57,7 @@
ALWAYS_START_PREFETCH(ox); \
CACHE_S(); \
READ_IN_S(); \
pt0 = &XREG((*_PREG)->y_u.ox.x); \
pt0 = &XREG((*_PREG)->u.ox.x); \
(*_PREG) = NEXTOP((*_PREG), ox); \
RESET_VARIABLE(S_SREG); \
*pt0 = (CELL)S_SREG; \
@ -71,7 +71,7 @@
CACHE_S(); \
ALWAYS_START_PREFETCH(oxx); \
READ_IN_S(); \
pt0 = &XREG((*_PREG)->y_u.oxx.xr); \
pt0 = &XREG((*_PREG)->u.oxx.xr); \
d0 = S_SREG[0]; \
d1 = S_SREG[1];
@ -87,7 +87,7 @@
#define UNIFY_X_VAR2_END \
WRITEBACK_S(S_SREG+2); \
XREG((*_PREG)->y_u.oxx.xl) = d0; \
XREG((*_PREG)->u.oxx.xl) = d0; \
(*_PREG) = NEXTOP((*_PREG), oxx); \
*pt0 = d1; \
ALWAYS_GONext(); \
@ -98,9 +98,9 @@
register CELL *pt0; \
CACHE_S(); \
READ_IN_S(); \
pt0 = &XREG((*_PREG)->y_u.oxx.xr); \
pt0 = &XREG((*_PREG)->u.oxx.xr); \
RESET_VARIABLE(S_SREG); \
XREG((*_PREG)->y_u.oxx.xl) = (CELL) S_SREG; \
XREG((*_PREG)->u.oxx.xl) = (CELL) S_SREG; \
S_SREG++; \
(*_PREG) = NEXTOP((*_PREG), oxx); \
RESET_VARIABLE(S_SREG); \
@ -115,13 +115,13 @@
register CELL *pt0; \
CACHE_S(); \
READ_IN_S(); \
pt0 = &XREG((*_PREG)->y_u.oxx.xr); \
pt0 = &XREG((*_PREG)->u.oxx.xr); \
d0 = S_SREG[0]; \
d1 = S_SREG[1]; \
if (d0 == 0) \
XREG((*_PREG)->y_u.oxx.xl) = (CELL)S_SREG; \
XREG((*_PREG)->u.oxx.xl) = (CELL)S_SREG; \
else \
XREG((*_PREG)->y_u.oxx.xl) = d0; \
XREG((*_PREG)->u.oxx.xl) = d0; \
(*_PREG) = NEXTOP((*_PREG), oxx); \
if (d1 == 0) \
*pt0 = (CELL)(S_SREG+1); \
@ -135,11 +135,11 @@
register CELL *pt0; \
CACHE_S(); \
READ_IN_S(); \
pt0 = &XREG((*_PREG)->y_u.oxx.xr); \
pt0 = &XREG((*_PREG)->u.oxx.xr); \
d0 = S_SREG[0]; \
d1 = S_SREG[1]; \
{ \
XREG((*_PREG)->y_u.oxx.xl) = d0; \
XREG((*_PREG)->u.oxx.xl) = d0; \
} \
(*_PREG) = NEXTOP((*_PREG), oxx); \
{ \
@ -153,8 +153,8 @@
register CELL *pt0; \
CACHE_S(); \
READ_IN_S(); \
pt0 = &XREG((*_PREG)->y_u.oxx.xr); \
XREG((*_PREG)->y_u.oxx.xl) = (CELL) S_SREG; \
pt0 = &XREG((*_PREG)->u.oxx.xr); \
XREG((*_PREG)->u.oxx.xl) = (CELL) S_SREG; \
RESET_VARIABLE(S_SREG); \
S_SREG++; \
*pt0 = (CELL) S_SREG; \
@ -168,7 +168,7 @@
register CELL d0; \
d0 = *(*_SREG)++; \
if (d0 == 0) { \
INITIALIZE_PERMVAR(YREG+(*_PREG)->y_u.oy.y,(CELL)((*_SREG)-1)); \
INITIALIZE_PERMVAR(YREG+(*_PREG)->u.oy.y,(CELL)((*_SREG)-1)); \
} else \
(*_PREG) = NEXTOP((*_PREG), oy); \
GONext();
@ -176,7 +176,7 @@
#define UNIFY_Y_VAR_INSTINIT \
register CELL d0; \
d0 = *(*_SREG)++; \
INITIALIZE_PERMVAR(YREG+(*_PREG)->y_u.oy.y,d0); \
INITIALIZE_PERMVAR(YREG+(*_PREG)->u.oy.y,d0); \
(*_PREG) = NEXTOP((*_PREG), oy); \
GONext();
#endif /* YAPOR_SBA */
@ -184,7 +184,7 @@
#define UNIFY_Y_VAR_WRITE_INSTINIT \
CACHE_S(); \
READ_IN_S(); \
INITIALIZE_PERMVAR(YREG+(*_PREG)->y_u.oy.y,(CELL) S_SREG); \
INITIALIZE_PERMVAR(YREG+(*_PREG)->u.oy.y,(CELL) S_SREG); \
(*_PREG) = NEXTOP((*_PREG), oy); \
RESET_VARIABLE(S_SREG); \
WRITEBACK_S(S_SREG+1); \
@ -196,7 +196,7 @@
register CELL d0; \
d0 = (*_SREG)[0]; \
if (d0 == 0) { \
INITIALIZE_PERMVAR(YREG+(*_PREG)->y_u.oy.y,(CELL)(*_SREG)); \
INITIALIZE_PERMVAR(YREG+(*_PREG)->u.oy.y,(CELL)(*_SREG)); \
} else \
(*_PREG) = NEXTOP((*_PREG), oy); \
GONext();
@ -204,7 +204,7 @@
#define UNIFY_L_Y_VAR_INSTINIT \
register CELL d0; \
d0 = (*_SREG)[0]; \
INITIALIZE_PERMVAR(YREG+(*_PREG)->y_u.oy.y,d0); \
INITIALIZE_PERMVAR(YREG+(*_PREG)->u.oy.y,d0); \
(*_PREG) = NEXTOP((*_PREG), oy); \
GONext();
#endif /* YAPOR_SBA */
@ -212,7 +212,7 @@
#define UNIFY_L_Y_VAR_WRITE_INSTINIT \
CACHE_S(); \
READ_IN_S(); \
INITIALIZE_PERMVAR(YREG+(*_PREG)->y_u.oy.y,(CELL) S_SREG); \
INITIALIZE_PERMVAR(YREG+(*_PREG)->u.oy.y,(CELL) S_SREG); \
(*_PREG) = NEXTOP((*_PREG), oy); \
RESET_VARIABLE(S_SREG); \
ENDCACHE_S(); \
@ -225,7 +225,7 @@
d0 = *pt0;
#define UNIFY_X_VAL_UVALX_NONVAR \
d1 = XREG((*_PREG)->y_u.ox.x);
d1 = XREG((*_PREG)->u.ox.x);
#define UNIFY_X_VAL_UVALX_NONVAR_NONVAR \
BLOCK = (CELL)UNIFY_X_VAL_UVALX_NONVAR_NONVAR; \
@ -240,7 +240,7 @@
GONext();
#define UNIFY_X_VAL_UVALX_UNK \
d1 = XREG((*_PREG)->y_u.ox.x);
d1 = XREG((*_PREG)->u.ox.x);
#define UNIFY_X_VAL_UVALX_VAR_NONVAR \
(*_PREG) = NEXTOP((*_PREG), ox); \
@ -255,7 +255,7 @@
GONext();
#define UNIFY_X_VAL_WRITE_INSTINIT \
*(*_SREG)++ = XREG((*_PREG)->y_u.ox.x); \
*(*_SREG)++ = XREG((*_PREG)->u.ox.x); \
(*_PREG) = NEXTOP((*_PREG), ox); \
GONextW();
@ -266,7 +266,7 @@
d0 = *pt0;
#define UNIFY_L_X_VAL_ULVALX_NONVAR \
d1 = XREG((*_PREG)->y_u.ox.x);
d1 = XREG((*_PREG)->u.ox.x);
#define UNIFY_L_X_VAL_ULVALX_NONVAR_NONVAR \
BLOCK = (CELL)UNIFY_L_X_VAL_ULVALX_NONVAR_NONVAR; \
@ -279,7 +279,7 @@
GONext();
#define UNIFY_L_X_VAL_ULVALX_UNK \
d1 = XREG((*_PREG)->y_u.ox.x);
d1 = XREG((*_PREG)->u.ox.x);
#define UNIFY_L_X_VAL_ULVALX_VAR_NONVAR \
(*_PREG) = NEXTOP((*_PREG), ox); \
@ -292,7 +292,7 @@
GONext();
#define UNIFY_L_X_VAL_WRITE_INSTINIT \
(*_SREG)[0] = XREG((*_PREG)->y_u.ox.x); \
(*_SREG)[0] = XREG((*_PREG)->u.ox.x); \
(*_PREG) = NEXTOP((*_PREG), ox); \
GONext();
@ -303,7 +303,7 @@
d0 = *pt0;
#define UNIFY_Y_VAL_UVALY_NONVAR \
pt1 = YREG+(*_PREG)->y_u.oy.y; \
pt1 = YREG+(*_PREG)->u.oy.y; \
d1 = *pt1;
#define UNIFY_Y_VAL_UVALY_NONVAR_NONVAR \
@ -319,7 +319,7 @@
GONext();
#define UNIFY_Y_VAL_UVALY_UNK \
pt1 = YREG+(*_PREG)->y_u.oy.y; \
pt1 = YREG+(*_PREG)->u.oy.y; \
d1 = *pt1;
#define UNIFY_Y_VAL_UVALY_VAR_NONVAR \
@ -337,9 +337,9 @@
#ifdef YAPOR_SBA
#define UNIFY_Y_VAL_WRITE_INSTINIT \
register CELL d0; \
d0 = YREG[(*_PREG)->y_u.oy.y]; \
d0 = YREG[(*_PREG)->u.oy.y]; \
if (d0 == 0) \
*(*_SREG)++ = (CELL)(YREG+(*_PREG)->y_u.oy.y); \
*(*_SREG)++ = (CELL)(YREG+(*_PREG)->u.oy.y); \
else \
*(*_SREG)++ = d0; \
(*_PREG) = NEXTOP((*_PREG), oy); \
@ -347,7 +347,7 @@
#else /* YAPOR_SBA */
#define UNIFY_Y_VAL_WRITE_INSTINIT \
register CELL d0; \
d0 = YREG[(*_PREG)->y_u.oy.y]; \
d0 = YREG[(*_PREG)->u.oy.y]; \
*(*_SREG)++ = d0; \
(*_PREG) = NEXTOP((*_PREG), oy); \
GONextW();
@ -360,7 +360,7 @@
d0 = *pt0;
#define UNIFY_L_Y_VAL_ULVALY_NONVAR \
pt1 = YREG+(*_PREG)->y_u.oy.y; \
pt1 = YREG+(*_PREG)->u.oy.y; \
d1 = *pt1;
#define UNIFY_L_Y_VAL_ULVALY_NONVAR_NONVAR \
@ -374,7 +374,7 @@
GONext();
#define UNIFY_L_Y_VAL_ULVALY_UNK \
pt1 = YREG+(*_PREG)->y_u.oy.y; \
pt1 = YREG+(*_PREG)->u.oy.y; \
d1 = *pt1;
#define UNIFY_L_Y_VAL_ULVALY_VAR_NONVAR \
@ -390,9 +390,9 @@
#ifdef YAPOR_SBA
#define UNIFY_L_Y_VAL_WRITE_INSTINIT \
register CELL d0; \
d0 = YREG[(*_PREG)->y_u.oy.y]; \
d0 = YREG[(*_PREG)->u.oy.y]; \
if (d0 == 0) \
(*_SREG)[0] = (CELL)(YREG+(*_PREG)->y_u.oy.y); \
(*_SREG)[0] = (CELL)(YREG+(*_PREG)->u.oy.y); \
else \
(*_SREG)[0] = d0; \
(*_PREG) = NEXTOP((*_PREG), oy); \
@ -400,7 +400,7 @@
#else /* YAPOR_SBA */
#define UNIFY_L_Y_VAL_WRITE_INSTINIT \
register CELL d0; \
d0 = YREG[(*_PREG)->y_u.oy.y]; \
d0 = YREG[(*_PREG)->u.oy.y]; \
(*_SREG)[0] = d0; \
(*_PREG) = NEXTOP((*_PREG), oy); \
GONext();
@ -413,7 +413,7 @@
d0 = *pt0;
#define UNIFY_X_LOC_UVALX_LOC_NONVAR \
d1 = XREG((*_PREG)->y_u.ox.x);
d1 = XREG((*_PREG)->u.ox.x);
#define UNIFY_X_LOC_UVALX_LOC_NONVAR_NONVAR \
BLOCK = (CELL)UNIFY_X_LOC_UVALX_LOC_NONVAR_NONVAR; \
@ -428,7 +428,7 @@
GONext();
#define UNIFY_X_LOC_UVALX_LOC_UNK \
d1 = XREG((*_PREG)->y_u.ox.x);
d1 = XREG((*_PREG)->u.ox.x);
#define UNIFY_X_LOC_UVALX_LOC_VAR_NONVAR \
(*_PREG) = NEXTOP((*_PREG), ox); \
@ -445,7 +445,7 @@
#define UNIFY_X_LOC_WRITE_INSTINIT \
register CELL d0; \
register CELL *pt0; \
d0 = XREG((*_PREG)->y_u.ox.x);
d0 = XREG((*_PREG)->u.ox.x);
#define UNIFY_X_LOC_WRITE_UNIFY_X_LOC_NONVAR \
*(*_SREG)++ = d0; \
@ -475,7 +475,7 @@
d0 = *pt0;
#define UNIFY_L_X_LOC_ULVALX_LOC_NONVAR \
d1 = XREG((*_PREG)->y_u.ox.x);
d1 = XREG((*_PREG)->u.ox.x);
#define UNIFY_L_X_LOC_ULVALX_LOC_NONVAR_NONVAR \
BLOCK = (CELL)UNIFY_L_X_LOC_ULVALX_LOC_NONVAR_NONVAR; \
@ -488,7 +488,7 @@
GONext();
#define UNIFY_L_X_LOC_ULVALX_LOC_UNK \
d1 = XREG((*_PREG)->y_u.ox.x);
d1 = XREG((*_PREG)->u.ox.x);
#define UNIFY_L_X_LOC_ULVALX_LOC_VAR_NONVAR \
(*_PREG) = NEXTOP((*_PREG), ox); \
@ -503,7 +503,7 @@
#define UNIFY_L_X_LOC_WRITE_INSTINIT \
register CELL d0, d1; \
register CELL *pt0, *pt1; \
d0 = XREG((*_PREG)->y_u.ox.x);
d0 = XREG((*_PREG)->u.ox.x);
#define UNIFY_L_X_LOC_WRITE_ULNIFY_X_LOC_NONVAR \
(*_SREG)[0] = d0; \
@ -529,7 +529,7 @@
d0 = *pt0;
#define UNIFY_Y_LOC_UVALY_LOC_NONVAR \
pt1 = YREG+(*_PREG)->y_u.oy.y; \
pt1 = YREG+(*_PREG)->u.oy.y; \
d1 = *pt1;
#define UNIFY_Y_LOC_UVALY_LOC_NONVAR_NONVAR \
@ -545,7 +545,7 @@
GONext();
#define UNIFY_Y_LOC_UVALY_LOC_UNK \
pt1 = YREG+(*_PREG)->y_u.oy.y; \
pt1 = YREG+(*_PREG)->u.oy.y; \
d1 = *pt1;
#define UNIFY_Y_LOC_UVALY_LOC_VAR_NONVAR \
@ -563,7 +563,7 @@
#define UNIFY_Y_LOC_WRITE_INSTINIT \
register CELL d0; \
register CELL *pt0; \
pt0 = YREG+(*_PREG)->y_u.oy.y; \
pt0 = YREG+(*_PREG)->u.oy.y; \
d0 = *pt0;
#define UNIFY_Y_LOC_WRITE_UNIFY_Y_LOC_NONVAR \
@ -594,7 +594,7 @@
d0 = *pt0;
#define UNIFY_L_Y_LOC_ULVALY_LOC_NONVAR \
pt1 = YREG+(*_PREG)->y_u.oy.y; \
pt1 = YREG+(*_PREG)->u.oy.y; \
d1 = *pt1;
#define UNIFY_L_Y_LOC_ULVALY_LOC_NONVAR_NONVAR \
@ -608,7 +608,7 @@
GONext();
#define UNIFY_L_Y_LOC_ULVALY_LOC_UNK \
pt1 = YREG+(*_PREG)->y_u.oy.y; \
pt1 = YREG+(*_PREG)->u.oy.y; \
d1 = *pt1;
#define UNIFY_L_Y_LOC_ULVALY_LOC_VAR_NONVAR \
@ -624,7 +624,7 @@
#define UNIFY_L_Y_LOC_WRITE_INSTINIT \
register CELL d0; \
register CELL *pt0; \
pt0 = YREG+(*_PREG)->y_u.oy.y; \
pt0 = YREG+(*_PREG)->u.oy.y; \
d0 = *pt0;
#define UNIFY_L_Y_LOC_WRITE_ULUNIFY_Y_LOC_NONVAR \
@ -673,14 +673,14 @@
GONext();
#define UNIFY_N_VOIDS_INSTINIT \
(*_SREG) += (*_PREG)->y_u.os.s; \
(*_SREG) += (*_PREG)->u.os.s; \
(*_PREG) = NEXTOP((*_PREG), os); \
GONext();
#define UNIFY_N_VOIDS_WRITE_INSTINIT \
register CELL d0; \
CACHE_S(); \
d0 = (*_PREG)->y_u.os.s; \
d0 = (*_PREG)->u.os.s; \
READ_IN_S(); \
(*_PREG) = NEXTOP((*_PREG), os); \
for (; d0 > 0; d0--) { \
@ -697,7 +697,7 @@
#define UNIFY_L_N_VOIDS_WRITE_INSTINIT \
register CELL d0; \
d0 = (*_PREG)->y_u.os.s; \
d0 = (*_PREG)->u.os.s; \
(*_PREG) = NEXTOP((*_PREG), os); \
CACHE_S(); \
READ_IN_S(); \
@ -718,7 +718,7 @@
#define UNIFY_ATOM_UATOM_NONVAR \
BLOCK = (CELL)UNIFY_ATOM_UATOM_NONVAR; \
FAILED = 0; \
if (d0 != (*_PREG)->y_u.oc.c) { \
if (d0 != (*_PREG)->u.oc.c) { \
YAAM_FAIL; \
} \
else { \
@ -727,13 +727,13 @@
}
#define UNIFY_ATOM_UATOM_UNK \
d0 = (*_PREG)->y_u.oc.c; \
d0 = (*_PREG)->u.oc.c; \
(*_PREG) = NEXTOP((*_PREG), oc); \
Bind_Global(pt0, d0); \
GONext();
#define UNIFY_ATOM_WRITE_INSTINIT \
* (*_SREG)++ = (*_PREG)->y_u.oc.c; \
* (*_SREG)++ = (*_PREG)->u.oc.c; \
(*_PREG) = NEXTOP((*_PREG), oc); \
GONextW();
@ -747,7 +747,7 @@
#define UNIFY_L_ATOM_ULATOM_NONVAR \
BLOCK = (CELL)UNIFY_L_ATOM_ULATOM_NONVAR; \
FAILED = 0; \
if (d0 != (*_PREG)->y_u.oc.c) { \
if (d0 != (*_PREG)->u.oc.c) { \
YAAM_FAIL; \
} \
else { \
@ -756,21 +756,21 @@
}
#define UNIFY_L_ATOM_ULATOM_UNK \
d0 = (*_PREG)->y_u.oc.c; \
d0 = (*_PREG)->u.oc.c; \
(*_PREG) = NEXTOP((*_PREG), oc); \
Bind_Global(pt0, d0); \
GONext();
#define UNIFY_L_ATOM_WRITE_INSTINIT \
(*_SREG)[0] = (*_PREG)->y_u.oc.c; \
(*_SREG)[0] = (*_PREG)->u.oc.c; \
(*_PREG) = NEXTOP((*_PREG), oc); \
GONext();
#define UNIFY_N_ATOMS_INSTINIT \
register Int i = (*_PREG)->y_u.osc.s; \
register Int i = (*_PREG)->u.osc.s; \
register CELL d0, d1; \
register CELL *pt0; \
d1 = (*_PREG)->y_u.osc.c; \
d1 = (*_PREG)->u.osc.c; \
for (; i > 0; i--) { \
pt0 = (*_SREG)++; \
d0 = *pt0; \
@ -802,8 +802,8 @@
#define UNIFY_N_ATOMS_WRITE_INSTINIT \
register CELL d0, d1; \
d0 = (*_PREG)->y_u.osc.s; \
d1 = (*_PREG)->y_u.osc.c; \
d0 = (*_PREG)->u.osc.s; \
d1 = (*_PREG)->u.osc.c; \
CACHE_S(); \
READ_IN_S(); \
(*_PREG) = NEXTOP((*_PREG), osc); \
@ -825,20 +825,20 @@
d0 = *pt0;
#define UNIFY_FLOAT_UFLOAT_NONVAR_D0ISFUNCTOR \
pt1 = (*_PREG)->y_u.od.d; \
pt1 = (*_PREG)->u.od.d; \
(*_PREG) = NEXTOP((*_PREG), od);
#define UNIFY_FLOAT_UFLOAT_NONVAR_END \
GONext();
#define UNIFY_FLOAT_UFLOAT_UNK \
d1 = AbsAppl((*_PREG)->y_u.od.d); \
d1 = AbsAppl((*_PREG)->u.od.d); \
(*_PREG) = NEXTOP((*_PREG), od); \
Bind_Global(pt0, d1); \
GONext();
#define UNIFY_FLOAT_WRITE_INSTINIT \
* (*_SREG)++ = AbsAppl((*_PREG)->y_u.od.d); \
* (*_SREG)++ = AbsAppl((*_PREG)->u.od.d); \
(*_PREG) = NEXTOP((*_PREG), od); \
GONextW();
@ -854,21 +854,21 @@
d0 = *pt0;
#define UNIFY_L_FLOAT_D0ISFUNC \
pt1 = (*_PREG)->y_u.od.d; \
pt1 = (*_PREG)->u.od.d; \
(*_PREG) = NEXTOP((*_PREG), od);
#define UNIFY_L_FLOAT_EQUALS \
GONext();
#define UNIFY_L_FLOAT_ULFLOAT_UNK \
d1 = AbsAppl((*_PREG)->y_u.od.d); \
d1 = AbsAppl((*_PREG)->u.od.d); \
(*_PREG) = NEXTOP((*_PREG), od); \
Bind_Global(S_SREG, d1); \
GONext(); \
ENDCACHE_S();
#define UNIFY_L_FLOAT_WRITE_INSTINIT \
(*_SREG)[0] = AbsAppl((*_PREG)->y_u.od.d); \
(*_SREG)[0] = AbsAppl((*_PREG)->u.od.d); \
(*_PREG) = NEXTOP((*_PREG), od); \
GONext();
@ -883,20 +883,20 @@
d0 = *pt0;
#define UNIFY_LONGINT_D0ISFUNC \
pt1 = (*_PREG)->y_u.oi.i; \
pt1 = (*_PREG)->u.oi.i; \
(*_PREG) = NEXTOP((*_PREG), oi);
#define UNIFY_LONGINT_EQUALS \
GONext();
#define UNIFY_LONGINT_ULONGINT_UNK \
d1 = AbsAppl((*_PREG)->y_u.oi.i); \
d1 = AbsAppl((*_PREG)->u.oi.i); \
(*_PREG) = NEXTOP((*_PREG), oi); \
Bind_Global(pt0, d1); \
GONext();
#define UNIFY_LONGINT_WRITE_INSTINIT \
* (*_SREG)++ = AbsAppl((*_PREG)->y_u.oi.i); \
* (*_SREG)++ = AbsAppl((*_PREG)->u.oi.i); \
(*_PREG) = NEXTOP((*_PREG), oi); \
GONextW();
@ -912,20 +912,20 @@
d0 = *pt0;
#define UNIFY_L_LONGINT_D0ISFUNC \
pt1 = (*_PREG)->y_u.oi.i; \
pt1 = (*_PREG)->u.oi.i; \
(*_PREG) = NEXTOP((*_PREG), oi);
#define UNIFY_L_LONGINT_EQUALS \
GONext();
#define UNIFY_L_LONGINT_ULLONGINT_UNK \
d1 = AbsAppl((*_PREG)->y_u.oi.i); \
d1 = AbsAppl((*_PREG)->u.oi.i); \
(*_PREG) = NEXTOP((*_PREG), oi); \
Bind_Global(S_SREG, d1); \
GONext();
#define UNIFY_L_LONGINT_WRITE_INSTINIT \
(*_SREG)[0] = AbsAppl((*_PREG)->y_u.oi.i); \
(*_SREG)[0] = AbsAppl((*_PREG)->u.oi.i); \
(*_PREG) = NEXTOP((*_PREG), oi); \
GONext();
@ -945,7 +945,7 @@
GONext();
#define UNIFY_BIGINT_UBIGINT_UNK \
d1 = (*_PREG)->y_u.oN.b; \
d1 = (*_PREG)->u.oN.b; \
(*_PREG) = NEXTOP((*_PREG), oN); \
Bind_Global(pt0, d1); \
GONext();
@ -968,7 +968,7 @@
GONext();
#define UNIFY_L_BIGINT_ULBIGINT_UNK \
d1 = (*_PREG)->y_u.oN.b; \
d1 = (*_PREG)->u.oN.b; \
(*_PREG) = NEXTOP((*_PREG), oN); \
Bind_Global(S_SREG, d1); \
GONext(); \
@ -983,12 +983,12 @@
#define UNIFY_DBTERM_UDBTERM_NONVAR \
BLOCK = (CELL)UNIFY_DBTERM_UDBTERM_NONVAR; \
d1 = (*_PREG)->y_u.oD.D; \
d1 = (*_PREG)->u.oD.D; \
(*_PREG) = NEXTOP((*_PREG), oD); \
YAAM_UNIFYBOUND;
#define UNIFY_DBTERM_UDBTERM_UNK \
d1 = (*_PREG)->y_u.oD.D; \
d1 = (*_PREG)->u.oD.D; \
(*_PREG) = NEXTOP((*_PREG), oD); \
Bind_Global(pt0, d1); \
GONext();
@ -1002,12 +1002,12 @@
#define UNIFY_L_DBTERM_ULDBTERM_NONVAR \
BLOCK = (CELL)UNIFY_L_DBTERM_ULDBTERM_NONVAR; \
d1 = (*_PREG)->y_u.oD.D; \
d1 = (*_PREG)->u.oD.D; \
(*_PREG) = NEXTOP((*_PREG), oD); \
YAAM_UNIFYBOUND;
#define UNIFY_L_DBTERM_ULDBTERM_UNK \
d1 = (*_PREG)->y_u.oD.D; \
d1 = (*_PREG)->u.oD.D; \
(*_PREG) = NEXTOP((*_PREG), oD); \
Bind_Global(S_SREG, d1); \
GONext(); \
@ -1129,7 +1129,7 @@
CACHE_S(); \
READ_IN_S(); \
S_SREG = RepAppl(d0); \
d0 = (CELL) ((*_PREG)->y_u.ofa.f); \
d0 = (CELL) ((*_PREG)->u.ofa.f); \
if (*S_SREG != d0) { \
YAAM_FAIL; \
} \
@ -1146,9 +1146,9 @@
d1 = AbsAppl(HR); \
Bind_Global(pt0, d1); \
pt0 = HR; \
d0 = (CELL) ((*_PREG)->y_u.ofa.f); \
d0 = (CELL) ((*_PREG)->u.ofa.f); \
*pt0++ = d0; \
HR = pt0 + (*_PREG)->y_u.ofa.a; \
HR = pt0 + (*_PREG)->u.ofa.a; \
(*_PREG) = NEXTOP((*_PREG), ofa); \
(*_SREG) = pt0; \
GONextW(); \
@ -1163,9 +1163,9 @@
d0 = AbsAppl(HR); \
S_SREG[0] = d0; \
S_SREG = HR; \
d0 = (CELL) ((*_PREG)->y_u.ofa.f); \
d0 = (CELL) ((*_PREG)->u.ofa.f); \
*S_SREG++ = d0; \
HR = S_SREG + (*_PREG)->y_u.ofa.a; \
HR = S_SREG + (*_PREG)->u.ofa.a; \
(*_PREG) = NEXTOP((*_PREG), ofa); \
WRITEBACK_S(S_SREG); \
ENDCACHE_S(); \
@ -1186,7 +1186,7 @@
} \
else { \
(*_SREG) = RepAppl(d0); \
d0 = (CELL) ((*_PREG)->y_u.ofa.f); \
d0 = (CELL) ((*_PREG)->u.ofa.f); \
if (*(*_SREG)++ != d0) { \
YAAM_FAIL; \
} \
@ -1201,9 +1201,9 @@
d1 = AbsAppl(HR); \
Bind_Global(pt0, d1); \
pt0 = HR; \
d0 = (CELL) ((*_PREG)->y_u.ofa.f); \
d0 = (CELL) ((*_PREG)->u.ofa.f); \
*pt0++ = d0; \
HR = pt0 + (*_PREG)->y_u.ofa.a; \
HR = pt0 + (*_PREG)->u.ofa.a; \
(*_PREG) = NEXTOP((*_PREG), ofa); \
(*_SREG) = pt0; \
GONextW(); \
@ -1216,51 +1216,51 @@
READ_IN_S(); \
S_SREG[0] = d0; \
S_SREG = HR; \
d0 = (CELL) ((*_PREG)->y_u.ofa.f); \
d0 = (CELL) ((*_PREG)->u.ofa.f); \
*S_SREG++ = d0; \
HR = S_SREG + (*_PREG)->y_u.ofa.a; \
HR = S_SREG + (*_PREG)->u.ofa.a; \
(*_PREG) = NEXTOP((*_PREG), ofa); \
WRITEBACK_S(S_SREG); \
ENDCACHE_S(); \
GONextW();
#define SAVE_PAIR_X_INSTINIT \
XREG((*_PREG)->y_u.ox.x) = AbsPair((*_SREG)); \
XREG((*_PREG)->u.ox.x) = AbsPair((*_SREG)); \
(*_PREG) = NEXTOP((*_PREG), ox); \
GONext();
#define SAVE_PAIR_X_WRITE_INSTINIT \
XREG((*_PREG)->y_u.ox.x) = AbsPair((*_SREG)); \
XREG((*_PREG)->u.ox.x) = AbsPair((*_SREG)); \
(*_PREG) = NEXTOP((*_PREG), ox); \
GONextW();
#define SAVE_PAIR_Y_INSTINIT \
INITIALIZE_PERMVAR(YREG+(*_PREG)->y_u.oy.y,AbsPair((*_SREG))); \
INITIALIZE_PERMVAR(YREG+(*_PREG)->u.oy.y,AbsPair((*_SREG))); \
(*_PREG) = NEXTOP((*_PREG), oy); \
GONext();
#define SAVE_PAIR_Y_WRITE_INSTINIT \
INITIALIZE_PERMVAR(YREG+(*_PREG)->y_u.oy.y,AbsPair((*_SREG))); \
INITIALIZE_PERMVAR(YREG+(*_PREG)->u.oy.y,AbsPair((*_SREG))); \
(*_PREG) = NEXTOP((*_PREG), oy); \
GONextW();
#define SAVE_APPL_X_INSTINIT \
XREG((*_PREG)->y_u.ox.x) = AbsAppl((*_SREG) - 1); \
XREG((*_PREG)->u.ox.x) = AbsAppl((*_SREG) - 1); \
(*_PREG) = NEXTOP((*_PREG), ox); \
GONext();
#define SAVE_APPL_X_WRITE_INSTINIT \
XREG((*_PREG)->y_u.ox.x) = AbsAppl((*_SREG) - 1); \
XREG((*_PREG)->u.ox.x) = AbsAppl((*_SREG) - 1); \
(*_PREG) = NEXTOP((*_PREG), ox); \
GONextW();
#define SAVE_APPL_Y_INSTINIT \
INITIALIZE_PERMVAR(YREG+(*_PREG)->y_u.oy.y,AbsAppl((*_SREG)-1)); \
INITIALIZE_PERMVAR(YREG+(*_PREG)->u.oy.y,AbsAppl((*_SREG)-1)); \
(*_PREG) = NEXTOP((*_PREG), oy); \
GONext();
#define SAVE_APPL_Y_WRITE_INSTINIT \
INITIALIZE_PERMVAR(YREG+(*_PREG)->y_u.oy.y,AbsAppl((*_SREG)-1)); \
INITIALIZE_PERMVAR(YREG+(*_PREG)->u.oy.y,AbsAppl((*_SREG)-1)); \
(*_PREG) = NEXTOP((*_PREG), oy); \
GONextW();

View File

@ -15,7 +15,7 @@
#define UNIFY_X_VAR_END \
WRITEBACK_S(S_SREG+1); \
ALWAYS_START_PREFETCH(ox); \
XREG((*_PREG)->y_u.ox.x) = d0; \
XREG((*_PREG)->u.ox.x) = d0; \
(*_PREG) = NEXTOP((*_PREG), ox); \
ALWAYS_GONext(); \
ALWAYS_END_PREFETCH(); \
@ -26,7 +26,7 @@
register CELL *pt0; \
CACHE_S(); \
READ_IN_S(); \
pt0 = &XREG((*_PREG)->y_u.ox.x); \
pt0 = &XREG((*_PREG)->u.ox.x); \
(*_PREG) = NEXTOP((*_PREG), ox); \
RESET_VARIABLE(S_SREG); \
*pt0 = (CELL) S_SREG; \
@ -40,7 +40,7 @@
register CELL *pt0; \
ALWAYS_START_PREFETCH(ox); \
d0 = (*_SREG)[0]; \
pt0 = &XREG((*_PREG)->y_u.ox.x); \
pt0 = &XREG((*_PREG)->u.ox.x); \
(*_PREG) = NEXTOP((*_PREG), ox);
#ifdef YAPOR_SBA
@ -61,7 +61,7 @@
ALWAYS_START_PREFETCH(ox); \
CACHE_S(); \
READ_IN_S(); \
pt0 = &XREG((*_PREG)->y_u.ox.x); \
pt0 = &XREG((*_PREG)->u.ox.x); \
(*_PREG) = NEXTOP((*_PREG), ox); \
RESET_VARIABLE(S_SREG); \
*pt0 = (CELL)S_SREG; \
@ -76,7 +76,7 @@
CACHE_S(); \
ALWAYS_START_PREFETCH(oxx); \
READ_IN_S(); \
pt0 = &XREG((*_PREG)->y_u.oxx.xr); \
pt0 = &XREG((*_PREG)->u.oxx.xr); \
d0 = S_SREG[0]; \
d1 = S_SREG[1];
@ -92,7 +92,7 @@
#define UNIFY_X_VAR2_END \
WRITEBACK_S(S_SREG+2); \
XREG((*_PREG)->y_u.oxx.xl) = d0; \
XREG((*_PREG)->u.oxx.xl) = d0; \
(*_PREG) = NEXTOP((*_PREG), oxx); \
*pt0 = d1; \
ALWAYS_GONext(); \
@ -104,9 +104,9 @@
register CELL *pt0; \
CACHE_S(); \
READ_IN_S(); \
pt0 = &XREG((*_PREG)->y_u.oxx.xr); \
pt0 = &XREG((*_PREG)->u.oxx.xr); \
RESET_VARIABLE(S_SREG); \
XREG((*_PREG)->y_u.oxx.xl) = (CELL) S_SREG; \
XREG((*_PREG)->u.oxx.xl) = (CELL) S_SREG; \
S_SREG++; \
(*_PREG) = NEXTOP((*_PREG), oxx); \
RESET_VARIABLE(S_SREG); \
@ -122,13 +122,13 @@
register CELL *pt0; \
CACHE_S(); \
READ_IN_S(); \
pt0 = &XREG((*_PREG)->y_u.oxx.xr); \
pt0 = &XREG((*_PREG)->u.oxx.xr); \
d0 = S_SREG[0]; \
d1 = S_SREG[1]; \
if (d0 == 0) \
XREG((*_PREG)->y_u.oxx.xl) = (CELL)S_SREG; \
XREG((*_PREG)->u.oxx.xl) = (CELL)S_SREG; \
else \
XREG((*_PREG)->y_u.oxx.xl) = d0; \
XREG((*_PREG)->u.oxx.xl) = d0; \
(*_PREG) = NEXTOP((*_PREG), oxx); \
if (d1 == 0) \
*pt0 = (CELL)(S_SREG+1); \
@ -143,11 +143,11 @@
register CELL *pt0; \
CACHE_S(); \
READ_IN_S(); \
pt0 = &XREG((*_PREG)->y_u.oxx.xr); \
pt0 = &XREG((*_PREG)->u.oxx.xr); \
d0 = S_SREG[0]; \
d1 = S_SREG[1]; \
{ \
XREG((*_PREG)->y_u.oxx.xl) = d0; \
XREG((*_PREG)->u.oxx.xl) = d0; \
} \
(*_PREG) = NEXTOP((*_PREG), oxx); \
{ \
@ -162,8 +162,8 @@
register CELL *pt0; \
CACHE_S(); \
READ_IN_S(); \
pt0 = &XREG((*_PREG)->y_u.oxx.xr); \
XREG((*_PREG)->y_u.oxx.xl) = (CELL) S_SREG; \
pt0 = &XREG((*_PREG)->u.oxx.xr); \
XREG((*_PREG)->u.oxx.xl) = (CELL) S_SREG; \
RESET_VARIABLE(S_SREG); \
S_SREG++; \
*pt0 = (CELL) S_SREG; \
@ -178,7 +178,7 @@
register CELL d0; \
d0 = *(*_SREG)++; \
if (d0 == 0) { \
INITIALIZE_PERMVAR(YREG+(*_PREG)->y_u.oy.y,(CELL)((*_SREG)-1)); \
INITIALIZE_PERMVAR(YREG+(*_PREG)->u.oy.y,(CELL)((*_SREG)-1)); \
} else \
(*_PREG) = NEXTOP((*_PREG), oy); \
GONext();
@ -187,7 +187,7 @@
print_instruction((*_PREG), ON_NATIVE); \
register CELL d0; \
d0 = *(*_SREG)++; \
INITIALIZE_PERMVAR(YREG+(*_PREG)->y_u.oy.y,d0); \
INITIALIZE_PERMVAR(YREG+(*_PREG)->u.oy.y,d0); \
(*_PREG) = NEXTOP((*_PREG), oy); \
GONext();
#endif /* YAPOR_SBA */
@ -196,7 +196,7 @@
print_instruction((*_PREG), ON_NATIVE); \
CACHE_S(); \
READ_IN_S(); \
INITIALIZE_PERMVAR(YREG+(*_PREG)->y_u.oy.y,(CELL) S_SREG); \
INITIALIZE_PERMVAR(YREG+(*_PREG)->u.oy.y,(CELL) S_SREG); \
(*_PREG) = NEXTOP((*_PREG), oy); \
RESET_VARIABLE(S_SREG); \
WRITEBACK_S(S_SREG+1); \
@ -209,7 +209,7 @@
register CELL d0; \
d0 = (*_SREG)[0]; \
if (d0 == 0) { \
INITIALIZE_PERMVAR(YREG+(*_PREG)->y_u.oy.y,(CELL)(*_SREG)); \
INITIALIZE_PERMVAR(YREG+(*_PREG)->u.oy.y,(CELL)(*_SREG)); \
} else \
(*_PREG) = NEXTOP((*_PREG), oy); \
GONext();
@ -218,7 +218,7 @@
print_instruction((*_PREG), ON_NATIVE); \
register CELL d0; \
d0 = (*_SREG)[0]; \
INITIALIZE_PERMVAR(YREG+(*_PREG)->y_u.oy.y,d0); \
INITIALIZE_PERMVAR(YREG+(*_PREG)->u.oy.y,d0); \
(*_PREG) = NEXTOP((*_PREG), oy); \
GONext();
#endif /* YAPOR_SBA */
@ -227,7 +227,7 @@
print_instruction((*_PREG), ON_NATIVE); \
CACHE_S(); \
READ_IN_S(); \
INITIALIZE_PERMVAR(YREG+(*_PREG)->y_u.oy.y,(CELL) S_SREG); \
INITIALIZE_PERMVAR(YREG+(*_PREG)->u.oy.y,(CELL) S_SREG); \
(*_PREG) = NEXTOP((*_PREG), oy); \
RESET_VARIABLE(S_SREG); \
ENDCACHE_S(); \
@ -241,7 +241,7 @@
d0 = *pt0;
#define UNIFY_X_VAL_UVALX_NONVAR \
d1 = XREG((*_PREG)->y_u.ox.x);
d1 = XREG((*_PREG)->u.ox.x);
#define UNIFY_X_VAL_UVALX_NONVAR_NONVAR \
BLOCK = (CELL)UNIFY_X_VAL_UVALX_NONVAR_NONVAR; \
@ -256,7 +256,7 @@
GONext();
#define UNIFY_X_VAL_UVALX_UNK \
d1 = XREG((*_PREG)->y_u.ox.x);
d1 = XREG((*_PREG)->u.ox.x);
#define UNIFY_X_VAL_UVALX_VAR_NONVAR \
(*_PREG) = NEXTOP((*_PREG), ox); \
@ -272,7 +272,7 @@
#define UNIFY_X_VAL_WRITE_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
*(*_SREG)++ = XREG((*_PREG)->y_u.ox.x); \
*(*_SREG)++ = XREG((*_PREG)->u.ox.x); \
(*_PREG) = NEXTOP((*_PREG), ox); \
GONextW();
@ -284,7 +284,7 @@
d0 = *pt0;
#define UNIFY_L_X_VAL_ULVALX_NONVAR \
d1 = XREG((*_PREG)->y_u.ox.x);
d1 = XREG((*_PREG)->u.ox.x);
#define UNIFY_L_X_VAL_ULVALX_NONVAR_NONVAR \
BLOCK = (CELL)UNIFY_L_X_VAL_ULVALX_NONVAR_NONVAR; \
@ -297,7 +297,7 @@
GONext();
#define UNIFY_L_X_VAL_ULVALX_UNK \
d1 = XREG((*_PREG)->y_u.ox.x);
d1 = XREG((*_PREG)->u.ox.x);
#define UNIFY_L_X_VAL_ULVALX_VAR_NONVAR \
(*_PREG) = NEXTOP((*_PREG), ox); \
@ -311,7 +311,7 @@
#define UNIFY_L_X_VAL_WRITE_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
(*_SREG)[0] = XREG((*_PREG)->y_u.ox.x); \
(*_SREG)[0] = XREG((*_PREG)->u.ox.x); \
(*_PREG) = NEXTOP((*_PREG), ox); \
GONext();
@ -323,7 +323,7 @@
d0 = *pt0;
#define UNIFY_Y_VAL_UVALY_NONVAR \
pt1 = YREG+(*_PREG)->y_u.oy.y; \
pt1 = YREG+(*_PREG)->u.oy.y; \
d1 = *pt1;
#define UNIFY_Y_VAL_UVALY_NONVAR_NONVAR \
@ -339,7 +339,7 @@
GONext();
#define UNIFY_Y_VAL_UVALY_UNK \
pt1 = YREG+(*_PREG)->y_u.oy.y; \
pt1 = YREG+(*_PREG)->u.oy.y; \
d1 = *pt1;
#define UNIFY_Y_VAL_UVALY_VAR_NONVAR \
@ -358,9 +358,9 @@
#define UNIFY_Y_VAL_WRITE_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
register CELL d0; \
d0 = YREG[(*_PREG)->y_u.oy.y]; \
d0 = YREG[(*_PREG)->u.oy.y]; \
if (d0 == 0) \
*(*_SREG)++ = (CELL)(YREG+(*_PREG)->y_u.oy.y); \
*(*_SREG)++ = (CELL)(YREG+(*_PREG)->u.oy.y); \
else \
*(*_SREG)++ = d0; \
(*_PREG) = NEXTOP((*_PREG), oy); \
@ -369,7 +369,7 @@
#define UNIFY_Y_VAL_WRITE_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
register CELL d0; \
d0 = YREG[(*_PREG)->y_u.oy.y]; \
d0 = YREG[(*_PREG)->u.oy.y]; \
*(*_SREG)++ = d0; \
(*_PREG) = NEXTOP((*_PREG), oy); \
GONextW();
@ -383,7 +383,7 @@
d0 = *pt0;
#define UNIFY_L_Y_VAL_ULVALY_NONVAR \
pt1 = YREG+(*_PREG)->y_u.oy.y; \
pt1 = YREG+(*_PREG)->u.oy.y; \
d1 = *pt1;
#define UNIFY_L_Y_VAL_ULVALY_NONVAR_NONVAR \
@ -397,7 +397,7 @@
GONext();
#define UNIFY_L_Y_VAL_ULVALY_UNK \
pt1 = YREG+(*_PREG)->y_u.oy.y; \
pt1 = YREG+(*_PREG)->u.oy.y; \
d1 = *pt1;
#define UNIFY_L_Y_VAL_ULVALY_VAR_NONVAR \
@ -414,9 +414,9 @@
#define UNIFY_L_Y_VAL_WRITE_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
register CELL d0; \
d0 = YREG[(*_PREG)->y_u.oy.y]; \
d0 = YREG[(*_PREG)->u.oy.y]; \
if (d0 == 0) \
(*_SREG)[0] = (CELL)(YREG+(*_PREG)->y_u.oy.y); \
(*_SREG)[0] = (CELL)(YREG+(*_PREG)->u.oy.y); \
else \
(*_SREG)[0] = d0; \
(*_PREG) = NEXTOP((*_PREG), oy); \
@ -425,7 +425,7 @@
#define UNIFY_L_Y_VAL_WRITE_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
register CELL d0; \
d0 = YREG[(*_PREG)->y_u.oy.y]; \
d0 = YREG[(*_PREG)->u.oy.y]; \
(*_SREG)[0] = d0; \
(*_PREG) = NEXTOP((*_PREG), oy); \
GONext();
@ -439,7 +439,7 @@
d0 = *pt0;
#define UNIFY_X_LOC_UVALX_LOC_NONVAR \
d1 = XREG((*_PREG)->y_u.ox.x);
d1 = XREG((*_PREG)->u.ox.x);
#define UNIFY_X_LOC_UVALX_LOC_NONVAR_NONVAR \
BLOCK = (CELL)UNIFY_X_LOC_UVALX_LOC_NONVAR_NONVAR; \
@ -454,7 +454,7 @@
GONext();
#define UNIFY_X_LOC_UVALX_LOC_UNK \
d1 = XREG((*_PREG)->y_u.ox.x);
d1 = XREG((*_PREG)->u.ox.x);
#define UNIFY_X_LOC_UVALX_LOC_VAR_NONVAR \
(*_PREG) = NEXTOP((*_PREG), ox); \
@ -472,7 +472,7 @@
print_instruction((*_PREG), ON_NATIVE); \
register CELL d0; \
register CELL *pt0; \
d0 = XREG((*_PREG)->y_u.ox.x);
d0 = XREG((*_PREG)->u.ox.x);
#define UNIFY_X_LOC_WRITE_UNIFY_X_LOC_NONVAR \
*(*_SREG)++ = d0; \
@ -503,7 +503,7 @@
d0 = *pt0;
#define UNIFY_L_X_LOC_ULVALX_LOC_NONVAR \
d1 = XREG((*_PREG)->y_u.ox.x);
d1 = XREG((*_PREG)->u.ox.x);
#define UNIFY_L_X_LOC_ULVALX_LOC_NONVAR_NONVAR \
BLOCK = (CELL)UNIFY_L_X_LOC_ULVALX_LOC_NONVAR_NONVAR; \
@ -516,7 +516,7 @@
GONext();
#define UNIFY_L_X_LOC_ULVALX_LOC_UNK \
d1 = XREG((*_PREG)->y_u.ox.x);
d1 = XREG((*_PREG)->u.ox.x);
#define UNIFY_L_X_LOC_ULVALX_LOC_VAR_NONVAR \
(*_PREG) = NEXTOP((*_PREG), ox); \
@ -532,7 +532,7 @@
print_instruction((*_PREG), ON_NATIVE); \
register CELL d0, d1; \
register CELL *pt0, *pt1; \
d0 = XREG((*_PREG)->y_u.ox.x);
d0 = XREG((*_PREG)->u.ox.x);
#define UNIFY_L_X_LOC_WRITE_ULNIFY_X_LOC_NONVAR \
(*_SREG)[0] = d0; \
@ -559,7 +559,7 @@
d0 = *pt0;
#define UNIFY_Y_LOC_UVALY_LOC_NONVAR \
pt1 = YREG+(*_PREG)->y_u.oy.y; \
pt1 = YREG+(*_PREG)->u.oy.y; \
d1 = *pt1;
#define UNIFY_Y_LOC_UVALY_LOC_NONVAR_NONVAR \
@ -575,7 +575,7 @@
GONext();
#define UNIFY_Y_LOC_UVALY_LOC_UNK \
pt1 = YREG+(*_PREG)->y_u.oy.y; \
pt1 = YREG+(*_PREG)->u.oy.y; \
d1 = *pt1;
#define UNIFY_Y_LOC_UVALY_LOC_VAR_NONVAR \
@ -594,7 +594,7 @@
print_instruction((*_PREG), ON_NATIVE); \
register CELL d0; \
register CELL *pt0; \
pt0 = YREG+(*_PREG)->y_u.oy.y; \
pt0 = YREG+(*_PREG)->u.oy.y; \
d0 = *pt0;
#define UNIFY_Y_LOC_WRITE_UNIFY_Y_LOC_NONVAR \
@ -626,7 +626,7 @@
d0 = *pt0;
#define UNIFY_L_Y_LOC_ULVALY_LOC_NONVAR \
pt1 = YREG+(*_PREG)->y_u.oy.y; \
pt1 = YREG+(*_PREG)->u.oy.y; \
d1 = *pt1;
#define UNIFY_L_Y_LOC_ULVALY_LOC_NONVAR_NONVAR \
@ -640,7 +640,7 @@
GONext();
#define UNIFY_L_Y_LOC_ULVALY_LOC_UNK \
pt1 = YREG+(*_PREG)->y_u.oy.y; \
pt1 = YREG+(*_PREG)->u.oy.y; \
d1 = *pt1;
#define UNIFY_L_Y_LOC_ULVALY_LOC_VAR_NONVAR \
@ -657,7 +657,7 @@
print_instruction((*_PREG), ON_NATIVE); \
register CELL d0; \
register CELL *pt0; \
pt0 = YREG+(*_PREG)->y_u.oy.y; \
pt0 = YREG+(*_PREG)->u.oy.y; \
d0 = *pt0;
#define UNIFY_L_Y_LOC_WRITE_ULUNIFY_Y_LOC_NONVAR \
@ -711,7 +711,7 @@
#define UNIFY_N_VOIDS_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
(*_SREG) += (*_PREG)->y_u.os.s; \
(*_SREG) += (*_PREG)->u.os.s; \
(*_PREG) = NEXTOP((*_PREG), os); \
GONext();
@ -719,7 +719,7 @@
print_instruction((*_PREG), ON_NATIVE); \
register CELL d0; \
CACHE_S(); \
d0 = (*_PREG)->y_u.os.s; \
d0 = (*_PREG)->u.os.s; \
READ_IN_S(); \
(*_PREG) = NEXTOP((*_PREG), os); \
for (; d0 > 0; d0--) { \
@ -738,7 +738,7 @@
#define UNIFY_L_N_VOIDS_WRITE_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
register CELL d0; \
d0 = (*_PREG)->y_u.os.s; \
d0 = (*_PREG)->u.os.s; \
(*_PREG) = NEXTOP((*_PREG), os); \
CACHE_S(); \
READ_IN_S(); \
@ -760,7 +760,7 @@
#define UNIFY_ATOM_UATOM_NONVAR \
BLOCK = (CELL)UNIFY_ATOM_UATOM_NONVAR; \
FAILED = 0; \
if (d0 != (*_PREG)->y_u.oc.c) { \
if (d0 != (*_PREG)->u.oc.c) { \
YAAM_FAIL; \
} \
else { \
@ -769,14 +769,14 @@
}
#define UNIFY_ATOM_UATOM_UNK \
d0 = (*_PREG)->y_u.oc.c; \
d0 = (*_PREG)->u.oc.c; \
(*_PREG) = NEXTOP((*_PREG), oc); \
Bind_Global(pt0, d0); \
GONext();
#define UNIFY_ATOM_WRITE_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
* (*_SREG)++ = (*_PREG)->y_u.oc.c; \
* (*_SREG)++ = (*_PREG)->u.oc.c; \
(*_PREG) = NEXTOP((*_PREG), oc); \
GONextW();
@ -791,7 +791,7 @@
#define UNIFY_L_ATOM_ULATOM_NONVAR \
BLOCK = (CELL)UNIFY_L_ATOM_ULATOM_NONVAR; \
FAILED = 0; \
if (d0 != (*_PREG)->y_u.oc.c) { \
if (d0 != (*_PREG)->u.oc.c) { \
YAAM_FAIL; \
} \
else { \
@ -800,23 +800,23 @@
}
#define UNIFY_L_ATOM_ULATOM_UNK \
d0 = (*_PREG)->y_u.oc.c; \
d0 = (*_PREG)->u.oc.c; \
(*_PREG) = NEXTOP((*_PREG), oc); \
Bind_Global(pt0, d0); \
GONext();
#define UNIFY_L_ATOM_WRITE_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
(*_SREG)[0] = (*_PREG)->y_u.oc.c; \
(*_SREG)[0] = (*_PREG)->u.oc.c; \
(*_PREG) = NEXTOP((*_PREG), oc); \
GONext();
#define UNIFY_N_ATOMS_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
register Int i = (*_PREG)->y_u.osc.s; \
register Int i = (*_PREG)->u.osc.s; \
register CELL d0, d1; \
register CELL *pt0; \
d1 = (*_PREG)->y_u.osc.c; \
d1 = (*_PREG)->u.osc.c; \
for (; i > 0; i--) { \
pt0 = (*_SREG)++; \
d0 = *pt0; \
@ -849,8 +849,8 @@
#define UNIFY_N_ATOMS_WRITE_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
register CELL d0, d1; \
d0 = (*_PREG)->y_u.osc.s; \
d1 = (*_PREG)->y_u.osc.c; \
d0 = (*_PREG)->u.osc.s; \
d1 = (*_PREG)->u.osc.c; \
CACHE_S(); \
READ_IN_S(); \
(*_PREG) = NEXTOP((*_PREG), osc); \
@ -873,21 +873,21 @@
d0 = *pt0;
#define UNIFY_FLOAT_UFLOAT_NONVAR_D0ISFUNCTOR \
pt1 = (*_PREG)->y_u.od.d; \
pt1 = (*_PREG)->u.od.d; \
(*_PREG) = NEXTOP((*_PREG), od);
#define UNIFY_FLOAT_UFLOAT_NONVAR_END \
GONext();
#define UNIFY_FLOAT_UFLOAT_UNK \
d1 = AbsAppl((*_PREG)->y_u.od.d); \
d1 = AbsAppl((*_PREG)->u.od.d); \
(*_PREG) = NEXTOP((*_PREG), od); \
Bind_Global(pt0, d1); \
GONext();
#define UNIFY_FLOAT_WRITE_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
* (*_SREG)++ = AbsAppl((*_PREG)->y_u.od.d); \
* (*_SREG)++ = AbsAppl((*_PREG)->u.od.d); \
(*_PREG) = NEXTOP((*_PREG), od); \
GONextW();
@ -904,14 +904,14 @@
d0 = *pt0;
#define UNIFY_L_FLOAT_D0ISFUNC \
pt1 = (*_PREG)->y_u.od.d; \
pt1 = (*_PREG)->u.od.d; \
(*_PREG) = NEXTOP((*_PREG), od);
#define UNIFY_L_FLOAT_EQUALS \
GONext();
#define UNIFY_L_FLOAT_ULFLOAT_UNK \
d1 = AbsAppl((*_PREG)->y_u.od.d); \
d1 = AbsAppl((*_PREG)->u.od.d); \
(*_PREG) = NEXTOP((*_PREG), od); \
Bind_Global(S_SREG, d1); \
GONext(); \
@ -919,7 +919,7 @@
#define UNIFY_L_FLOAT_WRITE_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
(*_SREG)[0] = AbsAppl((*_PREG)->y_u.od.d); \
(*_SREG)[0] = AbsAppl((*_PREG)->u.od.d); \
(*_PREG) = NEXTOP((*_PREG), od); \
GONext();
@ -935,21 +935,21 @@
d0 = *pt0;
#define UNIFY_LONGINT_D0ISFUNC \
pt1 = (*_PREG)->y_u.oi.i; \
pt1 = (*_PREG)->u.oi.i; \
(*_PREG) = NEXTOP((*_PREG), oi);
#define UNIFY_LONGINT_EQUALS \
GONext();
#define UNIFY_LONGINT_ULONGINT_UNK \
d1 = AbsAppl((*_PREG)->y_u.oi.i); \
d1 = AbsAppl((*_PREG)->u.oi.i); \
(*_PREG) = NEXTOP((*_PREG), oi); \
Bind_Global(pt0, d1); \
GONext();
#define UNIFY_LONGINT_WRITE_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
* (*_SREG)++ = AbsAppl((*_PREG)->y_u.oi.i); \
* (*_SREG)++ = AbsAppl((*_PREG)->u.oi.i); \
(*_PREG) = NEXTOP((*_PREG), oi); \
GONextW();
@ -966,21 +966,21 @@
d0 = *pt0;
#define UNIFY_L_LONGINT_D0ISFUNC \
pt1 = (*_PREG)->y_u.oi.i; \
pt1 = (*_PREG)->u.oi.i; \
(*_PREG) = NEXTOP((*_PREG), oi);
#define UNIFY_L_LONGINT_EQUALS \
GONext();
#define UNIFY_L_LONGINT_ULLONGINT_UNK \
d1 = AbsAppl((*_PREG)->y_u.oi.i); \
d1 = AbsAppl((*_PREG)->u.oi.i); \
(*_PREG) = NEXTOP((*_PREG), oi); \
Bind_Global(S_SREG, d1); \
GONext();
#define UNIFY_L_LONGINT_WRITE_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
(*_SREG)[0] = AbsAppl((*_PREG)->y_u.oi.i); \
(*_SREG)[0] = AbsAppl((*_PREG)->u.oi.i); \
(*_PREG) = NEXTOP((*_PREG), oi); \
GONext();
@ -1001,7 +1001,7 @@
GONext();
#define UNIFY_BIGINT_UBIGINT_UNK \
d1 = (*_PREG)->y_u.oN.b; \
d1 = (*_PREG)->u.oN.b; \
(*_PREG) = NEXTOP((*_PREG), oN); \
Bind_Global(pt0, d1); \
GONext();
@ -1025,7 +1025,7 @@
GONext();
#define UNIFY_L_BIGINT_ULBIGINT_UNK \
d1 = (*_PREG)->y_u.oN.b; \
d1 = (*_PREG)->u.oN.b; \
(*_PREG) = NEXTOP((*_PREG), oN); \
Bind_Global(S_SREG, d1); \
GONext(); \
@ -1041,12 +1041,12 @@
#define UNIFY_DBTERM_UDBTERM_NONVAR \
BLOCK = (CELL)UNIFY_DBTERM_UDBTERM_NONVAR; \
d1 = (*_PREG)->y_u.oD.D; \
d1 = (*_PREG)->u.oD.D; \
(*_PREG) = NEXTOP((*_PREG), oD); \
YAAM_UNIFYBOUND;
#define UNIFY_DBTERM_UDBTERM_UNK \
d1 = (*_PREG)->y_u.oD.D; \
d1 = (*_PREG)->u.oD.D; \
(*_PREG) = NEXTOP((*_PREG), oD); \
Bind_Global(pt0, d1); \
GONext();
@ -1061,12 +1061,12 @@
#define UNIFY_L_DBTERM_ULDBTERM_NONVAR \
BLOCK = (CELL)UNIFY_L_DBTERM_ULDBTERM_NONVAR; \
d1 = (*_PREG)->y_u.oD.D; \
d1 = (*_PREG)->u.oD.D; \
(*_PREG) = NEXTOP((*_PREG), oD); \
YAAM_UNIFYBOUND;
#define UNIFY_L_DBTERM_ULDBTERM_UNK \
d1 = (*_PREG)->y_u.oD.D; \
d1 = (*_PREG)->u.oD.D; \
(*_PREG) = NEXTOP((*_PREG), oD); \
Bind_Global(S_SREG, d1); \
GONext(); \
@ -1193,7 +1193,7 @@
CACHE_S(); \
READ_IN_S(); \
S_SREG = RepAppl(d0); \
d0 = (CELL) ((*_PREG)->y_u.ofa.f); \
d0 = (CELL) ((*_PREG)->u.ofa.f); \
if (*S_SREG != d0) { \
YAAM_FAIL; \
} \
@ -1210,9 +1210,9 @@
d1 = AbsAppl(HR); \
Bind_Global(pt0, d1); \
pt0 = HR; \
d0 = (CELL) ((*_PREG)->y_u.ofa.f); \
d0 = (CELL) ((*_PREG)->u.ofa.f); \
*pt0++ = d0; \
HR = pt0 + (*_PREG)->y_u.ofa.a; \
HR = pt0 + (*_PREG)->u.ofa.a; \
(*_PREG) = NEXTOP((*_PREG), ofa); \
(*_SREG) = pt0; \
GONextW(); \
@ -1228,9 +1228,9 @@
d0 = AbsAppl(HR); \
S_SREG[0] = d0; \
S_SREG = HR; \
d0 = (CELL) ((*_PREG)->y_u.ofa.f); \
d0 = (CELL) ((*_PREG)->u.ofa.f); \
*S_SREG++ = d0; \
HR = S_SREG + (*_PREG)->y_u.ofa.a; \
HR = S_SREG + (*_PREG)->u.ofa.a; \
(*_PREG) = NEXTOP((*_PREG), ofa); \
WRITEBACK_S(S_SREG); \
ENDCACHE_S(); \
@ -1252,7 +1252,7 @@
} \
else { \
(*_SREG) = RepAppl(d0); \
d0 = (CELL) ((*_PREG)->y_u.ofa.f); \
d0 = (CELL) ((*_PREG)->u.ofa.f); \
if (*(*_SREG)++ != d0) { \
YAAM_FAIL; \
} \
@ -1267,9 +1267,9 @@
d1 = AbsAppl(HR); \
Bind_Global(pt0, d1); \
pt0 = HR; \
d0 = (CELL) ((*_PREG)->y_u.ofa.f); \
d0 = (CELL) ((*_PREG)->u.ofa.f); \
*pt0++ = d0; \
HR = pt0 + (*_PREG)->y_u.ofa.a; \
HR = pt0 + (*_PREG)->u.ofa.a; \
(*_PREG) = NEXTOP((*_PREG), ofa); \
(*_SREG) = pt0; \
GONextW(); \
@ -1283,9 +1283,9 @@
READ_IN_S(); \
S_SREG[0] = d0; \
S_SREG = HR; \
d0 = (CELL) ((*_PREG)->y_u.ofa.f); \
d0 = (CELL) ((*_PREG)->u.ofa.f); \
*S_SREG++ = d0; \
HR = S_SREG + (*_PREG)->y_u.ofa.a; \
HR = S_SREG + (*_PREG)->u.ofa.a; \
(*_PREG) = NEXTOP((*_PREG), ofa); \
WRITEBACK_S(S_SREG); \
ENDCACHE_S(); \
@ -1293,49 +1293,49 @@
#define SAVE_PAIR_X_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
XREG((*_PREG)->y_u.ox.x) = AbsPair((*_SREG)); \
XREG((*_PREG)->u.ox.x) = AbsPair((*_SREG)); \
(*_PREG) = NEXTOP((*_PREG), ox); \
GONext();
#define SAVE_PAIR_X_WRITE_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
XREG((*_PREG)->y_u.ox.x) = AbsPair((*_SREG)); \
XREG((*_PREG)->u.ox.x) = AbsPair((*_SREG)); \
(*_PREG) = NEXTOP((*_PREG), ox); \
GONextW();
#define SAVE_PAIR_Y_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
INITIALIZE_PERMVAR(YREG+(*_PREG)->y_u.oy.y,AbsPair((*_SREG))); \
INITIALIZE_PERMVAR(YREG+(*_PREG)->u.oy.y,AbsPair((*_SREG))); \
(*_PREG) = NEXTOP((*_PREG), oy); \
GONext();
#define SAVE_PAIR_Y_WRITE_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
INITIALIZE_PERMVAR(YREG+(*_PREG)->y_u.oy.y,AbsPair((*_SREG))); \
INITIALIZE_PERMVAR(YREG+(*_PREG)->u.oy.y,AbsPair((*_SREG))); \
(*_PREG) = NEXTOP((*_PREG), oy); \
GONextW();
#define SAVE_APPL_X_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
XREG((*_PREG)->y_u.ox.x) = AbsAppl((*_SREG) - 1); \
XREG((*_PREG)->u.ox.x) = AbsAppl((*_SREG) - 1); \
(*_PREG) = NEXTOP((*_PREG), ox); \
GONext();
#define SAVE_APPL_X_WRITE_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
XREG((*_PREG)->y_u.ox.x) = AbsAppl((*_SREG) - 1); \
XREG((*_PREG)->u.ox.x) = AbsAppl((*_SREG) - 1); \
(*_PREG) = NEXTOP((*_PREG), ox); \
GONextW();
#define SAVE_APPL_Y_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
INITIALIZE_PERMVAR(YREG+(*_PREG)->y_u.oy.y,AbsAppl((*_SREG)-1)); \
INITIALIZE_PERMVAR(YREG+(*_PREG)->u.oy.y,AbsAppl((*_SREG)-1)); \
(*_PREG) = NEXTOP((*_PREG), oy); \
GONext();
#define SAVE_APPL_Y_WRITE_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
INITIALIZE_PERMVAR(YREG+(*_PREG)->y_u.oy.y,AbsAppl((*_SREG)-1)); \
INITIALIZE_PERMVAR(YREG+(*_PREG)->u.oy.y,AbsAppl((*_SREG)-1)); \
(*_PREG) = NEXTOP((*_PREG), oy); \
GONextW();

View File

@ -1,5 +1,5 @@
#define WRITE_X_VAR_INSTINIT \
XREG((*_PREG)->y_u.x.x) = Unsigned((*_SREG)); \
XREG((*_PREG)->u.x.x) = Unsigned((*_SREG)); \
(*_PREG) = NEXTOP((*_PREG), x); \
RESET_VARIABLE((*_SREG)); \
(*_SREG)++; \
@ -13,7 +13,7 @@
#define WRITE_N_VOIDS_INSTINIT \
register CELL d0; \
d0 = (*_PREG)->y_u.s.s; \
d0 = (*_PREG)->u.s.s; \
(*_PREG) = NEXTOP((*_PREG), s); \
for (; d0 > 0; d0--) { \
RESET_VARIABLE((*_SREG)); \
@ -22,7 +22,7 @@
GONext();
#define WRITE_Y_VAR_INSTINIT \
INITIALIZE_PERMVAR(YREG+(*_PREG)->y_u.y.y,Unsigned((*_SREG))); \
INITIALIZE_PERMVAR(YREG+(*_PREG)->u.y.y,Unsigned((*_SREG))); \
(*_PREG) = NEXTOP((*_PREG), y); \
RESET_VARIABLE((*_SREG)); \
(*_SREG)++; \
@ -30,7 +30,7 @@
#define WRITE_X_VAL_INSTINIT \
register CELL d0; \
d0 = XREG((*_PREG)->y_u.x.x); \
d0 = XREG((*_PREG)->u.x.x); \
*(*_SREG)++ = d0; \
(*_PREG) = NEXTOP((*_PREG), x); \
GONext();
@ -38,7 +38,7 @@
#define WRITE_X_LOC_INSTINIT \
register CELL d0; \
register CELL *pt0; \
d0 = XREG((*_PREG)->y_u.x.x); \
d0 = XREG((*_PREG)->u.x.x); \
(*_PREG) = NEXTOP((*_PREG), x);
#define WRITE_X_LOC_W_X_BOUND \
@ -104,9 +104,9 @@
#ifdef YAPOR_SBA
#define WRITE_Y_VAL_INSTINIT \
register CELL d0; \
d0 = YREG[(*_PREG)->y_u.y.y]; \
d0 = YREG[(*_PREG)->u.y.y]; \
if (d0 == 0) \
*(*_SREG)++ = (CELL)(YREG+(*_PREG)->y_u.y.y); \
*(*_SREG)++ = (CELL)(YREG+(*_PREG)->u.y.y); \
else \
*(*_SREG)++ = d0; \
(*_PREG) = NEXTOP((*_PREG), y); \
@ -114,7 +114,7 @@
#else /* YAPOR_SBA */
#define WRITE_Y_VAL_INSTINIT \
register CELL d0; \
d0 = YREG[(*_PREG)->y_u.y.y]; \
d0 = YREG[(*_PREG)->u.y.y]; \
*(*_SREG)++ = d0; \
(*_PREG) = NEXTOP((*_PREG), y); \
GONext();
@ -123,7 +123,7 @@
#define WRITE_Y_LOC_INSTINIT \
register CELL d0; \
register CELL *pt0; \
pt0 = YREG+(*_PREG)->y_u.y.y; \
pt0 = YREG+(*_PREG)->u.y.y; \
d0 = *pt0;
#define WRITE_Y_LOC_W_Y_BOUND \
@ -199,43 +199,43 @@
#define WRITE_ATOM_INSTINIT \
register CELL d0; \
d0 = (*_PREG)->y_u.c.c; \
d0 = (*_PREG)->u.c.c; \
*(*_SREG)++ = d0; \
(*_PREG) = NEXTOP((*_PREG), c); \
GONext();
#define WRITE_BIGINT_INSTINIT \
register CELL d0; \
d0 = (*_PREG)->y_u.N.b; \
d0 = (*_PREG)->u.N.b; \
*(*_SREG)++ = d0; \
(*_PREG) = NEXTOP((*_PREG), N); \
GONext();
#define WRITE_DBTERM_INSTINIT \
register CELL d0; \
d0 = (*_PREG)->y_u.D.D; \
d0 = (*_PREG)->u.D.D; \
*(*_SREG)++ = d0; \
(*_PREG) = NEXTOP((*_PREG), D); \
GONext();
#define WRITE_FLOAT_INSTINIT \
register CELL d0; \
d0 = AbsAppl((*_PREG)->y_u.d.d); \
d0 = AbsAppl((*_PREG)->u.d.d); \
*(*_SREG)++ = d0; \
(*_PREG) = NEXTOP((*_PREG), d); \
GONext();
#define WRITE_LONGIT_INSTINIT \
register CELL d0; \
d0 = AbsAppl((*_PREG)->y_u.i.i); \
d0 = AbsAppl((*_PREG)->u.i.i); \
*(*_SREG)++ = d0; \
(*_PREG) = NEXTOP((*_PREG), i); \
GONext();
#define WRITE_N_ATOMS_INSTINIT \
register CELL d0, d1; \
d0 = (*_PREG)->y_u.sc.s; \
d1 = (*_PREG)->y_u.sc.c; \
d0 = (*_PREG)->u.sc.s; \
d1 = (*_PREG)->u.sc.c; \
for (; d0 > 0; d0--) { \
*(*_SREG)++ = d1; \
} \
@ -275,9 +275,9 @@
SP[-1] = Unsigned((*_SREG)); \
SP[-2] = 1; \
SP -= 2; \
d0 = (CELL) ((*_PREG)->y_u.fa.f); \
*HR++ = d0; \
d0 = (*_PREG)->y_u.fa.a; \
d0 = (CELL) ((*_PREG)->u.fa.f); \
*H++ = d0; \
d0 = (*_PREG)->u.fa.a; \
(*_PREG) = NEXTOP((*_PREG), fa); \
(*_SREG) = HR; \
HR += d0; \
@ -287,10 +287,10 @@
register CELL d0; \
d0 = AbsAppl(HR); \
*(*_SREG) = d0; \
d0 = (CELL) ((*_PREG)->y_u.fa.f); \
*HR++ = d0; \
d0 = (CELL) ((*_PREG)->u.fa.f); \
*H++ = d0; \
(*_SREG) = HR; \
d0 = (*_PREG)->y_u.fa.a; \
d0 = (*_PREG)->u.fa.a; \
(*_PREG) = NEXTOP((*_PREG), fa); \
HR += d0; \
GONext();

View File

@ -1,6 +1,6 @@
#define WRITE_X_VAR_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
XREG((*_PREG)->y_u.x.x) = Unsigned((*_SREG)); \
XREG((*_PREG)->u.x.x) = Unsigned((*_SREG)); \
(*_PREG) = NEXTOP((*_PREG), x); \
RESET_VARIABLE((*_SREG)); \
(*_SREG)++; \
@ -16,7 +16,7 @@
#define WRITE_N_VOIDS_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
register CELL d0; \
d0 = (*_PREG)->y_u.s.s; \
d0 = (*_PREG)->u.s.s; \
(*_PREG) = NEXTOP((*_PREG), s); \
for (; d0 > 0; d0--) { \
RESET_VARIABLE((*_SREG)); \
@ -26,7 +26,7 @@
#define WRITE_Y_VAR_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
INITIALIZE_PERMVAR(YREG+(*_PREG)->y_u.y.y,Unsigned((*_SREG))); \
INITIALIZE_PERMVAR(YREG+(*_PREG)->u.y.y,Unsigned((*_SREG))); \
(*_PREG) = NEXTOP((*_PREG), y); \
RESET_VARIABLE((*_SREG)); \
(*_SREG)++; \
@ -35,7 +35,7 @@
#define WRITE_X_VAL_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
register CELL d0; \
d0 = XREG((*_PREG)->y_u.x.x); \
d0 = XREG((*_PREG)->u.x.x); \
*(*_SREG)++ = d0; \
(*_PREG) = NEXTOP((*_PREG), x); \
GONext();
@ -44,7 +44,7 @@
print_instruction((*_PREG), ON_NATIVE); \
register CELL d0; \
register CELL *pt0; \
d0 = XREG((*_PREG)->y_u.x.x); \
d0 = XREG((*_PREG)->u.x.x); \
(*_PREG) = NEXTOP((*_PREG), x);
#define WRITE_X_LOC_W_X_BOUND \
@ -111,9 +111,9 @@
#define WRITE_Y_VAL_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
register CELL d0; \
d0 = YREG[(*_PREG)->y_u.y.y]; \
d0 = YREG[(*_PREG)->u.y.y]; \
if (d0 == 0) \
*(*_SREG)++ = (CELL)(YREG+(*_PREG)->y_u.y.y); \
*(*_SREG)++ = (CELL)(YREG+(*_PREG)->u.y.y); \
else \
*(*_SREG)++ = d0; \
(*_PREG) = NEXTOP((*_PREG), y); \
@ -122,7 +122,7 @@
#define WRITE_Y_VAL_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
register CELL d0; \
d0 = YREG[(*_PREG)->y_u.y.y]; \
d0 = YREG[(*_PREG)->u.y.y]; \
*(*_SREG)++ = d0; \
(*_PREG) = NEXTOP((*_PREG), y); \
GONext();
@ -132,7 +132,7 @@
print_instruction((*_PREG), ON_NATIVE); \
register CELL d0; \
register CELL *pt0; \
pt0 = YREG+(*_PREG)->y_u.y.y; \
pt0 = YREG+(*_PREG)->u.y.y; \
d0 = *pt0;
#define WRITE_Y_LOC_W_Y_BOUND \
@ -209,7 +209,7 @@
#define WRITE_ATOM_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
register CELL d0; \
d0 = (*_PREG)->y_u.c.c; \
d0 = (*_PREG)->u.c.c; \
*(*_SREG)++ = d0; \
(*_PREG) = NEXTOP((*_PREG), c); \
GONext();
@ -217,7 +217,7 @@
#define WRITE_BIGINT_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
register CELL d0; \
d0 = (*_PREG)->y_u.N.b; \
d0 = (*_PREG)->u.N.b; \
*(*_SREG)++ = d0; \
(*_PREG) = NEXTOP((*_PREG), N); \
GONext();
@ -225,7 +225,7 @@
#define WRITE_DBTERM_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
register CELL d0; \
d0 = (*_PREG)->y_u.D.D; \
d0 = (*_PREG)->u.D.D; \
*(*_SREG)++ = d0; \
(*_PREG) = NEXTOP((*_PREG), D); \
GONext();
@ -233,7 +233,7 @@
#define WRITE_FLOAT_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
register CELL d0; \
d0 = AbsAppl((*_PREG)->y_u.d.d); \
d0 = AbsAppl((*_PREG)->u.d.d); \
*(*_SREG)++ = d0; \
(*_PREG) = NEXTOP((*_PREG), d); \
GONext();
@ -241,7 +241,7 @@
#define WRITE_LONGIT_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
register CELL d0; \
d0 = AbsAppl((*_PREG)->y_u.i.i); \
d0 = AbsAppl((*_PREG)->u.i.i); \
*(*_SREG)++ = d0; \
(*_PREG) = NEXTOP((*_PREG), i); \
GONext();
@ -249,8 +249,8 @@
#define WRITE_N_ATOMS_INSTINIT \
print_instruction((*_PREG), ON_NATIVE); \
register CELL d0, d1; \
d0 = (*_PREG)->y_u.sc.s; \
d1 = (*_PREG)->y_u.sc.c; \
d0 = (*_PREG)->u.sc.s; \
d1 = (*_PREG)->u.sc.c; \
for (; d0 > 0; d0--) { \
*(*_SREG)++ = d1; \
} \
@ -293,9 +293,9 @@
SP[-1] = Unsigned((*_SREG)); \
SP[-2] = 1; \
SP -= 2; \
d0 = (CELL) ((*_PREG)->y_u.fa.f); \
*HR++ = d0; \
d0 = (*_PREG)->y_u.fa.a; \
d0 = (CELL) ((*_PREG)->u.fa.f); \
*H++ = d0; \
d0 = (*_PREG)->u.fa.a; \
(*_PREG) = NEXTOP((*_PREG), fa); \
(*_SREG) = HR; \
HR += d0; \
@ -306,10 +306,10 @@
register CELL d0; \
d0 = AbsAppl(HR); \
*(*_SREG) = d0; \
d0 = (CELL) ((*_PREG)->y_u.fa.f); \
*HR++ = d0; \
d0 = (CELL) ((*_PREG)->u.fa.f); \
*H++ = d0; \
(*_SREG) = HR; \
d0 = (*_PREG)->y_u.fa.a; \
d0 = (*_PREG)->u.fa.a; \
(*_PREG) = NEXTOP((*_PREG), fa); \
HR += d0; \
GONext();

View File

@ -2,13 +2,12 @@
#include <unistd.h>
#include <sys/wait.h>
#include <fcntl.h>
#include <memory>
using namespace std;
#define FREE_ALLOCATED() \
free(buffer); \
free(p->y_u.jhc.jh->cmd); \
free(p->u.jhc.jh->cmd); \
free(outputfilename); \
free(optoutputfilename); \
free(cmd1); \
@ -40,8 +39,8 @@ using namespace std;
PI = PassRegistry::getPassRegistry()->getPassInfo(PASS->getPassID()); \
Kind = PASS->getPassKind(); \
ADD_PASS_ACCORDING_TO_KIND();
#include "PassPrinters.hh"
#include "PassPrinters.hpp"
void JIT_Compiler::analyze_module(llvm::Module* &M)
{
@ -50,9 +49,9 @@ void JIT_Compiler::analyze_module(llvm::Module* &M)
const PassInfo *PI;
PassKind Kind;
Pass.add(TLI); // First, I add on 'Pass' the Target Info of Module
Pass.add(new DataLayoutPass(M)); // Second, I must add Target Data on 'Pass'
Pass.add(new TargetData(M)); // Second, I must add Target Data on 'Pass'
for (int i = 0; i < ExpEnv.analysis_struc.n; i++) {
/*
* 'ExpEnv.analysis_struc.act_an' contains sorted analysis passes *
@ -85,9 +84,8 @@ void JIT_Compiler::analyze_module(llvm::Module* &M)
case e_createLazyValueInfoPass:
TREAT_CASE_FOR(createLazyValueInfoPass());
break;
//CHANGED FOR LLVM 3.5
case e_createLoopDependenceAnalysisPass:
TREAT_CASE_FOR(createDependenceAnalysisPass());
TREAT_CASE_FOR(createLoopDependenceAnalysisPass());
break;
case e_createLibCallAliasAnalysisPass:
TREAT_CASE_FOR(createLibCallAliasAnalysisPass(NULL));
@ -104,29 +102,24 @@ void JIT_Compiler::analyze_module(llvm::Module* &M)
case e_createNoAAPass:
TREAT_CASE_FOR(createNoAAPass());
break;
//NOT IN LLVM 3.5
//case e_createNoPathProfileInfoPass:
// TREAT_CASE_FOR(createNoPathProfileInfoPass());
// break;
//NOT IN LLVM 3.5
//case e_createNoProfileInfoPass:
// TREAT_CASE_FOR(createNoProfileInfoPass());
// break;
case e_createNoPathProfileInfoPass:
TREAT_CASE_FOR(createNoPathProfileInfoPass());
break;
case e_createNoProfileInfoPass:
TREAT_CASE_FOR(createNoProfileInfoPass());
break;
case e_createObjCARCAliasAnalysisPass:
TREAT_CASE_FOR(createObjCARCAliasAnalysisPass());
break;
//NOT IN LLVM 3.5
//case e_createProfileEstimatorPass:
// TREAT_CASE_FOR(createProfileEstimatorPass());
// break;
//CHANGED FOR LLVM 3.5
case e_createProfileLoaderPass:
TREAT_CASE_FOR(createSampleProfileLoaderPass());
case e_createProfileEstimatorPass:
TREAT_CASE_FOR(createProfileEstimatorPass());
break;
case e_createProfileLoaderPass:
TREAT_CASE_FOR(createProfileLoaderPass());
break;
case e_createProfileVerifierPass:
TREAT_CASE_FOR(createProfileVerifierPass());
break;
//NOT IN LLVM 3.5
//case e_createProfileVerifierPass:
// TREAT_CASE_FOR(createProfileVerifierPass());
// break;
case e_createRegionInfoPass:
TREAT_CASE_FOR(createRegionInfoPass());
break;
@ -136,9 +129,8 @@ void JIT_Compiler::analyze_module(llvm::Module* &M)
case e_createTypeBasedAliasAnalysisPass:
TREAT_CASE_FOR(createTypeBasedAliasAnalysisPass());
break;
//CHANGED FOR LLVM 3.5
case e_createDbgInfoPrinterPass:
TREAT_CASE_FOR(createDebugInfoVerifierPass());
TREAT_CASE_FOR(createDbgInfoPrinterPass());
break;
case e_createCFGPrinterPass:
TREAT_CASE_FOR(createCFGPrinterPass());
@ -164,23 +156,21 @@ void JIT_Compiler::analyze_module(llvm::Module* &M)
case e_createRegionOnlyPrinterPass:
TREAT_CASE_FOR(createRegionOnlyPrinterPass());
break;
//NOT IN LLVM 3.5
//case e_createPathProfileLoaderPass:
// TREAT_CASE_FOR(createPathProfileLoaderPass());
// break;
//NOT IN LLVM 3.5
//case e_createPathProfileVerifierPass:
// TREAT_CASE_FOR(createPathProfileVerifierPass());
// break;
case e_createPathProfileLoaderPass:
TREAT_CASE_FOR(createPathProfileLoaderPass());
break;
case e_createPathProfileVerifierPass:
TREAT_CASE_FOR(createPathProfileVerifierPass());
break;
default:;
}
}
/* if 'llvm::TimePassesIsEnabled' is 'true', llvm time passes are printed on 'shutdown_llvm()' (p_halt -- stdpreds.c) */
llvm::TimePassesIsEnabled = ExpEnv.analysis_struc.time_pass_enabled;
/* Use 'llvm::EnableStatistics()' so that llvm stats are printed on 'shutdown_llvm()' (p_halt -- stdpreds.c) */
if (ExpEnv.analysis_struc.stats_enabled) llvm::EnableStatistics();
/*
* Here, I configure resulting analysis output -- default: stderr *
* Use analysis_output_file/1 to change *
@ -218,22 +208,21 @@ void JIT_Compiler::optimize_module(llvm::Module* &M)
/* Yes, I do, so... */
/* Initializes PassManager for Function */
std::shared_ptr<FunctionPassManager> FPM;
OwningPtr<FunctionPassManager> FPM;
FPM.reset(new FunctionPassManager(M));
FPM->add(new DataLayoutPass(M));
FPM->add(new TargetData(M));
PassManagerBuilder Builder; // aid to 'FPM' and 'MPM'
/* Initializes PassManager for Function */
PassManager MPM;
TargetLibraryInfo *TLI = new TargetLibraryInfo(Triple(M->getTargetTriple()));
MPM.add(TLI);
MPM.add(new DataLayoutPass(M));
MPM.add(new TargetData(M));
/* Populates 'Builder' */
Builder.OptLevel = ExpEnv.transform_struc.optlevel;
Builder.DisableUnitAtATime = !ExpEnv.transform_struc.unit_at_time_enabled;
//NOT IN LLVM 3.5
//Builder.DisableSimplifyLibCalls = !ExpEnv.transform_struc.simplify_libcalls_enabled;
Builder.DisableSimplifyLibCalls = !ExpEnv.transform_struc.simplify_libcalls_enabled;
/* inline and unrool only be enabled if 'ExpEnv.transform_struc.optlevel' > 0 */
if (ExpEnv.transform_struc.optlevel) Builder.Inliner =
createFunctionInliningPass(ExpEnv.transform_struc.opt_args.inline_threshold);
@ -245,7 +234,7 @@ void JIT_Compiler::optimize_module(llvm::Module* &M)
Builder.populateFunctionPassManager(*FPM);
/* Populates 'MPM' from 'Builder' */
Builder.populateModulePassManager(MPM);
/*
* Enabling link-time optimizations -- default is no *
* Use 'link_time_opt/1', 'link_time_opt/3', 'enable_link_time_opt/0', or 'enable_link_time_opt/2' to change *
@ -273,7 +262,7 @@ void JIT_Compiler::optimize_module(llvm::Module* &M)
PassManager Pass; // 'Pass' stores transform passes to be applied
TargetLibraryInfo *TLI = new TargetLibraryInfo(Triple(M->getTargetTriple()));
Pass.add(TLI); // First, I add on 'Pass' the Target Info of Module
Pass.add(new DataLayoutPass(M)); // Second, I must add Target Data on 'Pass'
Pass.add(new TargetData(M)); // Second, I must add Target Data on 'Pass'
for (int i = 0; i < ExpEnv.transform_struc.n; i++) {
/*
* 'ExpEnv.transform_struc.act_tr' contains sorted transform passes *
@ -295,10 +284,9 @@ void JIT_Compiler::optimize_module(llvm::Module* &M)
case t_createBlockExtractorPass:
Pass.add(createBlockExtractorPass());
break;
//NOT IN LLVM 3.5
//case t_createBlockPlacementPass:
// Pass.add(createBlockPlacementPass());
// break;
case t_createBlockPlacementPass:
Pass.add(createBlockPlacementPass());
break;
case t_createBreakCriticalEdgesPass:
Pass.add(createBreakCriticalEdgesPass());
break;
@ -369,7 +357,7 @@ void JIT_Compiler::optimize_module(llvm::Module* &M)
Pass.add(createInstructionSimplifierPass());
break;
case t_createInternalizePass:
Pass.add(createInternalizePass());
Pass.add(createInternalizePass(true));
break;
case t_createIPConstantPropagationPass:
Pass.add(createIPConstantPropagationPass());
@ -461,10 +449,9 @@ void JIT_Compiler::optimize_module(llvm::Module* &M)
case t_createSCCPPass:
Pass.add(createSCCPPass());
break;
//NOT IN LLVM 3.5
//case t_createSimplifyLibCallsPass:
// Pass.add(createSimplifyLibCallsPass());
// break;
case t_createSimplifyLibCallsPass:
Pass.add(createSimplifyLibCallsPass());
break;
case t_createSingleLoopExtractorPass:
Pass.add(createSingleLoopExtractorPass());
break;
@ -571,25 +558,26 @@ void* JIT_Compiler::compile_all(LLVMContext* &Context, yamop* p)
"-DYAP_JIT", "-D_NATIVE=1", "-I.", "-I./H", "-I./include", "-I./os", "-I./OPTYap", "-I./BEAM", "-I./MYDDAS", "-I./HPP", "-xc", "-c", "-", "-o", "-", "-emit-llvm", NULL
};
#pragma GCC diagnostic pop
std::string errStr;
error_code e;
llvm::error_code e;
OwningPtr<MemoryBuffer> bf;
/* Pipe to communicate 'echo' with 'clang' */
int pipe1[2];
int pid_echo, pid_clang ;
/* 'clang' out file */
char* outputfilename = (char*)malloc(33*sizeof(char));
sprintf(outputfilename, "%lx.bc", (CELL)p);
int Output = open(outputfilename, O_CREAT | O_RDWR, 0644);
/* Creating pipes */
if (pipe(pipe1)<0) {
perror(" ERROR!!\n ERROR") ;
exit(1);
}
/* Calls echo. */
pid_echo = fork() ;
if (pid_echo < 0) {
@ -599,12 +587,12 @@ void* JIT_Compiler::compile_all(LLVMContext* &Context, yamop* p)
if (!pid_echo) {
/* Setting echo's output to 1st pipe */
dup2(pipe1[1], 1);
/* Closing pipes */
close(pipe1[0]);
close(pipe1[1]);
execlp("echo", "echo", p->y_u.jhc.jh->tcc.cmd, NULL);
execlp("echo", "echo", p->u.jhc.jh->tcc.cmd, NULL);
}
else {
/* Calls clang. */
@ -619,11 +607,11 @@ void* JIT_Compiler::compile_all(LLVMContext* &Context, yamop* p)
/* Setting clang's output to Output */
dup2(Output, 1) ;
/* Closing pipes */
close(pipe1[0]);
close(pipe1[1]);
execvp(*clang_args, clang_args);
}
}
@ -637,15 +625,14 @@ void* JIT_Compiler::compile_all(LLVMContext* &Context, yamop* p)
// 2 means two processes: 'echo' and 'clang'
for (i = 0; i < 2; i++) wait(status);
/***/
/*
* At this point, the compiled code (O0) is on 'Output' *
* I need to read it to main memory *
* for this, I'll use 'MemoryBuffer::getOpenFile' *
*/
lseek(Output, 0, SEEK_SET);
ErrorOr<std::unique_ptr<MemoryBuffer>> em = MemoryBuffer::getOpenFile(Output, outputfilename, -1);
e = em.getError();
e = MemoryBuffer::getOpenFile(Output, outputfilename, bf);
if (e) {
errs() << "ERROR::Unable to MemoryBuffer from " << outputfilename << " -- " << e.message() << "\n";
exit(1);
@ -654,9 +641,9 @@ void* JIT_Compiler::compile_all(LLVMContext* &Context, yamop* p)
/*
* At this point, the compiled code (O0) is on main memory *
* I need to read it to Module *
* for this, I'll use 'parseBitcodeFile' *
* for this, I'll use 'ParseBitcodeFile' *
*/
Module *Mod = *parseBitcodeFile(em->get(), *Context);
Module *Mod = ParseBitcodeFile(bf.get(), *Context);
/*
* verify module correctness *
@ -683,41 +670,41 @@ void* JIT_Compiler::compile_all(LLVMContext* &Context, yamop* p)
analyze_module(Mod);
/* Optimize module -- transform predicates */
optimize_module(Mod);
/* Computing size of optimized module */
{
/* Open file 'tmp.bc' which will be filled by optimized Module */
std::shared_ptr<tool_output_file> Out;
OwningPtr<tool_output_file> Out;
std::string ErrorInfo;
Out.reset(new tool_output_file("tmp.bc", ErrorInfo, llvm::sys::fs::F_None));
Out.reset(new tool_output_file("tmp.bc", ErrorInfo, raw_fd_ostream::F_Binary));
if (!ErrorInfo.empty()) {
errs() << ErrorInfo << '\n';
exit(1);
}
/* 'createPrintModulePass(arg)' will print Module (now optimized) to on file represented by 'arg' */
PassManager Pass;
Pass.add(createPrintModulePass(Out->os()));
Pass.add(createPrintModulePass(&Out->os()));
Pass.run(*Mod);
/* 'Out->keep()' will keep printed module to file and will close file */
Out->keep();
/* Open file 'tmp.bc' */
int Outtmp = open("tmp.bc", O_CREAT | O_RDWR, 0644);
#if YAP_STAT_PREDS
/* for statistics... compute file size and store value on 'NativeArea->area.native_size_bytes' */
NativeArea->area.native_size_bytes[p->y_u.jhc.jh->caa.naddress][NativeArea->area.nrecomp[p->y_u.jhc.jh->caa.naddress]-1] = lseek(Outtmp, 0, SEEK_END);
NativeArea->area.native_size_bytes[p->u.jhc.jh->caa.naddress][NativeArea->area.nrecomp[p->u.jhc.jh->caa.naddress]-1] = lseek(Outtmp, 0, SEEK_END);
#endif
close(Outtmp);
remove("tmp.bc");
}
/***/
#if YAP_DBG_PREDS
/* for debug... print module after optimizing it */
if (ExpEnv.debug_struc.pprint_llva.print_llva_after)
errs() << "Module after optimization::\n" << *Mod;
#endif
/*
* verify module correctness *
* predicates: *
@ -733,11 +720,10 @@ void* JIT_Compiler::compile_all(LLVMContext* &Context, yamop* p)
}
}
/***/
// materializeAllPermanently -- Make sure all GlobalValues in this Module are fully read
error_code materialize_error = Mod->materializeAllPermanently();
if (materialize_error.value() != 0) {
errs() <<"Error:: bitcode didn't read correctly. -- " << materialize_error.message() << "\n";
// MaterializeAllPermanently -- Make sure all GlobalValues in this Module are fully read
if (Mod->MaterializeAllPermanently(&errStr)) {
errs() <<"Error:: bitcode didn't read correctly. -- " << errStr << "\n";
exit(1);
}
@ -804,14 +790,12 @@ void* JIT_Compiler::compile_all(LLVMContext* &Context, yamop* p)
{
/* codegen predicates 'enable_framepointer_elimination/0' or 'disable_framepointer_elimination/0' */
Options.NoFramePointerElim = (bool)ExpEnv.codegen_struc.struc_targetopt.noframepointerelim;
//NOT IN LLVM 3.5
//Options.NoFramePointerElimNonLeaf = (bool)ExpEnv.codegen_struc.struc_targetopt.noframepointerelim;
Options.NoFramePointerElimNonLeaf = (bool)ExpEnv.codegen_struc.struc_targetopt.noframepointerelim;
/***/
// codegen predicates 'less_precise_fp_mad_option/0' or 'more_precise_fp_mad_option/0'
Options.LessPreciseFPMADOption = (bool)ExpEnv.codegen_struc.struc_targetopt.lessprecisefpmadoption;
// codegen predicates 'no_excess_fp_precision/0' or 'excess_fp_precision/0'
//NOT IN LLVM 3.5
//Options.NoExcessFPPrecision = (bool)ExpEnv.codegen_struc.struc_targetopt.noexcessfpprecision;
Options.NoExcessFPPrecision = (bool)ExpEnv.codegen_struc.struc_targetopt.noexcessfpprecision;
// codegen predicates 'unsafe_fp_math/0' or 'safe_fp_math/0'
Options.UnsafeFPMath = (bool)ExpEnv.codegen_struc.struc_targetopt.unsafefpmath;
// codegen predicates 'rounding_mode_dynamically_changed/0' or 'rounding_mode_not_changed/0'
@ -820,8 +804,7 @@ void* JIT_Compiler::compile_all(LLVMContext* &Context, yamop* p)
// codegen predicates 'no_use_soft_float/0' or 'use_soft_float/0'
Options.UseSoftFloat = (bool)ExpEnv.codegen_struc.struc_targetopt.usesoftfloat;
// codegen predicates 'enable_jit_exception_handling/0' or 'disable_jit_exception_handling/0'
//NOT IN LLVM 3.5
//Options.JITExceptionHandling = (bool)ExpEnv.codegen_struc.struc_targetopt.jitexceptionhandling;
Options.JITExceptionHandling = (bool)ExpEnv.codegen_struc.struc_targetopt.jitexceptionhandling;
// codegen predicates 'enable_jit_emit_debug_info/0' or 'disable_jit_emit_debug_info/0'
Options.JITEmitDebugInfo = (bool)ExpEnv.codegen_struc.struc_targetopt.jitemitdebuginfo;
// codegen predicates 'enable_jit_emit_debug_info_to_disk/0' or 'disable_jit_emit_debug_info_to_disk/0'
@ -868,7 +851,7 @@ void* JIT_Compiler::compile_all(LLVMContext* &Context, yamop* p)
*/
close(Output);
remove(outputfilename);
free(p->y_u.jhc.jh->tcc.cmd);
free(p->u.jhc.jh->tcc.cmd);
free(outputfilename);
return NULL;
}
@ -877,10 +860,10 @@ void* JIT_Compiler::compile_all(LLVMContext* &Context, yamop* p)
// 1. execute all of the static constructors or destructors for program
EE->runStaticConstructorsDestructors(false);
global++;
close(Output);
remove(outputfilename);
free(p->y_u.jhc.jh->tcc.cmd);
free(p->u.jhc.jh->tcc.cmd);
free(outputfilename);
// 2. get native pointer from 'clause' (our function within Module) and return it
return EE->getPointerToFunction(EntryFn);

View File

@ -32,12 +32,12 @@ then
AC_CHECK_PROG(LLVM, llvm-config, [yes],[no])
if test "$LLVM" = "no" ;then
AC_MSG_ERROR([--enable-jit was given, but test for LLVM 3.5 failed])
AC_MSG_ERROR([--enable-jit was given, but test for LLVM 3.1 failed])
else
LLVM_VERSION="`llvm-config --version`"
if test "$LLVM_VERSION" != "3.5.0";then
AC_MSG_ERROR([Test for LLVM 3.5 failed])
if test "$LLVM_VERSION" != "3.1";then
AC_MSG_ERROR([Test for LLVM 3.1 failed])
fi
fi
@ -56,7 +56,7 @@ then
JITCODEGENPREDS="jit_codegenpreds.o"
JITFLAGS="`llvm-config --cxxflags`"
JITLD="`llvm-config --ldflags`"
JITLIBS="`llvm-config --libs all` -pthread -lffi -lz"
JITLIBS="`llvm-config --libs all`"
fi

View File

@ -21,65 +21,65 @@
#define N_ANALYSIS_PASSES 33
// Disable one (passed by argument) LLVM analysis pass
static Int p_disable_analysis_pass(void);
static Int p_disable_analysis_pass(USES_REGS1 ) ;
// Enable one (passed by argument) LLVM analysis pass
static Int p_analysis_pass(void);
static Int p_analysis_pass( USES_REGS1 );
// Enable one (passed by argument) LLVM analysis pass
static Int p_enable_analysis_pass(void);
static Int p_enable_analysis_pass( USES_REGS1 );
// Enable a list (passed by argument) of LLVM analysis passes
static Int p_analysis_passes(void);
static Int p_analysis_passes( USES_REGS1 );
// Enable all available LLVM analysis passes
static Int p_enable_all_analysis_passes(void);
static Int p_enable_all_analysis_passes( USES_REGS1 );
// Disable all available LLVM analysis passes
static Int p_disable_all_analysis_passes(void);
static Int p_disable_all_analysis_passes( USES_REGS1 );
// Enable LLVM statistics
static Int p_enable_stats(void);
static Int p_enable_stats( USES_REGS1 );
// Enable elapsed time of each LLVM's task
static Int p_enable_time_passes(void);
static Int p_enable_time_passes( USES_REGS1 );
// Checks generated modules are correct (before optimize it). Use only if you suspect that any module has been generated incorrectly.
static Int p_enable_module_correctness(void);
static Int p_enable_module_correctness( USES_REGS1 );
// Same as 'p_enable_module_correctness', but accepts one argument, which defines when modules are checked.
// Valid values are those defined by 'enumPointToVerifiy' on 'amidefs.h'
static Int p_enable_module_correctness1(void);
static Int p_enable_module_correctness1( USES_REGS1 );
// Same as 'p_enable_module_correctness' with ARG1 = NOPOINT
static Int p_verify_module_nopoint(void);
static Int p_verify_module_nopoint( USES_REGS1 );
// Same as 'p_enable_module_correctness' with ARG1 = BEFORE
static Int p_verify_module_before(void);
static Int p_verify_module_before( USES_REGS1 );
// Same as 'p_enable_module_correctness' with ARG1 = AFTER
static Int p_verify_module_after(void);
static Int p_verify_module_after( USES_REGS1 );
// Same as 'p_enable_module_correctness' with ARG1 = BOTH
static Int p_verify_module_both(void);
static Int p_verify_module_both( USES_REGS1 );
// Disable LLVM statistics
static Int p_disable_stats(void);
static Int p_disable_stats( USES_REGS1 );
// Disable elapsed time of each LLVM's task
static Int p_disable_time_passes(void);
static Int p_disable_time_passes( USES_REGS1 ) );
// Don't check generated modules are correct
static Int p_disable_module_correctness(void);
static Int p_disable_module_correctness( USES_REGS1 )
// Set output file where analysis results are emitted. 'stderr' and 'stdout' are valid values
static Int p_analysis_output_file(void);
static Int p_analysis_output_file( USES_REGS1 ) ;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wimplicit-function-declaration"
static Int
p_disable_analysis_pass(void)
p_disable_analysis_pass( USES_REGS1 )
{
// First: stores what analysis pass should be disabled
@ -101,7 +101,7 @@ p_disable_analysis_pass(void)
int i = 0, j = 0;
char *tmp;
// gets string from atom and stores it on 'str'
char *str = (char*)malloc(YAP_AtomNameLength(AtomOfTerm(t))*sizeof(char));
char *str = (char*)malloc(YAP_AtomNameLength(AtomOfTerm(t))*sizeof(char)
strcpy(str, AtomName(AtomOfTerm(t)));
// Makes upper characters of 'str' (for comparison)
UPPER_ENTRY(str);
@ -181,7 +181,7 @@ p_disable_analysis_pass(void)
}
static Int
p_analysis_pass(void)
p_analysis_pass( USES_REGS1 )
{
// First: disables analysis pass (if be active)
p_disable_analysis_pass();
@ -269,13 +269,13 @@ p_analysis_pass(void)
}
static Int
p_enable_analysis_pass(void)
p_enable_analysis_pass( USES_REGS1 )
{
return p_analysis_pass();
}
static Int
p_analysis_passes(void)
p_analysis_passes( USES_REGS1 )
{
int i = 0, j = 0;
char *tmp;
@ -415,7 +415,7 @@ p_analysis_passes(void)
}
static Int
p_enable_all_analysis_passes(void)
p_enable_all_analysis_passes( USES_REGS1 )
{
// Same as 'analysis_passes(all)'
// First, disable all analysis passes
@ -434,7 +434,7 @@ p_enable_all_analysis_passes(void)
}
static Int
p_disable_all_analysis_passes(void)
p_disable_all_analysis_passes( USES_REGS1 )
{
// Just empty 'ExpEnv.analysis_struc.act_an'
if (ExpEnv.analysis_struc.act_an) free(ExpEnv.analysis_struc.act_an);
@ -444,28 +444,28 @@ p_disable_all_analysis_passes(void)
}
static Int
p_enable_stats(void)
p_enable_stats( USES_REGS1 )
{
ExpEnv.analysis_struc.stats_enabled = 1;
return TRUE;
}
static Int
p_enable_time_passes(void)
p_enable_time_passes( USES_REGS1 )
{
ExpEnv.analysis_struc.time_pass_enabled = 1;
return TRUE;
}
static Int
p_enable_module_correctness(void)
p_enable_module_correctness( USES_REGS1 )
{
ExpEnv.analysis_struc.pointtoverifymodule = AFTER;
return TRUE;
}
static Int
p_enable_module_correctness1(void)
p_enable_module_correctness1( USES_REGS1 )
{
Term t = Deref(ARG1);
char *tmp;
@ -499,7 +499,7 @@ p_enable_module_correctness1(void)
}
static Int
p_verify_module_nopoint(void)
p_verify_module_nopoint( USES_REGS1 )
{
// Same as 'enable_module_correctness(nopoint)'
ExpEnv.analysis_struc.pointtoverifymodule = NOPOINT;
@ -507,7 +507,7 @@ p_verify_module_nopoint(void)
}
static Int
p_verify_module_before(void)
p_verify_module_before( USES_REGS1 )
{
// Same as 'enable_module_correctness(before)'
ExpEnv.analysis_struc.pointtoverifymodule = BEFORE;
@ -515,7 +515,7 @@ p_verify_module_before(void)
}
static Int
p_verify_module_after(void)
p_verify_module_after( USES_REGS1 )
{
// Same as 'enable_module_correctness(after)'
ExpEnv.analysis_struc.pointtoverifymodule = AFTER;
@ -523,7 +523,7 @@ p_verify_module_after(void)
}
static Int
p_verify_module_both(void)
p_verify_module_both( USES_REGS1 )
{
// Same as 'enable_module_correctness(both)'
ExpEnv.analysis_struc.pointtoverifymodule = BOTH;
@ -531,28 +531,28 @@ p_verify_module_both(void)
}
static Int
p_disable_stats(void)
p_disable_stats( USES_REGS1 )
{
ExpEnv.analysis_struc.stats_enabled = 0;
return TRUE;
}
static Int
p_disable_time_passes(void)
p_disable_time_passes( USES_REGS1 )
{
ExpEnv.analysis_struc.time_pass_enabled = 0;
return TRUE;
}
static Int
p_disable_module_correctness(void)
p_disable_module_correctness( USES_REGS1 )
{
ExpEnv.analysis_struc.pointtoverifymodule = NOPOINT;
return TRUE;
}
static Int
p_analysis_output_file(void)
p_analysis_output_file( USES_REGS1 )
{
Term t = Deref(ARG1);
char *tmp;

View File

@ -18,228 +18,228 @@
#include "jit_predicates.hh"
/* Predicates for LLVM Target Options configuration */
static Int p_enable_framepointer_elimination(void);
static Int p_more_precise_fp_mad_option(void);
static Int p_excess_fp_precision(void);
static Int p_safe_fp_math(void);
static Int p_rounding_mode_not_changed(void);
static Int p_no_use_soft_float(void);
static Int p_disable_jit_exception_handling(void);
static Int p_disable_jit_emit_debug_info(void);
static Int p_disable_jit_emit_debug_info_to_disk(void);
static Int p_no_guaranteed_tail_call_opt(void);
static Int p_enable_tail_calls(void);
static Int p_disable_fast_isel(void);
static Int p_disable_framepointer_elimination(void);
static Int p_less_precise_fp_mad_option(void);
static Int p_no_excess_fp_precision(void);
static Int p_unsafe_fp_math(void);
static Int p_rounding_mode_dynamically_changed(void);
static Int p_use_soft_float(void);
static Int p_enable_jit_exception_handling(void);
static Int p_enable_jit_emit_debug_info(void);
static Int p_enable_jit_emit_debug_info_to_disk(void);
static Int p_guaranteed_tail_call_opt(void);
static Int p_disable_tail_calls(void);
static Int p_enable_fast_isel(void);
static Int p_fp_abitype(void);
static Int p_default_fp_abitype(void);
static Int p_enable_framepointer_elimination( USES_REGS1 );
static Int p_more_precise_fp_mad_option( USES_REGS1 );
static Int p_excess_fp_precision( USES_REGS1 );
static Int p_safe_fp_math( USES_REGS1 );
static Int p_rounding_mode_not_changed( USES_REGS1 );
static Int p_no_use_soft_float( USES_REGS1 );
static Int p_disable_jit_exception_handling( USES_REGS1 );
static Int p_disable_jit_emit_debug_info( USES_REGS1 );
static Int p_disable_jit_emit_debug_info_to_disk( USES_REGS1 );
static Int p_no_guaranteed_tail_call_opt( USES_REGS1 );
static Int p_enable_tail_calls( USES_REGS1 );
static Int p_disable_fast_isel( USES_REGS1 );
static Int p_disable_framepointer_elimination( USES_REGS1 );
static Int p_less_precise_fp_mad_option( USES_REGS1 );
static Int p_no_excess_fp_precision( USES_REGS1 );
static Int p_unsafe_fp_math( USES_REGS1 );
static Int p_rounding_mode_dynamically_changed( USES_REGS1 );
static Int p_use_soft_float( USES_REGS1 );
static Int p_enable_jit_exception_handling( USES_REGS1 );
static Int p_enable_jit_emit_debug_info( USES_REGS1 );
static Int p_enable_jit_emit_debug_info_to_disk( USES_REGS1 );
static Int p_guaranteed_tail_call_opt( USES_REGS1 );
static Int p_disable_tail_calls( USES_REGS1 );
static Int p_enable_fast_isel( USES_REGS1 );
static Int p_fp_abitype( USES_REGS1 );
static Int p_default_fp_abitype( USES_REGS1 );
// LLVM Execution Engine level
static Int p_engine_opt_level(void);
static Int p_reset_engine_opt_level(void);
static Int p_engine_opt_level( USES_REGS1 );
static Int p_reset_engine_opt_level( USES_REGS1 );
// LLVM Execution Engine reloc model
static Int p_relocmodel(void);
static Int p_reset_relocmodel(void);
static Int p_relocmodel( USES_REGS1 );
static Int p_reset_relocmodel( USES_REGS1 );
// LLVM Execution Engine code model
static Int p_codemodel(void);
static Int p_reset_codemodel(void);
static Int p_codemodel( USES_REGS1 );
static Int p_reset_codemodel( USES_REGS1 );
// Enable MC JIT (experimental)
static Int p_enable_mcjit(void);
static Int p_enable_mcjit( USES_REGS1 );
// Disable MC JIT (experimental)
static Int p_disable_mcjit(void);
static Int p_disable_mcjit( USES_REGS1 );
// LLVM Register Allocator (not implemented -- for some reason, LLVM crashes when I use it on 'JIT_Compiler.cpp')
static Int p_register_allocator(void);
static Int p_reset_register_allocator(void);
static Int p_register_allocator( USES_REGS1 );
static Int p_reset_register_allocator( USES_REGS1 );
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wimplicit-function-declaration"
static Int
p_enable_framepointer_elimination(void)
p_enable_framepointer_elimination( USES_REGS1 )
{
ExpEnv.codegen_struc.struc_targetopt.noframepointerelim = FALSE;
return TRUE;
}
static Int
p_more_precise_fp_mad_option(void)
p_more_precise_fp_mad_option( USES_REGS1 )
{
ExpEnv.codegen_struc.struc_targetopt.lessprecisefpmadoption = FALSE;
return TRUE;
}
static Int
p_excess_fp_precision(void)
p_excess_fp_precision( USES_REGS1 )
{
ExpEnv.codegen_struc.struc_targetopt.noexcessfpprecision = FALSE;
return TRUE;
}
static Int
p_safe_fp_math(void)
p_safe_fp_math( USES_REGS1 )
{
ExpEnv.codegen_struc.struc_targetopt.unsafefpmath = FALSE;
return TRUE;
}
static Int
p_rounding_mode_not_changed(void)
p_rounding_mode_not_changed( USES_REGS1 )
{
ExpEnv.codegen_struc.struc_targetopt.honorsigndependentroundingfpmathoption = FALSE;
return TRUE;
}
static Int
p_no_use_soft_float(void)
p_no_use_soft_float( USES_REGS1 )
{
ExpEnv.codegen_struc.struc_targetopt.usesoftfloat = FALSE;
return TRUE;
}
static Int
p_disable_jit_exception_handling(void)
p_disable_jit_exception_handling( USES_REGS1 )
{
ExpEnv.codegen_struc.struc_targetopt.jitexceptionhandling = FALSE;
return TRUE;
}
static Int
p_disable_jit_emit_debug_info(void)
p_disable_jit_emit_debug_info( USES_REGS1 )
{
ExpEnv.codegen_struc.struc_targetopt.jitemitdebuginfo = FALSE;
return TRUE;
}
static Int
p_disable_jit_emit_debug_info_to_disk(void)
p_disable_jit_emit_debug_info_to_disk( USES_REGS1 )
{
ExpEnv.codegen_struc.struc_targetopt.jitemitdebuginfotodisk = FALSE;
return TRUE;
}
static Int
p_no_guaranteed_tail_call_opt(void)
p_no_guaranteed_tail_call_opt( USES_REGS1 )
{
ExpEnv.codegen_struc.struc_targetopt.guaranteedtailcallopt = FALSE;
return TRUE;
}
static Int
p_enable_tail_calls(void)
p_enable_tail_calls( USES_REGS1 )
{
ExpEnv.codegen_struc.struc_targetopt.disabletailcalls = FALSE;
return TRUE;
}
static Int
p_disable_fast_isel(void)
p_disable_fast_isel( USES_REGS1 )
{
ExpEnv.codegen_struc.struc_targetopt.fastisel = FALSE;
return TRUE;
}
static Int
p_disable_framepointer_elimination(void)
p_disable_framepointer_elimination( USES_REGS1 )
{
ExpEnv.codegen_struc.struc_targetopt.noframepointerelim = TRUE;
return TRUE;
}
static Int
p_less_precise_fp_mad_option(void)
p_less_precise_fp_mad_option( USES_REGS1 )
{
ExpEnv.codegen_struc.struc_targetopt.lessprecisefpmadoption = TRUE;
return TRUE;
}
static Int
p_no_excess_fp_precision(void)
p_no_excess_fp_precision( USES_REGS1 )
{
ExpEnv.codegen_struc.struc_targetopt.noexcessfpprecision = TRUE;
return TRUE;
}
static Int
p_unsafe_fp_math(void)
p_unsafe_fp_math( USES_REGS1 )
{
ExpEnv.codegen_struc.struc_targetopt.unsafefpmath = TRUE;
return TRUE;
}
static Int
p_rounding_mode_dynamically_changed(void)
p_rounding_mode_dynamically_changed( USES_REGS1 )
{
ExpEnv.codegen_struc.struc_targetopt.honorsigndependentroundingfpmathoption = TRUE;
return TRUE;
}
static Int
p_use_soft_float(void)
p_use_soft_float( USES_REGS1 )
{
ExpEnv.codegen_struc.struc_targetopt.usesoftfloat = TRUE;
return TRUE;
}
static Int
p_enable_jit_exception_handling(void)
p_enable_jit_exception_handling( USES_REGS1 )
{
ExpEnv.codegen_struc.struc_targetopt.jitexceptionhandling = TRUE;
return TRUE;
}
static Int
p_enable_jit_emit_debug_info(void)
p_enable_jit_emit_debug_info( USES_REGS1 )
{
ExpEnv.codegen_struc.struc_targetopt.jitemitdebuginfo = TRUE;
return TRUE;
}
static Int
p_enable_jit_emit_debug_info_to_disk(void)
p_enable_jit_emit_debug_info_to_disk( USES_REGS1 )
{
ExpEnv.codegen_struc.struc_targetopt.jitemitdebuginfotodisk = TRUE;
return TRUE;
}
static Int
p_guaranteed_tail_call_opt(void)
p_guaranteed_tail_call_opt( USES_REGS1 )
{
ExpEnv.codegen_struc.struc_targetopt.guaranteedtailcallopt = TRUE;
return TRUE;
}
static Int
p_disable_tail_calls(void)
p_disable_tail_calls( USES_REGS1 )
{
ExpEnv.codegen_struc.struc_targetopt.disabletailcalls = TRUE;
return TRUE;
}
static Int
p_enable_fast_isel(void)
p_enable_fast_isel( USES_REGS1 )
{
ExpEnv.codegen_struc.struc_targetopt.fastisel = TRUE;
return TRUE;
}
static Int
p_fp_abitype(void)
p_fp_abitype( USES_REGS1 )
{
Term t = Deref(ARG1);
Int v;
@ -285,14 +285,14 @@ p_fp_abitype(void)
}
static Int
p_default_fp_abitype(void)
p_default_fp_abitype( USES_REGS1 )
{
ExpEnv.codegen_struc.struc_targetopt.floatabitype = 0;
return TRUE;
}
static Int
p_engine_opt_level(void)
p_engine_opt_level( USES_REGS1 )
{
Term t = Deref(ARG1);
Int v;
@ -339,14 +339,14 @@ p_engine_opt_level(void)
}
static Int
p_reset_engine_opt_level(void)
p_reset_engine_opt_level( USES_REGS1 )
{
ExpEnv.codegen_struc.struc_enginebuilder.engineoptlevel = 3;
return TRUE;
}
static Int
p_relocmodel(void)
p_relocmodel( USES_REGS1 )
{
Term t = Deref(ARG1);
Int v;
@ -393,14 +393,14 @@ p_relocmodel(void)
}
static Int
p_reset_relocmodel(void)
p_reset_relocmodel( USES_REGS1 )
{
ExpEnv.codegen_struc.struc_enginebuilder.relocmodel = 0;
return TRUE;
}
static Int
p_codemodel(void)
p_codemodel( USES_REGS1 )
{
Term t = Deref(ARG1);
Int v;
@ -449,28 +449,28 @@ p_codemodel(void)
}
static Int
p_reset_codemodel(void)
p_reset_codemodel( USES_REGS1 )
{
ExpEnv.codegen_struc.struc_enginebuilder.codemodel = 1;
return TRUE;
}
static Int
p_enable_mcjit(void)
p_enable_mcjit( USES_REGS1 )
{
ExpEnv.codegen_struc.struc_enginebuilder.usemcjit = 1;
return TRUE;
}
static Int
p_disable_mcjit(void)
p_disable_mcjit( USES_REGS1 )
{
ExpEnv.codegen_struc.struc_enginebuilder.usemcjit = 0;
return TRUE;
}
static Int
p_register_allocator(void)
p_register_allocator( USES_REGS1 )
{
Term t = Deref(ARG1);
// valid values for ARG1 are 'integer' and 'atom'
@ -517,7 +517,7 @@ p_register_allocator(void)
}
static Int
p_reset_register_allocator(void)
p_reset_register_allocator( USES_REGS1 )
{
ExpEnv.codegen_struc.struc_enginebuilder.regallocator = REG_ALLOC_GREEDY;
return TRUE;

View File

@ -19,65 +19,65 @@
#include <math.h>
// Enable any (passed by argument) execution mode
static Int p_execution_mode(void);
static Int p_execution_mode( USES_REGS1 );
// Enable 'just interpreted' mode.
static Int p_interpreted_mode(void);
static Int p_interpreted_mode( USES_REGS1 );
// Enable 'smart jit' mode.
static Int p_smartjit_mode(void);
static Int p_smartjit_mode( USES_REGS1 );
// Enable 'continuous compilation' mode.
static Int p_continuouscompilation_mode(void);
static Int p_continuouscompilation_mode( USES_REGS1 );
// Enable 'just compiled' mode.
static Int p_justcompiled_mode(void);
static Int p_justcompiled_mode( USES_REGS1 );
// Enable one (passed by argument) of all available frequency types: counter or time. Frequency bound is default.
// Just for 'smart jit' or 'continuous compilation' mode
static Int p_frequencyty1(void);
static Int p_frequencyty1( USES_REGS1 );
// Enable one (1st argument) of all available frequency types: counter and time. Frequency bound is 2nd argument
// Just for 'smart jit' or 'continuous compilation' mode
static Int p_frequencyty2(void);
static Int p_frequencyty2( USES_REGS1 );
// Enable frequency bound
// Just for 'smart jit' or 'continuous compilation' mode
static Int p_frequency_bound(void);
static Int p_frequency_bound( USES_REGS1 );
// Enable value for starting profiling
// Just for 'smart jit' or 'continuous compilation' mode
static Int p_profiling_start_point(void);
static Int p_profiling_start_point( USES_REGS1 );
// Choose type of clause that can be main on traces
// Just for 'smart jit' or 'continuous compilation' mode
static Int p_main_clause_ty(void);
static Int p_main_clause_ty( USES_REGS1 );
// Choose amount of compilation threads
// Just for 'smart jit' or 'continuous compilation' mode
static Int p_compilation_threads(void);
static Int p_compilation_threads( USES_REGS1 );
// Enable recompilation
// Just for 'smart jit' or 'continuous compilation' mode
static Int p_enable_recompilation(void);
static Int p_enable_recompilation( USES_REGS1 );
// Disable recompilation
// Just for 'smart jit' or 'continuous compilation' mode
static Int p_disable_recompilation(void);
static Int p_disable_recompilation( USES_REGS1 );
// Just code interpretation. Don't compile
// Just for 'smart jit' or 'continuous compilation' mode
static Int p_only_profiled_interpreter(void);
static Int p_only_profiled_interpreter( USES_REGS1 );
// Disable 'p_only_profiled_interpreter'
// Just for 'smart jit' or 'continuous compilation' mode
static Int p_noonly_profiled_interpreter(void);
static Int p_noonly_profiled_interpreter( USES_REGS1 );
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wimplicit-function-declaration"
static Int
p_execution_mode(void)
p_execution_mode( USES_REGS1 )
{
enumExecModes mode;
// valid values for ARG1 are 'integer' and 'atom'
@ -122,7 +122,7 @@ p_execution_mode(void)
// setting execution mode
ExpEnv.config_struc.execution_mode = mode;
/* setting execution mode parameters */
switch (mode) {
case JUST_INTERPRETED:
@ -217,7 +217,7 @@ p_execution_mode(void)
}
static Int
p_interpreted_mode(void)
p_interpreted_mode( USES_REGS1 )
{
// Same as 'execution_mode(0)' or 'execution_mode(interpreted)'
if (Yap_ExecutionMode == INTERPRETED) {
@ -242,7 +242,7 @@ p_interpreted_mode(void)
}
static Int
p_smartjit_mode(void)
p_smartjit_mode( USES_REGS1 )
{
// Same as 'execution_mode(1)' or 'execution_mode(smartjit)'
if (Yap_ExecutionMode == MIXED_MODE) {
@ -273,7 +273,7 @@ p_smartjit_mode(void)
}
static Int
p_continuouscompilation_mode(void)
p_continuouscompilation_mode( USES_REGS1 )
{
// Same as 'execution_mode(2)' or 'execution_mode(continuouscompilation)'
if (Yap_ExecutionMode == MIXED_MODE) {
@ -310,7 +310,7 @@ p_continuouscompilation_mode(void)
}
static Int
p_justcompiled_mode(void)
p_justcompiled_mode( USES_REGS1 )
{
// Same as 'execution_mode(3)' or 'execution_mode(justcompiled)'
if (Yap_ExecutionMode == COMPILED) {
@ -337,7 +337,7 @@ p_justcompiled_mode(void)
}
static Int
p_frequencyty1(void)
p_frequencyty1( USES_REGS1 )
{
// this predicate works only 'SMART_JIT' and 'CONTINUOUS_COMPILATION' modes
if (ExpEnv.config_struc.execution_mode == SMART_JIT || ExpEnv.config_struc.execution_mode == CONTINUOUS_COMPILATION) {
@ -384,7 +384,7 @@ p_frequencyty1(void)
}
static Int
p_frequencyty2(void)
p_frequencyty2( USES_REGS1 )
{
// this predicate works only 'SMART_JIT' and 'CONTINUOUS_COMPILATION' modes
if (ExpEnv.config_struc.execution_mode == SMART_JIT || ExpEnv.config_struc.execution_mode == CONTINUOUS_COMPILATION) {
@ -456,7 +456,7 @@ p_frequencyty2(void)
}
static Int
p_frequency_bound(void)
p_frequency_bound( USES_REGS1 )
{
// this predicate works only 'SMART_JIT' and 'CONTINUOUS_COMPILATION' modes
if (ExpEnv.config_struc.execution_mode == SMART_JIT || ExpEnv.config_struc.execution_mode == CONTINUOUS_COMPILATION) {
@ -502,7 +502,7 @@ p_frequency_bound(void)
}
static Int
p_profiling_start_point(void)
p_profiling_start_point( USES_REGS1 )
{
// this predicate works only 'SMART_JIT' and 'CONTINUOUS_COMPILATION' modes
if (ExpEnv.config_struc.execution_mode == SMART_JIT || ExpEnv.config_struc.execution_mode == CONTINUOUS_COMPILATION) {
@ -533,7 +533,7 @@ p_profiling_start_point(void)
}
static Int
p_main_clause_ty(void)
p_main_clause_ty( USES_REGS1 )
{
// this predicate works only 'SMART_JIT' and 'CONTINUOUS_COMPILATION' modes
if (ExpEnv.config_struc.execution_mode == SMART_JIT || ExpEnv.config_struc.execution_mode == CONTINUOUS_COMPILATION) {
@ -628,7 +628,7 @@ p_main_clause_ty(void)
}
static Int
p_compilation_threads(void)
p_compilation_threads( USES_REGS1 )
{
// this predicate works only 'CONTINUOUS_COMPILATION' mode
if (ExpEnv.config_struc.execution_mode == SMART_JIT || ExpEnv.config_struc.execution_mode == CONTINUOUS_COMPILATION) {
@ -681,28 +681,28 @@ p_compilation_threads(void)
}
static Int
p_enable_recompilation(void)
p_enable_recompilation( USES_REGS1 )
{
ExpEnv.config_struc.torecompile = 1;
return TRUE;
}
static Int
p_disable_recompilation(void)
p_disable_recompilation( USES_REGS1 )
{
ExpEnv.config_struc.torecompile = 0;
return TRUE;
}
static Int
p_only_profiled_interpreter(void)
p_only_profiled_interpreter( USES_REGS1 )
{
ExpEnv.config_struc.useonlypi = 1;
return TRUE;
}
static Int
p_noonly_profiled_interpreter(void)
p_noonly_profiled_interpreter( USES_REGS1 )
{
ExpEnv.config_struc.useonlypi = 0;
return TRUE;

File diff suppressed because it is too large Load Diff

View File

@ -18,14 +18,14 @@
#include "jit_predicates.hh"
#include <papi.h>
static Int p_init_low_level_stats(void);
static Int p_statistics_jit(void);
static Int p_init_low_level_stats( USES_REGS1 );
static Int p_statistics_jit( USES_REGS1 );
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wimplicit-function-declaration"
static Int
p_init_low_level_stats(void)
p_init_low_level_stats( USES_REGS1 )
{
int i = 0, j = 0;
char *tmp;
@ -143,7 +143,7 @@ p_init_low_level_stats(void)
if (PAPI_add_event(ExpEnv.stats_struc.papi_eventset, PAPI_CA_SNP) == PAPI_OK)
ExpEnv.stats_struc.papi_valid_values[4] = 1;
}
else if (ExpEnv.stats_struc.papi_event_type == 2) {
// Event type is 'conditional_store' -- contains 3 performance counters
ExpEnv.stats_struc.papi_valid_values = (short*)malloc(3*sizeof(short));
@ -164,7 +164,7 @@ p_init_low_level_stats(void)
if (PAPI_add_event(ExpEnv.stats_struc.papi_eventset, PAPI_CSR_TOT) == PAPI_OK)
ExpEnv.stats_struc.papi_valid_values[2] = 1;
}
else if (ExpEnv.stats_struc.papi_event_type == 3) {
// Event type is 'floating_point_operations' -- contains 14 performance counters
ExpEnv.stats_struc.papi_valid_values = (short*)malloc(14*sizeof(short));
@ -514,7 +514,7 @@ p_init_low_level_stats(void)
}
static Int
p_statistics_jit(void)
p_statistics_jit( USES_REGS1 )
{
if (NativeArea && NativeArea->n) { // This exp will be true only if JIT Compiler was used
// printing...
@ -542,7 +542,7 @@ p_statistics_jit(void)
}
// get address on IntermediatecodeArea which is stored on first instruction of native code (this instruction is NativeArea->area.pc[i]')
int taddress = ((yamop*)NativeArea->area.pc[i])->y_u.jhc.jh->caa.taddress;
int taddress = ((yamop*)NativeArea->area.pc[i])->u.jhc.jh->caa.taddress;
if (taddress != -1) {
fprintf(stderr, "\tProfiling time: %.3lf sec.\n", IntermediatecodeArea->area.profiling_time[taddress]);
@ -554,7 +554,7 @@ p_statistics_jit(void)
}
fprintf(stderr, "------------------------------\n");
}
// From this point until the end we do:
// 1. We verify if PAPI was initialized (ExpEnv.stats_struc.papi_initialized). If yes, we do:
// 2. We verify what event type was used. Based on this, we alloc memory for 'ExpEnv.stats_struc.papi_values'
@ -582,7 +582,7 @@ p_statistics_jit(void)
if (PAPI_read(ExpEnv.stats_struc.papi_eventset, ExpEnv.stats_struc.papi_values) != PAPI_OK)
fprintf (stderr, "%s:%d\t ERROR\n", __FILE__, __LINE__);
int k = 0;
if (ExpEnv.stats_struc.papi_event_type == 0) {
if (ExpEnv.stats_struc.papi_valid_values[0])
@ -618,7 +618,7 @@ p_statistics_jit(void)
fprintf(stderr, "\tRequests for a snoop:: %lld\n", ExpEnv.stats_struc.papi_values[k++]);
}
else if (ExpEnv.stats_struc.papi_event_type == 2) {
else if (ExpEnv.stats_struc.papi_event_type == 2) {
if (ExpEnv.stats_struc.papi_valid_values[0])
fprintf(stderr, "\tFailed store conditional instructions:: %lld\n", ExpEnv.stats_struc.papi_values[k++]);
if (ExpEnv.stats_struc.papi_valid_values[1])
@ -821,10 +821,10 @@ p_statistics_jit(void)
if (ExpEnv.stats_struc.papi_valid_values[3])
fprintf(stderr, "\tTotal translation lookaside buffer misses:: %lld\n", ExpEnv.stats_struc.papi_values[k++]);
}
fprintf(stderr, "------------------------------\n");
}
return TRUE;
}

View File

@ -20,46 +20,46 @@
#define N_TRANSFORM_PASSES 69
// Disable one (passed by argument) LLVM transform pass
static Int p_disable_transform_pass(void);
static Int p_disable_transform_pass( USES_REGS1 );
// Enable one (passed by argument) LLVM transform pass
static Int p_transform_pass(void);
static Int p_transform_pass( USES_REGS1 );
// Enable one (passed by argument) LLVM transform pass
static Int p_enable_transform_pass(void);
static Int p_enable_transform_pass( USES_REGS1 );
// Enable a list (passed by argument) of LLVM transform passes
static Int p_transform_passes(void);
static Int p_transform_passes( USES_REGS1 );
// Enable all available LLVM transform passes
static Int p_enable_all_transform_passes(void);
static Int p_enable_all_transform_passes( USES_REGS1 );
// Disable all available LLVM transform passes
static Int p_disable_all_transform_passes(void);
static Int p_disable_all_transform_passes( USES_REGS1 );
// Enable n LLVM transform passes (randomly)
static Int p_n_transform_passes(void);
static Int p_n_transform_passes( USES_REGS1 );
// Enable a transform level
static Int p_transform_level(void);
static Int p_transform_level( USES_REGS1 );
// Max element of Argument Promotion Pass
static Int p_argument_promotion_max_elements(void);
static Int p_argument_promotion_max_elements( USES_REGS1 );
// Threshold of Scalar Repl Aggregates Pass
static Int p_scalar_replace_aggregates_threshold(void);
static Int p_scalar_replace_aggregates_threshold( USES_REGS1 );
// Threshold of Loop Unroll Pass
static Int p_loop_unroll_threshold(void);
static Int p_loop_unroll_threshold( USES_REGS1 );
// Threshold of Function Inlining Pass
static Int p_inline_threshold(void);
static Int p_inline_threshold( USES_REGS1 );
// Eliminates (or not) only debugging information on Strip Symbols Pass
static Int p_strip_symbols_pass_type(void);
static Int p_strip_symbols_pass_type( USES_REGS1 );
// Optimizes (or not) for size on Loop Unswitch Pass
static Int p_loop_unswitch_optimize_for_size(void);
static Int p_loop_unswitch_optimize_for_size( USES_REGS1 );
/*
* Default value of 'max elements on Argument Promotion Pass *
@ -69,25 +69,25 @@ static Int p_loop_unswitch_optimize_for_size(void);
* 'Strip Symbols Pass *
* 'Loop Unswitch Pass *
*/
static Int p_default_optimization_args(void);
static Int p_default_optimization_args( USES_REGS1 );
// Same as 'p_default_optimization_args'
static Int p_reset_optimization_args(void);
static Int p_reset_optimization_args( USES_REGS1 );
// Enable IPO by LLVM
static Int p_enable_unit_at_time(void);
static Int p_enable_unit_at_time( USES_REGS1 );
// Enable libcalls simplification by LLVM
static Int p_enable_simplify_libcalls(void);
static Int p_enable_simplify_libcalls( USES_REGS1 );
// Disable IPO by LLVM
static Int p_disable_unit_at_time(void);
static Int p_disable_unit_at_time( USES_REGS1 );
// Disable libcalls simplification by LLVM
static Int p_disable_simplify_libcalls(void);
static Int p_disable_simplify_libcalls( USES_REGS1 );
// Enable (or not) link-time optimization
static Int p_link_time_opt1(void);
static Int p_link_time_opt1( USES_REGS1 );
/*
* Same as 'p_link_time_opt1', but accepts 3 arguments: *
@ -95,26 +95,26 @@ static Int p_link_time_opt1(void);
* 2 -- Should I run internalize? *
* 3 -- Should I run inliner? *
*/
static Int p_link_time_opt3(void);
static Int p_link_time_opt3( USES_REGS1 );
// Enable link-time optimization. Same as 'link_time_opt(true)'
static Int p_enable_link_time_opt(void);
static Int p_enable_link_time_opt( USES_REGS1 );
/*
* Same as 'p_enable_link_time_opt', but accepts 2 arguments: *
* 1 -- Should I run internalize? *
* 2 -- Should I run inliner? *
*/
static Int p_enable_link_time_opt2(void);
static Int p_enable_link_time_opt2( USES_REGS1 );
// Disable link-time optimization.
static Int p_disable_link_time_opt(void);
static Int p_disable_link_time_opt( USES_REGS1 );
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wimplicit-function-declaration"
static Int
p_disable_transform_pass(void)
p_disable_transform_pass( USES_REGS1 )
{
// First: stores what transform pass should be disabled
@ -250,7 +250,7 @@ p_disable_transform_pass(void)
}
static Int
p_transform_pass(void)
p_transform_pass( USES_REGS1 )
{
// First: disables analysis pass (if be active)
p_disable_transform_pass();
@ -375,13 +375,13 @@ p_transform_pass(void)
}
static Int
p_enable_transform_pass(void)
p_enable_transform_pass( USES_REGS1 )
{
return p_transform_pass();
}
static Int
p_transform_passes(void)
p_transform_passes( USES_REGS1 )
{
int i = 0, j = 0;
char *tmp;
@ -557,7 +557,7 @@ p_transform_passes(void)
}
static Int
p_enable_all_transform_passes(void)
p_enable_all_transform_passes( USES_REGS1 )
{
// Same as 'transform_passes(all)'
// First, disable all analysis passes
@ -577,7 +577,7 @@ p_enable_all_transform_passes(void)
}
static Int
p_disable_all_transform_passes(void)
p_disable_all_transform_passes( USES_REGS1 )
{
// Just empty 'ExpEnv.analysis_struc.act_tr'
if (ExpEnv.transform_struc.act_tr) free(ExpEnv.transform_struc.act_tr);
@ -587,7 +587,7 @@ p_disable_all_transform_passes(void)
}
static Int
p_n_transform_passes(void)
p_n_transform_passes( USES_REGS1 )
{
// valid value for ARG1 is just 'integer' (number of transform passes added randomly)
Term t = Deref(ARG1);
@ -651,7 +651,7 @@ p_n_transform_passes(void)
}
static Int
p_transform_level(void)
p_transform_level( USES_REGS1 )
{
Term t = Deref(ARG1);
// valid value for ARG1 is just 'integer'
@ -682,7 +682,7 @@ p_transform_level(void)
}
static Int
p_argument_promotion_max_elements(void)
p_argument_promotion_max_elements( USES_REGS1 )
{
Term t = Deref(ARG1);
// valid value for ARG1 is just 'integer'
@ -710,7 +710,7 @@ p_argument_promotion_max_elements(void)
}
static Int
p_scalar_replace_aggregates_threshold(void)
p_scalar_replace_aggregates_threshold( USES_REGS1 )
{
Term t = Deref(ARG1);
// valid value for ARG1 is just 'integer'
@ -734,7 +734,7 @@ p_scalar_replace_aggregates_threshold(void)
}
static Int
p_loop_unroll_threshold(void)
p_loop_unroll_threshold( USES_REGS1 )
{
Term t = Deref(ARG1);
// valid value for ARG1 is just 'integer'
@ -758,7 +758,7 @@ p_loop_unroll_threshold(void)
}
static Int
p_inline_threshold(void)
p_inline_threshold( USES_REGS1 )
{
Term t = Deref(ARG1);
// valid value for ARG1 is just 'integer'
@ -782,7 +782,7 @@ p_inline_threshold(void)
}
static Int
p_strip_symbols_pass_type(void)
p_strip_symbols_pass_type( USES_REGS1 )
{
Term t = Deref(ARG1);
// valid values for ARG1 are 'integer' and 'atom'
@ -820,7 +820,7 @@ p_strip_symbols_pass_type(void)
}
static Int
p_loop_unswitch_optimize_for_size(void)
p_loop_unswitch_optimize_for_size( USES_REGS1 )
{
Term t = Deref(ARG1);
// valid values for ARG1 are 'integer' and 'atom'
@ -858,7 +858,7 @@ p_loop_unswitch_optimize_for_size(void)
}
static Int
p_default_optimization_args(void)
p_default_optimization_args( USES_REGS1 )
{
/* resetting arguments used in some passes */
ExpEnv.transform_struc.opt_args.arg_promotion_max_elements = 3; // Argument Promotion Pass
@ -886,7 +886,7 @@ p_default_optimization_args(void)
}
static Int
p_reset_optimization_args(void)
p_reset_optimization_args( USES_REGS1 )
{
// Same as 'p_default_optimization_args'
p_default_optimization_args();
@ -894,7 +894,7 @@ p_reset_optimization_args(void)
}
static Int
p_enable_unit_at_time(void)
p_enable_unit_at_time( USES_REGS1 )
{
// Enable IPO
ExpEnv.transform_struc.unit_at_time_enabled = 1;
@ -902,7 +902,7 @@ p_enable_unit_at_time(void)
}
static Int
p_enable_simplify_libcalls(void)
p_enable_simplify_libcalls( USES_REGS1 )
{
// Enable libcalls simplification
ExpEnv.transform_struc.simplify_libcalls_enabled = 1;
@ -910,7 +910,7 @@ p_enable_simplify_libcalls(void)
}
static Int
p_disable_unit_at_time(void)
p_disable_unit_at_time( USES_REGS1 )
{
// Disable IPO
ExpEnv.transform_struc.unit_at_time_enabled = 0;
@ -918,7 +918,7 @@ p_disable_unit_at_time(void)
}
static Int
p_disable_simplify_libcalls(void)
p_disable_simplify_libcalls( USES_REGS1 )
{
// Disable libcalls simplification
ExpEnv.transform_struc.simplify_libcalls_enabled = 0;
@ -926,7 +926,7 @@ p_disable_simplify_libcalls(void)
}
static Int
p_link_time_opt1(void)
p_link_time_opt1( USES_REGS1 )
{
Term t = Deref(ARG1);
// valid value for ARG1 are 'integer' and 'atom'
@ -976,7 +976,7 @@ p_link_time_opt1(void)
}
static Int
p_link_time_opt3(void)
p_link_time_opt3( USES_REGS1 )
{
Term t = Deref(ARG1);
// valid value for ARG1 are 'integer' and 'atom'
@ -1085,7 +1085,7 @@ p_link_time_opt3(void)
}
static Int
p_enable_link_time_opt(void)
p_enable_link_time_opt( USES_REGS1 )
{
// Same as 'link_time_opt(true)'
ExpEnv.transform_struc.link_time_opt.enabled = 1;
@ -1095,7 +1095,7 @@ p_enable_link_time_opt(void)
}
static Int
p_enable_link_time_opt2(void)
p_enable_link_time_opt2( USES_REGS1 )
{
Term t = Deref(ARG1);
// valid value for ARG1 are 'integer' and 'atom'
@ -1172,7 +1172,7 @@ p_enable_link_time_opt2(void)
}
static Int
p_disable_link_time_opt(void)
p_disable_link_time_opt( USES_REGS1 )
{
ExpEnv.transform_struc.link_time_opt.enabled = 0;
ExpEnv.transform_struc.link_time_opt.internalize = 0;
@ -1183,7 +1183,7 @@ p_disable_link_time_opt(void)
#pragma GCC diagnostic pop
void
Yap_InitJitTransformPreds(void)
Yap_InitJitTransformPreds( void )
{
Yap_InitCPred("disable_transform_pass", 1, p_disable_transform_pass, SafePredFlag);
Yap_InitCPred("transform_pass", 1, p_transform_pass, SafePredFlag);

View File

@ -61,7 +61,7 @@ YAPSTARTUP=@SAVED_STATE_PREFIX@startup.yss
CC=@CC@
CXX=@CXX@
MPI_CC=@MPI_CC@
CPPFLAGS=@CPPFLAGS@ -I. -I$(srcdir)/include -I$(srcdir)/C -I$(srcdir)/H -I$(srcdir)/os -I$(srcdir)/OPTYap -I$(srcdir)/BEAM -I$(srcdir)/CXX -I$(srcdir)/JIT/HPP
CPPFLAGS=@CPPFLAGS@ -I. -I$(srcdir)/H -I$(srcdir)/include -I$(srcdir)/os -I$(srcdir)/OPTYap -I$(srcdir)/BEAM -I$(srcdir)/CXX
EXECUTABLE_CFLAGS= @CFLAGS@ $(YAP_EXTRAS) $(DEFS) $(CPPFLAGS)
CFLAGS= @YAPLIB_CFLAGS@ $(YAP_EXTRAS) $(DEFS) $(CPPFLAGS)
CXXFLAGS= @SHLIB_CXXFLAGS@ $(YAP_EXTRAS) $(DEFS) $(CPPFLAGS)
@ -77,9 +77,9 @@ CPP=@CPP@
RC=@RC@
RCFLAGS=@RCFLAGS@
DEFS=@DEFS@ -D_YAP_NOT_INSTALLED_=1 -DDESTDIR=\"$(DESTDIR)\"
LIBS=@LIBS@ @JITLIBS@
DLL_LIBS=$(LIBS) @EXTRA_LIBS_FOR_DLLS@
LDFLAGS=@LDFLAGS@ @JITLD@
LIBS=@LIBS@
DLL_LIBS=@LIBS@ @EXTRA_LIBS_FOR_DLLS@
LDFLAGS=@LDFLAGS@
EXTRAYAPLIBS=@EXTRAYAPLIBS@
LN_S=@LN_S@
M4=@M4@
@ -159,7 +159,6 @@ IOLIB_HEADERS=os/pl-buffer.h \
H/pl-yap.h @WINDOWS@ os/windows/dirent.h os/windows/utf8.h os/windows/utf8.c os/windows/uxnt.h os/windows/popen.c
HEADERS = \
C/absmi_insts.i \
H/Atoms.h \
H/sshift.h \
H/Yap.h \
@ -218,7 +217,9 @@ HEADERS = \
OPTYap/locks_mips_funcs.h OPTYap/locks_alpha.h \
OPTYap/locks_alpha_funcs.h \
OPTYap/locks_pthread.h \
library/dialect/swi/fli/swi.h
library/dialect/swi/fli/swi.h \
JIT/HPP/JIT.hh JIT/HPP/JIT_Compiler.hh \
JIT/HPP/jit_predicates.hh
IOLIB_SOURCES=os/pl-buffer.c os/pl-ctype.c \
os/pl-codelist.c \
@ -300,7 +301,7 @@ C_SOURCES= \
# library/lammpi/yap_mpi.c library/lamm1pi/hash.c library/lammpi/prologterms2c.c
CXX_SOURCES = \
CXX/yapi.cpp \
JIT/JIT_Compiler.cpp
JIT/JIT_Compiler.cpp
PLCONS_SOURCES = \
console/LGPL/pl-nt.c \
@ -435,7 +436,7 @@ BEAM_OBJECTS = \
STATIC_OBJECTS = \
@STATIC_MODE@sys.o yap_random.o regexp.o @NO_BUILTIN_REGEXP@ regcomp.o regerror.o regfree.o regexec.o
LIB_OBJECTS = $(ENGINE_OBJECTS) $(C_INTERFACE_OBJECTS) $(OR_OBJECTS) $(BEAM_OBJECTS) $(STATIC_OBJECTS) $(LIBTAI_OBJECTS) $(JIT_OBJECTS)
LIB_OBJECTS = $(ENGINE_OBJECTS) $(C_INTERFACE_OBJECTS) $(OR_OBJECTS) $(BEAM_OBJECTS) $(STATIC_OBJECTS) $(LIBTAI_OBJECTS) $(JIT_OBJECTS)
OBJECTS = yap.o yapi.o $(LIB_OBJECTS)
@ -502,11 +503,11 @@ yap_random.o: library/random/yap_random.c config.h
%.o: os/%.c config.h
$(CC) -c $(CFLAGS) -I$(srcdir)/include -I$(srcdir) -Ios @EXTRA_INCLUDES_FOR_WIN32@ $< -o $@
JIT_Compiler.o: JIT/JIT_Compiler.cpp
$(CXX) -c $(CFLAGS) $(JITFLAGS) -I$(srcdir)/JIT/HPP $< -o $@
JIT_Compiler.o: IT/JIT_Compiler.cpp
$(CXX) -c $(CFLAGS) $(JITFLAGS) $< -o $@
%.o: JIT/%.c
$(CC) -c $(CFLAGS) -I$(srcdir)/JIT/HPP $< -o $@
%.o: $JIT/%.c
$(CC) -c $(CFLAGS) $< -o $@
pl-ntcon.o: console/LGPL/pl-ntcon.c config.h
$(CC) -c $(CFLAGS) -DUNICODE -D_UNICODE -DPL_CONSOLE=1 -I$(srcdir)/include $< -o $@
@ -594,15 +595,15 @@ all: startup.yss
-rm -f startup.yss
echo "bootstrap('$(srcdir)/pl/init.yap'). module(user). qsave_program('startup.yss')." | @PRE_INSTALL_ENV@ ./yap@EXEC_SUFFIX@ -b $(srcdir)/pl/boot.yap
yap@EXEC_SUFFIX@: $(HEADERS) yap.o @YAPLIB@ libYap.a
$(MPI_CC) $(EXECUTABLE_CFLAGS) $(LDFLAGS) -o yap@EXEC_SUFFIX@ yap.o @YAPLIB@ $(LIBS) $(PAPILIB)
yap@EXEC_SUFFIX@: $(HEADERS) yap.o @YAPLIB@ libYap.a
$(MPI_CC) $(EXECUTABLE_CFLAGS) $(LDFLAGS) -o yap@EXEC_SUFFIX@ yap.o @YAPLIB@ $(LIBS) $(PAPILIB) $(JITLIBS) $(JITLD)
yap-win: yap-win@EXEC_SUFFIX@
yapwin: yap-win@EXEC_SUFFIX@
yap-win@EXEC_SUFFIX@: $(PLCONS_OBJECTS) $(HEADERS) @YAPLIB@
$(MAKE) -C swi/console
$(MAKE) -C swi/console
$(MPI_CC) -municode -DUNICODE -D_UNICODE $(EXECUTABLE_CFLAGS) $(LDFLAGS) -Wl,-subsystem,windows -o yap-win@EXEC_SUFFIX@ $(PLCONS_OBJECTS) plterm.dll @YAPLIB@ $(LIBS) -lgdi32 @MPILDF@
libYap.a: $(LIB_OBJECTS) yapi.o
@ -645,7 +646,7 @@ install_unix: @YAPLIB@ yap@EXEC_SUFFIX@
$(INSTALL_PROGRAM) -m 755 yap@EXEC_SUFFIX@ $(DESTDIR)$(BINDIR)/yap
$(INSTALL_DATA) -m 755 @YAPLIB@ $(DESTDIR)$(LIBDIR)
install_startup: startup.yss
install_startup: startup.yss
$(INSTALL_DATA) startup.yss $(DESTDIR)$(YAPLIBDIR)/startup.yss
install_win32: startup.yss @WINDOWS@ yap-win@EXEC_SUFFIX@
@ -704,7 +705,6 @@ TAGS: $(C_SOURCES) $(PL_SOURCES) $(HEADERS)
find . -name '*.pl' -exec etags -a {} \;
find . -name '*.cpp' -exec etags -a {} \;
find . -name '*.hh' -exec etags -a {} \;
find . -name '*.hpp' -exec etags -a {} \;
find . -name '*.java' -exec etags -a {} \;
find . -name '*.py' -exec etags -a {} \;

8
configure vendored
View File

@ -10769,12 +10769,12 @@ fi
if test "$LLVM" = "no" ;then
as_fn_error $? "--enable-jit was given, but test for LLVM 3.5 failed" "$LINENO" 5
as_fn_error $? "--enable-jit was given, but test for LLVM 3.1 failed" "$LINENO" 5
else
LLVM_VERSION="`llvm-config --version`"
if test "$LLVM_VERSION" != "3.5.0";then
as_fn_error $? "Test for LLVM 3.5 failed" "$LINENO" 5
if test "$LLVM_VERSION" != "3.1";then
as_fn_error $? "Test for LLVM 3.1 failed" "$LINENO" 5
fi
fi
@ -10830,7 +10830,7 @@ fi
JITCODEGENPREDS="jit_codegenpreds.o"
JITFLAGS="`llvm-config --cxxflags`"
JITLD="`llvm-config --ldflags`"
JITLIBS="`llvm-config --libs all` -pthread -lffi -lz"
JITLIBS="`llvm-config --libs all`"
fi

View File

@ -129,7 +129,7 @@ Yap_InitSWIHash(void)
}
static void
UserCPredicate(char *a, CPredicate def, unsigned long int arity, Term mod, pred_flags_t flags)
UserCPredicate(char *a, CPredicate def, unsigned long int arity, Term mod, int flags)
{
CACHE_REGS
@ -2503,7 +2503,7 @@ X_API void PL_register_foreign_in_module(const char *module, const char *name, i
{
CACHE_REGS
Term tmod;
pred_flags_t nflags = 0;
Int nflags = 0;
#ifdef DEBUG
if (flags & (PL_FA_CREF)) {
@ -2523,14 +2523,14 @@ X_API void PL_register_foreign_in_module(const char *module, const char *name, i
} else {
nflags |= CArgsPredFlag;
}
if (flags & PL_FA_NOTRACE) {
nflags |= NoTracePredFlag;
}
if (flags & PL_FA_NONDETERMINISTIC) {
Yap_InitCPredBackCut((char *)name, arity, sizeof(struct foreign_context)/sizeof(CELL), (CPredicate)function, (CPredicate)function, (CPredicate)function, UserCPredFlag|nflags);
} else {
UserCPredicate((char *)name,(CPredicate)function,arity,tmod,nflags);
}
if (flags & PL_FA_NOTRACE) {
Yap_SetNoTrace((char *)name, arity, tmod);
}
}
X_API void PL_register_extensions(const PL_extension *ptr)

View File

@ -613,7 +613,7 @@ PL_install_readline(void)
Serror->functions = &GD->os.rl_functions;
#define PRED(name, arity, func, attr) \
PL_register_foreign_in_module("prolog", name, arity, func, attr)
PL_register_foreign_in_module("system", name, arity, func, attr)
PRED("rl_read_init_file", 1, pl_rl_read_init_file, 0);
PRED("rl_add_history", 1, pl_rl_add_history, PL_FA_NOTRACE);

Some files were not shown because too many files have changed in this diff Show More