From bece9d05d877b08159601180c4b22557d0d3aeb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Tue, 20 Jan 2015 03:00:42 +0000 Subject: [PATCH] JIT --- C/absmi.c | 13 +- C/absmi_insts.h | 21 +- C/amasm.c | 18 - C/bignum.c | 2 +- C/c_interface.c | 6 +- C/control_absmi_insts.h | 22 +- C/fli_absmi_insts.h | 10 +- C/index.c | 4 +- C/index_absmi_insts.h | 1 - C/lu_absmi_insts.h | 413 ++- C/meta_absmi_insts.h | 8 +- C/prim_absmi_insts.h | 1636 ++++++++- C/sysbits.c | 144 +- .../traced_absmi_insts.h | 2972 +++++++-------- CMakeLists.txt | 45 +- CXX/CMakeLists.txt | 12 + H/CMakeLists.txt | 0 H/TermExt.h | 2 +- H/Yap.h | 99 +- H/YapOpcodes.h | 478 ++- H/YapTags.h | 2 +- H/YapTerm.h | 8 +- H/YapText.h | 2 +- H/absmi.h | 1811 +++++++--- H/amidefs.h | 24 +- H/amiops.h | 69 +- H/dlocals.h | 5 - H/findclause.h | 20 +- H/headclause.h | 26 +- H/hlocals.h | 4 - H/ilocals.h | 4 - H/pl-shared.h | 4 +- H/rclause.h | 963 ++++- H/rlocals.h | 4 - H/saveclause.h | 922 ++++- H/walkclause.h | 682 +++- JIT/CMakeLists.txt | 62 + JIT/HPP/IsGround.h | 1563 ++++---- JIT/HPP/JIT.hpp | 24 + JIT/HPP/JIT_Compiler.hpp | 109 + JIT/HPP/PassPrinters.h | 47 + JIT/HPP/PassPrinters.hpp | 183 + JIT/HPP/Yap_BasicBlocks.h | 2 +- JIT/HPP/jit_predicates.hpp | 45 + JIT/HPP/lastop.h | 1564 ++++---- JIT/HPP/nextof.hpp | 2390 +++++++++++++ JIT/HPP/print_op.hpp | 3181 +++++++++++++++++ JIT/HPP/sprint_op.hpp | 3179 ++++++++++++++++ JIT/HPP/yaam_macros.hpp | 1311 +++++++ JIT/configure.in | 2 +- OPTYap/opt.mavar.h | 4 +- OPTYap/{or.insts.i => or.insts.h} | 0 OPTYap/{tab.insts.i => tab.insts.h} | 0 OPTYap/tab.macros.h | 14 +- OPTYap/tab.rational.i | 77 - OPTYap/tab.tries.c | 18 +- OPTYap/tab.tries.i | 2045 ----------- .../{tab.tries.insts.i => tab.tries.insts.h} | 0 OPTYap/traced_or.insts.h | 41 + OPTYap/traced_tab.insts.h | 154 + OPTYap/traced_tab.tries.insts.h | 370 ++ YapTermConfig.h.cmake | 53 +- cmake/FindLLVM.cmake | 205 ++ docs/CMakeLists.txt | 18 - docs/doxfull.rc | 7 +- include/YapDefs.h | 43 +- include/YapError.h | 8 + library/tries/tries.c | 168 +- misc/LOCALS | 4 - misc/buildops | 95 +- misc/sysgraph | 952 +---- packages/gecode/dev/Makefile | 5 - packages/gecode/dev/extractor/Makefile | 36 - packages/odbc | 2 +- 74 files changed, 20972 insertions(+), 7465 deletions(-) rename JIT/HPP/traced_absmi_insts.i => C/traced_absmi_insts.h (83%) create mode 100644 CXX/CMakeLists.txt delete mode 100644 H/CMakeLists.txt create mode 100644 JIT/CMakeLists.txt create mode 100644 JIT/HPP/JIT.hpp create mode 100644 JIT/HPP/JIT_Compiler.hpp create mode 100644 JIT/HPP/PassPrinters.h create mode 100644 JIT/HPP/PassPrinters.hpp create mode 100644 JIT/HPP/jit_predicates.hpp create mode 100644 JIT/HPP/nextof.hpp create mode 100644 JIT/HPP/print_op.hpp create mode 100644 JIT/HPP/sprint_op.hpp create mode 100644 JIT/HPP/yaam_macros.hpp rename OPTYap/{or.insts.i => or.insts.h} (100%) rename OPTYap/{tab.insts.i => tab.insts.h} (100%) delete mode 100644 OPTYap/tab.rational.i delete mode 100644 OPTYap/tab.tries.i rename OPTYap/{tab.tries.insts.i => tab.tries.insts.h} (100%) create mode 100644 OPTYap/traced_or.insts.h create mode 100644 OPTYap/traced_tab.insts.h create mode 100644 OPTYap/traced_tab.tries.insts.h create mode 100644 cmake/FindLLVM.cmake delete mode 100644 docs/CMakeLists.txt delete mode 100644 packages/gecode/dev/Makefile delete mode 100644 packages/gecode/dev/extractor/Makefile diff --git a/C/absmi.c b/C/absmi.c index e7bb09b04..88cb7404f 100755 --- a/C/absmi.c +++ b/C/absmi.c @@ -620,7 +620,7 @@ push_live_regs(yamop *pco) #if defined(ANALYST) || defined(DEBUG) -char *Yap_op_names[_std_top + 1] = +char *Yap_op_names[] = { #define OPCODE(OP,TYPE) #OP #include "YapOpcodes.h" @@ -1571,7 +1571,7 @@ Yap_absmi(int inp) struct timeval timstart, timend; struct rusage rustart, ruend; #endif - static void *control_labels[] = { &&fail, &&NoStackCut, &&NoStackCommitY, &&NoStackCutT, &&NoStackEither, &&NoStackExecute, &&NoStackCall, &&NoStackDExecute, &&NoStackDeallocate, &¬railleft, &&NoStackFail, &&NoStackCommitX, &&dospy }; + static void *control_labels[] = { &&fail, &&NoStackCut, &&NoStackCommitY, &&NoStackCutT, &&NoStackEither, &&NoStackExecute, &&NoStackCall, &&NoStackDExecute, &&NoStackDeallocate, &¬railleft, &&NoStackFail, &&NoStackCommitX }; curtrace = NULL; curpreg = NULL; globalcurblock = NULL; @@ -1799,7 +1799,14 @@ Yap_absmi(int inp) #include "absmi_insts.h" #if YAP_JIT -#include "traced_absmi_insts.i" +#include "traced_absmi_insts.h" +#if YAPOR +#include "traced_or.insts.h" +#endif +#if TABLING +#include "traced_tab.insts.h" +#include "traced_tab.tries.insts.h" +#endif #endif #if !USE_THREADED_CODE diff --git a/C/absmi_insts.h b/C/absmi_insts.h index ef54aabbf..1d5b86652 100644 --- a/C/absmi_insts.h +++ b/C/absmi_insts.h @@ -65,13 +65,14 @@ BOp(Ystop, l); 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" +#include "cp_absmi_insts.h" +#include "lu_absmi_insts.h" +#include "fail_absmi_insts.h" +#include "control_absmi_insts.h" +#include "unify_absmi_insts.h" +#include "fli_absmi_insts.h" +#include "or_absmi_insts.h" +#include "index_absmi_insts.h" +#include "type_absmi_insts.h" +#include "prim_absmi_insts.h" +#include "meta_absmi_insts.h" diff --git a/C/amasm.c b/C/amasm.c index e1b471aee..cd62eae0e 100755 --- a/C/amasm.c +++ b/C/amasm.c @@ -1556,21 +1556,6 @@ a_empty_call(clause_info *clinfo, yamop *code_p, int pass_no, struct intermedia return code_p; } -static yamop * -a_cnp(op_numbers opcode, yamop *code_p, int pass_no, struct intermediates *cip) -{ - if (pass_no) { - code_p->opc = emit_op(opcode); - code_p->y_u.aFlp.n = 0; - code_p->y_u.aFlp.native = NULL; - code_p->y_u.aFlp.native_next = 0; - code_p->y_u.aFlp.p = cip->CurrentPred; - } - GONEXT(aFlp); - return code_p; -} - - static yamop * a_pl(op_numbers opcode, PredEntry *pred, yamop *code_p, int pass_no) { @@ -3363,9 +3348,6 @@ do_pass(int pass_no, yamop **entry_codep, int assembling, int *clause_has_blobsp case cut_op: code_p = a_cut(&clinfo, code_p, pass_no, cip); break; - case native_op: - code_p = a_cnp(_native_me, code_p, pass_no, cip); - break; case cutexit_op: cip->clause_has_cut = TRUE; if (cip->CurrentPred->PredFlags & LogUpdatePredFlag && diff --git a/C/bignum.c b/C/bignum.c index 543700eb4..ca82bd0af 100644 --- a/C/bignum.c +++ b/C/bignum.c @@ -145,7 +145,7 @@ Yap_AllocExternalDataInStack(CELL tag, size_t bytes) MP_INT *dst = (MP_INT *)(HR+2); CELL *ret = HR; - nlimbs = ALIGN_YAPTYPE(bytes,CELL)/CellSize; + nlimbs = ALIGN_BY_TYPE(bytes,CELL)/CellSize; if (nlimbs > (ASP-ret)-1024) { return TermNil; } diff --git a/C/c_interface.c b/C/c_interface.c index 63b60b7b6..5612b8129 100755 --- a/C/c_interface.c +++ b/C/c_interface.c @@ -332,7 +332,9 @@ #define Bool int #define flt double -#define C_INTERFACE +#define C_INTERFACE 1 +#define _yap_c_interface_h 1 + #include #include "Yap.h" @@ -2910,7 +2912,7 @@ do_bootfile (char *bootfilename) } else if (t == term_true) { - YAP_Exit(0); + Yap_exit(0); } else if (t == term_end_of_file) { diff --git a/C/control_absmi_insts.h b/C/control_absmi_insts.h index 74f0ad309..299b0843c 100644 --- a/C/control_absmi_insts.h +++ b/C/control_absmi_insts.h @@ -224,9 +224,9 @@ #ifdef DEPTH_LIMIT if (DEPTH <= MkIntTerm(1)) {/* I assume Module==0 is prolog */ if (pt0->ModuleOfPred) { - if (DEPTH == MkIntTerm(0)) + if (DEPTH == MkIntTerm(0)) { FAIL(); - else DEPTH = RESET_DEPTH(); + } else { DEPTH = RESET_DEPTH(); } } } else if (pt0->ModuleOfPred) DEPTH -= MkIntConstant(2); @@ -267,9 +267,11 @@ #ifdef DEPTH_LIMIT if (DEPTH <= MkIntTerm(1)) {/* I assume Module==0 is primitives */ if (pt0->ModuleOfPred) { - if (DEPTH == MkIntTerm(0)) + if (DEPTH == MkIntTerm(0)) { FAIL(); - else DEPTH = RESET_DEPTH(); + } else { + DEPTH = RESET_DEPTH(); + } } } else if (pt0->ModuleOfPred) DEPTH -= MkIntConstant(2); @@ -353,9 +355,11 @@ #ifdef DEPTH_LIMIT if (DEPTH <= MkIntTerm(1)) {/* I assume Module==0 is primitives */ if (pt->ModuleOfPred) { - if (DEPTH == MkIntTerm(0)) + if (DEPTH == MkIntTerm(0)) { FAIL(); - else DEPTH = RESET_DEPTH(); + } else { + DEPTH = RESET_DEPTH(); + } } } else if (pt->ModuleOfPred) DEPTH -= MkIntConstant(2); @@ -476,11 +480,11 @@ **********************************************/ #ifdef YAPOR -#include "or.insts.i" +#include "or.insts.h" #endif /* YAPOR */ #ifdef TABLING -#include "tab.insts.i" -#include "tab.tries.insts.i" +#include "tab.insts.h" +#include "tab.tries.insts.h" #endif /* TABLING */ diff --git a/C/fli_absmi_insts.h b/C/fli_absmi_insts.h index e54f86c85..a0d3e9dd6 100644 --- a/C/fli_absmi_insts.h +++ b/C/fli_absmi_insts.h @@ -100,9 +100,11 @@ #ifdef DEPTH_LIMIT if (DEPTH <= MkIntTerm(1)) {/* I assume Module==0 is prolog */ if (pt0->ModuleOfPred) { - if (DEPTH == MkIntTerm(0)) + if (DEPTH == MkIntTerm(0)) { FAIL(); - else DEPTH = RESET_DEPTH(); + } else{ + DEPTH = RESET_DEPTH(); + } } } else if (pt0->ModuleOfPred) { DEPTH -= MkIntConstant(2); @@ -351,7 +353,7 @@ #endif SET_BB(B_YREG); ENDCACHE_Y(); - LOCAL_PrologMode |= UserCCallMode; + LOCAL_PrologMode = UserCCallMode; ASP = YREG; saveregs(); save_machine_regs(); @@ -359,7 +361,7 @@ EX = NULL; restore_machine_regs(); setregs(); - LOCAL_PrologMode &= ~UserCCallMode; + LOCAL_PrologMode &= UserMode; if (!SREG) { FAIL(); } diff --git a/C/index.c b/C/index.c index 81b6eeab7..a56d816bf 100755 --- a/C/index.c +++ b/C/index.c @@ -1116,8 +1116,10 @@ move_next(ClauseDef *clause, UInt regno) op_numbers op = Yap_op_from_opcode(cl->opc); switch (op) { - case _native_me: +#if YAP_JIT + case _jit_handler: return; +#endif #if THREADS case _unlock_lu: clause->CurrentCode = NEXTOP(cl,e); diff --git a/C/index_absmi_insts.h b/C/index_absmi_insts.h index c3e78ddc1..acee185a9 100644 --- a/C/index_absmi_insts.h +++ b/C/index_absmi_insts.h @@ -6,7 +6,6 @@ #ifdef INDENT_CODE { { - { #endif /* INDENT_CODE */ BOp(user_switch, lp); diff --git a/C/lu_absmi_insts.h b/C/lu_absmi_insts.h index facb00559..8b74c2bf7 100644 --- a/C/lu_absmi_insts.h +++ b/C/lu_absmi_insts.h @@ -5,9 +5,50 @@ #ifdef INDENT_CODE { { - { #endif /* INDENT_CODE */ + /************************************************************************\ + * Logical Updates * +\************************************************************************/ + + /* enter logical pred */ + BOp(enter_lu_pred, Illss); + check_trail(TR); + /* mark the indexing code */ + { + LogUpdIndex *cl = PREG->y_u.Illss.I; + PredEntry *ap = cl->ClPred; + + if (!cl) { FAIL(); } /* in case the index is empty */ + if (ap->LastCallOfPred != LUCALL_EXEC) { + /* + only increment time stamp if we are working on current time + stamp + */ + if (ap->TimeStampOfPred >= TIMESTAMP_RESET) + Yap_UpdateTimestamps(ap); + ap->TimeStampOfPred++; + ap->LastCallOfPred = LUCALL_EXEC; + /* fprintf(stderr,"R %x--%d--%ul\n",ap,ap->TimeStampOfPred,ap->ArityOfPE);*/ + } + *--YREG = MkIntegerTerm(ap->TimeStampOfPred); + /* fprintf(stderr,"> %p/%p %d %d\n",cl,ap,ap->TimeStampOfPred,PREG->y_u.Illss.s);*/ + PREG = PREG->y_u.Illss.l1; + /* indicate the indexing code is being used */ +#if MULTIPLE_STACKS + /* just store a reference */ + INC_CLREF_COUNT(cl); + TRAIL_CLREF(cl); +#else + if (!(cl->ClFlags & InUseMask)) { + cl->ClFlags |= InUseMask; + TRAIL_CLREF(cl); + } +#endif + } + JMPNext(); + ENDBOp(); + BOp(profiled_retry_logical, OtaLl); check_trail(TR); { @@ -164,12 +205,376 @@ } ENDBOp(); - S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG); -#endif /* FROZEN_STACKS */ - set_cut(S_YREG, B); + BOp(try_logical, OtaLl); + check_trail(TR); + { + UInt timestamp; + + CACHE_Y(YREG); + timestamp = IntegerOfTerm(S_YREG[0]); + /* fprintf(stderr,"+ %p/%p %d %d %d--%u\n",PREG,PREG->y_u.OtaLl.d->ClPred,timestamp,PREG->y_u.OtaLl.d->ClPred->TimeStampOfPred,PREG->y_u.OtaLl.d->ClTimeStart,PREG->y_u.OtaLl.d->ClTimeEnd);*/ + /* Point AP to the code that follows this instruction */ + /* always do this, even if we are not going to use it */ + store_args(PREG->y_u.OtaLl.s); + store_yaam_regs(PREG->y_u.OtaLl.n, 0); + set_cut(S_YREG, B); + B = B_YREG; +#ifdef YAPOR + SCH_set_load(B_YREG); +#endif /* YAPOR */ +#ifdef YAPOR + PP = PREG->y_u.OtaLl.d->ClPred; +#endif /* YAPOR */ + if (!VALID_TIMESTAMP(timestamp, PREG->y_u.OtaLl.d)) { + /* jump to next alternative */ + PREG=PREG->y_u.OtaLl.n; + } else { + PREG = PREG->y_u.OtaLl.d->ClCode; } SET_BB(B_YREG); ENDCACHE_Y(); + } + JMPNext(); + ENDBOp(); + + BOp(count_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); + LOCAL_RetriesCounter--; + if (LOCAL_RetriesCounter == 0) { + saveregs(); + Yap_NilError(RETRY_COUNTER_UNDERFLOW,""); + setregs(); + JMPNext(); + } + LOCAL_PredEntriesCounter--; + if (LOCAL_PredEntriesCounter == 0) { + saveregs(); + Yap_NilError(PRED_ENTRY_COUNTER_UNDERFLOW,""); + 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); +#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(count_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 { + LOCAL_RetriesCounter--; + if (LOCAL_RetriesCounter == 0) { + saveregs(); + Yap_NilError(RETRY_COUNTER_UNDERFLOW,""); + setregs(); + JMPNext(); + } + LOCAL_PredEntriesCounter--; + if (LOCAL_PredEntriesCounter == 0) { + saveregs(); + Yap_NilError(PRED_ENTRY_COUNTER_UNDERFLOW,""); + setregs(); + JMPNext(); + } + 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 + PELOCK(2, ap); + PP = ap; + 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 too */ + 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(); + + + + BOp(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]); + /* fprintf(stderr,"^ %p/%p %d %d %d--%u\n",PREG,PREG->y_u.OtaLl.d->ClPred,timestamp,PREG->y_u.OtaLl.d->ClPred->TimeStampOfPred,PREG->y_u.OtaLl.d->ClTimeStart,PREG->y_u.OtaLl.d->ClTimeEnd);*/ + 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_at_least_one_arg(PREG->y_u.OtaLl.s); +#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(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]); + + /* fprintf(stderr,"- %p/%p %d %d %p\n",PREG,ap,timestamp,ap->TimeStampOfPred,PREG->y_u.OtILl.d->ClCode);*/ +#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 { + 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) { + if (lcl->ClRefCount == 1) { + /* make sure the clause isn't destroyed */ + /* always add an extra reference */ + INC_CLREF_COUNT(lcl); + TRAIL_CLREF(lcl); + B->cp_tr = TR; + } + } + 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 too */ + if (!(lcl->ClFlags & InUseMask)) { + lcl->ClFlags |= InUseMask; + TRAIL_CLREF(lcl); + B->cp_tr = TR; + } + } + if (cl->ClFlags & ErasedMask) { + saveregs(); + Yap_ErLogUpdIndex(cl); + setregs(); + } else { + saveregs(); + Yap_CleanUpIndex(cl); + setregs(); + } + } + } +#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(); +#if defined(YAPOR) || defined(THREADS) + if (PREG == FAILCODE) { + UNLOCKPE(26,PP); + PP = NULL; + } +#endif JMPNext(); } ENDBOp(); diff --git a/C/meta_absmi_insts.h b/C/meta_absmi_insts.h index 44056cf4d..274abe754 100644 --- a/C/meta_absmi_insts.h +++ b/C/meta_absmi_insts.h @@ -244,9 +244,11 @@ #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(); + if (DEPTH == MkIntTerm(0)) { + FAIL(); + } else { + DEPTH = RESET_DEPTH(); + } } } else if (pen->ModuleOfPred) DEPTH -= MkIntConstant(2); diff --git a/C/prim_absmi_insts.h b/C/prim_absmi_insts.h index bfa350f1f..755414238 100644 --- a/C/prim_absmi_insts.h +++ b/C/prim_absmi_insts.h @@ -8,7 +8,1639 @@ { #endif /* INDENT_CODE */ - + + Op(p_plus_vv, xxx); + BEGD(d0); + BEGD(d1); + d0 = XREG(PREG->y_u.xxx.x1); + /* first check pt1 */ + deref_head(d0, plus_vv_unk); + plus_vv_nvar: + d1 = XREG(PREG->y_u.xxx.x2); + /* next check A2 */ + deref_head(d1, plus_vv_nvar_unk); + plus_vv_nvar_nvar: + /* d0 and d1 are where I want them */ + if (IsIntTerm(d0) && IsIntTerm(d1)) { + d0 = MkIntegerTerm(IntOfTerm(d0) + IntOfTerm(d1)); + } + else { + saveregs(); + d0 = p_plus(Yap_Eval(d0), Yap_Eval(d1) PASS_REGS); + setregs(); + if (d0 == 0L) { + saveregs(); + Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); + setregs(); + FAIL(); + } + } + XREG(PREG->y_u.xxx.x) = d0; + PREG = NEXTOP(PREG, xxx); + GONext(); + + BEGP(pt0); + deref_body(d0, pt0, plus_vv_unk, plus_vv_nvar); + saveregs(); + Yap_NilError(INSTANTIATION_ERROR, "X is _+B"); + setregs(); + FAIL(); + ENDP(pt0); + + BEGP(pt0); + deref_body(d1, pt0, plus_vv_nvar_unk, plus_vv_nvar_nvar); + saveregs(); + Yap_NilError(INSTANTIATION_ERROR, "X is A+B"); + setregs(); + FAIL(); + ENDP(pt0); + ENDD(d1); + ENDD(d0); + ENDOp(); + + Op(p_plus_vc, xxn); + BEGD(d0); + d0 = XREG(PREG->y_u.xxn.xi); + /* first check pt1 */ + deref_head(d0, plus_vc_unk); + plus_vc_nvar: + { + Int d1 = PREG->y_u.xxn.c; + if (IsIntTerm(d0)) { + d0 = MkIntegerTerm(IntOfTerm(d0) + d1); + } + else { + saveregs(); + d0 = p_plus(Yap_Eval(d0), MkIntegerTerm(d1) PASS_REGS); + setregs(); + if (d0 == 0L) { + saveregs(); + Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); + setregs(); + FAIL(); + } + } + } + XREG(PREG->y_u.xxn.x) = d0; + PREG = NEXTOP(PREG, xxn); + GONext(); + + BEGP(pt0); + deref_body(d0, pt0, plus_vc_unk, plus_vc_nvar); + saveregs(); + Yap_NilError(INSTANTIATION_ERROR, "X is A + " Int_FORMAT, PREG->y_u.xxn.c); + setregs(); + FAIL(); + ENDP(pt0); + ENDD(d0); + ENDOp(); + + Op(p_plus_y_vv, yxx); + BEGD(d0); + BEGD(d1); + d0 = XREG(PREG->y_u.yxx.x1); + /* first check pt1 */ + deref_head(d0, plus_y_vv_unk); + plus_y_vv_nvar: + d1 = XREG(PREG->y_u.xxx.x2); + /* next check A2 */ + deref_head(d1, plus_y_vv_nvar_unk); + plus_y_vv_nvar_nvar: + /* d0 and d1 are where I want them */ + if (IsIntTerm(d0) && IsIntTerm(d1)) { + d0 = MkIntegerTerm(IntOfTerm(d0) + IntOfTerm(d1)); + } + else { + saveregs(); + d0 = p_plus(Yap_Eval(d0), Yap_Eval(d1) PASS_REGS); + setregs(); + if (d0 == 0L) { + saveregs(); + Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); + setregs(); + FAIL(); + } + } + BEGP(pt0); + pt0 = YREG + PREG->y_u.yxx.y; + PREG = NEXTOP(PREG, yxx); + INITIALIZE_PERMVAR(pt0,d0); + ENDP(pt0); + GONext(); + + BEGP(pt0); + deref_body(d0, pt0, plus_y_vv_unk, plus_y_vv_nvar); + saveregs(); + Yap_NilError(INSTANTIATION_ERROR, "X is A+B"); + setregs(); + FAIL(); + ENDP(pt0); + + BEGP(pt0); + deref_body(d1, pt0, plus_y_vv_nvar_unk, plus_y_vv_nvar_nvar); + saveregs(); + Yap_NilError(INSTANTIATION_ERROR, "X is A+B"); + setregs(); + FAIL(); + ENDP(pt0); + ENDD(d1); + ENDD(d0); + ENDOp(); + + Op(p_plus_y_vc, yxn); + BEGD(d0); + d0 = XREG(PREG->y_u.yxn.xi); + /* first check pt1 */ + deref_head(d0, plus_y_vc_unk); + plus_y_vc_nvar: + { + Int d1 = PREG->y_u.yxn.c; + if (IsIntTerm(d0)) { + d0 = MkIntegerTerm(IntOfTerm(d0) + d1); + } + else { + saveregs(); + d0 = p_plus(Yap_Eval(d0), MkIntegerTerm(d1) PASS_REGS); + setregs(); + if (d0 == 0L) { + saveregs(); + Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); + setregs(); + FAIL(); + } + } + } + BEGP(pt0); + pt0 = YREG + PREG->y_u.yxn.y; + PREG = NEXTOP(PREG, yxn); + INITIALIZE_PERMVAR(pt0,d0); + ENDP(pt0); + GONext(); + + BEGP(pt0); + deref_body(d0, pt0, plus_y_vc_unk, plus_y_vc_nvar); + saveregs(); + Yap_NilError(INSTANTIATION_ERROR, "X is A + " Int_FORMAT, PREG->y_u.yxn.c); + setregs(); + FAIL(); + ENDP(pt0); + ENDD(d0); + ENDOp(); + + Op(p_minus_vv, xxx); + BEGD(d0); + BEGD(d1); + d0 = XREG(PREG->y_u.xxx.x1); + /* first check pt1 */ + deref_head(d0, minus_vv_unk); + minus_vv_nvar: + d1 = XREG(PREG->y_u.xxx.x2); + /* next check A2 */ + deref_head(d1, minus_vv_nvar_unk); + minus_vv_nvar_nvar: + /* d0 and d1 are where I want them */ + if (IsIntTerm(d0) && IsIntTerm(d1)) { + d0 = MkIntegerTerm(IntOfTerm(d0) - IntOfTerm(d1)); + } + else { + saveregs(); + d0 = p_minus(Yap_Eval(d0), Yap_Eval(d1) PASS_REGS); + setregs(); + if (d0 == 0L) { + saveregs(); + Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); + setregs(); + FAIL(); + } + } + XREG(PREG->y_u.xxx.x) = d0; + PREG = NEXTOP(PREG, xxx); + GONext(); + + BEGP(pt0); + deref_body(d0, pt0, minus_vv_unk, minus_vv_nvar); + saveregs(); + Yap_NilError(INSTANTIATION_ERROR, "X is A-B"); + setregs(); + FAIL(); + ENDP(pt0); + + BEGP(pt0); + deref_body(d1, pt0, minus_vv_nvar_unk, minus_vv_nvar_nvar); + saveregs(); + Yap_NilError(INSTANTIATION_ERROR, "X is A-B"); + setregs(); + FAIL(); + ENDP(pt0); + ENDD(d1); + ENDD(d0); + ENDOp(); + + Op(p_minus_cv, xxn); + BEGD(d0); + d0 = XREG(PREG->y_u.xxn.xi); + /* first check pt1 */ + deref_head(d0, minus_cv_unk); + minus_cv_nvar: + { + Int d1 = PREG->y_u.xxn.c; + if (IsIntTerm(d0)) { + d0 = MkIntegerTerm(d1 - IntOfTerm(d0)); + } + else { + saveregs(); + d0 = p_minus(MkIntegerTerm(d1),Yap_Eval(d0) PASS_REGS); + setregs(); + if (d0 == 0L) { + saveregs(); + Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); + setregs(); + FAIL(); + } + } + } + XREG(PREG->y_u.xxn.x) = d0; + PREG = NEXTOP(PREG, xxn); + GONext(); + + BEGP(pt0); + deref_body(d0, pt0, minus_cv_unk, minus_cv_nvar); + saveregs(); + Yap_NilError(INSTANTIATION_ERROR, "X is " Int_FORMAT "-A", PREG->y_u.xxn.c); + setregs(); + FAIL(); + ENDP(pt0); + ENDD(d0); + ENDOp(); + + Op(p_minus_y_vv, yxx); + BEGD(d0); + BEGD(d1); + d0 = XREG(PREG->y_u.yxx.x1); + /* first check pt1 */ + deref_head(d0, minus_y_vv_unk); + minus_y_vv_nvar: + d1 = XREG(PREG->y_u.xxx.x2); + /* next check A2 */ + deref_head(d1, minus_y_vv_nvar_unk); + minus_y_vv_nvar_nvar: + /* d0 and d1 are where I want them */ + if (IsIntTerm(d0) && IsIntTerm(d1)) { + d0 = MkIntegerTerm(IntOfTerm(d0) - IntOfTerm(d1)); + } + else { + saveregs(); + d0 = p_minus(Yap_Eval(d0), Yap_Eval(d1) PASS_REGS); + setregs(); + if (d0 == 0L) { + saveregs(); + Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); + setregs(); + FAIL(); + } + } + BEGP(pt0); + pt0 = YREG + PREG->y_u.yxx.y; + PREG = NEXTOP(PREG, yxx); + INITIALIZE_PERMVAR(pt0,d0); + ENDP(pt0); + GONext(); + + BEGP(pt0); + deref_body(d0, pt0, minus_y_vv_unk, minus_y_vv_nvar); + saveregs(); + Yap_NilError(INSTANTIATION_ERROR, "X is A-B"); + setregs(); + FAIL(); + ENDP(pt0); + + BEGP(pt0); + deref_body(d1, pt0, minus_y_vv_nvar_unk, minus_y_vv_nvar_nvar); + saveregs(); + Yap_NilError(INSTANTIATION_ERROR, "X is A-B"); + setregs(); + FAIL(); + ENDP(pt0); + ENDD(d1); + ENDD(d0); + ENDOp(); + + Op(p_minus_y_cv, yxn); + BEGD(d0); + d0 = XREG(PREG->y_u.yxn.xi); + /* first check pt1 */ + deref_head(d0, minus_y_cv_unk); + minus_y_cv_nvar: + { + Int d1 = PREG->y_u.yxn.c; + if (IsIntTerm(d0)) { + d0 = MkIntegerTerm(d1 - IntOfTerm(d0)); + } + else { + saveregs(); + d0 = p_minus(MkIntegerTerm(d1), Yap_Eval(d0) PASS_REGS); + setregs(); + if (d0 == 0L) { + saveregs(); + Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); + setregs(); + FAIL(); + } + } + } + BEGP(pt0); + pt0 = YREG + PREG->y_u.yxn.y; + PREG = NEXTOP(PREG, yxn); + INITIALIZE_PERMVAR(pt0,d0); + ENDP(pt0); + GONext(); + + BEGP(pt0); + deref_body(d0, pt0, minus_y_cv_unk, minus_y_cv_nvar); + saveregs(); + Yap_NilError(INSTANTIATION_ERROR, "X is " Int_FORMAT "-A", PREG->y_u.yxn.c); + setregs(); + FAIL(); + ENDP(pt0); + ENDD(d0); + ENDOp(); + + Op(p_times_vv, xxx); + BEGD(d0); + BEGD(d1); + d0 = XREG(PREG->y_u.xxx.x1); + /* first check pt1 */ + deref_head(d0, times_vv_unk); + times_vv_nvar: + d1 = XREG(PREG->y_u.xxx.x2); + /* next check A2 */ + deref_head(d1, times_vv_nvar_unk); + times_vv_nvar_nvar: + /* d0 and d1 are where I want them */ + if (IsIntTerm(d0) && IsIntTerm(d1)) { + d0 = times_int(IntOfTerm(d0), IntOfTerm(d1) PASS_REGS); + } + else { + saveregs(); + d0 = p_times(Yap_Eval(d0), Yap_Eval(d1) PASS_REGS); + setregs(); + if (d0 == 0L) { + saveregs(); + Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); + setregs(); + FAIL(); + } + } + XREG(PREG->y_u.xxx.x) = d0; + PREG = NEXTOP(PREG, xxx); + GONext(); + + BEGP(pt0); + deref_body(d0, pt0, times_vv_unk, times_vv_nvar); + saveregs(); + Yap_NilError(INSTANTIATION_ERROR, "X is A*B"); + setregs(); + FAIL(); + ENDP(pt0); + + BEGP(pt0); + deref_body(d1, pt0, times_vv_nvar_unk, times_vv_nvar_nvar); + saveregs(); + Yap_NilError(INSTANTIATION_ERROR, "X is A*B"); + setregs(); + FAIL(); + ENDP(pt0); + ENDD(d1); + ENDD(d0); + ENDOp(); + + Op(p_times_vc, xxn); + BEGD(d0); + d0 = XREG(PREG->y_u.xxn.xi); + /* first check pt1 */ + deref_head(d0, times_vc_unk); + times_vc_nvar: + { + Int d1 = PREG->y_u.xxn.c; + if (IsIntTerm(d0)) { + d0 = times_int(IntOfTerm(d0), d1 PASS_REGS); + } + else { + saveregs(); + d0 = p_times(Yap_Eval(d0), MkIntegerTerm(d1) PASS_REGS); + setregs(); + if (d0 == 0L) { + saveregs(); + Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); + setregs(); + FAIL(); + } + } + } + XREG(PREG->y_u.xxn.x) = d0; + PREG = NEXTOP(PREG, xxn); + GONext(); + + BEGP(pt0); + deref_body(d0, pt0, times_vc_unk, times_vc_nvar); + saveregs(); + Yap_NilError(INSTANTIATION_ERROR, "X is A* " Int_FORMAT, PREG->y_u.xxn.c); + setregs(); + FAIL(); + ENDP(pt0); + ENDD(d0); + ENDOp(); + + Op(p_times_y_vv, yxx); + BEGD(d0); + BEGD(d1); + d0 = XREG(PREG->y_u.yxx.x1); + /* first check pt1 */ + deref_head(d0, times_y_vv_unk); + times_y_vv_nvar: + d1 = XREG(PREG->y_u.xxx.x2); + /* next check A2 */ + deref_head(d1, times_y_vv_nvar_unk); + times_y_vv_nvar_nvar: + /* d0 and d1 are where I want them */ + if (IsIntTerm(d0) && IsIntTerm(d1)) { + d0 = times_int(IntOfTerm(d0), IntOfTerm(d1) PASS_REGS); + } + else { + saveregs(); + d0 = p_times(Yap_Eval(d0), Yap_Eval(d1) PASS_REGS); + setregs(); + if (d0 == 0L) { + saveregs(); + Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); + setregs(); + FAIL(); + } + } + BEGP(pt0); + pt0 = YREG + PREG->y_u.yxx.y; + PREG = NEXTOP(PREG, yxx); + INITIALIZE_PERMVAR(pt0,d0); + ENDP(pt0); + GONext(); + + BEGP(pt0); + deref_body(d0, pt0, times_y_vv_unk, times_y_vv_nvar); + saveregs(); + Yap_NilError(INSTANTIATION_ERROR, "X is A*B"); + setregs(); + FAIL(); + ENDP(pt0); + + BEGP(pt0); + deref_body(d1, pt0, times_y_vv_nvar_unk, times_y_vv_nvar_nvar); + saveregs(); + Yap_NilError(INSTANTIATION_ERROR, "X is A*B"); + setregs(); + FAIL(); + ENDP(pt0); + ENDD(d1); + ENDD(d0); + ENDOp(); + + Op(p_times_y_vc, yxn); + BEGD(d0); + d0 = XREG(PREG->y_u.yxn.xi); + /* first check pt1 */ + deref_head(d0, times_y_vc_unk); + times_y_vc_nvar: + { + Int d1 = PREG->y_u.yxn.c; + if (IsIntTerm(d0)) { + d0 = times_int(IntOfTerm(d0), d1 PASS_REGS); + } + else { + saveregs(); + d0 = p_times(Yap_Eval(d0), MkIntegerTerm(d1) PASS_REGS); + setregs(); + if (d0 == 0L) { + saveregs(); + Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); + setregs(); + FAIL(); + } + } + } + BEGP(pt0); + pt0 = YREG + PREG->y_u.yxn.y; + PREG = NEXTOP(PREG, yxn); + INITIALIZE_PERMVAR(pt0,d0); + ENDP(pt0); + GONext(); + + BEGP(pt0); + deref_body(d0, pt0, times_y_vc_unk, times_y_vc_nvar); + saveregs(); + Yap_NilError(INSTANTIATION_ERROR, "X is A* " Int_FORMAT, PREG->y_u.yxn.c); + setregs(); + FAIL(); + ENDP(pt0); + ENDD(d0); + ENDOp(); + + Op(p_div_vv, xxx); + BEGD(d0); + BEGD(d1); + d0 = XREG(PREG->y_u.xxx.x1); + /* first check pt1 */ + deref_head(d0, div_vv_unk); + div_vv_nvar: + d1 = XREG(PREG->y_u.xxx.x2); + /* next check A2 */ + deref_head(d1, div_vv_nvar_unk); + div_vv_nvar_nvar: + /* d0 and d1 are where I want them */ + if (IsIntTerm(d0) && IsIntTerm(d1)) { + Int div = IntOfTerm(d1); + if (div == 0) { + saveregs(); + Yap_NilError(EVALUATION_ERROR_ZERO_DIVISOR,"// /2"); + setregs(); + FAIL(); + } + d0 = MkIntTerm(IntOfTerm(d0) / div); + } + else { + saveregs(); + d0 = p_div(Yap_Eval(d0), Yap_Eval(d1) PASS_REGS); + setregs(); + if (d0 == 0L) { + saveregs(); + Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); + setregs(); + FAIL(); + } + } + XREG(PREG->y_u.xxx.x) = d0; + PREG = NEXTOP(PREG, xxx); + GONext(); + + BEGP(pt0); + deref_body(d0, pt0, div_vv_unk, div_vv_nvar); + saveregs(); + Yap_NilError(INSTANTIATION_ERROR, "X is A//B"); + setregs(); + FAIL(); + ENDP(pt0); + + BEGP(pt0); + deref_body(d1, pt0, div_vv_nvar_unk, div_vv_nvar_nvar); + saveregs(); + Yap_NilError(INSTANTIATION_ERROR, "X is A//B"); + setregs(); + FAIL(); + ENDP(pt0); + ENDD(d1); + ENDD(d0); + ENDOp(); + + Op(p_div_vc, xxn); + BEGD(d0); + d0 = XREG(PREG->y_u.xxn.xi); + /* first check pt1 */ + deref_head(d0, div_vc_unk); + div_vc_nvar: + { + Int d1 = PREG->y_u.xxn.c; + if (IsIntTerm(d0)) { + d0 = MkIntTerm(IntOfTerm(d0) / d1); + } + else { + saveregs(); + d0 = p_div(Yap_Eval(d0),MkIntegerTerm(d1) PASS_REGS); + setregs(); + if (d0 == 0L) { + saveregs(); + Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); + setregs(); + FAIL(); + } + } + } + XREG(PREG->y_u.xxn.x) = d0; + PREG = NEXTOP(PREG, xxn); + GONext(); + + BEGP(pt0); + deref_body(d0, pt0, div_vc_unk, div_vc_nvar); + saveregs(); + Yap_NilError(INSTANTIATION_ERROR, "X is A//B"); + setregs(); + FAIL(); + ENDP(pt0); + ENDD(d0); + ENDOp(); + + Op(p_div_cv, xxn); + BEGD(d0); + d0 = XREG(PREG->y_u.xxn.xi); + /* first check pt1 */ + deref_head(d0, div_cv_unk); + div_cv_nvar: + { + Int d1 = PREG->y_u.xxn.c; + if (IsIntTerm(d0)) { + Int div = IntOfTerm(d0); + if (div == 0){ + saveregs(); + Yap_NilError(EVALUATION_ERROR_ZERO_DIVISOR,"// /2"); + setregs(); + FAIL(); + } + d0 = MkIntegerTerm(d1 / div); + } + else { + saveregs(); + d0 = p_div(MkIntegerTerm(d1),Yap_Eval(d0) PASS_REGS); + if (d0 == 0L) { + saveregs(); + Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); + setregs(); + FAIL(); + } + } + } + XREG(PREG->y_u.xxn.x) = d0; + PREG = NEXTOP(PREG, xxn); + GONext(); + + BEGP(pt0); + deref_body(d0, pt0, div_cv_unk, div_cv_nvar); + saveregs(); + Yap_NilError(INSTANTIATION_ERROR, "X is " Int_FORMAT "// A", PREG->y_u.xxn.c); + setregs(); + FAIL(); + ENDP(pt0); + ENDD(d0); + ENDOp(); + + Op(p_div_y_vv, yxx); + BEGD(d0); + BEGD(d1); + d0 = XREG(PREG->y_u.yxx.x1); + /* first check pt1 */ + deref_head(d0, div_y_vv_unk); + div_y_vv_nvar: + d1 = XREG(PREG->y_u.xxx.x2); + /* next check A2 */ + deref_head(d1, div_y_vv_nvar_unk); + div_y_vv_nvar_nvar: + /* d0 and d1 are where I want them */ + if (IsIntTerm(d0) && IsIntTerm(d1)) { + Int div = IntOfTerm(d1); + if (div == 0) { + saveregs(); + Yap_NilError(EVALUATION_ERROR_ZERO_DIVISOR,"// /2"); + setregs(); + FAIL(); + } + d0 = MkIntTerm(IntOfTerm(d0) / div); + } + else { + saveregs(); + d0 = p_div(Yap_Eval(d0), Yap_Eval(d1) PASS_REGS); + setregs(); + if (d0 == 0L) { + saveregs(); + Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); + setregs(); + FAIL(); + } + } + BEGP(pt0); + pt0 = YREG + PREG->y_u.yxx.y; + PREG = NEXTOP(PREG, yxx); + INITIALIZE_PERMVAR(pt0,d0); + ENDP(pt0); + GONext(); + + BEGP(pt0); + deref_body(d0, pt0, div_y_vv_unk, div_y_vv_nvar); + saveregs(); + Yap_NilError(INSTANTIATION_ERROR, "X is A//B"); + setregs(); + FAIL(); + ENDP(pt0); + + BEGP(pt0); + deref_body(d1, pt0, div_y_vv_nvar_unk, div_y_vv_nvar_nvar); + saveregs(); + Yap_NilError(INSTANTIATION_ERROR, "X is A//B"); + setregs(); + FAIL(); + ENDP(pt0); + ENDD(d1); + ENDD(d0); + ENDOp(); + + Op(p_div_y_vc, yxn); + BEGD(d0); + d0 = XREG(PREG->y_u.yxn.xi); + /* first check pt1 */ + deref_head(d0, div_y_vc_unk); + div_y_vc_nvar: + { + Int d1 = PREG->y_u.yxn.c; + if (IsIntTerm(d0)) { + d0 = MkIntTerm(IntOfTerm(d0)/d1); + } + else { + saveregs(); + d0 = p_div(Yap_Eval(d0),MkIntegerTerm(d1) PASS_REGS); + setregs(); + if (d0 == 0L) { + saveregs(); + Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); + setregs(); + FAIL(); + } + } + } + BEGP(pt0); + pt0 = YREG + PREG->y_u.yxn.y; + PREG = NEXTOP(PREG, yxn); + INITIALIZE_PERMVAR(pt0,d0); + ENDP(pt0); + GONext(); + + BEGP(pt0); + deref_body(d0, pt0, div_y_vc_unk, div_y_vc_nvar); + saveregs(); + Yap_NilError(INSTANTIATION_ERROR, "X is A//B"); + setregs(); + FAIL(); + ENDP(pt0); + ENDD(d0); + ENDOp(); + + Op(p_div_y_cv, yxn); + BEGD(d0); + d0 = XREG(PREG->y_u.yxn.xi); + /* first check pt1 */ + deref_head(d0, div_y_cv_unk); + div_y_cv_nvar: + { + Int d1 = PREG->y_u.yxn.c; + if (IsIntTerm(d0)) { + Int div = IntOfTerm(d0); + if (div == 0) { + saveregs(); + Yap_NilError(EVALUATION_ERROR_ZERO_DIVISOR,"// /2"); + setregs(); + FAIL(); + } + d0 = MkIntegerTerm(d1 / div); + } + else { + saveregs(); + d0 = p_div(MkIntegerTerm(d1), Yap_Eval(d0) PASS_REGS); + setregs(); + if (d0 == 0L) { + saveregs(); + Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); + setregs(); + FAIL(); + } + } + } + BEGP(pt0); + pt0 = YREG + PREG->y_u.yxn.y; + PREG = NEXTOP(PREG, yxn); + INITIALIZE_PERMVAR(pt0,d0); + ENDP(pt0); + GONext(); + + BEGP(pt0); + deref_body(d0, pt0, div_y_cv_unk, div_y_cv_nvar); + saveregs(); + Yap_NilError(INSTANTIATION_ERROR, "X is " Int_FORMAT "// A", PREG->y_u.yxn.c); + setregs(); + FAIL(); + ENDP(pt0); + ENDD(d0); + ENDOp(); + + + Op(p_and_vv, xxx); + BEGD(d0); + BEGD(d1); + d0 = XREG(PREG->y_u.xxx.x1); + /* first check pt1 */ + deref_head(d0, and_vv_unk); + and_vv_nvar: + d1 = XREG(PREG->y_u.xxx.x2); + /* next check A2 */ + deref_head(d1, and_vv_nvar_unk); + and_vv_nvar_nvar: + /* d0 and d1 are where I want them */ + if (IsIntTerm(d0) && IsIntTerm(d1)) { + d0 = MkIntegerTerm(IntOfTerm(d0) & IntOfTerm(d1)); + } + else { + saveregs(); + d0 = p_and(Yap_Eval(d0), Yap_Eval(d1) PASS_REGS); + setregs(); + if (d0 == 0L) { + saveregs(); + Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); + setregs(); + FAIL(); + } + } + XREG(PREG->y_u.xxx.x) = d0; + PREG = NEXTOP(PREG, xxx); + GONext(); + + BEGP(pt0); + deref_body(d0, pt0, and_vv_unk, and_vv_nvar); + saveregs(); + Yap_NilError(INSTANTIATION_ERROR, "X is A/\\B"); + setregs(); + FAIL(); + ENDP(pt0); + + BEGP(pt0); + deref_body(d1, pt0, and_vv_nvar_unk, and_vv_nvar_nvar); + saveregs(); + Yap_NilError(INSTANTIATION_ERROR, "X is A/\\B"); + setregs(); + FAIL(); + ENDP(pt0); + ENDD(d1); + ENDD(d0); + ENDOp(); + + Op(p_and_vc, xxn); + BEGD(d0); + d0 = XREG(PREG->y_u.xxn.xi); + /* first check pt1 */ + deref_head(d0, and_vc_unk); + and_vc_nvar: + { + Int d1 = PREG->y_u.xxn.c; + if (IsIntTerm(d0)) { + d0 = MkIntegerTerm(IntOfTerm(d0) & d1); + } + else { + saveregs(); + d0 = p_and(Yap_Eval(d0), MkIntegerTerm(d1) PASS_REGS); + setregs(); + if (d0 == 0L) { + saveregs(); + Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); + setregs(); + FAIL(); + } + } + } + XREG(PREG->y_u.xxn.x) = d0; + PREG = NEXTOP(PREG, xxn); + GONext(); + + BEGP(pt0); + deref_body(d0, pt0, and_vc_unk, and_vc_nvar); + saveregs(); + Yap_NilError(INSTANTIATION_ERROR, "X is A /\\ " Int_FORMAT , PREG->y_u.xxn.c); + setregs(); + FAIL(); + ENDP(pt0); + ENDD(d0); + ENDOp(); + + Op(p_and_y_vv, yxx); + BEGD(d0); + BEGD(d1); + d0 = XREG(PREG->y_u.yxx.x1); + /* first check pt1 */ + deref_head(d0, and_y_vv_unk); + and_y_vv_nvar: + d1 = XREG(PREG->y_u.xxx.x2); + /* next check A2 */ + deref_head(d1, and_y_vv_nvar_unk); + and_y_vv_nvar_nvar: + /* d0 and d1 are where I want them */ + if (IsIntTerm(d0) && IsIntTerm(d1)) { + d0 = MkIntegerTerm(IntOfTerm(d0) & IntOfTerm(d1)); + } + else { + saveregs(); + d0 = p_and(Yap_Eval(d0), Yap_Eval(d1) PASS_REGS); + setregs(); + if (d0 == 0L) { + saveregs(); + Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); + setregs(); + FAIL(); + } + } + BEGP(pt0); + pt0 = YREG + PREG->y_u.yxx.y; + PREG = NEXTOP(PREG, yxx); + INITIALIZE_PERMVAR(pt0,d0); + ENDP(pt0); + GONext(); + + BEGP(pt0); + deref_body(d0, pt0, and_y_vv_unk, and_y_vv_nvar); + saveregs(); + Yap_NilError(INSTANTIATION_ERROR, "X is A/\\B"); + setregs(); + FAIL(); + ENDP(pt0); + + BEGP(pt0); + deref_body(d1, pt0, and_y_vv_nvar_unk, and_y_vv_nvar_nvar); + saveregs(); + Yap_NilError(INSTANTIATION_ERROR, "X is A/\\B"); + setregs(); + FAIL(); + ENDP(pt0); + ENDD(d1); + ENDD(d0); + ENDOp(); + + Op(p_and_y_vc, yxn); + BEGD(d0); + d0 = XREG(PREG->y_u.yxn.xi); + /* first check pt1 */ + deref_head(d0, and_y_vc_unk); + and_y_vc_nvar: + { + Int d1 = PREG->y_u.yxn.c; + if (IsIntTerm(d0)) { + d0 = MkIntegerTerm(IntOfTerm(d0) & d1); + } + else { + saveregs(); + d0 = p_and(Yap_Eval(d0), MkIntegerTerm(d1) PASS_REGS); + setregs(); + if (d0 == 0L) { + saveregs(); + Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); + setregs(); + FAIL(); + } + } + } + BEGP(pt0); + pt0 = YREG + PREG->y_u.yxn.y; + PREG = NEXTOP(PREG, yxn); + INITIALIZE_PERMVAR(pt0,d0); + ENDP(pt0); + GONext(); + + BEGP(pt0); + deref_body(d0, pt0, and_y_vc_unk, and_y_vc_nvar); + saveregs(); + Yap_NilError(INSTANTIATION_ERROR, "X is A /\\ " Int_FORMAT , PREG->y_u.yxn.c); + setregs(); + FAIL(); + ENDP(pt0); + ENDD(d0); + ENDOp(); + + + Op(p_or_vv, xxx); + BEGD(d0); + BEGD(d1); + d0 = XREG(PREG->y_u.xxx.x1); + /* first check pt1 */ + deref_head(d0, or_vv_unk); + or_vv_nvar: + d1 = XREG(PREG->y_u.xxx.x2); + /* next check A2 */ + deref_head(d1, or_vv_nvar_unk); + or_vv_nvar_nvar: + /* d0 and d1 are where I want them */ + if (IsIntTerm(d0) && IsIntTerm(d1)) { + d0 = MkIntegerTerm(IntOfTerm(d0) | IntOfTerm(d1)); + } + else { + saveregs(); + d0 = p_or(Yap_Eval(d0), Yap_Eval(d1) PASS_REGS); + setregs(); + if (d0 == 0L) { + saveregs(); + Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); + setregs(); + FAIL(); + } + } + XREG(PREG->y_u.xxx.x) = d0; + PREG = NEXTOP(PREG, xxx); + GONext(); + + BEGP(pt0); + deref_body(d0, pt0, or_vv_unk, or_vv_nvar); + saveregs(); + Yap_NilError(INSTANTIATION_ERROR, "X is A\\/B"); + setregs(); + FAIL(); + ENDP(pt0); + + BEGP(pt0); + deref_body(d1, pt0, or_vv_nvar_unk, or_vv_nvar_nvar); + saveregs(); + Yap_NilError(INSTANTIATION_ERROR, "X is A\\/B"); + setregs(); + FAIL(); + ENDP(pt0); + ENDD(d1); + ENDD(d0); + ENDOp(); + + Op(p_or_vc, xxn); + BEGD(d0); + d0 = XREG(PREG->y_u.xxn.xi); + /* first check pt1 */ + deref_head(d0, or_vc_unk); + or_vc_nvar: + { + Int d1 = PREG->y_u.xxn.c; + if (IsIntTerm(d0)) { + d0 = MkIntegerTerm(IntOfTerm(d0) | d1); + } + else { + saveregs(); + d0 = p_or(Yap_Eval(d0), MkIntegerTerm(d1) PASS_REGS); + if (d0 == 0L) { + saveregs(); + Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); + setregs(); + FAIL(); + } + } + } + XREG(PREG->y_u.xxn.x) = d0; + PREG = NEXTOP(PREG, xxn); + GONext(); + + BEGP(pt0); + deref_body(d0, pt0, or_vc_unk, or_vc_nvar); + saveregs(); + Yap_NilError(INSTANTIATION_ERROR, "X is A \\/ " Int_FORMAT , PREG->y_u.xxn.c); + setregs(); + FAIL(); + ENDP(pt0); + ENDD(d0); + ENDOp(); + + Op(p_or_y_vv, yxx); + BEGD(d0); + BEGD(d1); + d0 = XREG(PREG->y_u.yxx.x1); + /* first check pt1 */ + deref_head(d0, or_y_vv_unk); + or_y_vv_nvar: + d1 = XREG(PREG->y_u.xxx.x2); + /* next check A2 */ + deref_head(d1, or_y_vv_nvar_unk); + or_y_vv_nvar_nvar: + /* d0 and d1 are where I want them */ + if (IsIntTerm(d0) && IsIntTerm(d1)) { + d0 = MkIntegerTerm(IntOfTerm(d0) | IntOfTerm(d1)); + } + else { + saveregs(); + d0 = p_or(Yap_Eval(d0), Yap_Eval(d1) PASS_REGS); + setregs(); + if (d0 == 0L) { + saveregs(); + Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); + setregs(); + FAIL(); + } + } + BEGP(pt0); + pt0 = YREG + PREG->y_u.yxx.y; + PREG = NEXTOP(PREG, yxx); + INITIALIZE_PERMVAR(pt0,d0); + ENDP(pt0); + GONext(); + + BEGP(pt0); + deref_body(d0, pt0, or_y_vv_unk, or_y_vv_nvar); + saveregs(); + Yap_NilError(INSTANTIATION_ERROR, "X is A\\/B"); + setregs(); + FAIL(); + ENDP(pt0); + + BEGP(pt0); + deref_body(d1, pt0, or_y_vv_nvar_unk, or_y_vv_nvar_nvar); + saveregs(); + Yap_NilError(INSTANTIATION_ERROR, "X is A\\/B"); + setregs(); + FAIL(); + ENDP(pt0); + ENDD(d1); + ENDD(d0); + ENDOp(); + + Op(p_or_y_vc, yxn); + BEGD(d0); + d0 = XREG(PREG->y_u.yxn.xi); + /* first check pt1 */ + deref_head(d0, or_y_vc_unk); + or_y_vc_nvar: + { + Int d1 = PREG->y_u.yxn.c; + if (IsIntTerm(d0)) { + d0 = MkIntegerTerm(IntOfTerm(d0) | d1); + } + else { + saveregs(); + d0 = p_or(Yap_Eval(d0), MkIntegerTerm(d1) PASS_REGS); + setregs(); + if (d0 == 0L) { + saveregs(); + Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); + setregs(); + FAIL(); + } + } + } + BEGP(pt0); + pt0 = YREG + PREG->y_u.yxn.y; + PREG = NEXTOP(PREG, yxn); + INITIALIZE_PERMVAR(pt0,d0); + ENDP(pt0); + GONext(); + + BEGP(pt0); + deref_body(d0, pt0, or_y_vc_unk, or_y_vc_nvar); + saveregs(); + Yap_NilError(INSTANTIATION_ERROR, "X is A \\/ " Int_FORMAT , PREG->y_u.yxn.c); + setregs(); + FAIL(); + ENDP(pt0); + ENDD(d0); + ENDOp(); + + Op(p_sll_vv, xxx); + BEGD(d0); + BEGD(d1); + d0 = XREG(PREG->y_u.xxx.x1); + /* first check pt1 */ + deref_head(d0, sll_vv_unk); + sll_vv_nvar: + d1 = XREG(PREG->y_u.xxx.x2); + /* next check A2 */ + deref_head(d1, sll_vv_nvar_unk); + sll_vv_nvar_nvar: + /* d0 and d1 are where I want them */ + if (IsIntTerm(d0) && IsIntTerm(d1)) { + Int i2 = IntOfTerm(d1); + if (i2 < 0) + d0 = MkIntegerTerm(SLR(IntOfTerm(d0), -i2)); + else + d0 = do_sll(IntOfTerm(d0),i2 PASS_REGS); + } + else { + saveregs(); + d0 = p_sll(Yap_Eval(d0), Yap_Eval(d1) PASS_REGS); + setregs(); + } + if (d0 == 0L) { + saveregs(); + Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); + setregs(); + FAIL(); + } + XREG(PREG->y_u.xxx.x) = d0; + PREG = NEXTOP(PREG, xxx); + GONext(); + + BEGP(pt0); + deref_body(d0, pt0, sll_vv_unk, sll_vv_nvar); + saveregs(); + Yap_NilError(INSTANTIATION_ERROR, "X is A<y_u.xxn.xi); + /* first check pt1 */ + deref_head(d0, sll_vc_unk); + sll_vc_nvar: + { + Int d1 = PREG->y_u.xxn.c; + if (IsIntTerm(d0)) { + d0 = do_sll(IntOfTerm(d0), (Int)d1 PASS_REGS); + } + else { + saveregs(); + d0 = p_sll(Yap_Eval(d0), MkIntegerTerm(d1) PASS_REGS); + setregs(); + } + } + if (d0 == 0L) { + saveregs(); + Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); + setregs(); + FAIL(); + } + XREG(PREG->y_u.xxn.x) = d0; + PREG = NEXTOP(PREG, xxn); + GONext(); + + BEGP(pt0); + deref_body(d0, pt0, sll_vc_unk, sll_vc_nvar); + saveregs(); + Yap_NilError(INSTANTIATION_ERROR, "X is A<y_u.xxn.xi); + /* first check pt1 */ + deref_head(d0, sll_cv_unk); + sll_cv_nvar: + { + Int d1 = PREG->y_u.xxn.c; + if (IsIntTerm(d0)) { + Int i2 = IntOfTerm(d0); + if (i2 < 0) + d0 = MkIntegerTerm(SLR(d1, -i2)); + else + d0 = do_sll(d1,i2 PASS_REGS); + } + else { + saveregs(); + d0 = p_sll(MkIntegerTerm(d1), Yap_Eval(d0) PASS_REGS); + setregs(); + } + } + if (d0 == 0L) { + saveregs(); + Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); + setregs(); + FAIL(); + } + XREG(PREG->y_u.xxn.x) = d0; + PREG = NEXTOP(PREG, xxn); + GONext(); + + BEGP(pt0); + deref_body(d0, pt0, sll_cv_unk, sll_cv_nvar); + saveregs(); + Yap_NilError(INSTANTIATION_ERROR, "X is A<y_u.yxx.x1); + /* first check pt1 */ + deref_head(d0, sll_y_vv_unk); + sll_y_vv_nvar: + d1 = XREG(PREG->y_u.xxx.x2); + /* next check A2 */ + deref_head(d1, sll_y_vv_nvar_unk); + sll_y_vv_nvar_nvar: + /* d0 and d1 are where I want them */ + if (IsIntTerm(d0) && IsIntTerm(d1)) { + Int i2 = IntOfTerm(d1); + if (i2 < 0) + d0 = MkIntegerTerm(SLR(IntOfTerm(d0), -i2)); + else + d0 = do_sll(IntOfTerm(d0),i2 PASS_REGS); + } + else { + saveregs(); + d0 = p_sll(Yap_Eval(d0), Yap_Eval(d1) PASS_REGS); + setregs(); + } + if (d0 == 0L) { + saveregs(); + Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); + setregs(); + FAIL(); + } + BEGP(pt0); + pt0 = YREG + PREG->y_u.yxx.y; + PREG = NEXTOP(PREG, yxx); + INITIALIZE_PERMVAR(pt0,d0); + ENDP(pt0); + GONext(); + + BEGP(pt0); + deref_body(d0, pt0, sll_y_vv_unk, sll_y_vv_nvar); + saveregs(); + Yap_NilError(INSTANTIATION_ERROR, "X is A<y_u.yxn.xi); + /* first check pt1 */ + deref_head(d0, sll_y_vc_unk); + sll_y_vc_nvar: + { + Int d1 = PREG->y_u.yxn.c; + if (IsIntTerm(d0)) { + d0 = do_sll(IntOfTerm(d0), Yap_Eval(d1) PASS_REGS); + } + else { + saveregs(); + d0 = p_sll(Yap_Eval(d0), MkIntegerTerm(d1) PASS_REGS); + setregs(); + } + } + if (d0 == 0L) { + saveregs(); + Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); + setregs(); + FAIL(); + } + BEGP(pt0); + pt0 = YREG + PREG->y_u.yxn.y; + PREG = NEXTOP(PREG, yxn); + INITIALIZE_PERMVAR(pt0,d0); + ENDP(pt0); + GONext(); + + BEGP(pt0); + deref_body(d0, pt0, sll_y_vc_unk, sll_y_vc_nvar); + saveregs(); + Yap_NilError(INSTANTIATION_ERROR, "X is A<y_u.yxn.xi); + /* first check pt1 */ + deref_head(d0, sll_y_cv_unk); + sll_y_cv_nvar: + { + Int d1 = PREG->y_u.yxn.c; + if (IsIntTerm(d0)) { + Int i2 = IntOfTerm(d0); + if (i2 < 0) + d0 = MkIntegerTerm(SLR(d1, -i2)); + else + d0 = do_sll(d1,i2 PASS_REGS); + } + else { + saveregs(); + d0 = p_sll(MkIntegerTerm(d1), Yap_Eval(0) PASS_REGS); + setregs(); + } + } + if (d0 == 0L) { + saveregs(); + Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); + setregs(); + FAIL(); + } + BEGP(pt0); + pt0 = YREG + PREG->y_u.yxn.y; + PREG = NEXTOP(PREG, yxn); + INITIALIZE_PERMVAR(pt0,d0); + ENDP(pt0); + GONext(); + + BEGP(pt0); + deref_body(d0, pt0, sll_y_cv_unk, sll_y_cv_nvar); + saveregs(); + Yap_NilError(INSTANTIATION_ERROR, "X is A<y_u.xxx.x1); + /* first check pt1 */ + deref_head(d0, slr_vv_unk); + slr_vv_nvar: + d1 = XREG(PREG->y_u.xxx.x2); + /* next check A2 */ + deref_head(d1, slr_vv_nvar_unk); + slr_vv_nvar_nvar: + /* d0 and d1 are where I want them */ + if (IsIntTerm(d0) && IsIntTerm(d1)) { + Int i2 = IntOfTerm(d1); + if (i2 < 0) + d0 = do_sll(IntOfTerm(d0), -i2 PASS_REGS); + else + d0 = MkIntTerm(SLR(IntOfTerm(d0), i2)); + } + else { + saveregs(); + d0 = p_slr(Yap_Eval(d0), Yap_Eval(d1) PASS_REGS); + setregs(); + } + if (d0 == 0L) { + saveregs(); + Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); + setregs(); + FAIL(); + } + XREG(PREG->y_u.xxx.x) = d0; + PREG = NEXTOP(PREG, xxx); + GONext(); + + BEGP(pt0); + deref_body(d0, pt0, slr_vv_unk, slr_vv_nvar); + saveregs(); + Yap_NilError(INSTANTIATION_ERROR, "X is A>>B"); + setregs(); + FAIL(); + ENDP(pt0); + + BEGP(pt0); + deref_body(d1, pt0, slr_vv_nvar_unk, slr_vv_nvar_nvar); + saveregs(); + Yap_NilError(INSTANTIATION_ERROR, "X is A>>B"); + setregs(); + FAIL(); + ENDP(pt0); + ENDD(d1); + ENDD(d0); + ENDOp(); + + Op(p_slr_vc, xxn); + BEGD(d0); + d0 = XREG(PREG->y_u.xxn.xi); + /* first check pt1 */ + deref_head(d0, slr_vc_unk); + slr_vc_nvar: + { + Int d1 = PREG->y_u.xxn.c; + if (IsIntTerm(d0)) { + d0 = MkIntTerm(SLR(IntOfTerm(d0), d1)); + } + else { + saveregs(); + d0 = p_slr(Yap_Eval(d0), MkIntegerTerm(d1) PASS_REGS); + setregs(); + if (d0 == 0L) { + saveregs(); + Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); + setregs(); + FAIL(); + } + } + } + XREG(PREG->y_u.xxn.x) = d0; + PREG = NEXTOP(PREG, xxn); + GONext(); + + BEGP(pt0); + deref_body(d0, pt0, slr_vc_unk, slr_vc_nvar); + saveregs(); + Yap_NilError(INSTANTIATION_ERROR, "X is A>>B"); + setregs(); + FAIL(); + ENDP(pt0); + ENDD(d0); + ENDOp(); + + Op(p_slr_cv, xxn); + BEGD(d0); + d0 = XREG(PREG->y_u.xxn.xi); + /* first check pt1 */ + deref_head(d0, slr_cv_unk); + slr_cv_nvar: + { + Int d1 = PREG->y_u.xxn.c; + if (IsIntTerm(d0)) { + Int i2 = IntOfTerm(d0); + if (i2 < 0) + d0 = do_sll(d1, -i2 PASS_REGS); + else + d0 = MkIntegerTerm(SLR(d1, i2)); + } + else { + saveregs(); + d0 = p_slr(MkIntegerTerm(d1), Yap_Eval(d0) PASS_REGS); + setregs(); + } + } + if (d0 == 0L) { + saveregs(); + Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); + setregs(); + FAIL(); + } + XREG(PREG->y_u.xxn.x) = d0; + PREG = NEXTOP(PREG, xxn); + GONext(); + + BEGP(pt0); + deref_body(d0, pt0, slr_cv_unk, slr_cv_nvar); + saveregs(); + Yap_NilError(INSTANTIATION_ERROR, "X is A>>B"); + setregs(); + FAIL(); + ENDP(pt0); + ENDD(d0); + ENDOp(); + + Op(p_slr_y_vv, yxx); + BEGD(d0); + BEGD(d1); + d0 = XREG(PREG->y_u.yxx.x1); + /* first check pt1 */ + deref_head(d0, slr_y_vv_unk); + slr_y_vv_nvar: + d1 = XREG(PREG->y_u.xxx.x2); + /* next check A2 */ + deref_head(d1, slr_y_vv_nvar_unk); + slr_y_vv_nvar_nvar: + /* d0 and d1 are where I want them */ + if (IsIntTerm(d0) && IsIntTerm(d1)) { + Int i2 = IntOfTerm(d1); + if (i2 < 0) + d0 = do_sll(IntOfTerm(d0), -i2 PASS_REGS); + else + d0 = MkIntTerm(SLR(IntOfTerm(d0), i2)); + } + else { + saveregs(); + d0 = p_slr(Yap_Eval(d0), Yap_Eval(d1) PASS_REGS); + setregs(); + } + BEGP(pt0); + if (d0 == 0L) { + saveregs(); + Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); + setregs(); + FAIL(); + } + pt0 = YREG + PREG->y_u.yxx.y; + PREG = NEXTOP(PREG, yxx); + INITIALIZE_PERMVAR(pt0,d0); + ENDP(pt0); + GONext(); + + BEGP(pt0); + deref_body(d0, pt0, slr_y_vv_unk, slr_y_vv_nvar); + saveregs(); + Yap_NilError(INSTANTIATION_ERROR, "X is A>>B"); + setregs(); + FAIL(); + ENDP(pt0); + + BEGP(pt0); + deref_body(d1, pt0, slr_y_vv_nvar_unk, slr_y_vv_nvar_nvar); + saveregs(); + Yap_NilError(INSTANTIATION_ERROR, "X is A>>B"); + setregs(); + FAIL(); + ENDP(pt0); + ENDD(d1); + ENDD(d0); + ENDOp(); + Op(p_slr_y_vc, yxn); BEGD(d0); d0 = XREG(PREG->y_u.yxn.xi); @@ -2038,7 +3670,7 @@ func_nvar_nvar: /* A2 was bound */ if (d0 != d1) { - vvvv FAIL(); + FAIL(); } /* I have to this here so that I don't have a jump to a closing bracket */ d0 = arity; diff --git a/C/sysbits.c b/C/sysbits.c index 2c5aed42b..478807661 100644 --- a/C/sysbits.c +++ b/C/sysbits.c @@ -143,7 +143,7 @@ Yap_WinError(char *yap_error) char msg[256]; /* Error, we could not read time */ FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, GetLastError(), + NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), msg, 256, NULL); Yap_Error(OPERATING_SYSTEM_ERROR, TermNil, "%s at %s", msg, yap_error); @@ -195,13 +195,13 @@ is_directory(const char *FileName) s1[-1] = '\\'; } if (ExpandEnvironmentStrings(s, (LPSTR)FileName, YAP_FILENAME_MAX) == 0) - return FALSE; + return FALSE; DWORD dwAtts = GetFileAttributes( FileName ); if (dwAtts == INVALID_FILE_ATTRIBUTES) return FALSE; return (dwAtts & FILE_ATTRIBUTE_DIRECTORY); - #elif HAVE_LSTAT + #elif HAVE_LSTAT struct stat buf; if (lstat(FileName, &buf) == -1) { @@ -261,7 +261,7 @@ initSysPath(Term tlib, Term tcommons, bool dir_done, bool commons_done) { MkAtomTerm(Yap_LookupAtom(dir))) ) return FALSE; } - commons_done = true; + commons_done = true; } if (dir_done && commons_done) return TRUE; @@ -271,7 +271,7 @@ initSysPath(Term tlib, Term tcommons, bool dir_done, bool commons_done) { len = strlen(LOCAL_FileNameBuf); if (!dir_done) { strncat(LOCAL_FileNameBuf, "Yap", YAP_FILENAME_MAX); - if (is_directory(LOCAL_FileNameBuf)) + if (is_directory(LOCAL_FileNameBuf)) { if (! Yap_unify( tlib, MkAtomTerm(Yap_LookupAtom(LOCAL_FileNameBuf))) ) @@ -300,7 +300,7 @@ initSysPath(Term tlib, Term tcommons, bool dir_done, bool commons_done) { /* couldn't find it where it was supposed to be, let's try using the executable */ if (!GetModuleFileName( NULL, LOCAL_FileNameBuf, YAP_FILENAME_MAX)) { - Yap_WinError( "could not find executable name" ); + Yap_WinError( "could not find executable name" ); /* do nothing */ return FALSE; } @@ -468,31 +468,31 @@ InitTime (int wid) REMOTE_ThreadHandle(wid).last_time_sysp = (struct timeval *)malloc(sizeof(struct timeval)); getrusage(RUSAGE_SELF, &rusage); (*REMOTE_ThreadHandle(wid).last_timep).tv_sec = - (*REMOTE_ThreadHandle(wid).start_of_timesp).tv_sec = + (*REMOTE_ThreadHandle(wid).start_of_timesp).tv_sec = rusage.ru_utime.tv_sec; (*REMOTE_ThreadHandle(wid).last_timep).tv_usec = - (*REMOTE_ThreadHandle(wid).start_of_timesp).tv_usec = + (*REMOTE_ThreadHandle(wid).start_of_timesp).tv_usec = rusage.ru_utime.tv_usec; (*REMOTE_ThreadHandle(wid).last_time_sysp).tv_sec = - (*REMOTE_ThreadHandle(wid).start_of_times_sysp).tv_sec = + (*REMOTE_ThreadHandle(wid).start_of_times_sysp).tv_sec = rusage.ru_stime.tv_sec; (*REMOTE_ThreadHandle(wid).last_time_sysp).tv_usec = - (*REMOTE_ThreadHandle(wid).start_of_times_sysp).tv_usec = + (*REMOTE_ThreadHandle(wid).start_of_times_sysp).tv_usec = rusage.ru_stime.tv_usec; #else getrusage(RUSAGE_SELF, &rusage); last_time.tv_sec = - StartOfTimes.tv_sec = + StartOfTimes.tv_sec = rusage.ru_utime.tv_sec; last_time.tv_usec = - StartOfTimes.tv_usec = + StartOfTimes.tv_usec = rusage.ru_utime.tv_usec; last_time_sys.tv_sec = - StartOfTimes_sys.tv_sec = + StartOfTimes_sys.tv_sec = rusage.ru_stime.tv_sec; last_time_sys.tv_usec = - StartOfTimes_sys.tv_usec = - rusage.ru_stime.tv_usec; + StartOfTimes_sys.tv_usec = + rusage.ru_stime.tv_usec; #endif } @@ -586,51 +586,51 @@ InitTime (int wid) REMOTE_ThreadHandle(wid).last_timep = (struct _FILETIME *)malloc(sizeof(FILETIME)); REMOTE_ThreadHandle(wid).start_of_times_sysp = (struct _FILETIME *)malloc(sizeof(FILETIME)); REMOTE_ThreadHandle(wid).last_time_sysp = (struct _FILETIME *)malloc(sizeof(FILETIME)); - (*REMOTE_ThreadHandle(wid).last_timep).dwLowDateTime = + (*REMOTE_ThreadHandle(wid).last_timep).dwLowDateTime = UserTime.dwLowDateTime; (*REMOTE_ThreadHandle(wid).last_timep).dwHighDateTime = UserTime.dwHighDateTime; (*REMOTE_ThreadHandle(wid).start_of_timesp).dwLowDateTime = UserTime.dwLowDateTime; - (*REMOTE_ThreadHandle(wid).start_of_timesp).dwHighDateTime = + (*REMOTE_ThreadHandle(wid).start_of_timesp).dwHighDateTime = UserTime.dwHighDateTime; (*REMOTE_ThreadHandle(wid).last_time_sysp).dwLowDateTime = KernelTime.dwLowDateTime; - (*REMOTE_ThreadHandle(wid).last_time_sysp).dwHighDateTime = + (*REMOTE_ThreadHandle(wid).last_time_sysp).dwHighDateTime = KernelTime.dwHighDateTime; (*REMOTE_ThreadHandle(wid).start_of_times_sysp).dwLowDateTime = KernelTime.dwLowDateTime; - (*REMOTE_ThreadHandle(wid).start_of_times_sysp).dwHighDateTime = + (*REMOTE_ThreadHandle(wid).start_of_times_sysp).dwHighDateTime = KernelTime.dwHighDateTime; #else - last_time.dwLowDateTime = + last_time.dwLowDateTime = UserTime.dwLowDateTime; last_time.dwHighDateTime = UserTime.dwHighDateTime; StartOfTimes.dwLowDateTime = UserTime.dwLowDateTime; - StartOfTimes.dwHighDateTime = + StartOfTimes.dwHighDateTime = UserTime.dwHighDateTime; last_time_sys.dwLowDateTime = KernelTime.dwLowDateTime; - last_time_sys.dwHighDateTime = + last_time_sys.dwHighDateTime = KernelTime.dwHighDateTime; StartOfTimes_sys.dwLowDateTime = KernelTime.dwLowDateTime; - StartOfTimes_sys.dwHighDateTime = + StartOfTimes_sys.dwHighDateTime = KernelTime.dwHighDateTime; #endif } } #ifdef __GNUC__ -static unsigned long long int +static unsigned long long int sub_utime(FILETIME t1, FILETIME t2) { ULARGE_INTEGER u[2]; memcpy((void *)u,(void *)&t1,sizeof(FILETIME)); memcpy((void *)(u+1),(void *)&t2,sizeof(FILETIME)); - return + return u[0].QuadPart - u[1].QuadPart; } #endif @@ -951,7 +951,7 @@ real_cputime () static hrtime_t StartOfWTimes; /* since last call to walltime */ -#define LastWtime (*(hrtime_t *)ALIGN_YAPTYPE(LastWtimePtr,hrtime_t)) +#define LastWtime (*(hrtime_t *)ALIGN_BY_TYPE(LastWtimePtr,hrtime_t)) static void InitWTime (void) @@ -1178,7 +1178,7 @@ p_init_random_state ( USES_REGS1 ) current_seed = (unsigned int) FloatOfTerm (t0); else current_seed = (unsigned int) LongIntOfTerm (t0); - + new = (char *) malloc(256); old = initstate(random(), new, 256); return Yap_unify(ARG2, MkIntegerTerm((Int)old)) && @@ -1383,7 +1383,7 @@ Yap_signal_index(const char *name) { struct signame *sn = signames; char tmp[12]; - if ( strncmp(name, "SIG", 3) == 0 && strlen(name) < 12 ) + if ( strncmp(name, "SIG", 3) == 0 && strlen(name) < 12 ) { char *p = (char *)name+3, *q = tmp; while ((*q++ = tolower(*p++))) {}; name = tmp; @@ -1415,7 +1415,7 @@ SearchForTrailFault(void *ptr, int sure) crash again */ #if OS_HANDLES_TR_OVERFLOW && !USE_SYSTEM_MALLOC - if ((ptr > (void *)LOCAL_TrailTop-1024 && + if ((ptr > (void *)LOCAL_TrailTop-1024 && TR < (tr_fr_ptr) LOCAL_TrailTop+(64*1024))) { if (!Yap_growtrail(64*1024, TRUE)) { Yap_Error(OUT_OF_TRAIL_ERROR, TermNil, "YAP failed to reserve %ld bytes in growtrail", K64); @@ -1563,7 +1563,7 @@ HandleMatherr(int sig, void *sipv, void *uapv) typedef void (*signal_handler_t)(int, void *, void *); -#if HAVE_SIGACTION +#if HAVE_SIGACTION static void my_signal_info(int sig, void * handler) { @@ -1604,7 +1604,7 @@ my_signal_info(int sig, void *handler) #endif -#if !defined(LIGHT) && !_MSC_VER && !defined(__MINGW32__) && !defined(LIGHT) +#if !defined(LIGHT) && !_MSC_VER && !defined(__MINGW32__) && !defined(LIGHT) static RETSIGTYPE ReceiveSignal (int s, void *x, void *y) { @@ -1702,7 +1702,7 @@ static void InitSignals (void) { if (GLOBAL_PrologShouldHandleInterrupts) { -#if !defined(LIGHT) && !_MSC_VER && !defined(__MINGW32__) && !defined(LIGHT) +#if !defined(LIGHT) && !_MSC_VER && !defined(__MINGW32__) && !defined(LIGHT) my_signal (SIGQUIT, ReceiveSignal); my_signal (SIGKILL, ReceiveSignal); my_signal (SIGUSR1, ReceiveSignal); @@ -1727,7 +1727,7 @@ InitSignals (void) my_signal_info (SIGSEGV, HandleSIGSEGV); #endif #ifdef YAPOR_COW - signal(SIGCHLD, SIG_IGN); /* avoid ghosts */ + signal(SIGCHLD, SIG_IGN); /* avoid ghosts */ #endif } } @@ -1780,7 +1780,7 @@ TrueFileName (char *source, char *root, char *result, int in_lib, int expand_roo result[0] = '\0'; if (strlen(source) >= YAP_FILENAME_MAX) { - Yap_Error(OPERATING_SYSTEM_ERROR, TermNil, "%s in true_file-name is larger than the buffer size (%d bytes)", source, strlen(source)); + Yap_Error(OPERATING_SYSTEM_ERROR, TermNil, "%s in true_file-name is larger than the buffer size (%d bytes)", source, strlen(source)); } #if defined(__MINGW32__) || _MSC_VER /* step 0: replace / by \ */ @@ -1816,7 +1816,7 @@ TrueFileName (char *source, char *root, char *result, int in_lib, int expand_roo } else { #if HAVE_GETPWNAM struct passwd *user_passwd; - char *res0 = result; + char *res0 = result; source++; while (!dir_separator((*res0 = *source)) && *res0 != '\0') @@ -1841,7 +1841,7 @@ TrueFileName (char *source, char *root, char *result, int in_lib, int expand_roo while ((ch = *res0) && is_valid_env_char (ch) && ch != '}') { res0++; } - *res0++ = '\0'; + *res0++ = '\0'; if (ch == '}') { // {...} source++; @@ -1977,7 +1977,7 @@ static Int p_true_file_name ( USES_REGS1 ) { Term t = Deref(ARG1); - + if (IsVarTerm(t)) { Yap_Error(INSTANTIATION_ERROR,t,"argument to true_file_name unbound"); return FALSE; @@ -1994,7 +1994,7 @@ static Int p_expand_file_name ( USES_REGS1 ) { Term t = Deref(ARG1); - + if (IsVarTerm(t)) { Yap_Error(INSTANTIATION_ERROR,t,"argument to true_file_name unbound"); return FALSE; @@ -2012,7 +2012,7 @@ p_true_file_name3 ( USES_REGS1 ) { Term t = Deref(ARG1), t2 = Deref(ARG2); char *root = NULL; - + if (IsVarTerm(t)) { Yap_Error(INSTANTIATION_ERROR,t,"argument to true_file_name unbound"); return FALSE; @@ -2033,12 +2033,12 @@ p_true_file_name3 ( USES_REGS1 ) } /* Executes $SHELL under Prolog */ -/** @pred sh +/** @pred sh Creates a new shell interaction. - + */ static Int p_sh ( USES_REGS1 ) @@ -2088,7 +2088,7 @@ p_shell ( USES_REGS1 ) return FALSE; #else -#if HAVE_SYSTEM +#if HAVE_SYSTEM char *shell; register int bourne = FALSE; Term t1 = Deref (ARG1); @@ -2167,7 +2167,7 @@ p_system ( USES_REGS1 ) si.cb = sizeof(si); ZeroMemory( &pi, sizeof(pi) ); - // Start the child process. + // Start the child process. if( !CreateProcess( NULL, // No module name (use command line) cmd, // Command line NULL, // Process handle not inheritable @@ -2175,10 +2175,10 @@ p_system ( USES_REGS1 ) FALSE, // Set handle inheritance to FALSE 0, // No creation flags NULL, // Use parent's environment block - NULL, // Use parent's starting directory + NULL, // Use parent's starting directory &si, // Pointer to STARTUPINFO structure &pi ) // Pointer to PROCESS_INFORMATION structure - ) + ) { Yap_Error( SYSTEM_ERROR, ARG1, "CreateProcess failed (%d).\n", GetLastError() ); return FALSE; @@ -2186,7 +2186,7 @@ p_system ( USES_REGS1 ) // Wait until child process exits. WaitForSingleObject( pi.hProcess, INFINITE ); - // Close process and thread handles. + // Close process and thread handles. CloseHandle( pi.hProcess ); CloseHandle( pi.hThread ); @@ -2243,7 +2243,7 @@ p_system ( USES_REGS1 ) /* Rename a file */ -/** @pred rename(+ _F_,+ _G_) +/** @pred rename(+ _F_,+ _G_) Renames file _F_ to _G_. */ @@ -2454,7 +2454,7 @@ p_alarm( USES_REGS1 ) #else Yap_get_signal( YAP_ALARM_SIGNAL ); #endif - } + } #if _MSC_VER || defined(__MINGW32__) { Term tout; @@ -2462,19 +2462,19 @@ p_alarm( USES_REGS1 ) time[0] = i1; time[1] = i2; - - if (time[0] != 0 && time[1] != 0) { - DWORD dwThreadId; - HANDLE hThread; - hThread = CreateThread( + if (time[0] != 0 && time[1] != 0) { + DWORD dwThreadId; + HANDLE hThread; + + hThread = CreateThread( NULL, /* no security attributes */ - 0, /* use default stack size */ + 0, /* use default stack size */ DoTimerThread, /* thread function */ (LPVOID)time, /* argument to thread function */ 0, /* use default creation flags */ &dwThreadId); /* returns the thread identifier */ - + /* Check the return value for success. */ if (hThread == NULL) { Yap_WinError("trying to use alarm"); @@ -2549,19 +2549,19 @@ p_virtual_alarm( USES_REGS1 ) time[0] = IntegerOfTerm(t); time[1] = IntegerOfTerm(t2); - - if (time[0] != 0 && time[1] != 0) { - DWORD dwThreadId; - HANDLE hThread; - hThread = CreateThread( + if (time[0] != 0 && time[1] != 0) { + DWORD dwThreadId; + HANDLE hThread; + + hThread = CreateThread( NULL, /* no security attributes */ - 0, /* use default stack size */ + 0, /* use default stack size */ DoTimerThread, /* thread function */ (LPVOID)time, /* argument to thread function */ 0, /* use default creation flags */ &dwThreadId); /* returns the thread identifier */ - + /* Check the return value for success. */ if (hThread == NULL) { Yap_WinError("trying to use alarm"); @@ -2667,7 +2667,7 @@ set_fpu_exceptions(bool flag) /* this will probably not work in older releases of Linux */ int v = _FPU_IEEE; _FPU_SETCW(v); -#endif +#endif #ifdef HAVE_SIGFPE my_signal (SIGFPE, SIG_IGN); #endif @@ -2709,14 +2709,14 @@ p_yap_paths( USES_REGS1 ) { char destdir[YAP_FILENAME_MAX+1]; if (env_destdir) { - strncat(destdir, env_destdir, YAP_FILENAME_MAX ); - strncat(destdir, "/" YAP_LIBDIR, YAP_FILENAME_MAX ); + strncat(destdir, env_destdir, YAP_FILENAME_MAX ); + strncat(destdir, "/" YAP_LIBDIR, YAP_FILENAME_MAX ); out1 = MkAtomTerm(Yap_LookupAtom(destdir)); } else { out1 = MkAtomTerm(Yap_LookupAtom(YAP_LIBDIR)); } if (env_destdir) { - strncat(destdir, env_destdir, YAP_FILENAME_MAX ); + strncat(destdir, env_destdir, YAP_FILENAME_MAX ); strncat(destdir, "/" YAP_SHAREDIR, YAP_FILENAME_MAX ); out2 = MkAtomTerm(Yap_LookupAtom(destdir)); } else { @@ -2727,7 +2727,7 @@ p_yap_paths( USES_REGS1 ) { #endif } if (env_destdir) { - strncat(destdir, env_destdir, YAP_FILENAME_MAX ); + strncat(destdir, env_destdir, YAP_FILENAME_MAX ); strncat(destdir, "/" YAP_BINDIR, YAP_FILENAME_MAX ); out3 = MkAtomTerm(Yap_LookupAtom(destdir)); } else { @@ -2804,7 +2804,7 @@ void Yap_ReInitWallTime (void) { InitWTime(); - if (Yap_heap_regs->last_wtime != NULL) + if (Yap_heap_regs->last_wtime != NULL) Yap_FreeCodeSpace(Yap_heap_regs->last_wtime); InitLastWtime(); } @@ -2963,7 +2963,7 @@ WideStringFromAtom(Atom KeyAt USES_REGS) if (!Yap_growheap(FALSE, sz, NULL)) { Yap_Error(OUT_OF_HEAP_ERROR, MkIntegerTerm(sz), "generating key in win_registry_get_value/3"); return FALSE; - } + } } kptr = k; while ((*kptr++ = *chp++)); @@ -3098,8 +3098,8 @@ Yap_InitSysPreds(void) Yap_InitCPred ("$yap_home", 1, p_yap_home, SafePredFlag); Yap_InitCPred ("$yap_paths", 3, p_yap_paths, SafePredFlag); Yap_InitCPred ("$dir_separator", 1, p_dir_sp, SafePredFlag); - Yap_InitCPred ("libraries_directory", 2, p_libraries_path, 0); - Yap_InitCPred ("system_library", 1, p_library_dir, 0); + Yap_InitCPred ("libraries_directory", 2, p_libraries_path, 0); + Yap_InitCPred ("system_library", 1, p_library_dir, 0); Yap_InitCPred ("commons_library", 1, p_commons_dir, 0); Yap_InitCPred ("$alarm", 4, p_alarm, SafePredFlag|SyncPredFlag); Yap_InitCPred ("$getenv", 2, p_getenv, SafePredFlag); @@ -3180,7 +3180,7 @@ int WINAPI win_yap(HANDLE, DWORD, LPVOID); int WINAPI win_yap(HANDLE hinst, DWORD reason, LPVOID reserved) { - switch (reason) + switch (reason) { case DLL_PROCESS_ATTACH: break; diff --git a/JIT/HPP/traced_absmi_insts.i b/C/traced_absmi_insts.h similarity index 83% rename from JIT/HPP/traced_absmi_insts.i rename to C/traced_absmi_insts.h index 533bd2b0e..34bd063ed 100644 --- a/JIT/HPP/traced_absmi_insts.i +++ b/C/traced_absmi_insts.h @@ -21,11 +21,11 @@ /* I use YREG =to go through the choicepoint. Usually YREG =is in a * register, but sometimes (X86) not. In this case, have a * new register to point at YREG =*/ - CACHE_Y(YREG); +CACHE_Y(YREG); /* store arguments for procedure */ - store_at_least_one_arg(PREG->u.Otapl.s); + store_at_least_one_arg(PREG->y_u.Otapl.s); /* store abstract machine registers */ - store_yaam_regs(PREG->u.Otapl.d, 0); + store_yaam_regs(PREG->y_u.Otapl.d, 0); /* On a try_me, set cut to point at previous choicepoint, * that is, to the B before the cut. */ @@ -49,8 +49,8 @@ CACHE_Y(B); /* After retry, cut should be pointing at the parent * choicepoint for the current B */ - restore_yaam_regs(PREG->u.Otapl.d); - restore_at_least_one_arg(PREG->u.Otapl.s); + restore_yaam_regs(PREG->y_u.Otapl.d); + restore_at_least_one_arg(PREG->y_u.Otapl.s); #ifdef FROZEN_STACKS EMIT_SIMPLE_BLOCK_TEST(RETRY_ME_FROZEN); S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG); @@ -74,7 +74,7 @@ #ifdef YAPOR if (SCH_top_shared_cp(B)) { SCH_last_alternative(PREG, B_YREG); - restore_at_least_one_arg(PREG->u.Otapl.s); + restore_at_least_one_arg(PREG->y_u.Otapl.s); #ifdef FROZEN_STACKS S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG); #endif /* FROZEN_STACKS */ @@ -84,7 +84,7 @@ #endif /* YAPOR */ { pop_yaam_regs(); - pop_at_least_one_arg(PREG->u.Otapl.s); + pop_at_least_one_arg(PREG->y_u.Otapl.s); /* After trust, cut should be pointing at the new top * choicepoint */ #ifdef FROZEN_STACKS @@ -106,9 +106,9 @@ /* profiled_enter_me Pred */ Op(traced_enter_profiling, p); EMIT_ENTRY_BLOCK(PREG,ENTER_PROFILING_INSTINIT); - LOCK(PREG->u.p.p->StatisticsForPred.lock); - PREG->u.p.p->StatisticsForPred.NOfEntries++; - UNLOCK(PREG->u.p.p->StatisticsForPred.lock); + LOCK(PREG->y_u.p.p->StatisticsForPred.lock); + PREG->y_u.p.p->StatisticsForPred.NOfEntries++; + UNLOCK(PREG->y_u.p.p->StatisticsForPred.lock); PREG = NEXTOP(PREG, p); GONext(); ENDOp(); @@ -116,9 +116,9 @@ /* profiled_retry Label,NArgs */ Op(traced_retry_profiled, p); EMIT_ENTRY_BLOCK(PREG,RETRY_PROFILED_INSTINIT); - LOCK(PREG->u.p.p->StatisticsForPred.lock); - PREG->u.p.p->StatisticsForPred.NOfRetries++; - UNLOCK(PREG->u.p.p->StatisticsForPred.lock); + LOCK(PREG->y_u.p.p->StatisticsForPred.lock); + PREG->y_u.p.p->StatisticsForPred.NOfRetries++; + UNLOCK(PREG->y_u.p.p->StatisticsForPred.lock); PREG = NEXTOP(PREG, p); GONext(); ENDOp(); @@ -129,11 +129,11 @@ CACHE_Y(B); /* After retry, cut should be pointing at the parent * choicepoint for the current B */ - 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); + 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); #ifdef FROZEN_STACKS EMIT_SIMPLE_BLOCK(PROFILED_RETRY_ME_FROZEN); S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG); @@ -157,7 +157,7 @@ #ifdef YAPOR if (SCH_top_shared_cp(B)) { SCH_last_alternative(PREG, B_YREG); - restore_args(PREG->u.Otapl.s); + restore_args(PREG->y_u.Otapl.s); #ifdef FROZEN_STACKS S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG); #endif /* FROZEN_STACKS */ @@ -167,7 +167,7 @@ #endif /* YAPOR */ { pop_yaam_regs(); - pop_args(PREG->u.Otapl.s); + pop_args(PREG->y_u.Otapl.s); /* After trust, cut should be pointing at the new top * choicepoint */ #ifdef FROZEN_STACKS @@ -178,9 +178,9 @@ EMIT_SIMPLE_BLOCK(PROFILED_TRUST_ME_END); SET_BB(B_YREG); ENDCACHE_Y(); - LOCK(PREG->u.Otapl.p->StatisticsForPred.lock); - PREG->u.Otapl.p->StatisticsForPred.NOfRetries++; - UNLOCK(PREG->u.Otapl.p->StatisticsForPred.lock); + LOCK(PREG->y_u.Otapl.p->StatisticsForPred.lock); + PREG->y_u.Otapl.p->StatisticsForPred.NOfRetries++; + UNLOCK(PREG->y_u.Otapl.p->StatisticsForPred.lock); PREG = NEXTOP(PREG, Otapl); GONext(); ENDOp(); @@ -192,23 +192,23 @@ UInt timestamp; CACHE_Y(B); - timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[PREG->u.OtaLl.s]); - if (!VALID_TIMESTAMP(timestamp, PREG->u.OtaLl.d)) { + 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->u.OtaLl.n; + PREG=PREG->y_u.OtaLl.n; JMPNext(); } - 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); + 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 EMIT_SIMPLE_BLOCK(PROFILED_RETRY_LOGICAL_THREADS); - PP = PREG->u.OtaLl.d->ClPred; + PP = PREG->y_u.OtaLl.d->ClPred; #endif EMIT_SIMPLE_BLOCK(PROFILED_RETRY_LOGICAL_POST_THREADS); - PREG = PREG->u.OtaLl.d->ClCode; + PREG = PREG->y_u.OtaLl.d->ClCode; #ifdef FROZEN_STACKS EMIT_SIMPLE_BLOCK(PROFILED_RETRY_LOGICAL_FROZEN); S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG); @@ -229,9 +229,9 @@ EMIT_SIMPLE_BLOCK(PROFILED_TRUST_LOGICAL_END); CACHE_Y(B); { - LogUpdIndex *cl = PREG->u.OtILl.block; + LogUpdIndex *cl = PREG->y_u.OtILl.block; PredEntry *ap = cl->ClPred; - LogUpdClause *lcl = PREG->u.OtILl.d; + LogUpdClause *lcl = PREG->y_u.OtILl.d; UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]); if (!VALID_TIMESTAMP(timestamp, lcl)) { @@ -343,9 +343,9 @@ /* count_enter_me Label,NArgs */ Op(traced_count_call, p); EMIT_ENTRY_BLOCK(PREG,COUNT_CALL_INSTINIT); - LOCK(PREG->u.p.p->StatisticsForPred.lock); - PREG->u.p.p->StatisticsForPred.NOfEntries++; - UNLOCK(PREG->u.p.p->StatisticsForPred.lock); + LOCK(PREG->y_u.p.p->StatisticsForPred.lock); + PREG->y_u.p.p->StatisticsForPred.NOfEntries++; + UNLOCK(PREG->y_u.p.p->StatisticsForPred.lock); LOCAL_ReductionsCounter--; EMIT_SIMPLE_BLOCK(COUNT_CALL_MIDDLE); if (LOCAL_ReductionsCounter == 0 && LOCAL_ReductionsCounterOn) { @@ -369,9 +369,9 @@ /* count_retry Label,NArgs */ Op(traced_count_retry, p); EMIT_ENTRY_BLOCK(PREG,COUNT_RETRY_INSTINIT); - LOCK(PREG->u.p.p->StatisticsForPred.lock); - PREG->u.p.p->StatisticsForPred.NOfRetries++; - UNLOCK(PREG->u.p.p->StatisticsForPred.lock); + LOCK(PREG->y_u.p.p->StatisticsForPred.lock); + PREG->y_u.p.p->StatisticsForPred.NOfRetries++; + UNLOCK(PREG->y_u.p.p->StatisticsForPred.lock); LOCAL_RetriesCounter--; EMIT_SIMPLE_BLOCK(COUNT_RETRY_MIDDLE); if (LOCAL_RetriesCounter == 0 && LOCAL_RetriesCounterOn) { @@ -399,8 +399,8 @@ Op(traced_count_retry_me, Otapl); EMIT_ENTRY_BLOCK(PREG,COUNT_RETRY_ME_INSTINIT); CACHE_Y(B); - restore_yaam_regs(PREG->u.Otapl.d); - restore_args(PREG->u.Otapl.s); + restore_yaam_regs(PREG->y_u.Otapl.d); + restore_args(PREG->y_u.Otapl.s); /* After retry, cut should be pointing at the parent * choicepoint for the current B */ EMIT_SIMPLE_BLOCK(COUNT_RETRY_ME_MIDDLE); @@ -412,9 +412,9 @@ #endif /* FROZEN_STACKS */ SET_BB(B_YREG); ENDCACHE_Y(); - LOCK(((PredEntry *)(PREG->u.Otapl.p))->StatisticsForPred.lock); - ((PredEntry *)(PREG->u.Otapl.p))->StatisticsForPred.NOfRetries++; - UNLOCK(((PredEntry *)(PREG->u.Otapl.p))->StatisticsForPred.lock); + 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); LOCAL_RetriesCounter--; if (LOCAL_RetriesCounter == 0 && LOCAL_RetriesCounterOn) { saveregs(); @@ -442,7 +442,7 @@ #ifdef YAPOR if (SCH_top_shared_cp(B)) { SCH_last_alternative(PREG, B_YREG); - restore_args(PREG->u.Otapl.s); + restore_args(PREG->y_u.Otapl.s); #ifdef FROZEN_STACKS S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG); #endif /* FROZEN_STACKS */ @@ -452,7 +452,7 @@ #endif /* YAPOR */ { pop_yaam_regs(); - pop_args(PREG->u.Otapl.s); + pop_args(PREG->y_u.Otapl.s); /* After trust, cut should be pointing at the new top * choicepoint */ #ifdef FROZEN_STACKS @@ -477,9 +477,9 @@ JMPNext(); } EMIT_SIMPLE_BLOCK(COUNT_TRUST_ME_END); - LOCK(((PredEntry *)(PREG->u.Otapl.p))->StatisticsForPred.lock); - ((PredEntry *)(PREG->u.Otapl.p))->StatisticsForPred.NOfRetries++; - UNLOCK(((PredEntry *)(PREG->u.Otapl.p))->StatisticsForPred.lock); + 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); PREG = NEXTOP(PREG, Otapl); GONext(); ENDOp(); @@ -492,14 +492,14 @@ UInt timestamp; CACHE_Y(B); - timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[PREG->u.OtaLl.s]); - if (!VALID_TIMESTAMP(timestamp, PREG->u.OtaLl.d)) { + 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->u.OtaLl.n; + PREG=PREG->y_u.OtaLl.n; JMPNext(); } - restore_yaam_regs(PREG->u.OtaLl.n); - restore_args(PREG->u.OtaLl.s); + restore_yaam_regs(PREG->y_u.OtaLl.n); + restore_args(PREG->y_u.OtaLl.s); LOCAL_RetriesCounter--; if (LOCAL_RetriesCounter == 0) { saveregs(); @@ -514,13 +514,13 @@ setregs(); JMPNext(); } - LOCK(PREG->u.OtaLl.d->ClPred->StatisticsForPred.lock); - PREG->u.OtaLl.d->ClPred->StatisticsForPred.NOfRetries++; - UNLOCK(PREG->u.OtaLl.d->ClPred->StatisticsForPred.lock); + 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->u.OtaLl.d->ClPred; + PP = PREG->y_u.OtaLl.d->ClPred; #endif - PREG = PREG->u.OtaLl.d->ClCode; + 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); @@ -538,9 +538,9 @@ EMIT_SIMPLE_BLOCK(COUNT_TRUST_LOGICAL_END); CACHE_Y(B); { - LogUpdIndex *cl = PREG->u.OtILl.block; + LogUpdIndex *cl = PREG->y_u.OtILl.block; PredEntry *ap = cl->ClPred; - LogUpdClause *lcl = PREG->u.OtILl.d; + LogUpdClause *lcl = PREG->y_u.OtILl.d; UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]); if (!VALID_TIMESTAMP(timestamp, lcl)) { @@ -674,7 +674,7 @@ if (PP) { GONext(); } - PP = PREG->u.p.p; + PP = PREG->y_u.p.p; PELOCK(3, PP); #endif PREG = NEXTOP(PREG, p); @@ -706,7 +706,7 @@ #if MULTIPLE_STACKS { EMIT_SIMPLE_BLOCK(ALLOC_FOR_LOGICAL_PRED_MULTIPLE_STACKS); - LogUpdClause *cl = PREG->u.L.ClBase; + LogUpdClause *cl = PREG->y_u.L.ClBase; #if PARALLEL_YAP EMIT_SIMPLE_BLOCK(ALLOC_FOR_LOGICAL_PRED_MULTIPLE_STACKS_PARALLEL); PredEntry *ap = cl->ClPred; @@ -721,7 +721,7 @@ #else { EMIT_SIMPLE_BLOCK(ALLOC_FOR_LOGICAL_PRED_NOMULTIPLE_STACKS_INIT); - LogUpdClause *cl = (LogUpdClause *)PREG->u.L.ClBase; + LogUpdClause *cl = (LogUpdClause *)PREG->y_u.L.ClBase; EMIT_SIMPLE_BLOCK(ALLOC_FOR_LOGICAL_PRED_NOMULTIPLE_STACKS_IF); if (!(cl->ClFlags & InUseMask)) { cl->ClFlags |= InUseMask; @@ -744,7 +744,7 @@ SET_ASP(YREG, E_CB*sizeof(CELL)); saveregs(); - while ((t = Yap_FetchTermFromDB(cl->ClSource)) == 0L) { + while ((t = Yap_FetchTermFromDB(cl->lusl.ClSource)) == 0L) { if (LOCAL_Error_TYPE == OUT_OF_ATTVARS_ERROR) { LOCAL_Error_TYPE = YAP_NO_ERROR; if (!Yap_growglobal(NULL)) { @@ -793,10 +793,10 @@ PP = NULL; #else if (!(cl->ClFlags & InUseMask)) { - /* Clause *cl = (Clause *)PREG->u.EC.ClBase; + /* Clause *cl = (Clause *)PREG->y_u.EC.ClBase; - PREG->u.EC.ClTrail = TR-(tr_fr_ptr)LOCAL_TrailBase; - PREG->u.EC.ClENV = LCL0-YREG;*/ + PREG->y_u.EC.ClTrail = TR-(tr_fr_ptr)LOCAL_TrailBase; + PREG->y_u.EC.ClENV = LCL0-YREG;*/ cl->ClFlags |= InUseMask; TRAIL_CLREF(cl); } @@ -819,7 +819,7 @@ LogUpdClause *cl = ClauseCodeToLogUpdClause(PREG); saveregs(); - if (!Yap_IUnify(ARG2, cl->ClSource->Entry)) { + if (!Yap_IUnify(ARG2, cl->lusl.ClSource->Entry)) { setregs(); UNLOCKPE(8,PP); #if defined(YAPOR) || defined(THREADS) @@ -847,10 +847,10 @@ PP = NULL; #else if (!(cl->ClFlags & InUseMask)) { - /* Clause *cl = (Clause *)PREG->u.EC.ClBase; + /* Clause *cl = (Clause *)PREG->y_u.EC.ClBase; - PREG->u.EC.ClTrail = TR-(tr_fr_ptr)LOCAL_TrailBase; - PREG->u.EC.ClENV = LCL0-YREG;*/ + PREG->y_u.EC.ClTrail = TR-(tr_fr_ptr)LOCAL_TrailBase; + PREG->y_u.EC.ClENV = LCL0-YREG;*/ cl->ClFlags |= InUseMask; TRAIL_CLREF(cl); } @@ -874,15 +874,15 @@ EMIT_ENTRY_BLOCK(PREG,ENSURE_SPACE_INSTINIT); EMIT_SIMPLE_BLOCK(ENSURE_SPACE_END); { - Int sz = PREG->u.Osbpa.i; - UInt arity = PREG->u.Osbpa.p->ArityOfPE; + Int sz = PREG->y_u.Osbpa.i; + UInt arity = PREG->y_u.Osbpa.p->ArityOfPE; if (Unsigned(HR) + sz > Unsigned(YREG)-CreepFlag) { YENV[E_CP] = (CELL) CPREG; YENV[E_E] = (CELL) ENV; #ifdef DEPTH_LIMIT YENV[E_DEPTH] = DEPTH; #endif /* DEPTH_LIMIT */ - SET_ASP(YREG, PREG->u.Osbpa.s); + SET_ASP(YREG, PREG->y_u.Osbpa.s); PREG = NEXTOP(PREG,Osbpa); saveregs(); if (!Yap_gcl(sz, arity, YENV, PREG)) { @@ -906,9 +906,9 @@ /* spy_or_trymark */ BOp(traced_spy_or_trymark, Otapl); EMIT_ENTRY_BLOCK(PREG,SPY_OR_TRYMARK_INSTINIT); - PELOCK(5, ((PredEntry *)(PREG->u.Otapl.p))); - PREG = (yamop *)(&(((PredEntry *)(PREG->u.Otapl.p))->OpcodeOfPred)); - UNLOCKPE(11,(PredEntry *)(PREG->u.Otapl.p)); + 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)); goto traced_dospy; ENDBOp(); @@ -923,17 +923,17 @@ CUT_wait_leftmost(); #endif /* YAPOR */ EMIT_SIMPLE_BLOCK(TRY_AND_MARK_YAPOR_THREADS_NOYAPOR_IF); - if (PREG->u.Otapl.p->PredFlags & LogUpdatePredFlag) { - PELOCK(6,PREG->u.Otapl.p); - PP = PREG->u.Otapl.p; + 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->CodeOfPred != PREG) { + if (PREG->y_u.Otapl.p->CodeOfPred != PREG) { /* oops, someone changed the procedure under our feet, fortunately this is no big deal because we haven't done anything yet */ PP = NULL; - PREG = PREG->u.Otapl.p->CodeOfPred; - UNLOCKPE(12,PREG->u.Otapl.p); + PREG = PREG->y_u.Otapl.p->CodeOfPred; + UNLOCKPE(12,PREG->y_u.Otapl.p); /* for profiler */ save_pc(); JMPNext(); @@ -941,16 +941,16 @@ #endif EMIT_SIMPLE_BLOCK(TRY_AND_MARK_NOYAPOR_NOTHREADS); CACHE_Y(YREG); - PREG = PREG->u.Otapl.d; + PREG = PREG->y_u.Otapl.d; /* I've got a read lock on the DB, so I don't need to care... niaaahh.... niahhhh... */ LOCK(DynamicLock(PREG)); /* one can now mess around with the predicate */ - UNLOCKPE(13,((PredEntry *)(PREG->u.Otapl.p))); + UNLOCKPE(13,((PredEntry *)(PREG->y_u.Otapl.p))); BEGD(d1); - d1 = PREG->u.Otapl.s; + d1 = PREG->y_u.Otapl.s; store_args(d1); store_yaam_regs(PREG, 0); ENDD(d1); @@ -1002,9 +1002,9 @@ BOp(traced_profiled_retry_and_mark, Otapl); EMIT_ENTRY_BLOCK(PREG,PROFILED_RETRY_AND_MARK_INSTINIT); - LOCK(((PredEntry *)(PREG->u.Otapl.p))->StatisticsForPred.lock); - ((PredEntry *)(PREG->u.Otapl.p))->StatisticsForPred.NOfRetries++; - UNLOCK(((PredEntry *)(PREG->u.Otapl.p))->StatisticsForPred.lock); + 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); /* enter a retry dynamic */ ENDBOp(); @@ -1017,13 +1017,13 @@ #endif /* YAPOR */ /* need to make the DB stable until I get the new clause */ EMIT_SIMPLE_BLOCK(RETRY_AND_MARK_POST_YAPOR); - PELOCK(7,PREG->u.Otapl.p); + PELOCK(7,PREG->y_u.Otapl.p); CACHE_Y(B); - PREG = PREG->u.Otapl.d; + PREG = PREG->y_u.Otapl.d; LOCK(DynamicLock(PREG)); - UNLOCK(PREG->u.Otapl.p->PELock); + UNLOCK(PREG->y_u.Otapl.p->PELock); restore_yaam_regs(PREG); - restore_args(PREG->u.Otapl.s); + restore_args(PREG->y_u.Otapl.s); #ifdef FROZEN_STACKS EMIT_SIMPLE_BLOCK(RETRY_AND_MARK_FROZEN); S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG); @@ -1207,26 +1207,26 @@ case _retry3: case _retry4: { - ipc = NEXTOP(traced_ipc,l); + ipc = NEXTOP(ipc,l); go_on = TRUE; break; } case _jump: { - ipc = ipc->u.l.l; + ipc = ipc->y_u.l.l; go_on = TRUE; break; } case _retry_c: case _retry_userc: { - low_level_trace(retry_pred, ipc->u.OtapFs.p, B->cp_args); + low_level_trace(retry_pred, ipc->y_u.OtapFs.p, B->cp_args); break; } case _retry_profiled: case _count_retry: { - ipc = NEXTOP(traced_ipc,p); + ipc = NEXTOP(ipc,p); go_on = TRUE; break; } @@ -1241,7 +1241,7 @@ case _retry: case _trust: { - low_level_trace(retry_pred, ipc->u.Otapl.p, B->cp_args); + low_level_trace(retry_pred, ipc->y_u.Otapl.p, B->cp_args); break; } case _try_logical: @@ -1252,7 +1252,7 @@ case _profiled_trust_logical: case _count_trust_logical: { - low_level_trace(retry_pred, ipc->u.OtILl.d->ClPred, B->cp_args); + low_level_trace(retry_pred, ipc->y_u.OtILl.d->ClPred, B->cp_args); break; } case _Nstop: @@ -1330,7 +1330,7 @@ goto traced_failloop; } else #endif /* FROZEN_STACKS */ - if (IN_BETWEEN(H0,pt1,H)) { + if (IN_BETWEEN(H0,pt1,HR)) { if (IsAttVar(pt1)) { goto traced_failloop; } else if (*pt1 == (CELL)FunctorBigInt) { @@ -1463,7 +1463,7 @@ \************************************************************************/ /* cut */ - Op(traced_cut, s); +Op(traced_cut, s); EMIT_ENTRY_BLOCK(PREG,CUT_INSTINIT); #ifdef COROUTINING EMIT_SIMPLE_BLOCK_TEST(CUT_COROUTINING); @@ -1475,7 +1475,7 @@ } #endif EMIT_SIMPLE_BLOCK_TEST(CUT_NOCOROUTINING); - SET_ASP(YREG, PREG->u.s.s); + SET_ASP(YREG, PREG->y_u.s.s); PREG = NEXTOP(NEXTOP(NEXTOP(PREG, s),Osbpp),l); /* assume cut is always in stack */ saveregs(); @@ -1498,7 +1498,7 @@ } #endif EMIT_SIMPLE_BLOCK_TEST(CUT_T_NOCOROUTINING); - SET_ASP(YREG, PREG->u.s.s); + SET_ASP(YREG, PREG->y_u.s.s); /* assume cut is always in stack */ saveregs(); prune((choiceptr)YREG[E_CB]); @@ -1520,7 +1520,7 @@ } #endif EMIT_SIMPLE_BLOCK_TEST(CUT_E_NOCOROUTINING); - SET_ASP(YREG, PREG->u.s.s); + SET_ASP(YREG, PREG->y_u.s.s); PREG = NEXTOP(NEXTOP(NEXTOP(PREG, s),Osbpp),l); saveregs(); prune((choiceptr)SREG[E_CB]); @@ -1532,7 +1532,7 @@ Op(traced_save_b_x, x); EMIT_ENTRY_BLOCK(PREG,SAVE_B_X_INSTINIT); BEGD(d0); - d0 = PREG->u.x.x; + d0 = PREG->y_u.x.x; #if defined(YAPOR_SBA) && defined(FROZEN_STACKS) EMIT_SIMPLE_BLOCK_TEST(SAVE_B_X_YSBA_FROZEN); XREG(d0) = MkIntegerTerm((Int)B); @@ -1551,10 +1551,10 @@ EMIT_ENTRY_BLOCK(PREG,SAVE_B_Y_INSTINIT); #if defined(YAPOR_SBA) EMIT_SIMPLE_BLOCK_TEST(SAVE_B_Y_YSBA); - INITIALIZE_PERMVAR(YREG+PREG->u.y.y,MkIntegerTerm((Int)B)); + INITIALIZE_PERMVAR(YREG+PREG->y_u.y.y,MkIntegerTerm((Int)B)); #else EMIT_SIMPLE_BLOCK_TEST(SAVE_B_Y_NOYSBA); - INITIALIZE_PERMVAR(YREG+PREG->u.y.y,MkIntegerTerm(LCL0-(CELL *)(B))); + INITIALIZE_PERMVAR(YREG+PREG->y_u.y.y,MkIntegerTerm(LCL0-(CELL *)(B))); #endif /* YAPOR_SBA*/ EMIT_SIMPLE_BLOCK_TEST(SAVE_B_Y_END); PREG = NEXTOP(PREG, y); @@ -1572,12 +1572,12 @@ #endif EMIT_SIMPLE_BLOCK_TEST(COMMIT_B_X_DO_COMMIT_B_X); BEGD(d0); - d0 = XREG(PREG->u.xps.x); + d0 = XREG(PREG->y_u.xps.x); profiled_deref_head_TEST(d0, traced_commit_b_x_unk); traced_commit_b_x_nvar: /* skip a void call and a label */ EMIT_SIMPLE_BLOCK_TEST(COMMIT_B_X_COMMIT_B_X_NVAR); - SET_ASP(YREG, PREG->u.xps.s); + SET_ASP(YREG, PREG->y_u.xps.s); PREG = NEXTOP(NEXTOP(NEXTOP(PREG, xps),Osbpp),l); { choiceptr pt0; @@ -1616,11 +1616,11 @@ #endif EMIT_SIMPLE_BLOCK_TEST(COMMIT_B_Y_DO_COMMIT_B_Y); BEGD(d0); - d0 = YREG[PREG->u.yps.y]; + d0 = YREG[PREG->y_u.yps.y]; profiled_deref_head_TEST(d0, traced_commit_b_y_unk); traced_commit_b_y_nvar: EMIT_SIMPLE_BLOCK_TEST(COMMIT_B_Y_COMMIT_B_Y_NVAR); - SET_ASP(YREG, PREG->u.yps.s); + SET_ASP(YREG, PREG->y_u.yps.s); PREG = NEXTOP(NEXTOP(NEXTOP(PREG, yps),Osbpp),l); { choiceptr pt0; @@ -1660,7 +1660,7 @@ EMIT_ENTRY_BLOCK(PREG,EXECUTE_INSTINIT); PredEntry *pt0; CACHE_Y_AS_ENV(YREG); - pt0 = PREG->u.pp.p; + pt0 = PREG->y_u.pp.p; #ifdef LOW_LEVEL_TRACER if (Yap_do_low_level_trace) { EMIT_SIMPLE_BLOCK_TEST(EXECUTE_LOW_LEVEL_TRACER); @@ -1716,8 +1716,8 @@ /*NoStackExecute: CHECK_ALARM(JMPNext()); - SREG = (CELL *) PREG->u.pp.p; - PP = PREG->u.pp.p0; + SREG = (CELL *) PREG->y_u.pp.p; + PP = PREG->y_u.pp.p0; if (LOCAL_ActiveSignals & YAP_CDOVF_SIGNAL) { SET_ASP(YREG, E_CB*sizeof(CELL)); SREG = YENV; @@ -1735,7 +1735,7 @@ #ifdef LOW_LEVEL_TRACER if (Yap_do_low_level_trace) { EMIT_SIMPLE_BLOCK_TEST(DEXECUTE_LOW_LEVEL_TRACER); - low_level_trace(enter_pred,PREG->u.pp.p,XREGS+1); + low_level_trace(enter_pred,PREG->y_u.pp.p,XREGS+1); } #endif /* LOW_LEVEL_TRACER */ EMIT_SIMPLE_BLOCK_TEST(DEXECUTE_POST_LOW_LEVEL_TRACER); @@ -1744,7 +1744,7 @@ PredEntry *pt0; CACHE_A1(); - pt0 = PREG->u.pp.p; + pt0 = PREG->y_u.pp.p; #ifndef NO_CHECKING /* check stacks */ EMIT_SIMPLE_BLOCK_TEST(NoStackDExecute_Exception); @@ -1830,14 +1830,14 @@ #ifdef LOW_LEVEL_TRACER if (Yap_do_low_level_trace) { EMIT_SIMPLE_BLOCK_TEST(CALL_LOW_LEVEL_TRACER); - low_level_trace(enter_pred,PREG->u.Osbpp.p,XREGS+1); + low_level_trace(enter_pred,PREG->y_u.Osbpp.p,XREGS+1); } #endif /* LOW_LEVEL_TRACER */ EMIT_SIMPLE_BLOCK_TEST(CALL_POST_LOW_LEVEL_TRACER); CACHE_Y_AS_ENV(YREG); { PredEntry *pt; - pt = PREG->u.Osbpp.p; + pt = PREG->y_u.Osbpp.p; CACHE_A1(); #ifndef NO_CHECKING EMIT_SIMPLE_BLOCK_TEST(NoStackCall_Exception); @@ -1846,7 +1846,7 @@ EMIT_SIMPLE_BLOCK_TEST(CALL_POST_NO_CHECKING); ENV = ENV_YREG; /* Try to preserve the environment */ - ENV_YREG = (CELL *) (((char *) ENV_YREG) + PREG->u.Osbpp.s); + ENV_YREG = (CELL *) (((char *) ENV_YREG) + PREG->y_u.Osbpp.s); CPREG = NEXTOP(PREG, Osbpp); ALWAYS_LOOKAHEAD(pt->OpcodeOfPred); PREG = pt->CodeOfPred; @@ -1993,107 +1993,17 @@ * OPTYap instructions * **********************************************/ -#ifdef YAPOR - traced_getwork_first_time: - traced_getwork: - traced_getwork_seq: - traced_sync: -#endif /* YAPOR */ -#ifdef TABLING -#ifdef TABLING_INNER_CUTS - traced_clause_with_cut: -#endif - traced_table_load_answer: - traced_table_try_answer: - traced_table_try_single: - traced_table_try_me: - traced_table_try: - traced_table_retry_me: - traced_table_retry: - traced_table_trust_me: - traced_table_trust: - traced_table_new_answer: - traced_table_answer_resolution: - traced_table_completion: -#ifdef THREADS_CONSUMER_SHARING - traced_table_answer_resolution_completion: -#endif - traced_trie_do_var: - traced_trie_trust_var: - traced_trie_try_var: - traced_trie_retry_var: - traced_trie_do_var_in_pair: - traced_trie_trust_var_in_pair: - traced_trie_try_var_in_pair: - traced_trie_retry_var_in_pair: - traced_trie_do_val: - traced_trie_trust_val: - traced_trie_try_val: - traced_trie_retry_val: - traced_trie_do_val_in_pair: - traced_trie_trust_val_in_pair: - traced_trie_try_val_in_pair: - traced_trie_retry_val_in_pair: - traced_trie_do_atom: - traced_trie_trust_atom: - traced_trie_try_atom: - traced_trie_retry_atom: - traced_trie_do_atom_in_pair: - traced_trie_trust_atom_in_pair: - traced_trie_try_atom_in_pair: - traced_trie_retry_atom_in_pair: - traced_trie_do_null: - traced_trie_trust_null: - traced_trie_try_null: - traced_trie_retry_null: - traced_trie_do_null_in_pair: - traced_trie_trust_null_in_pair: - traced_trie_try_null_in_pair: - traced_trie_retry_null_in_pair: - traced_trie_do_pair: - traced_trie_trust_pair: - traced_trie_try_pair: - traced_trie_retry_pair: - traced_trie_do_appl: - traced_trie_trust_appl: - traced_trie_try_appl: - traced_trie_retry_appl: - traced_trie_do_appl_in_pair: - traced_trie_trust_appl_in_pair: - traced_trie_try_appl_in_pair: - traced_trie_retry_appl_in_pair: - traced_trie_do_extension: - traced_trie_trust_extension: - traced_trie_try_extension: - traced_trie_retry_extension: - traced_trie_do_double: - traced_trie_trust_double: - traced_trie_try_double: - traced_trie_retry_double: - traced_trie_do_longint: - traced_trie_trust_longint: - traced_trie_try_longint: - traced_trie_retry_longint: - traced_trie_do_gterm: - traced_trie_trust_gterm: - traced_trie_try_gterm: - traced_trie_retry_gterm: - { printf("Não era pra chegar aqui!!\n"); exit(1); } -#endif /* TABLING */ - -#ifdef BEAM - extern int eam_am(PredEntry *); - Op(traced_retry_eam, e); - goto retry_eam; + //goto retry_eam; +{ printf("EAM not supported by JIT!!\n"); exit(1); } ENDOp(); Op(traced_run_eam, os); - goto run_eam; +{ printf("EAM not supported by JIT!!\n"); exit(1); } + //goto run_eam; ENDOp(); -#endif /************************************************************************\ * Get Instructions * @@ -2102,8 +2012,8 @@ Op(traced_get_x_var, xx); EMIT_ENTRY_BLOCK(PREG,GET_X_VAR_INSTINIT); BEGD(d0); - d0 = XREG(PREG->u.xx.xr); - XREG(PREG->u.xx.xl) = d0; + d0 = XREG(PREG->y_u.xx.xr); + XREG(PREG->y_u.xx.xl) = d0; PREG = NEXTOP(PREG, xx); ENDD(d0); GONext(); @@ -2113,8 +2023,8 @@ EMIT_ENTRY_BLOCK(PREG,GET_Y_VAR_INSTINIT); BEGD(d0); BEGP(pt0); - pt0 = YREG + PREG->u.yx.y; - d0 = XREG(PREG->u.yx.x); + pt0 = YREG + PREG->y_u.yx.y; + d0 = XREG(PREG->y_u.yx.x); PREG = NEXTOP(PREG, yx); INITIALIZE_PERMVAR(pt0,d0); GONext(); @@ -2127,12 +2037,12 @@ CACHE_Y(YREG); BEGD(d0); BEGP(pt0); - pt0 = S_YREG + PREG->u.yyxx.y1; - d0 = XREG(PREG->u.yyxx.x1); + pt0 = S_YREG + PREG->y_u.yyxx.y1; + d0 = XREG(PREG->y_u.yyxx.x1); BEGD(d1); BEGP(pt1); - pt1 = S_YREG + PREG->u.yyx.y2; - d1 = XREG(PREG->u.yyxx.x2); + pt1 = S_YREG + PREG->y_u.yyx.y2; + d1 = XREG(PREG->y_u.yyxx.x2); PREG = NEXTOP(PREG, yyxx); INITIALIZE_PERMVAR(pt0,d0); INITIALIZE_PERMVAR(pt1,d1); @@ -2151,7 +2061,7 @@ Op(traced_get_x_val, xx); EMIT_ENTRY_BLOCK(PREG,GET_X_VAL_INSTINIT); BEGD(d0); - d0 = XREG(PREG->u.xx.xl); + d0 = XREG(PREG->y_u.xx.xl); profiled_deref_head_TEST(d0, traced_gvalx_unk); /* d0 will keep the first argument */ @@ -2159,7 +2069,7 @@ /* first argument is bound */ EMIT_SIMPLE_BLOCK_TEST(GET_X_VAL_GVALX_NONVAR); BEGD(d1); - d1 = XREG(PREG->u.xx.xr); + d1 = XREG(PREG->y_u.xx.xr); profiled_deref_head_TEST(d1, traced_gvalx_nonvar_unk); traced_gvalx_nonvar_nonvar: @@ -2175,7 +2085,7 @@ /* first argument bound, second unbound */ EMIT_MULTIPLE_DESTINY_BLOCK_TEST(GET_X_VAL_GVALX_NONVAR_UNK); PREG = NEXTOP(PREG, xx); - Bind(pt0, d0); +Bind(pt0, d0); GONext(); ENDP(pt0); @@ -2187,7 +2097,7 @@ /* first argument is unbound and in pt0 and in d0 */ EMIT_SIMPLE_BLOCK_TEST(GET_X_VAL_GVALX_UNK); BEGD(d1); - d1 = XREG(PREG->u.xx.xr); + d1 = XREG(PREG->y_u.xx.xr); profiled_deref_head_TEST(d1, traced_gvalx_var_unk); traced_gvalx_var_nonvar: @@ -2218,7 +2128,7 @@ BEGD(d0); BEGD(d1); BEGP(pt0); - pt0 = YREG + PREG->u.yx.y; + pt0 = YREG + PREG->y_u.yx.y; d0 = *pt0; /* From now on, it's just a copy of the code for get_x_val */ @@ -2227,7 +2137,7 @@ /* first argument is bound */ EMIT_SIMPLE_BLOCK_TEST(GET_Y_VAL_GVALY_NONVAR); - d1 = XREG(PREG->u.yx.x); + d1 = XREG(PREG->y_u.yx.x); profiled_deref_head_TEST(d1, traced_gvaly_nonvar_unk); traced_gvaly_nonvar_nonvar: @@ -2251,7 +2161,7 @@ profiled_derefa_body(d0, pt0, traced_gvaly_unk, traced_gvaly_nonvar); /* first argument is unbound */ EMIT_SIMPLE_BLOCK_TEST(GET_Y_VAL_GVALY_UNK); - d1 = XREG(PREG->u.yx.x); + d1 = XREG(PREG->y_u.yx.x); profiled_deref_head_TEST(d1, traced_gvaly_var_unk); traced_gvaly_var_nonvar: /* first unbound, second bound */ @@ -2278,8 +2188,8 @@ BEGD(d0); BEGD(d1); /* fetch arguments */ - d0 = XREG(PREG->u.xc.x); - d1 = PREG->u.xc.c; + d0 = XREG(PREG->y_u.xc.x); + d1 = PREG->y_u.xc.c; BEGP(pt0); profiled_deref_head_TEST(d0, traced_gatom_unk); @@ -2316,7 +2226,7 @@ profiled_deref_head_TEST(d0, traced_gatom_2unk); /* argument is nonvar */ traced_gatom_2nonvar: - if (d0 == PREG->u.cc.c1) { + if (d0 == PREG->y_u.cc.c1) { goto traced_gatom_2b; } else { @@ -2325,13 +2235,13 @@ profiled_deref_body(d0, pt0, traced_gatom_2unk, traced_gatom_2nonvar); EMIT_SIMPLE_BLOCK_TEST(GET_2ATOMS_GATOM_2UNK); - Bind(pt0, PREG->u.cc.c1); + Bind(pt0, PREG->y_u.cc.c1); ENDP(pt0); traced_gatom_2b: /* fetch arguments */ EMIT_SIMPLE_BLOCK_TEST(GET_2ATOMS_GATOM_2B); d0 = ARG2; - d1 = PREG->u.cc.c2; + d1 = PREG->y_u.cc.c2; BEGP(pt0); profiled_deref_head_TEST(d0, traced_gatom_2bunk); @@ -2368,7 +2278,7 @@ profiled_deref_head_TEST(d0, traced_gatom_3unk); /* argument is nonvar */ traced_gatom_3nonvar: - if (d0 == PREG->u.ccc.c1) { + if (d0 == PREG->y_u.ccc.c1) { goto traced_gatom_3b; } else { @@ -2378,7 +2288,7 @@ profiled_deref_body(d0, pt0, traced_gatom_3unk, traced_gatom_3nonvar); /* argument is a variable */ EMIT_SIMPLE_BLOCK_TEST(GET_3ATOMS_GATOM_3UNK); - Bind(pt0, PREG->u.ccc.c1); + Bind(pt0, PREG->y_u.ccc.c1); ENDP(pt0); traced_gatom_3b: /* fetch arguments */ @@ -2389,7 +2299,7 @@ profiled_deref_head_TEST(d0, traced_gatom_3bunk); /* argument is nonvar */ traced_gatom_3bnonvar: - if (d0 == PREG->u.ccc.c2) { + if (d0 == PREG->y_u.ccc.c2) { goto traced_gatom_3c; } else { @@ -2399,13 +2309,13 @@ profiled_deref_body(d0, pt0, traced_gatom_3bunk, traced_gatom_3bnonvar); /* argument is a variable */ EMIT_SIMPLE_BLOCK_TEST(GET_3ATOMS_GATOM_3BUNK); - Bind(pt0, PREG->u.ccc.c2); + Bind(pt0, PREG->y_u.ccc.c2); ENDP(pt0); traced_gatom_3c: /* fetch arguments */ EMIT_SIMPLE_BLOCK_TEST(GET_3ATOMS_GATOM_3C); d0 = ARG3; - d1 = PREG->u.ccc.c3; + d1 = PREG->y_u.ccc.c3; BEGP(pt0); profiled_deref_head_TEST(d0, traced_gatom_3cunk); @@ -2442,7 +2352,7 @@ profiled_deref_head_TEST(d0, traced_gatom_4unk); /* argument is nonvar */ traced_gatom_4nonvar: - if (d0 == PREG->u.cccc.c1) { + if (d0 == PREG->y_u.cccc.c1) { goto traced_gatom_4b; } else { @@ -2452,7 +2362,7 @@ profiled_deref_body(d0, pt0, traced_gatom_4unk, traced_gatom_4nonvar); /* argument is a variable */ EMIT_SIMPLE_BLOCK_TEST(GET_4ATOMS_GATOM_4UNK); - Bind(pt0, PREG->u.cccc.c1); + Bind(pt0, PREG->y_u.cccc.c1); ENDP(pt0); traced_gatom_4b: /* fetch arguments */ @@ -2463,7 +2373,7 @@ profiled_deref_head_TEST(d0, traced_gatom_4bunk); /* argument is nonvar */ traced_gatom_4bnonvar: - if (d0 == PREG->u.cccc.c2) { + if (d0 == PREG->y_u.cccc.c2) { goto traced_gatom_4c; } else { @@ -2473,7 +2383,7 @@ profiled_deref_body(d0, pt0, traced_gatom_4bunk, traced_gatom_4bnonvar); /* argument is a variable */ EMIT_SIMPLE_BLOCK_TEST(GET_4ATOMS_GATOM_4BUNK); - Bind(pt0, PREG->u.cccc.c2); + Bind(pt0, PREG->y_u.cccc.c2); ENDP(pt0); traced_gatom_4c: /* fetch arguments */ @@ -2484,7 +2394,7 @@ profiled_deref_head_TEST(d0, traced_gatom_4cunk); /* argument is nonvar */ traced_gatom_4cnonvar: - if (d0 == PREG->u.cccc.c3) { + if (d0 == PREG->y_u.cccc.c3) { goto traced_gatom_4d; } else { @@ -2494,13 +2404,13 @@ profiled_deref_body(d0, pt0, traced_gatom_4cunk, traced_gatom_4cnonvar); /* argument is a variable */ EMIT_SIMPLE_BLOCK_TEST(GET_4ATOMS_GATOM_4CUNK); - Bind(pt0, PREG->u.cccc.c3); + Bind(pt0, PREG->y_u.cccc.c3); ENDP(pt0); traced_gatom_4d: /* fetch arguments */ EMIT_SIMPLE_BLOCK_TEST(GET_4ATOMS_GATOM_4D); d0 = ARG4; - d1 = PREG->u.cccc.c4; + d1 = PREG->y_u.cccc.c4; BEGP(pt0); profiled_deref_head_TEST(d0, traced_gatom_4dunk); @@ -2537,7 +2447,7 @@ profiled_deref_head_TEST(d0, traced_gatom_5unk); /* argument is nonvar */ traced_gatom_5nonvar: - if (d0 == PREG->u.ccccc.c1) { + if (d0 == PREG->y_u.ccccc.c1) { goto traced_gatom_5b; } else { @@ -2547,7 +2457,7 @@ profiled_deref_body(d0, pt0, traced_gatom_5unk, traced_gatom_5nonvar); /* argument is a variable */ EMIT_SIMPLE_BLOCK_TEST(GET_5ATOMS_GATOM_5UNK); - Bind(pt0, PREG->u.ccccc.c1); + Bind(pt0, PREG->y_u.ccccc.c1); ENDP(pt0); traced_gatom_5b: /* fetch arguments */ @@ -2558,7 +2468,7 @@ profiled_deref_head_TEST(d0, traced_gatom_5bunk); /* argument is nonvar */ traced_gatom_5bnonvar: - if (d0 == PREG->u.ccccc.c2) { + if (d0 == PREG->y_u.ccccc.c2) { goto traced_gatom_5c; } else { @@ -2568,7 +2478,7 @@ profiled_deref_body(d0, pt0, traced_gatom_5bunk, traced_gatom_5bnonvar); /* argument is a variable */ EMIT_SIMPLE_BLOCK_TEST(GET_5ATOMS_GATOM_5BUNK); - Bind(pt0, PREG->u.ccccc.c2); + Bind(pt0, PREG->y_u.ccccc.c2); ENDP(pt0); traced_gatom_5c: /* fetch arguments */ @@ -2579,7 +2489,7 @@ profiled_deref_head_TEST(d0, traced_gatom_5cunk); /* argument is nonvar */ traced_gatom_5cnonvar: - if (d0 == PREG->u.ccccc.c3) { + if (d0 == PREG->y_u.ccccc.c3) { goto traced_gatom_5d; } else { @@ -2589,7 +2499,7 @@ profiled_deref_body(d0, pt0, traced_gatom_5cunk, traced_gatom_5cnonvar); /* argument is a variable */ EMIT_SIMPLE_BLOCK_TEST(GET_5ATOMS_GATOM_5CUNK); - Bind(pt0, PREG->u.ccccc.c3); + Bind(pt0, PREG->y_u.ccccc.c3); ENDP(pt0); traced_gatom_5d: /* fetch arguments */ @@ -2600,7 +2510,7 @@ profiled_deref_head_TEST(d0, traced_gatom_5dunk); /* argument is nonvar */ traced_gatom_5dnonvar: - if (d0 == PREG->u.ccccc.c4) { + if (d0 == PREG->y_u.ccccc.c4) { goto traced_gatom_5e; } else { @@ -2610,13 +2520,13 @@ profiled_deref_body(d0, pt0, traced_gatom_5dunk, traced_gatom_5dnonvar); /* argument is a variable */ EMIT_SIMPLE_BLOCK_TEST(GET_5ATOMS_GATOM_5DUNK); - Bind(pt0, PREG->u.ccccc.c4); + Bind(pt0, PREG->y_u.ccccc.c4); ENDP(pt0); traced_gatom_5e: /* fetch arguments */ EMIT_SIMPLE_BLOCK_TEST(GET_5ATOMS_GATOM_5E); d0 = ARG5; - d1 = PREG->u.ccccc.c5; + d1 = PREG->y_u.ccccc.c5; BEGP(pt0); profiled_deref_head_TEST(d0, traced_gatom_5eunk); @@ -2653,7 +2563,7 @@ profiled_deref_head_TEST(d0, traced_gatom_6unk); /* argument is nonvar */ traced_gatom_6nonvar: - if (d0 == PREG->u.cccccc.c1) { + if (d0 == PREG->y_u.cccccc.c1) { goto traced_gatom_6b; } else { @@ -2663,7 +2573,7 @@ profiled_deref_body(d0, pt0, traced_gatom_6unk, traced_gatom_6nonvar); /* argument is a variable */ EMIT_SIMPLE_BLOCK_TEST(GET_6ATOMS_GATOM_6UNK); - Bind(pt0, PREG->u.cccccc.c1); + Bind(pt0, PREG->y_u.cccccc.c1); ENDP(pt0); traced_gatom_6b: /* fetch arguments */ @@ -2674,7 +2584,7 @@ profiled_deref_head_TEST(d0, traced_gatom_6bunk); /* argument is nonvar */ traced_gatom_6bnonvar: - if (d0 == PREG->u.cccccc.c2) { + if (d0 == PREG->y_u.cccccc.c2) { goto traced_gatom_6c; } else { @@ -2684,7 +2594,7 @@ profiled_deref_body(d0, pt0, traced_gatom_6bunk, traced_gatom_6bnonvar); /* argument is a variable */ EMIT_SIMPLE_BLOCK_TEST(GET_6ATOMS_GATOM_6BUNK); - Bind(pt0, PREG->u.cccccc.c2); + Bind(pt0, PREG->y_u.cccccc.c2); ENDP(pt0); traced_gatom_6c: /* fetch arguments */ @@ -2695,7 +2605,7 @@ profiled_deref_head_TEST(d0, traced_gatom_6cunk); /* argument is nonvar */ traced_gatom_6cnonvar: - if (d0 == PREG->u.cccccc.c3) { + if (d0 == PREG->y_u.cccccc.c3) { goto traced_gatom_6d; } else { @@ -2705,7 +2615,7 @@ profiled_deref_body(d0, pt0, traced_gatom_6cunk, traced_gatom_6cnonvar); /* argument is a variable */ EMIT_SIMPLE_BLOCK_TEST(GET_6ATOMS_GATOM_6CUNK); - Bind(pt0, PREG->u.cccccc.c3); + Bind(pt0, PREG->y_u.cccccc.c3); ENDP(pt0); traced_gatom_6d: /* fetch arguments */ @@ -2716,7 +2626,7 @@ profiled_deref_head_TEST(d0, traced_gatom_6dunk); /* argument is nonvar */ traced_gatom_6dnonvar: - if (d0 == PREG->u.cccccc.c4) { + if (d0 == PREG->y_u.cccccc.c4) { goto traced_gatom_6e; } else { @@ -2726,7 +2636,7 @@ profiled_deref_body(d0, pt0, traced_gatom_6dunk, traced_gatom_6dnonvar); /* argument is a variable */ EMIT_SIMPLE_BLOCK_TEST(GET_6ATOMS_GATOM_6DUNK); - Bind(pt0, PREG->u.cccccc.c4); + Bind(pt0, PREG->y_u.cccccc.c4); ENDP(pt0); traced_gatom_6e: /* fetch arguments */ @@ -2737,7 +2647,7 @@ profiled_deref_head_TEST(d0, traced_gatom_6eunk); /* argument is nonvar */ traced_gatom_6enonvar: - if (d0 == PREG->u.cccccc.c5) { + if (d0 == PREG->y_u.cccccc.c5) { goto traced_gatom_6f; } else { @@ -2747,13 +2657,13 @@ profiled_deref_body(d0, pt0, traced_gatom_6eunk, traced_gatom_6enonvar); /* argument is a variable */ EMIT_SIMPLE_BLOCK_TEST(GET_6ATOMS_GATOM_6EUNK); - Bind(pt0, PREG->u.cccccc.c5); + Bind(pt0, PREG->y_u.cccccc.c5); ENDP(pt0); traced_gatom_6f: /* fetch arguments */ EMIT_SIMPLE_BLOCK_TEST(GET_6ATOMS_GATOM_6F); d0 = ARG6; - d1 = PREG->u.cccccc.c6; + d1 = PREG->y_u.cccccc.c6; BEGP(pt0); profiled_deref_head_TEST(d0, traced_gatom_6funk); @@ -2785,7 +2695,7 @@ OpRW(traced_get_list, x); EMIT_ENTRY_BLOCK(PREG,GET_LIST_INSTINIT); BEGD(d0); - d0 = XREG(PREG->u.x.x); + d0 = XREG(PREG->y_u.x.x); profiled_deref_head_TEST(d0, traced_glist_unk); traced_glist_nonvar: @@ -2831,7 +2741,7 @@ OpRW(traced_get_struct, xfa); EMIT_ENTRY_BLOCK(PREG,GET_STRUCT_INSTINIT); BEGD(d0); - d0 = XREG(PREG->u.xfa.x); + d0 = XREG(PREG->y_u.xfa.x); profiled_deref_head_TEST(d0, traced_gstruct_unk); traced_gstruct_nonvar: @@ -2842,9 +2752,9 @@ /* we have met a compound term */ START_PREFETCH(xfa); CACHE_S(); - S_SREG = RepAppl(d0); - /* check functor */ - d0 = (CELL) (PREG->u.xfa.f); +S_SREG = RepAppl(d0); +/* check functor */ + d0 = (CELL) (PREG->y_u.xfa.f); if (*S_SREG != d0) { TRACED_FAIL(); } @@ -2869,9 +2779,9 @@ pt0 = HR; ENDD(d1); /* first, put the functor */ - d0 = (CELL) (PREG->u.xfa.f); + d0 = (CELL) (PREG->y_u.xfa.f); *pt0++ = d0; - HR = pt0 + PREG->u.xfa.a; + HR = pt0 + PREG->y_u.xfa.a; PREG = NEXTOP(PREG, xfa); /* set SREG */ SREG = pt0; @@ -2886,7 +2796,7 @@ Op(traced_get_float, xd); EMIT_ENTRY_BLOCK(PREG,GET_FLOAT_INSTINIT); BEGD(d0); - d0 = XREG(PREG->u.xd.x); + d0 = XREG(PREG->y_u.xd.x); profiled_deref_head_TEST(d0, traced_gfloat_unk); traced_gfloat_nonvar: @@ -2903,7 +2813,7 @@ TRACED_FAIL(); } BEGP(pt1); - pt1 = PREG->u.xd.d; + pt1 = PREG->y_u.xd.d; PREG = NEXTOP(PREG, xd); if ( pt1[1] != pt0[1] @@ -2926,7 +2836,7 @@ EMIT_SIMPLE_BLOCK_TEST(GET_FLOAT_GFLOAT_UNK); START_PREFETCH(xc); BEGD(d1); - d1 = AbsAppl(PREG->u.xd.d); + d1 = AbsAppl(PREG->y_u.xd.d); PREG = NEXTOP(PREG, xd); Bind(pt0, d1); GONext(); @@ -2940,7 +2850,7 @@ Op(traced_get_longint, xi); EMIT_ENTRY_BLOCK(PREG,GET_LONGINT_INSTINIT); BEGD(d0); - d0 = XREG(PREG->u.xi.x); + d0 = XREG(PREG->y_u.xi.x); profiled_deref_head_TEST(d0, traced_glongint_unk); traced_glongint_nonvar: @@ -2956,7 +2866,7 @@ if (*pt0 != (CELL)FunctorLongInt) { TRACED_FAIL(); } - if (PREG->u.xi.i[1] != (CELL)pt0[1]) { + if (PREG->y_u.xi.i[1] != (CELL)pt0[1]) { TRACED_FAIL(); } ENDP(pt0); @@ -2972,7 +2882,7 @@ EMIT_SIMPLE_BLOCK_TEST(GET_LONGINT_GLONGINT_UNK); START_PREFETCH(xi); BEGD(d1); - d1 = AbsAppl(PREG->u.xi.i); + d1 = AbsAppl(PREG->y_u.xi.i); PREG = NEXTOP(PREG, xi); Bind(pt0, d1); GONext(); @@ -2987,7 +2897,7 @@ #ifdef USE_GMP EMIT_ENTRY_BLOCK(PREG,GET_BIGINT_INSTINIT); BEGD(d0); - d0 = XREG(PREG->u.xN.x); + d0 = XREG(PREG->y_u.xN.x); profiled_deref_head_TEST(d0, traced_gbigint_unk); traced_gbigint_nonvar: @@ -3004,7 +2914,7 @@ { TRACED_FAIL(); } - if (Yap_gmp_tcmp_big_big(d0,PREG->u.xN.b)) { + if (Yap_gmp_tcmp_big_big(d0,PREG->y_u.xN.b)) { TRACED_FAIL(); } PREG = NEXTOP(PREG, xN); @@ -3020,7 +2930,7 @@ EMIT_SIMPLE_BLOCK_TEST(GET_BIGINT_GBIGINT_UNK); START_PREFETCH(xN); BEGD(d1); - d1 = PREG->u.xN.b; + d1 = PREG->y_u.xN.b; PREG = NEXTOP(PREG, xN); Bind(pt0, d1); GONext(); @@ -3038,14 +2948,14 @@ Op(traced_get_dbterm, xD); EMIT_ENTRY_BLOCK(PREG,GET_DBTERM_INSTINIT); BEGD(d0); - d0 = XREG(PREG->u.xD.x); + d0 = XREG(PREG->y_u.xD.x); profiled_deref_head_TEST(d0, traced_gdbterm_unk); traced_gdbterm_nonvar: BEGD(d1); /* we have met a preexisting dbterm */ EMIT_MULTIPLE_DESTINY_BLOCK_TEST(GET_DBTERM_GDBTERM_NONVAR); - d1 = PREG->u.xD.D; + d1 = PREG->y_u.xD.D; PREG = NEXTOP(PREG, xD); traced_UnifyBound(d0,d1); ENDD(d1); @@ -3057,7 +2967,7 @@ EMIT_SIMPLE_BLOCK_TEST(GET_DBTERM_GDBTERM_UNK); START_PREFETCH(xD); BEGD(d1); - d1 = PREG->u.xD.D; + d1 = PREG->y_u.xD.D; PREG = NEXTOP(PREG, xD); Bind(pt0, d1); GONext(); @@ -3074,7 +2984,7 @@ OpRW(traced_glist_valx, xx); EMIT_ENTRY_BLOCK(PREG,GLIST_VALX_INSTINIT); BEGD(d0); - d0 = XREG(PREG->u.xx.xl); + d0 = XREG(PREG->y_u.xx.xl); profiled_deref_head_TEST(d0, traced_glist_valx_write); traced_glist_valx_read: BEGP(pt0); @@ -3096,7 +3006,7 @@ /* first argument is bound */ EMIT_SIMPLE_BLOCK_TEST(GLIST_VALX_GLIST_VALX_NONVAR); BEGD(d1); - d1 = XREG(PREG->u.xx.xr); + d1 = XREG(PREG->y_u.xx.xr); profiled_deref_head_TEST(d1, traced_glist_valx_nonvar_unk); traced_glist_valx_nonvar_nonvar: @@ -3123,7 +3033,7 @@ profiled_derefa_body(d0, pt0, traced_glist_valx_unk, traced_glist_valx_nonvar); /* head is unbound, pt0 has the value */ EMIT_SIMPLE_BLOCK_TEST(GLIST_VALX_GLIST_VALX_UNK); - d0 = XREG(PREG->u.xx.xr); + d0 = XREG(PREG->y_u.xx.xr); profiled_deref_head_TEST(d0, traced_glist_valx_var_unk); traced_glist_valx_var_nonvar: @@ -3151,7 +3061,7 @@ /* enter write mode */ S_SREG = HR; BEGD(d1); - d1 = XREG(PREG->u.xx.xr); + d1 = XREG(PREG->y_u.xx.xr); d0 = AbsPair(S_SREG); S_SREG[0] = d1; ENDD(d1); @@ -3171,7 +3081,7 @@ OpRW(traced_glist_valy, yx); EMIT_ENTRY_BLOCK(PREG,GLIST_VALY_INSTINIT); BEGD(d0); - d0 = XREG(PREG->u.yx.x); + d0 = XREG(PREG->y_u.yx.x); profiled_deref_head_TEST(d0, traced_glist_valy_write); traced_glist_valy_read: BEGP(pt0); @@ -3193,7 +3103,7 @@ EMIT_SIMPLE_BLOCK_TEST(GLIST_VALY_GLIST_VALY_NONVAR); BEGD(d1); BEGP(pt1); - pt1 = YREG + PREG->u.yx.y; + pt1 = YREG + PREG->y_u.yx.y; d1 = *pt1; PREG = NEXTOP(PREG, yx); profiled_deref_head_TEST(d1, traced_glist_valy_nonvar_unk); @@ -3218,7 +3128,7 @@ /* first argument is unbound */ EMIT_SIMPLE_BLOCK_TEST(GLIST_VALY_GLIST_VALY_UNK); BEGP(pt1); - pt1 = YREG+PREG->u.yx.y; + pt1 = YREG+PREG->y_u.yx.y; d1 = *pt1; profiled_deref_head_TEST(d1, traced_glist_valy_var_unk); traced_glist_valy_var_nonvar: @@ -3251,7 +3161,7 @@ Bind(pt0, d0); BEGD(d0); /* include XREG on it */ - d0 = YREG[PREG->u.yx.y]; + d0 = YREG[PREG->y_u.yx.y]; pt1[0] = d0; ENDD(d0); HR = pt1 + 2; @@ -3268,7 +3178,7 @@ Op(traced_gl_void_varx, xx); EMIT_ENTRY_BLOCK(PREG,GL_VOID_VARX_INSTINIT); BEGD(d0); - d0 = XREG(PREG->u.xx.xl); + d0 = XREG(PREG->y_u.xx.xl); profiled_deref_head_TEST(d0, traced_glist_void_varx_write); traced_glist_void_varx_read: /* did we find a list? */ @@ -3281,7 +3191,7 @@ BEGP(pt0); pt0 = RepPair(d0); d0 = pt0[1]; - XREG(PREG->u.xx.xr) = d0; + XREG(PREG->y_u.xx.xr) = d0; PREG = NEXTOP(PREG, xx); ALWAYS_GONext(); ENDP(pt0); @@ -3294,7 +3204,7 @@ BEGP(pt1); pt1 = HR; /* include XREG on it */ - XREG(PREG->u.xx.xr) = + XREG(PREG->y_u.xx.xr) = Unsigned(pt1 + 1); RESET_VARIABLE(pt1); RESET_VARIABLE(pt1+1); @@ -3313,7 +3223,7 @@ Op(traced_gl_void_vary, yx); EMIT_ENTRY_BLOCK(PREG,GL_VOID_VARY_INSTINIT); BEGD(d0); - d0 = XREG(PREG->u.yx.x); + d0 = XREG(PREG->y_u.yx.x); profiled_deref_head_TEST(d0, traced_glist_void_vary_write); traced_glist_void_vary_read: /* did we find a list? */ @@ -3326,7 +3236,7 @@ pt0 = RepPair(d0); d0 = pt0[1]; ENDP(pt0); - INITIALIZE_PERMVAR(YREG+PREG->u.yx.y,d0); + INITIALIZE_PERMVAR(YREG+PREG->y_u.yx.y,d0); PREG = NEXTOP(PREG, yx); GONext(); @@ -3337,7 +3247,7 @@ BEGP(pt1); pt1 = HR; /* include XREG on it */ - INITIALIZE_PERMVAR(YREG+PREG->u.yx.y,Unsigned(pt1 + 1)); + INITIALIZE_PERMVAR(YREG+PREG->y_u.yx.y,Unsigned(pt1 + 1)); PREG = NEXTOP(PREG, yx); RESET_VARIABLE(pt1); RESET_VARIABLE(pt1+1); @@ -3356,7 +3266,7 @@ EMIT_ENTRY_BLOCK(PREG,GL_VOID_VALX_INSTINIT); ///#endif BEGD(d0); - d0 = XREG(PREG->u.xx.xl); + d0 = XREG(PREG->y_u.xx.xl); deref_head(d0, traced_glist_void_valx_write); traced_glist_void_valx_read: BEGP(pt0); @@ -3379,7 +3289,7 @@ EMIT_SIMPLE_BLOCK(GL_VOID_VALX_GLIST_VOID_VALX_NONVAR); //#endif BEGD(d1); - d1 = XREG(PREG->u.xx.xr); + d1 = XREG(PREG->y_u.xx.xr); deref_head(d1, traced_glist_void_valx_nonvar_unk); traced_glist_void_valx_nonvar_nonvar: @@ -3411,7 +3321,7 @@ EMIT_SIMPLE_BLOCK(GL_VOID_VALX_GLIST_VOID_VALX_UNK); ///#endif BEGD(d1); - d1 = XREG(PREG->u.xx.xr); + d1 = XREG(PREG->y_u.xx.xr); deref_head(d1, traced_glist_void_valx_var_unk); traced_glist_void_valx_var_nonvar: @@ -3449,7 +3359,7 @@ pt1 = HR; BEGD(d0); /* include XREG on it */ - d0 = XREG(PREG->u.xx.xr); + d0 = XREG(PREG->y_u.xx.xr); RESET_VARIABLE(pt1); pt1[1] = d0; HR = pt1 + 2; @@ -3467,7 +3377,7 @@ EMIT_ENTRY_BLOCK(PREG,GL_VOID_VALY_INSTINIT); ///#endif BEGD(d0); - d0 = XREG(PREG->u.yx.x); + d0 = XREG(PREG->y_u.yx.x); deref_head(d0, traced_glist_void_valy_write); traced_glist_void_valy_read: ///#ifdef PROFILED_ABSMI @@ -3493,7 +3403,7 @@ ///#endif BEGD(d1); BEGP(pt1); - pt1 = YREG+PREG->u.yx.y; + pt1 = YREG+PREG->y_u.yx.y; d1 = *pt1; deref_head(d1, traced_glist_void_valy_nonvar_unk); @@ -3525,7 +3435,7 @@ EMIT_SIMPLE_BLOCK(GL_VOID_VALY_GLIST_VOID_VALY_UNK); ///#endif BEGP(pt1); - pt1 = YREG+PREG->u.yx.y; + pt1 = YREG+PREG->y_u.yx.y; d1 = *pt1; deref_head(d1, traced_glist_void_valy_var_unk); @@ -3563,7 +3473,7 @@ S_SREG = HR; /* include XREG on it */ BEGD(d1); - d1 = YREG[PREG->u.yx.y]; + d1 = YREG[PREG->y_u.yx.y]; RESET_VARIABLE(S_SREG); S_SREG[1] = d1; ENDD(d1); @@ -3596,7 +3506,7 @@ EMIT_SIMPLE_BLOCK_TEST(UNIFY_X_VAR_END); WRITEBACK_S(S_SREG+1); ALWAYS_START_PREFETCH(ox); - XREG(PREG->u.ox.x) = d0; + XREG(PREG->y_u.ox.x) = d0; PREG = NEXTOP(PREG, ox); ALWAYS_GONext(); ALWAYS_END_PREFETCH(); @@ -3609,7 +3519,7 @@ CACHE_S(); READ_IN_S(); BEGP(pt0); - pt0 = &XREG(PREG->u.ox.x); + pt0 = &XREG(PREG->y_u.ox.x); PREG = NEXTOP(PREG, ox); RESET_VARIABLE(S_SREG); *pt0 = (CELL) S_SREG; @@ -3625,7 +3535,7 @@ BEGP(pt0); BEGD(d0); d0 = SREG[0]; - pt0 = &XREG(PREG->u.ox.x); + pt0 = &XREG(PREG->y_u.ox.x); PREG = NEXTOP(PREG, ox); #ifdef YAPOR_SBA EMIT_SIMPLE_BLOCK_TEST(UNIFY_L_X_VAR_YAPOR_SBA); @@ -3647,7 +3557,7 @@ CACHE_S(); READ_IN_S(); BEGP(pt0); - pt0 = &XREG(PREG->u.ox.x); + pt0 = &XREG(PREG->y_u.ox.x); PREG = NEXTOP(PREG, ox); RESET_VARIABLE(S_SREG); *pt0 = (CELL)S_SREG; @@ -3663,7 +3573,7 @@ ALWAYS_START_PREFETCH(oxx); READ_IN_S(); BEGP(pt0); - pt0 = &XREG(PREG->u.oxx.xr); + pt0 = &XREG(PREG->y_u.oxx.xr); BEGD(d0); d0 = S_SREG[0]; BEGD(d1); @@ -3679,7 +3589,7 @@ #endif EMIT_SIMPLE_BLOCK_TEST(UNIFY_X_VAR2_END); WRITEBACK_S(S_SREG+2); - XREG(PREG->u.oxx.xl) = d0; + XREG(PREG->y_u.oxx.xl) = d0; PREG = NEXTOP(PREG, oxx); *pt0 = d1; ENDD(d0); @@ -3695,9 +3605,9 @@ CACHE_S(); READ_IN_S(); BEGP(pt0); - pt0 = &XREG(PREG->u.oxx.xr); + pt0 = &XREG(PREG->y_u.oxx.xr); RESET_VARIABLE(S_SREG); - XREG(PREG->u.oxx.xl) = (CELL) S_SREG; + XREG(PREG->y_u.oxx.xl) = (CELL) S_SREG; S_SREG++; PREG = NEXTOP(PREG, oxx); RESET_VARIABLE(S_SREG); @@ -3714,17 +3624,17 @@ CACHE_S(); READ_IN_S(); BEGP(pt0); - pt0 = &XREG(PREG->u.oxx.xr); + pt0 = &XREG(PREG->y_u.oxx.xr); BEGD(d0); d0 = S_SREG[0]; BEGD(d1); d1 = S_SREG[1]; #ifdef YAPOR_SBA if (d0 == 0) - XREG(PREG->u.oxx.xl) = (CELL)S_SREG; + XREG(PREG->y_u.oxx.xl) = (CELL)S_SREG; else #endif - XREG(PREG->u.oxx.xl) = d0; + XREG(PREG->y_u.oxx.xl) = d0; PREG = NEXTOP(PREG, oxx); #ifdef YAPOR_SBA if (d1 == 0) @@ -3745,8 +3655,8 @@ CACHE_S(); READ_IN_S(); BEGP(pt0); - pt0 = &XREG(PREG->u.oxx.xr); - XREG(PREG->u.oxx.xl) = (CELL) S_SREG; + pt0 = &XREG(PREG->y_u.oxx.xr); + XREG(PREG->y_u.oxx.xl) = (CELL) S_SREG; RESET_VARIABLE(S_SREG); S_SREG++; *pt0 = (CELL) S_SREG; @@ -3763,10 +3673,10 @@ d0 = *SREG++; #ifdef YAPOR_SBA if (d0 == 0) { - INITIALIZE_PERMVAR(YREG+PREG->u.oy.y,(CELL)(SREG-1)); + INITIALIZE_PERMVAR(YREG+PREG->y_u.oy.y,(CELL)(SREG-1)); } else #else - INITIALIZE_PERMVAR(YREG+PREG->u.oy.y,d0); + INITIALIZE_PERMVAR(YREG+PREG->y_u.oy.y,d0); #endif /* YAPOR_SBA */ PREG = NEXTOP(PREG, oy); GONext(); @@ -3777,7 +3687,7 @@ EMIT_ENTRY_BLOCK(PREG,UNIFY_Y_VAR_WRITE_INSTINIT); CACHE_S(); READ_IN_S(); - INITIALIZE_PERMVAR(YREG+PREG->u.oy.y,(CELL) S_SREG); + INITIALIZE_PERMVAR(YREG+PREG->y_u.oy.y,(CELL) S_SREG); PREG = NEXTOP(PREG, oy); RESET_VARIABLE(S_SREG); WRITEBACK_S(S_SREG+1); @@ -3791,10 +3701,10 @@ d0 = SREG[0]; #ifdef YAPOR_SBA if (d0 == 0) { - INITIALIZE_PERMVAR(YREG+PREG->u.oy.y,(CELL)SREG); + INITIALIZE_PERMVAR(YREG+PREG->y_u.oy.y,(CELL)SREG); } else #else - INITIALIZE_PERMVAR(YREG+PREG->u.oy.y,d0); + INITIALIZE_PERMVAR(YREG+PREG->y_u.oy.y,d0); #endif /* YAPOR_SBA */ PREG = NEXTOP(PREG, oy); GONext(); @@ -3805,7 +3715,7 @@ EMIT_ENTRY_BLOCK(PREG,UNIFY_L_Y_VAR_WRITE_INSTINIT); CACHE_S(); READ_IN_S(); - INITIALIZE_PERMVAR(YREG+PREG->u.oy.y,(CELL) S_SREG); + INITIALIZE_PERMVAR(YREG+PREG->y_u.oy.y,(CELL) S_SREG); PREG = NEXTOP(PREG, oy); RESET_VARIABLE(S_SREG); ENDCACHE_S(); @@ -3830,7 +3740,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(UNIFY_X_VAL_UVALX_NONVAR); ///#endif - d1 = XREG(PREG->u.ox.x); + d1 = XREG(PREG->y_u.ox.x); deref_head(d1, traced_uvalx_nonvar_unk); traced_uvalx_nonvar_nonvar: @@ -3863,7 +3773,7 @@ EMIT_SIMPLE_BLOCK(UNIFY_X_VAL_UVALX_UNK); ///#endif /* first argument is unbound */ - d1 = XREG(PREG->u.ox.x); + d1 = XREG(PREG->y_u.ox.x); deref_head(d1, traced_uvalx_var_unk); traced_uvalx_var_nonvar: @@ -3895,7 +3805,7 @@ OpW(traced_unify_x_val_write, ox); /* we are in write mode */ EMIT_ENTRY_BLOCK(PREG,UNIFY_X_VAL_WRITE_INSTINIT); - *SREG++ = XREG(PREG->u.ox.x); + *SREG++ = XREG(PREG->y_u.ox.x); PREG = NEXTOP(PREG, ox); GONextW(); ENDOpW(); @@ -3918,7 +3828,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(UNIFY_L_X_VAL_ULVALX_NONVAR); ///#endif - d1 = XREG(PREG->u.ox.x); + d1 = XREG(PREG->y_u.ox.x); deref_head(d1, traced_ulvalx_nonvar_unk); traced_ulvalx_nonvar_nonvar: @@ -3948,7 +3858,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(UNIFY_L_X_VAL_ULVALX_UNK); ///#endif - d1 = XREG(PREG->u.ox.x); + d1 = XREG(PREG->y_u.ox.x); deref_head(d1, traced_ulvalx_var_unk); traced_ulvalx_var_nonvar: @@ -3978,7 +3888,7 @@ Op(traced_unify_l_x_val_write, ox); /* we are in write mode */ EMIT_ENTRY_BLOCK(PREG,UNIFY_L_X_VAL_WRITE_INSTINIT); - SREG[0] = XREG(PREG->u.ox.x); + SREG[0] = XREG(PREG->y_u.ox.x); PREG = NEXTOP(PREG, ox); GONext(); ENDOp(); @@ -4002,7 +3912,7 @@ EMIT_SIMPLE_BLOCK_TEST(UNIFY_Y_VAL_UVALY_NONVAR); ///#endif BEGP(pt1); - pt1 = YREG+PREG->u.oy.y; + pt1 = YREG+PREG->y_u.oy.y; d1 = *pt1; deref_head(d1, traced_uvaly_nonvar_unk); @@ -4035,7 +3945,7 @@ EMIT_SIMPLE_BLOCK_TEST(UNIFY_Y_VAL_UVALY_UNK); ///#endif BEGP(pt1); - pt1 = YREG+PREG->u.oy.y; + pt1 = YREG+PREG->y_u.oy.y; d1 = *pt1; deref_head(d1, traced_uvaly_var_unk); @@ -4068,10 +3978,10 @@ EMIT_ENTRY_BLOCK(PREG,UNIFY_Y_VAL_WRITE_INSTINIT); /* we are in write mode */ BEGD(d0); - d0 = YREG[PREG->u.oy.y]; + d0 = YREG[PREG->y_u.oy.y]; #ifdef YAPOR_SBA if (d0 == 0) /* free variable */ - *SREG++ = (CELL)(YREG+PREG->u.oy.y); + *SREG++ = (CELL)(YREG+PREG->y_u.oy.y); else #endif *SREG++ = d0; @@ -4099,7 +4009,7 @@ EMIT_SIMPLE_BLOCK_TEST(UNIFY_L_Y_VAL_ULVALY_NONVAR); ///#endif BEGP(pt1); - pt1 = YREG+PREG->u.oy.y; + pt1 = YREG+PREG->y_u.oy.y; d1 = *pt1; deref_head(d1, traced_ulvaly_nonvar_unk); @@ -4130,7 +4040,7 @@ EMIT_SIMPLE_BLOCK_TEST(UNIFY_L_Y_VAL_ULVALY_UNK); ///#endif BEGP(pt1); - pt1 = YREG+PREG->u.oy.y; + pt1 = YREG+PREG->y_u.oy.y; d1 = *pt1; deref_head(d1, traced_ulvaly_var_unk); @@ -4163,10 +4073,10 @@ EMIT_ENTRY_BLOCK(PREG,UNIFY_L_Y_VAL_WRITE_INSTINIT); /* we are in write mode */ BEGD(d0); - d0 = YREG[PREG->u.oy.y]; + d0 = YREG[PREG->y_u.oy.y]; #ifdef YAPOR_SBA if (d0 == 0) /* new variable */ - SREG[0] = (CELL)(YREG+PREG->u.oy.y); + SREG[0] = (CELL)(YREG+PREG->y_u.oy.y); else #endif SREG[0] = d0; @@ -4189,7 +4099,7 @@ traced_uvalx_loc_nonvar: /* first argument is bound */ EMIT_SIMPLE_BLOCK_TEST(UNIFY_X_LOC_UVALX_LOC_NONVAR); - d1 = XREG(PREG->u.ox.x); + d1 = XREG(PREG->y_u.ox.x); profiled_deref_head_TEST(d1, traced_uvalx_loc_nonvar_unk); traced_uvalx_loc_nonvar_nonvar: @@ -4216,7 +4126,7 @@ profiled_derefa_body(d0, pt0, traced_uvalx_loc_unk, traced_uvalx_loc_nonvar); /* first argument is unbound */ EMIT_SIMPLE_BLOCK_TEST(UNIFY_X_LOC_UVALX_LOC_UNK); - d1 = XREG(PREG->u.ox.x); + d1 = XREG(PREG->y_u.ox.x); profiled_deref_head_TEST(d1, traced_uvalx_loc_var_unk); traced_uvalx_loc_var_nonvar: /* first unbound, second bound */ @@ -4246,7 +4156,7 @@ EMIT_ENTRY_BLOCK(PREG,UNIFY_X_LOC_WRITE_INSTINIT); /* we are in write mode */ BEGD(d0); - d0 = XREG(PREG->u.ox.x); + d0 = XREG(PREG->y_u.ox.x); profiled_deref_head_TEST(d0, traced_unify_x_loc_unk); traced_unify_x_loc_nonvar: EMIT_SIMPLE_BLOCK_TEST(UNIFY_X_LOC_WRITE_UNIFY_X_LOC_NONVAR); @@ -4297,7 +4207,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK_TEST(UNIFY_L_X_LOC_ULVALX_LOC_NONVAR); ///#endif - d1 = XREG(PREG->u.ox.x); + d1 = XREG(PREG->y_u.ox.x); deref_head(d1, traced_ulvalx_loc_nonvar_unk); traced_ulvalx_loc_nonvar_nonvar: @@ -4325,7 +4235,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK_TEST(UNIFY_L_X_LOC_ULVALX_LOC_UNK); ///#endif - d1 = XREG(PREG->u.ox.x); + d1 = XREG(PREG->y_u.ox.x); deref_head(d1, traced_ulvalx_loc_var_unk); traced_ulvalx_loc_var_nonvar: @@ -4356,7 +4266,7 @@ EMIT_ENTRY_BLOCK(PREG,UNIFY_L_X_LOC_WRITE_INSTINIT); /* we are in write mode */ BEGD(d0); - d0 = XREG(PREG->u.ox.x); + d0 = XREG(PREG->y_u.ox.x); profiled_deref_head_TEST(d0, traced_ulnify_x_loc_unk); traced_ulnify_x_loc_nonvar: EMIT_SIMPLE_BLOCK_TEST(UNIFY_L_X_LOC_WRITE_ULNIFY_X_LOC_NONVAR); @@ -4402,7 +4312,7 @@ EMIT_SIMPLE_BLOCK_TEST(UNIFY_Y_LOC_UVALY_LOC_NONVAR); ///#endif BEGP(pt1); - pt1 = YREG+PREG->u.oy.y; + pt1 = YREG+PREG->y_u.oy.y; d1 = *pt1; deref_head(d1, traced_uvaly_loc_nonvar_unk); @@ -4435,7 +4345,7 @@ EMIT_SIMPLE_BLOCK_TEST(UNIFY_Y_LOC_UVALY_LOC_UNK); ///#endif BEGP(pt1); - pt1 = YREG+PREG->u.oy.y; + pt1 = YREG+PREG->y_u.oy.y; d1 = *pt1; deref_head(d1, traced_uvaly_loc_var_unk); @@ -4471,7 +4381,7 @@ EMIT_ENTRY_BLOCK(PREG,UNIFY_Y_LOC_WRITE_INSTINIT); BEGD(d0); BEGP(pt0); - pt0 = YREG+PREG->u.oy.y; + pt0 = YREG+PREG->y_u.oy.y; d0 = *pt0; profiled_deref_head_TEST(d0, traced_unify_y_loc_unk); traced_unify_y_loc_nonvar: @@ -4521,7 +4431,7 @@ EMIT_SIMPLE_BLOCK_TEST(UNIFY_L_Y_LOC_ULVALY_LOC_NONVAR); ///#endif BEGP(pt1); - pt1 = YREG+PREG->u.oy.y; + pt1 = YREG+PREG->y_u.oy.y; d1 = *pt1; deref_head(d1, traced_ulvaly_loc_nonvar_unk); @@ -4552,7 +4462,7 @@ EMIT_SIMPLE_BLOCK_TEST(UNIFY_L_Y_LOC_ULVALY_LOC_UNK); ///#endif BEGP(pt1); - pt1 = YREG+PREG->u.oy.y; + pt1 = YREG+PREG->y_u.oy.y; d1 = *pt1; deref_head(d1, traced_ulvaly_loc_var_unk); @@ -4586,7 +4496,7 @@ EMIT_ENTRY_BLOCK(PREG,UNIFY_L_Y_LOC_WRITE_INSTINIT); BEGD(d0); BEGP(pt0); - pt0 = YREG+PREG->u.oy.y; + pt0 = YREG+PREG->y_u.oy.y; d0 = *pt0; profiled_deref_head_TEST(d0, traced_ulunify_y_loc_unk); traced_ulunify_y_loc_nonvar: @@ -4652,7 +4562,7 @@ Op(traced_unify_n_voids, os); EMIT_ENTRY_BLOCK(PREG,UNIFY_N_VOIDS_INSTINIT); - SREG += PREG->u.os.s; + SREG += PREG->y_u.os.s; PREG = NEXTOP(PREG, os); GONext(); ENDOp(); @@ -4661,7 +4571,7 @@ EMIT_ENTRY_BLOCK(PREG,UNIFY_N_VOIDS_WRITE_INSTINIT); BEGD(d0); CACHE_S(); - d0 = PREG->u.os.s; + d0 = PREG->y_u.os.s; READ_IN_S(); PREG = NEXTOP(PREG, os); for (; d0 > 0; d0--) { @@ -4683,7 +4593,7 @@ Op(traced_unify_l_n_voids_write, os); EMIT_ENTRY_BLOCK(PREG,UNIFY_L_N_VOIDS_WRITE_INSTINIT); BEGD(d0); - d0 = PREG->u.os.s; + d0 = PREG->y_u.os.s; PREG = NEXTOP(PREG, os); CACHE_S(); READ_IN_S(); @@ -4705,7 +4615,7 @@ profiled_deref_head_TEST(d0, traced_uatom_unk); traced_uatom_nonvar: EMIT_MULTIPLE_DESTINY_BLOCK_TEST(UNIFY_ATOM_UATOM_NONVAR); - if (d0 != PREG->u.oc.c) { + if (d0 != PREG->y_u.oc.c) { TRACED_FAIL(); } PREG = NEXTOP(PREG, oc); @@ -4713,7 +4623,7 @@ profiled_derefa_body(d0, pt0, traced_uatom_unk, traced_uatom_nonvar); EMIT_SIMPLE_BLOCK_TEST(UNIFY_ATOM_UATOM_UNK); - d0 = PREG->u.oc.c; + d0 = PREG->y_u.oc.c; PREG = NEXTOP(PREG, oc); Bind_Global(pt0, d0); GONext(); @@ -4723,7 +4633,7 @@ OpW(traced_unify_atom_write, oc); EMIT_ENTRY_BLOCK(PREG,UNIFY_ATOM_WRITE_INSTINIT); - * SREG++ = PREG->u.oc.c; + * SREG++ = PREG->y_u.oc.c; PREG = NEXTOP(PREG, oc); GONextW(); ENDOpW(); @@ -4737,7 +4647,7 @@ profiled_deref_head_TEST(d0, traced_ulatom_unk); traced_ulatom_nonvar: EMIT_MULTIPLE_DESTINY_BLOCK_TEST(UNIFY_L_ATOM_ULATOM_NONVAR); - if (d0 != PREG->u.oc.c) { + if (d0 != PREG->y_u.oc.c) { TRACED_FAIL(); } PREG = NEXTOP(PREG, oc); @@ -4745,7 +4655,7 @@ profiled_derefa_body(d0, pt0, traced_ulatom_unk, traced_ulatom_nonvar); EMIT_SIMPLE_BLOCK_TEST(UNIFY_L_ATOM_ULATOM_UNK); - d0 = PREG->u.oc.c; + d0 = PREG->y_u.oc.c; PREG = NEXTOP(PREG, oc); Bind_Global(pt0, d0); GONext(); @@ -4755,7 +4665,7 @@ Op(traced_unify_l_atom_write, oc); EMIT_ENTRY_BLOCK(PREG,UNIFY_L_ATOM_WRITE_INSTINIT); - SREG[0] = PREG->u.oc.c; + SREG[0] = PREG->y_u.oc.c; PREG = NEXTOP(PREG, oc); GONext(); ENDOp(); @@ -4763,10 +4673,10 @@ Op(traced_unify_n_atoms, osc); EMIT_ENTRY_BLOCK(PREG,UNIFY_N_ATOMS_INSTINIT); { - register Int i = PREG->u.osc.s; /* not enough registers */ + register Int i = PREG->y_u.osc.s; /* not enough registers */ BEGD(d1); - d1 = PREG->u.osc.c; + d1 = PREG->y_u.osc.c; for (; i > 0; i--) { BEGD(d0); BEGP(pt0); @@ -4800,8 +4710,8 @@ EMIT_ENTRY_BLOCK(PREG,UNIFY_N_ATOMS_WRITE_INSTINIT); BEGD(d0); BEGD(d1); - d0 = PREG->u.osc.s; - d1 = PREG->u.osc.c; + d0 = PREG->y_u.osc.s; + d1 = PREG->y_u.osc.c; /* write N atoms */ CACHE_S(); READ_IN_S(); @@ -4845,7 +4755,7 @@ EMIT_SIMPLE_BLOCK_TEST(UNIFY_FLOAT_UFLOAT_NONVAR_D0ISFUNCTOR); ///#endif BEGP(pt1); - pt1 = PREG->u.od.d; + pt1 = PREG->y_u.od.d; PREG = NEXTOP(PREG, od); if ( pt1[1] != pt0[1] @@ -4867,7 +4777,7 @@ EMIT_SIMPLE_BLOCK_TEST(UNIFY_FLOAT_UFLOAT_UNK); ///#endif BEGD(d1); - d1 = AbsAppl(PREG->u.od.d); + d1 = AbsAppl(PREG->y_u.od.d); PREG = NEXTOP(PREG, od); Bind_Global(pt0, d1); GONext(); @@ -4878,7 +4788,7 @@ OpW(traced_unify_float_write, od); EMIT_ENTRY_BLOCK(PREG,UNIFY_FLOAT_WRITE_INSTINIT); - * SREG++ = AbsAppl(PREG->u.od.d); + * SREG++ = AbsAppl(PREG->y_u.od.d); PREG = NEXTOP(PREG, od); GONextW(); ENDOpW(); @@ -4911,7 +4821,7 @@ EMIT_SIMPLE_BLOCK_TEST(UNIFY_L_FLOAT_D0ISFUNC); //#endif BEGP(pt1); - pt1 = PREG->u.od.d; + pt1 = PREG->y_u.od.d; PREG = NEXTOP(PREG, od); if ( pt1[1] != pt0[1] @@ -4933,7 +4843,7 @@ EMIT_SIMPLE_BLOCK_TEST(UNIFY_L_FLOAT_ULFLOAT_UNK); ///#endif BEGD(d1); - d1 = AbsAppl(PREG->u.od.d); + d1 = AbsAppl(PREG->y_u.od.d); PREG = NEXTOP(PREG, od); Bind_Global(S_SREG, d1); GONext(); @@ -4944,7 +4854,7 @@ Op(traced_unify_l_float_write, od); EMIT_ENTRY_BLOCK(PREG,UNIFY_L_FLOAT_WRITE_INSTINIT); - SREG[0] = AbsAppl(PREG->u.od.d); + SREG[0] = AbsAppl(PREG->y_u.od.d); PREG = NEXTOP(PREG, od); GONext(); ENDOp(); @@ -4978,7 +4888,7 @@ ///#endif ENDD(d0); BEGP(pt1); - pt1 = PREG->u.oi.i; + pt1 = PREG->y_u.oi.i; PREG = NEXTOP(PREG, oi); if (pt1[1] != pt0[1]) { TRACED_FAIL(); @@ -4995,7 +4905,7 @@ EMIT_SIMPLE_BLOCK_TEST(UNIFY_LONGINT_ULONGINT_UNK); ///#endif BEGD(d1); - d1 = AbsAppl(PREG->u.oi.i); + d1 = AbsAppl(PREG->y_u.oi.i); PREG = NEXTOP(PREG, oi); Bind_Global(pt0, d1); GONext(); @@ -5006,7 +4916,7 @@ OpW(traced_unify_longint_write, oi); EMIT_ENTRY_BLOCK(PREG,UNIFY_LONGINT_WRITE_INSTINIT); - * SREG++ = AbsAppl(PREG->u.oi.i); + * SREG++ = AbsAppl(PREG->y_u.oi.i); PREG = NEXTOP(PREG, oi); GONextW(); ENDOpW(); @@ -5039,7 +4949,7 @@ EMIT_SIMPLE_BLOCK_TEST(UNIFY_L_LONGINT_D0ISFUNC); ///#endif BEGP(pt1); - pt1 = PREG->u.oi.i; + pt1 = PREG->y_u.oi.i; PREG = NEXTOP(PREG, oi); if (pt1[1] != pt0[1]) { TRACED_FAIL(); @@ -5056,7 +4966,7 @@ EMIT_SIMPLE_BLOCK_TEST(UNIFY_L_LONGINT_ULLONGINT_UNK); ///#endif BEGD(d1); - d1 = AbsAppl(PREG->u.oi.i); + d1 = AbsAppl(PREG->y_u.oi.i); PREG = NEXTOP(PREG, oi); Bind_Global(S_SREG, d1); GONext(); @@ -5067,7 +4977,7 @@ Op(traced_unify_l_longint_write, oi); EMIT_ENTRY_BLOCK(PREG,UNIFY_L_LONGINT_WRITE_INSTINIT); - SREG[0] = AbsAppl(PREG->u.oi.i); + SREG[0] = AbsAppl(PREG->y_u.oi.i); PREG = NEXTOP(PREG, oi); GONext(); ENDOp(); @@ -5099,7 +5009,7 @@ TRACED_FAIL(); } ENDD(d1); - if (Yap_gmp_tcmp_big_big(d0,PREG->u.oN.b)) { + if (Yap_gmp_tcmp_big_big(d0,PREG->y_u.oN.b)) { TRACED_FAIL(); } ///#ifdef PROFILED_ABSMI @@ -5114,7 +5024,7 @@ EMIT_SIMPLE_BLOCK_TEST(UNIFY_BIGINT_UBIGINT_UNK); ///#endif BEGD(d1); - d1 = PREG->u.oN.b; + d1 = PREG->y_u.oN.b; PREG = NEXTOP(PREG, oN); Bind_Global(pt0, d1); GONext(); @@ -5152,7 +5062,7 @@ TRACED_FAIL(); } ENDD(d0); - if (Yap_gmp_tcmp_big_big(d0,PREG->u.oN.b)) { + if (Yap_gmp_tcmp_big_big(d0,PREG->y_u.oN.b)) { TRACED_FAIL(); } ///#ifdef PROFILED_ABSMI @@ -5167,7 +5077,7 @@ EMIT_SIMPLE_BLOCK_TEST(UNIFY_L_BIGINT_ULBIGINT_UNK); ///#endif BEGD(d1); - d1 = PREG->u.oN.b; + d1 = PREG->y_u.oN.b; PREG = NEXTOP(PREG, oN); Bind_Global(S_SREG, d1); GONext(); @@ -5194,7 +5104,7 @@ ///#endif BEGD(d1); /* we have met a preexisting dbterm */ - d1 = PREG->u.oD.D; + d1 = PREG->y_u.oD.D; PREG = NEXTOP(PREG, oD); traced_UnifyBound(d0,d1); ENDD(d1); @@ -5204,7 +5114,7 @@ EMIT_SIMPLE_BLOCK_TEST(UNIFY_DBTERM_UDBTERM_UNK); ///#endif BEGD(d1); - d1 = PREG->u.oD.D; + d1 = PREG->y_u.oD.D; PREG = NEXTOP(PREG, oD); Bind_Global(pt0, d1); GONext(); @@ -5228,7 +5138,7 @@ ///#endif BEGD(d1); /* we have met a preexisting dbterm */ - d1 = PREG->u.oD.D; + d1 = PREG->y_u.oD.D; PREG = NEXTOP(PREG, oD); traced_UnifyBound(d0,d1); ENDD(d1); @@ -5238,7 +5148,7 @@ EMIT_SIMPLE_BLOCK_TEST(UNIFY_L_DBTERM_ULDBTERM_UNK); ///#endif BEGD(d1); - d1 = PREG->u.oD.D; + d1 = PREG->y_u.oD.D; PREG = NEXTOP(PREG, oD); Bind_Global(S_SREG, d1); GONext(); @@ -5385,7 +5295,7 @@ /* we continue in read mode */ S_SREG = RepAppl(d0); /* just check functor */ - d0 = (CELL) (PREG->u.ofa.f); + d0 = (CELL) (PREG->y_u.ofa.f); if (*S_SREG != d0) { TRACED_FAIL(); } @@ -5409,9 +5319,9 @@ pt0 = HR; ENDD(d1); /* first, put the functor */ - d0 = (CELL) (PREG->u.ofa.f); + d0 = (CELL) (PREG->y_u.ofa.f); *pt0++ = d0; - HR = pt0 + PREG->u.ofa.a; + HR = pt0 + PREG->y_u.ofa.a; PREG = NEXTOP(PREG, ofa); /* set SREG */ SREG = pt0; @@ -5435,9 +5345,9 @@ d0 = AbsAppl(HR); S_SREG[0] = d0; S_SREG = HR; - d0 = (CELL) (PREG->u.ofa.f); + d0 = (CELL) (PREG->y_u.ofa.f); *S_SREG++ = d0; - HR = S_SREG + PREG->u.ofa.a; + HR = S_SREG + PREG->y_u.ofa.a; PREG = NEXTOP(PREG, ofa); WRITEBACK_S(S_SREG); ENDCACHE_S(); @@ -5462,7 +5372,7 @@ /* we continue in read mode */ SREG = RepAppl(d0); /* just check functor */ - d0 = (CELL) (PREG->u.ofa.f); + d0 = (CELL) (PREG->y_u.ofa.f); if (*SREG++ != d0) { TRACED_FAIL(); } @@ -5484,9 +5394,9 @@ pt0 = HR; ENDD(d1); /* first, put the functor */ - d0 = (CELL) (PREG->u.ofa.f); + d0 = (CELL) (PREG->y_u.ofa.f); *pt0++ = d0; - HR = pt0 + PREG->u.ofa.a; + HR = pt0 + PREG->y_u.ofa.a; PREG = NEXTOP(PREG, ofa); /* set SREG */ SREG = pt0; @@ -5506,9 +5416,9 @@ READ_IN_S(); S_SREG[0] = d0; S_SREG = HR; - d0 = (CELL) (PREG->u.ofa.f); + d0 = (CELL) (PREG->y_u.ofa.f); *S_SREG++ = d0; - HR = S_SREG + PREG->u.ofa.a; + HR = S_SREG + PREG->y_u.ofa.a; PREG = NEXTOP(PREG, ofa); WRITEBACK_S(S_SREG); ENDCACHE_S(); @@ -5525,9 +5435,9 @@ EMIT_ENTRY_BLOCK(PREG,PUT_X_VAR_INSTINIT); BEGP(pt0); pt0 = HR; - XREG(PREG->u.xx.xl) = Unsigned(pt0); + XREG(PREG->y_u.xx.xl) = Unsigned(pt0); HR = pt0 + 1; - XREG(PREG->u.xx.xr) = Unsigned(pt0); + XREG(PREG->y_u.xx.xr) = Unsigned(pt0); PREG = NEXTOP(PREG, xx); RESET_VARIABLE(pt0); ENDP(pt0); @@ -5537,8 +5447,8 @@ Op(traced_put_y_var, yx); EMIT_ENTRY_BLOCK(PREG,PUT_Y_VAR_INSTINIT); BEGP(pt0); - pt0 = YREG + PREG->u.yx.y; - XREG(PREG->u.yx.x) = (CELL) pt0; + pt0 = YREG + PREG->y_u.yx.y; + XREG(PREG->y_u.yx.x) = (CELL) pt0; PREG = NEXTOP(PREG, yx); #if defined(YAPOR_SBA) && defined(FROZEN_STACKS) /* We must initialise a shared variable to point to the SBA */ @@ -5555,8 +5465,8 @@ Op(traced_put_x_val, xx); EMIT_ENTRY_BLOCK(PREG,PUT_X_VAL_INSTINIT); BEGD(d0); - d0 = XREG(PREG->u.xx.xl); - XREG(PREG->u.xx.xr) = d0; + d0 = XREG(PREG->y_u.xx.xl); + XREG(PREG->y_u.xx.xr) = d0; ENDD(d0); PREG = NEXTOP(PREG, xx); GONext(); @@ -5566,10 +5476,10 @@ EMIT_ENTRY_BLOCK(PREG,PUT_XX_VAL_INSTINIT); BEGD(d0); BEGD(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; + 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; ENDD(d1); ENDD(d0); PREG = NEXTOP(PREG, xxxx); @@ -5579,13 +5489,13 @@ Op(traced_put_y_val, yx); EMIT_ENTRY_BLOCK(PREG,PUT_Y_VAL_INSTINIT); BEGD(d0); - d0 = YREG[PREG->u.yx.y]; + d0 = YREG[PREG->y_u.yx.y]; #ifdef YAPOR_SBA if (d0 == 0) { /* new variable */ - XREG(PREG->u.yx.x) = (CELL)(YREG+PREG->u.yx.y); + XREG(PREG->y_u.yx.x) = (CELL)(YREG+PREG->y_u.yx.y); } else #endif - XREG(PREG->u.yx.x) = d0; + XREG(PREG->y_u.yx.x) = d0; ENDD(d0); PREG = NEXTOP(PREG, yx); GONext(); @@ -5595,24 +5505,24 @@ EMIT_ENTRY_BLOCK(PREG,PUT_Y_VALS_INSTINIT); ALWAYS_START_PREFETCH(yyxx); BEGD(d0); - d0 = YREG[PREG->u.yyxx.y1]; + d0 = YREG[PREG->y_u.yyxx.y1]; #ifdef YAPOR_SBA if (d0 == 0) /* new variable */ - XREG(PREG->u.yyxx.x1) = (CELL)(YREG+PREG->u.yyxx.y1); + XREG(PREG->y_u.yyxx.x1) = (CELL)(YREG+PREG->y_u.yyxx.y1); else #endif - XREG(PREG->u.yyxx.x1) = d0; + XREG(PREG->y_u.yyxx.x1) = d0; ENDD(d0); /* allow for some prefetching */ PREG = NEXTOP(PREG, yyxx); BEGD(d1); - d1 = YREG[PREVOP(PREG,yyxx)->u.yyxx.y2]; + d1 = YREG[PREVOP(PREG,yyxx)->y_u.yyxx.y2]; #ifdef YAPOR_SBA if (d1 == 0) /* new variable */ - XREG(PREVOP(traced_PREG->u.yyxx,yyxx).x2) = (CELL)(YREG+PREG->u.yyxx.y2); + XREG(PREVOP(traced_PREG->y_u.yyxx,yyxx).x2) = (CELL)(YREG+PREG->y_u.yyxx.y2); else #endif - XREG(PREVOP(PREG,yyxx)->u.yyxx.x2) = d1; + XREG(PREVOP(PREG,yyxx)->y_u.yyxx.x2) = d1; ENDD(d1); ALWAYS_GONext(); ALWAYS_END_PREFETCH(); @@ -5622,12 +5532,12 @@ EMIT_ENTRY_BLOCK(PREG,PUT_UNSAFE_INSTINIT); BEGD(d0); BEGP(pt0); - pt0 = YREG+PREG->u.yx.y; + pt0 = YREG+PREG->y_u.yx.y; d0 = *pt0; profiled_deref_head_TEST(d0, traced_punsafe_unk); traced_punsafe_nonvar: EMIT_SIMPLE_BLOCK_TEST(PUT_UNSAFE_PUNSAFE_NONVAR); - XREG(PREG->u.yx.x) = d0; + XREG(PREG->y_u.yx.x) = d0; PREG = NEXTOP(PREG, yx); GONext(); @@ -5636,16 +5546,16 @@ /* d0 is a variable, check whether we need to globalise it */ if (pt0 <= HR || pt0 >= YREG) { /* variable is safe */ - XREG(PREG->u.yx.x) = Unsigned(pt0); + XREG(PREG->y_u.yx.x) = Unsigned(pt0); PREG = NEXTOP(PREG, yx); GONext(); } else { /* create a new Heap variable and bind our variable to it */ Bind_Local(pt0, Unsigned(HR)); - XREG(PREG->u.yx.x) = (CELL) HR; + XREG(PREG->y_u.yx.x) = (CELL) HR; RESET_VARIABLE(HR); - H++; + HR++; PREG = NEXTOP(PREG, yx); GONext(); } @@ -5656,8 +5566,8 @@ Op(traced_put_atom, xc); EMIT_ENTRY_BLOCK(PREG,PUT_ATOM_INSTINIT); BEGD(d0); - d0 = PREG->u.xc.c; - XREG(PREG->u.xc.x) = d0; + d0 = PREG->y_u.xc.c; + XREG(PREG->y_u.xc.x) = d0; PREG = NEXTOP(PREG, xc); GONext(); ENDD(d0); @@ -5666,8 +5576,8 @@ Op(traced_put_dbterm, xD); EMIT_ENTRY_BLOCK(PREG,PUT_DBTERM_INSTINIT); BEGD(d0); - d0 = PREG->u.xD.D; - XREG(PREG->u.xD.x) = d0; + d0 = PREG->y_u.xD.D; + XREG(PREG->y_u.xD.x) = d0; PREG = NEXTOP(PREG, xD); GONext(); ENDD(d0); @@ -5676,8 +5586,8 @@ Op(traced_put_bigint, xN); EMIT_ENTRY_BLOCK(PREG,PUT_BIGINT_INSTINIT); BEGD(d0); - d0 = PREG->u.xN.b; - XREG(PREG->u.xN.x) = d0; + d0 = PREG->y_u.xN.b; + XREG(PREG->y_u.xN.x) = d0; PREG = NEXTOP(PREG, xN); GONext(); ENDD(d0); @@ -5686,8 +5596,8 @@ Op(traced_put_float, xd); EMIT_ENTRY_BLOCK(PREG,PUT_FLOAT_INSTINIT); BEGD(d0); - d0 = AbsAppl(PREG->u.xd.d); - XREG(PREG->u.xd.x) = d0; + d0 = AbsAppl(PREG->y_u.xd.d); + XREG(PREG->y_u.xd.x) = d0; PREG = NEXTOP(PREG, xd); GONext(); ENDD(d0); @@ -5696,8 +5606,8 @@ Op(traced_put_longint, xi); EMIT_ENTRY_BLOCK(PREG,PUT_LONGINT_INSTINIT); BEGD(d0); - d0 = AbsAppl(PREG->u.xi.i); - XREG(PREG->u.xi.x) = d0; + d0 = AbsAppl(PREG->y_u.xi.i); + XREG(PREG->y_u.xi.x) = d0; PREG = NEXTOP(PREG, xi); GONext(); ENDD(d0); @@ -5711,7 +5621,7 @@ HR += 2; BEGD(d0); d0 = AbsPair(S_SREG); - XREG(PREG->u.x.x) = d0; + XREG(PREG->y_u.x.x) = d0; PREG = NEXTOP(PREG, x); ENDD(d0); WRITEBACK_S(S_SREG); @@ -5723,11 +5633,11 @@ EMIT_ENTRY_BLOCK(PREG,PUT_STRUCT_INSTINIT); BEGD(d0); d0 = AbsAppl(HR); - XREG(PREG->u.xfa.x) = d0; - d0 = (CELL) (PREG->u.xfa.f); - *H++ = d0; + XREG(PREG->y_u.xfa.x) = d0; + d0 = (CELL) (PREG->y_u.xfa.f); + *HR++ = d0; SREG = HR; - HR += PREG->u.xfa.a; + HR += PREG->y_u.xfa.a; ENDD(d0); PREG = NEXTOP(PREG, xfa); GONext(); @@ -5739,7 +5649,7 @@ Op(traced_write_x_var, x); EMIT_ENTRY_BLOCK(PREG,WRITE_X_VAR_INSTINIT); - XREG(PREG->u.x.x) = Unsigned(SREG); + XREG(PREG->y_u.x.x) = Unsigned(SREG); PREG = NEXTOP(PREG, x); RESET_VARIABLE(SREG); SREG++; @@ -5757,7 +5667,7 @@ Op(traced_write_n_voids, s); EMIT_ENTRY_BLOCK(PREG,WRITE_N_VOIDS_INSTINIT); BEGD(d0); - d0 = PREG->u.s.s; + d0 = PREG->y_u.s.s; PREG = NEXTOP(PREG, s); for (; d0 > 0; d0--) { RESET_VARIABLE(SREG); @@ -5769,7 +5679,7 @@ Op(traced_write_y_var, y); EMIT_ENTRY_BLOCK(PREG,WRITE_Y_VAR_INSTINIT); - INITIALIZE_PERMVAR(YREG+PREG->u.y.y,Unsigned(SREG)); + INITIALIZE_PERMVAR(YREG+PREG->y_u.y.y,Unsigned(SREG)); PREG = NEXTOP(PREG, y); RESET_VARIABLE(SREG); SREG++; @@ -5779,7 +5689,7 @@ Op(traced_write_x_val, x); EMIT_ENTRY_BLOCK(PREG,WRITE_X_VAL_INSTINIT); BEGD(d0); - d0 = XREG(PREG->u.x.x); + d0 = XREG(PREG->y_u.x.x); *SREG++ = d0; ENDD(d0); PREG = NEXTOP(PREG, x); @@ -5789,7 +5699,7 @@ Op(traced_write_x_loc, x); EMIT_ENTRY_BLOCK(PREG,WRITE_X_LOC_INSTINIT); BEGD(d0); - d0 = XREG(PREG->u.x.x); + d0 = XREG(PREG->y_u.x.x); PREG = NEXTOP(PREG, x); profiled_deref_head_TEST(d0, traced_w_x_unk); traced_w_x_bound: @@ -5827,10 +5737,10 @@ Op(traced_write_y_val, y); EMIT_ENTRY_BLOCK(PREG,WRITE_Y_VAL_INSTINIT); BEGD(d0); - d0 = YREG[PREG->u.y.y]; + d0 = YREG[PREG->y_u.y.y]; #ifdef YAPOR_SBA if (d0 == 0) /* new variable */ - *SREG++ = (CELL)(YREG+PREG->u.y.y); + *SREG++ = (CELL)(YREG+PREG->y_u.y.y); else #endif *SREG++ = d0; @@ -5843,7 +5753,7 @@ EMIT_ENTRY_BLOCK(PREG,WRITE_Y_LOC_INSTINIT); BEGD(d0); BEGP(pt0); - pt0 = YREG+PREG->u.y.y; + pt0 = YREG+PREG->y_u.y.y; d0 = *pt0; profiled_deref_head_TEST(d0, traced_w_y_unk); traced_w_y_bound: @@ -5882,7 +5792,7 @@ Op(traced_write_atom, c); EMIT_ENTRY_BLOCK(PREG,WRITE_ATOM_INSTINIT); BEGD(d0); - d0 = PREG->u.c.c; + d0 = PREG->y_u.c.c; *SREG++ = d0; ENDD(d0); PREG = NEXTOP(PREG, c); @@ -5892,7 +5802,7 @@ Op(traced_write_bigint, N); EMIT_ENTRY_BLOCK(PREG,WRITE_BIGINT_INSTINIT); BEGD(d0); - d0 = PREG->u.N.b; + d0 = PREG->y_u.N.b; *SREG++ = d0; ENDD(d0); PREG = NEXTOP(PREG, N); @@ -5902,7 +5812,7 @@ Op(traced_write_dbterm, D); EMIT_ENTRY_BLOCK(PREG,WRITE_DBTERM_INSTINIT); BEGD(d0); - d0 = PREG->u.D.D; + d0 = PREG->y_u.D.D; *SREG++ = d0; ENDD(d0); PREG = NEXTOP(PREG, D); @@ -5912,7 +5822,7 @@ Op(traced_write_float, d); EMIT_ENTRY_BLOCK(PREG,WRITE_FLOAT_INSTINIT); BEGD(d0); - d0 = AbsAppl(PREG->u.d.d); + d0 = AbsAppl(PREG->y_u.d.d); *SREG++ = d0; ENDD(d0); PREG = NEXTOP(PREG, d); @@ -5922,7 +5832,7 @@ Op(traced_write_longint, i); EMIT_ENTRY_BLOCK(PREG,WRITE_LONGIT_INSTINIT); BEGD(d0); - d0 = AbsAppl(PREG->u.i.i); + d0 = AbsAppl(PREG->y_u.i.i); *SREG++ = d0; ENDD(d0); PREG = NEXTOP(PREG, i); @@ -5933,8 +5843,8 @@ EMIT_ENTRY_BLOCK(PREG,WRITE_N_ATOMS_INSTINIT); BEGD(d0); BEGD(d1); - d0 = PREG->u.sc.s; - d1 = PREG->u.sc.c; + d0 = PREG->y_u.sc.s; + d1 = PREG->y_u.sc.c; for (; d0 > 0; d0--) { *SREG++ = d1; } @@ -5985,11 +5895,11 @@ SP[-1] = Unsigned(SREG); SP[-2] = 1; /* Put instructions follow the main stream */ SP -= 2; - d0 = (CELL) (PREG->u.fa.f); - *H++ = d0; + d0 = (CELL) (PREG->y_u.fa.f); + *HR++ = d0; ENDD(d0); BEGD(d0); - d0 = PREG->u.fa.a; + d0 = PREG->y_u.fa.a; PREG = NEXTOP(PREG, fa); SREG = HR; HR += d0; @@ -6002,12 +5912,12 @@ BEGD(d0); d0 = AbsAppl(HR); *SREG = d0; - d0 = (CELL) (PREG->u.fa.f); - *H++ = d0; + d0 = (CELL) (PREG->y_u.fa.f); + *HR++ = d0; SREG = HR; ENDD(d0); BEGD(d0); - d0 = PREG->u.fa.a; + d0 = PREG->y_u.fa.a; PREG = NEXTOP(PREG, fa); HR += d0; ENDD(d0); @@ -6024,56 +5934,56 @@ Op(traced_save_pair_x, ox); EMIT_ENTRY_BLOCK(PREG,SAVE_PAIR_X_INSTINIT); - XREG(PREG->u.ox.x) = AbsPair(SREG); + XREG(PREG->y_u.ox.x) = AbsPair(SREG); PREG = NEXTOP(PREG, ox); GONext(); ENDOp(); OpW(traced_save_pair_x_write, ox); EMIT_ENTRY_BLOCK(PREG,SAVE_PAIR_X_WRITE_INSTINIT); - XREG(PREG->u.ox.x) = AbsPair(SREG); + XREG(PREG->y_u.ox.x) = AbsPair(SREG); PREG = NEXTOP(PREG, ox); GONextW(); ENDOpW(); Op(traced_save_pair_y, oy); EMIT_ENTRY_BLOCK(PREG,SAVE_PAIR_Y_INSTINIT); - INITIALIZE_PERMVAR(YREG+PREG->u.oy.y,AbsPair(SREG)); + INITIALIZE_PERMVAR(YREG+PREG->y_u.oy.y,AbsPair(SREG)); PREG = NEXTOP(PREG, oy); GONext(); ENDOp(); OpW(traced_save_pair_y_write, oy); EMIT_ENTRY_BLOCK(PREG,SAVE_PAIR_Y_WRITE_INSTINIT); - INITIALIZE_PERMVAR(YREG+PREG->u.oy.y,AbsPair(SREG)); + INITIALIZE_PERMVAR(YREG+PREG->y_u.oy.y,AbsPair(SREG)); PREG = NEXTOP(PREG, oy); GONextW(); ENDOpW(); Op(traced_save_appl_x, ox); EMIT_ENTRY_BLOCK(PREG,SAVE_APPL_X_INSTINIT); - XREG(PREG->u.ox.x) = AbsAppl(SREG - 1); + XREG(PREG->y_u.ox.x) = AbsAppl(SREG - 1); PREG = NEXTOP(PREG, ox); GONext(); ENDOp(); OpW(traced_save_appl_x_write, ox); EMIT_ENTRY_BLOCK(PREG,SAVE_APPL_X_WRITE_INSTINIT); - XREG(PREG->u.ox.x) = AbsAppl(SREG - 1); + XREG(PREG->y_u.ox.x) = AbsAppl(SREG - 1); PREG = NEXTOP(PREG, ox); GONextW(); ENDOpW(); Op(traced_save_appl_y, oy); EMIT_ENTRY_BLOCK(PREG,SAVE_APPL_Y_INSTINIT); - INITIALIZE_PERMVAR(YREG+PREG->u.oy.y,AbsAppl(SREG-1)); + INITIALIZE_PERMVAR(YREG+PREG->y_u.oy.y,AbsAppl(SREG-1)); PREG = NEXTOP(PREG, oy); GONext(); ENDOp(); OpW(traced_save_appl_y_write, oy); EMIT_ENTRY_BLOCK(PREG,SAVE_APPL_Y_WRITE_INSTINIT); - INITIALIZE_PERMVAR(YREG+PREG->u.oy.y,AbsAppl(SREG-1)); + INITIALIZE_PERMVAR(YREG+PREG->y_u.oy.y,AbsAppl(SREG-1)); PREG = NEXTOP(PREG, oy); GONextW(); ENDOpW(); @@ -6085,7 +5995,7 @@ BOp(traced_jump, l); EMIT_ENTRY_BLOCK(PREG,JUMP_INSTINIT); - PREG = PREG->u.l.l; + PREG = PREG->y_u.l.l; JMPNext(); ENDBOp(); @@ -6124,7 +6034,7 @@ EMIT_SIMPLE_BLOCK_TEST(EITHER_POST_COROUTINING); BEGD(d0); /* Try to preserve the environment */ - d0 = PREG->u.Osblp.s; + d0 = PREG->y_u.Osblp.s; BEGCHO(pt1); pt1 = (choiceptr) ((char *) YREG + (yslot) d0); EMIT_SIMPLE_BLOCK_TEST(EITHER_FROZEN_YSBA); @@ -6144,7 +6054,7 @@ EMIT_SIMPLE_BLOCK_TEST(EITHER_POST_FROZEN_YSBA); pt1 = (choiceptr)(((CELL *) pt1)-1); *(CELL **) pt1 = YREG; - store_yaam_regs_for_either(PREG->u.Osblp.l, PREG); + store_yaam_regs_for_either(PREG->y_u.Osblp.l, PREG); SREG = (CELL *) (B = pt1); #ifdef YAPOR EMIT_SIMPLE_BLOCK_TEST(EITHER_YAPOR); @@ -6163,7 +6073,7 @@ ///#ifdef PROFILED_ABSMI EMIT_ENTRY_BLOCK(PREG,OR_ELSE_INSTINIT); ///#endif - HR = HRBREG = PROTECT_FROZEN_H(B); + HR = HBREG = PROTECT_FROZEN_H(B); ENV = B->cp_env; B->cp_cp = PREG; #ifdef DEPTH_LIMIT @@ -6181,13 +6091,13 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(OR_ELSE_YAPOR); ///#endif - SCH_new_alternative(PREG, PREG->u.Osblp.l); + SCH_new_alternative(PREG, PREG->y_u.Osblp.l); } else #endif /* YAPOR */ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(OR_ELSE_END); ///#endif - B->cp_ap = PREG->u.Osblp.l; + B->cp_ap = PREG->y_u.Osblp.l; PREG = NEXTOP(PREG, Osblp); YREG = (CELL *) B->cp_a1; GONext(); @@ -6204,7 +6114,7 @@ #ifdef YAPOR if (SCH_top_shared_cp(B)) { EMIT_SIMPLE_BLOCK_TEST(OR_LAST_IFOK_INIT); - H = HRBREG = PROTECT_FROZEN_H(pt0); + H = HBREG = PROTECT_FROZEN_H(pt0); YREG = (CELL *) pt0->cp_a1; ENV = pt0->cp_env; #ifdef DEPTH_LIMIT @@ -6219,7 +6129,7 @@ { EMIT_SIMPLE_BLOCK_TEST(OR_LAST_NOIF_INIT); B = pt0->cp_b; - H = PROTECT_FROZEN_H(pt0); + HR = PROTECT_FROZEN_H(pt0); YREG = (CELL *) pt0->cp_a1; ENV = pt0->cp_env; #ifdef DEPTH_LIMIT @@ -6251,7 +6161,7 @@ EMIT_ENTRY_BLOCK(PREG,POP_N_INSTINIT); EMIT_MULTIPLE_DESTINY_BLOCK_TEST(POP_N_END); BEGD(d0); - d0 = PREG->u.os.s; + d0 = PREG->y_u.os.s; SP = (CELL *) (((char *) SP) + d0); ENDD(d0); BEGD(d0); @@ -6306,7 +6216,7 @@ EMIT_SIMPLE_BLOCK_TEST(YAAM_CHECK_TRAIL_TR); check_trail(TR); EMIT_SIMPLE_BLOCK_TEST(CALL_CPRED_TEST_STACK); - if (!(PREG->u.Osbpp.p->PredFlags & (SafePredFlag|HiddenPredFlag))) { + if (!(PREG->y_u.Osbpp.p->PredFlags & (SafePredFlag|HiddenPredFlag))) { CACHE_Y_AS_ENV(YREG); EMIT_SIMPLE_BLOCK_TEST(NoStackCall_Exception); check_stack(NoStackCall, HR); @@ -6326,22 +6236,22 @@ ASP = (CELL *)top_b; #endif /* YAPOR_SBA */ else - ASP = (CELL *)(((char *)YREG) + PREG->u.Osbpp.s); + ASP = (CELL *)(((char *)YREG) + PREG->y_u.Osbpp.s); } #else EMIT_SIMPLE_BLOCK_TEST(CALL_CPRED_NOFROZEN); - SET_ASP(YREG, PREG->u.Osbpp.s); + 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) { EMIT_SIMPLE_BLOCK_TEST(CALL_CPRED_LOW_LEVEL_TRACER); - low_level_trace(enter_pred,PREG->u.Osbpp.p,XREGS+1); + low_level_trace(enter_pred,PREG->y_u.Osbpp.p,XREGS+1); } #endif /* LOW_LEVEL_TRACE */ EMIT_SIMPLE_BLOCK_TEST(CALL_CPRED_POST_LOW_LEVEL_TRACER); BEGD(d0); - CPredicate f = PREG->u.Osbpp.p->cs.f_code; + CPredicate f = PREG->y_u.Osbpp.p->cs.f_code; PREG = NEXTOP(PREG, Osbpp); saveregs(); d0 = (f)(PASS_REGS1); @@ -6395,7 +6305,7 @@ /* for slots to work */ #endif /* FROZEN_STACKS */ EMIT_SIMPLE_BLOCK_TEST(EXECUTE_CPRED_POST_FROZEN); - pt0 = PREG->u.pp.p; + pt0 = PREG->y_u.pp.p; #ifdef LOW_LEVEL_TRACER if (Yap_do_low_level_trace) { EMIT_SIMPLE_BLOCK_TEST(EXECUTE_CPRED_LOW_LEVEL_TRACER); @@ -6442,7 +6352,7 @@ /* now call C-Code */ EMIT_MULTIPLE_DESTINY_BLOCK_TEST(EXECUTE_CPRED_END); { - CPredicate f = PREG->u.pp.p->cs.f_code; + CPredicate f = PREG->y_u.pp.p->cs.f_code; yamop *oldPREG = PREG; saveregs(); d0 = (f)(PASS_REGS1); @@ -6486,7 +6396,7 @@ #ifdef LOW_LEVEL_TRACER if (Yap_do_low_level_trace) { EMIT_SIMPLE_BLOCK_TEST(CALL_USERCPRED_LOW_LEVEL_TRACER); - low_level_trace(enter_pred,PREG->u.Osbpp.p,XREGS+1); + low_level_trace(enter_pred,PREG->y_u.Osbpp.p,XREGS+1); } #endif /* LOW_LEVEL_TRACE */ EMIT_SIMPLE_BLOCK_TEST(CALL_USERCPRED_FROZEN); @@ -6501,10 +6411,10 @@ ASP = (CELL *) top_b; #endif /* YAPOR_SBA */ else - ASP = (CELL *)(((char *)YREG) + PREG->u.Osbpp.s); + ASP = (CELL *)(((char *)YREG) + PREG->y_u.Osbpp.s); } #else - SET_ASP(YREG, PREG->u.Osbpp.s); + SET_ASP(YREG, PREG->y_u.Osbpp.s); /* for slots to work */ #endif /* FROZEN_STACKS */ { @@ -6515,7 +6425,7 @@ Yap_StartSlots( PASS_REGS1 ); LOCAL_PrologMode = UserCCallMode; { - PredEntry *p = PREG->u.Osbpp.p; + PredEntry *p = PREG->y_u.Osbpp.p; PREG = NEXTOP(PREG, Osbpp); savedP = PREG; @@ -6524,7 +6434,6 @@ SREG = (CELL *) YAP_Execute(p, p->cs.f_code); } - Yap_CloseSlots( PASS_REGS1 ); setregs(); LOCAL_PrologMode = UserMode; restore_machine_regs(); @@ -6549,7 +6458,7 @@ //printf("call_c_wfail!!\n\n"); #ifdef LOW_LEVEL_TRACER if (Yap_do_low_level_trace) { - low_level_trace(enter_pred,PREG->u.slp.p,XREGS+1); + low_level_trace(enter_pred,PREG->y_u.slp.p,XREGS+1); } #endif /* LOW_LEVEL_TRACE */ #ifdef FROZEN_STACKS @@ -6562,7 +6471,7 @@ #endif /* YAPOR_SBA */ else { BEGD(d0); - d0 = PREG->u.slp.s; + d0 = PREG->y_u.slp.s; ASP = ((CELL *)YREG) + d0; ENDD(d0); } @@ -6572,13 +6481,13 @@ ASP = (CELL *) B; else { BEGD(d0); - d0 = PREG->u.slp.s; + d0 = PREG->y_u.slp.s; ASP = ((CELL *) YREG) + d0; ENDD(d0); } #endif /* FROZEN_STACKS */ { - CPredicate f = PREG->u.slp.p->cs.f_code; + CPredicate f = PREG->y_u.slp.p->cs.f_code; saveregs(); SREG = (CELL *)((f)(PASS_REGS1)); setregs(); @@ -6586,7 +6495,7 @@ if (!SREG) { /* be careful about error handling */ if (PREG != FAILCODE) - PREG = PREG->u.slp.l; + PREG = PREG->y_u.slp.l; } else { PREG = NEXTOP(PREG, slp); } @@ -6604,8 +6513,8 @@ /* Alocate space for the cut_c structure*/ CUT_C_PUSH(NEXTOP(NEXTOP(PREG,OtapFs),OtapFs),S_YREG); #endif - S_YREG = S_YREG - PREG->u.OtapFs.extra; - store_args(PREG->u.OtapFs.s); + 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 @@ -6617,7 +6526,7 @@ traced_TRYCC: ASP = (CELL *)B; { - CPredicate f = (CPredicate)(PREG->u.OtapFs.f); + CPredicate f = (CPredicate)(PREG->y_u.OtapFs.f); saveregs(); SREG = (CELL *) ((f) (PASS_REGS1)); /* This last instruction changes B B*/ @@ -6663,23 +6572,21 @@ #ifdef DEPTH_LIMIT DEPTH =B->cp_depth; #endif - HRBREG = HR; - restore_args(PREG->u.OtapFs.s); + HBREG = HR; + restore_args(PREG->y_u.OtapFs.s); ENDCACHE_Y(); goto traced_TRYCC; ENDBOp(); -#ifdef CUT_C BOp(traced_cut_c, OtapFs); //printf("cut_c!!\n"); /*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*/ + printf ("ERROR: Should not print this message FILE: absmi.c %d\n",__LINE__); ENDBOp(); -#endif BOp(traced_try_userc, OtapFs); //printf("try_userc!!\n\n"); @@ -6691,8 +6598,8 @@ /* Alocate space for the cut_c structure*/ CUT_C_PUSH(NEXTOP(NEXTOP(PREG,OtapFs),OtapFs),S_YREG); #endif - S_YREG = S_YREG - PREG->u.OtapFs.extra; - store_args(PREG->u.OtapFs.s); + 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 @@ -6706,12 +6613,11 @@ Yap_StartSlots( PASS_REGS1 ); saveregs(); save_machine_regs(); - SREG = (CELL *) YAP_ExecuteFirst(PREG->u.OtapFs.p, (CPredicate)(PREG->u.OtapFs.f)); - EX = 0L; + SREG = (CELL *) YAP_ExecuteFirst(PREG->y_u.OtapFs.p, (CPredicate)(PREG->y_u.OtapFs.f)); + EX = NULL; restore_machine_regs(); setregs(); LOCAL_PrologMode = UserMode; - Yap_CloseSlots( PASS_REGS1 ); if (!SREG) { TRACED_FAIL(); } @@ -6740,22 +6646,19 @@ #ifdef DEPTH_LIMIT DEPTH =B->cp_depth; #endif - HRBREG = HR; - restore_args(PREG->u.OtapFs.s); + HBREG = HR; + restore_args(PREG->y_u.OtapFs.s); ENDCACHE_Y(); - LOCAL_PrologMode = UserCCallMode; + LOCAL_PrologMode |= UserCCallMode; SET_ASP(YREG, E_CB*sizeof(CELL)); - /* for slots to work */ - Yap_StartSlots( PASS_REGS1 ); saveregs(); save_machine_regs(); - SREG = (CELL *) YAP_ExecuteNext(PREG->u.OtapFs.p, (CPredicate)(PREG->u.OtapFs.f)); - EX = 0L; + SREG = (CELL *) YAP_ExecuteNext(PREG->y_u.OtapFs.p, (CPredicate)(PREG->y_u.OtapFs.f)); + EX = NULL; restore_machine_regs(); setregs(); LOCAL_PrologMode = UserMode; - Yap_CloseSlots( PASS_REGS1 ); if (!SREG) { #ifdef CUT_C /* Removes the cut functions from the stack @@ -6885,19 +6788,24 @@ JMPNext(); ENDBOp(); -#if THREADS BOp(traced_thread_local, e); - EMIT_ENTRY_BLOCK(PREG,THREAD_LOCAL_INSTINIT); { +#if THREADS + EMIT_ENTRY_BLOCK(PREG,THREAD_LOCAL_INSTINIT); PredEntry *ap = PredFromDefCode(PREG); ap = Yap_GetThreadPred(ap PASS_REGS); PREG = ap->CodeOfPred; - /* for profiler */ - save_pc(); - } +#else + saveregs(); + undef_goal( PASS_REGS1 ); + setregs(); + /* for profiler */ +#endif + CACHE_A1(); + } + JMPNext(); ENDBOp(); -#endif BOp(traced_expand_index, e); { @@ -6978,7 +6886,7 @@ ///#ifdef PROFILED_ABSMI EMIT_ENTRY_BLOCK(PREG,EXPAND_CLAUSES_INSTINIT); ///#endif - PredEntry *pe = PREG->u.sssllp.p; + PredEntry *pe = PREG->y_u.sssllp.p; yamop *pt0; /* update ASP before calling IPred */ @@ -7054,7 +6962,7 @@ } else { HR[d0 + 2] = AbsAppl(HR); - *H = (CELL) pe->FunctorOfPred; + *HR = (CELL) pe->FunctorOfPred; HR++; BEGP(pt1); pt1 = XREGS + 1; @@ -7066,7 +6974,7 @@ deref_head(d1, traced_undef_unk); traced_undef_nonvar: /* just copy it to the heap */ - *H++ = d1; + *HR++ = d1; continue; do { @@ -7078,7 +6986,7 @@ if (pt0 <= HR) { /* variable is safe */ - *H++ = (CELL)pt0; + *HR++ = (CELL)pt0; } else { /* bind it, in case it is a local variable */ d1 = Unsigned(HR); @@ -7092,9 +7000,9 @@ ENDP(pt1); } ENDD(d0); - H[0] = Yap_Module_Name(pe); + HR[0] = Yap_Module_Name(pe); ARG1 = (Term) AbsPair(HR); - H += 2; + HR += 2; #ifdef LOW_LEVEL_TRACER if (Yap_do_low_level_trace) { low_level_trace(enter_pred,UndefCode,XREGS+1); @@ -7190,8 +7098,9 @@ JMPNext(); } } - if (!LOCAL_DebugOn) { + if (1 /* !LOCAL_DebugOn */) { ///#ifdef PROFILED_ABSMI + EMIT_SIMPLE_BLOCK(SPY_PRED_FOURTHIFOK); ///#endif PREG = pe->cs.p_code.TrueCodeOfPred; @@ -7214,7 +7123,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(SPY_PRED_D0ISNOZERO_INIT); ///#endif - *H = (CELL) pe->FunctorOfPred; + *HR = (CELL) pe->FunctorOfPred; HR[d0 + 2] = AbsAppl(HR); HR++; BEGP(pt1); @@ -7233,7 +7142,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(SPY_PRED_D0ISNOZERO_INSIDEFOR_DOSPY_NONVAR); ///#endif - *H++ = d1; + *HR++ = d1; continue; derefa_body(d1, pt0, traced_dospy_unk, traced_dospy_nonvar); @@ -7242,7 +7151,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(SPY_PRED_D0ISNOZERO_INSIDEFOR_SAFEVAR); ///#endif - *H++ = (CELL)pt0; + *HR++ = (CELL)pt0; } else { /* bind it, in case it is a local variable */ ///#ifdef PROFILED_ABSMI @@ -7262,7 +7171,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(SPY_PRED_POST_IFS); ///#endif - H[0] = Yap_Module_Name(pe); + HR[0] = Yap_Module_Name(pe); } ARG1 = (Term) AbsPair(HR); HR += 2; @@ -7317,9 +7226,9 @@ check_trail(TR); CACHE_Y(YREG); /* Point AP to the code that follows this instruction */ - store_at_least_one_arg(PREG->u.Otapl.s); + store_at_least_one_arg(PREG->y_u.Otapl.s); store_yaam_regs(NEXTOP(PREG, Otapl), 0); - PREG = PREG->u.Otapl.d; + PREG = PREG->y_u.Otapl.d; set_cut(S_YREG, B); B = B_YREG; #ifdef YAPOR @@ -7345,7 +7254,7 @@ B_YREG->cp_a1 = x1; B_YREG->cp_a2 = x2; } - PREG = PREG->u.l.l; + PREG = PREG->y_u.l.l; set_cut(S_YREG, B); B = B_YREG; #ifdef YAPOR @@ -7369,7 +7278,7 @@ B_YREG->cp_a2 = ARG2; B_YREG->cp_a3 = ARG3; } - PREG = PREG->u.l.l; + PREG = PREG->y_u.l.l; set_cut(S_YREG, B); B = B_YREG; #ifdef YAPOR @@ -7394,7 +7303,7 @@ B_YREG->cp_a3 = ARG3; B_YREG->cp_a4 = ARG4; } - PREG = PREG->u.l.l; + PREG = PREG->y_u.l.l; set_cut(S_YREG, B); B = B_YREG; #ifdef YAPOR @@ -7411,7 +7320,7 @@ EMIT_ENTRY_BLOCK(PREG,RETRY_INSTINIT); CACHE_Y(B); restore_yaam_regs(NEXTOP(PREG, Otapl)); - restore_at_least_one_arg(PREG->u.Otapl.s); + restore_at_least_one_arg(PREG->y_u.Otapl.s); #ifdef FROZEN_STACKS EMIT_SIMPLE_BLOCK_TEST(RETRY_FROZEN); S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG); @@ -7423,7 +7332,7 @@ EMIT_MULTIPLE_DESTINY_BLOCK_TEST(RETRY_END); SET_BB(B_YREG); ENDCACHE_Y(); - PREG = PREG->u.Otapl.d; + PREG = PREG->y_u.Otapl.d; JMPNext(); ENDBOp(); @@ -7431,7 +7340,7 @@ EMIT_ENTRY_BLOCK(PREG,RETRY2_INSTINIT); CACHE_Y(B); restore_yaam_regs(NEXTOP(PREG, l)); - PREG = PREG->u.l.l; + PREG = PREG->y_u.l.l; ARG1 = B_YREG->cp_a1; ARG2 = B_YREG->cp_a2; #ifdef FROZEN_STACKS @@ -7452,7 +7361,7 @@ EMIT_ENTRY_BLOCK(PREG,RETRY3_INSTINIT); CACHE_Y(B); restore_yaam_regs(NEXTOP(PREG, l)); - PREG = PREG->u.l.l; + PREG = PREG->y_u.l.l; ARG1 = B_YREG->cp_a1; ARG2 = B_YREG->cp_a2; ARG3 = B_YREG->cp_a3; @@ -7474,7 +7383,7 @@ EMIT_ENTRY_BLOCK(PREG,RETRY4_INSTINIT); CACHE_Y(B); restore_yaam_regs(NEXTOP(PREG, l)); - PREG = PREG->u.l.l; + PREG = PREG->y_u.l.l; ARG1 = B_YREG->cp_a1; ARG2 = B_YREG->cp_a2; ARG3 = B_YREG->cp_a3; @@ -7500,7 +7409,7 @@ if (SCH_top_shared_cp(B)) { EMIT_SIMPLE_BLOCK_TEST(TRUST_IFOK_INIT); SCH_last_alternative(PREG, B_YREG); - restore_at_least_one_arg(PREG->u.Otapl.s); + restore_at_least_one_arg(PREG->y_u.Otapl.s); #ifdef FROZEN_STACKS EMIT_SIMPLE_BLOCK_TEST(TRUST_IFOK_FROZEN); S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG); @@ -7513,7 +7422,7 @@ { EMIT_SIMPLE_BLOCK_TEST(TRUST_NOIF_INIT); pop_yaam_regs(); - pop_at_least_one_arg(PREG->u.Otapl.s); + pop_at_least_one_arg(PREG->y_u.Otapl.s); #ifdef FROZEN_STACKS EMIT_SIMPLE_BLOCK_TEST(TRUST_NOIF_FROZEN); S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG); @@ -7523,7 +7432,7 @@ EMIT_MULTIPLE_DESTINY_BLOCK_TEST(TRUST_END); SET_BB(B_YREG); ENDCACHE_Y(); - PREG = PREG->u.Otapl.d; + PREG = PREG->y_u.Otapl.d; JMPNext(); ENDBOp(); @@ -7531,7 +7440,7 @@ EMIT_ENTRY_BLOCK(PREG,TRY_IN_INSTINIT); EMIT_MULTIPLE_DESTINY_BLOCK_TEST(TRY_IN_END); B->cp_ap = NEXTOP(PREG, l); - PREG = PREG->u.l.l; + PREG = PREG->y_u.l.l; JMPNext(); ENDBOp(); @@ -7546,7 +7455,7 @@ check_trail(TR); /* mark the indexing code */ { - LogUpdIndex *cl = PREG->u.Illss.I; + LogUpdIndex *cl = PREG->y_u.Illss.I; PredEntry *ap = cl->ClPred; if (ap->LastCallOfPred != LUCALL_EXEC) { @@ -7561,8 +7470,8 @@ /* fprintf(stderr,"R %x--%d--%ul\n",ap,ap->TimeStampOfPred,ap->ArityOfPE);*/ } *--YREG = MkIntegerTerm(ap->TimeStampOfPred); - /* fprintf(stderr,"> %p/%p %d %d\n",cl,ap,ap->TimeStampOfPred,PREG->u.Illss.s);*/ - PREG = PREG->u.Illss.l1; + /* fprintf(stderr,"> %p/%p %d %d\n",cl,ap,ap->TimeStampOfPred,PREG->y_u.Illss.s);*/ + PREG = PREG->y_u.Illss.l1; /* indicate the indexing code is being used */ #if MULTIPLE_STACKS /* just store a reference */ @@ -7585,24 +7494,24 @@ CACHE_Y(YREG); timestamp = IntegerOfTerm(S_YREG[0]); - /* fprintf(stderr,"+ %p/%p %d %d %d--%u\n",PREG,PREG->u.OtaLl.d->ClPred,timestamp,PREG->u.OtaLl.d->ClPred->TimeStampOfPred,PREG->u.OtaLl.d->ClTimeStart,PREG->u.OtaLl.d->ClTimeEnd);*/ + /* fprintf(stderr,"+ %p/%p %d %d %d--%u\n",PREG,PREG->y_u.OtaLl.d->ClPred,timestamp,PREG->y_u.OtaLl.d->ClPred->TimeStampOfPred,PREG->y_u.OtaLl.d->ClTimeStart,PREG->y_u.OtaLl.d->ClTimeEnd);*/ /* Point AP to the code that follows this instruction */ /* always do this, even if we are not going to use it */ - store_args(PREG->u.OtaLl.s); - store_yaam_regs(PREG->u.OtaLl.n, 0); + store_args(PREG->y_u.OtaLl.s); + store_yaam_regs(PREG->y_u.OtaLl.n, 0); set_cut(S_YREG, B); B = B_YREG; #ifdef YAPOR SCH_set_load(B_YREG); #endif /* YAPOR */ #ifdef YAPOR - PP = PREG->u.OtaLl.d->ClPred; + PP = PREG->y_u.OtaLl.d->ClPred; #endif /* YAPOR */ - if (!VALID_TIMESTAMP(timestamp, PREG->u.OtaLl.d)) { + if (!VALID_TIMESTAMP(timestamp, PREG->y_u.OtaLl.d)) { /* jump to next alternative */ - PREG=PREG->u.OtaLl.n; + PREG=PREG->y_u.OtaLl.n; } else { - PREG = PREG->u.OtaLl.d->ClCode; + PREG = PREG->y_u.OtaLl.d->ClCode; } SET_BB(B_YREG); ENDCACHE_Y(); @@ -7618,23 +7527,23 @@ #if defined(YAPOR) || defined(THREADS) if (!PP) { - PP = PREG->u.OtaLl.d->ClPred; + PP = PREG->y_u.OtaLl.d->ClPred; PELOCK(15,PP); } #endif - timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[PREG->u.OtaLl.s]); - /* fprintf(stderr,"^ %p/%p %d %d %d--%u\n",PREG,PREG->u.OtaLl.d->ClPred,timestamp,PREG->u.OtaLl.d->ClPred->TimeStampOfPred,PREG->u.OtaLl.d->ClTimeStart,PREG->u.OtaLl.d->ClTimeEnd);*/ - if (!VALID_TIMESTAMP(timestamp, PREG->u.OtaLl.d)) { + timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[PREG->y_u.OtaLl.s]); + /* fprintf(stderr,"^ %p/%p %d %d %d--%u\n",PREG,PREG->y_u.OtaLl.d->ClPred,timestamp,PREG->y_u.OtaLl.d->ClPred->TimeStampOfPred,PREG->y_u.OtaLl.d->ClTimeStart,PREG->y_u.OtaLl.d->ClTimeEnd);*/ + if (!VALID_TIMESTAMP(timestamp, PREG->y_u.OtaLl.d)) { /* jump to next instruction */ - PREG=PREG->u.OtaLl.n; + PREG=PREG->y_u.OtaLl.n; JMPNext(); } - restore_yaam_regs(PREG->u.OtaLl.n); - restore_at_least_one_arg(PREG->u.OtaLl.s); + restore_yaam_regs(PREG->y_u.OtaLl.n); + restore_at_least_one_arg(PREG->y_u.OtaLl.s); #ifdef THREADS - PP = PREG->u.OtaLl.d->ClPred; + PP = PREG->y_u.OtaLl.d->ClPred; #endif - PREG = PREG->u.OtaLl.d->ClCode; + 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); @@ -7650,12 +7559,12 @@ BOp(traced_trust_logical, OtILl); CACHE_Y(B); { - LogUpdIndex *cl = PREG->u.OtILl.block; + LogUpdIndex *cl = PREG->y_u.OtILl.block; PredEntry *ap = cl->ClPred; - LogUpdClause *lcl = PREG->u.OtILl.d; + LogUpdClause *lcl = PREG->y_u.OtILl.d; UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]); - /* fprintf(stderr,"- %p/%p %d %d %p\n",PREG,ap,timestamp,ap->TimeStampOfPred,PREG->u.OtILl.d->ClCode);*/ + /* fprintf(stderr,"- %p/%p %d %d %p\n",PREG,ap,timestamp,ap->TimeStampOfPred,PREG->y_u.OtILl.d->ClCode);*/ #if defined(YAPOR) || defined(THREADS) if (!PP) { PELOCK(16,ap); @@ -7772,9 +7681,9 @@ { EMIT_ENTRY_BLOCK(PREG,USER_SWITCH_INSTINIT); EMIT_MULTIPLE_DESTINY_BLOCK_TEST(USER_SWITCH_END); - yamop *new = Yap_udi_search(PREG->u.lp.p); + yamop *new = Yap_udi_search(PREG->y_u.lp.p); if (!new) { - PREG = PREG->u.lp.l; + PREG = PREG->y_u.lp.l; JMPNext(); } PREG = new; @@ -7793,21 +7702,21 @@ if (IsPairTerm(d0)) { /* pair */ SREG = RepPair(d0); - copy_jmp_address(PREG->u.llll.l1); - PREG = PREG->u.llll.l1; + copy_jmp_address(PREG->y_u.llll.l1); + PREG = PREG->y_u.llll.l1; JMPNext(); } else if (!IsApplTerm(d0)) { /* constant */ - copy_jmp_address(PREG->u.llll.l2); - PREG = PREG->u.llll.l2; + copy_jmp_address(PREG->y_u.llll.l2); + PREG = PREG->y_u.llll.l2; I_R = d0; JMPNext(); } else { /* appl */ - copy_jmp_address(PREG->u.llll.l3); - PREG = PREG->u.llll.l3; + copy_jmp_address(PREG->y_u.llll.l3); + PREG = PREG->y_u.llll.l3; SREG = RepAppl(d0); JMPNext(); } @@ -7821,8 +7730,8 @@ } while (Unsigned(pt0) != (d0)); /* variable */ - copy_jmp_address(PREG->u.llll.l4); - PREG = PREG->u.llll.l4; + copy_jmp_address(PREG->y_u.llll.l4); + PREG = PREG->y_u.llll.l4; JMPNext(); ENDP(pt0); ENDD(d0); @@ -7838,7 +7747,7 @@ BOp(traced_switch_list_nl, ollll); EMIT_ENTRY_BLOCK(PREG,SWITCH_LIST_NL_INSTINIT); EMIT_MULTIPLE_DESTINY_BLOCK_TEST(SWITCH_LIST_NL_END); - ALWAYS_LOOKAHEAD(PREG->u.ollll.pop); + ALWAYS_LOOKAHEAD(PREG->y_u.ollll.pop); BEGD(d0); d0 = CACHED_A1(); #if UNIQUE_TAG_FOR_PAIRS @@ -7852,8 +7761,8 @@ if (__builtin_expect(IsPairTerm(d0),1)) { /* pair */ #endif - copy_jmp_address(PREG->u.ollll.l1); - PREG = PREG->u.ollll.l1; + copy_jmp_address(PREG->y_u.ollll.l1); + PREG = PREG->y_u.ollll.l1; SREG = RepPair(d0); ALWAYS_GONext(); } @@ -7862,19 +7771,19 @@ #endif if (d0 == TermNil) { /* empty list */ - PREG = PREG->u.ollll.l2; + PREG = PREG->y_u.ollll.l2; JMPNext(); } else { /* appl or constant */ if (IsApplTerm(d0)) { - copy_jmp_address(PREG->u.ollll.l3); - PREG = PREG->u.ollll.l3; + copy_jmp_address(PREG->y_u.ollll.l3); + PREG = PREG->y_u.ollll.l3; SREG = RepAppl(d0); JMPNext(); } else { - copy_jmp_address(PREG->u.ollll.l3); - PREG = PREG->u.ollll.l3; + copy_jmp_address(PREG->y_u.ollll.l3); + PREG = PREG->y_u.ollll.l3; I_R = d0; JMPNext(); } @@ -7889,8 +7798,8 @@ #endif ENDP(pt0); /* variable */ - copy_jmp_address(PREG->u.ollll.l4); - PREG = PREG->u.ollll.l4; + copy_jmp_address(PREG->y_u.ollll.l4); + PREG = PREG->y_u.ollll.l4; JMPNext(); ENDD(d0); } @@ -7900,28 +7809,28 @@ EMIT_ENTRY_BLOCK(PREG,SWITCH_ON_ARG_TYPE_INSTINIT); EMIT_MULTIPLE_DESTINY_BLOCK_TEST(SWITCH_ON_ARG_TYPE_END); BEGD(d0); - d0 = XREG(PREG->u.xllll.x); + d0 = XREG(PREG->y_u.xllll.x); deref_head(d0, traced_arg_swt_unk); /* nonvar */ traced_arg_swt_nvar: if (IsPairTerm(d0)) { /* pair */ - copy_jmp_address(PREG->u.xllll.l1); - PREG = PREG->u.xllll.l1; + 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->u.xllll.l2); - PREG = PREG->u.xllll.l2; + copy_jmp_address(PREG->y_u.xllll.l2); + PREG = PREG->y_u.xllll.l2; I_R = d0; JMPNext(); } else { /* appl */ - copy_jmp_address(PREG->u.xllll.l3); - PREG = PREG->u.xllll.l3; + copy_jmp_address(PREG->y_u.xllll.l3); + PREG = PREG->y_u.xllll.l3; SREG = RepAppl(d0); JMPNext(); } @@ -7929,8 +7838,8 @@ BEGP(pt0); deref_body(d0, pt0, traced_arg_swt_unk, traced_arg_swt_nvar); /* variable */ - copy_jmp_address(PREG->u.xllll.l4); - PREG = PREG->u.xllll.l4; + copy_jmp_address(PREG->y_u.xllll.l4); + PREG = PREG->y_u.xllll.l4; JMPNext(); ENDP(pt0); ENDD(d0); @@ -7940,28 +7849,28 @@ EMIT_ENTRY_BLOCK(PREG,SWITCH_ON_SUB_ARG_TYPE_INSTINIT); EMIT_MULTIPLE_DESTINY_BLOCK_TEST(SWITCH_ON_SUB_ARG_TYPE_END); BEGD(d0); - d0 = SREG[PREG->u.sllll.s]; + d0 = SREG[PREG->y_u.sllll.s]; deref_head(d0, traced_sub_arg_swt_unk); /* nonvar */ traced_sub_arg_swt_nvar: if (IsPairTerm(d0)) { /* pair */ - copy_jmp_address(PREG->u.sllll.l1); - PREG = PREG->u.sllll.l1; + 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->u.sllll.l2); - PREG = PREG->u.sllll.l2; + copy_jmp_address(PREG->y_u.sllll.l2); + PREG = PREG->y_u.sllll.l2; I_R = d0; JMPNext(); } else { /* appl */ - copy_jmp_address(PREG->u.sllll.l3); - PREG = PREG->u.sllll.l3; + copy_jmp_address(PREG->y_u.sllll.l3); + PREG = PREG->y_u.sllll.l3; SREG = RepAppl(d0); JMPNext(); } @@ -7975,8 +7884,8 @@ } while (Unsigned(pt0) != (d0)); /* variable */ - copy_jmp_address(PREG->u.sllll.l4); - PREG = PREG->u.sllll.l4; + copy_jmp_address(PREG->y_u.sllll.l4); + PREG = PREG->y_u.sllll.l4; JMPNext(); ENDP(pt0); ENDD(d0); @@ -7996,8 +7905,8 @@ BEGP(pt0); deref_body(d0, pt0, traced_jump_if_unk, traced_jump0_if_nonvar); /* variable */ - copy_jmp_address(PREG->u.l.l); - PREG = PREG->u.l.l; + copy_jmp_address(PREG->y_u.l.l); + PREG = PREG->y_u.l.l; ENDP(pt0); JMPNext(); ENDD(d0); @@ -8007,12 +7916,12 @@ EMIT_ENTRY_BLOCK(PREG,JUMP_IF_NONVAR_INSTINIT); EMIT_MULTIPLE_DESTINY_BLOCK_TEST(JUMP_IF_NONVAR_END); BEGD(d0); - d0 = XREG(PREG->u.xll.x); + d0 = XREG(PREG->y_u.xll.x); deref_head(d0, traced_jump2_if_unk); /* non var */ traced_jump2_if_nonvar: - copy_jmp_address(PREG->u.xll.l1); - PREG = PREG->u.xll.l1; + copy_jmp_address(PREG->y_u.xll.l1); + PREG = PREG->y_u.xll.l1; JMPNext(); BEGP(pt0); @@ -8038,17 +7947,17 @@ deref_head(d0, traced_if_n_unk); traced_if_n_nvar: /* not variable */ - if (d0 == PREG->u.clll.c) { + if (d0 == PREG->y_u.clll.c) { /* equal to test value */ - copy_jmp_address(PREG->u.clll.l2); - PREG = PREG->u.clll.l2; + 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->u.clll.l1); - PREG = PREG->u.clll.l1; + copy_jmp_address(PREG->y_u.clll.l1); + PREG = PREG->y_u.clll.l1; JMPNext(); } @@ -8062,8 +7971,8 @@ ENDP(pt0); /* variable */ - copy_jmp_address(PREG->u.clll.l3); - PREG = PREG->u.clll.l3; + copy_jmp_address(PREG->y_u.clll.l3); + PREG = PREG->y_u.clll.l3; JMPNext(); ENDD(d0); ENDBOp(); @@ -8084,11 +7993,11 @@ { CELL /* first, calculate the mask */ - Mask = (PREG->u.sssl.s - 1) << 1, /* next, calculate the hash function */ + Mask = (PREG->y_u.sssl.s - 1) << 1, /* next, calculate the hash function */ hash = d1 >> (HRASH_SHIFT - 1) & Mask; CELL *base; - base = (CELL *)PREG->u.sssl.l; + 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 */ @@ -8133,11 +8042,11 @@ { CELL /* first, calculate the mask */ - Mask = (PREG->u.sssl.s - 1) << 1, /* next, calculate the hash function */ + Mask = (PREG->y_u.sssl.s - 1) << 1, /* next, calculate the hash function */ hash = d1 >> (HRASH_SHIFT - 1) & Mask; CELL *base; - base = (CELL *)PREG->u.sssl.l; + 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 */ @@ -8177,7 +8086,7 @@ EMIT_MULTIPLE_DESTINY_BLOCK_TEST(GO_ON_FUNC_END); BEGD(d0); { - CELL *pt = (CELL *)(PREG->u.sssl.l); + CELL *pt = (CELL *)(PREG->y_u.sssl.l); d0 = *SREG++; if (d0 == pt[0]) { @@ -8198,7 +8107,7 @@ EMIT_MULTIPLE_DESTINY_BLOCK_TEST(GO_ON_CONS_END); BEGD(d0); { - CELL *pt = (CELL *)(PREG->u.sssl.l); + CELL *pt = (CELL *)(PREG->y_u.sssl.l); d0 = I_R; if (d0 == pt[0]) { @@ -8219,7 +8128,7 @@ EMIT_MULTIPLE_DESTINY_BLOCK_TEST(IF_FUNC_END); BEGD(d1); BEGP(pt0); - pt0 = (CELL *) PREG->u.sssl.l; + pt0 = (CELL *) PREG->y_u.sssl.l; d1 = *SREG++; while (pt0[0] != d1 && pt0[0] != (CELL)NULL ) { pt0 += 2; @@ -8236,7 +8145,7 @@ EMIT_MULTIPLE_DESTINY_BLOCK_TEST(IF_CONS_END); BEGD(d1); BEGP(pt0); - pt0 = (CELL *) PREG->u.sssl.l; + pt0 = (CELL *) PREG->y_u.sssl.l; d1 = I_R; while (pt0[0] != d1 && pt0[0] != 0L ) { pt0 += 2; @@ -8279,23 +8188,23 @@ \************************************************************************/ /* native_me */ - BOp(traced_jit_handler, jhc); + BOp(traced_jit_handler, J); /* Needs to recompile */ - if (PREG->u.jhc.jh->jitman.torecomp) { + if (PREG->y_u.J.jh->jitman.torecomp) { /* First: recompile on Smart JIT */ if (ExpEnv.config_struc.execution_mode == SMART_JIT) { - PREG->u.jhc.jh->jitman.torecomp = 0; + PREG->y_u.J.jh->jitman.torecomp = 0; recompile((void*)PREG); - if (NativeArea->area.p[PREG->u.jhc.jh->caa.naddress]) + if (NativeArea->area.p[PREG->y_u.J.jh->caa.naddress]) goto native_lbl; else { - PREG->u.jhc.jh->caa.taddress = -1; - PREG->u.jhc.jh->caa.naddress = -1; + PREG->y_u.J.jh->caa.taddress = -1; + PREG->y_u.J.jh->caa.naddress = -1; #if YAP_DBG_PREDS print_main_when_head(PREG, ON_PROFILED_INTERPRETER); #endif - PREG = NEXTOP(PREG, jhc); + PREG = NEXTOP(PREG, J); JMPNext(); } } @@ -8306,23 +8215,23 @@ if (!ExpEnv.config_struc.posthreads[i]) { yamop* pt = PREG; ExpEnv.config_struc.posthreads[i] = 1; - PREG->u.jhc.jh->jitman.used_thread = i; + PREG->y_u.J.jh->jitman.used_thread = i; if(pthread_create(&ExpEnv.config_struc.threaded_compiler_threads[i], NULL, recompile, (void*)pt)) { fprintf(stderr, "Error creating thread\n"); exit(1); } - PREG->u.jhc.jh->jitman.torecomp = 0; + PREG->y_u.J.jh->jitman.torecomp = 0; #if YAP_DBG_PREDS print_main_when_head(PREG, ON_PROFILED_INTERPRETER); #endif - PREG = NEXTOP(PREG, jhc); + PREG = NEXTOP(PREG, J); JMPNext(); } else if (i == ExpEnv.config_struc.compilation_threads) { #if YAP_DBG_PREDS print_main_when_head(PREG, ON_PROFILED_INTERPRETER); #endif - PREG = NEXTOP(PREG, jhc); + PREG = NEXTOP(PREG, J); JMPNext(); } } @@ -8330,53 +8239,55 @@ /* Does not need to recompile */ else { /* Do I have native function to execute? */ - if (PREG->u.jhc.jh->caa.naddress != -1 && NativeArea->area.p && NativeArea->area.p[PREG->u.jhc.jh->caa.naddress] && NativeArea->area.ok[PREG->u.jhc.jh->caa.naddress]) { + if (PREG->y_u.J.jh->caa.naddress != -1 && NativeArea->area.p && NativeArea->area.p[PREG->y_u.J.jh->caa.naddress] && NativeArea->area.ok[PREG->y_u.J.jh->caa.naddress]) { /* Yes, I do */ native_lbl:; void* (*callee)(yamop**,yamop**,CELL**,void*[],void*[]); void* go; - callee = (void*(*)(yamop**,yamop**,CELL**,void*[],void*[]))NativeArea->area.p[PREG->u.jhc.jh->caa.naddress]; + callee = (void*(*)(yamop**,yamop**,CELL**,void*[],void*[]))NativeArea->area.p[PREG->y_u.J.jh->caa.naddress]; - HREADPREG = PREG; + HEADPREG = PREG; #if YAP_STAT_PREDS getrusage(RUSAGE_SELF, &rustart); #endif #if YAP_DBG_PREDS if (ExpEnv.debug_struc.pprint_me.nativerun_init != 0 && ExpEnv.debug_struc.pprint_me.nativerun_init != 0x1) { fprintf(stderr, "%s:%d\n", __FILE__, __LINE__); - fprintf(stderr, "%s", (char*)ExpEnv.debug_struc.pprint_me.nativerun_init); + fprintf(stderr, "%s", (char*)ExpEnv.debug_struc.pprint_me.nativerun_init); } #endif - go = (*callee)(&PREG, &CPREG, &SREG, control_labels, OpAddress); + saveregs(); + go = (*callee)(&P, &CPREG, &S, control_labels, OpAddress); + setregs(); #if YAP_STAT_PREDS - getrusage(RUSAGE_SELF, &ruend); + getrusage(RUSAGE_SELF, &ruend); timstart = rustart.ru_utime; timend = ruend.ru_utime; - NativeArea->t_runs[HEADPREG->u.jhc.jh->caa.naddress] += (((double)timend.tv_sec - (double)timstart.tv_sec) + ((double)timend.tv_usec - (double)timstart.tv_usec) / 1000000.0); + NativeArea->t_runs[HEADPREG->y_u.J.jh->caa.naddress] += (((double)timend.tv_sec - (double)timstart.tv_sec) + ((double)timend.tv_usec - (double)timstart.tv_usec) / 1000000.0); //fprintf(stdout, "Executou nativo!!\n\n"); #endif /* Do I need to recompile? */ - if (HREADPREG->u.jhc.jh->jitman.torecomp) { + if (HEADPREG->y_u.J.jh->jitman.torecomp) { /* Yes. Manage intermediate code so that emitted BBs append to right last block */ - IntermediatecodeArea->area.isactive[HEADPREG->u.jhc.jh->caa.taddress] = 1; - BlocksContext* b = IntermediatecodeArea->area.t[HEADPREG->u.jhc.jh->caa.taddress]->bc; - set_last_deeply(b, &(IntermediatecodeArea->area.lastblock[HEADPREG->u.jhc.jh->caa.taddress])); + IntermediatecodeArea->area.isactive[HEADPREG->y_u.J.jh->caa.taddress] = 1; + BlocksContext* b = IntermediatecodeArea->area.t[HEADPREG->y_u.J.jh->caa.taddress]->bc; + set_last_deeply(b, &(IntermediatecodeArea->area.lastblock[HEADPREG->y_u.J.jh->caa.taddress])); } goto *go; } /* No, I don't. So, Did PREG reach threshold value to become hot? */ - else if (PREG->u.jhc.jh->fi.bcst.c == ExpEnv.config_struc.frequency_bound && PREG->u.jhc.jh->caa.taddress != -1 && IntermediatecodeArea->area.t && IntermediatecodeArea->area.t[PREG->u.jhc.jh->caa.taddress] && IntermediatecodeArea->area.ok[PREG->u.jhc.jh->caa.taddress]) { + else if (PREG->y_u.J.jh->fi.bcst.c == ExpEnv.config_struc.frequency_bound && PREG->y_u.J.jh->caa.taddress != -1 && IntermediatecodeArea->area.t && IntermediatecodeArea->area.t[PREG->y_u.J.jh->caa.taddress] && IntermediatecodeArea->area.ok[PREG->y_u.J.jh->caa.taddress]) { /* Yes, it did */ if (ExpEnv.config_struc.useonlypi) { /* Don't compile. Use only profiled insts. This will be executed only if "only_profiled_interpreter" is used */ - IntermediatecodeArea->area.isactive[PREG->u.jhc.jh->caa.taddress] = 0; - PREG->u.jhc.jh->fi.bcst.c = 2*ExpEnv.config_struc.frequency_bound; + IntermediatecodeArea->area.isactive[PREG->y_u.J.jh->caa.taddress] = 0; + PREG->y_u.J.jh->fi.bcst.c = 2*ExpEnv.config_struc.frequency_bound; #if YAP_DBG_PREDS print_main_when_head(PREG, ON_PROFILED_INTERPRETER); - PREG = NEXTOP(PREG, jhc); + PREG = NEXTOP(PREG, J); #endif JMPNext(); } @@ -8384,14 +8295,14 @@ /* Compile on Smart JIT */ if (ExpEnv.config_struc.execution_mode == SMART_JIT) { compile((void*)PREG); - PREG->u.jhc.jh->fi.bcst.c = 2*ExpEnv.config_struc.frequency_bound; - if (PREG->u.jhc.jh->caa.naddress != -1 && NativeArea->area.p[PREG->u.jhc.jh->caa.naddress]) // success + PREG->y_u.J.jh->fi.bcst.c = 2*ExpEnv.config_struc.frequency_bound; + if (PREG->y_u.J.jh->caa.naddress != -1 && NativeArea->area.p[PREG->y_u.J.jh->caa.naddress]) // success goto native_lbl; else { // fail #if YAP_DBG_PREDS print_main_when_head(PREG, ON_PROFILED_INTERPRETER); #endif - PREG = NEXTOP(PREG, jhc); + PREG = NEXTOP(PREG, J); JMPNext(); } } @@ -8404,23 +8315,23 @@ /* I have available thread */ yamop* pt = PREG; ExpEnv.config_struc.posthreads[i] = 1; - PREG->u.jhc.jh->jitman.used_thread = i; + PREG->y_u.J.jh->jitman.used_thread = i; if(pthread_create(&ExpEnv.config_struc.threaded_compiler_threads[i], NULL, compile, (void*)pt)) { fprintf(stderr, "Error creating thread\n"); exit(1); } - PREG->u.jhc.jh->fi.bcst.c = 2*ExpEnv.config_struc.frequency_bound; + PREG->y_u.J.jh->fi.bcst.c = 2*ExpEnv.config_struc.frequency_bound; #if YAP_DBG_PREDS print_main_when_head(PREG, ON_PROFILED_INTERPRETER); #endif - PREG = NEXTOP(PREG, jhc); + PREG = NEXTOP(PREG, J); JMPNext(); } else if (i == ExpEnv.config_struc.compilation_threads) { /* I don't have */ #if YAP_DBG_PREDS print_main_when_head(PREG, ON_PROFILED_INTERPRETER); - PREG = NEXTOP(PREG, jhc); + PREG = NEXTOP(PREG, J); #endif JMPNext(); } @@ -8428,11 +8339,11 @@ } /* No, I don't have native pointer to execute and PREG did not become hot */ else { - if (!PREG->u.jhc.jh->fi.bcst.c) PREG->u.jhc.jh->mf.isground = IsGround(PREG); - PREG->u.jhc.jh->fi.bcst.c++; + 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->u.jhc.jh->fi.bcst.c == (COUNT)(ExpEnv.config_struc.frequency_bound*(ExpEnv.config_struc.profiling_startp)) && !PREG->u.jhc.jh->mf.isground) { + 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) { /* Yes, it did So... */ critical_lbl:; @@ -8448,31 +8359,31 @@ #if YAP_STAT_PREDS IntermediatecodeArea->area.profiling_time = (double*)realloc(IntermediatecodeArea->area.profiling_time, (IntermediatecodeArea->n+1)*sizeof(double)); #endif - PREG->u.jhc.jh->caa.taddress = IntermediatecodeArea->n; + PREG->y_u.J.jh->caa.taddress = IntermediatecodeArea->n; IntermediatecodeArea->n += 1; - IntermediatecodeArea->area.isactive[PREG->u.jhc.jh->caa.taddress] = 1; - IntermediatecodeArea->area.ok[PREG->u.jhc.jh->caa.taddress] = 1; - IntermediatecodeArea->area.t[PREG->u.jhc.jh->caa.taddress] = (TraceContext*)malloc(sizeof(TraceContext)); - IntermediatecodeArea->area.t[PREG->u.jhc.jh->caa.taddress]->bc = NULL; - IntermediatecodeArea->area.t[PREG->u.jhc.jh->caa.taddress]->tracesize = 0; - IntermediatecodeArea->area.t[PREG->u.jhc.jh->caa.taddress]->n = 0; - curtrace = &IntermediatecodeArea->area.t[PREG->u.jhc.jh->caa.taddress]; + IntermediatecodeArea->area.isactive[PREG->y_u.J.jh->caa.taddress] = 1; + IntermediatecodeArea->area.ok[PREG->y_u.J.jh->caa.taddress] = 1; + IntermediatecodeArea->area.t[PREG->y_u.J.jh->caa.taddress] = (TraceContext*)malloc(sizeof(TraceContext)); + IntermediatecodeArea->area.t[PREG->y_u.J.jh->caa.taddress]->bc = NULL; + IntermediatecodeArea->area.t[PREG->y_u.J.jh->caa.taddress]->tracesize = 0; + IntermediatecodeArea->area.t[PREG->y_u.J.jh->caa.taddress]->n = 0; + curtrace = &IntermediatecodeArea->area.t[PREG->y_u.J.jh->caa.taddress]; headoftrace = PREG; ineedredefinedest = 0; /* Define NATIVE_ME_INSTINIT as simple BB on traces initialized before the latter */ EMIT_HEAD_BLOCK(PREG); - IntermediatecodeArea->area.lastblock[PREG->u.jhc.jh->caa.taddress] = (*curtrace)->bc; + IntermediatecodeArea->area.lastblock[PREG->y_u.J.jh->caa.taddress] = (*curtrace)->bc; } } - else if (PREG->u.jhc.jh->fi.bcst.c >= (COUNT)(ExpEnv.config_struc.frequency_bound*(ExpEnv.config_struc.profiling_startp)) && PREG->u.jhc.jh->fi.bcst.c < ExpEnv.config_struc.frequency_bound && !PREG->u.jhc.jh->mf.isground) { + else 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->fi.bcst.c < ExpEnv.config_struc.frequency_bound && !PREG->y_u.J.jh->mf.isground) { /* No, PREG is critical but still not hot */ EMIT_ENTRY_BLOCK(PREG,JIT_HANDLER_INSTINIT); { - curtrace = &IntermediatecodeArea->area.t[PREG->u.jhc.jh->caa.taddress]; + curtrace = &IntermediatecodeArea->area.t[PREG->y_u.J.jh->caa.taddress]; headoftrace = PREG; ineedredefinedest = 0; EMIT_HEAD_BLOCK(PREG); - IntermediatecodeArea->area.lastblock[PREG->u.jhc.jh->caa.taddress] = (*curtrace)->bc; + IntermediatecodeArea->area.lastblock[PREG->y_u.J.jh->caa.taddress] = (*curtrace)->bc; } } else { @@ -8482,7 +8393,7 @@ #if YAP_DBG_PREDS print_main_when_head(PREG, ON_PROFILED_INTERPRETER); #endif - PREG = NEXTOP(PREG, jhc); + PREG = NEXTOP(PREG, J); JMPNext(); } } @@ -8497,7 +8408,7 @@ Op(traced_p_atom_x, xl); EMIT_ENTRY_BLOCK(PREG,P_ATOM_X_INSTINIT); BEGD(d0); - d0 = XREG(PREG->u.xl.x); + d0 = XREG(PREG->y_u.xl.x); profiled_deref_head_TEST(d0, traced_atom_x_unk); traced_atom_x_nvar: if (IsAtomTerm(d0) && !IsBlob(AtomOfTerm(d0))) { @@ -8507,14 +8418,14 @@ } else { EMIT_MULTIPLE_DESTINY_BLOCK_TEST(P_ATOM_X_NOATOM); - PREG = PREG->u.xl.F; + PREG = PREG->y_u.xl.F; GONext(); } BEGP(pt0); profiled_deref_body(d0, pt0, traced_atom_x_unk, traced_atom_x_nvar); EMIT_SIMPLE_BLOCK_TEST(P_ATOM_X_NOATOM); - PREG = PREG->u.xl.F; + PREG = PREG->y_u.xl.F; GONext(); ENDP(pt0); ENDD(d0); @@ -8526,7 +8437,7 @@ ///#endif BEGD(d0); BEGP(pt0); - pt0 = YREG + PREG->u.yl.y; + pt0 = YREG + PREG->y_u.yl.y; d0 = *pt0; deref_head(d0, traced_atom_y_unk); traced_atom_y_nvar: @@ -8541,7 +8452,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_ATOM_Y_NOIF); ///#endif - PREG = PREG->u.yl.F; + PREG = PREG->y_u.yl.F; GONext(); } @@ -8549,7 +8460,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_ATOM_Y_END); //#endif - PREG = PREG->u.yl.F; + PREG = PREG->y_u.yl.F; GONext(); ENDP(pt0); ENDD(d0); @@ -8560,7 +8471,7 @@ EMIT_ENTRY_BLOCK(PREG,P_ATOMIC_X_INSTINIT); ///#endif BEGD(d0); - d0 = XREG(PREG->u.xl.x); + d0 = XREG(PREG->y_u.xl.x); deref_head(d0, traced_atomic_x_unk); traced_atomic_x_nvar: /* non variable */ @@ -8575,7 +8486,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_ATOMIC_X_VAR); ///#endif - PREG = PREG->u.xl.F; + PREG = PREG->y_u.xl.F; GONext(); } @@ -8584,7 +8495,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_ATOMIC_X_END); //#endif - PREG = PREG->u.xl.F; + PREG = PREG->y_u.xl.F; GONext(); ENDP(pt0); ENDD(d0); @@ -8596,7 +8507,7 @@ ///#endif BEGD(d0); BEGP(pt0); - pt0 = YREG + PREG->u.yl.y; + pt0 = YREG + PREG->y_u.yl.y; d0 = *pt0; deref_head(d0, traced_atomic_y_unk); traced_atomic_y_nvar: @@ -8612,7 +8523,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_ATOMIC_Y_VAR); //#endif - PREG = PREG->u.yl.F; + PREG = PREG->y_u.yl.F; GONext(); } @@ -8620,7 +8531,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_ATOMIC_Y_END); ///#endif - PREG = PREG->u.yl.F; + PREG = PREG->y_u.yl.F; GONext(); ENDP(pt0); ENDD(d0); @@ -8629,7 +8540,7 @@ Op(traced_p_integer_x, xl); EMIT_ENTRY_BLOCK(PREG,P_INTEGER_X_INSTINIT); BEGD(d0); - d0 = XREG(PREG->u.xl.x); + d0 = XREG(PREG->y_u.xl.x); profiled_deref_head_TEST(d0, traced_integer_x_unk); traced_integer_x_nvar: /* non variable */ @@ -8658,7 +8569,7 @@ EMIT_CONDITIONAL_SUCCESS("IsExtensionFunctor(f0)"); EMIT_CONDITIONAL_FAIL("(CELL)f0 == (CELL)FunctorLongInt || (CELL)f0 == (CELL)FunctorBigInt"); EMIT_MULTIPLE_DESTINY_BLOCK_TEST(P_INTEGER_X_INTEGER_X_NVAR_NOOK); - PREG = PREG->u.xl.F; + PREG = PREG->y_u.xl.F; GONext(); } } @@ -8666,13 +8577,13 @@ EMIT_CONDITIONAL_FAIL("IsIntTerm(d0)"); EMIT_CONDITIONAL_FAIL("IsApplTerm(d0)"); EMIT_SIMPLE_BLOCK_TEST(P_INTEGER_X_INTEGER_X_NVAR_NOOK); - PREG = PREG->u.xl.F; + PREG = PREG->y_u.xl.F; GONext(); BEGP(pt0); profiled_deref_body(d0, pt0, traced_integer_x_unk, traced_integer_x_nvar); EMIT_SIMPLE_BLOCK_TEST(P_INTEGER_X_INTEGER_X_UNK); - PREG = PREG->u.xl.F; + PREG = PREG->y_u.xl.F; GONext(); ENDP(pt0); ENDD(d0); @@ -8682,7 +8593,7 @@ EMIT_ENTRY_BLOCK(PREG,P_INTEGER_Y_INSTINIT); BEGD(d0); BEGP(pt0); - pt0 = YREG + PREG->u.yl.y; + pt0 = YREG + PREG->y_u.yl.y; d0 = *pt0; profiled_deref_head_TEST(d0, traced_integer_y_unk); traced_integer_y_nvar: @@ -8714,7 +8625,7 @@ EMIT_CONDITIONAL_SUCCESS("IsExtensionFunctor(f0)"); EMIT_CONDITIONAL_FAIL(FUNCTOR_LARGE_INT); EMIT_MULTIPLE_DESTINY_BLOCK_TEST(P_INTEGER_Y_INTEGER_Y_NVAR_NOOK); - PREG = PREG->u.yl.F; + PREG = PREG->y_u.yl.F; GONext(); } } @@ -8722,12 +8633,12 @@ EMIT_CONDITIONAL_FAIL("IsIntTerm(d0)"); EMIT_CONDITIONAL_FAIL("IsApplTerm(d0)"); EMIT_SIMPLE_BLOCK_TEST(P_INTEGER_Y_INTEGER_Y_NVAR_NOOK); - PREG = PREG->u.yl.F; + PREG = PREG->y_u.yl.F; GONext(); profiled_derefa_body(d0, pt0, traced_integer_y_unk, traced_integer_y_nvar); EMIT_SIMPLE_BLOCK(P_INTEGER_Y_INTEGER_Y_UNK); - PREG = PREG->u.yl.F; + PREG = PREG->y_u.yl.F; GONext(); ENDP(pt0); ENDD(d0); @@ -8736,7 +8647,7 @@ Op(traced_p_nonvar_x, xl); EMIT_ENTRY_BLOCK(PREG,P_NONVAR_X_INSTINIT); BEGD(d0); - d0 = XREG(PREG->u.xl.x); + d0 = XREG(PREG->y_u.xl.x); profiled_deref_head_TEST(d0, traced_nonvar_x_unk); traced_nonvar_x_nvar: EMIT_SIMPLE_BLOCK_TEST(P_NONVAR_X_NONVAR); @@ -8746,7 +8657,7 @@ BEGP(pt0); profiled_deref_body(d0, pt0, traced_nonvar_x_unk, traced_nonvar_x_nvar); EMIT_MULTIPLE_DESTINY_BLOCK_TEST(P_NONVAR_X_NONONVAR); - PREG = PREG->u.xl.F; + PREG = PREG->y_u.xl.F; GONext(); ENDP(pt0); ENDD(d0); @@ -8756,7 +8667,7 @@ EMIT_ENTRY_BLOCK(PREG,P_NONVAR_Y_INSTINIT); BEGD(d0); BEGP(pt0); - pt0 = YREG + PREG->u.yl.y; + pt0 = YREG + PREG->y_u.yl.y; d0 = *pt0; profiled_deref_head_TEST(d0, traced_nonvar_y_unk); traced_nonvar_y_nvar: @@ -8766,7 +8677,7 @@ profiled_derefa_body(d0, pt0, traced_nonvar_y_unk, traced_nonvar_y_nvar); EMIT_MULTIPLE_DESTINY_BLOCK_TEST(P_NONVAR_Y_NONONVAR); - PREG = PREG->u.yl.F; + PREG = PREG->y_u.yl.F; GONext(); ENDP(pt0); ENDD(d0); @@ -8777,7 +8688,7 @@ EMIT_ENTRY_BLOCK(PREG,P_NUMBER_X_INSTINIT); ///#endif BEGD(d0); - d0 = XREG(PREG->u.xl.x); + d0 = XREG(PREG->y_u.xl.x); deref_head(d0, traced_number_x_unk); traced_number_x_nvar: /* non variable */ @@ -8807,7 +8718,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_NUMBER_X_FUNCTORDEFAULT); ///#endif - PREG = PREG->u.xl.F; + PREG = PREG->y_u.xl.F; GONext(); } } @@ -8815,7 +8726,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_NUMBER_X_POST_IF); ///#endif - PREG = PREG->u.xl.F; + PREG = PREG->y_u.xl.F; GONext(); BEGP(pt0); @@ -8823,7 +8734,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_NUMBER_X_NUMBER_X_UNK); ///#endif - PREG = PREG->u.xl.F; + PREG = PREG->y_u.xl.F; GONext(); ENDP(pt0); ENDD(d0); @@ -8835,7 +8746,7 @@ ///#endif BEGD(d0); BEGP(pt0); - pt0 = YREG + PREG->u.yl.y; + pt0 = YREG + PREG->y_u.yl.y; d0 = *pt0; deref_head(d0, traced_number_y_unk); traced_number_y_nvar: @@ -8866,7 +8777,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_NUMBER_Y_FUNCTORDEFAULT); ///#endif - PREG = PREG->u.yl.F; + PREG = PREG->y_u.yl.F; GONext(); } } @@ -8874,14 +8785,14 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_NUMBER_Y_POST_IF); ///#endif - PREG = PREG->u.xl.F; + PREG = PREG->y_u.xl.F; GONext(); derefa_body(d0, pt0, traced_number_y_unk, traced_number_y_nvar); ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_NUMBER_Y_NUMBER_Y_UNK); ///#endif - PREG = PREG->u.yl.F; + PREG = PREG->y_u.yl.F; GONext(); ENDP(pt0); ENDD(d0); @@ -8890,12 +8801,12 @@ Op(traced_p_var_x, xl); EMIT_ENTRY_BLOCK(PREG,P_VAR_X_INSTINIT); BEGD(d0); - d0 = XREG(PREG->u.xl.x); + d0 = XREG(PREG->y_u.xl.x); profiled_deref_head_TEST(d0, traced_var_x_unk); traced_var_x_nvar: /* non variable */ EMIT_MULTIPLE_DESTINY_BLOCK_TEST(P_VAR_X_NONVAR); - PREG = PREG->u.xl.F; + PREG = PREG->y_u.xl.F; GONext(); BEGP(pt0); @@ -8911,13 +8822,13 @@ EMIT_ENTRY_BLOCK(PREG,P_VAR_Y_INSTINIT); BEGD(d0); BEGP(pt0); - pt0 = YREG + PREG->u.yl.y; + pt0 = YREG + PREG->y_u.yl.y; d0 = *pt0; profiled_deref_head_TEST(d0, traced_var_y_unk); traced_var_y_nvar: /* non variable */ EMIT_MULTIPLE_DESTINY_BLOCK_TEST(P_VAR_Y_NONVAR); - PREG = PREG->u.yl.F; + PREG = PREG->y_u.yl.F; GONext(); profiled_derefa_body(d0, pt0, traced_var_y_unk, traced_var_y_nvar); @@ -8933,7 +8844,7 @@ EMIT_ENTRY_BLOCK(PREG,P_DB_REF_X_INSTINIT); ///#endif BEGD(d0); - d0 = XREG(PREG->u.xl.x); + d0 = XREG(PREG->y_u.xl.x); deref_head(d0, traced_dbref_x_unk); traced_dbref_x_nvar: /* non variable */ @@ -8950,7 +8861,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_DB_REF_X_NODBREF); ///#endif - PREG = PREG->u.xl.F; + PREG = PREG->y_u.xl.F; GONext(); } @@ -8959,7 +8870,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_DB_REF_X_DBREF_X_UNK); ///#endif - PREG = PREG->u.xl.F; + PREG = PREG->y_u.xl.F; GONext(); ENDP(pt0); ENDD(d0); @@ -8971,7 +8882,7 @@ ///#endif BEGD(d0); BEGP(pt0); - pt0 = YREG + PREG->u.yl.y; + pt0 = YREG + PREG->y_u.yl.y; d0 = *pt0; deref_head(d0, traced_dbref_y_unk); traced_dbref_y_nvar: @@ -8989,7 +8900,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_DB_REF_Y_NODBREF); ///#endif - PREG = PREG->u.yl.F; + PREG = PREG->y_u.yl.F; GONext(); } @@ -8997,7 +8908,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_DB_REF_Y_DBREF_Y_UNK); ///#endif - PREG = PREG->u.yl.F; + PREG = PREG->y_u.yl.F; GONext(); ENDP(pt0); ENDD(d0); @@ -9008,7 +8919,7 @@ EMIT_ENTRY_BLOCK(PREG,P_PRIMITIVE_X_INSTINIT); ///#endif BEGD(d0); - d0 = XREG(PREG->u.xl.x); + d0 = XREG(PREG->y_u.xl.x); deref_head(d0, traced_primi_x_unk); traced_primi_x_nvar: /* non variable */ @@ -9023,7 +8934,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_PRIMITIVE_X_NOPRIMITIVE); ///#endif - PREG = PREG->u.xl.F; + PREG = PREG->y_u.xl.F; GONext(); } @@ -9032,7 +8943,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_PRIMITIVE_X_PRIMI_X_UNK); ///#endif - PREG = PREG->u.xl.F; + PREG = PREG->y_u.xl.F; GONext(); ENDP(pt0); ENDD(d0); @@ -9044,7 +8955,7 @@ ///#endif BEGD(d0); BEGP(pt0); - pt0 = YREG + PREG->u.yl.y; + pt0 = YREG + PREG->y_u.yl.y; d0 = *pt0; deref_head(d0, traced_primi_y_unk); traced_primi_y_nvar: @@ -9060,7 +8971,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_PRIMITIVE_Y_NOPRIMITIVE); ///#endif - PREG = PREG->u.yl.F; + PREG = PREG->y_u.yl.F; GONext(); } @@ -9068,7 +8979,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_PRIMITIVE_Y_PRIMI_Y_UNK); ///#endif - PREG = PREG->u.yl.F; + PREG = PREG->y_u.yl.F; GONext(); ENDP(pt0); ENDD(d0); @@ -9079,7 +8990,7 @@ EMIT_ENTRY_BLOCK(PREG,P_COMPOUND_X_INSTINIT); ///#endif BEGD(d0); - d0 = XREG(PREG->u.xl.x); + d0 = XREG(PREG->y_u.xl.x); deref_head(d0, traced_compound_x_unk); traced_compound_x_nvar: /* non variable */ @@ -9095,7 +9006,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_COMPOUND_X_APPL_IFOK); ///#endif - PREG = PREG->u.xl.F; + PREG = PREG->y_u.xl.F; GONext(); } ///#ifdef PROFILED_ABSMI @@ -9108,7 +9019,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_COMPOUND_X_NOAPPL); ///#endif - PREG = PREG->u.xl.F; + PREG = PREG->y_u.xl.F; GONext(); } @@ -9117,7 +9028,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_COMPOUND_X_COMPOUND_X_UNK); ///#endif - PREG = PREG->u.xl.F; + PREG = PREG->y_u.xl.F; GONext(); ENDP(pt0); ENDD(d0); @@ -9129,7 +9040,7 @@ ///#endif BEGD(d0); BEGP(pt0); - pt0 = YREG + PREG->u.yl.y; + pt0 = YREG + PREG->y_u.yl.y; d0 = *pt0; deref_head(d0, traced_compound_y_unk); traced_compound_y_nvar: @@ -9146,7 +9057,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_COMPOUND_Y_APPL_IFOK); ///#endif - PREG = PREG->u.yl.F; + PREG = PREG->y_u.yl.F; GONext(); } ///#ifdef PROFILED_ABSMI @@ -9159,7 +9070,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_COMPOUND_Y_NOAPPL); ///#endif - PREG = PREG->u.yl.F; + PREG = PREG->y_u.yl.F; GONext(); } @@ -9167,7 +9078,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_COMPOUND_Y_COMPOUND_Y_UNK); ///#endif - PREG = PREG->u.yl.F; + PREG = PREG->y_u.yl.F; GONext(); ENDP(pt0); ENDD(d0); @@ -9178,7 +9089,7 @@ EMIT_ENTRY_BLOCK(PREG,P_FLOAT_X_INSTINIT); ///#endif BEGD(d0); - d0 = XREG(PREG->u.xl.x); + d0 = XREG(PREG->y_u.xl.x); deref_head(d0, traced_float_x_unk); traced_float_x_nvar: /* non variable */ @@ -9192,7 +9103,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_FLOAT_X_POST_IF); ///#endif - PREG = PREG->u.xl.F; + PREG = PREG->y_u.xl.F; GONext(); BEGP(pt0); @@ -9200,7 +9111,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_FLOAT_X_FLOAT_X_UNK); ///#endif - PREG = PREG->u.xl.F; + PREG = PREG->y_u.xl.F; GONext(); ENDP(pt0); ENDD(d0); @@ -9212,7 +9123,7 @@ ///#endif BEGD(d0); BEGP(pt0); - pt0 = YREG + PREG->u.yl.y; + pt0 = YREG + PREG->y_u.yl.y; d0 = *pt0; deref_head(d0, traced_float_y_unk); traced_float_y_nvar: @@ -9227,14 +9138,14 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_FLOAT_Y_POST_IF); ///#endif - PREG = PREG->u.yl.F; + PREG = PREG->y_u.yl.F; GONext(); derefa_body(d0, pt0, traced_float_y_unk, traced_float_y_nvar); ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_FLOAT_Y_FLOAT_Y_UNK); ///#endif - PREG = PREG->u.yl.F; + PREG = PREG->y_u.yl.F; GONext(); ENDP(pt0); ENDD(d0); @@ -9244,12 +9155,12 @@ EMIT_ENTRY_BLOCK(PREG,P_PLUS_VV_INSTINIT); BEGD(d0); BEGD(d1); - d0 = XREG(PREG->u.xxx.x1); + d0 = XREG(PREG->y_u.xxx.x1); /* first check pt1 */ profiled_deref_head_TEST(d0, traced_plus_vv_unk); traced_plus_vv_nvar: EMIT_SIMPLE_BLOCK_TEST(P_PLUS_VV_PLUS_VV_NVAR); - d1 = XREG(PREG->u.xxx.x2); + d1 = XREG(PREG->y_u.xxx.x2); /* next check A2 */ profiled_deref_head_TEST(d1, traced_plus_vv_nvar_unk); traced_plus_vv_nvar_nvar: @@ -9272,7 +9183,7 @@ TRACED_FAIL(); } } - XREG(PREG->u.xxx.x) = d0; + XREG(PREG->y_u.xxx.x) = d0; PREG = NEXTOP(PREG, xxx); GONext(); @@ -9300,12 +9211,12 @@ Op(traced_p_plus_vc, xxn); EMIT_ENTRY_BLOCK(PREG,P_PLUS_VC_INSTINIT); BEGD(d0); - d0 = XREG(PREG->u.xxn.xi); + d0 = XREG(PREG->y_u.xxn.xi); /* first check pt1 */ profiled_deref_head_TEST(d0, traced_plus_vc_unk); traced_plus_vc_nvar: { - Int d1 = PREG->u.xxn.c; + Int d1 = PREG->y_u.xxn.c; if (IsIntTerm(d0)) { EMIT_CONDITIONAL_SUCCESS("IsIntTerm(d0)"); EMIT_SIMPLE_BLOCK_TEST(P_PLUS_VC_PLUS_VC_NVAR_INT); @@ -9325,7 +9236,7 @@ } } } - XREG(PREG->u.xxn.x) = d0; + XREG(PREG->y_u.xxn.x) = d0; PREG = NEXTOP(PREG, xxn); GONext(); @@ -9333,7 +9244,7 @@ profiled_deref_body(d0, pt0, traced_plus_vc_unk, traced_plus_vc_nvar); EMIT_SIMPLE_BLOCK_TEST(P_PLUS_VC_PLUS_VC_UNK); saveregs(); - Yap_NilError(INSTANTIATION_ERROR, "X is A + " Int_FORMAT, PREG->u.xxn.c); + Yap_NilError(INSTANTIATION_ERROR, "X is A + " Int_FORMAT, PREG->y_u.xxn.c); setregs(); TRACED_FAIL(); ENDP(pt0); @@ -9344,12 +9255,12 @@ EMIT_ENTRY_BLOCK(PREG,P_PLUS_Y_VV_INSTINIT); BEGD(d0); BEGD(d1); - d0 = XREG(PREG->u.yxx.x1); + d0 = XREG(PREG->y_u.yxx.x1); /* first check pt1 */ profiled_deref_head_TEST(d0, traced_plus_y_vv_unk); traced_plus_y_vv_nvar: EMIT_SIMPLE_BLOCK_TEST(P_PLUS_Y_VV_PLUS_Y_VV_NVAR); - d1 = XREG(PREG->u.xxx.x2); + d1 = XREG(PREG->y_u.xxx.x2); /* next check A2 */ profiled_deref_head_TEST(d1, traced_plus_y_vv_nvar_unk); traced_plus_y_vv_nvar_nvar: @@ -9373,7 +9284,7 @@ } } BEGP(pt0); - pt0 = YREG + PREG->u.yxx.y; + pt0 = YREG + PREG->y_u.yxx.y; PREG = NEXTOP(PREG, yxx); INITIALIZE_PERMVAR(pt0,d0); ENDP(pt0); @@ -9402,14 +9313,14 @@ Op(traced_p_plus_y_vc, yxn); BEGD(d0); - d0 = XREG(PREG->u.yxn.xi); + d0 = XREG(PREG->y_u.yxn.xi); EMIT_ENTRY_BLOCK(PREG,P_PLUS_Y_VC_INSTINIT); /* first check pt1 */ profiled_deref_head_TEST(d0, traced_plus_y_vc_unk); traced_plus_y_vc_nvar: { - Int d1 = PREG->u.yxn.c; + Int d1 = PREG->y_u.yxn.c; if (IsIntTerm(d0)) { EMIT_CONDITIONAL_SUCCESS("IsIntTerm(d0)"); EMIT_SIMPLE_BLOCK_TEST(P_PLUS_Y_VC_PLUS_Y_VC_NVAR_INT); @@ -9430,7 +9341,7 @@ } } BEGP(pt0); - pt0 = YREG + PREG->u.yxn.y; + pt0 = YREG + PREG->y_u.yxn.y; PREG = NEXTOP(PREG, yxn); INITIALIZE_PERMVAR(pt0,d0); ENDP(pt0); @@ -9440,7 +9351,7 @@ profiled_deref_body(d0, pt0, traced_plus_y_vc_unk, traced_plus_y_vc_nvar); EMIT_SIMPLE_BLOCK_TEST(P_PLUS_Y_VC_PLUS_Y_VC_UNK); saveregs(); - Yap_NilError(INSTANTIATION_ERROR, "X is A + " Int_FORMAT, PREG->u.yxn.c); + Yap_NilError(INSTANTIATION_ERROR, "X is A + " Int_FORMAT, PREG->y_u.yxn.c); setregs(); TRACED_FAIL(); ENDP(pt0); @@ -9451,12 +9362,12 @@ EMIT_ENTRY_BLOCK(PREG,P_MINUS_VV_INSTINIT); BEGD(d0); BEGD(d1); - d0 = XREG(PREG->u.xxx.x1); + d0 = XREG(PREG->y_u.xxx.x1); /* first check pt1 */ profiled_deref_head_TEST(d0, traced_minus_vv_unk); traced_minus_vv_nvar: EMIT_SIMPLE_BLOCK_TEST(P_MINUS_VV_MINUS_VV_NVAR); - d1 = XREG(PREG->u.xxx.x2); + d1 = XREG(PREG->y_u.xxx.x2); /* next check A2 */ profiled_deref_head_TEST(d1, traced_minus_vv_nvar_unk); traced_minus_vv_nvar_nvar: @@ -9479,7 +9390,7 @@ TRACED_FAIL(); } } - XREG(PREG->u.xxx.x) = d0; + XREG(PREG->y_u.xxx.x) = d0; PREG = NEXTOP(PREG, xxx); GONext(); @@ -9507,12 +9418,12 @@ Op(traced_p_minus_cv, xxn); EMIT_ENTRY_BLOCK(PREG,P_MINUS_CV_INSTINIT); BEGD(d0); - d0 = XREG(PREG->u.xxn.xi); + d0 = XREG(PREG->y_u.xxn.xi); /* first check pt1 */ profiled_deref_head_TEST(d0, traced_minus_cv_unk); traced_minus_cv_nvar: { - Int d1 = PREG->u.xxn.c; + Int d1 = PREG->y_u.xxn.c; if (IsIntTerm(d0)) { EMIT_SIMPLE_BLOCK_TEST(P_MINUS_CV_MINUS_CV_NVAR_INT); d0 = MkIntegerTerm(d1 - IntOfTerm(d0)); @@ -9530,7 +9441,7 @@ } } } - XREG(PREG->u.xxn.x) = d0; + XREG(PREG->y_u.xxn.x) = d0; PREG = NEXTOP(PREG, xxn); GONext(); @@ -9538,7 +9449,7 @@ profiled_deref_body(d0, pt0, traced_minus_cv_unk, traced_minus_cv_nvar); EMIT_SIMPLE_BLOCK_TEST(P_MINUS_CV_MINUS_CV_UNK); saveregs(); - Yap_NilError(INSTANTIATION_ERROR, "X is " Int_FORMAT "-A", PREG->u.xxn.c); + Yap_NilError(INSTANTIATION_ERROR, "X is " Int_FORMAT "-A", PREG->y_u.xxn.c); setregs(); TRACED_FAIL(); ENDP(pt0); @@ -9551,14 +9462,14 @@ ///#endif BEGD(d0); BEGD(d1); - d0 = XREG(PREG->u.yxx.x1); + d0 = XREG(PREG->y_u.yxx.x1); /* first check pt1 */ deref_head(d0, traced_minus_y_vv_unk); traced_minus_y_vv_nvar: ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_MINUS_Y_VV_MINUS_Y_VV_NVAR); ///#endif - d1 = XREG(PREG->u.xxx.x2); + d1 = XREG(PREG->y_u.xxx.x2); /* next check A2 */ deref_head(d1, traced_minus_y_vv_nvar_unk); traced_minus_y_vv_nvar_nvar: @@ -9590,7 +9501,7 @@ EMIT_SIMPLE_BLOCK(P_MINUS_Y_VV_NVAR_END); ///#endif BEGP(pt0); - pt0 = YREG + PREG->u.yxx.y; + pt0 = YREG + PREG->y_u.yxx.y; PREG = NEXTOP(PREG, yxx); INITIALIZE_PERMVAR(pt0,d0); ENDP(pt0); @@ -9626,7 +9537,7 @@ EMIT_ENTRY_BLOCK(PREG,P_MINUS_Y_CV_INSTINIT); ///#endif BEGD(d0); - d0 = XREG(PREG->u.yxn.xi); + d0 = XREG(PREG->y_u.yxn.xi); /* first check pt1 */ deref_head(d0, traced_minus_y_cv_unk); traced_minus_y_cv_nvar: @@ -9634,7 +9545,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_MINUS_Y_CV_MINUS_Y_CV_NVAR); ///#endif - Int d1 = PREG->u.yxn.c; + Int d1 = PREG->y_u.yxn.c; if (IsIntTerm(d0)) { ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_MINUS_Y_CV_INTTERM); @@ -9663,7 +9574,7 @@ EMIT_SIMPLE_BLOCK(P_MINUS_Y_CV_NVAR_END); ///#endif BEGP(pt0); - pt0 = YREG + PREG->u.yxn.y; + pt0 = YREG + PREG->y_u.yxn.y; PREG = NEXTOP(PREG, yxn); INITIALIZE_PERMVAR(pt0,d0); ENDP(pt0); @@ -9675,7 +9586,7 @@ EMIT_SIMPLE_BLOCK(P_MINUS_Y_CV_MINUS_Y_CV_UNK); ///#endif saveregs(); - Yap_NilError(INSTANTIATION_ERROR, "X is " Int_FORMAT "-A", PREG->u.yxn.c); + Yap_NilError(INSTANTIATION_ERROR, "X is " Int_FORMAT "-A", PREG->y_u.yxn.c); setregs(); TRACED_FAIL(); ENDP(pt0); @@ -9686,12 +9597,12 @@ EMIT_ENTRY_BLOCK(PREG,P_TIMES_VV_INSTINIT); BEGD(d0); BEGD(d1); - d0 = XREG(PREG->u.xxx.x1); + d0 = XREG(PREG->y_u.xxx.x1); /* first check pt1 */ profiled_deref_head_TEST(d0, traced_times_vv_unk); traced_times_vv_nvar: EMIT_SIMPLE_BLOCK_TEST(P_TIMES_VV_TIMES_VV_NVAR); - d1 = XREG(PREG->u.xxx.x2); + d1 = XREG(PREG->y_u.xxx.x2); /* next check A2 */ profiled_deref_head_TEST(d1, traced_times_vv_nvar_unk); traced_times_vv_nvar_nvar: @@ -9714,7 +9625,7 @@ TRACED_FAIL(); } } - XREG(PREG->u.xxx.x) = d0; + XREG(PREG->y_u.xxx.x) = d0; PREG = NEXTOP(PREG, xxx); GONext(); @@ -9742,12 +9653,12 @@ Op(traced_p_times_vc, xxn); EMIT_ENTRY_BLOCK(PREG,P_TIMES_VC_INSTINIT); BEGD(d0); - d0 = XREG(PREG->u.xxn.xi); + d0 = XREG(PREG->y_u.xxn.xi); /* first check pt1 */ profiled_deref_head_TEST(d0, traced_times_vc_unk); traced_times_vc_nvar: { - Int d1 = PREG->u.xxn.c; + Int d1 = PREG->y_u.xxn.c; if (IsIntTerm(d0)) { EMIT_CONDITIONAL_SUCCESS("IsIntTerm(d0)"); EMIT_SIMPLE_BLOCK_TEST(P_TIMES_VC_TIMES_VC_NVAR_INT); @@ -9767,7 +9678,7 @@ } } } - XREG(PREG->u.xxn.x) = d0; + XREG(PREG->y_u.xxn.x) = d0; PREG = NEXTOP(PREG, xxn); GONext(); @@ -9775,7 +9686,7 @@ profiled_deref_body(d0, pt0, traced_times_vc_unk, traced_times_vc_nvar); EMIT_SIMPLE_BLOCK_TEST(P_TIMES_VC_TIMES_VC_UNK); saveregs(); - Yap_NilError(INSTANTIATION_ERROR, "X is A* " Int_FORMAT, PREG->u.xxn.c); + Yap_NilError(INSTANTIATION_ERROR, "X is A* " Int_FORMAT, PREG->y_u.xxn.c); setregs(); TRACED_FAIL(); ENDP(pt0); @@ -9788,14 +9699,14 @@ ///#endif BEGD(d0); BEGD(d1); - d0 = XREG(PREG->u.yxx.x1); + d0 = XREG(PREG->y_u.yxx.x1); /* first check pt1 */ deref_head(d0, traced_times_y_vv_unk); traced_times_y_vv_nvar: ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_TIMES_Y_VV_TIMES_Y_VV_NVAR); ///#endif - d1 = XREG(PREG->u.xxx.x2); + d1 = XREG(PREG->y_u.xxx.x2); /* next check A2 */ deref_head(d1, traced_times_y_vv_nvar_unk); traced_times_y_vv_nvar_nvar: @@ -9827,7 +9738,7 @@ EMIT_SIMPLE_BLOCK(P_TIMES_Y_VV_NVAR_END); ///#endif BEGP(pt0); - pt0 = YREG + PREG->u.yxx.y; + pt0 = YREG + PREG->y_u.yxx.y; PREG = NEXTOP(PREG, yxx); INITIALIZE_PERMVAR(pt0,d0); ENDP(pt0); @@ -9861,12 +9772,12 @@ Op(traced_p_times_y_vc, yxn); EMIT_ENTRY_BLOCK(PREG,P_TIMES_Y_VC_INSTINIT); BEGD(d0); - d0 = XREG(PREG->u.yxn.xi); + d0 = XREG(PREG->y_u.yxn.xi); /* first check pt1 */ profiled_deref_head_TEST(d0, traced_times_y_vc_unk); traced_times_y_vc_nvar: { - Int d1 = PREG->u.yxn.c; + Int d1 = PREG->y_u.yxn.c; if (IsIntTerm(d0)) { EMIT_SIMPLE_BLOCK_TEST(P_TIMES_Y_VC_TIMES_Y_VC_NVAR_INT); d0 = times_int(IntOfTerm(d0), d1); @@ -9885,7 +9796,7 @@ } } BEGP(pt0); - pt0 = YREG + PREG->u.yxn.y; + pt0 = YREG + PREG->y_u.yxn.y; PREG = NEXTOP(PREG, yxn); INITIALIZE_PERMVAR(pt0,d0); ENDP(pt0); @@ -9897,7 +9808,7 @@ EMIT_SIMPLE_BLOCK_TEST(P_TIMES_Y_VC_TIMES_Y_VC_UNK); ///#endif saveregs(); - Yap_NilError(INSTANTIATION_ERROR, "X is A* " Int_FORMAT, PREG->u.yxn.c); + Yap_NilError(INSTANTIATION_ERROR, "X is A* " Int_FORMAT, PREG->y_u.yxn.c); setregs(); TRACED_FAIL(); ENDP(pt0); @@ -9908,12 +9819,12 @@ EMIT_ENTRY_BLOCK(PREG,P_DIV_VV_INSTINIT); BEGD(d0); BEGD(d1); - d0 = XREG(PREG->u.xxx.x1); + d0 = XREG(PREG->y_u.xxx.x1); /* first check pt1 */ profiled_deref_head_TEST(d0, traced_div_vv_unk); traced_div_vv_nvar: EMIT_SIMPLE_BLOCK_TEST(P_DIV_VV_DIV_VV_NVAR); - d1 = XREG(PREG->u.xxx.x2); + d1 = XREG(PREG->y_u.xxx.x2); /* next check A2 */ profiled_deref_head_TEST(d1, traced_div_vv_nvar_unk); traced_div_vv_nvar_nvar: @@ -9943,7 +9854,7 @@ TRACED_FAIL(); } } - XREG(PREG->u.xxx.x) = d0; + XREG(PREG->y_u.xxx.x) = d0; PREG = NEXTOP(PREG, xxx); GONext(); @@ -9973,7 +9884,7 @@ EMIT_ENTRY_BLOCK(PREG,P_DIV_VC_INSTINIT); ///#endif BEGD(d0); - d0 = XREG(PREG->u.xxn.xi); + d0 = XREG(PREG->y_u.xxn.xi); /* first check pt1 */ deref_head(d0, traced_div_vc_unk); traced_div_vc_nvar: @@ -9981,7 +9892,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_DIV_VC_DIV_VC_NVAR); ///#endif - Int d1 = PREG->u.xxn.c; + Int d1 = PREG->y_u.xxn.c; if (IsIntTerm(d0)) { ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_DIV_VC_INTTERM); @@ -10009,7 +9920,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_DIV_VC_NVAR_END); ///#endif - XREG(PREG->u.xxn.x) = d0; + XREG(PREG->y_u.xxn.x) = d0; PREG = NEXTOP(PREG, xxn); GONext(); @@ -10031,7 +9942,7 @@ EMIT_ENTRY_BLOCK(PREG,P_DIV_CV_INSTINIT); ///#endif BEGD(d0); - d0 = XREG(PREG->u.xxn.xi); + d0 = XREG(PREG->y_u.xxn.xi); /* first check pt1 */ deref_head(d0, traced_div_cv_unk); traced_div_cv_nvar: @@ -10039,7 +9950,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_DIV_CV_DIV_CV_NVAR); ///#endif - Int d1 = PREG->u.xxn.c; + Int d1 = PREG->y_u.xxn.c; if (IsIntTerm(d0)) { ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_DIV_CV_INTTERM_INIT); @@ -10079,7 +9990,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_DIV_CV_NVAR_END); ///#endif - XREG(PREG->u.xxn.x) = d0; + XREG(PREG->y_u.xxn.x) = d0; PREG = NEXTOP(PREG, xxn); GONext(); @@ -10089,7 +10000,7 @@ EMIT_SIMPLE_BLOCK(P_DIV_CV_DIV_CV_UNK); ///#endif saveregs(); - Yap_NilError(INSTANTIATION_ERROR, "X is " Int_FORMAT "// A", PREG->u.xxn.c); + Yap_NilError(INSTANTIATION_ERROR, "X is " Int_FORMAT "// A", PREG->y_u.xxn.c); setregs(); TRACED_FAIL(); ENDP(pt0); @@ -10102,14 +10013,14 @@ ///#endif BEGD(d0); BEGD(d1); - d0 = XREG(PREG->u.yxx.x1); + d0 = XREG(PREG->y_u.yxx.x1); /* first check pt1 */ deref_head(d0, traced_div_y_vv_unk); traced_div_y_vv_nvar: ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_DIV_Y_VV_DIV_Y_VV_NVAR); ///#endif - d1 = XREG(PREG->u.xxx.x2); + d1 = XREG(PREG->y_u.xxx.x2); /* next check A2 */ deref_head(d1, traced_div_y_vv_nvar_unk); traced_div_y_vv_nvar_nvar: @@ -10154,7 +10065,7 @@ EMIT_SIMPLE_BLOCK(P_DIV_Y_VV_NVAR_END); ///#endif BEGP(pt0); - pt0 = YREG + PREG->u.yxx.y; + pt0 = YREG + PREG->y_u.yxx.y; PREG = NEXTOP(PREG, yxx); INITIALIZE_PERMVAR(pt0,d0); ENDP(pt0); @@ -10190,7 +10101,7 @@ EMIT_ENTRY_BLOCK(PREG,P_DIV_Y_VC_INSTINIT); ///#endif BEGD(d0); - d0 = XREG(PREG->u.yxn.xi); + d0 = XREG(PREG->y_u.yxn.xi); /* first check pt1 */ deref_head(d0, traced_div_y_vc_unk); traced_div_y_vc_nvar: @@ -10198,7 +10109,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_DIV_Y_VC_DIV_Y_VC_NVAR); ///#endif - Int d1 = PREG->u.yxn.c; + Int d1 = PREG->y_u.yxn.c; if (IsIntTerm(d0)) { //#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_DIV_Y_VC_INTTERM); @@ -10227,7 +10138,7 @@ EMIT_SIMPLE_BLOCK(P_DIV_Y_VC_NVAR_END); ///#endif BEGP(pt0); - pt0 = YREG + PREG->u.yxn.y; + pt0 = YREG + PREG->y_u.yxn.y; PREG = NEXTOP(PREG, yxn); INITIALIZE_PERMVAR(pt0,d0); ENDP(pt0); @@ -10251,7 +10162,7 @@ EMIT_ENTRY_BLOCK(PREG,P_DIV_Y_CV_INSTINIT); ///#endif BEGD(d0); - d0 = XREG(PREG->u.yxn.xi); + d0 = XREG(PREG->y_u.yxn.xi); /* first check pt1 */ deref_head(d0, traced_div_y_cv_unk); traced_div_y_cv_nvar: @@ -10259,7 +10170,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_DIV_Y_CV_DIV_Y_CV_NVAR); ///#endif - Int d1 = PREG->u.yxn.c; + Int d1 = PREG->y_u.yxn.c; if (IsIntTerm(d0)) { ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_DIV_Y_CV_INTTERM_INIT); @@ -10301,7 +10212,7 @@ EMIT_SIMPLE_BLOCK(P_DIV_Y_CV_NVAR_END); ///#endif BEGP(pt0); - pt0 = YREG + PREG->u.yxn.y; + pt0 = YREG + PREG->y_u.yxn.y; PREG = NEXTOP(PREG, yxn); INITIALIZE_PERMVAR(pt0,d0); ENDP(pt0); @@ -10313,7 +10224,7 @@ EMIT_SIMPLE_BLOCK(P_DIV_Y_CV_DIV_Y_CV_UNK); ///#endif saveregs(); - Yap_NilError(INSTANTIATION_ERROR, "X is " Int_FORMAT "// A", PREG->u.yxn.c); + Yap_NilError(INSTANTIATION_ERROR, "X is " Int_FORMAT "// A", PREG->y_u.yxn.c); setregs(); TRACED_FAIL(); ENDP(pt0); @@ -10325,12 +10236,12 @@ EMIT_ENTRY_BLOCK(PREG,P_AND_VV_INSTINIT); BEGD(d0); BEGD(d1); - d0 = XREG(PREG->u.xxx.x1); + d0 = XREG(PREG->y_u.xxx.x1); /* first check pt1 */ profiled_deref_head_TEST(d0, traced_and_vv_unk); traced_and_vv_nvar: EMIT_SIMPLE_BLOCK_TEST(P_AND_VV_AND_VV_NVAR); - d1 = XREG(PREG->u.xxx.x2); + d1 = XREG(PREG->y_u.xxx.x2); /* next check A2 */ profiled_deref_head_TEST(d1, traced_and_vv_nvar_unk); traced_and_vv_nvar_nvar: @@ -10353,7 +10264,7 @@ TRACED_FAIL(); } } - XREG(PREG->u.xxx.x) = d0; + XREG(PREG->y_u.xxx.x) = d0; PREG = NEXTOP(PREG, xxx); GONext(); @@ -10381,12 +10292,12 @@ Op(traced_p_and_vc, xxn); EMIT_ENTRY_BLOCK(PREG,P_AND_VC_INSTINIT); BEGD(d0); - d0 = XREG(PREG->u.xxn.xi); + d0 = XREG(PREG->y_u.xxn.xi); /* first check pt1 */ profiled_deref_head_TEST(d0, traced_and_vc_unk); traced_and_vc_nvar: { - Int d1 = PREG->u.xxn.c; + Int d1 = PREG->y_u.xxn.c; if (IsIntTerm(d0)) { EMIT_CONDITIONAL_SUCCESS("IsIntTerm(d0)"); EMIT_SIMPLE_BLOCK_TEST(P_AND_VC_AND_VC_NVAR_INT); @@ -10406,7 +10317,7 @@ } } } - XREG(PREG->u.xxn.x) = d0; + XREG(PREG->y_u.xxn.x) = d0; PREG = NEXTOP(PREG, xxn); GONext(); @@ -10414,7 +10325,7 @@ profiled_deref_body(d0, pt0, traced_and_vc_unk, traced_and_vc_nvar); EMIT_SIMPLE_BLOCK_TEST(P_AND_VC_AND_VC_UNK); saveregs(); - Yap_NilError(INSTANTIATION_ERROR, "X is A /\\ " Int_FORMAT , PREG->u.xxn.c); + Yap_NilError(INSTANTIATION_ERROR, "X is A /\\ " Int_FORMAT , PREG->y_u.xxn.c); setregs(); TRACED_FAIL(); ENDP(pt0); @@ -10427,14 +10338,14 @@ ///#endif BEGD(d0); BEGD(d1); - d0 = XREG(PREG->u.yxx.x1); + d0 = XREG(PREG->y_u.yxx.x1); /* first check pt1 */ deref_head(d0, traced_and_y_vv_unk); traced_and_y_vv_nvar: ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_AND_Y_VV_AND_Y_VV_NVAR); ///#endif - d1 = XREG(PREG->u.xxx.x2); + d1 = XREG(PREG->y_u.xxx.x2); /* next check A2 */ deref_head(d1, traced_and_y_vv_nvar_unk); traced_and_y_vv_nvar_nvar: @@ -10466,7 +10377,7 @@ EMIT_SIMPLE_BLOCK(P_AND_Y_VV_NVAR_END); ///#endif BEGP(pt0); - pt0 = YREG + PREG->u.yxx.y; + pt0 = YREG + PREG->y_u.yxx.y; PREG = NEXTOP(PREG, yxx); INITIALIZE_PERMVAR(pt0,d0); ENDP(pt0); @@ -10502,7 +10413,7 @@ EMIT_ENTRY_BLOCK(PREG,P_AND_Y_VC_INSTINIT); ///#endif BEGD(d0); - d0 = XREG(PREG->u.yxn.xi); + d0 = XREG(PREG->y_u.yxn.xi); /* first check pt1 */ deref_head(d0, traced_and_y_vc_unk); traced_and_y_vc_nvar: @@ -10510,7 +10421,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_AND_Y_VC_AND_Y_VC_NVAR); ///#endif - Int d1 = PREG->u.yxn.c; + Int d1 = PREG->y_u.yxn.c; if (IsIntTerm(d0)) { ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_AND_Y_VC_INTTERM); @@ -10539,7 +10450,7 @@ EMIT_SIMPLE_BLOCK(P_AND_Y_VC_NVAR_END); ///#endif BEGP(pt0); - pt0 = YREG + PREG->u.yxn.y; + pt0 = YREG + PREG->y_u.yxn.y; PREG = NEXTOP(PREG, yxn); INITIALIZE_PERMVAR(pt0,d0); ENDP(pt0); @@ -10551,7 +10462,7 @@ EMIT_SIMPLE_BLOCK(P_AND_Y_VC_AND_Y_VC_UNK); ///#endif saveregs(); - Yap_NilError(INSTANTIATION_ERROR, "X is A /\\ " Int_FORMAT , PREG->u.yxn.c); + Yap_NilError(INSTANTIATION_ERROR, "X is A /\\ " Int_FORMAT , PREG->y_u.yxn.c); setregs(); TRACED_FAIL(); ENDP(pt0); @@ -10565,14 +10476,14 @@ ///#endif BEGD(d0); BEGD(d1); - d0 = XREG(PREG->u.xxx.x1); + d0 = XREG(PREG->y_u.xxx.x1); /* first check pt1 */ deref_head(d0, traced_or_vv_unk); traced_or_vv_nvar: ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_OR_VV_OR_VV_NVAR); ///#endif - d1 = XREG(PREG->u.xxx.x2); + d1 = XREG(PREG->y_u.xxx.x2); /* next check A2 */ deref_head(d1, traced_or_vv_nvar_unk); traced_or_vv_nvar_nvar: @@ -10603,7 +10514,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_OR_VV_NVAR_END); ///#endif - XREG(PREG->u.xxx.x) = d0; + XREG(PREG->y_u.xxx.x) = d0; PREG = NEXTOP(PREG, xxx); GONext(); @@ -10637,7 +10548,7 @@ EMIT_ENTRY_BLOCK(PREG,P_OR_VC_INSTINIT); ///#endif BEGD(d0); - d0 = XREG(PREG->u.xxn.xi); + d0 = XREG(PREG->y_u.xxn.xi); /* first check pt1 */ deref_head(d0, traced_or_vc_unk); traced_or_vc_nvar: @@ -10645,7 +10556,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_OR_VC_OR_VC_NVAR); ///#endif - Int d1 = PREG->u.xxn.c; + Int d1 = PREG->y_u.xxn.c; if (IsIntTerm(d0)) { ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_OR_VC_INTTERM); @@ -10672,7 +10583,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_OR_VC_NVAR_END); ///#endif - XREG(PREG->u.xxn.x) = d0; + XREG(PREG->y_u.xxn.x) = d0; PREG = NEXTOP(PREG, xxn); GONext(); @@ -10682,7 +10593,7 @@ EMIT_SIMPLE_BLOCK(P_OR_VC_OR_VC_UNK); ///#endif saveregs(); - Yap_NilError(INSTANTIATION_ERROR, "X is A \\/ " Int_FORMAT , PREG->u.xxn.c); + Yap_NilError(INSTANTIATION_ERROR, "X is A \\/ " Int_FORMAT , PREG->y_u.xxn.c); setregs(); TRACED_FAIL(); ENDP(pt0); @@ -10695,14 +10606,14 @@ ///#endif BEGD(d0); BEGD(d1); - d0 = XREG(PREG->u.yxx.x1); + d0 = XREG(PREG->y_u.yxx.x1); /* first check pt1 */ deref_head(d0, traced_or_y_vv_unk); traced_or_y_vv_nvar: ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_OR_Y_VV_OR_Y_VV_NVAR); ///#endif - d1 = XREG(PREG->u.xxx.x2); + d1 = XREG(PREG->y_u.xxx.x2); /* next check A2 */ deref_head(d1, traced_or_y_vv_nvar_unk); traced_or_y_vv_nvar_nvar: @@ -10734,7 +10645,7 @@ EMIT_SIMPLE_BLOCK(P_OR_Y_VV_NVAR_END); ///#endif BEGP(pt0); - pt0 = YREG + PREG->u.yxx.y; + pt0 = YREG + PREG->y_u.yxx.y; PREG = NEXTOP(PREG, yxx); INITIALIZE_PERMVAR(pt0,d0); ENDP(pt0); @@ -10770,7 +10681,7 @@ EMIT_ENTRY_BLOCK(PREG,P_OR_Y_VC_INSTINIT); ///#endif BEGD(d0); - d0 = XREG(PREG->u.yxn.xi); + d0 = XREG(PREG->y_u.yxn.xi); /* first check pt1 */ deref_head(d0, traced_or_y_vc_unk); traced_or_y_vc_nvar: @@ -10778,7 +10689,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_OR_Y_VC_OR_Y_VC_NVAR); ///#endif - Int d1 = PREG->u.yxn.c; + Int d1 = PREG->y_u.yxn.c; if (IsIntTerm(d0)) { ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_OR_Y_VC_INTTERM); @@ -10807,7 +10718,7 @@ EMIT_SIMPLE_BLOCK(P_OR_Y_VC_NVAR_END); ///#endif BEGP(pt0); - pt0 = YREG + PREG->u.yxn.y; + pt0 = YREG + PREG->y_u.yxn.y; PREG = NEXTOP(PREG, yxn); INITIALIZE_PERMVAR(pt0,d0); ENDP(pt0); @@ -10819,7 +10730,7 @@ EMIT_SIMPLE_BLOCK(P_OR_Y_VC_OR_Y_VC_UNK); ///#endif saveregs(); - Yap_NilError(INSTANTIATION_ERROR, "X is A \\/ " Int_FORMAT , PREG->u.yxn.c); + Yap_NilError(INSTANTIATION_ERROR, "X is A \\/ " Int_FORMAT , PREG->y_u.yxn.c); setregs(); TRACED_FAIL(); ENDP(pt0); @@ -10832,14 +10743,14 @@ ///#endif BEGD(d0); BEGD(d1); - d0 = XREG(PREG->u.xxx.x1); + d0 = XREG(PREG->y_u.xxx.x1); /* first check pt1 */ deref_head(d0, traced_sll_vv_unk); traced_sll_vv_nvar: ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_SLL_VV_SLL_VV_NVAR); ///#endif - d1 = XREG(PREG->u.xxx.x2); + d1 = XREG(PREG->y_u.xxx.x2); /* next check A2 */ deref_head(d1, traced_sll_vv_nvar_unk); traced_sll_vv_nvar_nvar: @@ -10881,7 +10792,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_SLL_VV_NVAR_END); ///#endif - XREG(PREG->u.xxx.x) = d0; + XREG(PREG->y_u.xxx.x) = d0; PREG = NEXTOP(PREG, xxx); GONext(); @@ -10915,7 +10826,7 @@ EMIT_ENTRY_BLOCK(PREG,P_SLL_VC_INSTINIT); ///#endif BEGD(d0); - d0 = XREG(PREG->u.xxn.xi); + d0 = XREG(PREG->y_u.xxn.xi); /* first check pt1 */ deref_head(d0, traced_sll_vc_unk); traced_sll_vc_nvar: @@ -10923,7 +10834,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_SLL_VC_SLL_VC_NVAR); ///#endif - Int d1 = PREG->u.xxn.c; + Int d1 = PREG->y_u.xxn.c; if (IsIntTerm(d0)) { ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_SLL_VC_INTTERM); @@ -10951,7 +10862,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_SLL_VC_NVAR_END); ///#endif - XREG(PREG->u.xxn.x) = d0; + XREG(PREG->y_u.xxn.x) = d0; PREG = NEXTOP(PREG, xxn); GONext(); @@ -10971,12 +10882,12 @@ Op(traced_p_sll_cv, xxn); EMIT_ENTRY_BLOCK(PREG,P_SLL_CV_INSTINIT); BEGD(d0); - d0 = XREG(PREG->u.xxn.xi); + d0 = XREG(PREG->y_u.xxn.xi); /* first check pt1 */ profiled_deref_head_TEST(d0, traced_sll_cv_unk); traced_sll_cv_nvar: { - Int d1 = PREG->u.xxn.c; + Int d1 = PREG->y_u.xxn.c; if (IsIntTerm(d0)) { EMIT_CONDITIONAL_SUCCESS("IsIntTerm(d0)"); EMIT_SIMPLE_BLOCK_TEST(P_SLL_CV_SLL_CV_NVAR_INT); @@ -11000,7 +10911,7 @@ setregs(); TRACED_FAIL(); } - XREG(PREG->u.xxn.x) = d0; + XREG(PREG->y_u.xxn.x) = d0; PREG = NEXTOP(PREG, xxn); GONext(); @@ -11021,14 +10932,14 @@ ///#endif BEGD(d0); BEGD(d1); - d0 = XREG(PREG->u.yxx.x1); + d0 = XREG(PREG->y_u.yxx.x1); /* first check pt1 */ deref_head(d0, traced_sll_y_vv_unk); traced_sll_y_vv_nvar: ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_SLL_Y_VV_SLL_Y_VV_NVAR); ///#endif - d1 = XREG(PREG->u.xxx.x2); + d1 = XREG(PREG->y_u.xxx.x2); /* next check A2 */ deref_head(d1, traced_sll_y_vv_nvar_unk); traced_sll_y_vv_nvar_nvar: @@ -11070,7 +10981,7 @@ EMIT_SIMPLE_BLOCK(P_SLL_Y_VV_NVAR_END); ///#endif BEGP(pt0); - pt0 = YREG + PREG->u.yxx.y; + pt0 = YREG + PREG->y_u.yxx.y; PREG = NEXTOP(PREG, yxx); INITIALIZE_PERMVAR(pt0,d0); ENDP(pt0); @@ -11106,7 +11017,7 @@ EMIT_ENTRY_BLOCK(PREG,P_SLL_Y_VC_INSTINIT); ///#endif BEGD(d0); - d0 = XREG(PREG->u.yxn.xi); + d0 = XREG(PREG->y_u.yxn.xi); /* first check pt1 */ deref_head(d0, traced_sll_y_vc_unk); traced_sll_y_vc_nvar: @@ -11114,7 +11025,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_SLL_Y_VC_SLL_Y_VC_NVAR); ///#endif - Int d1 = PREG->u.yxn.c; + Int d1 = PREG->y_u.yxn.c; if (IsIntTerm(d0)) { ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_SLL_Y_VC_INTTERM); @@ -11143,7 +11054,7 @@ EMIT_SIMPLE_BLOCK(P_SLL_Y_VC_NVAR_END); ///#endif BEGP(pt0); - pt0 = YREG + PREG->u.yxn.y; + pt0 = YREG + PREG->y_u.yxn.y; PREG = NEXTOP(PREG, yxn); INITIALIZE_PERMVAR(pt0,d0); ENDP(pt0); @@ -11168,7 +11079,7 @@ EMIT_ENTRY_BLOCK(PREG,P_SLL_Y_CV_INSTINIT); ///#endif BEGD(d0); - d0 = XREG(PREG->u.yxn.xi); + d0 = XREG(PREG->y_u.yxn.xi); /* first check pt1 */ deref_head(d0, traced_sll_y_cv_unk); traced_sll_y_cv_nvar: @@ -11176,7 +11087,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_SLL_Y_CV_SLL_Y_CV_NVAR); ///#endif - Int d1 = PREG->u.yxn.c; + Int d1 = PREG->y_u.yxn.c; if (IsIntTerm(d0)) { ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_SLL_Y_CV_INTTERM_INIT); @@ -11215,7 +11126,7 @@ EMIT_SIMPLE_BLOCK(P_SLL_Y_CV_NVAR_END); ///#endif BEGP(pt0); - pt0 = YREG + PREG->u.yxn.y; + pt0 = YREG + PREG->y_u.yxn.y; PREG = NEXTOP(PREG, yxn); INITIALIZE_PERMVAR(pt0,d0); ENDP(pt0); @@ -11240,14 +11151,14 @@ ///#endif BEGD(d0); BEGD(d1); - d0 = XREG(PREG->u.xxx.x1); + d0 = XREG(PREG->y_u.xxx.x1); /* first check pt1 */ deref_head(d0, traced_slr_vv_unk); traced_slr_vv_nvar: ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_SLR_VV_SLR_VV_NVAR); ///#endif - d1 = XREG(PREG->u.xxx.x2); + d1 = XREG(PREG->y_u.xxx.x2); /* next check A2 */ deref_head(d1, traced_slr_vv_nvar_unk); traced_slr_vv_nvar_nvar: @@ -11288,7 +11199,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_SLR_VV_NVAR_END); ///#endif - XREG(PREG->u.xxx.x) = d0; + XREG(PREG->y_u.xxx.x) = d0; PREG = NEXTOP(PREG, xxx); GONext(); @@ -11320,12 +11231,12 @@ Op(traced_p_slr_vc, xxn); EMIT_ENTRY_BLOCK(PREG,P_SLR_VC_INSTINIT); BEGD(d0); - d0 = XREG(PREG->u.xxn.xi); + d0 = XREG(PREG->y_u.xxn.xi); /* first check pt1 */ profiled_deref_head_TEST(d0, traced_slr_vc_unk); traced_slr_vc_nvar: { - Int d1 = PREG->u.xxn.c; + Int d1 = PREG->y_u.xxn.c; if (IsIntTerm(d0)) { EMIT_CONDITIONAL_SUCCESS("IsIntTerm(d0)"); EMIT_SIMPLE_BLOCK_TEST(P_SLR_VC_SLR_VC_NVAR_INT); @@ -11345,7 +11256,7 @@ } } } - XREG(PREG->u.xxn.x) = d0; + XREG(PREG->y_u.xxn.x) = d0; PREG = NEXTOP(PREG, xxn); GONext(); @@ -11365,7 +11276,7 @@ EMIT_ENTRY_BLOCK(PREG,P_SLR_CV_INSTINIT); ///#endif BEGD(d0); - d0 = XREG(PREG->u.xxn.xi); + d0 = XREG(PREG->y_u.xxn.xi); /* first check pt1 */ deref_head(d0, traced_slr_cv_unk); traced_slr_cv_nvar: @@ -11373,7 +11284,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_SLR_CV_SLR_CV_NVAR); ///#endif - Int d1 = PREG->u.xxn.c; + Int d1 = PREG->y_u.xxn.c; if (IsIntTerm(d0)) { ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_SLR_CV_INTTERM_INIT); @@ -11411,7 +11322,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_SLR_CV_NVAR_END); ///#endif - XREG(PREG->u.xxn.x) = d0; + XREG(PREG->y_u.xxn.x) = d0; PREG = NEXTOP(PREG, xxn); GONext(); @@ -11434,14 +11345,14 @@ ///#endif BEGD(d0); BEGD(d1); - d0 = XREG(PREG->u.yxx.x1); + d0 = XREG(PREG->y_u.yxx.x1); /* first check pt1 */ deref_head(d0, traced_slr_y_vv_unk); traced_slr_y_vv_nvar: ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_SLR_Y_VV_SLR_Y_VV_NVAR); ///#endif - d1 = XREG(PREG->u.xxx.x2); + d1 = XREG(PREG->y_u.xxx.x2); /* next check A2 */ deref_head(d1, traced_slr_y_vv_nvar_unk); traced_slr_y_vv_nvar_nvar: @@ -11483,7 +11394,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_SLR_Y_VV_NVAR_END); ///#endif - pt0 = YREG + PREG->u.yxx.y; + pt0 = YREG + PREG->y_u.yxx.y; PREG = NEXTOP(PREG, yxx); INITIALIZE_PERMVAR(pt0,d0); ENDP(pt0); @@ -11519,7 +11430,7 @@ EMIT_ENTRY_BLOCK(PREG,P_SLR_Y_VC_INSTINIT); ///#endif BEGD(d0); - d0 = XREG(PREG->u.yxn.xi); + d0 = XREG(PREG->y_u.yxn.xi); /* first check pt1 */ deref_head(d0, traced_slr_y_vc_unk); traced_slr_y_vc_nvar: @@ -11527,7 +11438,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_SLR_Y_VC_SLR_Y_VC_NVAR); ///#endif - Int d1 = PREG->u.yxn.c; + Int d1 = PREG->y_u.yxn.c; if (IsIntTerm(d0)) { ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_SLR_Y_VC_INTTERM); @@ -11556,7 +11467,7 @@ EMIT_SIMPLE_BLOCK(P_SLR_Y_VC_NVAR_END); ///#endif BEGP(pt0); - pt0 = YREG + PREG->u.yxn.y; + pt0 = YREG + PREG->y_u.yxn.y; PREG = NEXTOP(PREG, yxn); INITIALIZE_PERMVAR(pt0,d0); ENDP(pt0); @@ -11579,7 +11490,7 @@ EMIT_ENTRY_BLOCK(PREG,P_SLR_Y_CV_INSTINIT); ///#endif BEGD(d0); - d0 = XREG(PREG->u.yxn.xi); + d0 = XREG(PREG->y_u.yxn.xi); /* first check pt1 */ deref_head(d0, traced_slr_y_cv_unk); traced_slr_y_cv_nvar: @@ -11587,7 +11498,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_SLR_Y_CV_SLR_Y_CV_NVAR); ///#endif - Int d1 = PREG->u.yxn.c; + Int d1 = PREG->y_u.yxn.c; if (IsIntTerm(d0)) { ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_SLR_Y_CV_INTTERM_INIT); @@ -11626,7 +11537,7 @@ EMIT_SIMPLE_BLOCK(P_SLR_Y_CV_NVAR_END); ///#endif BEGP(pt0); - pt0 = YREG + PREG->u.yxn.y; + pt0 = YREG + PREG->y_u.yxn.y; PREG = NEXTOP(PREG, yxn); INITIALIZE_PERMVAR(pt0,d0); ENDP(pt0); @@ -11649,10 +11560,10 @@ EMIT_ENTRY_BLOCK(PREG,CALL_BFUNC_XX_INSTINIT); BEGD(d0); BEGD(d1); - d0 = XREG(PREG->u.plxxs.x1); + d0 = XREG(PREG->y_u.plxxs.x1); traced_call_bfunc_xx_nvar: EMIT_SIMPLE_BLOCK_TEST(CALL_BFUNC_XX_CALL_BFUNC_XX_NVAR); - d1 = XREG(PREG->u.plxxs.x2); + d1 = XREG(PREG->y_u.plxxs.x2); traced_call_bfunc_xx2_nvar: profiled_deref_head_TEST(d0, traced_call_bfunc_xx_unk); profiled_deref_head_TEST(d1, traced_call_bfunc_xx2_unk); @@ -11662,7 +11573,7 @@ COUNT flags; Int v = IntOfTerm(d0) - IntOfTerm(d1); - flags = PREG->u.plxxs.flags; + flags = PREG->y_u.plxxs.flags; if (v > 0) { if (flags & GT_OK_IN_CMP) { yamop *nextp = NEXTOP(PREG, plxxs); @@ -11672,7 +11583,7 @@ ALWAYS_END_PREFETCH(); } else { - yamop *nextp = PREG->u.plxxs.f; + yamop *nextp = PREG->y_u.plxxs.f; ALWAYS_LOOKAHEAD(nextp->opc); PREG = nextp; ALWAYS_GONext(); @@ -11688,7 +11599,7 @@ ALWAYS_END_PREFETCH(); } else { - yamop *nextp = PREG->u.plxxs.f; + yamop *nextp = PREG->y_u.plxxs.f; ALWAYS_LOOKAHEAD(nextp->opc); PREG = nextp; ALWAYS_GONext(); @@ -11704,7 +11615,7 @@ ALWAYS_END_PREFETCH(); } else { - yamop *nextp = PREG->u.plxxs.f; + yamop *nextp = PREG->y_u.plxxs.f; ALWAYS_LOOKAHEAD(nextp->opc); PREG = nextp; ALWAYS_GONext(); @@ -11716,7 +11627,7 @@ EMIT_CONDITIONAL_FAIL("IsIntTerm(d0) && IsIntTerm(d1)"); EMIT_MULTIPLE_DESTINY_BLOCK_TEST(CALL_BFUNC_XX_CALL_BFUNC_XX2_NVAR_NOINT); { - CmpPredicate f = PREG->u.plxxs.p->cs.d_code; + CmpPredicate f = PREG->y_u.plxxs.p->cs.d_code; saveregs(); d0 = (CELL) (f) (d0,d1); setregs(); @@ -11725,7 +11636,7 @@ JMPNext(); } if (!d0) { - PREG = PREG->u.plxxs.f; + PREG = PREG->y_u.plxxs.f; JMPNext(); } PREG = NEXTOP(PREG, plxxs); @@ -11752,8 +11663,8 @@ BEGD(d0); BEGD(d1); BEGP(pt0); - pt0 = YREG + PREG->u.plxys.y; - d1 = XREG(PREG->u.plxys.x); + pt0 = YREG + PREG->y_u.plxys.y; + d1 = XREG(PREG->y_u.plxys.x); d0 = *pt0; ENDP(pt0); profiled_deref_head_TEST(d0, traced_call_bfunc_yx_unk); @@ -11766,13 +11677,13 @@ int flags; Int v = IntOfTerm(d0) - IntOfTerm(d1); - flags = PREG->u.plxys.flags; + flags = PREG->y_u.plxys.flags; if (v > 0) { if (flags & GT_OK_IN_CMP) { PREG = NEXTOP(PREG, plxys); JMPNext(); } else { - PREG = PREG->u.plxys.f; + PREG = PREG->y_u.plxys.f; JMPNext(); } } else if (v < 0) { @@ -11780,7 +11691,7 @@ PREG = NEXTOP(PREG, plxys); JMPNext(); } else { - PREG = PREG->u.plxys.f; + PREG = PREG->y_u.plxys.f; JMPNext(); } } else /* if (v == 0) */ { @@ -11788,7 +11699,7 @@ PREG = NEXTOP(PREG, plxys); JMPNext(); } else { - PREG = PREG->u.plxys.f; + PREG = PREG->y_u.plxys.f; JMPNext(); } } @@ -11797,14 +11708,14 @@ EMIT_CONDITIONAL_FAIL("IsIntTerm(d0) && IsIntTerm(d1)"); EMIT_MULTIPLE_DESTINY_BLOCK_TEST(CALL_BFUNC_YX_CALL_BFUNC_YX2_NVAR_NOINT); { - CmpPredicate f = PREG->u.plxys.p->cs.d_code; + CmpPredicate f = PREG->y_u.plxys.p->cs.d_code; saveregs(); d0 = (CELL) (f) (d0,d1); setregs(); } if (!d0 || PREG == FAILCODE) { if (PREG != FAILCODE) { - PREG = PREG->u.plxys.f; + PREG = PREG->y_u.plxys.f; } JMPNext(); } @@ -11832,8 +11743,8 @@ BEGD(d0); BEGD(d1); BEGP(pt0); - pt0 = YREG + PREG->u.plxys.y; - d0 = XREG(PREG->u.plxys.x); + pt0 = YREG + PREG->y_u.plxys.y; + d0 = XREG(PREG->y_u.plxys.x); d1 = *pt0; ENDP(pt0); profiled_deref_head_TEST(d0, traced_call_bfunc_xy_unk); @@ -11846,13 +11757,13 @@ int flags; Int v = IntOfTerm(d0) - IntOfTerm(d1); - flags = PREG->u.plxys.flags; + flags = PREG->y_u.plxys.flags; if (v > 0) { if (flags & GT_OK_IN_CMP) { PREG = NEXTOP(PREG, plxys); JMPNext(); } else { - PREG = PREG->u.plxys.f; + PREG = PREG->y_u.plxys.f; JMPNext(); } } else if (v < 0) { @@ -11860,7 +11771,7 @@ PREG = NEXTOP(PREG, plxys); JMPNext(); } else { - PREG = PREG->u.plxys.f; + PREG = PREG->y_u.plxys.f; JMPNext(); } } else /* if (v == 0) */ { @@ -11868,7 +11779,7 @@ PREG = NEXTOP(PREG, plxys); JMPNext(); } else { - PREG = PREG->u.plxys.f; + PREG = PREG->y_u.plxys.f; JMPNext(); } } @@ -11877,14 +11788,14 @@ EMIT_CONDITIONAL_FAIL("IsIntTerm(d0) && IsIntTerm(d1)"); EMIT_MULTIPLE_DESTINY_BLOCK_TEST(CALL_BFUNC_XY_CALL_BFUNC_XY2_NVAR_NOINT); { - CmpPredicate f = PREG->u.plxys.p->cs.d_code; + CmpPredicate f = PREG->y_u.plxys.p->cs.d_code; saveregs(); d0 = (CELL) (f) (d0,d1); setregs(); } if (!d0 || PREG == FAILCODE) { if (PREG != FAILCODE) { - PREG = PREG->u.plxys.f; + PREG = PREG->y_u.plxys.f; } JMPNext(); } @@ -11912,9 +11823,9 @@ BEGD(d0); BEGD(d1); BEGP(pt0); - pt0 = YREG + PREG->u.plyys.y1; + pt0 = YREG + PREG->y_u.plyys.y1; BEGP(pt1); - pt1 = YREG + PREG->u.plyys.y2; + pt1 = YREG + PREG->y_u.plyys.y2; d0 = *pt0; d1 = *pt1; ENDP(pt1); @@ -11929,13 +11840,13 @@ int flags; Int v = IntOfTerm(d0) - IntOfTerm(d1); - flags = PREG->u.plyys.flags; + flags = PREG->y_u.plyys.flags; if (v > 0) { if (flags & GT_OK_IN_CMP) { PREG = NEXTOP(PREG, plyys); JMPNext(); } else { - PREG = PREG->u.plyys.f; + PREG = PREG->y_u.plyys.f; JMPNext(); } } else if (v < 0) { @@ -11943,7 +11854,7 @@ PREG = NEXTOP(PREG, plyys); JMPNext(); } else { - PREG = PREG->u.plyys.f; + PREG = PREG->y_u.plyys.f; JMPNext(); } } else /* if (v == 0) */ { @@ -11951,7 +11862,7 @@ PREG = NEXTOP(PREG, plyys); JMPNext(); } else { - PREG = PREG->u.plyys.f; + PREG = PREG->y_u.plyys.f; JMPNext(); } } @@ -11960,14 +11871,14 @@ EMIT_CONDITIONAL_FAIL("IsIntTerm(d0) && IsIntTerm(d1)"); EMIT_MULTIPLE_DESTINY_BLOCK_TEST(CALL_BFUNC_YY_CALL_BFUNC_YY2_NVAR_NOINT); { - CmpPredicate f = PREG->u.plyys.p->cs.d_code; + CmpPredicate f = PREG->y_u.plyys.p->cs.d_code; saveregs(); d0 = (CELL) (f) (d0,d1); setregs(); } if (!d0 || PREG == FAILCODE) { if (PREG != FAILCODE) { - PREG = PREG->u.plyys.f; + PREG = PREG->y_u.plyys.f; } JMPNext(); } @@ -12006,7 +11917,7 @@ #ifdef LOW_LEVEL_TRACER if (Yap_do_low_level_trace) { EMIT_SIMPLE_BLOCK_TEST(P_DIF_LOW_LEVEL_TRACER); - low_level_trace(enter_pred,RepPredPrOp(traced_Yap_GetPredPropByFunc(FunctorDiff,0)),XREGS+1); + low_level_trace(enter_pred,RepPredProp(Yap_GetPredPropByFunc(FunctorDiff,0)),XREGS+1); } #endif /* LOW_LEVEL_TRACE */ EMIT_SIMPLE_BLOCK_TEST(P_DIF_POST_LOW_LEVEL_TRACER); @@ -12023,7 +11934,7 @@ /* both arguments are bound */ EMIT_MULTIPLE_DESTINY_BLOCK_TEST(P_DIF_DIF_NVAR1_NVAR2); if (d0 == d1) { - PREG = PREG->u.l.l; + PREG = PREG->y_u.l.l; GONext(); } if (IsAtomOrIntTerm(d0) || IsAtomOrIntTerm(d1)) { @@ -12061,14 +11972,14 @@ /* now restore Woken Goals to its old value */ Yap_UpdateTimedVar(LOCAL_WokenGoals, OldWokenGoals); if (OldWokenGoals == TermNil) { - Yap_undo_signal(YAP_WAKEUP_SIGNAL); + Yap_get_signal(YAP_WAKEUP_SIGNAL); } #endif /* restore B */ B = pt1; SET_BB(PROTECT_FROZEN_B(pt1)); #ifdef COROUTINING - H = HRBREG; + HR = HBREG; #endif HBREG = B->cp_h; /* untrail all bindings made by Yap_IUnify */ @@ -12105,7 +12016,7 @@ } if (opresult) { /* restore B, no need to restore HRB */ - PREG = PREG->u.l.l; + PREG = PREG->y_u.l.l; GONext(); } /* restore B, and later HRB */ @@ -12119,7 +12030,7 @@ EMIT_SIMPLE_BLOCK_TEST(P_DIF_DIF_UNK1); ENDP(pt0); /* first argument is unbound */ - PREG = PREG->u.l.l; + PREG = PREG->y_u.l.l; GONext(); BEGP(pt0); @@ -12127,7 +12038,7 @@ EMIT_SIMPLE_BLOCK_TEST(P_DIF_DIF_NVAR1_UNK2); ENDP(pt0); /* second argument is unbound */ - PREG = PREG->u.l.l; + PREG = PREG->y_u.l.l; GONext(); ENDD(d1); ENDD(d0); @@ -12138,7 +12049,7 @@ #ifdef LOW_LEVEL_TRACER if (Yap_do_low_level_trace) { EMIT_SIMPLE_BLOCK_TEST(P_EQ_LOW_LEVEL_TRACER); - low_level_trace(enter_pred,RepPredPrOp(traced_Yap_GetPredPropByFunc(FunctorSame,0)),XREGS+1); + low_level_trace(enter_pred,RepPredProp(Yap_GetPredPropByFunc(FunctorSame,0)),XREGS+1); } #endif /* LOW_LEVEL_TRACE */ EMIT_SIMPLE_BLOCK_TEST(P_EQ_POST_LOW_LEVEL_TRACER); @@ -12160,14 +12071,14 @@ } if (IsPairTerm(d0)) { if (!IsPairTerm(d1)) { - PREG = PREG->u.l.l; + PREG = PREG->y_u.l.l; GONext(); } BEGD(d2); always_save_pc(); d2 = iequ_complex(RepPair(d0)-1, RepPair(d0)+1,RepPair(d1)-1); if (d2 == FALSE) { - PREG = PREG->u.l.l; + PREG = PREG->y_u.l.l; GONext(); } ENDD(d2); @@ -12181,7 +12092,7 @@ /* f1 must be a compound term, even if it is a suspension */ if (!IsApplTerm(d1)) { - PREG = PREG->u.l.l; + PREG = PREG->y_u.l.l; GONext(); } f1 = FunctorOfTerm(d1); @@ -12195,35 +12106,35 @@ PREG = NEXTOP(PREG, l); GONext(); } - PREG = PREG->u.l.l; + PREG = PREG->y_u.l.l; GONext(); case (CELL)FunctorLongInt: if (f1 != FunctorLongInt) { - PREG = PREG->u.l.l; + PREG = PREG->y_u.l.l; GONext(); } if (LongIntOfTerm(d0) == LongIntOfTerm(d1)) { PREG = NEXTOP(PREG, l); GONext(); } - PREG = PREG->u.l.l; + PREG = PREG->y_u.l.l; GONext(); #ifdef USE_GMP case (CELL)FunctorBigInt: if (f1 != FunctorBigInt) { - PREG = PREG->u.l.l; + PREG = PREG->y_u.l.l; GONext(); } if (Yap_gmp_tcmp_big_big(d0,d1) == 0) { PREG = NEXTOP(PREG, l); GONext(); } - PREG = PREG->u.l.l; + PREG = PREG->y_u.l.l; GONext(); #endif case (CELL)FunctorDouble: if (f1 != FunctorDouble) { - PREG = PREG->u.l.l; + PREG = PREG->y_u.l.l; GONext(); } if (FloatOfTerm(d0) == FloatOfTerm(d1)) { @@ -12231,19 +12142,19 @@ GONext(); } default: - PREG = PREG->u.l.l; + PREG = PREG->y_u.l.l; GONext(); } } if (f0 != f1) { - PREG = PREG->u.l.l; + PREG = PREG->y_u.l.l; GONext(); } always_save_pc(); BEGD(d2); d2 = iequ_complex(RepAppl(d0), RepAppl(d0)+ArityOfFunctor(f0), RepAppl(d1)); if (d2 == FALSE) { - PREG = PREG->u.l.l; + PREG = PREG->y_u.l.l; GONext(); } ENDD(d2); @@ -12251,7 +12162,7 @@ PREG = NEXTOP(PREG, l); GONext(); } - PREG = PREG->u.l.l; + PREG = PREG->y_u.l.l; GONext(); BEGP(pt0); @@ -12262,7 +12173,7 @@ /* second argument is unbound */ /* I don't need to worry about co-routining because an unbound variable may never be == to a constrained variable!! */ - PREG = PREG->u.l.l; + PREG = PREG->y_u.l.l; GONext(); ENDD(d1); @@ -12276,7 +12187,7 @@ /* I don't need to worry about co-routining because an unbound variable may never be == to a constrained variable!! */ EMIT_SIMPLE_BLOCK_TEST(P_EQ_P_EQ_VAR1_NVAR2); - PREG = PREG->u.l.l; + PREG = PREG->y_u.l.l; GONext(); BEGP(pt1); @@ -12285,7 +12196,7 @@ /* second argument is unbound */ EMIT_MULTIPLE_DESTINY_BLOCK_TEST(P_EQ_P_EQ_VAR1_UNK2_END); if (pt1 != pt0) { - PREG = PREG->u.l.l; + PREG = PREG->y_u.l.l; GONext(); } PREG = NEXTOP(PREG, l); @@ -12302,15 +12213,15 @@ #ifdef LOW_LEVEL_TRACER if (Yap_do_low_level_trace) { EMIT_SIMPLE_BLOCK(P_ARG_VV_LOW_LEVEL_TRACER); - H[0] = XREG(PREG->u.xxx.x1); - H[1] = XREG(PREG->u.xxx.x2); + HR[0] = XREG(PREG->y_u.xxx.x1); + HR[1] = XREG(PREG->y_u.xxx.x2); RESET_VARIABLE(HR+2); - low_level_trace(enter_pred,RepPredPrOp(traced_Yap_GetPredPropByFunc(FunctorArg,0)),H); + low_level_trace(enter_pred,RepPredProp(Yap_GetPredPropByFunc(FunctorArg,0)),HR); } #endif /* LOW_LEVEL_TRACE */ EMIT_SIMPLE_BLOCK_TEST(P_ARG_VV_TEST_D0); BEGD(d0); - d0 = XREG(PREG->u.xxx.x1); + d0 = XREG(PREG->y_u.xxx.x1); profiled_deref_head_TEST(d0, traced_arg_arg1_unk); traced_arg_arg1_nvar: /* ARG1 is ok! */ @@ -12329,7 +12240,7 @@ /* d0 now got the argument we want */ EMIT_SIMPLE_BLOCK_TEST(P_ARG_VV_TEST_D1); BEGD(d1); - d1 = XREG(PREG->u.xxx.x2); + d1 = XREG(PREG->y_u.xxx.x2); profiled_deref_head_TEST(d1, traced_arg_arg2_unk); traced_arg_arg2_nvar: /* d1 now got the structure we want to fetch the argument @@ -12354,7 +12265,7 @@ */ TRACED_FAIL(); } - XREG(PREG->u.xxx.x) = pt0[d0]; + XREG(PREG->y_u.xxx.x) = pt0[d0]; PREG = NEXTOP(PREG, xxx); GONext(); ENDP(pt0); @@ -12371,7 +12282,7 @@ } TRACED_FAIL(); } - XREG(PREG->u.xxx.x) = pt0[d0-1]; + XREG(PREG->y_u.xxx.x) = pt0[d0-1]; PREG = NEXTOP(PREG, xxx); GONext(); ENDP(pt0); @@ -12413,20 +12324,20 @@ if (Yap_do_low_level_trace) { EMIT_SIMPLE_BLOCK_TEST(P_ARG_CV_LOW_LEVEL_TRACER); CELL *Ho = HR; - Term t = MkIntegerTerm(PREG->u.xxn.c); - H[0] = t; - H[1] = XREG(PREG->u.xxn.xi); + Term t = MkIntegerTerm(PREG->y_u.xxn.c); + HR[0] = t; + HR[1] = XREG(PREG->y_u.xxn.xi); RESET_VARIABLE(HR+2); - low_level_trace(enter_pred,RepPredPrOp(traced_Yap_GetPredPropByFunc(FunctorArg,0)),H); - H = HRo; + low_level_trace(enter_pred,RepPredProp(Yap_GetPredPropByFunc(FunctorArg,0)),HR); + HR = Ho; } #endif /* LOW_LEVEL_TRACE */ EMIT_SIMPLE_BLOCK_TEST(P_ARG_CV_TEST_D1); BEGD(d0); - d0 = PREG->u.xxn.c; + d0 = PREG->y_u.xxn.c; /* d0 now got the argument we want */ BEGD(d1); - d1 = XREG(PREG->u.xxn.xi); + d1 = XREG(PREG->y_u.xxn.xi); profiled_deref_head_TEST(d1, traced_arg_arg2_vc_unk); traced_arg_arg2_vc_nvar: EMIT_MULTIPLE_DESTINY_BLOCK_TEST(P_ARG_CV_ARG_ARG2_VC_NVAR); @@ -12451,7 +12362,7 @@ */ TRACED_FAIL(); } - XREG(PREG->u.xxn.x) = pt0[d0]; + XREG(PREG->y_u.xxn.x) = pt0[d0]; PREG = NEXTOP(PREG, xxn); GONext(); ENDP(pt0); @@ -12468,7 +12379,7 @@ } TRACED_FAIL(); } - XREG(PREG->u.xxn.x) = pt0[d0-1]; + XREG(PREG->y_u.xxn.x) = pt0[d0-1]; PREG = NEXTOP(PREG, xxn); GONext(); ENDP(pt0); @@ -12501,16 +12412,16 @@ #ifdef LOW_LEVEL_TRACER if (Yap_do_low_level_trace) { EMIT_SIMPLE_BLOCK_TEST(P_ARG_Y_VV_LOW_LEVEL_TRACER); - H[0] = XREG(PREG->u.yxx.x1); - H[1] = XREG(PREG->u.yxx.x2); - H[2] = YREG[PREG->u.yxx.y]; + HR[0] = XREG(PREG->y_u.yxx.x1); + HR[1] = XREG(PREG->y_u.yxx.x2); + HR[2] = YREG[PREG->y_u.yxx.y]; RESET_VARIABLE(HR+2); - low_level_trace(enter_pred,RepPredPrOp(traced_Yap_GetPredPropByFunc(FunctorArg,0)),H); + low_level_trace(enter_pred,RepPredProp(Yap_GetPredPropByFunc(FunctorArg,0)),HR); } #endif /* LOW_LEVEL_TRACE */ EMIT_SIMPLE_BLOCK_TEST(P_ARG_Y_VV_TEST_D0); BEGD(d0); - d0 = XREG(PREG->u.yxx.x1); + d0 = XREG(PREG->y_u.yxx.x1); profiled_deref_head_TEST(d0, traced_arg_y_arg1_unk); traced_arg_y_arg1_nvar: EMIT_SIMPLE_BLOCK_TEST(P_ARG_Y_VV_ARG_Y_ARG1_NVAR); @@ -12529,7 +12440,7 @@ /* d0 now got the argument we want */ EMIT_SIMPLE_BLOCK_TEST(P_ARG_Y_VV_TEST_D1); BEGD(d1); - d1 = XREG(PREG->u.yxx.x2); + d1 = XREG(PREG->y_u.yxx.x2); profiled_deref_head_TEST(d1, traced_arg_y_arg2_unk); traced_arg_y_arg2_nvar: /* d1 now got the structure we want to fetch the argument @@ -12555,7 +12466,7 @@ TRACED_FAIL(); } BEGP(pt1); - pt1 = YREG + PREG->u.yxx.y; + pt1 = YREG + PREG->y_u.yxx.y; PREG = NEXTOP(PREG, yxx); INITIALIZE_PERMVAR(pt1,pt0[d0]); ENDP(pt1); @@ -12575,7 +12486,7 @@ TRACED_FAIL(); } BEGP(pt1); - pt1 = YREG + PREG->u.yxx.y; + pt1 = YREG + PREG->y_u.yxx.y; PREG = NEXTOP(PREG, yxx); INITIALIZE_PERMVAR(pt1,pt0[d0-1]); GONext(); @@ -12623,23 +12534,23 @@ EMIT_SIMPLE_BLOCK(P_ARG_Y_CV_LOW_LEVEL_TRACER); ///#endif CELL *Ho = HR; - Term t = MkIntegerTerm(PREG->u.yxn.c); - H[0] = t; - H[1] = XREG(PREG->u.yxn.xi); - H[2] = YREG[PREG->u.yxn.y]; + Term t = MkIntegerTerm(PREG->y_u.yxn.c); + HR[0] = t; + HR[1] = XREG(PREG->y_u.yxn.xi); + HR[2] = YREG[PREG->y_u.yxn.y]; RESET_VARIABLE(HR+2); - low_level_trace(enter_pred,RepPredPrOp(traced_Yap_GetPredPropByFunc(FunctorArg,0)),H); - H = HRo; + low_level_trace(enter_pred,RepPredProp(Yap_GetPredPropByFunc(FunctorArg,0)),HR); + HR = Ho; } #endif /* LOW_LEVEL_TRACE */ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_ARG_Y_CV_TEST_D1); ///#endif BEGD(d0); - d0 = PREG->u.yxn.c; + d0 = PREG->y_u.yxn.c; /* d0 now got the argument we want */ BEGD(d1); - d1 = XREG(PREG->u.yxn.xi); + d1 = XREG(PREG->y_u.yxn.xi); deref_head(d1, traced_arg_y_arg2_vc_unk); traced_arg_y_arg2_vc_nvar: /* d1 now got the structure we want to fetch the argument @@ -12670,7 +12581,7 @@ EMIT_SIMPLE_BLOCK(P_ARG_Y_CV_D1APPL_END); ///#endif BEGP(pt1); - pt1 = YREG + PREG->u.yxn.y; + pt1 = YREG + PREG->y_u.yxn.y; PREG = NEXTOP(PREG, yxn); INITIALIZE_PERMVAR(pt1,pt0[d0]); ENDP(pt1); @@ -12699,7 +12610,7 @@ EMIT_SIMPLE_BLOCK(P_ARG_Y_CV_D1PAIR_END); ///#endif BEGP(pt1); - pt1 = YREG + PREG->u.yxn.y; + pt1 = YREG + PREG->y_u.yxn.y; PREG = NEXTOP(PREG, yxn); INITIALIZE_PERMVAR(pt1,pt0[d0-1]); ENDP(pt1); @@ -12743,9 +12654,9 @@ EMIT_SIMPLE_BLOCK(P_FUNC2S_VV_LOW_LEVEL_TRACER); ///#endif RESET_VARIABLE(HR); - H[1] = XREG(PREG->u.xxx.x1); - H[2] = XREG(PREG->u.xxx.x2); - low_level_trace(enter_pred,RepPredPrOp(traced_Yap_GetPredPropByFunc(FunctorFunctor,0)),H); + HR[1] = XREG(PREG->y_u.xxx.x1); + HR[2] = XREG(PREG->y_u.xxx.x2); + low_level_trace(enter_pred,RepPredProp(Yap_GetPredPropByFunc(FunctorFunctor,0)),HR); } #endif /* LOW_LEVEL_TRACE */ /* We have to build the structure */ @@ -12753,7 +12664,7 @@ EMIT_SIMPLE_BLOCK(P_FUNC2S_TEST_D0); ///#endif BEGD(d0); - d0 = XREG(PREG->u.xxx.x1); + d0 = XREG(PREG->y_u.xxx.x1); deref_head(d0, traced_func2s_unk); traced_func2s_nvar: /* we do, let's get the third argument */ @@ -12761,7 +12672,7 @@ EMIT_SIMPLE_BLOCK(P_FUNC2S_VV_TEST_D1); ///#endif BEGD(d1); - d1 = XREG(PREG->u.xxx.x2); + d1 = XREG(PREG->y_u.xxx.x2); deref_head(d1, traced_func2s_unk2); traced_func2s_nvar2: /* Uuuff, the second and third argument are bound */ @@ -12810,10 +12721,10 @@ RESET_VARIABLE(HR); RESET_VARIABLE(HR+1); d0 = AbsPair(HR); - H += 2; + HR += 2; /* else if arity is 0 just pass d0 through */ /* Ding, ding, we made it */ - XREG(PREG->u.xxx.x) = d0; + XREG(PREG->y_u.xxx.x) = d0; PREG = NEXTOP(NEXTOP(NEXTOP(PREG, xxx),Osbpp),l); GONext(); } @@ -12875,19 +12786,19 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_FUNC2S_VV_SECONDIFOK_END); ///#endif - H = pt1; + HR = pt1; /* done building the term */ ENDP(pt1); /* else if arity is 0 just pass d0 through */ /* Ding, ding, we made it */ - XREG(PREG->u.xxx.x) = d0; + XREG(PREG->y_u.xxx.x) = d0; PREG = NEXTOP(NEXTOP(NEXTOP(PREG, xxx),Osbpp),l); GONext(); } else if ((Int)d1 == 0) { ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_FUNC2S_VV_THIRDIFOK); ///#endif - XREG(PREG->u.xxx.x) = d0; + XREG(PREG->y_u.xxx.x) = d0; PREG = NEXTOP(NEXTOP(NEXTOP(PREG, xxx),Osbpp),l); GONext(); } else { @@ -12939,9 +12850,9 @@ EMIT_SIMPLE_BLOCK(P_FUNC2S_CV_LOW_LEVEL_TRACER); ///#endif RESET_VARIABLE(HR); - H[1] = PREG->u.xxc.c; - H[2] = XREG(PREG->u.xxc.xi); - low_level_trace(enter_pred,RepPredPrOp(traced_Yap_GetPredPropByFunc(FunctorFunctor,0)),H); + HR[1] = PREG->y_u.xxc.c; + HR[2] = XREG(PREG->y_u.xxc.xi); + low_level_trace(enter_pred,RepPredProp(Yap_GetPredPropByFunc(FunctorFunctor,0)),HR); } #endif /* LOW_LEVEL_TRACE */ ///#ifdef PROFILED_ABSMI @@ -12949,10 +12860,10 @@ ///#endif BEGD(d0); /* We have to build the structure */ - d0 = PREG->u.xxc.c; + d0 = PREG->y_u.xxc.c; /* we do, let's get the third argument */ BEGD(d1); - d1 = XREG(PREG->u.xxc.xi); + d1 = XREG(PREG->y_u.xxc.xi); deref_head(d1, traced_func2s_unk2_cv); traced_func2s_nvar2_cv: /* Uuuff, the second and third argument are bound */ @@ -12992,10 +12903,10 @@ RESET_VARIABLE(HR); RESET_VARIABLE(HR+1); d0 = AbsPair(HR); - H += 2; + HR += 2; /* else if arity is 0 just pass d0 through */ /* Ding, ding, we made it */ - XREG(PREG->u.xxc.x) = d0; + XREG(PREG->y_u.xxc.x) = d0; PREG = NEXTOP(NEXTOP(NEXTOP(PREG, xxc),Osbpp),l); GONext(); } else if ((Int)d1 > 0) { @@ -13057,18 +12968,18 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_FUNC2S_CV_D1GREATER_END); ///#endif - H = pt1; + HR = pt1; ENDP(pt1); /* else if arity is 0 just pass d0 through */ /* Ding, ding, we made it */ - XREG(PREG->u.xxc.x) = d0; + XREG(PREG->y_u.xxc.x) = d0; PREG = NEXTOP(NEXTOP(NEXTOP(PREG, xxc),Osbpp),l); GONext(); } else if (d1 == 0) { ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_FUNC2S_CV_D1ISZERO); ///#endif - XREG(PREG->u.xxc.x) = d0; + XREG(PREG->y_u.xxc.x) = d0; PREG = NEXTOP(NEXTOP(NEXTOP(PREG, xxc),Osbpp),l); GONext(); } else { @@ -13110,12 +13021,12 @@ Term ti; CELL *hi = HR; - ti = MkIntegerTerm(PREG->u.xxn.c); + ti = MkIntegerTerm(PREG->y_u.xxn.c); RESET_VARIABLE(HR); - H[1] = XREG(PREG->u.xxn.xi); - H[2] = ti; - low_level_trace(enter_pred,RepPredPrOp(traced_Yap_GetPredPropByFunc(FunctorFunctor,0)),H); - H = hi; + HR[1] = XREG(PREG->y_u.xxn.xi); + HR[2] = ti; + low_level_trace(enter_pred,RepPredProp(Yap_GetPredPropByFunc(FunctorFunctor,0)),HR); + HR = hi; } #endif /* LOW_LEVEL_TRACE */ /* We have to build the structure */ @@ -13123,14 +13034,14 @@ EMIT_SIMPLE_BLOCK(P_FUNC2S_VC_TEST_D0); ///#endif BEGD(d0); - d0 = XREG(PREG->u.xxn.xi); + d0 = XREG(PREG->y_u.xxn.xi); deref_head(d0, traced_func2s_unk_vc); traced_func2s_nvar_vc: ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_FUNC2S_VC_FUNC2S_NVAR_VC); ///#endif BEGD(d1); - d1 = PREG->u.xxn.c; + d1 = PREG->y_u.xxn.c; if (!IsAtomicTerm(d0)) { ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_FUNC2S_VC_D0NOATOMIC); @@ -13149,10 +13060,10 @@ RESET_VARIABLE(HR); RESET_VARIABLE(HR+1); d0 = AbsPair(HR); - H += 2; + HR += 2; /* else if arity is 0 just pass d0 through */ /* Ding, ding, we made it */ - XREG(PREG->u.xxn.x) = d0; + XREG(PREG->y_u.xxn.x) = d0; PREG = NEXTOP(NEXTOP(NEXTOP(PREG, xxn),Osbpp),l); GONext(); } @@ -13161,7 +13072,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_FUNC2S_VC_D1ISZERO); ///#endif - XREG(PREG->u.xxn.x) = d0; + XREG(PREG->y_u.xxn.x) = d0; PREG = NEXTOP(NEXTOP(NEXTOP(PREG, xxn),Osbpp),l); GONext(); } @@ -13187,7 +13098,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_FUNC2S_VC_POST_ELSE); ///#endif - pt1 = HR; + pt1 = HR; *pt1++ = d0; d0 = AbsAppl(HR); if (pt1+d1 > ENV || pt1+d1 > (CELL *)B) { @@ -13227,7 +13138,7 @@ ENDD(d1); /* else if arity is 0 just pass d0 through */ /* Ding, ding, we made it */ - XREG(PREG->u.xxn.x) = d0; + XREG(PREG->y_u.xxn.x) = d0; PREG = NEXTOP(NEXTOP(NEXTOP(PREG, xxn),Osbpp),l); GONext(); @@ -13257,9 +13168,9 @@ EMIT_SIMPLE_BLOCK(P_FUNC2S_Y_VV_LOW_LEVEL_TRACER); ///#endif RESET_VARIABLE(HR); - H[1] = XREG(PREG->u.yxx.x1); - H[2] = XREG(PREG->u.yxx.x2); - low_level_trace(enter_pred,RepPredPrOp(traced_Yap_GetPredPropByFunc(FunctorFunctor,0)),H); + HR[1] = XREG(PREG->y_u.yxx.x1); + HR[2] = XREG(PREG->y_u.yxx.x2); + low_level_trace(enter_pred,RepPredProp(Yap_GetPredPropByFunc(FunctorFunctor,0)), HR ); } #endif /* LOW_LEVEL_TRACE */ /* We have to build the structure */ @@ -13267,7 +13178,7 @@ EMIT_SIMPLE_BLOCK(P_FUNC2S_Y_VV_TEST_D0); ///#endif BEGD(d0); - d0 = XREG(PREG->u.yxx.x1); + d0 = XREG(PREG->y_u.yxx.x1); deref_head(d0, traced_func2s_y_unk); traced_func2s_y_nvar: /* we do, let's get the third argument */ @@ -13275,7 +13186,7 @@ EMIT_SIMPLE_BLOCK(P_FUNC2S_Y_VV_TEST_D1); ///#endif BEGD(d1); - d1 = XREG(PREG->u.yxx.x2); + d1 = XREG(PREG->y_u.yxx.x2); deref_head(d1, traced_func2s_y_unk2); traced_func2s_y_nvar2: /* Uuuff, the second and third argument are bound */ @@ -13324,9 +13235,9 @@ RESET_VARIABLE(HR); RESET_VARIABLE(HR+1); d0 = AbsPair(HR); - H += 2; + HR += 2; BEGP(pt1); - pt1 = YREG + PREG->u.yxx.y; + pt1 = YREG + PREG->y_u.yxx.y; PREG = NEXTOP(NEXTOP(NEXTOP(PREG, yxx),Osbpp),l); INITIALIZE_PERMVAR(pt1,d0); ENDP(pt1); @@ -13390,12 +13301,12 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_FUNC2S_Y_VV_D1GREATER_END); ///#endif - H = pt1; + HR = pt1; ENDP(pt1); /* else if arity is 0 just pass d0 through */ /* Ding, ding, we made it */ BEGP(pt1); - pt1 = YREG + PREG->u.yxx.y; + pt1 = YREG + PREG->y_u.yxx.y; PREG = NEXTOP(NEXTOP(NEXTOP(PREG, yxx),Osbpp),l); INITIALIZE_PERMVAR(pt1,d0); ENDP(pt1); @@ -13405,7 +13316,7 @@ EMIT_SIMPLE_BLOCK(P_FUNC2S_Y_VV_D1ISZERO); ///#endif BEGP(pt1); - pt1 = YREG + PREG->u.yxx.y; + pt1 = YREG + PREG->y_u.yxx.y; PREG = NEXTOP(NEXTOP(NEXTOP(PREG, yxx),Osbpp),l); INITIALIZE_PERMVAR(pt1,d0); ENDP(pt1); @@ -13459,9 +13370,9 @@ EMIT_SIMPLE_BLOCK(P_FUNC2S_Y_CV_LOW_LEVEL_TRACER); ///#endif RESET_VARIABLE(HR); - H[1] = PREG->u.yxn.c; - H[2] = XREG(PREG->u.yxn.xi); - low_level_trace(enter_pred,RepPredPrOp(traced_Yap_GetPredPropByFunc(FunctorFunctor,0)),H); + HR[1] = PREG->y_u.yxn.c; + HR[2] = XREG(PREG->y_u.yxn.xi); + low_level_trace(enter_pred,RepPredProp(Yap_GetPredPropByFunc(FunctorFunctor,0)),HR); } #endif /* LOW_LEVEL_TRACE */ /* We have to build the structure */ @@ -13469,10 +13380,10 @@ EMIT_SIMPLE_BLOCK(P_FUNC2S_Y_CV_TEST_D1); ///#endif BEGD(d0); - d0 = PREG->u.yxn.c; + d0 = PREG->y_u.yxn.c; /* we do, let's get the third argument */ BEGD(d1); - d1 = XREG(PREG->u.yxn.xi); + d1 = XREG(PREG->y_u.yxn.xi); deref_head(d1, traced_func2s_y_unk_cv); traced_func2s_y_nvar_cv: /* Uuuff, the second and third argument are bound */ @@ -13512,11 +13423,11 @@ RESET_VARIABLE(HR); RESET_VARIABLE(HR+1); d0 = AbsPair(HR); - H += 2; + HR += 2; /* else if arity is 0 just pass d0 through */ /* Ding, ding, we made it */ BEGP(pt1); - pt1 = YREG + PREG->u.yxn.y; + pt1 = YREG + PREG->y_u.yxn.y; PREG = NEXTOP(NEXTOP(NEXTOP(PREG, yxn),Osbpp),l); INITIALIZE_PERMVAR(pt1,d0); ENDP(pt1); @@ -13581,12 +13492,12 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_FUNC2S_Y_CV_D1GREATER_END); ///#endif - H = pt1; + HR = pt1; ENDP(pt1); /* else if arity is 0 just pass d0 through */ /* Ding, ding, we made it */ BEGP(pt1); - pt1 = YREG + PREG->u.yxn.y; + pt1 = YREG + PREG->y_u.yxn.y; PREG = NEXTOP(NEXTOP(NEXTOP(PREG, yxn),Osbpp),l); INITIALIZE_PERMVAR(pt1,d0); ENDP(pt1); @@ -13596,7 +13507,7 @@ EMIT_SIMPLE_BLOCK(P_FUNC2S_Y_CV_D1ISZERO); ///#endif BEGP(pt1); - pt1 = YREG + PREG->u.yxn.y; + pt1 = YREG + PREG->y_u.yxn.y; PREG = NEXTOP(NEXTOP(NEXTOP(PREG, yxn),Osbpp),l); INITIALIZE_PERMVAR(pt1,d0); ENDP(pt1); @@ -13640,12 +13551,12 @@ Term ti; CELL *hi = HR; - ti = MkIntegerTerm((Int)(PREG->u.yxn.c)); + ti = MkIntegerTerm((Int)(PREG->y_u.yxn.c)); RESET_VARIABLE(HR); - H[1] = XREG(PREG->u.yxn.xi); - H[2] = ti; - low_level_trace(enter_pred,RepPredPrOp(traced_Yap_GetPredPropByFunc(FunctorFunctor,0)),H); - H = hi; + HR[1] = XREG(PREG->y_u.yxn.xi); + HR[2] = ti; + low_level_trace(enter_pred,RepPredProp(Yap_GetPredPropByFunc(FunctorFunctor,0)),HR); + HR = hi; } #endif /* LOW_LEVEL_TRACE */ /* We have to build the structure */ @@ -13653,14 +13564,14 @@ EMIT_SIMPLE_BLOCK(P_FUNC2S_Y_VC_TEST_D0); ///#endif BEGD(d0); - d0 = XREG(PREG->u.yxn.xi); + d0 = XREG(PREG->y_u.yxn.xi); deref_head(d0, traced_func2s_y_unk_vc); traced_func2s_y_nvar_vc: ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_FUNC2S_Y_VC_FUNC2S_Y_NVAR_VC); ///#endif BEGD(d1); - d1 = PREG->u.yxn.c; + d1 = PREG->y_u.yxn.c; if (!IsAtomicTerm(d0)) { ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_FUNC2S_Y_VC_D0NOATOMIC); @@ -13679,11 +13590,11 @@ RESET_VARIABLE(HR); RESET_VARIABLE(HR+1); d0 = AbsPair(HR); - H += 2; + HR += 2; /* else if arity is 0 just pass d0 through */ /* Ding, ding, we made it */ BEGP(pt1); - pt1 = YREG + PREG->u.yxn.y; + pt1 = YREG + PREG->y_u.yxn.y; PREG = NEXTOP(NEXTOP(NEXTOP(PREG, yxn),Osbpp),l); INITIALIZE_PERMVAR(pt1,d0); ENDP(pt1); @@ -13694,7 +13605,7 @@ EMIT_SIMPLE_BLOCK(P_FUNC2S_Y_VC_D1ISZERO); ///#endif BEGP(pt1); - pt1 = YREG + PREG->u.yxn.y; + pt1 = YREG + PREG->y_u.yxn.y; PREG = NEXTOP(NEXTOP(NEXTOP(PREG, yxn),Osbpp),l); INITIALIZE_PERMVAR(pt1,d0); ENDP(pt1); @@ -13772,7 +13683,7 @@ /* else if arity is 0 just pass d0 through */ /* Ding, ding, we made it */ BEGP(pt1); - pt1 = YREG + PREG->u.yxn.y; + pt1 = YREG + PREG->y_u.yxn.y; PREG = NEXTOP(NEXTOP(NEXTOP(PREG, yxn),Osbpp),l); INITIALIZE_PERMVAR(pt1,d0); ENDP(pt1); @@ -13802,17 +13713,17 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_FUNC2F_XX_LOW_LEVEL_TRACER); ///#endif - H[0] = XREG(PREG->u.xxx.x); + HR[0] = XREG(PREG->y_u.xxx.x); RESET_VARIABLE(HR+1); RESET_VARIABLE(HR+2); - low_level_trace(enter_pred,RepPredPrOp(traced_Yap_GetPredPropByFunc(FunctorFunctor,0)),H); + low_level_trace(enter_pred,RepPredProp(Yap_GetPredPropByFunc(FunctorFunctor,0)),HR); } #endif /* LOW_LEVEL_TRACE */ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_FUNC2F_XX_TEST_D0); ///#endif BEGD(d0); - d0 = XREG(PREG->u.xxx.x); + d0 = XREG(PREG->y_u.xxx.x); deref_head(d0, traced_func2f_xx_unk); traced_func2f_xx_nvar: if (IsApplTerm(d0)) { @@ -13824,32 +13735,32 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_FUNC2F_XX_D0APPL_D1EXTFUNC); ///#endif - XREG(PREG->u.xxx.x1) = d0; - XREG(PREG->u.xxx.x2) = MkIntTerm(0); + XREG(PREG->y_u.xxx.x1) = d0; + XREG(PREG->y_u.xxx.x2) = MkIntTerm(0); PREG = NEXTOP(PREG, xxx); GONext(); } ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_FUNC2F_XX_D0APPL_END); ///#endif - XREG(PREG->u.xxx.x1) = MkAtomTerm(NameOfFunctor(d1)); - XREG(PREG->u.xxx.x2) = MkIntegerTerm(ArityOfFunctor(d1)); + XREG(PREG->y_u.xxx.x1) = MkAtomTerm(NameOfFunctor(d1)); + XREG(PREG->y_u.xxx.x2) = MkIntegerTerm(ArityOfFunctor(d1)); PREG = NEXTOP(PREG, xxx); GONext(); } else if (IsPairTerm(d0)) { ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_FUNC2F_XX_D0PAIR); ///#endif - XREG(PREG->u.xxx.x1) = TermDot; - XREG(PREG->u.xxx.x2) = MkIntTerm(2); + XREG(PREG->y_u.xxx.x1) = TermDot; + XREG(PREG->y_u.xxx.x2) = MkIntTerm(2); PREG = NEXTOP(PREG, xxx); GONext(); } else { ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_FUNC2F_XX_D0NOCOMPOUND); ///#endif - XREG(PREG->u.xxx.x1) = d0; - XREG(PREG->u.xxx.x2) = MkIntTerm(0); + XREG(PREG->y_u.xxx.x1) = d0; + XREG(PREG->y_u.xxx.x2) = MkIntTerm(0); PREG = NEXTOP(PREG, xxx); GONext(); } @@ -13877,17 +13788,17 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_FUNC2F_XY_LOW_LEVEL_TRACER); ///#endif - H[0] = XREG(PREG->u.xxy.x); + HR[0] = XREG(PREG->y_u.xxy.x); RESET_VARIABLE(HR+1); RESET_VARIABLE(HR+2); - low_level_trace(enter_pred,RepPredPrOp(traced_Yap_GetPredPropByFunc(FunctorFunctor,0)),H); + low_level_trace(enter_pred,RepPredProp(Yap_GetPredPropByFunc(FunctorFunctor,0)),HR); } #endif /* LOW_LEVEL_TRACE */ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_FUNC2F_XY_TEST_D0); ///#endif BEGD(d0); - d0 = XREG(PREG->u.xxy.x); + d0 = XREG(PREG->y_u.xxy.x); deref_head(d0, traced_func2f_xy_unk); traced_func2f_xy_nvar: if (IsApplTerm(d0)) { @@ -13895,12 +13806,12 @@ EMIT_SIMPLE_BLOCK(P_FUNC2F_XY_D0APPL); ///#endif Functor d1 = FunctorOfTerm(d0); - CELL *pt0 = YREG+PREG->u.xxy.y2; + CELL *pt0 = YREG+PREG->y_u.xxy.y2; if (IsExtensionFunctor(d1)) { ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_FUNC2F_XY_D0APPL_D1EXTFUNC); ///#endif - XREG(PREG->u.xxy.x1) = d0; + XREG(PREG->y_u.xxy.x1) = d0; PREG = NEXTOP(PREG, xxy); INITIALIZE_PERMVAR(pt0, MkIntTerm(0)); GONext(); @@ -13908,7 +13819,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_FUNC2F_XY_D0APPL_END); ///#endif - XREG(PREG->u.xxy.x1) = MkAtomTerm(NameOfFunctor(d1)); + XREG(PREG->y_u.xxy.x1) = MkAtomTerm(NameOfFunctor(d1)); PREG = NEXTOP(PREG, xxy); INITIALIZE_PERMVAR(pt0, MkIntegerTerm(ArityOfFunctor(d1))); GONext(); @@ -13916,8 +13827,8 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_FUNC2F_XY_D0PAIR); ///#endif - CELL *pt0 = YREG+PREG->u.xxy.y2; - XREG(PREG->u.xxy.x1) = TermDot; + CELL *pt0 = YREG+PREG->y_u.xxy.y2; + XREG(PREG->y_u.xxy.x1) = TermDot; PREG = NEXTOP(PREG, xxy); INITIALIZE_PERMVAR(pt0, MkIntTerm(2)); GONext(); @@ -13925,8 +13836,8 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_FUNC2F_XY_D0NOCOMPOUND); ///#endif - CELL *pt0 = YREG+PREG->u.xxy.y2; - XREG(PREG->u.xxy.x1) = d0; + CELL *pt0 = YREG+PREG->y_u.xxy.y2; + XREG(PREG->y_u.xxy.x1) = d0; PREG = NEXTOP(PREG, xxy); INITIALIZE_PERMVAR(pt0, MkIntTerm(0)); GONext(); @@ -13955,17 +13866,17 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_FUNC2F_YX_LOW_LEVEL_TRACER); ///#endif - H[0] = XREG(PREG->u.yxx.x2); + HR[0] = XREG(PREG->y_u.yxx.x2); RESET_VARIABLE(HR+1); RESET_VARIABLE(HR+2); - low_level_trace(enter_pred,RepPredPrOp(traced_Yap_GetPredPropByFunc(FunctorFunctor,0)),H); + low_level_trace(enter_pred,RepPredProp(Yap_GetPredPropByFunc(FunctorFunctor,0)),HR); } #endif /* LOW_LEVEL_TRACE */ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_FUNC2F_YX_TEST_D0); ///#endif BEGD(d0); - d0 = XREG(PREG->u.yxx.x2); + d0 = XREG(PREG->y_u.yxx.x2); deref_head(d0, traced_func2f_yx_unk); traced_func2f_yx_nvar: if (IsApplTerm(d0)) { @@ -13973,12 +13884,12 @@ EMIT_SIMPLE_BLOCK(P_FUNC2F_YX_D0APPL); ///#endif Functor d1 = FunctorOfTerm(d0); - CELL *pt0 = YREG+PREG->u.yxx.y; + CELL *pt0 = YREG+PREG->y_u.yxx.y; if (IsExtensionFunctor(d1)) { ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_FUNC2F_YX_D0APPL_D1EXTFUNC); ///#endif - XREG(PREG->u.yxx.x1) = MkIntTerm(0); + XREG(PREG->y_u.yxx.x1) = MkIntTerm(0); PREG = NEXTOP(PREG, yxx); INITIALIZE_PERMVAR(pt0, d0); GONext(); @@ -13986,7 +13897,7 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_FUNC2F_YX_D0APPL_END); ///#endif - XREG(PREG->u.yxx.x1) = MkIntegerTerm(ArityOfFunctor(d1)); + XREG(PREG->y_u.yxx.x1) = MkIntegerTerm(ArityOfFunctor(d1)); PREG = NEXTOP(PREG, yxx); INITIALIZE_PERMVAR(pt0, MkAtomTerm(NameOfFunctor(d1))); GONext(); @@ -13994,8 +13905,8 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_FUNC2F_YX_D0PAIR); ///#endif - CELL *pt0 = YREG+PREG->u.yxx.y; - XREG(PREG->u.yxx.x1) = MkIntTerm(2); + CELL *pt0 = YREG+PREG->y_u.yxx.y; + XREG(PREG->y_u.yxx.x1) = MkIntTerm(2); PREG = NEXTOP(PREG, yxx); INITIALIZE_PERMVAR(pt0 ,TermDot); GONext(); @@ -14003,8 +13914,8 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_FUNC2F_YX_D0NOCOMPOUND); ///#endif - CELL *pt0 = YREG+PREG->u.yxx.y; - XREG(PREG->u.yxx.x1) = MkIntTerm(0); + CELL *pt0 = YREG+PREG->y_u.yxx.y; + XREG(PREG->y_u.yxx.x1) = MkIntTerm(0); PREG = NEXTOP(PREG, yxx); INITIALIZE_PERMVAR(pt0, d0); GONext(); @@ -14033,17 +13944,17 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_FUNC2F_YY_LOW_LEVEL_TRACER); ///#endif - H[0] = XREG(PREG->u.yyx.x); + HR[0] = XREG(PREG->y_u.yyx.x); RESET_VARIABLE(HR+1); RESET_VARIABLE(HR+2); - low_level_trace(enter_pred,RepPredPrOp(traced_Yap_GetPredPropByFunc(FunctorFunctor,0)),H); + low_level_trace(enter_pred,RepPredProp(Yap_GetPredPropByFunc(FunctorFunctor,2)),HR); } #endif /* LOW_LEVEL_TRACE */ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_FUNC2F_YY_TEST_D0); ///#endif BEGD(d0); - d0 = XREG(PREG->u.yyx.x); + d0 = XREG(PREG->y_u.yyx.x); deref_head(d0, traced_func2f_yy_unk); traced_func2f_yy_nvar: if (IsApplTerm(d0)) { @@ -14051,8 +13962,8 @@ EMIT_SIMPLE_BLOCK(P_FUNC2F_YY_D0APPL); ///#endif Functor d1 = FunctorOfTerm(d0); - CELL *pt0 = YREG+PREG->u.yyx.y1; - CELL *pt1 = YREG+PREG->u.yyx.y2; + CELL *pt0 = YREG+PREG->y_u.yyx.y1; + CELL *pt1 = YREG+PREG->y_u.yyx.y2; if (IsExtensionFunctor(d1)) { ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_FUNC2F_YY_D0APPL_D1EXTFUNC); @@ -14073,8 +13984,8 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_FUNC2F_YY_D0PAIR); ///#endif - CELL *pt0 = YREG+PREG->u.yyx.y1; - CELL *pt1 = YREG+PREG->u.yyx.y2; + CELL *pt0 = YREG+PREG->y_u.yyx.y1; + CELL *pt1 = YREG+PREG->y_u.yyx.y2; PREG = NEXTOP(PREG, yyx); INITIALIZE_PERMVAR(pt0, TermDot); INITIALIZE_PERMVAR(pt1, MkIntTerm(2)); @@ -14083,8 +13994,8 @@ ///#ifdef PROFILED_ABSMI EMIT_SIMPLE_BLOCK(P_FUNC2F_YY_D0NOCOMPOUND); ///#endif - CELL *pt0 = YREG+PREG->u.yyx.y1; - CELL *pt1 = YREG+PREG->u.yyx.y2; + CELL *pt0 = YREG+PREG->y_u.yyx.y1; + CELL *pt1 = YREG+PREG->y_u.yyx.y2; PREG = NEXTOP(PREG, yyx); INITIALIZE_PERMVAR(pt0, d0); INITIALIZE_PERMVAR(pt1, MkIntTerm(0)); @@ -14110,7 +14021,7 @@ EMIT_MULTIPLE_DESTINY_BLOCK_TEST(P_FUNCTOR_END); #ifdef LOW_LEVEL_TRACER if (Yap_do_low_level_trace) - low_level_trace(enter_pred,RepPredPrOp(traced_Yap_GetPredPropByFunc(FunctorFunctor,0)),XREGS+1); + low_level_trace(enter_pred,RepPredProp(Yap_GetPredPropByFunc(FunctorFunctor,0)),XREGS+1); #endif /* LOW_LEVEL_TRACE */ traced_restart_functor: BEGD(d0); @@ -14220,7 +14131,7 @@ RESET_VARIABLE(HR); RESET_VARIABLE(HR+1); d0 = AbsPair(HR); - H += 2; + HR += 2; } else if ((Int)d1 > 0) { /* now let's build a compound term */ @@ -14256,7 +14167,7 @@ pt1++; } /* done building the term */ - H = pt1; + HR = pt1; ENDP(pt1); } else if ((Int)d1 < 0) { saveregs(); @@ -14293,693 +14204,302 @@ ENDD(d0); ENDOp(); - BOp(traced_p_execute2, Osbpp); - //printf("p_execute2!!\n"); - { - PredEntry *pen; - Term mod = ARG2; - deref_head(mod, traced_execute2_unk0); - traced_execute2_nvar0: - if (!IsAtomTerm(mod)) { - saveregs(); - Yap_Error(TYPE_ERROR_ATOM, mod, "call/2"); - setregs(); - } - CACHE_Y_AS_ENV(YREG); - /* Try to preserve the environment */ - ENV_YREG = (CELL *) (((char *) YREG) + PREG->u.Osbpp.s); + /* 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(traced_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); + { + choiceptr top_b = PROTECT_FROZEN_B(B); #ifdef YAPOR_SBA - if (ENV_YREG > (CELL *) top_b || ENV_YREG < HR) ENV_YREG = (CELL *) top_b; + 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; + if (ENV_YREG > (CELL *) top_b) ENV_YREG = (CELL *) top_b; #endif /* YAPOR_SBA */ - } + } #else - if (ENV_YREG > (CELL *) B) { - ENV_YREG = (CELL *) B; - } + if (ENV_YREG > (CELL *) B) { + ENV_YREG = (CELL *) B; + } #endif /* FROZEN_STACKS */ - BEGD(d0); - d0 = ARG1; - traced_restart_execute2: - deref_head(d0, traced_execute2_unk); - traced_execute2_nvar: - if (IsApplTerm(d0)) { - Functor f = FunctorOfTerm(d0); - if (IsExtensionFunctor(f)) { - goto traced_execute2_metacall; - } - pen = RepPredProp(PredPropByFunc(f, mod)); - if (pen->PredFlags & (MetaPredFlag|GoalExPredFlag)) { - if (f == FunctorModule) { - Term tmod = ArgOfTerm(1,d0); - if (!IsVarTerm(tmod) && IsAtomTerm(tmod)) { - d0 = ArgOfTerm(2,d0); - mod = tmod; - goto execute2_nvar; - } - } else if (f == FunctorComma) { - SREG = RepAppl(d0); - BEGD(d1); - d1 = SREG[2]; - /* create an to execute2 the call */ - deref_head(d1, traced_execute2_comma_unk); - traced_execute2_comma_nvar: - if (IsAtomTerm(d1)) { - ENV_YREG[-EnvSizeInCells-2] = MkIntegerTerm((Int)PredPropByAtom(AtomOfTerm(d1),mod)); - ENV_YREG[-EnvSizeInCells-3] = mod; - } else if (IsApplTerm(d1)) { - Functor f = FunctorOfTerm(d1); - if (IsExtensionFunctor(f)) { - goto traced_execute2_metacall; - } else { - if (f == FunctorModule) goto traced_execute2_metacall; - ENV_YREG[-EnvSizeInCells-2] = MkIntegerTerm((Int)PredPropByFunc(f,mod)); - ENV_YREG[-EnvSizeInCells-3] = mod; - } - } else { - goto traced_execute2_metacall; - } - ENV_YREG[E_CP] = (CELL)NEXTOP(PREG,Osbpp); - ENV_YREG[E_CB] = (CELL)B; - 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; - PREG = COMMA_CODE; - /* for profiler */ - save_pc(); - d0 = SREG[1]; - goto traced_restart_execute2; + /* 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 traced_execute_pred_f; + } else + goto traced_execute_pred_a; + ENDBOp(); - BEGP(pt1); - deref_body(d1, pt1, traced_execute2_comma_unk, traced_execute2_comma_nvar); - goto traced_execute2_metacall; - ENDP(pt1); - ENDD(d1); - } else if (mod != CurrentModule) { - goto traced_execute2_metacall; - } - } - if (PRED_GOAL_EXPANSION_ALL) { - goto traced_execute2_metacall; - } + /* fetch the module from ARG2 */ + BOp(traced_p_execute2, Osbpp); - BEGP(pt1); - pt1 = RepAppl(d0); - BEGD(d2); - for (d2 = ArityOfFunctor(f); d2; d2--) { + mod = ARG2; + deref_head(mod, traced_execute2_unk0); + traced_execute2_nvar0: + if (!IsAtomTerm(mod)) { + saveregs(); + Yap_Error(TYPE_ERROR_ATOM, mod, "call/2"); + setregs(); + } + goto start_traced_execute; + + BEGP(pt1); + deref_body(mod, pt1, traced_execute2_unk0, traced_execute2_nvar0); + saveregs(); + Yap_Error(INSTANTIATION_ERROR, mod, "call/2"); + setregs(); + ENDP(pt1); + /* Oops, second argument was unbound too */ + FAIL(); + ENDBOp(); + + BOp(traced_p_execute, Osbmp); + /* fetch the module from PREG */ + mod = PREG->y_u.Osbmp.mod; + start_traced_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 - BEGD(d1); - d1 = pt1[d2]; - if (d1 == 0) { - XREGS[d2] = (CELL)(pt1+d2); - } else { - XREGS[d2] = d1; - } + if (ENV_YREG > (CELL *) top_b || ENV_YREG < HR) ENV_YREG = (CELL *) top_b; #else - XREGS[d2] = pt1[d2]; -#endif - } - ENDD(d2); - ENDP(pt1); - CACHE_A1(); - } else if (IsAtomTerm(d0)) { - if (PRED_GOAL_EXPANSION_ALL) { - goto traced_execute2_metacall; - } else { - pen = RepPredProp(PredPropByAtom(AtomOfTerm(d0), mod)); - } - } else { - goto traced_execute2_metacall; - } + 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 traced_execute_metacall; + } + restart_traced_execute: + deref_head(d0, traced_execute_unk); + traced_execute_nvar: + if (IsApplTerm(d0)) { + f = FunctorOfTerm(d0); + if (IsExtensionFunctor(f)) { + goto traced_execute_metacall; + } + pen = RepPredProp(PredPropByFunc(f, mod)); + traced_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 traced_execute_nvar; + } + goto traced_execute_metacall; + } + if (f == FunctorComma) { + Term nmod = mod; - traced_execute2_end: - /* code copied from call */ -#ifndef NO_CHECKING - check_stack(traced_NoStackPExecute2, HR); -#endif - CPREG = NEXTOP(PREG, Osbpp); - ALWAYS_LOOKAHEAD(pen->OpcodeOfPred); - PREG = pen->CodeOfPred; - /* for profiler */ - save_pc(); + /* optimise conj */ + SREG = RepAppl(d0); + BEGD(d1); + d1 = SREG[2]; + /* create an environment to traced_execute the call */ + deref_head(d1, traced_execute_comma_unk); + traced_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 traced_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 traced_execute_comma_nvar; + } + goto traced_execute_metacall; + } + ENV_YREG[-EnvSizeInCells-2] = MkIntegerTerm((Int)PredPropByFunc(f1,nmod)); + } + } else { + goto traced_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 - if (DEPTH <= MkIntTerm(1)) {/* I assume Module==0 is primitives */ - if (pen->ModuleOfPred) { - if (DEPTH == MkIntTerm(0)) { - TRACED_FAIL(); - } - else DEPTH = RESET_DEPTH(); - } - } else if (pen->ModuleOfPred) - DEPTH -= MkIntConstant(2); -#endif /* 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_traced_execute; + + BEGP(pt1); + deref_body(d1, pt1, traced_execute_comma_unk, traced_execute_comma_nvar); + goto traced_execute_metacall; + ENDP(pt1); + ENDD(d1); + } else if (mod != CurrentModule) { + goto traced_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)); + traced_execute_pred_a: + /* handle extra pruning */ + if (pen->FunctorOfPred == (Functor)AtomCut) { + if (b_ptr != B) { + saveregs(); + prune(b_ptr PASS_REGS); + setregs(); + } + } + } else { + goto traced_execute_metacall; + } + + /* traced_execute, but test first for interrupts */ + traced_execute_end: + /* code copied from call */ +#ifndef NO_CHECKING + check_stack(TracedNoStackPExecute, HR); +#endif + traced_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; + 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(); + SCH_check_requests(); +#endif /* YAPOR */ + CACHE_A1(); + ALWAYS_GONext(); + ALWAYS_END_PREFETCH(); - BEGP(pt1); - deref_body(d0, pt1, traced_execute2_unk, traced_execute2_nvar); - traced_execute2_metacall: - ARG1 = ARG3 = d0; - pen = PredMetaCall; - ARG2 = Yap_cp_as_integer(B); - if (mod) - ARG4 = mod; - else - ARG4 = TermProlog; - goto traced_execute2_end; - ENDP(pt1); + /* meta-call: Prolog to the rescue */ + BEGP(pt1); + deref_body(d0, pt1, traced_execute_unk, traced_execute_nvar); + traced_execute_metacall: + ARG1 = ARG3 = d0; + pen = PredMetaCall; + ARG2 = Yap_cp_as_integer(b_ptr); + if (mod) + ARG4 = mod; + else + ARG4 = TermProlog; + goto traced_execute_end; + ENDP(pt1); - ENDD(d0); - traced_NoStackPExecute2: - CHECK_ALARM(goto traced_execute2_end); - if (LOCAL_ActiveSignals & YAP_FAIL_SIGNAL) { - LOCAL_ActiveSignals &= ~YAP_FAIL_SIGNAL; - if (!LOCAL_ActiveSignals) - CreepFlag = CalculateStackGap(); - goto fail; - } - PP = PredMetaCall; - SREG = (CELL *) pen; - ASP = ENV_YREG; - if (ASP > (CELL *)PROTECT_FROZEN_B(B)) - ASP = (CELL *)PROTECT_FROZEN_B(B); - /* setup GB */ - WRITEBACK_Y_AS_ENV(); - YREG[E_CB] = (CELL) B; - if (LOCAL_ActiveSignals) { - goto traced_creep_pe; - } - saveregs_and_ycache(); - if (!Yap_gc(((PredEntry *)SREG)->ArityOfPE, ENV, NEXTOP(PREG, Osbpp))) { - Yap_NilError(OUT_OF_STACK_ERROR,LOCAL_ErrorMessage); - } - setregs_and_ycache(); - goto traced_execute2_end; - ENDCACHE_Y_AS_ENV(); - - BEGP(pt1); - deref_body(mod, pt1, traced_execute2_unk0, traced_execute2_nvar0); - saveregs(); - Yap_Error(INSTANTIATION_ERROR, mod, "call/2"); - setregs(); - ENDP(pt1); - /* Oops, second argument was unbound too */ - TRACED_FAIL(); - } - ENDBOp(); - - BOp(traced_p_execute, Osbmp); - //printf("p_execute!!\n"); - { - PredEntry *pen; - Term mod = PREG->u.Osbmp.mod; - - CACHE_Y_AS_ENV(YREG); - /* Try to preserve the environment */ - ENV_YREG = (CELL *) (((char *) YREG) + PREG->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 */ - BEGD(d0); - d0 = ARG1; - traced_restart_execute: - deref_head(d0, traced_execute_unk); - traced_execute_nvar: - if (IsApplTerm(d0)) { - Functor f = FunctorOfTerm(d0); - if (IsExtensionFunctor(f)) { - goto traced_execute_metacall; - } - pen = RepPredProp(PredPropByFunc(f, mod)); - if (pen->PredFlags & (MetaPredFlag|GoalExPredFlag)) { - if (f == FunctorModule) { - Term tmod = ArgOfTerm(1,d0); - if (!IsVarTerm(tmod) && IsAtomTerm(tmod)) { - d0 = ArgOfTerm(2,d0); - mod = tmod; - goto traced_execute_nvar; - } - } else if (f == FunctorComma) { - SREG = RepAppl(d0); - BEGD(d1); - d1 = SREG[2]; - /* create an to execute the call */ - deref_head(d1, traced_execute_comma_unk); - traced_execute_comma_nvar: - if (IsAtomTerm(d1)) { - ENV_YREG[-EnvSizeInCells-2] = MkIntegerTerm((Int)PredPropByAtom(AtomOfTerm(d1),mod)); - ENV_YREG[-EnvSizeInCells-3] = mod; - } else if (IsApplTerm(d1)) { - f = FunctorOfTerm(d1); - if (IsExtensionFunctor(f)) { - goto traced_execute_metacall; - } else { - if (f == FunctorModule) goto traced_execute_metacall; - ENV_YREG[-EnvSizeInCells-2] = MkIntegerTerm((Int)PredPropByFunc(f,mod)); - ENV_YREG[-EnvSizeInCells-3] = mod; - } - } else { - goto traced_execute_metacall; - } - ENV_YREG[E_CP] = (CELL)NEXTOP(PREG,Osbmp); - ENV_YREG[E_CB] = (CELL)B; - 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; - PREG = COMMA_CODE; - /* for profiler */ - save_pc(); - d0 = SREG[1]; - goto traced_restart_execute; - - BEGP(pt1); - deref_body(d1, pt1, traced_execute_comma_unk, traced_execute_comma_nvar); - goto traced_execute_metacall; - ENDP(pt1); - ENDD(d1); - } else if (mod != CurrentModule) { - goto traced_execute_metacall; - } - } - if (PRED_GOAL_EXPANSION_ALL) { - goto traced_execute_metacall; - } - - 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)) { - if (PRED_GOAL_EXPANSION_ALL) { - goto traced_execute_metacall; - } else { - pen = RepPredProp(PredPropByAtom(AtomOfTerm(d0), mod)); - } - } else { - goto traced_execute_metacall; - } - - traced_execute_end: - /* code copied from call */ -#ifndef NO_CHECKING - check_stack(traced_NoStackPExecute, HR); -#endif - 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)) { - TRACED_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(); - - BEGP(pt1); - deref_body(d0, pt1, traced_execute_unk, traced_execute_nvar); - traced_execute_metacall: - ARG1 = ARG3 = d0; - pen = PredMetaCall; - ARG2 = Yap_cp_as_integer(B); - if (mod) - ARG4 = mod; - else - ARG4 = TermProlog; - goto traced_execute_end; - ENDP(pt1); - - ENDD(d0); - traced_NoStackPExecute: - CHECK_ALARM(goto traced_execute_end); - if (LOCAL_ActiveSignals & YAP_FAIL_SIGNAL) { - LOCAL_ActiveSignals &= ~YAP_FAIL_SIGNAL; - if (!LOCAL_ActiveSignals) - CreepFlag = CalculateStackGap(); - goto fail; - } - PP = PredMetaCall; - SREG = (CELL *) pen; - ASP = ENV_YREG; - if (ASP > (CELL *)PROTECT_FROZEN_B(B)) - ASP = (CELL *)PROTECT_FROZEN_B(B); - /* setup GB */ - WRITEBACK_Y_AS_ENV(); - YREG[E_CB] = (CELL) B; - if (LOCAL_ActiveSignals) { - goto traced_creep_pe; - } - saveregs_and_ycache(); - if (!Yap_gc(((PredEntry *)SREG)->ArityOfPE, ENV, NEXTOP(PREG, Osbmp))) { - Yap_NilError(OUT_OF_STACK_ERROR,LOCAL_ErrorMessage); - } - setregs_and_ycache(); - goto traced_execute_end; - ENDCACHE_Y_AS_ENV(); - } - ENDBOp(); - - traced_creep_pe: /* do creep in call */ - CPREG = NEXTOP(PREG, Osbmp); - goto creep; - - BOp(traced_p_execute_tail, Osbpp); - { - PredEntry *pen; - Term mod; - UInt arity; - - CACHE_Y_AS_ENV(YREG); - BEGP(pt0); - BEGD(d0); - d0 = ENV_YREG[-EnvSizeInCells-1]; - pen = RepPredProp((Prop)IntegerOfTerm(ENV_YREG[-EnvSizeInCells-2])); - CPREG = (yamop *) ENV_YREG[E_CP]; - pt0 = ENV_YREG; - 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 */ - arity = pen->ArityOfPE; - if (pen->PredFlags & (MetaPredFlag|GoalExPredFlag)) { - mod = pt0[-EnvSizeInCells-3]; - if (pen->FunctorOfPred == FunctorComma) { - SREG = RepAppl(d0); - BEGD(d1); - d1 = SREG[2]; - traced_execute_comma_comma: - /* create an to execute the call */ - deref_head(d1, traced_execute_comma_comma_unk); - traced_execute_comma_comma_nvar: - ENV_YREG[E_CB] = pt0[E_CB]; - if (IsAtomTerm(d1)) { - ENV_YREG[-EnvSizeInCells-2] = MkIntegerTerm((Int)PredPropByAtom(AtomOfTerm(d1),mod)); - } else if (IsApplTerm(d1)) { - Functor f = FunctorOfTerm(d1); - if (IsExtensionFunctor(f)) { - goto traced_execute_metacall_after_comma; - } else if (f == FunctorModule) { - Term tmod = ArgOfTerm(1, d1); - if (IsVarTerm(tmod) || !IsAtomTerm(tmod)) - goto traced_execute_metacall_after_comma; - mod = tmod; - d1 = RepAppl(d1)[2]; - goto traced_execute_comma_comma; - } else { - ENV_YREG[-EnvSizeInCells-2] = MkIntegerTerm((Int)PredPropByFunc(f,mod)); - } - } else { - goto traced_execute_metacall_after_comma; - } - ENV_YREG[E_CP] = (CELL)CPREG; - ENV_YREG[E_E] = (CELL)ENV; -#ifdef DEPTH_LIMIT - ENV_YREG[E_DEPTH] = DEPTH; -#endif /* DEPTH_LIMIT */ - ENV_YREG[-EnvSizeInCells-1] = d1; - ENV_YREG[-EnvSizeInCells-3] = mod; - ENV = ENV_YREG; - ENV_YREG -= EnvSizeInCells+3; - d0 = SREG[1]; - CPREG = NEXTOP(COMMA_CODE,Osbpp); - traced_execute_comma_comma2: - /* create an to execute the call */ - deref_head(d0, traced_execute_comma_comma2_unk); - traced_execute_comma_comma2_nvar: - if (IsAtomTerm(d0)) { - Atom at = AtomOfTerm(d0); - arity = 0; - if (at == AtomCut) { - choiceptr cut_pt = (choiceptr)pt0[E_CB]; - SET_ASP(YREG, E_CB*sizeof(CELL)); - saveregs(); - prune(cut_pt); - setregs(); - } - pen = RepPredProp(PredPropByAtom(at, mod)); - goto traced_execute_comma; - } else if (IsApplTerm(d0)) { - Functor f = FunctorOfTerm(d0); - if (IsExtensionFunctor(f) || f == FunctorModule) { - Term tmod = ArgOfTerm(1, d0); - if (IsVarTerm(tmod) || !IsAtomTerm(tmod)) - goto traced_execute_metacall_after_comma; - mod = tmod; - d0 = RepAppl(d0)[2]; - goto traced_execute_comma_comma2; - } else { - pen = RepPredProp(PredPropByFunc(f,mod)); - if (pen->PredFlags & (MetaPredFlag|GoalExPredFlag)) { - goto traced_execute_metacall_after_comma; - } - arity = pen->ArityOfPE; - goto traced_execute_comma; - } - } else { - if (mod != CurrentModule) - goto traced_execute_metacall_after_comma; - else { - arity = pen->ArityOfPE; - goto traced_execute_comma; - } - } - - BEGP(pt1); - deref_body(d0, pt1, traced_execute_comma_comma2_unk, traced_execute_comma_comma2_nvar); - goto traced_execute_metacall_after_comma; - ENDP(pt1); - - BEGP(pt1); - deref_body(d1, pt1, traced_execute_comma_comma_unk, traced_execute_comma_comma_nvar); - goto traced_execute_metacall_after_comma; - ENDP(pt1); - ENDD(d1); - } else { - if (mod != CurrentModule) { - traced_execute_metacall_after_comma: - ARG1 = ARG3 = d0; - pen = PredMetaCall; - ARG2 = Yap_cp_as_integer((choiceptr)pt0[E_CB]); - if (mod) - ARG4 = mod; - else - ARG4 = TermProlog; - CACHE_A1(); - goto traced_execute_after_comma; - } - } - } - traced_execute_comma: - if (arity) { - BEGP(pt1); - pt1 = RepAppl(d0); - BEGD(d2); - for (d2 = arity; 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 ((Atom)(pen->FunctorOfPred) == AtomCut) { - choiceptr cut_pt = (choiceptr)pt0[E_CB]; - SET_ASP(YREG, E_CB*sizeof(CELL)); - saveregs(); - prune(cut_pt); - setregs(); - } - - traced_execute_after_comma: -#ifndef NO_CHECKING - check_stack(traced_NoStackPTExecute, HR); -#endif - PREG = pen->CodeOfPred; - /* for profiler */ - save_pc(); - ALWAYS_LOOKAHEAD(pen->OpcodeOfPred); - ENV_YREG[E_CB] = (CELL)B; -#ifdef LOW_LEVEL_TRACER - if (Yap_do_low_level_trace) - low_level_trace(enter_pred,pen,XREGS+1); -#endif /* LOW_LEVEL_TRACER */ -#ifdef DEPTH_LIMIT - if (DEPTH <= MkIntTerm(1)) {/* I assume Module==0 is primitives */ - if (pen->ModuleOfPred) { - if (DEPTH == MkIntTerm(0)){ - TRACED_FAIL(); - } - else DEPTH = RESET_DEPTH(); - } - } else if (pen->ModuleOfPred) { - DEPTH -= MkIntConstant(2); - } -#endif /* DEPTH_LIMIT */ - /* do deallocate */ - WRITEBACK_Y_AS_ENV(); - ALWAYS_GONext(); - ALWAYS_END_PREFETCH(); - - ENDD(d0); - ENDP(pt0); - traced_NoStackPTExecute: - CHECK_ALARM(goto traced_execute_after_comma); - if (LOCAL_ActiveSignals & YAP_FAIL_SIGNAL) { - LOCAL_ActiveSignals &= ~YAP_FAIL_SIGNAL; - if (!LOCAL_ActiveSignals) - CreepFlag = CalculateStackGap(); - goto fail; - } - PP = NULL; - WRITEBACK_Y_AS_ENV(); - SREG = (CELL *) pen; - ASP = ENV_YREG; - if (ASP > (CELL *)PROTECT_FROZEN_B(B)) - ASP = (CELL *)PROTECT_FROZEN_B(B); - LOCK(LOCAL_SignalLock); - if (LOCAL_ActiveSignals & YAP_CDOVF_SIGNAL) { - UNLOCK(LOCAL_SignalLock); - saveregs_and_ycache(); - if (!Yap_growheap(FALSE, 0, NULL)) { - Yap_NilError(OUT_OF_HEAP_ERROR, "YAP failed to grow heap: %s", LOCAL_ErrorMessage); - setregs_and_ycache(); - TRACED_FAIL(); - } - setregs_and_ycache(); - LOCK(LOCAL_SignalLock); - LOCAL_ActiveSignals &= ~YAP_CDOVF_SIGNAL; - CreepFlag = CalculateStackGap(); - if (!LOCAL_ActiveSignals) { - UNLOCK(LOCAL_SignalLock); - goto traced_execute_after_comma; - } - } - if (LOCAL_ActiveSignals & YAP_TROVF_SIGNAL) { - UNLOCK(LOCAL_SignalLock); + /* at this point, we have the arguments all set in the argument registers, pen says who is the current predicate. don't remove. */ + TracedNoStackPExecute: + WRITEBACK_Y_AS_ENV(); #ifdef SHADOW_S - S = SREG; + Yap_REGS.S_ = SREG; #endif - saveregs_and_ycache(); - if(!Yap_growtrail (0, FALSE)) { - Yap_NilError(OUT_OF_TRAIL_ERROR,"YAP failed to reserve %ld bytes in growtrail",sizeof(CELL) * K16); - setregs_and_ycache(); - TRACED_FAIL(); - } - setregs_and_ycache(); - LOCAL_ActiveSignals &= ~YAP_TROVF_SIGNAL; - CreepFlag = CalculateStackGap(); - if (!LOCAL_ActiveSignals) { - UNLOCK(LOCAL_SignalLock); - goto traced_execute_after_comma; - } - } - if (LOCAL_ActiveSignals) { - if (LOCAL_ActiveSignals & YAP_CDOVF_SIGNAL) { - UNLOCK(LOCAL_SignalLock); - SREG = YENV; - goto noheapleft; - } - UNLOCK(LOCAL_SignalLock); - goto creep; - } - UNLOCK(LOCAL_SignalLock); - saveregs_and_ycache(); - if (!Yap_gc(((PredEntry *)SREG)->ArityOfPE, ENV, NEXTOP(PREG, Osbpp))) { - Yap_NilError(OUT_OF_STACK_ERROR,LOCAL_ErrorMessage); - } - setregs_and_ycache(); - goto traced_execute_after_comma; - ENDCACHE_Y_AS_ENV(); + 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 traced_execute_stack_checked; + goto traced_execute_end; + ENDBOp(); - } - ENDBOp(); + ENDD(d0); + ENDCACHE_Y_AS_ENV(); + + + } diff --git a/CMakeLists.txt b/CMakeLists.txt index d97e9549d..2ed7ef574 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -149,6 +149,8 @@ set (BUILD_SHARED_LIBS ON) # add_subdirectory (os/libtai) +add_subdirectory (CXX) + option (WITH_TABLING "Support tabling" ON) if (WITH_TABLING) #this depends on DEPTH_LIMIT define it after @@ -221,9 +223,24 @@ if (WIN32) ) endif (WIN32) -set (ENGINE_SOURCES - C/agc.c +set (ABSMI_SOURCES C/absmi.c + C/absmi_insts.h + C/fli_absmi_insts.h + C/or_absmi_insts.h + C/control_absmi_insts.h + C/index_absmi_insts.h + C/prim_absmi_insts.h + C/cp_absmi_insts.h + C/lu_absmi_insts.h + C/unify_absmi_insts.h + C/fail_absmi_insts.h + C/meta_absmi_insts.h + ) + +set (ENGINE_SOURCES + ${ABSMI_SOURCES} + C/agc.c C/adtdefs.c C/alloc.c C/amasm.c @@ -319,6 +336,8 @@ SET(OPTYAP_SOURCES OPTYap/tab.completion.c ) + + set(STATIC_SOURCES #NOT INCLUDED FOR NOW ) @@ -346,7 +365,8 @@ add_library(libYap SHARED ${C_INTERFACE_SOURCES} ${STATIC_SOURCES} ${OPTYAP_SOURCES} - $ ) + $ + ) target_link_libraries(libYap m resolv stdc++ ) @@ -357,7 +377,6 @@ set_target_properties(libYap OUTPUT_NAME Yap ) - option (WITH_Dynamic_BDD "dynamic bdd library" OFF) #TODO: @@ -413,7 +432,7 @@ if (READLINE_FOUND) endif (READLINE_FOUND) -macro_optional_find_package (Threads ON) +macro_optional_find_package (Threads OFF) macro_log_feature (THREADS_FOUND "Threads Support" "GNU Threads Library (or similar)" "http://www.gnu.org/software/threads") @@ -462,6 +481,22 @@ cmake_dependent_option (WITH_PThreadLocking "use pthread locking primitives for internal locking" ON System_Threads OFF) +option (Use_JIT + "use just-in-time compilation (experimental)" OFF) +if (Use_JIT) + macro_optional_find_package (LLVM ON) + macro_log_feature (LLVM_FOUND "LLVM JIT generator" + "The LLVM Compiler Infrastructure" + "http://www.llvm.org") + if (LLVM_FOUND) + add_subdirectory (JIT) + include_directories (JIT/HPP) + add_definitions(-DYAP_JIT=1) + endif (LLVM_FOUND) +endif (Use_JIT) + + + ADD_SUBDIRECTORY(library) ADD_SUBDIRECTORY(swi/library) # ADD_SUBDIRECTORY(os) diff --git a/CXX/CMakeLists.txt b/CXX/CMakeLists.txt new file mode 100644 index 000000000..5ba7bf6aa --- /dev/null +++ b/CXX/CMakeLists.txt @@ -0,0 +1,12 @@ + +add_library (Yap++ SHARED yapi.cpp) + +target_link_libraries(Yap++ libYap) + +install(TARGETS Yap++ + LIBRARY DESTINATION ${libdir} ) + +include_directories (${GMP_INCLUDE_DIR}) + + + diff --git a/H/CMakeLists.txt b/H/CMakeLists.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/H/TermExt.h b/H/TermExt.h index fed5787fc..c4cad5ef6 100755 --- a/H/TermExt.h +++ b/H/TermExt.h @@ -365,7 +365,7 @@ INLINE_ONLY inline EXTERN Term __MkStringTerm (const char *s USES_REGS) { Term t = AbsAppl(HR); - size_t sz = ALIGN_YAPTYPE(strlen(s)+1,CELL); + size_t sz = ALIGN_BY_TYPE(strlen(s)+1,CELL); HR[0] = (CELL) FunctorString; HR[1] = (CELL) sz; strcpy((char *)(HR+2), s); diff --git a/H/Yap.h b/H/Yap.h index d4a8b36ad..caf5d979a 100755 --- a/H/Yap.h +++ b/H/Yap.h @@ -43,6 +43,18 @@ #endif #include "config.h" +#ifndef COROUTINING +#define COROUTINING 1 +#endif + +#ifndef RATIONAL_TREES +#define RATIONAL_TREES 1 +#endif + +#ifndef CUT_C +#define CUT_C 1 +#endif + #define FunAdr(X) X #include "inline-only.h" @@ -97,26 +109,6 @@ #define TERM_EXTENSIONS 1 #endif /* COROUTINING && !TERM_EXTENSIONS */ -/* truth-values */ -#if HAVE_STDBOOL_H -#include -#else - -typedef int _Bool; - -#define bool _Bool; - -#define false 0 -#define true 1 -#endif - -#ifndef TRUE -#define TRUE true -#endif -#ifndef FALSE -#define FALSE false -#endif - /** * Stolen from Mozzila, this code should deal with bad implementations of stdc++. * @@ -182,6 +174,16 @@ typedef int _Bool; #define DUMMY_FILLER_FOR_ABS_TYPE int dummy; #endif /* HAVE_GCC */ +/************************************************************************************************* + main exports in YapInterface.h +*************************************************************************************************/ + +/* Basic exports */ + +#include "YapDefs.h" + +/* expect controls the direction of branches */ + #ifdef HAVE___BUILTIN_EXPECT #define likely(x) __builtin_expect((x), 1) #define unlikely(x) __builtin_expect((x), 0) @@ -199,20 +201,10 @@ typedef int _Bool; #include #endif /* THREADS */ -#ifndef ADTDEFS_C -#define EXTERN static -#else -#define EXTERN -#endif /* ADTDEFS_C */ - - /* null pointer */ #define NIL 0 /* Basic types */ - -#include "YapTerm.h" - #if HAVE_SIGPROF && (defined(__linux__) || defined(__APPLE__)) #define LOW_PROF 1 #endif @@ -349,7 +341,7 @@ typedef pthread_rwlock_t rwlock_t; /************************************************************************************************* - use an auxiliary function for ranges + use an auxiliary function for ranges *************************************************************************************************/ #ifdef __GNUC__ @@ -365,21 +357,13 @@ typedef pthread_rwlock_t rwlock_t; #endif /************************************************************************************************* - main exports in YapInterface.h -*************************************************************************************************/ - -/* Basic exports */ - -#include "YapDefs.h" - -/************************************************************************************************* - Atoms + Atoms *************************************************************************************************/ #include "Atoms.h" /************************************************************************************************* - Coroutining + Coroutining *************************************************************************************************/ @@ -389,7 +373,7 @@ typedef pthread_rwlock_t rwlock_t; #endif /************************************************************************************************* - abstract machine registers + abstract machine registers *************************************************************************************************/ #include "amidefs.h" @@ -406,7 +390,7 @@ typedef pthread_rwlock_t rwlock_t; #endif /************************************************************************************************* - variables concerned with Error Handling + variables concerned with Error Handling *************************************************************************************************/ #include @@ -496,7 +480,7 @@ typedef enum #define TermSize sizeof(Term) /************************************************************************************************* - variables related to memory allocation + variables related to memory allocation *************************************************************************************************/ /* must be before TermExt.h */ @@ -561,7 +545,7 @@ typedef struct opcode_tab_entry #endif /************************************************************************************************* - Prolog may be in several modes + Prolog may be in several modes *************************************************************************************************/ typedef enum @@ -679,13 +663,16 @@ typedef struct TIMED_MAVAR typedef enum { - INTERPRETED, /* interpreted */ - MIXED_MODE_USER, /* mixed mode only for user predicates */ - MIXED_MODE_ALL, /* mixed mode for all predicates */ - COMPILE_USER, /* compile all user predicates*/ - COMPILE_ALL /* compile all predicates */ + INTERPRETED = 0x1, /* interpreted */ + MIXED_MODE_USER = 0x2, /* mixed mode only for user predicates */ + MIXED_MODE_ALL = 0x4, /* mixed mode for all predicates */ + COMPILE_USER = 0x8, /* compile all user predicates*/ + COMPILE_ALL = 0x10 /* compile all predicates */ } yap_exec_mode; +#define MIXED_MODE ( MIXED_MODE_USER | MIXED_MODE_ALL ) + +#define COMPILED ( COMPILE_USER | COMPILE_ALL ) /************************/ // queues are an example of collections of DB objects @@ -855,6 +842,16 @@ extern struct worker_local Yap_local; #include "YapSignals.h" +/************************************************************************************************* +Global variables for JIT +*************************************************************************************************/ + +#if YAP_JIT +#ifndef __cplusplus +#ifndef _NATIVE +#include "JIT.hpp" +#endif +#endif +#endif #endif /* YAP_H */ - diff --git a/H/YapOpcodes.h b/H/YapOpcodes.h index 0187b7d94..58d22ae09 100644 --- a/H/YapOpcodes.h +++ b/H/YapOpcodes.h @@ -4,6 +4,9 @@ OPCODE(Ystop ,l), OPCODE(Nstop ,e), +#ifdef YAP_JIT + OPCODE(jit_handler ,J), +#endif OPCODE(try_me ,Otapl), OPCODE(retry_me ,Otapl), OPCODE(trust_me ,Otapl), @@ -20,25 +23,39 @@ OPCODE(retry_profiled ,p), OPCODE(profiled_retry_me ,Otapl), OPCODE(profiled_trust_me ,Otapl), - OPCODE(profiled_retry_logical ,OtaLl), - OPCODE(profiled_trust_logical ,OtILl), OPCODE(count_call ,p), OPCODE(count_retry ,p), OPCODE(count_retry_me ,Otapl), OPCODE(count_trust_me ,Otapl), - OPCODE(count_retry_logical ,OtaLl), - OPCODE(count_trust_logical ,OtILl), - OPCODE(lock_lu ,p), - OPCODE(unlock_lu ,e), - OPCODE(alloc_for_logical_pred ,L), - OPCODE(copy_idb_term ,e), - OPCODE(unify_idb_term ,e), OPCODE(ensure_space ,Osbpa), OPCODE(spy_or_trymark ,Otapl), OPCODE(try_and_mark ,Otapl), OPCODE(count_retry_and_mark ,Otapl), OPCODE(profiled_retry_and_mark ,Otapl), OPCODE(retry_and_mark ,Otapl), + OPCODE(try_clause ,Otapl), + OPCODE(try_clause2 ,l), + OPCODE(try_clause3 ,l), + OPCODE(try_clause4 ,l), + OPCODE(retry ,Otapl), + OPCODE(retry2 ,l), + OPCODE(retry3 ,l), + OPCODE(retry4 ,l), + OPCODE(trust ,Otapl), + OPCODE(try_in ,l), + OPCODE(enter_lu_pred ,Illss), + OPCODE(profiled_retry_logical ,OtaLl), + OPCODE(profiled_trust_logical ,OtILl), + OPCODE(try_logical ,OtaLl), + OPCODE(count_retry_logical ,OtaLl), + OPCODE(count_trust_logical ,OtILl), + OPCODE(retry_logical ,OtaLl), + OPCODE(trust_logical ,OtILl), + OPCODE(lock_lu ,p), + OPCODE(unlock_lu ,e), + OPCODE(alloc_for_logical_pred ,L), + OPCODE(copy_idb_term ,e), + OPCODE(unify_idb_term ,e), OPCODE(trust_fail ,e), OPCODE(op_fail ,e), OPCODE(cut ,s), @@ -190,13 +207,6 @@ OPCODE(save_appl_x_write ,ox), OPCODE(save_appl_y ,oy), OPCODE(save_appl_y_write ,oy), - OPCODE(jump ,l), - OPCODE(move_back ,l), - OPCODE(skip ,l), - OPCODE(either ,Osblp), - OPCODE(or_else ,Osblp), - OPCODE(pop_n ,s), - OPCODE(pop ,e), OPCODE(call_cpred ,Osbpp), OPCODE(execute_cpred ,pp), OPCODE(call_usercpred ,Osbpp), @@ -216,20 +226,13 @@ OPCODE(expand_clauses ,sssllp), OPCODE(undef_p ,e), OPCODE(spy_pred ,e), - OPCODE(try_clause ,Otapl), - OPCODE(try_clause2 ,l), - OPCODE(try_clause3 ,l), - OPCODE(try_clause4 ,l), - OPCODE(retry ,Otapl), - OPCODE(retry2 ,l), - OPCODE(retry3 ,l), - OPCODE(retry4 ,l), - OPCODE(trust ,Otapl), - OPCODE(try_in ,l), - OPCODE(enter_lu_pred ,Illss), - OPCODE(try_logical ,OtaLl), - OPCODE(retry_logical ,OtaLl), - OPCODE(trust_logical ,OtILl), + OPCODE(jump ,l), + OPCODE(move_back ,l), + OPCODE(skip ,l), + OPCODE(either ,Osblp), + OPCODE(or_else ,Osblp), + OPCODE(pop_n ,s), + OPCODE(pop ,e), OPCODE(user_switch ,lp), OPCODE(switch_on_type ,llll), OPCODE(switch_list_nl ,ollll), @@ -247,7 +250,6 @@ OPCODE(index_dbref ,e), OPCODE(index_blob ,e), OPCODE(index_long ,e), - OPCODE(native_me ,aFlp), OPCODE(p_atom_x ,xl), OPCODE(p_atom_y ,yl), OPCODE(p_atomic_x ,xl), @@ -421,9 +423,415 @@ OPCODE(trie_try_gterm ,e), OPCODE(trie_retry_gterm ,e), #endif - /* this instruction is hardwired */ +#ifdef YAP_JIT + OPCODE(traced_Ystop ,l), + OPCODE(traced_Nstop ,e), + OPCODE(traced_try_me ,Otapl), + OPCODE(traced_retry_me ,Otapl), + OPCODE(traced_trust_me ,Otapl), + OPCODE(traced_enter_profiling ,p), + OPCODE(traced_retry_profiled ,p), + OPCODE(traced_profiled_retry_me ,Otapl), + OPCODE(traced_profiled_trust_me ,Otapl), + OPCODE(traced_profiled_retry_logical,OtaLl), + OPCODE(traced_profiled_trust_logical,OtILl), + OPCODE(traced_count_call ,p), + OPCODE(traced_count_retry ,p), + OPCODE(traced_count_retry_me ,Otapl), + OPCODE(traced_count_trust_me ,Otapl), + OPCODE(traced_count_retry_logical ,OtaLl), + OPCODE(traced_count_trust_logical ,OtILl), + OPCODE(traced_lock_lu ,p), + OPCODE(traced_unlock_lu ,e), + OPCODE(traced_alloc_for_logical_pred,L), + OPCODE(traced_copy_idb_term ,e), + OPCODE(traced_unify_idb_term ,e), + OPCODE(traced_ensure_space ,Osbpa), + OPCODE(traced_spy_or_trymark ,Otapl), + OPCODE(traced_try_and_mark ,Otapl), + OPCODE(traced_count_retry_and_mark,Otapl), + OPCODE(traced_profiled_retry_and_mark,Otapl), + OPCODE(traced_retry_and_mark ,Otapl), + OPCODE(traced_trust_fail ,e), + OPCODE(traced_op_fail ,e), + OPCODE(traced_cut ,s), + OPCODE(traced_cut_t ,s), + OPCODE(traced_cut_e ,s), + OPCODE(traced_save_b_x ,x), + OPCODE(traced_save_b_y ,y), + OPCODE(traced_commit_b_x ,xps), + OPCODE(traced_commit_b_y ,yps), + OPCODE(traced_execute ,pp), + OPCODE(traced_dexecute ,pp), + OPCODE(traced_fcall ,Osbpp), + OPCODE(traced_call ,Osbpp), + OPCODE(traced_procceed ,p), + OPCODE(traced_allocate ,e), + OPCODE(traced_deallocate ,p), + OPCODE(traced_retry_eam ,e), + OPCODE(traced_run_eam ,os), + OPCODE(traced_get_x_var ,xx), + OPCODE(traced_get_y_var ,yx), + OPCODE(traced_get_yy_var ,yyxx), + OPCODE(traced_get_x_val ,xx), + OPCODE(traced_get_y_val ,yx), + OPCODE(traced_get_atom ,xc), + OPCODE(traced_get_2atoms ,cc), + OPCODE(traced_get_3atoms ,ccc), + OPCODE(traced_get_4atoms ,cccc), + OPCODE(traced_get_5atoms ,ccccc), + OPCODE(traced_get_6atoms ,cccccc), + OPCODE(traced_get_list ,x), + OPCODE(traced_get_struct ,xfa), + OPCODE(traced_get_float ,xd), + OPCODE(traced_get_longint ,xi), + OPCODE(traced_get_bigint ,xN), + OPCODE(traced_get_dbterm ,xD), + OPCODE(traced_glist_valx ,xx), + OPCODE(traced_glist_valy ,yx), + OPCODE(traced_gl_void_varx ,xx), + OPCODE(traced_gl_void_vary ,yx), + OPCODE(traced_gl_void_valx ,xx), + OPCODE(traced_gl_void_valy ,yx), + OPCODE(traced_unify_x_var ,ox), + OPCODE(traced_unify_x_var_write ,ox), + OPCODE(traced_unify_l_x_var ,ox), + OPCODE(traced_unify_l_x_var_write ,ox), + OPCODE(traced_unify_x_var2 ,oxx), + OPCODE(traced_unify_x_var2_write ,oxx), + OPCODE(traced_unify_l_x_var2 ,oxx), + OPCODE(traced_unify_l_x_var2_write,oxx), + OPCODE(traced_unify_y_var ,oy), + OPCODE(traced_unify_y_var_write ,oy), + OPCODE(traced_unify_l_y_var ,oy), + OPCODE(traced_unify_l_y_var_write ,oy), + OPCODE(traced_unify_x_val ,ox), + OPCODE(traced_unify_x_val_write ,ox), + OPCODE(traced_unify_l_x_val ,ox), + OPCODE(traced_unify_l_x_val_write ,ox), + OPCODE(traced_unify_y_val ,oy), + OPCODE(traced_unify_y_val_write ,oy), + OPCODE(traced_unify_l_y_val ,oy), + OPCODE(traced_unify_l_y_val_write ,oy), + OPCODE(traced_unify_x_loc ,ox), + OPCODE(traced_unify_x_loc_write ,ox), + OPCODE(traced_unify_l_x_loc ,ox), + OPCODE(traced_unify_l_x_loc_write ,ox), + OPCODE(traced_unify_y_loc ,oy), + OPCODE(traced_unify_y_loc_write ,oy), + OPCODE(traced_unify_l_y_loc ,oy), + OPCODE(traced_unify_l_y_loc_write ,oy), + OPCODE(traced_unify_void ,o), + OPCODE(traced_unify_void_write ,o), + OPCODE(traced_unify_l_void ,o), + OPCODE(traced_unify_l_void_write ,o), + OPCODE(traced_unify_n_voids ,os), + OPCODE(traced_unify_n_voids_write ,os), + OPCODE(traced_unify_l_n_voids ,os), + OPCODE(traced_unify_l_n_voids_write,os), + OPCODE(traced_unify_atom ,oc), + OPCODE(traced_unify_atom_write ,oc), + OPCODE(traced_unify_l_atom ,oc), + OPCODE(traced_unify_l_atom_write ,oc), + OPCODE(traced_unify_n_atoms ,osc), + OPCODE(traced_unify_n_atoms_write ,osc), + OPCODE(traced_unify_float ,od), + OPCODE(traced_unify_float_write ,od), + OPCODE(traced_unify_l_float ,od), + OPCODE(traced_unify_l_float_write ,od), + OPCODE(traced_unify_longint ,oi), + OPCODE(traced_unify_longint_write ,oi), + OPCODE(traced_unify_l_longint ,oi), + OPCODE(traced_unify_l_longint_write,oi), + OPCODE(traced_unify_bigint ,oN), + OPCODE(traced_unify_l_bigint ,oN), + OPCODE(traced_unify_dbterm ,oD), + OPCODE(traced_unify_l_dbterm ,oD), + OPCODE(traced_unify_list ,o), + OPCODE(traced_unify_list_write ,o), + OPCODE(traced_unify_l_list ,o), + OPCODE(traced_unify_l_list_write ,o), + OPCODE(traced_unify_struct ,ofa), + OPCODE(traced_unify_struct_write ,ofa), + OPCODE(traced_unify_l_struc ,ofa), + OPCODE(traced_unify_l_struc_write ,ofa), + OPCODE(traced_put_x_var ,xx), + OPCODE(traced_put_y_var ,yx), + OPCODE(traced_put_x_val ,xx), + OPCODE(traced_put_xx_val ,xxxx), + OPCODE(traced_put_y_val ,yx), + OPCODE(traced_put_y_vals ,yyxx), + OPCODE(traced_put_unsafe ,yx), + OPCODE(traced_put_atom ,xc), + OPCODE(traced_put_dbterm ,xD), + OPCODE(traced_put_bigint ,xN), + OPCODE(traced_put_float ,xd), + OPCODE(traced_put_longint ,xi), + OPCODE(traced_put_list ,x), + OPCODE(traced_put_struct ,xfa), + OPCODE(traced_write_x_var ,x), + OPCODE(traced_write_void ,e), + OPCODE(traced_write_n_voids ,s), + OPCODE(traced_write_y_var ,y), + OPCODE(traced_write_x_val ,x), + OPCODE(traced_write_x_loc ,x), + OPCODE(traced_write_y_val ,y), + OPCODE(traced_write_y_loc ,y), + OPCODE(traced_write_atom ,c), + OPCODE(traced_write_bigint ,N), + OPCODE(traced_write_dbterm ,D), + OPCODE(traced_write_float ,d), + OPCODE(traced_write_longint ,i), + OPCODE(traced_write_n_atoms ,sc), + OPCODE(traced_write_list ,e), + OPCODE(traced_write_l_list ,e), + OPCODE(traced_write_struct ,fa), + OPCODE(traced_write_l_struc ,fa), + OPCODE(traced_save_pair_x ,ox), + OPCODE(traced_save_pair_x_write ,ox), + OPCODE(traced_save_pair_y ,oy), + OPCODE(traced_save_pair_y_write ,oy), + OPCODE(traced_save_appl_x ,ox), + OPCODE(traced_save_appl_x_write ,ox), + OPCODE(traced_save_appl_y ,oy), + OPCODE(traced_save_appl_y_write ,oy), + OPCODE(traced_jump ,l), + OPCODE(traced_move_back ,l), + OPCODE(traced_skip ,l), + OPCODE(traced_either ,Osblp), + OPCODE(traced_or_else ,Osblp), + OPCODE(traced_pop_n ,s), + OPCODE(traced_pop ,e), + OPCODE(traced_call_cpred ,Osbpp), + OPCODE(traced_execute_cpred ,pp), + OPCODE(traced_call_usercpred ,Osbpp), + OPCODE(traced_call_c_wfail ,slp), + OPCODE(traced_try_c ,OtapFs), + OPCODE(traced_retry_c ,OtapFs), + OPCODE(traced_cut_c ,OtapFs), + OPCODE(traced_try_userc ,OtapFs), + OPCODE(traced_retry_userc ,OtapFs), + OPCODE(traced_cut_userc ,OtapFs), + OPCODE(traced_lock_pred ,e), + OPCODE(traced_index_pred ,e), + OPCODE(traced_thread_local ,e), + OPCODE(traced_expand_index ,e), + OPCODE(traced_expand_clauses ,sssllp), + OPCODE(traced_undef_p ,e), + OPCODE(traced_spy_pred ,e), + OPCODE(traced_try_clause ,Otapl), + OPCODE(traced_try_clause2 ,l), + OPCODE(traced_try_clause3 ,l), + OPCODE(traced_try_clause4 ,l), + OPCODE(traced_retry ,Otapl), + OPCODE(traced_retry2 ,l), + OPCODE(traced_retry3 ,l), + OPCODE(traced_retry4 ,l), + OPCODE(traced_trust ,Otapl), + OPCODE(traced_try_in ,l), + OPCODE(traced_enter_lu_pred ,Illss), + OPCODE(traced_try_logical ,OtaLl), + OPCODE(traced_retry_logical ,OtaLl), + OPCODE(traced_trust_logical ,OtILl), + OPCODE(traced_user_switch ,lp), + OPCODE(traced_switch_on_type ,llll), + OPCODE(traced_switch_list_nl ,ollll), + OPCODE(traced_switch_on_arg_type ,xllll), + OPCODE(traced_switch_on_sub_arg_type,sllll), + OPCODE(traced_jump_if_var ,l), + OPCODE(traced_jump_if_nonvar ,xll), + OPCODE(traced_if_not_then ,clll), + OPCODE(traced_switch_on_func ,sssl), + OPCODE(traced_switch_on_cons ,sssl), + OPCODE(traced_go_on_func ,sssl), + OPCODE(traced_go_on_cons ,sssl), + OPCODE(traced_if_func ,sssl), + OPCODE(traced_if_cons ,sssl), + OPCODE(traced_index_dbref ,e), + OPCODE(traced_index_blob ,e), + OPCODE(traced_index_long ,e), + OPCODE(traced_jit_handler ,J), + OPCODE(traced_p_atom_x ,xl), + OPCODE(traced_p_atom_y ,yl), + OPCODE(traced_p_atomic_x ,xl), + OPCODE(traced_p_atomic_y ,yl), + OPCODE(traced_p_integer_x ,xl), + OPCODE(traced_p_integer_y ,yl), + OPCODE(traced_p_nonvar_x ,xl), + OPCODE(traced_p_nonvar_y ,yl), + OPCODE(traced_p_number_x ,xl), + OPCODE(traced_p_number_y ,yl), + OPCODE(traced_p_var_x ,xl), + OPCODE(traced_p_var_y ,yl), + OPCODE(traced_p_db_ref_x ,xl), + OPCODE(traced_p_db_ref_y ,yl), + OPCODE(traced_p_primitive_x ,xl), + OPCODE(traced_p_primitive_y ,yl), + OPCODE(traced_p_compound_x ,xl), + OPCODE(traced_p_compound_y ,yl), + OPCODE(traced_p_float_x ,xl), + OPCODE(traced_p_float_y ,yl), + OPCODE(traced_p_plus_vv ,xxx), + OPCODE(traced_p_plus_vc ,xxn), + OPCODE(traced_p_plus_y_vv ,yxx), + OPCODE(traced_p_plus_y_vc ,yxn), + OPCODE(traced_p_minus_vv ,xxx), + OPCODE(traced_p_minus_cv ,xxn), + OPCODE(traced_p_minus_y_vv ,yxx), + OPCODE(traced_p_minus_y_cv ,yxn), + OPCODE(traced_p_times_vv ,xxx), + OPCODE(traced_p_times_vc ,xxn), + OPCODE(traced_p_times_y_vv ,yxx), + OPCODE(traced_p_times_y_vc ,yxn), + OPCODE(traced_p_div_vv ,xxx), + OPCODE(traced_p_div_vc ,xxn), + OPCODE(traced_p_div_cv ,xxn), + OPCODE(traced_p_div_y_vv ,yxx), + OPCODE(traced_p_div_y_vc ,yxn), + OPCODE(traced_p_div_y_cv ,yxn), + OPCODE(traced_p_and_vv ,xxx), + OPCODE(traced_p_and_vc ,xxn), + OPCODE(traced_p_and_y_vv ,yxx), + OPCODE(traced_p_and_y_vc ,yxn), + OPCODE(traced_p_or_vv ,xxx), + OPCODE(traced_p_or_vc ,xxn), + OPCODE(traced_p_or_y_vv ,yxx), + OPCODE(traced_p_or_y_vc ,yxn), + OPCODE(traced_p_sll_vv ,xxx), + OPCODE(traced_p_sll_vc ,xxn), + OPCODE(traced_p_sll_cv ,xxn), + OPCODE(traced_p_sll_y_vv ,yxx), + OPCODE(traced_p_sll_y_vc ,yxn), + OPCODE(traced_p_sll_y_cv ,yxn), + OPCODE(traced_p_slr_vv ,xxx), + OPCODE(traced_p_slr_vc ,xxn), + OPCODE(traced_p_slr_cv ,xxn), + OPCODE(traced_p_slr_y_vv ,yxx), + OPCODE(traced_p_slr_y_vc ,yxn), + OPCODE(traced_p_slr_y_cv ,yxn), + OPCODE(traced_call_bfunc_xx ,plxxs), + OPCODE(traced_call_bfunc_yx ,plxys), + OPCODE(traced_call_bfunc_xy ,plxys), + OPCODE(traced_call_bfunc_yy ,plyys), + OPCODE(traced_p_equal ,e), + OPCODE(traced_p_dif ,l), + OPCODE(traced_p_eq ,l), + OPCODE(traced_p_arg_vv ,xxx), + OPCODE(traced_p_arg_cv ,xxn), + OPCODE(traced_p_arg_y_vv ,yxx), + OPCODE(traced_p_arg_y_cv ,yxn), + OPCODE(traced_p_func2s_vv ,xxx), + OPCODE(traced_p_func2s_cv ,xxc), + OPCODE(traced_p_func2s_vc ,xxn), + OPCODE(traced_p_func2s_y_vv ,yxx), + OPCODE(traced_p_func2s_y_cv ,yxn), + OPCODE(traced_p_func2s_y_vc ,yxn), + OPCODE(traced_p_func2f_xx ,xxx), + OPCODE(traced_p_func2f_xy ,xxy), + OPCODE(traced_p_func2f_yx ,yxx), + OPCODE(traced_p_func2f_yy ,yyx), + OPCODE(traced_p_functor ,e), + OPCODE(traced_p_execute_tail ,Osbmp), + OPCODE(traced_p_execute2 ,Osbpp), + OPCODE(traced_p_execute ,Osbmp), #ifdef YAPOR - OPCODE(or_last ,sblp) -#else - OPCODE(or_last ,p) + OPCODE(traced_getwork_first_time ,e), + OPCODE(traced_getwork ,Otapl), + OPCODE(traced_getwork_seq ,Otapl), + OPCODE(traced_sync ,Otapl), +#endif +#ifdef TABLING + OPCODE(traced_clause_with_cut ,e), + OPCODE(traced_table_load_answer ,Otapl), + OPCODE(traced_table_try_answer ,Otapl), + OPCODE(traced_table_try_single ,Otapl), + OPCODE(traced_table_try_me ,Otapl), + OPCODE(traced_table_try ,Otapl), + OPCODE(traced_table_retry_me ,Otapl), + OPCODE(traced_table_retry ,Otapl), + OPCODE(traced_table_trust_me ,Otapl), + OPCODE(traced_table_trust ,Otapl), + OPCODE(traced_table_new_answer ,s), + OPCODE(traced_table_answer_resolution,Otapl), + OPCODE(traced_table_completion ,Otapl), + OPCODE(traced_table_answer_resolution_completion,Otapl), + OPCODE(traced_trie_do_var ,e), + OPCODE(traced_trie_trust_var ,e), + OPCODE(traced_trie_try_var ,e), + OPCODE(traced_trie_retry_var ,e), + OPCODE(traced_trie_do_var_in_pair ,e), + OPCODE(traced_trie_trust_var_in_pair,e), + OPCODE(traced_trie_try_var_in_pair,e), + OPCODE(traced_trie_retry_var_in_pair,e), + OPCODE(traced_trie_do_val ,e), + OPCODE(traced_trie_trust_val ,e), + OPCODE(traced_trie_try_val ,e), + OPCODE(traced_trie_retry_val ,e), + OPCODE(traced_trie_do_val_in_pair ,e), + OPCODE(traced_trie_trust_val_in_pair,e), + OPCODE(traced_trie_try_val_in_pair,e), + OPCODE(traced_trie_retry_val_in_pair,e), + OPCODE(traced_trie_do_atom ,e), + OPCODE(traced_trie_trust_atom ,e), + OPCODE(traced_trie_try_atom ,e), + OPCODE(traced_trie_retry_atom ,e), + OPCODE(traced_trie_do_atom_in_pair,e), + OPCODE(traced_trie_trust_atom_in_pair,e), + OPCODE(traced_trie_try_atom_in_pair,e), + OPCODE(traced_trie_retry_atom_in_pair,e), + OPCODE(traced_trie_do_null ,e), + OPCODE(traced_trie_trust_null ,e), + OPCODE(traced_trie_try_null ,e), + OPCODE(traced_trie_retry_null ,e), + OPCODE(traced_trie_do_null_in_pair,e), + OPCODE(traced_trie_trust_null_in_pair,e), + OPCODE(traced_trie_try_null_in_pair,e), + OPCODE(traced_trie_retry_null_in_pair,e), + OPCODE(traced_trie_do_pair ,e), + OPCODE(traced_trie_trust_pair ,e), + OPCODE(traced_trie_try_pair ,e), + OPCODE(traced_trie_retry_pair ,e), + OPCODE(traced_trie_do_appl ,e), + OPCODE(traced_trie_trust_appl ,e), + OPCODE(traced_trie_try_appl ,e), + OPCODE(traced_trie_retry_appl ,e), + OPCODE(traced_trie_do_appl_in_pair,e), + OPCODE(traced_trie_trust_appl_in_pair,e), + OPCODE(traced_trie_try_appl_in_pair,e), + OPCODE(traced_trie_retry_appl_in_pair,e), + OPCODE(traced_trie_do_extension ,e), + OPCODE(traced_trie_trust_extension,e), + OPCODE(traced_trie_try_extension ,e), + OPCODE(traced_trie_retry_extension,e), + OPCODE(traced_trie_do_double ,e), + OPCODE(traced_trie_trust_double ,e), + OPCODE(traced_trie_try_double ,e), + OPCODE(traced_trie_retry_double ,e), + OPCODE(traced_trie_do_longint ,e), + OPCODE(traced_trie_trust_longint ,e), + OPCODE(traced_trie_try_longint ,e), + OPCODE(traced_trie_retry_longint ,e), + OPCODE(traced_trie_do_bigint ,e), + OPCODE(traced_trie_trust_bigint ,e), + OPCODE(traced_trie_try_bigint ,e), + OPCODE(traced_trie_retry_bigint ,e), + OPCODE(traced_trie_do_gterm ,e), + OPCODE(traced_trie_trust_gterm ,e), + OPCODE(traced_trie_try_gterm ,e), + OPCODE(traced_trie_retry_gterm ,e), +#endif +#endif + /* this instruction is hardwired */ + /* or_last must be the last instruction. */ +#ifdef YAP_JIT +#ifdef YAPOR + OPCODE(traced_or_last ,sblp), +#else + OPCODE(traced_or_last ,p), +#endif +#endif +#ifdef YAPOR + OPCODE(or_last ,sblp), +#else + OPCODE(or_last ,p), #endif diff --git a/H/YapTags.h b/H/YapTags.h index 957df4531..e727aa97a 100644 --- a/H/YapTags.h +++ b/H/YapTags.h @@ -323,7 +323,7 @@ INLINE_ONLY EXTERN inline Term MkPairTerm__(Term head, Term tail USES_REGS ); INLINE_ONLY EXTERN inline Term MkPairTerm__ (Term head, Term tail USES_REGS) { - register CELL *p = HR; + CELL *p = HR; HR[0] = head; HR[1] = tail; diff --git a/H/YapTerm.h b/H/YapTerm.h index cd268fcc4..d2bfd8d84 100644 --- a/H/YapTerm.h +++ b/H/YapTerm.h @@ -28,7 +28,7 @@ typedef void *Atom; #endif -#define ALIGN_YAPTYPE(X,TYPE) (((CELL)(X)+(sizeof(TYPE)-1)) & ~(sizeof(TYPE)-1)) +#define ALIGN_BY_TYPE(X,TYPE) (((CELL)(X)+(sizeof(TYPE)-1)) & ~(sizeof(TYPE)-1)) #ifndef EXTERN @@ -43,10 +43,10 @@ typedef uintptr_t UInt; #if SIZEOF_INT_P==4 -#if SIZEOF_INT==4 +#if SIZEOF_LONGINT==4 -#define Int_FORMAT "%d" -#define UInt_FORMAT "%u" +#define Int_FORMAT "%l" +#define UInt_FORMAT "%ul" #elif SIZEOF_LONG_INT==4 /* */ typedef long int Int; diff --git a/H/YapText.h b/H/YapText.h index ebdb391bf..3c5e43d5b 100644 --- a/H/YapText.h +++ b/H/YapText.h @@ -106,7 +106,7 @@ buf_from_tstring( CELL *p ) { static inline void close_tstring( char *p USES_REGS ) { CELL *szp = HR+1; - HR = (CELL *)ALIGN_YAPTYPE( p ,CELL); + HR = (CELL *)ALIGN_BY_TYPE( p ,CELL); *szp = (HR - szp)-1; *HR++ = EndSpecials; } diff --git a/H/absmi.h b/H/absmi.h index 9300a2485..f0c7d677a 100755 --- a/H/absmi.h +++ b/H/absmi.h @@ -1,19 +1,19 @@ /************************************************************************* -* * -* YAP Prolog * -* * -* Yap Prolog was developed at NCCUP - Universidade do Porto * -* * -* Copyright L.Damas, V.S.Costa and Universidade do Porto 1985-1997 * -* * -************************************************************************** -* * -* File: absmi.c * -* Last rev: * -* mods: * -* comments: Portable abstract machine interpreter includes * -* * -*************************************************************************/ + * * + * YAP Prolog * + * * + * Yap Prolog was developed at NCCUP - Universidade do Porto * + * * + * Copyright L.Damas, V.S.Costa and Universidade do Porto 1985-1997 * + * * + ************************************************************************** + * * + * File: absmi.c * + * Last rev: * + * mods: * + * comments: Portable abstract machine interpreter includes * + * * + *************************************************************************/ #ifdef SCCS static char SccsId[] = "%W% %G%"; @@ -23,14 +23,14 @@ static char SccsId[] = "%W% %G%"; #if NATIVE_EXECUTION /* just a stub */ #else -#define EXEC_NATIVE(X) -#define MAX_INVOCATION 1024 -#define Yapc_Compile(P) 0 +#define EXEC_NATIVE(X) +#define MAX_INVOCATION 1024 +#define Yapc_Compile(P) 0 #endif /*************************************************************** -* Macros for register manipulation * -***************************************************************/ + * Macros for register manipulation * + ***************************************************************/ /* * Machine and compiler dependent definitions */ @@ -71,8 +71,8 @@ static char SccsId[] = "%W% %G%"; #define LIMITED_PREFETCH 1 #ifdef BP_FREE /*************************************************************** -* Use bp as PREG for X86 machines * -********************************************Term*******************/ + * Use bp as PREG for X86 machines * + ***************************************************************/ #if defined(IN_ABSMI_C) register struct yami* P1REG asm ("bp"); /* can't use yamop before Yap.h */ #define PREG P1REG @@ -91,15 +91,6 @@ register struct yami* P1REG asm ("bp"); /* can't use yamop before Yap.h */ #define TR_IN_MEM 1 #endif /* sparc_ */ -#if defined(__arm__) || defined(__thumb__) - -#define Y_IN_MEM 1 -#define S_IN_MEM 1 -#define TR_IN_MEM 1 -#define HAVE_FEW_REGS 1 -#endif - - #ifdef __x86_64__ #define SHADOW_P 1 #ifdef BP_FREE @@ -113,6 +104,14 @@ register struct yami* P1REG asm ("bp"); /* can't use yamop before Yap.h */ #define LIMITED_PREFETCH 1 #endif /* __x86_64__ */ +#if defined(__arm__) || defined(__thumb__) + +#define Y_IN_MEM 1 +#define S_IN_MEM 1 +#define TR_IN_MEM 1 +#define HAVE_FEW_REGS 1 +#endif + #else /* other compilers */ #define S_IN_MEM 1 @@ -159,7 +158,7 @@ register struct yami* P1REG asm ("bp"); /* can't use yamop before Yap.h */ #endif #ifdef YAPOR #include "or.macros.h" -#endif /* YAPOR */ +#endif /* YAPOR */ #ifdef USE_SYSTEM_MALLOC #include "YapHeap.h" #endif @@ -182,33 +181,32 @@ register struct yami* P1REG asm ("bp"); /* can't use yamop before Yap.h */ #if PUSH_REGS /*************************************************************** -* Trick to copy REGS into absmi local environment * -***************************************************************/ - -/* regp is a global variable */ - + * Trick to copy REGS into absmi local environment * + ***************************************************************/ INLINE_ONLY inline EXTERN void init_absmi_regs(REGSTORE * absmi_regs); +/* regp is a global variable */ + INLINE_ONLY inline EXTERN void init_absmi_regs(REGSTORE * absmi_regs) { CACHE_REGS - memcpy(absmi_regs, Yap_regp, sizeof(REGSTORE)); + memcpy(absmi_regs, Yap_regp, sizeof(REGSTORE)); } INLINE_ONLY inline EXTERN void restore_absmi_regs(REGSTORE * old_regs); + INLINE_ONLY inline EXTERN void restore_absmi_regs(REGSTORE * old_regs) { CACHE_REGS - memcpy(old_regs, Yap_regp, sizeof(REGSTORE)); + memcpy(old_regs, Yap_regp, sizeof(REGSTORE)); #ifdef THREADS pthread_setspecific(Yap_yaamregs_key, (void *)old_regs); LOCAL_ThreadHandle.current_yaam_regs = old_regs; - LOCAL_PL_local_data_p->reg_cache = old_regs; #else Yap_regp = old_regs; #endif @@ -217,7 +215,7 @@ restore_absmi_regs(REGSTORE * old_regs) /***************************************************************** - Machine Dependent stuff + Machine Dependent stuff ******************************************************************/ @@ -248,9 +246,9 @@ restore_absmi_regs(REGSTORE * old_regs) #define ENDCHO(TMP) } /*************************************************************** -* YREG is usually, but not always, a register. This affects * -* choicepoints * -***************************************************************/ + * YREG is usually, but not always, a register. This affects * + * choicepoints * + ***************************************************************/ #if Y_IN_MEM @@ -290,7 +288,7 @@ restore_absmi_regs(REGSTORE * old_regs) #define ENV_YREG (YREG) -#define WRITEBACK_Y_AS_ENV() +#define WRITEBACK_Y_AS_ENV() #define CACHE_Y_AS_ENV(A) { YREG = (A) @@ -308,20 +306,40 @@ restore_absmi_regs(REGSTORE * old_regs) #define CACHE_A1() -#define CACHED_A1() ARG1 +#define CACHED_A1() ARG1 #else -#define CACHE_A1() (SREG = (CELL *)ARG1) +#ifndef _NATIVE -#define CACHED_A1() ((CELL)SREG) +#define CACHE_A1() (SREG = (CELL *)ARG1) + +#define CACHED_A1() ((CELL)SREG) + +#else + +#define CACHE_A1() ((*_SREG) = (CELL *)ARG1) + +#define CACHED_A1() ((CELL)(*_SREG)) + +#endif /* _NATIVE */ #endif /* S_IN_MEM */ /*************************************************************** -* TR is usually, but not always, a register. This affects * -* backtracking * -***************************************************************/ + * TR is usually, but not always, a register. This affects * + * backtracking * + ***************************************************************/ + +#ifdef _NATIVE + +#define CACHE_TR(A) register tr_fr_ptr S_TR = (A) + +#define RESTORE_TR() TR = S_TR + +#define ENDCACHE_TR() + +#else #define CACHE_TR(A) { register tr_fr_ptr S_TR = (A) @@ -329,10 +347,12 @@ restore_absmi_regs(REGSTORE * old_regs) #define ENDCACHE_TR() } +#endif + /*************************************************************** -* S is usually, but not always, a register (X86 machines). * -* This affects unification instructions * -***************************************************************/ + * S is usually, but not always, a register (X86 machines). * + * This affects unification instructions * + ***************************************************************/ #if S_IN_MEM @@ -343,10 +363,18 @@ restore_absmi_regs(REGSTORE * old_regs) #define ENDCACHE_S() } +#ifndef _NATIVE + #define READ_IN_S() S_SREG = SREG #else +#define READ_IN_S() S_SREG = *_SREG + +#endif + +#else + /* do nothing if you are on a decent machine */ #define CACHE_S() { @@ -359,11 +387,19 @@ restore_absmi_regs(REGSTORE * old_regs) #endif +#ifndef _NATIVE + #define WRITEBACK_S(X) SREG = (X) +#else + +#define WRITEBACK_S(X) *_SREG = (X) + +#endif + /***************************************************************** - End of Machine Dependent stuff + End of Machine Dependent stuff ******************************************************************/ @@ -377,20 +413,60 @@ restore_absmi_regs(REGSTORE * old_regs) #if USE_THREADED_CODE +#ifndef _NATIVE + +#if YAP_JIT + +#define DO_PREFETCH(TYPE) \ + if (ExpEnv.config_struc.current_displacement) \ + to_go = (void *) OpAddress[Yap_op_from_opcode(NEXTOP(PREG,TYPE)->opc) + ExpEnv.config_struc.current_displacement]; \ + else \ + to_go = (void *)(NEXTOP(PREG,TYPE)->opc); + +#define DO_PREFETCH_W(TYPE) \ + if (ExpEnv.config_struc.current_displacement) \ + to_go = (void *)OpAddress[Yap_op_from_opcode(NEXTOP(PREG,TYPE)->y_u.o.opcw) + ExpEnv.config_struc.current_displacement]; \ + else \ + to_go = (void *)(NEXTOP(PREG,TYPE)->y_u.o.opcw); + +#else /* YAP_JIT */ + #define DO_PREFETCH(TYPE) to_go = (void *)(NEXTOP(PREG,TYPE)->opc) #define DO_PREFETCH_W(TYPE) to_go = (void *)(NEXTOP(PREG,TYPE)->y_u.o.opcw) +#endif /* YAP_JIT */ + +#else /* _NATIVE */ + +#define DO_PREFETCH(TYPE) + +#define DO_PREFETCH_W(TYPE) + +#endif /* _NATIVE */ + +#ifndef _NATIVE + #if LIMITED_PREFETCH||USE_PREFETCH -#define ALWAYS_START_PREFETCH(TYPE) \ - { register void *to_go; DO_PREFETCH(TYPE) +#define ALWAYS_START_PREFETCH(TYPE) \ + { register void *to_go; DO_PREFETCH(TYPE) -#define ALWAYS_LOOKAHEAD(WHAT) \ - { register void *to_go = (void *)(WHAT) +#if YAP_JIT +#define ALWAYS_LOOKAHEAD(WHAT) \ + { \ + register void *to_go; \ + if (ExpEnv.config_struc.current_displacement) \ + to_go = (void *) OpAddress[Yap_op_from_opcode(WHAT) + ExpEnv.config_struc.current_displacement]; \ + else \ + to_go = (void *)(WHAT); +#else /* YAP_JIT */ +#define ALWAYS_LOOKAHEAD(WHAT) \ + { register void *to_go = (void *)(WHAT); +#endif /* YAP_JIT */ -#define ALWAYS_START_PREFETCH_W(TYPE) \ - { register void *to_go; DO_PREFETCH_W(TYPE) +#define ALWAYS_START_PREFETCH_W(TYPE) \ + { register void *to_go; DO_PREFETCH_W(TYPE) #else @@ -400,7 +476,31 @@ restore_absmi_regs(REGSTORE * old_regs) #define ALWAYS_LOOKAHEAD(WHERE) { -#endif +#endif /* LIMITED_PREFETCH||USE_PREFETCH */ + +#else /* _NATIVE */ + +#if LIMITED_PREFETCH||USE_PREFETCH + +#define ALWAYS_START_PREFETCH(TYPE) + +#define ALWAYS_LOOKAHEAD(WHAT) + +#define ALWAYS_START_PREFETCH_W(TYPE) + +#else + +#define ALWAYS_START_PREFETCH(TYPE) + +#define ALWAYS_START_PREFETCH_W(TYPE) + +#define ALWAYS_LOOKAHEAD(WHERE) + +#endif /* LIMITED_PREFETCH||USE_PREFETCH */ + +#endif /* _NATIVE */ + +#ifndef _NATIVE #ifdef USE_PREFETCH @@ -408,11 +508,14 @@ restore_absmi_regs(REGSTORE * old_regs) #define START_PREFETCH_W(TYPE) ALWAYS_START_PREFETCH_W(TYPE) -#define INIT_PREFETCH() \ - { register void *to_go; +#define INIT_PREFETCH() \ + { register void *to_go; -#define PREFETCH_OP(X) \ - to_go = (void *)((X)->opc); +#define PREFETCH_OP(X) \ + if (ExpEnv.config_struc.current_displacement) \ + to_go = (void *) OpAddress[Yap_op_from_opcode((X)->opc) + ExpEnv.config_struc.current_displacement]; \ + else \ + to_go = (void *)((X)->opc); #else @@ -424,10 +527,38 @@ restore_absmi_regs(REGSTORE * old_regs) #define PREFETCH_OP(X) -#endif /* USE_PREFETCH */ +#endif /* USE_PREFETCH */ + +#else /* _NATIVE */ + +#ifdef USE_PREFETCH + +#define START_PREFETCH(TYPE) ALWAYS_START_PREFETCH(TYPE) + +#define START_PREFETCH_W(TYPE) ALWAYS_START_PREFETCH_W(TYPE) + +#define INIT_PREFETCH() + +#define PREFETCH_OP(X) + +#else + +#define START_PREFETCH(TYPE) + +#define START_PREFETCH_W(TYPE) + +#define INIT_PREFETCH() + +#define PREFETCH_OP(X) + +#endif /* USE_PREFETCH */ + +#endif /* _NATIVE */ #else /* USE_THREADED_CODE */ +#ifndef _NATIVE + #define ALWAYS_START_PREFETCH(TYPE) { #define ALWAYS_START_PREFETCH_W(TYPE) { @@ -442,8 +573,28 @@ restore_absmi_regs(REGSTORE * old_regs) #define PREFETCH_OP(X) +#else + +#define ALWAYS_START_PREFETCH(TYPE) + +#define ALWAYS_START_PREFETCH_W(TYPE) + +#define ALWAYS_LOOKAHEAD(WHERE) + +#define START_PREFETCH(TYPE) + +#define START_PREFETCH_W(TYPE) + +#define INIT_PREFETCH() + +#define PREFETCH_OP(X) + +#endif /* _NATIVE */ + #endif /* USE_THREADED_CODE */ +#ifndef _NATIVE + #define ALWAYS_END_PREFETCH() } #define ALWAYS_END_PREFETCH_W() } @@ -452,6 +603,18 @@ restore_absmi_regs(REGSTORE * old_regs) #define END_PREFETCH_W() } +#else + +#define ALWAYS_END_PREFETCH() + +#define ALWAYS_END_PREFETCH_W() + +#define END_PREFETCH() + +#define END_PREFETCH_W() + +#endif /* _NATIVE */ + /***************************************************************** How to jump to the next abstract machine instruction @@ -460,13 +623,173 @@ restore_absmi_regs(REGSTORE * old_regs) #if USE_THREADED_CODE -#define JMP(Lab) goto *Lab +#ifndef _NATIVE -#define JMPNext() \ - JMP((void *)(PREG->opc)) +#define JMP(Lab) goto *Lab; -#define JMPNextW() \ - JMP((void *)(PREG->y_u.o.opcw)) +#if YAP_JIT + +#define JMPNext() \ + if (ExpEnv.config_struc.current_displacement) \ + JMP((void *) OpAddress[Yap_op_from_opcode(PREG->opc) + ExpEnv.config_struc.current_displacement]); \ + JMP((void *) (PREG->opc)); + +#define JMPNextW() \ + if (ExpEnv.config_struc.current_displacement) \ + JMP((void *) OpAddress[Yap_op_from_opcode(PREG->y_u.o.opcw) + ExpEnv.config_struc.current_displacement]); \ + JMP((void *) (PREG->y_u.o.opcw)); + +#else /* YAP_JIT */ + +#define JMPNext() \ + JMP((void *) (PREG->opc)); + +#define JMPNextW() \ + JMP((void *) (PREG->y_u.o.opcw)); + +#endif /* YAP_JIT */ + +#else /* _NATIVE */ + +#if YAP_STAT_PREDS + +#if YAP_DBG_PREDS + +#define SUCCESSBACK() \ + { \ + if (Yap_op_from_opcode((*_PREG)->opc) == _jit_handler) { \ + if ((*_PREG)->y_u.jhc.jh->caa.naddress != -1 && NativeArea->area.p[(*_PREG)->y_u.jhc.jh->caa.naddress] && NativeArea->area.ok[(*_PREG)->y_u.jhc.jh->caa.naddress]) { \ + void* (*callee)(yamop**,yamop**,CELL**,void*[],void*[]); \ + void* go; \ + callee = (void*(*)(yamop**,yamop**,CELL**,void*[],void*[]))NativeArea->area.p[(*_PREG)->y_u.jhc.jh->caa.naddress]; \ + go = (*callee)(&(*_PREG), &(*_CPREG), &(*_SREG), external_labels, OpAddress); \ + return go; \ + } \ + } \ + if ((char*)ExpEnv.debug_struc.pprint_me.nativerun_exit_by_success != 0 && (char*)ExpEnv.debug_struc.pprint_me.nativerun_exit_by_success != (char*)0x1) { \ + fprintf(stderr, "%s:%d\n", __FILE__, __LINE__); \ + fprintf(stderr, "%s", (char*)ExpEnv.debug_struc.pprint_me.nativerun_exit_by_success); \ + } \ + HEADPREG->y_u.jhc.jh->jitman.torecomp = ExpEnv.config_struc.torecompile; \ + NativeArea->success[HEADPREG->y_u.jhc.jh->caa.naddress] += 1; \ + (ExpEnv.config_struc.torecompile) ? (ExpEnv.config_struc.current_displacement = ExpEnv.config_struc.TOTAL_OF_OPCODES) \ + : (ExpEnv.config_struc.current_displacement = 0); \ + if (ExpEnv.config_struc.current_displacement) \ + return ((void *) OpAddress[Yap_op_from_opcode((*_PREG)->opc) + ExpEnv.config_struc.current_displacement]); \ + return ((void *) ((*_PREG)->opc)); \ + } + +#define BACK() \ + { \ + if ((char*)ExpEnv.debug_struc.pprint_me.nativerun_exit_by_fail != 0 && (char*)ExpEnv.debug_struc.pprint_me.nativerun_exit_by_fail != (char*)0x1) { \ + fprintf(stderr, "%s:%d\n", __FILE__, __LINE__); \ + fprintf(stderr, "%s", (char*)ExpEnv.debug_struc.pprint_me.nativerun_exit_by_fail); \ + } \ + return ((void *) OpAddress[Yap_op_from_opcode((*_PREG)->opc)]); \ + } + +#else /* YAP_DBG_PREDS */ + +#define SUCCESSBACK() \ + { \ + if (Yap_op_from_opcode((*_PREG)->opc) == _jit_handler) { \ + if ((*_PREG)->y_u.jhc.jh->caa.naddress != -1 && NativeArea->area.p[(*_PREG)->y_u.jhc.jh->caa.naddress] && NativeArea->area.ok[(*_PREG)->y_u.jhc.jh->caa.naddress]) { \ + void* (*callee)(yamop**,yamop**,CELL**,void*[],void*[]); \ + void* go; \ + callee = (void*(*)(yamop**,yamop**,CELL**,void*[],void*[]))NativeArea->area.p[(*_PREG)->y_u.jhc.jh->caa.naddress]; \ + go = (*callee)(&(*_PREG), &(*_CPREG), &(*_SREG), external_labels, OpAddress); \ + return go; \ + } \ + } \ + HEADPREG->y_u.jhc.jh->jitman.torecomp = ExpEnv.config_struc.torecompile; \ + NativeArea->success[HEADPREG->y_u.jhc.jh->caa.naddress] += 1; \ + (ExpEnv.config_struc.torecompile) ? (ExpEnv.config_struc.current_displacement = ExpEnv.config_struc.TOTAL_OF_OPCODES) \ + : (ExpEnv.config_struc.current_displacement = 0); \ + if (ExpEnv.config_struc.current_displacement) \ + return ((void *) OpAddress[Yap_op_from_opcode((*_PREG)->opc) + ExpEnv.config_struc.current_displacement]); \ + return ((void *) ((*_PREG)->opc)); \ + } + +#define BACK() \ + { \ + return ((void *) OpAddress[Yap_op_from_opcode((*_PREG)->opc)]); \ + } + +#endif /* YAP_DBG_PREDS */ + +#else /* YAP_STAT_PREDS */ + +#if YAP_DBG_PREDS + +#define SUCCESSBACK() \ + { \ + if (Yap_op_from_opcode((*_PREG)->opc) == _jit_handler) { \ + if ((*_PREG)->y_u.jhc.jh->caa.naddress != -1 && NativeArea->area.p[(*_PREG)->y_u.jhc.jh->caa.naddress] && NativeArea->area.ok[(*_PREG)->y_u.jhc.jh->caa.naddress]) { \ + void* (*callee)(yamop**,yamop**,CELL**,void*[],void*[]); \ + void* go; \ + callee = (void*(*)(yamop**,yamop**,CELL**,void*[],void*[]))NativeArea->area.p[(*_PREG)->y_u.jhc.jh->caa.naddress]; \ + go = (*callee)(&(*_PREG), &(*_CPREG), &(*_SREG), external_labels, OpAddress); \ + return go; \ + } \ + } \ + if ((char*)ExpEnv.debug_struc.pprint_me.nativerun_exit_by_success != 0 && (char*)ExpEnv.debug_struc.pprint_me.nativerun_exit_by_success != (char*)0x1) { \ + fprintf(stderr, "%s:%d\n", __FILE__, __LINE__); \ + fprintf(stderr, "%s", (char*)ExpEnv.debug_struc.pprint_me.nativerun_exit_by_success); \ + } \ + HEADPREG->y_u.jhc.jh->jitman.torecomp = ExpEnv.config_struc.torecompile; \ + (ExpEnv.config_struc.torecompile) ? (ExpEnv.config_struc.current_displacement = ExpEnv.config_struc.TOTAL_OF_OPCODES) \ + : (ExpEnv.config_struc.current_displacement = 0); \ + if (ExpEnv.config_struc.current_displacement) \ + return ((void *) OpAddress[Yap_op_from_opcode((*_PREG)->opc) + ExpEnv.config_struc.current_displacement]); \ + return ((void *) ((*_PREG)->opc)); \ + } + +#define BACK() \ + { \ + if ((char*)ExpEnv.debug_struc.pprint_me.nativerun_exit_by_fail != 0 && (char*)ExpEnv.debug_struc.pprint_me.nativerun_exit_by_fail != (char*)0x1) { \ + fprintf(stderr, "%s:%d\n", __FILE__, __LINE__); \ + fprintf(stderr, "%s", (char*)ExpEnv.debug_struc.pprint_me.nativerun_exit_by_fail); \ + } \ + return ((void *) OpAddress[Yap_op_from_opcode((*_PREG)->opc)]); \ + } + +#else /* YAP_DBG_PREDS */ + +#define SUCCESSBACK() \ + { \ + if (Yap_op_from_opcode((*_PREG)->opc) == _jit_handler) { \ + if ((*_PREG)->y_u.jhc.jh->caa.naddress != -1 && NativeArea->area.p[(*_PREG)->y_u.jhc.jh->caa.naddress] && NativeArea->area.ok[(*_PREG)->y_u.jhc.jh->caa.naddress]) { \ + void* (*callee)(yamop**,yamop**,CELL**,void*[],void*[]); \ + void* go; \ + callee = (void*(*)(yamop**,yamop**,CELL**,void*[],void*[]))NativeArea->area.p[(*_PREG)->y_u.jhc.jh->caa.naddress]; \ + go = (*callee)(&(*_PREG), &(*_CPREG), &(*_SREG), external_labels, OpAddress); \ + return go; \ + } \ + } \ + HEADPREG->y_u.jhc.jh->jitman.torecomp = ExpEnv.config_struc.torecompile; \ + (ExpEnv.config_struc.torecompile) ? (ExpEnv.config_struc.current_displacement = ExpEnv.config_struc.TOTAL_OF_OPCODES) \ + : (ExpEnv.config_struc.current_displacement = 0); \ + if (ExpEnv.config_struc.current_displacement) \ + return ((void *) OpAddress[Yap_op_from_opcode((*_PREG)->opc) + ExpEnv.config_struc.current_displacement]); \ + return ((void *) ((*_PREG)->opc)); \ + } + +#define BACK() \ + { \ + return ((void *) OpAddress[Yap_op_from_opcode((*_PREG)->opc)]); \ + } + +#endif /* YAP_DBG_PREDS */ + +#endif /* YAP_STAT_PREDS */ + +#define JMP(Lab) + +#define JMPNext() + +#define JMPNextW() + +#endif /* _NATIVE */ #if USE_THREADED_CODE && (LIMITED_PREFETCH || USE_PREFETCH) @@ -484,9 +807,9 @@ restore_absmi_regs(REGSTORE * old_regs) #ifdef USE_PREFETCH -#define GONext() ALWAYS_GONext() +#define GONext() ALWAYS_GONext() -#define GONextW() ALWAYS_GONextW() +#define GONextW() ALWAYS_GONextW() #else @@ -496,35 +819,98 @@ restore_absmi_regs(REGSTORE * old_regs) #endif /* USE_PREFETCH */ -#define Op(Label,Type) Label:{ START_PREFETCH(Type) +#if YAP_DBG_PREDS -#define OpW(Label,Type) Label: { START_PREFETCH_W(Type) +#if YAP_JIT -#define BOp(Label,Type) Label: { +#define Op(Label,Type) \ + Label:{ (ExpEnv.config_struc.current_displacement) ? \ + print_instruction(PREG, ON_PROFILED_INTERPRETER) : \ + print_instruction(PREG, ON_INTERPRETER); \ + START_PREFETCH(Type) -#define PBOp(Label,Type) Label: { INIT_PREFETCH() +#define OpW(Label,Type) \ + Label:{ (ExpEnv.config_struc.current_displacement) ? \ + print_instruction(PREG, ON_PROFILED_INTERPRETER) : \ + print_instruction(PREG, ON_INTERPRETER); \ + START_PREFETCH_W(Type) -#define OpRW(Label,Type) Label: { +#define BOp(Label,Type) \ + Label:{ (ExpEnv.config_struc.current_displacement) ? \ + print_instruction(PREG, ON_PROFILED_INTERPRETER) : \ + print_instruction(PREG, ON_INTERPRETER); + +#define PBOp(Label,Type) \ + Label:{ (ExpEnv.config_struc.current_displacement) ? \ + print_instruction(PREG, ON_PROFILED_INTERPRETER) : \ + print_instruction(PREG, ON_INTERPRETER); \ + INIT_PREFETCH() + +#define OpRW(Label,Type) \ + Label:{ (ExpEnv.config_struc.current_displacement) ? \ + print_instruction(PREG, ON_PROFILED_INTERPRETER) : \ + print_instruction(PREG, ON_INTERPRETER); + +#else /* YAP_JIT */ + +#define Op(Label,Type) \ + Label:{ print_instruction(PREG, ON_INTERPRETER); \ + START_PREFETCH(Type) + +#define OpW(Label,Type) \ + Label:{ print_instruction(PREG, ON_INTERPRETER); \ + START_PREFETCH_W(Type) + +#define BOp(Label,Type) \ + Label:{ print_instruction(PREG, ON_INTERPRETER); + +#define PBOp(Label,Type) \ + Label:{ print_instruction(PREG, ON_INTERPRETER); \ + INIT_PREFETCH() + +#define OpRW(Label,Type) \ + Label:{ print_instruction(PREG, ON_INTERPRETER); + +#endif /* YAP_JIT */ + +#else /* YAP_DBG_PREDS */ + +#define Op(Label,Type) \ + Label:{ START_PREFETCH(Type) + +#define OpW(Label,Type) \ + Label:{ START_PREFETCH_W(Type) + +#define BOp(Label,Type) \ + Label:{ + +#define PBOp(Label,Type) \ + Label:{ INIT_PREFETCH() + +#define OpRW(Label,Type) \ + Label:{ + +#endif /* YAP_DBG_PREDS */ #else /* do not use threaded code */ -#define JMPNext() goto nextop +#define JMPNext() goto nextop -#define JMPNextW() goto nextop_write +#define JMPNextW() goto nextop_write -#define GONext() JMPNext() +#define GONext() JMPNext() -#define GONextW() JMPNextW() +#define GONextW() JMPNextW() #define ALWAYS_GONext() GONext() #define ALWAYS_GONextW() GONextW() -#define Op(Label,Type) case _##Label: { START_PREFETCH(Type) +#define Op(Label,Type) case _##Label: { START_PREFETCH(Type) -#define OpW(Label,Type) case _##Label: { START_PREFETCH_W(Type) +#define OpW(Label,Type) case _##Label: { START_PREFETCH_W(Type) -#define BOp(Label,Type) case _##Label: { +#define BOp(Label,Type) case _##Label: { #define PBOp(Label,Type) case _##Label: { INIT_PREFETCH() @@ -550,10 +936,10 @@ restore_absmi_regs(REGSTORE * old_regs) /* * How to set up and move a PC in a nice and disciplined way - * + * */ -typedef CELL label; + typedef CELL label; /* move PC */ @@ -561,38 +947,37 @@ typedef CELL label; /* * Lookup PredEntry Structure - * + * */ -#define pred_entry(X) ((PredEntry *)(Unsigned(X)-(CELL)(&(((PredEntry *)NULL)->StateOfPred)))) -#define pred_entry_from_code(X) ((PredEntry *)(Unsigned(X)-(CELL)(&(((PredEntry *)NULL)->CodeOfPred)))) -#define PredFromDefCode(X) ((PredEntry *)(Unsigned(X)-(CELL)(&(((PredEntry *)NULL)->OpcodeOfPred)))) -#define PredFromExpandCode(X) ((PredEntry *)(Unsigned(X)-(CELL)(&(((PredEntry *)NULL)->cs.p_code.ExpandCode)))) -#define PredCode(X) pred_entry(X)->CodeOfPred -#define PredOpCode(X) pred_entry(X)->OpcodeOfPred -#define TruePredCode(X) pred_entry(X)->TrueCodeOfPred -#define PredFunctor(X) pred_entry(X)->FunctorOfPred -#define PredArity(X) pred_entry(X)->ArityOfPE -#define Module(X) pred_entry(X)->ModuleOfPred +#define pred_entry(X) ((PredEntry *)(Unsigned(X)-(CELL)(&(((PredEntry *)NULL)->StateOfPred)))) +#define pred_entry_from_code(X) ((PredEntry *)(Unsigned(X)-(CELL)(&(((PredEntry *)NULL)->CodeOfPred)))) +#define PredFromDefCode(X) ((PredEntry *)(Unsigned(X)-(CELL)(&(((PredEntry *)NULL)->OpcodeOfPred)))) +#define PredFromExpandCode(X) ((PredEntry *)(Unsigned(X)-(CELL)(&(((PredEntry *)NULL)->cs.p_code.ExpandCode)))) +#define PredCode(X) pred_entry(X)->CodeOfPred +#define PredOpCode(X) pred_entry(X)->OpcodeOfPred +#define TruePredCode(X) pred_entry(X)->TrueCodeOfPred +#define PredFunctor(X) pred_entry(X)->FunctorOfPred +#define PredArity(X) pred_entry(X)->ArityOfPE #define FlagOff(Mask,w) !(Mask&w) #define FlagOn(Mask,w) (Mask&w) #define ResetFlag(Mask,w) w &= ~Mask #define SetFlag(Mask,w) w |= Mask -/********************************************************************** - * * - * X register access * - * * - **********************************************************************/ + /********************************************************************** + * * + * X register access * + * * + **********************************************************************/ #if PRECOMPUTE_REGADDRESS -#define XREG(I) (*(CELL *)(I)) +#define XREG(I) (*(CELL *)(I)) #else -#define XREG(I) XREGS[I] +#define XREG(I) XREGS[I] #endif /* PRECOMPUTE_REGADDRESS */ @@ -601,55 +986,65 @@ typedef CELL label; #define SP0 ((CELL *)AuxTop) #define SP AuxSp -/********************************************************************** - * * - * RWREG Manipulatio * - * * - **********************************************************************/ + /********************************************************************** + * * + * RWREG Manipulatio * + * * + **********************************************************************/ #define READ_MODE 1 #define WRITE_MODE 0 -/********************************************************************** - * * - *Setting Temporary Copies of Often Used WAM registers for efficiency * - * * - **********************************************************************/ + /********************************************************************** + * * + *Setting Temporary Copies of Often Used WAM registers for efficiency * + * * + **********************************************************************/ #ifdef SHADOW_P #define NEEDS_TO_SET_PC 1 #endif -/* - * First, the PC - */ + /* + * First, the PC + */ #ifdef NEEDS_TO_SET_PC -#define set_pc() PREG = P -#define save_pc() P = PREG +#ifndef _NATIVE +#define set_pc() PREG = P +#define save_pc() P = PREG +#else +#define set_pc() (*_PREG) = P +#define save_pc() P = (*_PREG) +#endif #else #define set_pc() #define save_pc() #define PREG (P) #endif -/* +/* * Next, Y */ #ifdef SHADOW_Y -#define set_y() YREG = YENV -#define save_y() YENV = YREG +#define set_y() YREG = YENV +#define save_y() YENV = YREG #else #define set_y() #define save_y() #define YREG YENV #endif -/* +/* * Next, CP */ #ifdef SHADOW_CP -#define set_cp() CPREG = CP -#define save_cp() CP = CPREG +#ifndef _NATIVE +#define set_cp() CPREG = CP +#define save_cp() CP = CPREG +#else +#define set_cp() (*_CPREG) = CP +#define save_cp() CP = (*_CPREG) +#endif #else #define set_cp() #define save_cp() @@ -658,17 +1053,17 @@ typedef CELL label; /* Say which registers must be saved at register entry and register * exit */ -#define setregs() \ - set_hb(); \ - set_cp(); \ - set_pc(); \ - set_y() +#define setregs() \ + set_hb(); \ + set_cp(); \ + set_pc(); \ + set_y() -#define saveregs() \ - save_hb(); \ - save_cp(); \ - save_pc(); \ - save_y() +#define saveregs() \ + save_hb(); \ + save_cp(); \ + save_pc(); \ + save_y() #if BP_FREE /* if we are using BP as a local register, we must save it whenever we leave absmi.c */ @@ -687,7 +1082,7 @@ Macros to check the limits of stacks #if HAVE_SIGSEGV /* for the moment I don't know how to handle trail overflows - in a pure Windows environment + in a pure Windows environment */ #if !defined(_MSC_VER) && !defined(__MINGW32__) && !defined(THREADS) && !defined(YAPOR) && !defined(USE_SYSTEM_MALLOC) && !USE_DL_MALLOC #define OS_HANDLES_TR_OVERFLOW 1 @@ -702,56 +1097,124 @@ Macros to check the limits of stacks #else -#define check_trail(x) if (__builtin_expect((Unsigned(CurrentTrailTop) < Unsigned(x)),0)) \ - goto notrailleft +#ifdef _NATIVE + +#if YAP_DBG_PREDS + +#define check_trail(x) if (__builtin_expect((Unsigned(CurrentTrailTop) < Unsigned(x)),0)) { \ + if ((char*)ExpEnv.debug_struc.pprint_me.native_treat_trail != 0 && (char*)ExpEnv.debug_struc.pprint_me.native_treat_trail != (char*)0x1) { \ + fprintf(stderr, "%s:%d\n", __FILE__, __LINE__); \ + fprintf(stderr, "%s", (char*)ExpEnv.debug_struc.pprint_me.native_treat_trail); \ + } \ + return external_labels[9]; \ + } + +#else /* YAP_DBG_PREDS */ + +#define check_trail(x) if (__builtin_expect((Unsigned(CurrentTrailTop) < Unsigned(x)),0)) { \ + return external_labels[9]; \ + } + +#endif /* YAP_DBG_PREDS */ #define check_trail_in_indexing(x) if (__builtin_expect((Unsigned(CurrentTrailTop) < Unsigned(x)),0)) \ - goto notrailleft_from_index + goto notrailleft_from_index -#endif - -#if (defined(YAPOR_SBA) && defined(YAPOR)) || defined(TABLING) -#define check_stack(Label, GLOB) \ - if (__builtin_expect( ((Int)(Unsigned(YOUNGEST_CP((choiceptr)ENV_YREG,B_FZ)) - Unsigned(YOUNGEST_H(H_FZ,GLOB))) < CreepFlag), 0) ) goto Label #else -#define check_stack(Label, GLOB) \ - if (__builtin_expect(((Int)(Unsigned(ENV_YREG) - Unsigned(GLOB)) < CreepFlag ), 0) ) goto Label + +#if YAP_DBG_PREDS + +#define check_trail(x) if (__builtin_expect((Unsigned(CurrentTrailTop) < Unsigned(x)),0)) { \ + if ((char*)ExpEnv.debug_struc.pprint_me.interpreted_treat_trail != 0 && (char*)ExpEnv.debug_struc.pprint_me.interpreted_treat_trail != (char*)0x1) { \ + fprintf(stderr, "%s:%d\n", __FILE__, __LINE__); \ + fprintf(stderr, "%s", (char*)ExpEnv.debug_struc.pprint_me.interpreted_treat_trail); \ + } \ + goto notrailleft; \ + } + +#else /* YAP_DBG_PREDS */ + +#define check_trail(x) if (__builtin_expect((Unsigned(CurrentTrailTop) < Unsigned(x)),0)) { \ + goto notrailleft; \ + } + +#endif /* YAP_DBG_PREDS */ + +#define check_trail_in_indexing(x) if (__builtin_expect((Unsigned(CurrentTrailTop) < Unsigned(x)),0)) \ + goto notrailleft_from_index + +#endif /* _NATIVE */ + +#endif /* OS_HANDLES_TR_OVERFLOW */ + +#if YAP_DBG_PREDS +#if (defined(YAPOR_SBA) && defined(YAPOR)) || defined(TABLING) +#define check_stack(Label, GLOB) \ + if (__builtin_expect( ((Int)(Unsigned(YOUNGEST_CP((choiceptr)ENV_YREG,B_FZ)) - Unsigned(YOUNGEST_H(H_FZ,GLOB))) < CreepFlag), 0) ) { \ + if ((char*)ExpEnv.debug_struc.pprint_me.interpreted_treat_heap != 0 && (char*)ExpEnv.debug_struc.pprint_me.interpreted_treat_heap != (char*)0x1) { \ + fprintf(stderr, "%s:%d\n", __FILE__, __LINE__); \ + fprintf(stderr, "%s", (char*)ExpEnv.debug_struc.pprint_me.interpreted_treat_heap); \ + } \ + goto Label; \ + } +#else +#define check_stack(Label, GLOB) \ + if (__builtin_expect(((Int)(Unsigned(ENV_YREG) - Unsigned(GLOB)) < CreepFlag ), 0) ) { \ + if ((char*)ExpEnv.debug_struc.pprint_me.interpreted_treat_heap != 0 && (char*)ExpEnv.debug_struc.pprint_me.interpreted_treat_heap != (char*)0x1) { \ + fprintf(stderr, "%s:%d\n", __FILE__, __LINE__); \ + fprintf(stderr, "%s", (char*)ExpEnv.debug_struc.pprint_me.interpreted_treat_heap); \ + } \ + goto Label; \ + } #endif /* YAPOR_SBA && YAPOR */ +#else /* YAP_DBG_PREDS */ +#if (defined(YAPOR_SBA) && defined(YAPOR)) || defined(TABLING) +#define check_stack(Label, GLOB) \ + if (__builtin_expect( ((Int)(Unsigned(YOUNGEST_CP((choiceptr)ENV_YREG,B_FZ)) - Unsigned(YOUNGEST_H(H_FZ,GLOB))) < CreepFlag), 0) ) { \ + goto Label; \ + } +#else +#define check_stack(Label, GLOB) \ + if (__builtin_expect(((Int)(Unsigned(ENV_YREG) - Unsigned(GLOB)) < CreepFlag ), 0) ) { \ + goto Label; \ + } +#endif /* YAPOR_SBA && YAPOR */ +#endif /* YAP_DBG_PREDS */ /*************************************************************** -* Macros for choice point manipulation * -***************************************************************/ + * Macros for choice point manipulation * + ***************************************************************/ /*************************************************************** -* Store variable number of arguments in a choice point * -***************************************************************/ + * Store variable number of arguments in a choice point * + ***************************************************************/ /*** - pt1 points at the new choice point, - pt0 points at XREGS[i] - d0 is a counter - The macro just pushes the arguments one by one to the local stack. + pt1 points at the new choice point, + pt0 points at XREGS[i] + d0 is a counter + The macro just pushes the arguments one by one to the local stack. ***/ -#define store_args(arity) \ - BEGP(pt0); \ - pt0 = XREGS+(arity); \ - while ( pt0 > XREGS ) \ - { register CELL x = pt0[0]; \ - S_YREG = S_YREG-1; \ - --pt0; \ - (S_YREG)[0] = x; \ - } \ - ENDP(pt0) +#define store_args(arity) \ + BEGP(pt0); \ + pt0 = XREGS+(arity); \ + while ( pt0 > XREGS ) \ + { register CELL x = pt0[0]; \ + S_YREG = S_YREG-1; \ + --pt0; \ + (S_YREG)[0] = x; \ + } \ + ENDP(pt0) -#define store_at_least_one_arg(arity) \ - BEGP(pt0); \ - pt0 = XREGS+(arity); \ - do { CELL x = pt0[0]; \ - S_YREG = (S_YREG)-1; \ - --pt0; \ - (S_YREG)[0] = x; \ - } \ - while ( pt0 > XREGS ); \ - ENDP(pt0) +#define store_at_least_one_arg(arity) \ + BEGP(pt0); \ + pt0 = XREGS+(arity); \ + do { CELL x = pt0[0]; \ + S_YREG = (S_YREG)-1; \ + --pt0; \ + (S_YREG)[0] = x; \ + } \ + while ( pt0 > XREGS ); \ + ENDP(pt0) #if LOW_LEVEL_TRACER && 0 #define COUNT_CPS() LOCAL_total_choicepoints++ @@ -760,9 +1223,9 @@ Macros to check the limits of stacks #endif /*************************************************************** -* Do the bulk of work in creating a choice-point * -* AP: alternative pointer * -***************************************************************/ + * Do the bulk of work in creating a choice-point * + * AP: alternative pointer * + ***************************************************************/ /* * The macro just sets pt1 to point to the base of the choicepoint * and then fills in all the necessary fields @@ -773,42 +1236,59 @@ Macros to check the limits of stacks #define store_yaam_reg_cpdepth(CPTR) #endif -#define store_yaam_regs(AP,I) \ - { /* Jump to CP_BASE */ \ - COUNT_CPS(); \ - S_YREG = (CELL *)((choiceptr)((S_YREG)-(I))-1); \ - /* Save Information */ \ - HBREG = HR; \ - B_YREG->cp_tr = TR; \ - B_YREG->cp_h = HR; \ - B_YREG->cp_b = B; \ - store_yaam_reg_cpdepth(B_YREG); \ - B_YREG->cp_cp = CPREG; \ - B_YREG->cp_ap = AP; \ - B_YREG->cp_env= ENV; \ - } +#ifndef _NATIVE +#define store_yaam_regs(AP,I) \ + { /* Jump to CP_BASE */ \ + COUNT_CPS(); \ + S_YREG = (CELL *)((choiceptr)((S_YREG)-(I))-1); \ + /* Save Information */ \ + HBREG = HR; \ + B_YREG->cp_tr = TR; \ + B_YREG->cp_h = HR; \ + B_YREG->cp_b = B; \ + store_yaam_reg_cpdepth(B_YREG); \ + B_YREG->cp_cp = CPREG; \ + B_YREG->cp_ap = AP; \ + B_YREG->cp_env= ENV; \ + } +#else /* _NATIVE */ +#define store_yaam_regs(AP,I) \ + { /* Jump to CP_BASE */ \ + COUNT_CPS(); \ + S_YREG = (CELL *)((choiceptr)((S_YREG)-(I))-1); \ + /* Save Information */ \ + HBREG = HR; \ + B_YREG->cp_tr = TR; \ + B_YREG->cp_h = HR; \ + B_YREG->cp_b = B; \ + store_yaam_reg_cpdepth(B_YREG); \ + B_YREG->cp_cp = (*_CPREG); \ + B_YREG->cp_ap = AP; \ + B_YREG->cp_env= ENV; \ + } +#endif #define store_yaam_regs_for_either(AP,d0) \ - COUNT_CPS(); \ - pt1 --; /* Jump to CP_BASE */ \ - /* Save Information */ \ - HBREG = HR; \ - pt1->cp_tr = TR; \ - pt1->cp_h = HR; \ - pt1->cp_b = B; \ - store_yaam_reg_cpdepth(pt1); \ - pt1->cp_cp = d0; \ - pt1->cp_ap = AP; \ - pt1->cp_env = ENV; + COUNT_CPS(); \ + pt1 --; /* Jump to CP_BASE */ \ + /* Save Information */ \ + HBREG = HR; \ + pt1->cp_tr = TR; \ + pt1->cp_h = HR; \ + pt1->cp_b = B; \ + store_yaam_reg_cpdepth(pt1); \ + pt1->cp_cp = d0; \ + pt1->cp_ap = AP; \ + pt1->cp_env = ENV; /*************************************************************** -* Place B as the new place to cut to * -***************************************************************/ -#define set_cut(E,B) (E)[E_CB] = (CELL)(B) + * Place B as the new place to cut to * + ***************************************************************/ +#define set_cut(E,B) (E)[E_CB] = (CELL)(B) /*************************************************************** -* Restore WAM registers from a choice point * -***************************************************************/ + * Restore WAM registers from a choice point * + ***************************************************************/ #ifdef DEPTH_LIMIT #define restore_yaam_reg_cpdepth(CPTR) DEPTH = (CPTR)->cp_depth @@ -818,9 +1298,9 @@ Macros to check the limits of stacks #ifdef YAPOR #define YAPOR_update_alternative(CUR_ALT, NEW_ALT) \ - if (SCH_top_shared_cp(B)) { \ - SCH_new_alternative(CUR_ALT, NEW_ALT); \ - } else + if (SCH_top_shared_cp(B)) { \ + SCH_new_alternative(CUR_ALT, NEW_ALT); \ + } else #else #define YAPOR_update_alternative(CUR_ALT, NEW_ALT) #endif /* YAPOR */ @@ -834,19 +1314,19 @@ Macros to check the limits of stacks #ifdef FROZEN_STACKS #ifdef YAPOR_SBA -#define PROTECT_FROZEN_H(CPTR) \ - ((Unsigned((Int)((CPTR)->cp_h)-(Int)(H_FZ)) < \ - Unsigned((Int)(B_FZ)-(Int)(H_FZ))) ? \ - (CPTR)->cp_h : H_FZ) -#define PROTECT_FROZEN_B(CPTR) \ - ((Unsigned((Int)(CPTR)-(Int)(H_FZ)) < \ - Unsigned((Int)(B_FZ)-(Int)(H_FZ))) ? \ - (CPTR) : B_FZ) - /* -#define PROTECT_FROZEN_H(CPTR) ((CPTR)->cp_h > H_FZ && (CPTR)->cp_h < (CELL *)B_FZ ? (CPTR)->cp_h : H_FZ ) +#define PROTECT_FROZEN_H(CPTR) \ + ((Unsigned((Int)((CPTR)->cp_h)-(Int)(H_FZ)) < \ + Unsigned((Int)(B_FZ)-(Int)(H_FZ))) ? \ + (CPTR)->cp_h : H_FZ) +#define PROTECT_FROZEN_B(CPTR) \ + ((Unsigned((Int)(CPTR)-(Int)(H_FZ)) < \ + Unsigned((Int)(B_FZ)-(Int)(H_FZ))) ? \ + (CPTR) : B_FZ) +/* + #define PROTECT_FROZEN_H(CPTR) ((CPTR)->cp_h > H_FZ && (CPTR)->cp_h < (CELL *)B_FZ ? (CPTR)->cp_h : H_FZ ) -#define PROTECT_FROZEN_B(CPTR) ((CPTR) < B_FZ && (CPTR) > (choiceptr)H_FZ ? (CPTR) : B_FZ ) - */ + #define PROTECT_FROZEN_B(CPTR) ((CPTR) < B_FZ && (CPTR) > (choiceptr)H_FZ ? (CPTR) : B_FZ ) +*/ #else /* TABLING */ #define PROTECT_FROZEN_B(CPTR) (YOUNGER_CP(CPTR, B_FZ) ? CPTR : B_FZ) #define PROTECT_FROZEN_H(CPTR) (((CPTR)->cp_h > H_FZ) ? (CPTR)->cp_h : H_FZ) @@ -856,59 +1336,74 @@ Macros to check the limits of stacks #define PROTECT_FROZEN_H(CPTR) (CPTR)->cp_h #endif /* FROZEN_STACKS */ -#define restore_yaam_regs(AP) \ - { register CELL *x1 = B_YREG->cp_env; \ - register yamop *x2; \ - HR = HBREG = PROTECT_FROZEN_H(B_YREG); \ - restore_yaam_reg_cpdepth(B_YREG); \ - CPREG = B_YREG->cp_cp; \ - /* AP may depend on H */ \ - x2 = (yamop *)AP; \ - ENV = x1; \ - YAPOR_update_alternative(PREG, x2) \ - B_YREG->cp_ap = x2; \ - } +#ifndef _NATIVE +#define restore_yaam_regs(AP) \ + { register CELL *x1 = B_YREG->cp_env; \ + register yamop *x2; \ + HR = HBREG = PROTECT_FROZEN_H(B_YREG); \ + restore_yaam_reg_cpdepth(B_YREG); \ + CPREG = B_YREG->cp_cp; \ + /* AP may depend on H */ \ + x2 = (yamop *)AP; \ + ENV = x1; \ + YAPOR_update_alternative(PREG, x2) \ + B_YREG->cp_ap = x2; \ + } +#else +#define restore_yaam_regs(AP) \ + { register CELL *x1 = B_YREG->cp_env; \ + register yamop *x2; \ + H = HBREG = PROTECT_FROZEN_H(B_YREG); \ + restore_yaam_reg_cpdepth(B_YREG); \ + (*_CPREG) = B_YREG->cp_cp; \ + /* AP may depend on H */ \ + x2 = (yamop *)AP; \ + ENV = x1; \ + YAPOR_update_alternative((*_PREG), x2) \ + B_YREG->cp_ap = x2; \ + } +#endif /*************************************************************** -* Restore variable number of arguments from a choice point * -***************************************************************/ -#define restore_args(Nargs) \ - BEGD(d0); \ - d0 = Nargs; \ - BEGP(pt0); \ - BEGP(pt1); \ - pt1 = (CELL *)(B_YREG+1)+d0; \ - pt0 = XREGS+1+d0; \ - while (pt0 > XREGS +1 ) \ - { register CELL x = pt1[-1]; \ - --pt0; \ - --pt1; \ - *pt0 = x; \ - } \ - ENDP(pt1); \ - ENDP(pt0); \ - ENDD(d0) + * Restore variable number of arguments from a choice point * + ***************************************************************/ +#define restore_args(Nargs) \ + BEGD(d0); \ + d0 = Nargs; \ + BEGP(pt0); \ + BEGP(pt1); \ + pt1 = (CELL *)(B_YREG+1)+d0; \ + pt0 = XREGS+1+d0; \ + while (pt0 > XREGS +1 ) \ + { register CELL x = pt1[-1]; \ + --pt0; \ + --pt1; \ + *pt0 = x; \ + } \ + ENDP(pt1); \ + ENDP(pt0); \ + ENDD(d0) -#define restore_at_least_one_arg(Nargs) \ - BEGD(d0); \ - d0 = Nargs; \ - BEGP(pt0); \ - BEGP(pt1); \ - pt1 = (CELL *)(B_YREG+1)+d0; \ - pt0 = XREGS+1+d0; \ - do { register CELL x = pt1[-1]; \ - --pt0; \ - --pt1; \ - *pt0 = x; \ - } \ - while (pt0 > XREGS +1 ); \ - ENDP(pt1); \ - ENDP(pt0); \ - ENDD(d0) +#define restore_at_least_one_arg(Nargs) \ + BEGD(d0); \ + d0 = Nargs; \ + BEGP(pt0); \ + BEGP(pt1); \ + pt1 = (CELL *)(B_YREG+1)+d0; \ + pt0 = XREGS+1+d0; \ + do { register CELL x = pt1[-1]; \ + --pt0; \ + --pt1; \ + *pt0 = x; \ + } \ + while (pt0 > XREGS +1 ); \ + ENDP(pt1); \ + ENDP(pt0); \ + ENDD(d0) /*************************************************************** -* Execute trust to release YAAM registers and pop choice point * -***************************************************************/ + * Execute trust to release YAAM registers and pop choice point * + ***************************************************************/ #ifdef DEPTH_LIMIT #define pop_yaam_reg_cpdepth(CPTR) DEPTH = (CPTR)->cp_depth #else @@ -921,53 +1416,66 @@ Macros to check the limits of stacks #define TABLING_close_alt(CPTR) #endif /* TABLING */ -#define pop_yaam_regs() \ - { \ - HR = PROTECT_FROZEN_H(B_YREG); \ - B = B_YREG->cp_b; \ - pop_yaam_reg_cpdepth(B_YREG); \ - CPREG = B_YREG->cp_cp; \ - ENV = B_YREG->cp_env; \ - TABLING_close_alt(B_YREG); \ - HBREG = PROTECT_FROZEN_H(B); \ - } +#ifndef _NATIVE +#define pop_yaam_regs() \ + { \ + HR = PROTECT_FROZEN_H(B_YREG); \ + B = B_YREG->cp_b; \ + pop_yaam_reg_cpdepth(B_YREG); \ + CPREG = B_YREG->cp_cp; \ + ENV = B_YREG->cp_env; \ + TABLING_close_alt(B_YREG); \ + HBREG = PROTECT_FROZEN_H(B); \ + } +#else +#define pop_yaam_regs() \ + { \ + HR = PROTECT_FROZEN_H(B_YREG); \ + B = B_YREG->cp_b; \ + pop_yaam_reg_cpdepth(B_YREG); \ + (*_CPREG) = B_YREG->cp_cp; \ + ENV = B_YREG->cp_env; \ + TABLING_close_alt(B_YREG); \ + HBREG = PROTECT_FROZEN_H(B); \ + } +#endif -#define pop_args(NArgs) \ - BEGD(d0); \ - d0 = (NArgs); \ - BEGP(pt0); \ - BEGP(pt1); \ - S_YREG = (CELL *)(B_YREG+1); \ - pt0 = XREGS + 1 ; \ - pt1 = S_YREG ; \ - while (pt0 < XREGS+1+d0) \ - { register CELL x = pt1[0]; \ - pt1++; \ - pt0++; \ - pt0[-1] = x; \ - } \ - S_YREG = pt1; \ - ENDP(pt1); \ - ENDP(pt0); \ - ENDD(d0); +#define pop_args(NArgs) \ + BEGD(d0); \ + d0 = (NArgs); \ + BEGP(pt0); \ + BEGP(pt1); \ + S_YREG = (CELL *)(B_YREG+1); \ + pt0 = XREGS + 1 ; \ + pt1 = S_YREG ; \ + while (pt0 < XREGS+1+d0) \ + { register CELL x = pt1[0]; \ + pt1++; \ + pt0++; \ + pt0[-1] = x; \ + } \ + S_YREG = pt1; \ + ENDP(pt1); \ + ENDP(pt0); \ + ENDD(d0); -#define pop_at_least_one_arg(NArgs) \ - BEGD(d0); \ - d0 = (NArgs); \ - BEGP(pt0); \ - BEGP(pt1); \ - pt1 = (CELL *)(B_YREG+1); \ - pt0 = XREGS + 1 ; \ - do { register CELL x = pt1[0]; \ - pt1++; \ - pt0++; \ - pt0[-1] = x; \ - } \ - while (pt0 < XREGS+1+d0); \ - S_YREG = pt1; \ - ENDP(pt1); \ - ENDP(pt0); \ - ENDD(d0); +#define pop_at_least_one_arg(NArgs) \ + BEGD(d0); \ + d0 = (NArgs); \ + BEGP(pt0); \ + BEGP(pt1); \ + pt1 = (CELL *)(B_YREG+1); \ + pt0 = XREGS + 1 ; \ + do { register CELL x = pt1[0]; \ + pt1++; \ + pt0++; \ + pt0[-1] = x; \ + } \ + while (pt0 < XREGS+1+d0); \ + S_YREG = pt1; \ + ENDP(pt1); \ + ENDP(pt0); \ + ENDD(d0); /********************************************************************** * * @@ -976,15 +1484,51 @@ Macros to check the limits of stacks **********************************************************************/ /* Failure can be called from two routines. - * + * * If from within the emulator, we should jump to the label fail. - * + * * If from within the complex-term unification routine, we should jump * to the label "cufail". - * + * */ -#define FAIL() goto fail +#ifndef _NATIVE + +#if YAP_DBG_PREDS + +#define FAIL() { \ + if ((char*)ExpEnv.debug_struc.pprint_me.interpreted_backtrack != 0 && (char*)ExpEnv.debug_struc.pprint_me.interpreted_backtrack != (char*)0x1) { \ + fprintf(stderr, "%s:%d\n", __FILE__, __LINE__); \ + fprintf(stderr, "%s", (char*)ExpEnv.debug_struc.pprint_me.interpreted_backtrack); \ + } \ + goto fail; \ + } + +#define TRACED_FAIL() { \ + if ((char*)ExpEnv.debug_struc.pprint_me.profiled_interpreted_backtrack != 0 && (char*)ExpEnv.debug_struc.pprint_me.profiled_interpreted_backtrack != (char*)0x1) { \ + fprintf(stderr, "%s:%d\n", __FILE__, __LINE__); \ + fprintf(stderr, "%s", (char*)ExpEnv.debug_struc.pprint_me.profiled_interpreted_backtrack); \ + } \ + goto traced_fail; \ + } + +#else /* YAP_DBG_PREDS */ + +#define FAIL() { \ + goto fail; \ + } + +#define TRACED_FAIL() { \ + goto traced_fail; \ + } + +#endif /* YAP_DBG_PREDS */ + +#else + +#define FAIL() { return external_labels[0]; } + +#endif /********************************************************************** * * @@ -992,109 +1536,146 @@ Macros to check the limits of stacks * * **********************************************************************/ -#define UnifyGlobalCells(a, b) \ - if ((b) > (a)) { \ - if (GlobalIsAttVar(b) && !GlobalIsAttVar(a)) { \ - Bind_Global((a),(CELL)(b)); \ - } else { \ - Bind_Global((b),(CELL)(a)); \ - } \ - } else if ((b) < (a)) { \ - if (GlobalIsAttVar(a) && !GlobalIsAttVar(b)) { \ - Bind_Global((b),(CELL)(a)); \ - } else { \ - Bind_Global((a),(CELL)(b)); \ - } \ - } +#define UnifyGlobalCells(a, b) \ + if ((b) > (a)) { \ + if (GlobalIsAttVar(b) && !GlobalIsAttVar(a)) { \ + Bind_Global((a),(CELL)(b)); \ + } else { \ + Bind_Global((b),(CELL)(a)); \ + } \ + } else if ((b) < (a)) { \ + if (GlobalIsAttVar(a) && !GlobalIsAttVar(b)) { \ + Bind_Global((b),(CELL)(a)); \ + } else { \ + Bind_Global((a),(CELL)(b)); \ + } \ + } -#define UnifyGlobalCellToCell(b, a) \ -if ((a) < HR) { /* two globals */ \ - UnifyGlobalCells(a,b); \ -} else { \ - Bind_Local((a),(CELL)(b)); \ -} +#define UnifyGlobalCellToCell(b, a) \ + if ((a) < HR) { /* two globals */ \ + UnifyGlobalCells(a,b); \ + } else { \ + Bind_Local((a),(CELL)(b)); \ + } -#define UnifyCells(a, b) \ -if ((a) < HR) { /* at least one global */ \ - if ((b) > HR) { Bind_Local((b),(CELL)(a)); } \ - else { UnifyGlobalCells(a,b); } \ -} else { \ - if ((b) > (a)) { Bind_Local((a),(CELL)(b)); } \ - else if ((a) > (b)) { \ - if ((b) < HR) { Bind_Local((a),(CELL)(b)); } \ - else { Bind_Local((b),(CELL)(a)); } \ - } \ -} +#define UnifyCells(a, b) \ + if ((a) < HR) { /* at least one global */ \ + if ((b) > HR) { Bind_Local((b),(CELL)(a)); } \ + else { UnifyGlobalCells(a,b); } \ + } else { \ + if ((b) > (a)) { Bind_Local((a),(CELL)(b)); } \ + else if ((a) > (b)) { \ + if ((b) < HR) { Bind_Local((a),(CELL)(b)); } \ + else { Bind_Local((b),(CELL)(a)); } \ + } \ + } /* unify two complex terms. - * + * * I use two stacks: one keeps the visited terms, and the other keeps the * terms to visit. - * + * * The terms-to-visit stack is used to implement traditional * recursion. The visited-terms-stack is used to link structures already * visited and allows unification of infinite terms - * + * */ #ifdef RATIONAL_TREES -#define UNWIND_CUNIF() \ - while (visited < AuxSp) { \ - pt1 = (CELL *)visited[0]; \ - *pt1 = visited[1]; \ - visited += 2; \ - } +#define UNWIND_CUNIF() \ + while (visited < AuxSp) { \ + pt1 = (CELL *)visited[0]; \ + *pt1 = visited[1]; \ + visited += 2; \ + } #else #define UNWIND_CUNIF() #endif -#define UnifyBound_TEST_ATTACHED(f,d0,pt0,d1) \ - if (IsExtensionFunctor(f)) { \ - if (unify_extension(f, d0, RepAppl(d0), d1)) \ - { GONext(); } \ - else \ - { FAIL(); } \ - } +#define UnifyBound_TEST_ATTACHED(f,d0,pt0,d1) \ + if (IsExtensionFunctor(f)) { \ + if (unify_extension(f, d0, RepAppl(d0), d1)) \ + { GONext(); } \ + else \ + { FAIL(); } \ + } -#define UnifyBound(d0,d1) \ - if (d0 == d1) GONext(); \ - if (IsPairTerm(d0)) { \ - register CELL *ipt0, *ipt1; \ - if (!IsPairTerm(d1)) { FAIL(); } \ - ipt0 = RepPair(d0); \ - ipt1 = RepPair(d1); \ - save_hb(); \ - always_save_pc(); \ - if (IUnify_complex(ipt0-1,ipt0+1,ipt1-1)) {always_set_pc(); GONext();}\ - else { FAIL(); } \ - } else if (IsApplTerm(d0)) { \ - register CELL *ipt0, *ipt1; \ - register Functor f; \ - if (!IsApplTerm(d1)) { FAIL(); } \ - ipt0 = RepAppl(d0); \ - ipt1 = RepAppl(d1); \ - f = (Functor)*ipt0; \ - if (f != (Functor)*ipt1) { FAIL(); } \ - UnifyBound_TEST_ATTACHED(f,d0,ipt0,d1); \ - d0 = ArityOfFunctor(f); \ - always_save_pc(); \ - save_hb(); \ +#define UnifyBound(d0,d1) \ + if (d0 == d1) { GONext(); } \ + if (IsPairTerm(d0)) { \ + register CELL *ipt0, *ipt1; \ + if (!IsPairTerm(d1)) { FAIL(); } \ + ipt0 = RepPair(d0); \ + ipt1 = RepPair(d1); \ + save_hb(); \ + always_save_pc(); \ + if (IUnify_complex(ipt0-1,ipt0+1,ipt1-1)) {always_set_pc(); GONext();} \ + else { FAIL(); } \ + } else if (IsApplTerm(d0)) { \ + register CELL *ipt0, *ipt1; \ + register Functor f; \ + if (!IsApplTerm(d1)) { FAIL(); } \ + ipt0 = RepAppl(d0); \ + ipt1 = RepAppl(d1); \ + f = (Functor)*ipt0; \ + if (f != (Functor)*ipt1) { FAIL(); } \ + UnifyBound_TEST_ATTACHED(f,d0,ipt0,d1); \ + d0 = ArityOfFunctor(f); \ + always_save_pc(); \ + save_hb(); \ if (IUnify_complex(ipt0, ipt0+d0, ipt1)) {always_set_pc(); GONext();} \ - else { FAIL(); } \ - } \ + else { FAIL(); } \ + } \ else { FAIL(); } + +#define traced_UnifyBound_TEST_ATTACHED(f,d0,pt0,d1) \ + if (IsExtensionFunctor(f)) { \ + if (unify_extension(f, d0, RepAppl(d0), d1)) \ + { GONext(); } \ + else \ + { TRACED_FAIL(); } \ + } -/* +#define traced_UnifyBound(d0,d1) \ + if (d0 == d1) { GONext(); } \ + if (IsPairTerm(d0)) { \ + register CELL *ipt0, *ipt1; \ + if (!IsPairTerm(d1)) { TRACED_FAIL(); } \ + ipt0 = RepPair(d0); \ + ipt1 = RepPair(d1); \ + save_hb(); \ + always_save_pc(); \ + if (IUnify_complex(ipt0-1,ipt0+1,ipt1-1)) {always_set_pc(); GONext();} \ + else { TRACED_FAIL(); } \ + } else if (IsApplTerm(d0)) { \ + register CELL *ipt0, *ipt1; \ + register Functor f; \ + if (!IsApplTerm(d1)) { TRACED_FAIL(); } \ + ipt0 = RepAppl(d0); \ + ipt1 = RepAppl(d1); \ + f = (Functor)*ipt0; \ + if (f != (Functor)*ipt1) { TRACED_FAIL(); } \ + traced_UnifyBound_TEST_ATTACHED(f,d0,ipt0,d1); \ + d0 = ArityOfFunctor(f); \ + always_save_pc(); \ + save_hb(); \ + if (IUnify_complex(ipt0, ipt0+d0, ipt1)) {always_set_pc(); GONext();} \ + else { TRACED_FAIL(); } \ + } \ + else { TRACED_FAIL(); } + + +/* * Next, HB */ #ifdef SHADOW_HB #undef HBREG -#define set_hb() HBREG = HB -#define save_hb() HB = HBREG +#define set_hb() HBREG = HB +#define save_hb() HB = HBREG #else #define set_hb() #define save_hb() @@ -1114,13 +1695,14 @@ typedef struct v_record { #if defined(IN_ABSMI_C) || defined(IN_UNIFY_C) + static int IUnify_complex(CELL *pt0, CELL *pt0_end, CELL *pt1) { CACHE_REGS #ifdef THREADS #undef Yap_REGS - register REGSTORE *regp = Yap_regp; + register REGSTORE *regp = Yap_regp; #define Yap_REGS (*regp) #elif defined(SHADOW_REGS) #if defined(B) || defined(TR) @@ -1139,7 +1721,7 @@ IUnify_complex(CELL *pt0, CELL *pt0_end, CELL *pt1) #define unif_base ((struct unif_record *)AuxBase) #define to_visit_base ((struct v_record *)AuxSp) -loop: + loop: while (pt0 < pt0_end) { register CELL *ptd0 = pt0+1; register CELL d0; @@ -1156,88 +1738,88 @@ loop: deref_head(d1, unify_comp_nvar_unk); unify_comp_nvar_nvar: if (d0 == d1) - continue; + continue; if (IsPairTerm(d0)) { - if (!IsPairTerm(d1)) { - goto cufail; - } - /* now link the two structures so that no one else will */ - /* come here */ - /* store the terms to visit */ - if (RATIONAL_TREES || pt0 < pt0_end) { - to_visit --; + if (!IsPairTerm(d1)) { + goto cufail; + } + /* now link the two structures so that no one else will */ + /* come here */ + /* store the terms to visit */ + if (RATIONAL_TREES || pt0 < pt0_end) { + to_visit --; #ifdef RATIONAL_TREES - unif++; + unif++; #endif - if ((void *)to_visit < (void *)unif) { - CELL **urec = (CELL **)unif; - to_visit = (struct v_record *)Yap_shift_visit((CELL **)to_visit, &urec, NULL); - unif = (struct unif_record *)urec; - } - to_visit->start0 = pt0; - to_visit->end0 = pt0_end; - to_visit->start1 = pt1; + if ((void *)to_visit < (void *)unif) { + CELL **urec = (CELL **)unif; + to_visit = (struct v_record *)Yap_shift_visit((CELL **)to_visit, &urec, NULL); + unif = (struct unif_record *)urec; + } + to_visit->start0 = pt0; + to_visit->end0 = pt0_end; + to_visit->start1 = pt1; #ifdef RATIONAL_TREES - unif[-1].old = *pt0; - unif[-1].ptr = pt0; - *pt0 = d1; + unif[-1].old = *pt0; + unif[-1].ptr = pt0; + *pt0 = d1; #endif - } - pt0_end = (pt0 = RepPair(d0) - 1) + 2; - pt1 = RepPair(d1) - 1; - continue; + } + pt0_end = (pt0 = RepPair(d0) - 1) + 2; + pt1 = RepPair(d1) - 1; + continue; } if (IsApplTerm(d0)) { - register Functor f; - register CELL *ap2, *ap3; + register Functor f; + register CELL *ap2, *ap3; - if (!IsApplTerm(d1)) { - goto cufail; - } - /* store the terms to visit */ - ap2 = RepAppl(d0); - ap3 = RepAppl(d1); - f = (Functor) (*ap2); - /* compare functors */ - if (f != (Functor) *ap3) - goto cufail; - if (IsExtensionFunctor(f)) { - if (unify_extension(f, d0, ap2, d1)) - continue; - goto cufail; - } - /* now link the two structures so that no one else will */ - /* come here */ - /* store the terms to visit */ - if (RATIONAL_TREES || pt0 < pt0_end) { - to_visit --; + if (!IsApplTerm(d1)) { + goto cufail; + } + /* store the terms to visit */ + ap2 = RepAppl(d0); + ap3 = RepAppl(d1); + f = (Functor) (*ap2); + /* compare functors */ + if (f != (Functor) *ap3) + goto cufail; + if (IsExtensionFunctor(f)) { + if (unify_extension(f, d0, ap2, d1)) + continue; + goto cufail; + } + /* now link the two structures so that no one else will */ + /* come here */ + /* store the terms to visit */ + if (RATIONAL_TREES || pt0 < pt0_end) { + to_visit --; #ifdef RATIONAL_TREES - unif++; + unif++; #endif - if ((void *)to_visit < (void *)unif) { - CELL **urec = (CELL **)unif; - to_visit = (struct v_record *)Yap_shift_visit((CELL **)to_visit, &urec, NULL); - unif = (struct unif_record *)urec; - } - to_visit->start0 = pt0; - to_visit->end0 = pt0_end; - to_visit->start1 = pt1; + if ((void *)to_visit < (void *)unif) { + CELL **urec = (CELL **)unif; + to_visit = (struct v_record *)Yap_shift_visit((CELL **)to_visit, &urec, NULL); + unif = (struct unif_record *)urec; + } + to_visit->start0 = pt0; + to_visit->end0 = pt0_end; + to_visit->start1 = pt1; #ifdef RATIONAL_TREES - unif[-1].old = *pt0; - unif[-1].ptr = pt0; - *pt0 = d1; + unif[-1].old = *pt0; + unif[-1].ptr = pt0; + *pt0 = d1; #endif - } - d0 = ArityOfFunctor(f); - pt0 = ap2; - pt0_end = ap2 + d0; - pt1 = ap3; - continue; + } + d0 = ArityOfFunctor(f); + pt0 = ap2; + pt0_end = ap2 + d0; + pt1 = ap3; + continue; } goto cufail; derefa_body(d1, ptd1, unify_comp_nvar_unk, unify_comp_nvar_nvar); - /* d1 and pt2 have the unbound value, whereas d0 is bound */ + /* d1 and pt2 have the unbound value, whereas d0 is bound */ Bind_Global(ptd1, d0); continue; } @@ -1281,7 +1863,7 @@ loop: #endif return TRUE; -cufail: + cufail: #ifdef RATIONAL_TREES /* restore bindigs */ while (unif-- != unif_base) { @@ -1314,13 +1896,13 @@ cufail: static int iequ_complex(register CELL *pt0, register CELL *pt0_end, - register CELL *pt1 -) + register CELL *pt1 + ) { -CACHE_REGS + CACHE_REGS #ifdef THREADS #undef Yap_REGS - register REGSTORE *regp = Yap_regp; + register REGSTORE *regp = Yap_regp; #define Yap_REGS (*regp) #elif defined(SHADOW_REGS) #if defined(B) || defined(TR) @@ -1339,7 +1921,7 @@ CACHE_REGS #define unif_base ((struct unif_record *)AuxBase) #define to_visit_base ((struct v_record *)AuxSp) -loop: + loop: while (pt0 < pt0_end) { register CELL *ptd0 = pt0+1; register CELL d0; @@ -1356,88 +1938,88 @@ loop: deref_head(d1, iequ_comp_nvar_unk); iequ_comp_nvar_nvar: if (d0 == d1) - continue; + continue; if (IsPairTerm(d0)) { - if (!IsPairTerm(d1)) { - goto cufail; - } - /* now link the two structures so that no one else will */ - /* come here */ - /* store the terms to visit */ - if (RATIONAL_TREES || pt0 < pt0_end) { - to_visit --; + if (!IsPairTerm(d1)) { + goto cufail; + } + /* now link the two structures so that no one else will */ + /* come here */ + /* store the terms to visit */ + if (RATIONAL_TREES || pt0 < pt0_end) { + to_visit --; #ifdef RATIONAL_TREES - unif++; + unif++; #endif - if ((void *)to_visit < (void *)unif) { - CELL **urec = (CELL **)unif; - to_visit = (struct v_record *)Yap_shift_visit((CELL **)to_visit, &urec, NULL); - unif = (struct unif_record *)urec; - } - to_visit->start0 = pt0; - to_visit->end0 = pt0_end; - to_visit->start1 = pt1; + if ((void *)to_visit < (void *)unif) { + CELL **urec = (CELL **)unif; + to_visit = (struct v_record *)Yap_shift_visit((CELL **)to_visit, &urec, NULL); + unif = (struct unif_record *)urec; + } + to_visit->start0 = pt0; + to_visit->end0 = pt0_end; + to_visit->start1 = pt1; #ifdef RATIONAL_TREES - unif[-1].old = *pt0; - unif[-1].ptr = pt0; - *pt0 = d1; + unif[-1].old = *pt0; + unif[-1].ptr = pt0; + *pt0 = d1; #endif - } - pt0_end = (pt0 = RepPair(d0) - 1) + 2; - pt1 = RepPair(d1) - 1; - continue; + } + pt0_end = (pt0 = RepPair(d0) - 1) + 2; + pt1 = RepPair(d1) - 1; + continue; } if (IsApplTerm(d0)) { - register Functor f; - register CELL *ap2, *ap3; + register Functor f; + register CELL *ap2, *ap3; - if (!IsApplTerm(d1)) { - goto cufail; - } - /* store the terms to visit */ - ap2 = RepAppl(d0); - ap3 = RepAppl(d1); - f = (Functor) (*ap2); - /* compare functors */ - if (f != (Functor) *ap3) - goto cufail; - if (IsExtensionFunctor(f)) { - if (unify_extension(f, d0, ap2, d1)) - continue; - goto cufail; - } - /* now link the two structures so that no one else will */ - /* come here */ - /* store the terms to visit */ - if (RATIONAL_TREES || pt0 < pt0_end) { - to_visit --; + if (!IsApplTerm(d1)) { + goto cufail; + } + /* store the terms to visit */ + ap2 = RepAppl(d0); + ap3 = RepAppl(d1); + f = (Functor) (*ap2); + /* compare functors */ + if (f != (Functor) *ap3) + goto cufail; + if (IsExtensionFunctor(f)) { + if (unify_extension(f, d0, ap2, d1)) + continue; + goto cufail; + } + /* now link the two structures so that no one else will */ + /* come here */ + /* store the terms to visit */ + if (RATIONAL_TREES || pt0 < pt0_end) { + to_visit --; #ifdef RATIONAL_TREES - unif++; + unif++; #endif - if ((void *)to_visit < (void *)unif) { - CELL **urec = (CELL **)unif; - to_visit = (struct v_record *)Yap_shift_visit((CELL **)to_visit, &urec, NULL); - unif = (struct unif_record *)urec; - } - to_visit->start0 = pt0; - to_visit->end0 = pt0_end; - to_visit->start1 = pt1; + if ((void *)to_visit < (void *)unif) { + CELL **urec = (CELL **)unif; + to_visit = (struct v_record *)Yap_shift_visit((CELL **)to_visit, &urec, NULL); + unif = (struct unif_record *)urec; + } + to_visit->start0 = pt0; + to_visit->end0 = pt0_end; + to_visit->start1 = pt1; #ifdef RATIONAL_TREES - unif[-1].old = *pt0; - unif[-1].ptr = pt0; - *pt0 = d1; + unif[-1].old = *pt0; + unif[-1].ptr = pt0; + *pt0 = d1; #endif - } - d0 = ArityOfFunctor(f); - pt0 = ap2; - pt0_end = ap2 + d0; - pt1 = ap3; - continue; + } + d0 = ArityOfFunctor(f); + pt0 = ap2; + pt0_end = ap2 + d0; + pt1 = ap3; + continue; } goto cufail; derefa_body(d1, ptd1, iequ_comp_nvar_unk, iequ_comp_nvar_nvar); - /* d1 and pt2 have the unbound value, whereas d0 is bound */ + /* d1 and pt2 have the unbound value, whereas d0 is bound */ goto cufail; } @@ -1459,7 +2041,7 @@ loop: derefa_body(d1, ptd1, iequ_comp_var_unk, iequ_comp_var_nvar); /* pt2 and pt3 are unbound */ if (ptd0 == ptd1) - continue; + continue; goto cufail; } @@ -1483,7 +2065,7 @@ loop: #endif return TRUE; -cufail: + cufail: #ifdef RATIONAL_TREES /* restore bindigs */ while (unif-- != unif_base) { @@ -1535,15 +2117,15 @@ Yap_regtoregno(wamreg reg) } #ifdef DEPTH_LIMIT -#define check_depth(DEPTH, ap) \ - if ((DEPTH) <= MkIntTerm(1)) {/* I assume Module==0 is prolog */ \ - if ((ap)->ModuleOfPred) {\ - if ((DEPTH) == MkIntTerm(0))\ - FAIL(); \ - else (DEPTH) = RESET_DEPTH();\ - } \ - } else if ((ap)->ModuleOfPred)\ - (DEPTH) -= MkIntConstant(2); +#define check_depth(DEPTH, ap) \ + if ((DEPTH) <= MkIntTerm(1)) {/* I assume Module==0 is prolog */ \ + if ((ap)->ModuleOfPred) { \ + if ((DEPTH) == MkIntTerm(0)) \ + { FAIL(); } \ + else (DEPTH) = RESET_DEPTH(); \ + } \ + } else if ((ap)->ModuleOfPred) \ + (DEPTH) -= MkIntConstant(2); #else #define check_depth(DEPTH, ap) #endif @@ -1552,31 +2134,32 @@ Yap_regtoregno(wamreg reg) #define copy_jmp_address(X) (PREG_ADDR = &(X)) #define copy_jmp_addressa(X) (PREG_ADDR = (yamop **)(X)) #else -#define copy_jmp_address(X) -#define copy_jmp_addressa(X) +#define copy_jmp_address(X) +#define copy_jmp_addressa(X) #endif static inline void -prune(choiceptr cp USES_REGS) +prune(choiceptr cp) { + CACHE_REGS #ifdef YAPOR - CUT_prune_to(cp); + CUT_prune_to(cp); #endif /* YAPOR */ if (SHOULD_CUT_UP_TO(B,cp)) { if (ASP > (CELL *)PROTECT_FROZEN_B(B)) - ASP = (CELL *)PROTECT_FROZEN_B(B); + ASP = (CELL *)PROTECT_FROZEN_B(B); while (B->cp_b < cp) { - if (POP_CHOICE_POINT(B->cp_b)) - { - POP_EXECUTE(); - } - B = B->cp_b; + if (POP_CHOICE_POINT(B->cp_b)) + { + POP_EXECUTE(); + } + B = B->cp_b; } if (POP_CHOICE_POINT(B->cp_b)) - { - POP_EXECUTE(); - } + { + POP_EXECUTE(); + } /* cut ! */ #ifdef TABLING abolish_incomplete_subgoals(B); @@ -1595,41 +2178,81 @@ prune(choiceptr cp USES_REGS) #endif /* l1: bind a, l2 bind b, l3 no binding */ -#define UnifyAndTrailCells(a, b) \ - if((a) > (b)) { \ - if ((a) < HR) { *(a) = (CELL)(b); DO_TRAIL((a),(CELL)(b)); } \ - else if ((b) <= HR) { *(a) =(CELL)(b); DO_TRAIL((a),(CELL)(b));} \ - else { *(b) = (CELL)(a); DO_TRAIL((b),(CELL)(a)); } \ - } else if((a) < (b)){ \ - if ((b) <= HR) { *(b) = (CELL)(a); DO_TRAIL((b),(CELL)(a)); } \ - else if ((a) <= HR) { *(b) = (CELL) (a); DO_TRAIL((b),(CELL)(a));} \ - else { *(a) = (CELL) (b); DO_TRAIL((a),(CELL)(b));} \ - } +#define UnifyAndTrailCells(a, b) \ + if((a) > (b)) { \ + if ((a) < HR) { *(a) = (CELL)(b); DO_TRAIL((a),(CELL)(b)); } \ + else if ((b) <= HR) { *(a) =(CELL)(b); DO_TRAIL((a),(CELL)(b));} \ + else { *(b) = (CELL)(a); DO_TRAIL((b),(CELL)(a)); } \ + } else if((a) < (b)){ \ + if ((b) <= HR) { *(b) = (CELL)(a); DO_TRAIL((b),(CELL)(a)); } \ + else if ((a) <= HR) { *(b) = (CELL) (a); DO_TRAIL((b),(CELL)(a));} \ + else { *(a) = (CELL) (b); DO_TRAIL((a),(CELL)(b));} \ + } -#ifdef SHADOW_S -#define PROCESS_INT( F, C ) \ - BEGD(d0); \ - Yap_REGS.S_ = SREG; \ - saveregs(); \ - d0 = F ( PASS_REGS1 );\ - setregs(); \ - SREG = Yap_REGS.S_; \ - if (!d0) FAIL(); \ - PP = NULL;\ - if (d0 == 2) goto C; \ - JMPNext(); \ - ENDD(d0); -#else -#define PROCESS_INT( F, C ) \ - BEGD(d0); \ - saveregs(); \ - d0 = F ( PASS_REGS1 );\ - setregs(); \ - PP = NULL;\ - if (!d0) FAIL(); \ - if (d0 == 2) goto C; \ - JMPNext(); \ - ENDD(d0); +#define CHECK_ALARM(CONT) + +#include +#include + +extern Environment ExpEnv; +extern char fin[1024]; + +#if YAP_JIT +#ifndef _NATIVE +#ifndef __cplusplus + +#include +#include "JIT_Compiler.hpp" + +struct JIT_Compiler *J; + +NativeContext *NativeArea; +IntermediatecodeContext *IntermediatecodeArea; +void* call_JIT_Compiler(struct JIT_Compiler*, yamop*); +void shutdown_llvm(void); + +CELL l; +short global; +CELL nnexec; +yamop* HEADPREG; +CELL BLOCK; +CELL BLOCKADDRESS; +CELL FAILED; + +#endif #endif +TraceContext **curtrace; +yamop *curpreg; +BlocksContext **globalcurblock; +COUNT ineedredefinedest; +yamop* headoftrace; + +#endif /* YAP_JIT */ + +#ifdef SHADOW_S +#define PROCESS_INT( F, C ) \ + BEGD(d0); \ + Yap_REGS.S_ = SREG; \ + saveregs(); \ + d0 = F ( PASS_REGS1 ); \ + setregs(); \ + SREG = Yap_REGS.S_; \ + if (!d0) FAIL(); \ + PP = NULL; \ + if (d0 == 2) goto C; \ + JMPNext(); \ + ENDD(d0); +#else +#define PROCESS_INT( F, C ) \ + BEGD(d0); \ + saveregs(); \ + d0 = F ( PASS_REGS1 ); \ + setregs(); \ + PP = NULL; \ + if (!d0) FAIL(); \ + if (d0 == 2) goto C; \ + JMPNext(); \ + ENDD(d0); +#endif diff --git a/H/amidefs.h b/H/amidefs.h index 8c76c78fd..318b4f45d 100644 --- a/H/amidefs.h +++ b/H/amidefs.h @@ -97,7 +97,6 @@ typedef Int (*CPredicate)(CACHE_TYPE1); typedef Int (*CmpPredicate)(Term, Term); - #define OpRegSize sizeof(OPREG) /* @@ -112,6 +111,7 @@ typedef OPREG wamreg; typedef OPREG yslot; typedef OPREG COUNT; +#include "amijit.h" /* This is a table with the codes for YAP instructions @@ -223,7 +223,6 @@ typedef enum { #endif #define OpCodeSize sizeof(OPCODE) - /* Types of possible YAAM instructions. @@ -237,6 +236,7 @@ typedef enum { d: double (functor + unaligned double) f: functor F: Function, CPredicate + J: JIT interface i: large integer (functor + long) I: logic upd index (struct logic_upd_index *) l: label, yamop * @@ -261,6 +261,10 @@ typedef enum { */ typedef struct yami { OPCODE opc; +#if YAP_JIT + CELL next_native_r; + CELL next_native_w; +#endif union { struct { CELL next; @@ -361,16 +365,12 @@ typedef struct yami { CELL next; } Otapl; struct { - /* call counter */ - COUNT n; - /* native code pointer */ - CPredicate native; - /* next instruction to execute after native code if the predicate was not fully compiled */ - struct yami *native_next; - /* Pointer to pred */ - struct pred_entry *p; - CELL next; - } aFlp; + /* jit_handler */ +#if YAP_JIT + JitHandlContext *jh; +#endif + CELL next; + } J; /* The next two instructions are twin: they both correspond to the old ldd. */ /* The first one, aLl, handles try_logical and retry_logical, */ /* Ill handles trust_logical. */ diff --git a/H/amiops.h b/H/amiops.h index 6614be50f..8b251d6b8 100644 --- a/H/amiops.h +++ b/H/amiops.h @@ -36,12 +36,35 @@ Dereferencing macros /* For DEREFD, D has both the input and the exit argument */ /* A is only used locally */ +#define profiled_deref_head_TEST(D,Label) \ + if (IsVarTerm(D)) { \ + if (!strcmp(#D, "d0")) { EMIT_CONDITIONAL_SUCCESS("IsVarTerm(d0)"); } \ + else if (!strcmp(#D, "d1")) { EMIT_CONDITIONAL_SUCCESS("IsVarTerm(d1)"); } \ + goto Label; \ + } \ + if (!strcmp(#D, "d0")) { EMIT_CONDITIONAL_FAIL("IsVarTerm(d0)"); } \ + else if (!strcmp(#D, "d1")) { EMIT_CONDITIONAL_FAIL("IsVarTerm(d1)"); } + #define deref_head(D,Label) if (IsVarTerm(D)) goto Label +#define profiled_deref_body(D,A,LabelUnk,LabelNonVar) \ + do { \ + if(!IsVarTerm(D)) goto LabelNonVar; \ +LabelUnk: \ + (A) = (CELL *)(D); \ + (D) = *(CELL *)(D); \ + if (!strcmp(#D, "d0") && !strcmp(#A, "pt0")) { EMIT_SIMPLE_BLOCK_TEST(YAAM_DEREF_BODY_D0PT0); } \ + else if (!strcmp(#D, "d0") && !strcmp(#A, "pt1")) { EMIT_SIMPLE_BLOCK_TEST(YAAM_DEREF_BODY_D0PT1); } \ + else if (!strcmp(#D, "d0") && !strcmp(#A, "S_SREG")) { EMIT_SIMPLE_BLOCK_TEST(YAAM_DEREF_BODY_D0S_SREG); } \ + else if (!strcmp(#D, "d1") && !strcmp(#A, "pt0")) { EMIT_SIMPLE_BLOCK_TEST(YAAM_DEREF_BODY_D1PT0); } \ + else if (!strcmp(#D, "d1") && !strcmp(#A, "pt1")) { EMIT_SIMPLE_BLOCK_TEST(YAAM_DEREF_BODY_D1PT1); } \ +} while (Unsigned(A) != (D)); + + #define deref_body(D,A,LabelUnk,LabelNonVar) \ - do { \ + do { \ if(!IsVarTerm(D)) goto LabelNonVar; \ - LabelUnk: \ + LabelUnk: \ (A) = (CELL *)(D); \ (D) = *(CELL *)(D); \ } while (Unsigned(A) != (D)) @@ -58,12 +81,26 @@ Dereferencing macros } while (Unsigned(A) != (D));\ LabelDone: +#define profiled_derefa_body(D,A,LabelUnk,LabelNonVar) \ + do { \ + (A) = (CELL *)(D); \ + (D) = *(CELL *)(D); \ + if (!strcmp(#D, "d0") && !strcmp(#A, "pt0")) { EMIT_SIMPLE_BLOCK_TEST(YAAM_DEREF_BODY_D0PT0); } \ + else if (!strcmp(#D, "d0") && !strcmp(#A, "pt1")) { EMIT_SIMPLE_BLOCK_TEST(YAAM_DEREF_BODY_D0PT1); } \ + else if (!strcmp(#D, "d0") && !strcmp(#A, "S_SREG")) { EMIT_SIMPLE_BLOCK_TEST(YAAM_DEREF_BODY_D0S_SREG); } \ + else if (!strcmp(#D, "d1") && !strcmp(#A, "pt0")) { EMIT_SIMPLE_BLOCK_TEST(YAAM_DEREF_BODY_D1PT0); } \ + else if (!strcmp(#D, "d1") && !strcmp(#A, "pt1")) { EMIT_SIMPLE_BLOCK_TEST(YAAM_DEREF_BODY_D1PT1); } \ + if(!IsVarTerm(D)) goto LabelNonVar; \ + LabelUnk: ; \ + } while (Unsigned(A) != (D)); + + #define derefa_body(D,A,LabelUnk,LabelNonVar) \ - do { \ + do { \ (A) = (CELL *)(D); \ (D) = *(CELL *)(D); \ if(!IsVarTerm(D)) goto LabelNonVar; \ - LabelUnk: ; \ + LabelUnk: ; \ } while (Unsigned(A) != (D)) #if UNIQUE_TAG_FOR_PAIRS @@ -103,12 +140,12 @@ A contains the address of the variable that is to be trailed #ifdef TABLING #define DO_TRAIL(TERM, VAL) \ -{ \ - register tr_fr_ptr r; \ - r = TR; \ - TR = r + 1; \ - TrailTerm(r) = (Term) (TERM); \ - TrailVal(r) = (CELL) (VAL); \ + { \ + tr_fr_ptr r; \ + r = TR; \ + TR = r + 1; \ + TrailTerm(r) = (Term) (TERM); \ + TrailVal(r) = (CELL) (VAL); \ } #ifdef BFZ_TRAIL_SCHEME @@ -157,7 +194,7 @@ A contains the address of the variable that is to be trailed #define DO_TRAIL(A,D) \ { \ - register tr_fr_ptr r; \ + tr_fr_ptr r; \ r = TR; \ TR = r+1; \ TrailTerm(r) = (CELL)(A); \ @@ -253,11 +290,11 @@ extern void Yap_WakeUp(CELL *v); #define Bind_Local(A,D) { TRAIL_LOCAL(A,D); *(A) = (D); } #define Bind_Global(A,D) { *(A) = (D); if (__builtin_expect(GlobalIsAttVar(A),0)) Yap_WakeUp(A); else TRAIL_GLOBAL(A,D); } -#define YapBind(A,D) { *(A) = (D); if (A < HR) { if (__builtin_expect(GlobalIsAttVar(A),0)) Yap_WakeUp(A); else TRAIL_GLOBAL(A,D); } else { TRAIL_LOCAL(A,D); } } +#define YapBind(A,D) { *(A) = (D); if (A < HR) { if (__builtin_expect(GlobalIsAttVar(A),0)) Yap_WakeUp(A); else TRAIL_GLOBAL(A,D); } else { TRAIL_LOCAL(A,D); } } #define Bind_NonAtt(A,D) { *(A) = (D); TRAIL(A,D); } #define Bind_Global_NonAtt(A,D) { *(A) = (D); TRAIL_GLOBAL(A,D); } #define Bind_and_Trail(A,D) { *(A) = (D); DO_TRAIL(A, D); } - +#define Bind(A,D) YapBind(A,D) #define MaBind(VP,D) { MATRAIL((VP),*(VP),(D)); *(VP) = (D); } @@ -353,10 +390,10 @@ Int Yap_unify(Term t0, Term t1) } } -EXTERN Int Yap_unify_constant(Term a, Term cons); +INLINE_ONLY EXTERN inline Int Yap_unify_constant(Term a, Term cons); -EXTERN inline Int -Yap_unify_constant(register Term a, register Term cons) +INLINE_ONLY EXTERN inline Int +Yap_unify_constant(Term a, Term cons) { CACHE_REGS CELL *pt; diff --git a/H/dlocals.h b/H/dlocals.h index 7ee85a0b1..2f7120d6c 100644 --- a/H/dlocals.h +++ b/H/dlocals.h @@ -250,13 +250,8 @@ #define REMOTE_ErrorMessage(wid) REMOTE(wid)->ErrorMessage_ #define LOCAL_Error_Term LOCAL->Error_Term_ #define REMOTE_Error_Term(wid) REMOTE(wid)->Error_Term_ -#ifdef THREADS #define LOCAL_Error_TYPE LOCAL->Error_TYPE_ #define REMOTE_Error_TYPE(wid) REMOTE(wid)->Error_TYPE_ -#else -#define LOCAL_Error_TYPE LOCAL->Error_TYPE_ -#define REMOTE_Error_TYPE(wid) REMOTE(wid)->Error_TYPE_ -#endif #define LOCAL_Error_Size LOCAL->Error_Size_ #define REMOTE_Error_Size(wid) REMOTE(wid)->Error_Size_ #define LOCAL_ErrorSay LOCAL->ErrorSay_ diff --git a/H/findclause.h b/H/findclause.h index ba97357fa..365513a18 100644 --- a/H/findclause.h +++ b/H/findclause.h @@ -9,6 +9,11 @@ case _write_dbterm: cl = NEXTOP(cl,D); break; +#ifdef YAP_JIT + case _jit_handler: +#endif + cl = NEXTOP(cl,J); + break; case _alloc_for_logical_pred: cl = NEXTOP(cl,L); break; @@ -18,9 +23,6 @@ case _ensure_space: cl = NEXTOP(cl,Osbpa); break; - case _native_me: - cl = NEXTOP(cl,aFlp); - break; case _write_atom: cl = NEXTOP(cl,c); break; @@ -287,6 +289,9 @@ return; cl = NEXTOP(cl,e); break; + case _unlock_lu: + cl = NEXTOP(cl,e); + break; case _write_l_list: cl = NEXTOP(cl,e); break; @@ -625,9 +630,6 @@ case _lock_lu: cl = NEXTOP(cl,p); break; - case _unlock_lu: - cl = NEXTOP(cl,e); - break; case _call_bfunc_xx: cl = NEXTOP(cl,plxxs); break; @@ -1531,6 +1533,12 @@ cl = NEXTOP(cl,Otapl); break; #endif +#ifdef YAP_JIT +#ifdef YAPOR +#endif +#ifdef TABLING +#endif +#endif default: clause->Tag = (CELL)NULL; return; diff --git a/H/headclause.h b/H/headclause.h index 7d8b68153..2e87bc391 100644 --- a/H/headclause.h +++ b/H/headclause.h @@ -6,14 +6,13 @@ while (TRUE) { op_numbers op = Yap_op_from_opcode(cl->opc); switch (op) { +#ifdef YAP_JIT + case _jit_handler: +#endif + cl = NEXTOP(cl,J); + break; case _ensure_space: - cl = NEXTOP(cl,Osbpa); - break; - case _unlock_lu: - cl = NEXTOP(cl,e); - break; - case _native_me: - cl = NEXTOP(cl,aFlp); + cl = NEXTOP(cl,Osbpa); break; case _get_2atoms: if (iarg == Yap_regnotoreg(1)) { @@ -224,7 +223,7 @@ CELL *pt = RepAppl(t); clause->Tag = AbsAppl((CELL *)pt[0]); - if (IsExtensionFunctor(FunctorOfTerm(t))) { + if (IsExtensionFunctor(FunctorOfTerm(t))) { clause->ucd.t_ptr = t; } else { clause->ucd.c_sreg = pt; @@ -259,7 +258,7 @@ CELL *pt = RepAppl(t); clause->Tag = AbsAppl((CELL *)pt[0]); - if (IsExtensionFunctor(FunctorOfTerm(t))) { + if (IsExtensionFunctor(FunctorOfTerm(t))) { clause->ucd.t_ptr = t; } else { clause->ucd.c_sreg = pt; @@ -277,6 +276,9 @@ return; cl = NEXTOP(cl,e); break; + case _unlock_lu: + cl = NEXTOP(cl,e); + break; case _unify_l_list: cl = NEXTOP(cl,o); break; @@ -812,6 +814,12 @@ cl = NEXTOP(cl,Otapl); break; #endif +#ifdef YAP_JIT +#ifdef YAPOR +#endif +#ifdef TABLING +#endif +#endif default: clause->Tag = (CELL)NULL; return; diff --git a/H/hlocals.h b/H/hlocals.h index 97e46b782..83b97fef0 100644 --- a/H/hlocals.h +++ b/H/hlocals.h @@ -140,11 +140,7 @@ typedef struct worker_local { ADDR TrailTop_; char* ErrorMessage_; Term Error_Term_; -#ifdef THREADS - Term Error_TYPE_; -#else yap_error_number Error_TYPE_; -#endif UInt Error_Size_; char ErrorSay_[MAX_ERROR_MSG_SIZE]; jmp_buf IOBotch_; diff --git a/H/ilocals.h b/H/ilocals.h index be24afb59..6a4629a9d 100755 --- a/H/ilocals.h +++ b/H/ilocals.h @@ -140,11 +140,7 @@ static void InitWorker(int wid) { -#ifdef THREADS -#else - -#endif diff --git a/H/pl-shared.h b/H/pl-shared.h index 6c40de49d..14c400b20 100755 --- a/H/pl-shared.h +++ b/H/pl-shared.h @@ -281,8 +281,8 @@ getUnknownModule(module_t m); #define clearPrologFlagMask(flag) clear(&LD->prolog_flag.mask, flag) #ifndef YAP_CPP_INTERFACE -COMMON(int) debugmode(debug_type new, debug_type *old); -COMMON(int) tracemode(debug_type new, debug_type *old); +COMMON(int) debugmode(debug_type newp, debug_type *old); +COMMON(int) tracemode(debug_type newp, debug_type *old); #endif COMMON(void) Yap_setCurrentSourceLocation( void *rd ); diff --git a/H/rclause.h b/H/rclause.h index b7061f0ce..454732372 100644 --- a/H/rclause.h +++ b/H/rclause.h @@ -2,11 +2,6 @@ /* This file was generated automatically by "yap -L misc/buildops" please do not update */ -//#define DEBUG_RESTORE2 1 -#if DEBUG_RESTORE2 -static volatile yamop *cur_opc; -static volatile op_numbers cur_op; -#endif static void restore_opcodes(yamop *pc, yamop *max USES_REGS) @@ -14,18 +9,11 @@ restore_opcodes(yamop *pc, yamop *max USES_REGS) yamop *opc = NULL; do { op_numbers op; - if (max && pc >= max) { -#ifdef DEBUG_RESTORE2 - fprintf(stderr, "\n"); -#endif - return; - } + if (max && pc >= max) return; op = Yap_op_from_opcode(pc->opc); pc->opc = Yap_opcode(op); #ifdef DEBUG_RESTORE2 - cur_op = op; - cur_opc = pc; - fprintf(stderr, "%s\n", Yap_op_names[op]); + fprintf(stderr, "%s ", Yap_op_names[op]); #endif switch (op) { /* instructions type D */ @@ -43,6 +31,10 @@ restore_opcodes(yamop *pc, yamop *max USES_REGS) opc = NEXTOP(pc,Illss); pc = pc->y_u.Illss.l1; break; + /* instructions type J */ +#ifdef YAP_JIT + case _jit_handler: +#endif /* instructions type L */ case _alloc_for_logical_pred: pc->y_u.L.ClBase = PtoLUClauseAdjust(pc->y_u.L.ClBase); @@ -156,14 +148,6 @@ restore_opcodes(yamop *pc, yamop *max USES_REGS) pc->y_u.Otapl.d = PtoOpAdjust(pc->y_u.Otapl.d); pc = NEXTOP(pc,Otapl); break; - /* instructions type aFlp */ - case _native_me: - pc->y_u.aFlp.n = ArityAdjust(pc->y_u.aFlp.n); - pc->y_u.aFlp.native = ExternalFunctionAdjust(pc->y_u.aFlp.native); - pc->y_u.aFlp.native_next = PtoOpAdjust(pc->y_u.aFlp.native_next); - pc->y_u.aFlp.p = PtoPredAdjust(pc->y_u.aFlp.p); - pc = NEXTOP(pc,aFlp); - break; /* instructions type c */ case _write_atom: pc->y_u.c.c = ConstantTermAdjust(pc->y_u.c.c); @@ -251,12 +235,7 @@ restore_opcodes(yamop *pc, yamop *max USES_REGS) case _write_l_list: case _write_list: case _write_void: - if (op == _Nstop || op == _copy_idb_term || op == _unify_idb_term){ -#ifdef DEBUG_RESTORE2 - fprintf(stderr, "\n"); -#endif - return; - } + if (op == _Nstop || op == _copy_idb_term || op == _unify_idb_term) return; pc = NEXTOP(pc,e); break; /* instructions type fa */ @@ -287,12 +266,7 @@ restore_opcodes(yamop *pc, yamop *max USES_REGS) case _try_clause4: case _try_in: pc->y_u.l.l = PtoOpAdjust(pc->y_u.l.l); - if (op == _Ystop) { -#ifdef DEBUG_RESTORE2 - fprintf(stderr, "\n"); -#endif - return; - } + if (op == _Ystop) return; pc = NEXTOP(pc,l); break; /* instructions type llll */ @@ -854,12 +828,7 @@ restore_opcodes(yamop *pc, yamop *max USES_REGS) break; /* instructions type e */ case _getwork_first_time: - if (op == _Nstop || op == _copy_idb_term || op == _unify_idb_term) { -#ifdef DEBUG_RESTORE2 - fprintf(stderr, "\n"); -#endif - return; - } + if (op == _Nstop || op == _copy_idb_term || op == _unify_idb_term) return; pc = NEXTOP(pc,e); break; #endif @@ -890,12 +859,7 @@ restore_opcodes(yamop *pc, yamop *max USES_REGS) #ifdef TABLING_INNER_CUTS case _clause_with_cut: #endif - if (op == _Nstop || op == _copy_idb_term || op == _unify_idb_term) { -#ifdef DEBUG_RESTORE2 - fprintf(stderr, "\n"); -#endif - return; - } + if (op == _Nstop || op == _copy_idb_term || op == _unify_idb_term) return; pc = NEXTOP(pc,e); break; /* instructions type s */ @@ -968,16 +932,908 @@ restore_opcodes(yamop *pc, yamop *max USES_REGS) case _trie_try_val_in_pair: case _trie_try_var: case _trie_try_var_in_pair: - if (op == _Nstop || op == _copy_idb_term || op == _unify_idb_term) { -#ifdef DEBUG_RESTORE2 - fprintf(stderr, "\n"); -#endif - return; - } + if (op == _Nstop || op == _copy_idb_term || op == _unify_idb_term) return; pc = NEXTOP(pc,e); break; +#endif +#ifdef YAP_JIT + /* instructions type D */ + case _traced_write_dbterm: + pc->y_u.D.D = DBGroundTermAdjust(pc->y_u.D.D); + pc = NEXTOP(pc,D); + break; + /* instructions type Illss */ + case _traced_enter_lu_pred: + pc->y_u.Illss.I = PtoLUIndexAdjust(pc->y_u.Illss.I); + pc->y_u.Illss.l1 = PtoOpAdjust(pc->y_u.Illss.l1); + pc->y_u.Illss.l2 = PtoOpAdjust(pc->y_u.Illss.l2); + pc->y_u.Illss.s = ConstantAdjust(pc->y_u.Illss.s); + pc->y_u.Illss.e = ConstantAdjust(pc->y_u.Illss.e); + opc = NEXTOP(pc,Illss); + pc = pc->y_u.Illss.l1; + break; + /* instructions type J */ + case _traced_jit_handler: + /* instructions type L */ + case _traced_alloc_for_logical_pred: + pc->y_u.L.ClBase = PtoLUClauseAdjust(pc->y_u.L.ClBase); + pc = NEXTOP(pc,L); + break; + /* instructions type N */ + case _traced_write_bigint: + pc->y_u.N.b = BlobTermInCodeAdjust(pc->y_u.N.b); + pc = NEXTOP(pc,N); + break; + /* instructions type Osblp */ + case _traced_either: + case _traced_or_else: + OrArgAdjust(pc->y_u.Osblp.or_arg); + pc->y_u.Osblp.s = ConstantAdjust(pc->y_u.Osblp.s); + pc->y_u.Osblp.bmap = CellPtoHeapAdjust(pc->y_u.Osblp.bmap); + pc->y_u.Osblp.l = PtoOpAdjust(pc->y_u.Osblp.l); + pc->y_u.Osblp.p0 = PtoPredAdjust(pc->y_u.Osblp.p0); + pc = NEXTOP(pc,Osblp); + break; + /* instructions type Osbmp */ + case _traced_p_execute: + case _traced_p_execute_tail: + OrArgAdjust(pc->y_u.Osbmp.or_arg); + pc->y_u.Osbmp.s = ConstantAdjust(pc->y_u.Osbmp.s); + pc->y_u.Osbmp.bmap = CellPtoHeapAdjust(pc->y_u.Osbmp.bmap); + pc->y_u.Osbmp.mod = ModuleAdjust(pc->y_u.Osbmp.mod); + pc->y_u.Osbmp.p0 = PtoPredAdjust(pc->y_u.Osbmp.p0); + pc = NEXTOP(pc,Osbmp); + break; + /* instructions type Osbpa */ + case _traced_ensure_space: + OrArgAdjust(pc->y_u.Osbpa.or_arg); + pc->y_u.Osbpa.s = ConstantAdjust(pc->y_u.Osbpa.s); + pc->y_u.Osbpa.bmap = CellPtoHeapAdjust(pc->y_u.Osbpa.bmap); + pc->y_u.Osbpa.p = PtoPredAdjust(pc->y_u.Osbpa.p); + pc->y_u.Osbpa.i = ArityAdjust(pc->y_u.Osbpa.i); + pc = NEXTOP(pc,Osbpa); + break; + /* instructions type Osbpp */ + case _traced_call: + case _traced_call_cpred: + case _traced_call_usercpred: + case _traced_fcall: + case _traced_p_execute2: + OrArgAdjust(pc->y_u.Osbpp.or_arg); + pc->y_u.Osbpp.s = ConstantAdjust(pc->y_u.Osbpp.s); + pc->y_u.Osbpp.bmap = CellPtoHeapAdjust(pc->y_u.Osbpp.bmap); + pc->y_u.Osbpp.p = PtoPredAdjust(pc->y_u.Osbpp.p); + pc->y_u.Osbpp.p0 = PtoPredAdjust(pc->y_u.Osbpp.p0); + pc = NEXTOP(pc,Osbpp); + break; + /* instructions type OtILl */ + case _traced_count_trust_logical: + case _traced_profiled_trust_logical: + case _traced_trust_logical: + OrArgAdjust(pc->y_u.OtILl.or_arg); + TabEntryAdjust(pc->y_u.OtILl.te); + pc->y_u.OtILl.block = PtoLUIndexAdjust(pc->y_u.OtILl.block); + pc->y_u.OtILl.d = PtoLUClauseAdjust(pc->y_u.OtILl.d); + pc->y_u.OtILl.n = PtoOpAdjust(pc->y_u.OtILl.n); + pc = opc; + break; + /* instructions type OtaLl */ + case _traced_count_retry_logical: + case _traced_profiled_retry_logical: + case _traced_retry_logical: + case _traced_try_logical: + OrArgAdjust(pc->y_u.OtaLl.or_arg); + TabEntryAdjust(pc->y_u.OtaLl.te); + pc->y_u.OtaLl.s = ArityAdjust(pc->y_u.OtaLl.s); + pc->y_u.OtaLl.d = PtoLUClauseAdjust(pc->y_u.OtaLl.d); + pc->y_u.OtaLl.n = PtoOpAdjust(pc->y_u.OtaLl.n); + pc = pc->y_u.OtaLl.n; + break; + /* instructions type OtapFs */ + case _traced_cut_c: + case _traced_cut_userc: + case _traced_retry_c: + case _traced_retry_userc: + case _traced_try_c: + case _traced_try_userc: + OrArgAdjust(pc->y_u.OtapFs.or_arg); + TabEntryAdjust(pc->y_u.OtapFs.te); + pc->y_u.OtapFs.s = ArityAdjust(pc->y_u.OtapFs.s); + pc->y_u.OtapFs.p = PtoPredAdjust(pc->y_u.OtapFs.p); + pc->y_u.OtapFs.f = ExternalFunctionAdjust(pc->y_u.OtapFs.f); + pc->y_u.OtapFs.extra = ConstantAdjust(pc->y_u.OtapFs.extra); + pc = NEXTOP(pc,OtapFs); + break; + /* instructions type Otapl */ + case _traced_count_retry_and_mark: + case _traced_count_retry_me: + case _traced_count_trust_me: + case _traced_profiled_retry_and_mark: + case _traced_profiled_retry_me: + case _traced_profiled_trust_me: + case _traced_retry: + case _traced_retry_and_mark: + case _traced_retry_me: + case _traced_spy_or_trymark: + case _traced_trust: + case _traced_trust_me: + case _traced_try_and_mark: + case _traced_try_clause: + case _traced_try_me: + OrArgAdjust(pc->y_u.Otapl.or_arg); + TabEntryAdjust(pc->y_u.Otapl.te); + pc->y_u.Otapl.s = ArityAdjust(pc->y_u.Otapl.s); + pc->y_u.Otapl.p = PtoPredAdjust(pc->y_u.Otapl.p); + pc->y_u.Otapl.d = PtoOpAdjust(pc->y_u.Otapl.d); + pc = NEXTOP(pc,Otapl); + break; + /* instructions type c */ + case _traced_write_atom: + pc->y_u.c.c = ConstantTermAdjust(pc->y_u.c.c); + pc = NEXTOP(pc,c); + break; + /* instructions type cc */ + case _traced_get_2atoms: + pc->y_u.cc.c1 = ConstantTermAdjust(pc->y_u.cc.c1); + pc->y_u.cc.c2 = ConstantTermAdjust(pc->y_u.cc.c2); + pc = NEXTOP(pc,cc); + break; + /* instructions type ccc */ + case _traced_get_3atoms: + pc->y_u.ccc.c1 = ConstantTermAdjust(pc->y_u.ccc.c1); + pc->y_u.ccc.c2 = ConstantTermAdjust(pc->y_u.ccc.c2); + pc->y_u.ccc.c3 = ConstantTermAdjust(pc->y_u.ccc.c3); + pc = NEXTOP(pc,ccc); + break; + /* instructions type cccc */ + case _traced_get_4atoms: + pc->y_u.cccc.c1 = ConstantTermAdjust(pc->y_u.cccc.c1); + pc->y_u.cccc.c2 = ConstantTermAdjust(pc->y_u.cccc.c2); + pc->y_u.cccc.c3 = ConstantTermAdjust(pc->y_u.cccc.c3); + pc->y_u.cccc.c4 = ConstantTermAdjust(pc->y_u.cccc.c4); + pc = NEXTOP(pc,cccc); + break; + /* instructions type ccccc */ + case _traced_get_5atoms: + pc->y_u.ccccc.c1 = ConstantTermAdjust(pc->y_u.ccccc.c1); + pc->y_u.ccccc.c2 = ConstantTermAdjust(pc->y_u.ccccc.c2); + pc->y_u.ccccc.c3 = ConstantTermAdjust(pc->y_u.ccccc.c3); + pc->y_u.ccccc.c4 = ConstantTermAdjust(pc->y_u.ccccc.c4); + pc->y_u.ccccc.c5 = ConstantTermAdjust(pc->y_u.ccccc.c5); + pc = NEXTOP(pc,ccccc); + break; + /* instructions type cccccc */ + case _traced_get_6atoms: + pc->y_u.cccccc.c1 = ConstantTermAdjust(pc->y_u.cccccc.c1); + pc->y_u.cccccc.c2 = ConstantTermAdjust(pc->y_u.cccccc.c2); + pc->y_u.cccccc.c3 = ConstantTermAdjust(pc->y_u.cccccc.c3); + pc->y_u.cccccc.c4 = ConstantTermAdjust(pc->y_u.cccccc.c4); + pc->y_u.cccccc.c5 = ConstantTermAdjust(pc->y_u.cccccc.c5); + pc->y_u.cccccc.c6 = ConstantTermAdjust(pc->y_u.cccccc.c6); + pc = NEXTOP(pc,cccccc); + break; + /* instructions type clll */ + case _traced_if_not_then: + pc->y_u.clll.c = ConstantTermAdjust(pc->y_u.clll.c); + pc->y_u.clll.l1 = PtoOpAdjust(pc->y_u.clll.l1); + pc->y_u.clll.l2 = PtoOpAdjust(pc->y_u.clll.l2); + pc->y_u.clll.l3 = PtoOpAdjust(pc->y_u.clll.l3); + pc = NEXTOP(pc,clll); + break; + /* instructions type d */ + case _traced_write_float: + DoubleInCodeAdjust(pc->y_u.d.d); + pc = NEXTOP(pc,d); + break; + /* instructions type e */ + case _traced_Nstop: + case _traced_allocate: + case _traced_copy_idb_term: + case _traced_expand_index: + case _traced_index_blob: + case _traced_index_dbref: + case _traced_index_long: + case _traced_index_pred: + case _traced_lock_pred: + case _traced_op_fail: + case _traced_p_equal: + case _traced_p_functor: + case _traced_pop: + case _traced_retry_eam: + case _traced_spy_pred: + case _traced_thread_local: + case _traced_trust_fail: + case _traced_undef_p: + case _traced_unify_idb_term: + case _traced_unlock_lu: + case _traced_write_l_list: + case _traced_write_list: + case _traced_write_void: + if (op == _Nstop || op == _copy_idb_term || op == _unify_idb_term) return; + pc = NEXTOP(pc,e); + break; + /* instructions type fa */ + case _traced_write_l_struc: + case _traced_write_struct: + pc->y_u.fa.f = FuncAdjust(pc->y_u.fa.f); + pc->y_u.fa.a = ArityAdjust(pc->y_u.fa.a); + pc = NEXTOP(pc,fa); + break; + /* instructions type i */ + case _traced_write_longint: + IntegerInCodeAdjust(pc->y_u.i.i); + pc = NEXTOP(pc,i); + break; + /* instructions type l */ + case _traced_Ystop: + case _traced_jump: + case _traced_jump_if_var: + case _traced_move_back: + case _traced_p_dif: + case _traced_p_eq: + case _traced_retry2: + case _traced_retry3: + case _traced_retry4: + case _traced_skip: + case _traced_try_clause2: + case _traced_try_clause3: + case _traced_try_clause4: + case _traced_try_in: + pc->y_u.l.l = PtoOpAdjust(pc->y_u.l.l); + if (op == _Ystop) return; + pc = NEXTOP(pc,l); + break; + /* instructions type llll */ + case _traced_switch_on_type: + pc->y_u.llll.l1 = PtoOpAdjust(pc->y_u.llll.l1); + pc->y_u.llll.l2 = PtoOpAdjust(pc->y_u.llll.l2); + pc->y_u.llll.l3 = PtoOpAdjust(pc->y_u.llll.l3); + pc->y_u.llll.l4 = PtoOpAdjust(pc->y_u.llll.l4); + pc = NEXTOP(pc,llll); + break; + /* instructions type lp */ + case _traced_user_switch: + pc->y_u.lp.l = PtoOpAdjust(pc->y_u.lp.l); + pc->y_u.lp.p = PtoPredAdjust(pc->y_u.lp.p); + pc = NEXTOP(pc,lp); + break; + /* instructions type o */ + case _traced_unify_l_list: + case _traced_unify_l_list_write: + case _traced_unify_l_void: + case _traced_unify_l_void_write: + case _traced_unify_list: + case _traced_unify_list_write: + case _traced_unify_void: + case _traced_unify_void_write: + pc->y_u.o.opcw = OpcodeAdjust(pc->y_u.o.opcw); + pc = NEXTOP(pc,o); + break; + /* instructions type oD */ + case _traced_unify_dbterm: + case _traced_unify_l_dbterm: + pc->y_u.oD.opcw = OpcodeAdjust(pc->y_u.oD.opcw); + pc->y_u.oD.D = DBGroundTermAdjust(pc->y_u.oD.D); + pc = NEXTOP(pc,oD); + break; + /* instructions type oN */ + case _traced_unify_bigint: + case _traced_unify_l_bigint: + pc->y_u.oN.opcw = OpcodeAdjust(pc->y_u.oN.opcw); + pc->y_u.oN.b = BlobTermInCodeAdjust(pc->y_u.oN.b); + pc = NEXTOP(pc,oN); + break; + /* instructions type oc */ + case _traced_unify_atom: + case _traced_unify_atom_write: + case _traced_unify_l_atom: + case _traced_unify_l_atom_write: + pc->y_u.oc.opcw = OpcodeAdjust(pc->y_u.oc.opcw); + pc->y_u.oc.c = ConstantTermAdjust(pc->y_u.oc.c); + pc = NEXTOP(pc,oc); + break; + /* instructions type od */ + case _traced_unify_float: + case _traced_unify_float_write: + case _traced_unify_l_float: + case _traced_unify_l_float_write: + pc->y_u.od.opcw = OpcodeAdjust(pc->y_u.od.opcw); + DoubleInCodeAdjust(pc->y_u.od.d); + pc = NEXTOP(pc,od); + break; + /* instructions type ofa */ + case _traced_unify_l_struc: + case _traced_unify_l_struc_write: + case _traced_unify_struct: + case _traced_unify_struct_write: + pc->y_u.ofa.opcw = OpcodeAdjust(pc->y_u.ofa.opcw); + pc->y_u.ofa.f = FuncAdjust(pc->y_u.ofa.f); + pc->y_u.ofa.a = ArityAdjust(pc->y_u.ofa.a); + pc = NEXTOP(pc,ofa); + break; + /* instructions type oi */ + case _traced_unify_l_longint: + case _traced_unify_l_longint_write: + case _traced_unify_longint: + case _traced_unify_longint_write: + pc->y_u.oi.opcw = OpcodeAdjust(pc->y_u.oi.opcw); + IntegerInCodeAdjust(pc->y_u.oi.i); + pc = NEXTOP(pc,oi); + break; + /* instructions type ollll */ + case _traced_switch_list_nl: + pc->y_u.ollll.pop = OpcodeAdjust(pc->y_u.ollll.pop); + pc->y_u.ollll.l1 = PtoOpAdjust(pc->y_u.ollll.l1); + pc->y_u.ollll.l2 = PtoOpAdjust(pc->y_u.ollll.l2); + pc->y_u.ollll.l3 = PtoOpAdjust(pc->y_u.ollll.l3); + pc->y_u.ollll.l4 = PtoOpAdjust(pc->y_u.ollll.l4); + pc = NEXTOP(pc,ollll); + break; + /* instructions type os */ + case _traced_run_eam: + case _traced_unify_l_n_voids: + case _traced_unify_l_n_voids_write: + case _traced_unify_n_voids: + case _traced_unify_n_voids_write: + pc->y_u.os.opcw = OpcodeAdjust(pc->y_u.os.opcw); + pc->y_u.os.s = ConstantAdjust(pc->y_u.os.s); + pc = NEXTOP(pc,os); + break; + /* instructions type osc */ + case _traced_unify_n_atoms: + case _traced_unify_n_atoms_write: + pc->y_u.osc.opcw = OpcodeAdjust(pc->y_u.osc.opcw); + pc->y_u.osc.s = ConstantAdjust(pc->y_u.osc.s); + pc->y_u.osc.c = ConstantTermAdjust(pc->y_u.osc.c); + pc = NEXTOP(pc,osc); + break; + /* instructions type ox */ + case _traced_save_appl_x: + case _traced_save_appl_x_write: + case _traced_save_pair_x: + case _traced_save_pair_x_write: + case _traced_unify_l_x_loc: + case _traced_unify_l_x_loc_write: + case _traced_unify_l_x_val: + case _traced_unify_l_x_val_write: + case _traced_unify_l_x_var: + case _traced_unify_l_x_var_write: + case _traced_unify_x_loc: + case _traced_unify_x_loc_write: + case _traced_unify_x_val: + case _traced_unify_x_val_write: + case _traced_unify_x_var: + case _traced_unify_x_var_write: + pc->y_u.ox.opcw = OpcodeAdjust(pc->y_u.ox.opcw); + pc->y_u.ox.x = XAdjust(pc->y_u.ox.x); + pc = NEXTOP(pc,ox); + break; + /* instructions type oxx */ + case _traced_unify_l_x_var2: + case _traced_unify_l_x_var2_write: + case _traced_unify_x_var2: + case _traced_unify_x_var2_write: + pc->y_u.oxx.opcw = OpcodeAdjust(pc->y_u.oxx.opcw); + pc->y_u.oxx.xl = XAdjust(pc->y_u.oxx.xl); + pc->y_u.oxx.xr = XAdjust(pc->y_u.oxx.xr); + pc = NEXTOP(pc,oxx); + break; + /* instructions type oy */ + case _traced_save_appl_y: + case _traced_save_appl_y_write: + case _traced_save_pair_y: + case _traced_save_pair_y_write: + case _traced_unify_l_y_loc: + case _traced_unify_l_y_loc_write: + case _traced_unify_l_y_val: + case _traced_unify_l_y_val_write: + case _traced_unify_l_y_var: + case _traced_unify_l_y_var_write: + case _traced_unify_y_loc: + case _traced_unify_y_loc_write: + case _traced_unify_y_val: + case _traced_unify_y_val_write: + case _traced_unify_y_var: + case _traced_unify_y_var_write: + pc->y_u.oy.opcw = OpcodeAdjust(pc->y_u.oy.opcw); + pc->y_u.oy.y = YAdjust(pc->y_u.oy.y); + pc = NEXTOP(pc,oy); + break; + /* instructions type p */ + case _traced_count_call: + case _traced_count_retry: + case _traced_deallocate: + case _traced_enter_profiling: + case _traced_lock_lu: + case _traced_procceed: + case _traced_retry_profiled: + pc->y_u.p.p = PtoPredAdjust(pc->y_u.p.p); + pc = NEXTOP(pc,p); + break; + /* instructions type plxxs */ + case _traced_call_bfunc_xx: + pc->y_u.plxxs.p = PtoPredAdjust(pc->y_u.plxxs.p); + pc->y_u.plxxs.f = PtoOpAdjust(pc->y_u.plxxs.f); + pc->y_u.plxxs.x1 = XAdjust(pc->y_u.plxxs.x1); + pc->y_u.plxxs.x2 = XAdjust(pc->y_u.plxxs.x2); + pc->y_u.plxxs.flags = ConstantAdjust(pc->y_u.plxxs.flags); + pc = NEXTOP(pc,plxxs); + break; + /* instructions type plxys */ + case _traced_call_bfunc_xy: + case _traced_call_bfunc_yx: + pc->y_u.plxys.p = PtoPredAdjust(pc->y_u.plxys.p); + pc->y_u.plxys.f = PtoOpAdjust(pc->y_u.plxys.f); + pc->y_u.plxys.x = XAdjust(pc->y_u.plxys.x); + pc->y_u.plxys.y = YAdjust(pc->y_u.plxys.y); + pc->y_u.plxys.flags = ConstantAdjust(pc->y_u.plxys.flags); + pc = NEXTOP(pc,plxys); + break; + /* instructions type plyys */ + case _traced_call_bfunc_yy: + pc->y_u.plyys.p = PtoPredAdjust(pc->y_u.plyys.p); + pc->y_u.plyys.f = PtoOpAdjust(pc->y_u.plyys.f); + pc->y_u.plyys.y1 = YAdjust(pc->y_u.plyys.y1); + pc->y_u.plyys.y2 = YAdjust(pc->y_u.plyys.y2); + pc->y_u.plyys.flags = ConstantAdjust(pc->y_u.plyys.flags); + pc = NEXTOP(pc,plyys); + break; + /* instructions type pp */ + case _traced_dexecute: + case _traced_execute: + case _traced_execute_cpred: + pc->y_u.pp.p = PtoPredAdjust(pc->y_u.pp.p); + pc->y_u.pp.p0 = PtoPredAdjust(pc->y_u.pp.p0); + pc = NEXTOP(pc,pp); + break; + /* instructions type s */ + case _traced_cut: + case _traced_cut_e: + case _traced_cut_t: + case _traced_pop_n: + case _traced_write_n_voids: + pc->y_u.s.s = ConstantAdjust(pc->y_u.s.s); + pc = NEXTOP(pc,s); + break; + /* instructions type sc */ + case _traced_write_n_atoms: + pc->y_u.sc.s = ConstantAdjust(pc->y_u.sc.s); + pc->y_u.sc.c = ConstantTermAdjust(pc->y_u.sc.c); + pc = NEXTOP(pc,sc); + break; + /* instructions type sllll */ + case _traced_switch_on_sub_arg_type: + pc->y_u.sllll.s = ConstantAdjust(pc->y_u.sllll.s); + pc->y_u.sllll.l1 = PtoOpAdjust(pc->y_u.sllll.l1); + pc->y_u.sllll.l2 = PtoOpAdjust(pc->y_u.sllll.l2); + pc->y_u.sllll.l3 = PtoOpAdjust(pc->y_u.sllll.l3); + pc->y_u.sllll.l4 = PtoOpAdjust(pc->y_u.sllll.l4); + pc = NEXTOP(pc,sllll); + break; + /* instructions type slp */ + case _traced_call_c_wfail: + pc->y_u.slp.s = ConstantAdjust(pc->y_u.slp.s); + pc->y_u.slp.l = PtoOpAdjust(pc->y_u.slp.l); + pc->y_u.slp.p = PtoPredAdjust(pc->y_u.slp.p); + pc = NEXTOP(pc,slp); + break; + /* instructions type sssl */ + case _traced_go_on_cons: + case _traced_go_on_func: + case _traced_if_cons: + case _traced_if_func: + case _traced_switch_on_cons: + case _traced_switch_on_func: + pc->y_u.sssl.s = ConstantAdjust(pc->y_u.sssl.s); + pc->y_u.sssl.e = ConstantAdjust(pc->y_u.sssl.e); + pc->y_u.sssl.w = ConstantAdjust(pc->y_u.sssl.w); + pc->y_u.sssl.l = PtoOpAdjust(pc->y_u.sssl.l); + AdjustSwitchTable(op, pc->y_u.sssl.l, pc->y_u.sssl.s); + pc = NEXTOP(pc,sssl); + break; + /* instructions type sssllp */ + case _traced_expand_clauses: + pc->y_u.sssllp.s1 = ConstantAdjust(pc->y_u.sssllp.s1); + pc->y_u.sssllp.s2 = ConstantAdjust(pc->y_u.sssllp.s2); + pc->y_u.sssllp.s3 = ConstantAdjust(pc->y_u.sssllp.s3); + pc->y_u.sssllp.sprev = PtoOpAdjust(pc->y_u.sssllp.sprev); + pc->y_u.sssllp.snext = PtoOpAdjust(pc->y_u.sssllp.snext); + pc->y_u.sssllp.p = PtoPredAdjust(pc->y_u.sssllp.p); + pc = NEXTOP(pc,sssllp); + break; + /* instructions type x */ + case _traced_get_list: + case _traced_put_list: + case _traced_save_b_x: + case _traced_write_x_loc: + case _traced_write_x_val: + case _traced_write_x_var: + pc->y_u.x.x = XAdjust(pc->y_u.x.x); + pc = NEXTOP(pc,x); + break; + /* instructions type xD */ + case _traced_get_dbterm: + case _traced_put_dbterm: + pc->y_u.xD.x = XAdjust(pc->y_u.xD.x); + pc->y_u.xD.D = DBGroundTermAdjust(pc->y_u.xD.D); + pc = NEXTOP(pc,xD); + break; + /* instructions type xN */ + case _traced_get_bigint: + case _traced_put_bigint: + pc->y_u.xN.x = XAdjust(pc->y_u.xN.x); + pc->y_u.xN.b = BlobTermInCodeAdjust(pc->y_u.xN.b); + pc = NEXTOP(pc,xN); + break; + /* instructions type xc */ + case _traced_get_atom: + case _traced_put_atom: + pc->y_u.xc.x = XAdjust(pc->y_u.xc.x); + pc->y_u.xc.c = ConstantTermAdjust(pc->y_u.xc.c); + pc = NEXTOP(pc,xc); + break; + /* instructions type xd */ + case _traced_get_float: + case _traced_put_float: + pc->y_u.xd.x = XAdjust(pc->y_u.xd.x); + DoubleInCodeAdjust(pc->y_u.xd.d); + pc = NEXTOP(pc,xd); + break; + /* instructions type xfa */ + case _traced_get_struct: + case _traced_put_struct: + pc->y_u.xfa.x = XAdjust(pc->y_u.xfa.x); + pc->y_u.xfa.f = FuncAdjust(pc->y_u.xfa.f); + pc->y_u.xfa.a = ArityAdjust(pc->y_u.xfa.a); + pc = NEXTOP(pc,xfa); + break; + /* instructions type xi */ + case _traced_get_longint: + case _traced_put_longint: + pc->y_u.xi.x = XAdjust(pc->y_u.xi.x); + IntegerInCodeAdjust(pc->y_u.xi.i); + pc = NEXTOP(pc,xi); + break; + /* instructions type xl */ + case _traced_p_atom_x: + case _traced_p_atomic_x: + case _traced_p_compound_x: + case _traced_p_db_ref_x: + case _traced_p_float_x: + case _traced_p_integer_x: + case _traced_p_nonvar_x: + case _traced_p_number_x: + case _traced_p_primitive_x: + case _traced_p_var_x: + pc->y_u.xl.x = XAdjust(pc->y_u.xl.x); + pc->y_u.xl.F = PtoOpAdjust(pc->y_u.xl.F); + pc = NEXTOP(pc,xl); + break; + /* instructions type xll */ + case _traced_jump_if_nonvar: + pc->y_u.xll.x = XAdjust(pc->y_u.xll.x); + pc->y_u.xll.l1 = PtoOpAdjust(pc->y_u.xll.l1); + pc->y_u.xll.l2 = PtoOpAdjust(pc->y_u.xll.l2); + pc = NEXTOP(pc,xll); + break; + /* instructions type xllll */ + case _traced_switch_on_arg_type: + pc->y_u.xllll.x = XAdjust(pc->y_u.xllll.x); + pc->y_u.xllll.l1 = PtoOpAdjust(pc->y_u.xllll.l1); + pc->y_u.xllll.l2 = PtoOpAdjust(pc->y_u.xllll.l2); + pc->y_u.xllll.l3 = PtoOpAdjust(pc->y_u.xllll.l3); + pc->y_u.xllll.l4 = PtoOpAdjust(pc->y_u.xllll.l4); + pc = NEXTOP(pc,xllll); + break; + /* instructions type xps */ + case _traced_commit_b_x: + pc->y_u.xps.x = XAdjust(pc->y_u.xps.x); + pc->y_u.xps.p0 = PtoPredAdjust(pc->y_u.xps.p0); + pc->y_u.xps.s = ConstantAdjust(pc->y_u.xps.s); + pc = NEXTOP(pc,xps); + break; + /* instructions type xx */ + case _traced_get_x_val: + case _traced_get_x_var: + case _traced_gl_void_valx: + case _traced_gl_void_varx: + case _traced_glist_valx: + case _traced_put_x_val: + case _traced_put_x_var: + pc->y_u.xx.xl = XAdjust(pc->y_u.xx.xl); + pc->y_u.xx.xr = XAdjust(pc->y_u.xx.xr); + pc = NEXTOP(pc,xx); + break; + /* instructions type xxc */ + case _traced_p_func2s_cv: + pc->y_u.xxc.x = XAdjust(pc->y_u.xxc.x); + pc->y_u.xxc.xi = XAdjust(pc->y_u.xxc.xi); + pc->y_u.xxc.c = ConstantTermAdjust(pc->y_u.xxc.c); + pc = NEXTOP(pc,xxc); + break; + /* instructions type xxn */ + case _traced_p_and_vc: + case _traced_p_arg_cv: + case _traced_p_div_cv: + case _traced_p_div_vc: + case _traced_p_func2s_vc: + case _traced_p_minus_cv: + case _traced_p_or_vc: + case _traced_p_plus_vc: + case _traced_p_sll_cv: + case _traced_p_sll_vc: + case _traced_p_slr_cv: + case _traced_p_slr_vc: + case _traced_p_times_vc: + pc->y_u.xxn.x = XAdjust(pc->y_u.xxn.x); + pc->y_u.xxn.xi = XAdjust(pc->y_u.xxn.xi); + pc->y_u.xxn.c = IntegerAdjust(pc->y_u.xxn.c); + pc = NEXTOP(pc,xxn); + break; + /* instructions type xxx */ + case _traced_p_and_vv: + case _traced_p_arg_vv: + case _traced_p_div_vv: + case _traced_p_func2f_xx: + case _traced_p_func2s_vv: + case _traced_p_minus_vv: + case _traced_p_or_vv: + case _traced_p_plus_vv: + case _traced_p_sll_vv: + case _traced_p_slr_vv: + case _traced_p_times_vv: + pc->y_u.xxx.x = XAdjust(pc->y_u.xxx.x); + pc->y_u.xxx.x1 = XAdjust(pc->y_u.xxx.x1); + pc->y_u.xxx.x2 = XAdjust(pc->y_u.xxx.x2); + pc = NEXTOP(pc,xxx); + break; + /* instructions type xxxx */ + case _traced_put_xx_val: + pc->y_u.xxxx.xl1 = XAdjust(pc->y_u.xxxx.xl1); + pc->y_u.xxxx.xl2 = XAdjust(pc->y_u.xxxx.xl2); + pc->y_u.xxxx.xr1 = XAdjust(pc->y_u.xxxx.xr1); + pc->y_u.xxxx.xr2 = XAdjust(pc->y_u.xxxx.xr2); + pc = NEXTOP(pc,xxxx); + break; + /* instructions type xxy */ + case _traced_p_func2f_xy: + pc->y_u.xxy.x = XAdjust(pc->y_u.xxy.x); + pc->y_u.xxy.x1 = XAdjust(pc->y_u.xxy.x1); + pc->y_u.xxy.y2 = YAdjust(pc->y_u.xxy.y2); + pc = NEXTOP(pc,xxy); + break; + /* instructions type y */ + case _traced_save_b_y: + case _traced_write_y_loc: + case _traced_write_y_val: + case _traced_write_y_var: + pc->y_u.y.y = YAdjust(pc->y_u.y.y); + pc = NEXTOP(pc,y); + break; + /* instructions type yl */ + case _traced_p_atom_y: + case _traced_p_atomic_y: + case _traced_p_compound_y: + case _traced_p_db_ref_y: + case _traced_p_float_y: + case _traced_p_integer_y: + case _traced_p_nonvar_y: + case _traced_p_number_y: + case _traced_p_primitive_y: + case _traced_p_var_y: + pc->y_u.yl.y = YAdjust(pc->y_u.yl.y); + pc->y_u.yl.F = PtoOpAdjust(pc->y_u.yl.F); + pc = NEXTOP(pc,yl); + break; + /* instructions type yps */ + case _traced_commit_b_y: + pc->y_u.yps.y = YAdjust(pc->y_u.yps.y); + pc->y_u.yps.p0 = PtoPredAdjust(pc->y_u.yps.p0); + pc->y_u.yps.s = ConstantAdjust(pc->y_u.yps.s); + pc = NEXTOP(pc,yps); + break; + /* instructions type yx */ + case _traced_get_y_val: + case _traced_get_y_var: + case _traced_gl_void_valy: + case _traced_gl_void_vary: + case _traced_glist_valy: + case _traced_put_unsafe: + case _traced_put_y_val: + case _traced_put_y_var: + pc->y_u.yx.y = YAdjust(pc->y_u.yx.y); + pc->y_u.yx.x = XAdjust(pc->y_u.yx.x); + pc = NEXTOP(pc,yx); + break; + /* instructions type yxn */ + case _traced_p_and_y_vc: + case _traced_p_arg_y_cv: + case _traced_p_div_y_cv: + case _traced_p_div_y_vc: + case _traced_p_func2s_y_cv: + case _traced_p_func2s_y_vc: + case _traced_p_minus_y_cv: + case _traced_p_or_y_vc: + case _traced_p_plus_y_vc: + case _traced_p_sll_y_cv: + case _traced_p_sll_y_vc: + case _traced_p_slr_y_cv: + case _traced_p_slr_y_vc: + case _traced_p_times_y_vc: + pc->y_u.yxn.y = YAdjust(pc->y_u.yxn.y); + pc->y_u.yxn.xi = XAdjust(pc->y_u.yxn.xi); + pc->y_u.yxn.c = IntegerAdjust(pc->y_u.yxn.c); + pc = NEXTOP(pc,yxn); + break; + /* instructions type yxx */ + case _traced_p_and_y_vv: + case _traced_p_arg_y_vv: + case _traced_p_div_y_vv: + case _traced_p_func2f_yx: + case _traced_p_func2s_y_vv: + case _traced_p_minus_y_vv: + case _traced_p_or_y_vv: + case _traced_p_plus_y_vv: + case _traced_p_sll_y_vv: + case _traced_p_slr_y_vv: + case _traced_p_times_y_vv: + pc->y_u.yxx.y = YAdjust(pc->y_u.yxx.y); + pc->y_u.yxx.x1 = XAdjust(pc->y_u.yxx.x1); + pc->y_u.yxx.x2 = XAdjust(pc->y_u.yxx.x2); + pc = NEXTOP(pc,yxx); + break; + /* instructions type yyx */ + case _traced_p_func2f_yy: + pc->y_u.yyx.y1 = YAdjust(pc->y_u.yyx.y1); + pc->y_u.yyx.y2 = YAdjust(pc->y_u.yyx.y2); + pc->y_u.yyx.x = XAdjust(pc->y_u.yyx.x); + pc = NEXTOP(pc,yyx); + break; + /* instructions type yyxx */ + case _traced_get_yy_var: + case _traced_put_y_vals: + pc->y_u.yyxx.y1 = YAdjust(pc->y_u.yyxx.y1); + pc->y_u.yyxx.y2 = YAdjust(pc->y_u.yyxx.y2); + pc->y_u.yyxx.x1 = XAdjust(pc->y_u.yyxx.x1); + pc->y_u.yyxx.x2 = XAdjust(pc->y_u.yyxx.x2); + pc = NEXTOP(pc,yyxx); + break; +#ifdef YAPOR + /* instructions type Otapl */ + case _traced_getwork: + case _traced_getwork_seq: + case _traced_sync: + OrArgAdjust(pc->y_u.Otapl.or_arg); + TabEntryAdjust(pc->y_u.Otapl.te); + pc->y_u.Otapl.s = ArityAdjust(pc->y_u.Otapl.s); + pc->y_u.Otapl.p = PtoPredAdjust(pc->y_u.Otapl.p); + pc->y_u.Otapl.d = PtoOpAdjust(pc->y_u.Otapl.d); + pc = NEXTOP(pc,Otapl); + break; + /* instructions type e */ + case _traced_getwork_first_time: + if (op == _Nstop || op == _copy_idb_term || op == _unify_idb_term) return; + pc = NEXTOP(pc,e); + break; +#endif +#ifdef TABLING + /* instructions type Otapl */ + case _traced_table_answer_resolution: + case _traced_table_answer_resolution_completion: + case _traced_table_completion: + case _traced_table_load_answer: + case _traced_table_retry: + case _traced_table_retry_me: + case _traced_table_trust: + case _traced_table_trust_me: + case _traced_table_try: + case _traced_table_try_answer: + case _traced_table_try_me: + case _traced_table_try_single: + OrArgAdjust(pc->y_u.Otapl.or_arg); + TabEntryAdjust(pc->y_u.Otapl.te); + pc->y_u.Otapl.s = ArityAdjust(pc->y_u.Otapl.s); + pc->y_u.Otapl.p = PtoPredAdjust(pc->y_u.Otapl.p); + pc->y_u.Otapl.d = PtoOpAdjust(pc->y_u.Otapl.d); + pc = NEXTOP(pc,Otapl); + break; + /* instructions type e */ + case _traced_clause_with_cut: + if (op == _Nstop || op == _copy_idb_term || op == _unify_idb_term) return; + pc = NEXTOP(pc,e); + break; + /* instructions type s */ + case _traced_table_new_answer: + pc->y_u.s.s = ConstantAdjust(pc->y_u.s.s); + pc = NEXTOP(pc,s); + break; + /* instructions type e */ + case _traced_trie_do_appl: + case _traced_trie_do_appl_in_pair: + case _traced_trie_do_atom: + case _traced_trie_do_atom_in_pair: + case _traced_trie_do_bigint: + case _traced_trie_do_double: + case _traced_trie_do_extension: + case _traced_trie_do_gterm: + case _traced_trie_do_longint: + case _traced_trie_do_null: + case _traced_trie_do_null_in_pair: + case _traced_trie_do_pair: + case _traced_trie_do_val: + case _traced_trie_do_val_in_pair: + case _traced_trie_do_var: + case _traced_trie_do_var_in_pair: + case _traced_trie_retry_appl: + case _traced_trie_retry_appl_in_pair: + case _traced_trie_retry_atom: + case _traced_trie_retry_atom_in_pair: + case _traced_trie_retry_bigint: + case _traced_trie_retry_double: + case _traced_trie_retry_extension: + case _traced_trie_retry_gterm: + case _traced_trie_retry_longint: + case _traced_trie_retry_null: + case _traced_trie_retry_null_in_pair: + case _traced_trie_retry_pair: + case _traced_trie_retry_val: + case _traced_trie_retry_val_in_pair: + case _traced_trie_retry_var: + case _traced_trie_retry_var_in_pair: + case _traced_trie_trust_appl: + case _traced_trie_trust_appl_in_pair: + case _traced_trie_trust_atom: + case _traced_trie_trust_atom_in_pair: + case _traced_trie_trust_bigint: + case _traced_trie_trust_double: + case _traced_trie_trust_extension: + case _traced_trie_trust_gterm: + case _traced_trie_trust_longint: + case _traced_trie_trust_null: + case _traced_trie_trust_null_in_pair: + case _traced_trie_trust_pair: + case _traced_trie_trust_val: + case _traced_trie_trust_val_in_pair: + case _traced_trie_trust_var: + case _traced_trie_trust_var_in_pair: + case _traced_trie_try_appl: + case _traced_trie_try_appl_in_pair: + case _traced_trie_try_atom: + case _traced_trie_try_atom_in_pair: + case _traced_trie_try_bigint: + case _traced_trie_try_double: + case _traced_trie_try_extension: + case _traced_trie_try_gterm: + case _traced_trie_try_longint: + case _traced_trie_try_null: + case _traced_trie_try_null_in_pair: + case _traced_trie_try_pair: + case _traced_trie_try_val: + case _traced_trie_try_val_in_pair: + case _traced_trie_try_var: + case _traced_trie_try_var_in_pair: + if (op == _Nstop || op == _copy_idb_term || op == _unify_idb_term) return; + pc = NEXTOP(pc,e); + break; +#endif #endif /* this instruction is hardwired */ +#ifdef YAP_JIT + case _traced_or_last: +#ifdef YAPOR + OrArgAdjust(pc->y_u.Osblp.or_arg); + pc->y_u.Osblp.s = ConstantAdjust(pc->y_u.Osblp.s); + pc->y_u.Osblp.bmap = CellPtoHeapAdjust(pc->y_u.Osblp.bmap); + pc->y_u.Osblp.l = PtoOpAdjust(pc->y_u.Osblp.l); + pc->y_u.Osblp.p0 = PtoPredAdjust(pc->y_u.Osblp.p0); + pc = NEXTOP(pc,Osblp); + break; +#else + pc->y_u.p.p = PtoPredAdjust(pc->y_u.p.p); + pc = NEXTOP(pc,p); + break; +#endif +#endif case _or_last: #ifdef YAPOR OrArgAdjust(pc->y_u.Osblp.or_arg); @@ -994,7 +1850,4 @@ restore_opcodes(yamop *pc, yamop *max USES_REGS) #endif } } while (TRUE); -#ifdef DEBUG_RESTORE2 - fprintf(stderr, "\n"); -#endif } diff --git a/H/rlocals.h b/H/rlocals.h index e8183562f..22d2a60e3 100644 --- a/H/rlocals.h +++ b/H/rlocals.h @@ -140,11 +140,7 @@ static void RestoreWorker(int wid USES_REGS) { -#ifdef THREADS -#else - -#endif diff --git a/H/saveclause.h b/H/saveclause.h index 887027402..7b1f5dc31 100644 --- a/H/saveclause.h +++ b/H/saveclause.h @@ -25,6 +25,10 @@ CHECK(save_Constant(stream, pc->y_u.Illss.e)); pc = NEXTOP(pc,Illss); break; + /* instructions type J */ +#ifdef YAP_JIT + case _jit_handler: +#endif /* instructions type L */ case _alloc_for_logical_pred: CHECK(save_PtoLUClause(stream, pc->y_u.L.ClBase)); @@ -162,14 +166,6 @@ CHECK(save_PtoOp(stream, pc->y_u.Otapl.d)); pc = NEXTOP(pc,Otapl); break; - /* instructions type aFlp */ - case _native_me: - CHECK(save_Arity(stream, pc->y_u.aFlp.n)); - CHECK(save_ExternalFunction(stream, pc->y_u.aFlp.native)); - CHECK(save_PtoOp(stream, pc->y_u.aFlp.native_next)); - CHECK(save_PtoPred(stream, pc->y_u.aFlp.p)); - pc = NEXTOP(pc,aFlp); - break; /* instructions type c */ case _write_atom: CHECK(save_ConstantTerm(stream, pc->y_u.c.c)); @@ -964,6 +960,916 @@ pc = NEXTOP(pc,e); break; #endif +#ifdef YAP_JIT + /* instructions type D */ + case _traced_write_dbterm: + CHECK(save_DBGroundTerm(stream, pc->y_u.D.D)); + pc = NEXTOP(pc,D); + break; + /* instructions type Illss */ + case _traced_enter_lu_pred: + CHECK(save_PtoLUIndex(stream, pc->y_u.Illss.I)); + CHECK(save_PtoOp(stream, pc->y_u.Illss.l1)); + CHECK(save_PtoOp(stream, pc->y_u.Illss.l2)); + CHECK(save_Constant(stream, pc->y_u.Illss.s)); + CHECK(save_Constant(stream, pc->y_u.Illss.e)); + pc = NEXTOP(pc,Illss); + break; + /* instructions type J */ + case _traced_jit_handler: + /* instructions type L */ + case _traced_alloc_for_logical_pred: + CHECK(save_PtoLUClause(stream, pc->y_u.L.ClBase)); + pc = NEXTOP(pc,L); + break; + /* instructions type N */ + case _traced_write_bigint: + CHECK(save_BlobTermInCode(stream, pc->y_u.N.b)); + pc = NEXTOP(pc,N); + break; + /* instructions type Osblp */ + case _traced_either: + case _traced_or_else: +#ifdef YAPOR + CHECK(save_OrArg(stream, pc->y_u.Osblp.or_arg)); +#endif + CHECK(save_Constant(stream, pc->y_u.Osblp.s)); + CHECK(save_CellPtoHeap(stream, pc->y_u.Osblp.bmap)); + CHECK(save_PtoOp(stream, pc->y_u.Osblp.l)); + CHECK(save_PtoPred(stream, pc->y_u.Osblp.p0)); + pc = NEXTOP(pc,Osblp); + break; + /* instructions type Osbmp */ + case _traced_p_execute: + case _traced_p_execute_tail: +#ifdef YAPOR + CHECK(save_OrArg(stream, pc->y_u.Osbmp.or_arg)); +#endif + CHECK(save_Constant(stream, pc->y_u.Osbmp.s)); + CHECK(save_CellPtoHeap(stream, pc->y_u.Osbmp.bmap)); + CHECK(save_Module(stream, pc->y_u.Osbmp.mod)); + CHECK(save_PtoPred(stream, pc->y_u.Osbmp.p0)); + pc = NEXTOP(pc,Osbmp); + break; + /* instructions type Osbpa */ + case _traced_ensure_space: +#ifdef YAPOR + CHECK(save_OrArg(stream, pc->y_u.Osbpa.or_arg)); +#endif + CHECK(save_Constant(stream, pc->y_u.Osbpa.s)); + CHECK(save_CellPtoHeap(stream, pc->y_u.Osbpa.bmap)); + CHECK(save_PtoPred(stream, pc->y_u.Osbpa.p)); + CHECK(save_Arity(stream, pc->y_u.Osbpa.i)); + pc = NEXTOP(pc,Osbpa); + break; + /* instructions type Osbpp */ + case _traced_call: + case _traced_call_cpred: + case _traced_call_usercpred: + case _traced_fcall: + case _traced_p_execute2: +#ifdef YAPOR + CHECK(save_OrArg(stream, pc->y_u.Osbpp.or_arg)); +#endif + CHECK(save_Constant(stream, pc->y_u.Osbpp.s)); + CHECK(save_CellPtoHeap(stream, pc->y_u.Osbpp.bmap)); + CHECK(save_PtoPred(stream, pc->y_u.Osbpp.p)); + CHECK(save_PtoPred(stream, pc->y_u.Osbpp.p0)); + pc = NEXTOP(pc,Osbpp); + break; + /* instructions type OtILl */ + case _traced_count_trust_logical: + case _traced_profiled_trust_logical: + case _traced_trust_logical: +#ifdef YAPOR + CHECK(save_OrArg(stream, pc->y_u.OtILl.or_arg)); +#endif +#ifdef TABLING + CHECK(save_TabEntry(stream, pc->y_u.OtILl.te)); +#endif + CHECK(save_PtoLUIndex(stream, pc->y_u.OtILl.block)); + CHECK(save_PtoLUClause(stream, pc->y_u.OtILl.d)); + CHECK(save_PtoOp(stream, pc->y_u.OtILl.n)); + pc = NEXTOP(pc,OtILl); + break; + /* instructions type OtaLl */ + case _traced_count_retry_logical: + case _traced_profiled_retry_logical: + case _traced_retry_logical: + case _traced_try_logical: +#ifdef YAPOR + CHECK(save_OrArg(stream, pc->y_u.OtaLl.or_arg)); +#endif +#ifdef TABLING + CHECK(save_TabEntry(stream, pc->y_u.OtaLl.te)); +#endif + CHECK(save_Arity(stream, pc->y_u.OtaLl.s)); + CHECK(save_PtoLUClause(stream, pc->y_u.OtaLl.d)); + CHECK(save_PtoOp(stream, pc->y_u.OtaLl.n)); + pc = NEXTOP(pc,OtaLl); + break; + /* instructions type OtapFs */ + case _traced_cut_c: + case _traced_cut_userc: + case _traced_retry_c: + case _traced_retry_userc: + case _traced_try_c: + case _traced_try_userc: +#ifdef YAPOR + CHECK(save_OrArg(stream, pc->y_u.OtapFs.or_arg)); +#endif +#ifdef TABLING + CHECK(save_TabEntry(stream, pc->y_u.OtapFs.te)); +#endif + CHECK(save_Arity(stream, pc->y_u.OtapFs.s)); + CHECK(save_PtoPred(stream, pc->y_u.OtapFs.p)); + CHECK(save_ExternalFunction(stream, pc->y_u.OtapFs.f)); + CHECK(save_Constant(stream, pc->y_u.OtapFs.extra)); + pc = NEXTOP(pc,OtapFs); + break; + /* instructions type Otapl */ + case _traced_count_retry_and_mark: + case _traced_count_retry_me: + case _traced_count_trust_me: + case _traced_profiled_retry_and_mark: + case _traced_profiled_retry_me: + case _traced_profiled_trust_me: + case _traced_retry: + case _traced_retry_and_mark: + case _traced_retry_me: + case _traced_spy_or_trymark: + case _traced_trust: + case _traced_trust_me: + case _traced_try_and_mark: + case _traced_try_clause: + case _traced_try_me: +#ifdef YAPOR + CHECK(save_OrArg(stream, pc->y_u.Otapl.or_arg)); +#endif +#ifdef TABLING + CHECK(save_TabEntry(stream, pc->y_u.Otapl.te)); +#endif + CHECK(save_Arity(stream, pc->y_u.Otapl.s)); + CHECK(save_PtoPred(stream, pc->y_u.Otapl.p)); + CHECK(save_PtoOp(stream, pc->y_u.Otapl.d)); + pc = NEXTOP(pc,Otapl); + break; + /* instructions type c */ + case _traced_write_atom: + CHECK(save_ConstantTerm(stream, pc->y_u.c.c)); + pc = NEXTOP(pc,c); + break; + /* instructions type cc */ + case _traced_get_2atoms: + CHECK(save_ConstantTerm(stream, pc->y_u.cc.c1)); + CHECK(save_ConstantTerm(stream, pc->y_u.cc.c2)); + pc = NEXTOP(pc,cc); + break; + /* instructions type ccc */ + case _traced_get_3atoms: + CHECK(save_ConstantTerm(stream, pc->y_u.ccc.c1)); + CHECK(save_ConstantTerm(stream, pc->y_u.ccc.c2)); + CHECK(save_ConstantTerm(stream, pc->y_u.ccc.c3)); + pc = NEXTOP(pc,ccc); + break; + /* instructions type cccc */ + case _traced_get_4atoms: + CHECK(save_ConstantTerm(stream, pc->y_u.cccc.c1)); + CHECK(save_ConstantTerm(stream, pc->y_u.cccc.c2)); + CHECK(save_ConstantTerm(stream, pc->y_u.cccc.c3)); + CHECK(save_ConstantTerm(stream, pc->y_u.cccc.c4)); + pc = NEXTOP(pc,cccc); + break; + /* instructions type ccccc */ + case _traced_get_5atoms: + CHECK(save_ConstantTerm(stream, pc->y_u.ccccc.c1)); + CHECK(save_ConstantTerm(stream, pc->y_u.ccccc.c2)); + CHECK(save_ConstantTerm(stream, pc->y_u.ccccc.c3)); + CHECK(save_ConstantTerm(stream, pc->y_u.ccccc.c4)); + CHECK(save_ConstantTerm(stream, pc->y_u.ccccc.c5)); + pc = NEXTOP(pc,ccccc); + break; + /* instructions type cccccc */ + case _traced_get_6atoms: + CHECK(save_ConstantTerm(stream, pc->y_u.cccccc.c1)); + CHECK(save_ConstantTerm(stream, pc->y_u.cccccc.c2)); + CHECK(save_ConstantTerm(stream, pc->y_u.cccccc.c3)); + CHECK(save_ConstantTerm(stream, pc->y_u.cccccc.c4)); + CHECK(save_ConstantTerm(stream, pc->y_u.cccccc.c5)); + CHECK(save_ConstantTerm(stream, pc->y_u.cccccc.c6)); + pc = NEXTOP(pc,cccccc); + break; + /* instructions type clll */ + case _traced_if_not_then: + CHECK(save_ConstantTerm(stream, pc->y_u.clll.c)); + CHECK(save_PtoOp(stream, pc->y_u.clll.l1)); + CHECK(save_PtoOp(stream, pc->y_u.clll.l2)); + CHECK(save_PtoOp(stream, pc->y_u.clll.l3)); + pc = NEXTOP(pc,clll); + break; + /* instructions type d */ + case _traced_write_float: + CHECK(save_DoubleInCode(stream, pc->y_u.d.d)); + pc = NEXTOP(pc,d); + break; + /* instructions type e */ + case _traced_Nstop: + case _traced_allocate: + case _traced_copy_idb_term: + case _traced_expand_index: + case _traced_index_blob: + case _traced_index_dbref: + case _traced_index_long: + case _traced_index_pred: + case _traced_lock_pred: + case _traced_op_fail: + case _traced_p_equal: + case _traced_p_functor: + case _traced_pop: + case _traced_retry_eam: + case _traced_spy_pred: + case _traced_thread_local: + case _traced_trust_fail: + case _traced_undef_p: + case _traced_unify_idb_term: + case _traced_unlock_lu: + case _traced_write_l_list: + case _traced_write_list: + case _traced_write_void: + if (op == _Nstop || op == _copy_idb_term || op == _unify_idb_term) return 1; + pc = NEXTOP(pc,e); + break; + /* instructions type fa */ + case _traced_write_l_struc: + case _traced_write_struct: + CHECK(save_Func(stream, pc->y_u.fa.f)); + CHECK(save_Arity(stream, pc->y_u.fa.a)); + pc = NEXTOP(pc,fa); + break; + /* instructions type i */ + case _traced_write_longint: + CHECK(save_IntegerInCode(stream, pc->y_u.i.i)); + pc = NEXTOP(pc,i); + break; + /* instructions type l */ + case _traced_Ystop: + case _traced_jump: + case _traced_jump_if_var: + case _traced_move_back: + case _traced_p_dif: + case _traced_p_eq: + case _traced_retry2: + case _traced_retry3: + case _traced_retry4: + case _traced_skip: + case _traced_try_clause2: + case _traced_try_clause3: + case _traced_try_clause4: + case _traced_try_in: + CHECK(save_PtoOp(stream, pc->y_u.l.l)); + pc = NEXTOP(pc,l); + break; + /* instructions type llll */ + case _traced_switch_on_type: + CHECK(save_PtoOp(stream, pc->y_u.llll.l1)); + CHECK(save_PtoOp(stream, pc->y_u.llll.l2)); + CHECK(save_PtoOp(stream, pc->y_u.llll.l3)); + CHECK(save_PtoOp(stream, pc->y_u.llll.l4)); + pc = NEXTOP(pc,llll); + break; + /* instructions type lp */ + case _traced_user_switch: + CHECK(save_PtoOp(stream, pc->y_u.lp.l)); + CHECK(save_PtoPred(stream, pc->y_u.lp.p)); + pc = NEXTOP(pc,lp); + break; + /* instructions type o */ + case _traced_unify_l_list: + case _traced_unify_l_list_write: + case _traced_unify_l_void: + case _traced_unify_l_void_write: + case _traced_unify_list: + case _traced_unify_list_write: + case _traced_unify_void: + case _traced_unify_void_write: + CHECK(save_Opcode(stream, pc->y_u.o.opcw)); + pc = NEXTOP(pc,o); + break; + /* instructions type oD */ + case _traced_unify_dbterm: + case _traced_unify_l_dbterm: + CHECK(save_Opcode(stream, pc->y_u.oD.opcw)); + CHECK(save_DBGroundTerm(stream, pc->y_u.oD.D)); + pc = NEXTOP(pc,oD); + break; + /* instructions type oN */ + case _traced_unify_bigint: + case _traced_unify_l_bigint: + CHECK(save_Opcode(stream, pc->y_u.oN.opcw)); + CHECK(save_BlobTermInCode(stream, pc->y_u.oN.b)); + pc = NEXTOP(pc,oN); + break; + /* instructions type oc */ + case _traced_unify_atom: + case _traced_unify_atom_write: + case _traced_unify_l_atom: + case _traced_unify_l_atom_write: + CHECK(save_Opcode(stream, pc->y_u.oc.opcw)); + CHECK(save_ConstantTerm(stream, pc->y_u.oc.c)); + pc = NEXTOP(pc,oc); + break; + /* instructions type od */ + case _traced_unify_float: + case _traced_unify_float_write: + case _traced_unify_l_float: + case _traced_unify_l_float_write: + CHECK(save_Opcode(stream, pc->y_u.od.opcw)); + CHECK(save_DoubleInCode(stream, pc->y_u.od.d)); + pc = NEXTOP(pc,od); + break; + /* instructions type ofa */ + case _traced_unify_l_struc: + case _traced_unify_l_struc_write: + case _traced_unify_struct: + case _traced_unify_struct_write: + CHECK(save_Opcode(stream, pc->y_u.ofa.opcw)); + CHECK(save_Func(stream, pc->y_u.ofa.f)); + CHECK(save_Arity(stream, pc->y_u.ofa.a)); + pc = NEXTOP(pc,ofa); + break; + /* instructions type oi */ + case _traced_unify_l_longint: + case _traced_unify_l_longint_write: + case _traced_unify_longint: + case _traced_unify_longint_write: + CHECK(save_Opcode(stream, pc->y_u.oi.opcw)); + CHECK(save_IntegerInCode(stream, pc->y_u.oi.i)); + pc = NEXTOP(pc,oi); + break; + /* instructions type ollll */ + case _traced_switch_list_nl: + CHECK(save_Opcode(stream, pc->y_u.ollll.pop)); + CHECK(save_PtoOp(stream, pc->y_u.ollll.l1)); + CHECK(save_PtoOp(stream, pc->y_u.ollll.l2)); + CHECK(save_PtoOp(stream, pc->y_u.ollll.l3)); + CHECK(save_PtoOp(stream, pc->y_u.ollll.l4)); + pc = NEXTOP(pc,ollll); + break; + /* instructions type os */ + case _traced_run_eam: + case _traced_unify_l_n_voids: + case _traced_unify_l_n_voids_write: + case _traced_unify_n_voids: + case _traced_unify_n_voids_write: + CHECK(save_Opcode(stream, pc->y_u.os.opcw)); + CHECK(save_Constant(stream, pc->y_u.os.s)); + pc = NEXTOP(pc,os); + break; + /* instructions type osc */ + case _traced_unify_n_atoms: + case _traced_unify_n_atoms_write: + CHECK(save_Opcode(stream, pc->y_u.osc.opcw)); + CHECK(save_Constant(stream, pc->y_u.osc.s)); + CHECK(save_ConstantTerm(stream, pc->y_u.osc.c)); + pc = NEXTOP(pc,osc); + break; + /* instructions type ox */ + case _traced_save_appl_x: + case _traced_save_appl_x_write: + case _traced_save_pair_x: + case _traced_save_pair_x_write: + case _traced_unify_l_x_loc: + case _traced_unify_l_x_loc_write: + case _traced_unify_l_x_val: + case _traced_unify_l_x_val_write: + case _traced_unify_l_x_var: + case _traced_unify_l_x_var_write: + case _traced_unify_x_loc: + case _traced_unify_x_loc_write: + case _traced_unify_x_val: + case _traced_unify_x_val_write: + case _traced_unify_x_var: + case _traced_unify_x_var_write: + CHECK(save_Opcode(stream, pc->y_u.ox.opcw)); + CHECK(save_X(stream, pc->y_u.ox.x)); + pc = NEXTOP(pc,ox); + break; + /* instructions type oxx */ + case _traced_unify_l_x_var2: + case _traced_unify_l_x_var2_write: + case _traced_unify_x_var2: + case _traced_unify_x_var2_write: + CHECK(save_Opcode(stream, pc->y_u.oxx.opcw)); + CHECK(save_X(stream, pc->y_u.oxx.xl)); + CHECK(save_X(stream, pc->y_u.oxx.xr)); + pc = NEXTOP(pc,oxx); + break; + /* instructions type oy */ + case _traced_save_appl_y: + case _traced_save_appl_y_write: + case _traced_save_pair_y: + case _traced_save_pair_y_write: + case _traced_unify_l_y_loc: + case _traced_unify_l_y_loc_write: + case _traced_unify_l_y_val: + case _traced_unify_l_y_val_write: + case _traced_unify_l_y_var: + case _traced_unify_l_y_var_write: + case _traced_unify_y_loc: + case _traced_unify_y_loc_write: + case _traced_unify_y_val: + case _traced_unify_y_val_write: + case _traced_unify_y_var: + case _traced_unify_y_var_write: + CHECK(save_Opcode(stream, pc->y_u.oy.opcw)); + CHECK(save_Y(stream, pc->y_u.oy.y)); + pc = NEXTOP(pc,oy); + break; + /* instructions type p */ + case _traced_count_call: + case _traced_count_retry: + case _traced_deallocate: + case _traced_enter_profiling: + case _traced_lock_lu: + case _traced_procceed: + case _traced_retry_profiled: + CHECK(save_PtoPred(stream, pc->y_u.p.p)); + pc = NEXTOP(pc,p); + break; + /* instructions type plxxs */ + case _traced_call_bfunc_xx: + CHECK(save_PtoPred(stream, pc->y_u.plxxs.p)); + CHECK(save_PtoOp(stream, pc->y_u.plxxs.f)); + CHECK(save_X(stream, pc->y_u.plxxs.x1)); + CHECK(save_X(stream, pc->y_u.plxxs.x2)); + CHECK(save_Constant(stream, pc->y_u.plxxs.flags)); + pc = NEXTOP(pc,plxxs); + break; + /* instructions type plxys */ + case _traced_call_bfunc_xy: + case _traced_call_bfunc_yx: + CHECK(save_PtoPred(stream, pc->y_u.plxys.p)); + CHECK(save_PtoOp(stream, pc->y_u.plxys.f)); + CHECK(save_X(stream, pc->y_u.plxys.x)); + CHECK(save_Y(stream, pc->y_u.plxys.y)); + CHECK(save_Constant(stream, pc->y_u.plxys.flags)); + pc = NEXTOP(pc,plxys); + break; + /* instructions type plyys */ + case _traced_call_bfunc_yy: + CHECK(save_PtoPred(stream, pc->y_u.plyys.p)); + CHECK(save_PtoOp(stream, pc->y_u.plyys.f)); + CHECK(save_Y(stream, pc->y_u.plyys.y1)); + CHECK(save_Y(stream, pc->y_u.plyys.y2)); + CHECK(save_Constant(stream, pc->y_u.plyys.flags)); + pc = NEXTOP(pc,plyys); + break; + /* instructions type pp */ + case _traced_dexecute: + case _traced_execute: + case _traced_execute_cpred: + CHECK(save_PtoPred(stream, pc->y_u.pp.p)); + CHECK(save_PtoPred(stream, pc->y_u.pp.p0)); + pc = NEXTOP(pc,pp); + break; + /* instructions type s */ + case _traced_cut: + case _traced_cut_e: + case _traced_cut_t: + case _traced_pop_n: + case _traced_write_n_voids: + CHECK(save_Constant(stream, pc->y_u.s.s)); + pc = NEXTOP(pc,s); + break; + /* instructions type sc */ + case _traced_write_n_atoms: + CHECK(save_Constant(stream, pc->y_u.sc.s)); + CHECK(save_ConstantTerm(stream, pc->y_u.sc.c)); + pc = NEXTOP(pc,sc); + break; + /* instructions type sllll */ + case _traced_switch_on_sub_arg_type: + CHECK(save_Constant(stream, pc->y_u.sllll.s)); + CHECK(save_PtoOp(stream, pc->y_u.sllll.l1)); + CHECK(save_PtoOp(stream, pc->y_u.sllll.l2)); + CHECK(save_PtoOp(stream, pc->y_u.sllll.l3)); + CHECK(save_PtoOp(stream, pc->y_u.sllll.l4)); + pc = NEXTOP(pc,sllll); + break; + /* instructions type slp */ + case _traced_call_c_wfail: + CHECK(save_Constant(stream, pc->y_u.slp.s)); + CHECK(save_PtoOp(stream, pc->y_u.slp.l)); + CHECK(save_PtoPred(stream, pc->y_u.slp.p)); + pc = NEXTOP(pc,slp); + break; + /* instructions type sssl */ + case _traced_go_on_cons: + case _traced_go_on_func: + case _traced_if_cons: + case _traced_if_func: + case _traced_switch_on_cons: + case _traced_switch_on_func: + CHECK(save_Constant(stream, pc->y_u.sssl.s)); + CHECK(save_Constant(stream, pc->y_u.sssl.e)); + CHECK(save_Constant(stream, pc->y_u.sssl.w)); + CHECK(save_PtoOp(stream, pc->y_u.sssl.l)); + pc = NEXTOP(pc,sssl); + break; + /* instructions type sssllp */ + case _traced_expand_clauses: + CHECK(save_Constant(stream, pc->y_u.sssllp.s1)); + CHECK(save_Constant(stream, pc->y_u.sssllp.s2)); + CHECK(save_Constant(stream, pc->y_u.sssllp.s3)); + CHECK(save_PtoOp(stream, pc->y_u.sssllp.sprev)); + CHECK(save_PtoOp(stream, pc->y_u.sssllp.snext)); + CHECK(save_PtoPred(stream, pc->y_u.sssllp.p)); + pc = NEXTOP(pc,sssllp); + break; + /* instructions type x */ + case _traced_get_list: + case _traced_put_list: + case _traced_save_b_x: + case _traced_write_x_loc: + case _traced_write_x_val: + case _traced_write_x_var: + CHECK(save_X(stream, pc->y_u.x.x)); + pc = NEXTOP(pc,x); + break; + /* instructions type xD */ + case _traced_get_dbterm: + case _traced_put_dbterm: + CHECK(save_X(stream, pc->y_u.xD.x)); + CHECK(save_DBGroundTerm(stream, pc->y_u.xD.D)); + pc = NEXTOP(pc,xD); + break; + /* instructions type xN */ + case _traced_get_bigint: + case _traced_put_bigint: + CHECK(save_X(stream, pc->y_u.xN.x)); + CHECK(save_BlobTermInCode(stream, pc->y_u.xN.b)); + pc = NEXTOP(pc,xN); + break; + /* instructions type xc */ + case _traced_get_atom: + case _traced_put_atom: + CHECK(save_X(stream, pc->y_u.xc.x)); + CHECK(save_ConstantTerm(stream, pc->y_u.xc.c)); + pc = NEXTOP(pc,xc); + break; + /* instructions type xd */ + case _traced_get_float: + case _traced_put_float: + CHECK(save_X(stream, pc->y_u.xd.x)); + CHECK(save_DoubleInCode(stream, pc->y_u.xd.d)); + pc = NEXTOP(pc,xd); + break; + /* instructions type xfa */ + case _traced_get_struct: + case _traced_put_struct: + CHECK(save_X(stream, pc->y_u.xfa.x)); + CHECK(save_Func(stream, pc->y_u.xfa.f)); + CHECK(save_Arity(stream, pc->y_u.xfa.a)); + pc = NEXTOP(pc,xfa); + break; + /* instructions type xi */ + case _traced_get_longint: + case _traced_put_longint: + CHECK(save_X(stream, pc->y_u.xi.x)); + CHECK(save_IntegerInCode(stream, pc->y_u.xi.i)); + pc = NEXTOP(pc,xi); + break; + /* instructions type xl */ + case _traced_p_atom_x: + case _traced_p_atomic_x: + case _traced_p_compound_x: + case _traced_p_db_ref_x: + case _traced_p_float_x: + case _traced_p_integer_x: + case _traced_p_nonvar_x: + case _traced_p_number_x: + case _traced_p_primitive_x: + case _traced_p_var_x: + CHECK(save_X(stream, pc->y_u.xl.x)); + CHECK(save_PtoOp(stream, pc->y_u.xl.F)); + pc = NEXTOP(pc,xl); + break; + /* instructions type xll */ + case _traced_jump_if_nonvar: + CHECK(save_X(stream, pc->y_u.xll.x)); + CHECK(save_PtoOp(stream, pc->y_u.xll.l1)); + CHECK(save_PtoOp(stream, pc->y_u.xll.l2)); + pc = NEXTOP(pc,xll); + break; + /* instructions type xllll */ + case _traced_switch_on_arg_type: + CHECK(save_X(stream, pc->y_u.xllll.x)); + CHECK(save_PtoOp(stream, pc->y_u.xllll.l1)); + CHECK(save_PtoOp(stream, pc->y_u.xllll.l2)); + CHECK(save_PtoOp(stream, pc->y_u.xllll.l3)); + CHECK(save_PtoOp(stream, pc->y_u.xllll.l4)); + pc = NEXTOP(pc,xllll); + break; + /* instructions type xps */ + case _traced_commit_b_x: + CHECK(save_X(stream, pc->y_u.xps.x)); + CHECK(save_PtoPred(stream, pc->y_u.xps.p0)); + CHECK(save_Constant(stream, pc->y_u.xps.s)); + pc = NEXTOP(pc,xps); + break; + /* instructions type xx */ + case _traced_get_x_val: + case _traced_get_x_var: + case _traced_gl_void_valx: + case _traced_gl_void_varx: + case _traced_glist_valx: + case _traced_put_x_val: + case _traced_put_x_var: + CHECK(save_X(stream, pc->y_u.xx.xl)); + CHECK(save_X(stream, pc->y_u.xx.xr)); + pc = NEXTOP(pc,xx); + break; + /* instructions type xxc */ + case _traced_p_func2s_cv: + CHECK(save_X(stream, pc->y_u.xxc.x)); + CHECK(save_X(stream, pc->y_u.xxc.xi)); + CHECK(save_ConstantTerm(stream, pc->y_u.xxc.c)); + pc = NEXTOP(pc,xxc); + break; + /* instructions type xxn */ + case _traced_p_and_vc: + case _traced_p_arg_cv: + case _traced_p_div_cv: + case _traced_p_div_vc: + case _traced_p_func2s_vc: + case _traced_p_minus_cv: + case _traced_p_or_vc: + case _traced_p_plus_vc: + case _traced_p_sll_cv: + case _traced_p_sll_vc: + case _traced_p_slr_cv: + case _traced_p_slr_vc: + case _traced_p_times_vc: + CHECK(save_X(stream, pc->y_u.xxn.x)); + CHECK(save_X(stream, pc->y_u.xxn.xi)); + CHECK(save_Integer(stream, pc->y_u.xxn.c)); + pc = NEXTOP(pc,xxn); + break; + /* instructions type xxx */ + case _traced_p_and_vv: + case _traced_p_arg_vv: + case _traced_p_div_vv: + case _traced_p_func2f_xx: + case _traced_p_func2s_vv: + case _traced_p_minus_vv: + case _traced_p_or_vv: + case _traced_p_plus_vv: + case _traced_p_sll_vv: + case _traced_p_slr_vv: + case _traced_p_times_vv: + CHECK(save_X(stream, pc->y_u.xxx.x)); + CHECK(save_X(stream, pc->y_u.xxx.x1)); + CHECK(save_X(stream, pc->y_u.xxx.x2)); + pc = NEXTOP(pc,xxx); + break; + /* instructions type xxxx */ + case _traced_put_xx_val: + CHECK(save_X(stream, pc->y_u.xxxx.xl1)); + CHECK(save_X(stream, pc->y_u.xxxx.xl2)); + CHECK(save_X(stream, pc->y_u.xxxx.xr1)); + CHECK(save_X(stream, pc->y_u.xxxx.xr2)); + pc = NEXTOP(pc,xxxx); + break; + /* instructions type xxy */ + case _traced_p_func2f_xy: + CHECK(save_X(stream, pc->y_u.xxy.x)); + CHECK(save_X(stream, pc->y_u.xxy.x1)); + CHECK(save_Y(stream, pc->y_u.xxy.y2)); + pc = NEXTOP(pc,xxy); + break; + /* instructions type y */ + case _traced_save_b_y: + case _traced_write_y_loc: + case _traced_write_y_val: + case _traced_write_y_var: + CHECK(save_Y(stream, pc->y_u.y.y)); + pc = NEXTOP(pc,y); + break; + /* instructions type yl */ + case _traced_p_atom_y: + case _traced_p_atomic_y: + case _traced_p_compound_y: + case _traced_p_db_ref_y: + case _traced_p_float_y: + case _traced_p_integer_y: + case _traced_p_nonvar_y: + case _traced_p_number_y: + case _traced_p_primitive_y: + case _traced_p_var_y: + CHECK(save_Y(stream, pc->y_u.yl.y)); + CHECK(save_PtoOp(stream, pc->y_u.yl.F)); + pc = NEXTOP(pc,yl); + break; + /* instructions type yps */ + case _traced_commit_b_y: + CHECK(save_Y(stream, pc->y_u.yps.y)); + CHECK(save_PtoPred(stream, pc->y_u.yps.p0)); + CHECK(save_Constant(stream, pc->y_u.yps.s)); + pc = NEXTOP(pc,yps); + break; + /* instructions type yx */ + case _traced_get_y_val: + case _traced_get_y_var: + case _traced_gl_void_valy: + case _traced_gl_void_vary: + case _traced_glist_valy: + case _traced_put_unsafe: + case _traced_put_y_val: + case _traced_put_y_var: + CHECK(save_Y(stream, pc->y_u.yx.y)); + CHECK(save_X(stream, pc->y_u.yx.x)); + pc = NEXTOP(pc,yx); + break; + /* instructions type yxn */ + case _traced_p_and_y_vc: + case _traced_p_arg_y_cv: + case _traced_p_div_y_cv: + case _traced_p_div_y_vc: + case _traced_p_func2s_y_cv: + case _traced_p_func2s_y_vc: + case _traced_p_minus_y_cv: + case _traced_p_or_y_vc: + case _traced_p_plus_y_vc: + case _traced_p_sll_y_cv: + case _traced_p_sll_y_vc: + case _traced_p_slr_y_cv: + case _traced_p_slr_y_vc: + case _traced_p_times_y_vc: + CHECK(save_Y(stream, pc->y_u.yxn.y)); + CHECK(save_X(stream, pc->y_u.yxn.xi)); + CHECK(save_Integer(stream, pc->y_u.yxn.c)); + pc = NEXTOP(pc,yxn); + break; + /* instructions type yxx */ + case _traced_p_and_y_vv: + case _traced_p_arg_y_vv: + case _traced_p_div_y_vv: + case _traced_p_func2f_yx: + case _traced_p_func2s_y_vv: + case _traced_p_minus_y_vv: + case _traced_p_or_y_vv: + case _traced_p_plus_y_vv: + case _traced_p_sll_y_vv: + case _traced_p_slr_y_vv: + case _traced_p_times_y_vv: + CHECK(save_Y(stream, pc->y_u.yxx.y)); + CHECK(save_X(stream, pc->y_u.yxx.x1)); + CHECK(save_X(stream, pc->y_u.yxx.x2)); + pc = NEXTOP(pc,yxx); + break; + /* instructions type yyx */ + case _traced_p_func2f_yy: + CHECK(save_Y(stream, pc->y_u.yyx.y1)); + CHECK(save_Y(stream, pc->y_u.yyx.y2)); + CHECK(save_X(stream, pc->y_u.yyx.x)); + pc = NEXTOP(pc,yyx); + break; + /* instructions type yyxx */ + case _traced_get_yy_var: + case _traced_put_y_vals: + CHECK(save_Y(stream, pc->y_u.yyxx.y1)); + CHECK(save_Y(stream, pc->y_u.yyxx.y2)); + CHECK(save_X(stream, pc->y_u.yyxx.x1)); + CHECK(save_X(stream, pc->y_u.yyxx.x2)); + pc = NEXTOP(pc,yyxx); + break; +#ifdef YAPOR + /* instructions type Otapl */ + case _traced_getwork: + case _traced_getwork_seq: + case _traced_sync: +#ifdef YAPOR + CHECK(save_OrArg(stream, pc->y_u.Otapl.or_arg)); +#endif +#ifdef TABLING + CHECK(save_TabEntry(stream, pc->y_u.Otapl.te)); +#endif + CHECK(save_Arity(stream, pc->y_u.Otapl.s)); + CHECK(save_PtoPred(stream, pc->y_u.Otapl.p)); + CHECK(save_PtoOp(stream, pc->y_u.Otapl.d)); + pc = NEXTOP(pc,Otapl); + break; + /* instructions type e */ + case _traced_getwork_first_time: + if (op == _Nstop || op == _copy_idb_term || op == _unify_idb_term) return 1; + pc = NEXTOP(pc,e); + break; +#endif +#ifdef TABLING + /* instructions type Otapl */ + case _traced_table_answer_resolution: + case _traced_table_answer_resolution_completion: + case _traced_table_completion: + case _traced_table_load_answer: + case _traced_table_retry: + case _traced_table_retry_me: + case _traced_table_trust: + case _traced_table_trust_me: + case _traced_table_try: + case _traced_table_try_answer: + case _traced_table_try_me: + case _traced_table_try_single: +#ifdef YAPOR + CHECK(save_OrArg(stream, pc->y_u.Otapl.or_arg)); +#endif +#ifdef TABLING + CHECK(save_TabEntry(stream, pc->y_u.Otapl.te)); +#endif + CHECK(save_Arity(stream, pc->y_u.Otapl.s)); + CHECK(save_PtoPred(stream, pc->y_u.Otapl.p)); + CHECK(save_PtoOp(stream, pc->y_u.Otapl.d)); + pc = NEXTOP(pc,Otapl); + break; + /* instructions type e */ + case _traced_clause_with_cut: + if (op == _Nstop || op == _copy_idb_term || op == _unify_idb_term) return 1; + pc = NEXTOP(pc,e); + break; + /* instructions type s */ + case _traced_table_new_answer: + CHECK(save_Constant(stream, pc->y_u.s.s)); + pc = NEXTOP(pc,s); + break; + /* instructions type e */ + case _traced_trie_do_appl: + case _traced_trie_do_appl_in_pair: + case _traced_trie_do_atom: + case _traced_trie_do_atom_in_pair: + case _traced_trie_do_bigint: + case _traced_trie_do_double: + case _traced_trie_do_extension: + case _traced_trie_do_gterm: + case _traced_trie_do_longint: + case _traced_trie_do_null: + case _traced_trie_do_null_in_pair: + case _traced_trie_do_pair: + case _traced_trie_do_val: + case _traced_trie_do_val_in_pair: + case _traced_trie_do_var: + case _traced_trie_do_var_in_pair: + case _traced_trie_retry_appl: + case _traced_trie_retry_appl_in_pair: + case _traced_trie_retry_atom: + case _traced_trie_retry_atom_in_pair: + case _traced_trie_retry_bigint: + case _traced_trie_retry_double: + case _traced_trie_retry_extension: + case _traced_trie_retry_gterm: + case _traced_trie_retry_longint: + case _traced_trie_retry_null: + case _traced_trie_retry_null_in_pair: + case _traced_trie_retry_pair: + case _traced_trie_retry_val: + case _traced_trie_retry_val_in_pair: + case _traced_trie_retry_var: + case _traced_trie_retry_var_in_pair: + case _traced_trie_trust_appl: + case _traced_trie_trust_appl_in_pair: + case _traced_trie_trust_atom: + case _traced_trie_trust_atom_in_pair: + case _traced_trie_trust_bigint: + case _traced_trie_trust_double: + case _traced_trie_trust_extension: + case _traced_trie_trust_gterm: + case _traced_trie_trust_longint: + case _traced_trie_trust_null: + case _traced_trie_trust_null_in_pair: + case _traced_trie_trust_pair: + case _traced_trie_trust_val: + case _traced_trie_trust_val_in_pair: + case _traced_trie_trust_var: + case _traced_trie_trust_var_in_pair: + case _traced_trie_try_appl: + case _traced_trie_try_appl_in_pair: + case _traced_trie_try_atom: + case _traced_trie_try_atom_in_pair: + case _traced_trie_try_bigint: + case _traced_trie_try_double: + case _traced_trie_try_extension: + case _traced_trie_try_gterm: + case _traced_trie_try_longint: + case _traced_trie_try_null: + case _traced_trie_try_null_in_pair: + case _traced_trie_try_pair: + case _traced_trie_try_val: + case _traced_trie_try_val_in_pair: + case _traced_trie_try_var: + case _traced_trie_try_var_in_pair: + if (op == _Nstop || op == _copy_idb_term || op == _unify_idb_term) return 1; + pc = NEXTOP(pc,e); + break; +#endif +#endif default: return -1; } diff --git a/H/walkclause.h b/H/walkclause.h index 8e1241d9a..5d731b6ab 100644 --- a/H/walkclause.h +++ b/H/walkclause.h @@ -16,6 +16,12 @@ /* instructions type Illss */ case _enter_lu_pred: return walk_got_lu_block(pc->y_u.Illss.I, startp, endp); + /* instructions type J */ +#ifdef YAP_JIT + case _jit_handler: +#endif + pc = NEXTOP(pc,J); + break; /* instructions type L */ case _alloc_for_logical_pred: return walk_got_lu_clause(pc->y_u.L.ClBase, startp, endp); @@ -97,10 +103,6 @@ pp = pc->y_u.Otapl.p; pc = NEXTOP(pc,Otapl); break; - /* instructions type aFlp */ - case _native_me: - pc = NEXTOP(pc,aFlp); - break; /* instructions type c */ case _write_atom: pc = NEXTOP(pc,c); @@ -724,8 +726,680 @@ case _trie_try_var_in_pair: pc = NEXTOP(pc,e); break; +#endif +#ifdef YAP_JIT + /* instructions type D */ + case _traced_write_dbterm: + pc = NEXTOP(pc,D); + break; + /* instructions type Illss */ + case _traced_enter_lu_pred: + return walk_got_lu_block(pc->y_u.Illss.I, startp, endp); + /* instructions type J */ + case _traced_jit_handler: + pc = NEXTOP(pc,J); + break; + /* instructions type L */ + case _traced_alloc_for_logical_pred: + return walk_got_lu_clause(pc->y_u.L.ClBase, startp, endp); + /* instructions type N */ + case _traced_write_bigint: + pc = NEXTOP(pc,N); + break; + /* instructions type Osblp */ + case _traced_either: + case _traced_or_else: + clause_code = TRUE; + pp = pc->y_u.Osblp.p0; + pc = NEXTOP(pc,Osblp); + break; + /* instructions type Osbmp */ + case _traced_p_execute: + case _traced_p_execute_tail: + pc = NEXTOP(pc,Osbmp); + break; + /* instructions type Osbpa */ + case _traced_ensure_space: + pc = NEXTOP(pc,Osbpa); + break; + /* instructions type Osbpp */ + case _traced_call: + case _traced_call_cpred: + case _traced_call_usercpred: + case _traced_fcall: + case _traced_p_execute2: + clause_code = TRUE; + pp = pc->y_u.Osbpp.p0; + pc = NEXTOP(pc,Osbpp); + break; + /* instructions type OtILl */ + case _traced_count_trust_logical: + case _traced_profiled_trust_logical: + case _traced_trust_logical: + return walk_got_lu_block(pc->y_u.OtILl.block, startp, endp); + /* instructions type OtaLl */ + case _traced_count_retry_logical: + case _traced_profiled_retry_logical: + case _traced_retry_logical: + case _traced_try_logical: + pc = pc->y_u.OtaLl.n; + break; + /* instructions type OtapFs */ + case _traced_cut_c: + case _traced_cut_userc: + case _traced_retry_c: + case _traced_retry_userc: + case _traced_try_c: + case _traced_try_userc: + clause_code = TRUE; + pp = pc->y_u.OtapFs.p; + pc = NEXTOP(pc,OtapFs); + break; + /* instructions type Otapl */ + case _traced_count_retry_and_mark: + case _traced_count_retry_me: + case _traced_count_trust_me: + case _traced_profiled_retry_and_mark: + case _traced_profiled_retry_me: + case _traced_profiled_trust_me: + case _traced_retry: + case _traced_retry_and_mark: + case _traced_retry_me: + case _traced_spy_or_trymark: + case _traced_trust: + case _traced_trust_me: + case _traced_try_and_mark: + case _traced_try_clause: + case _traced_try_me: + clause_code = FALSE; + pp = pc->y_u.Otapl.p; + pc = NEXTOP(pc,Otapl); + break; + /* instructions type c */ + case _traced_write_atom: + pc = NEXTOP(pc,c); + break; + /* instructions type cc */ + case _traced_get_2atoms: + pc = NEXTOP(pc,cc); + break; + /* instructions type ccc */ + case _traced_get_3atoms: + pc = NEXTOP(pc,ccc); + break; + /* instructions type cccc */ + case _traced_get_4atoms: + pc = NEXTOP(pc,cccc); + break; + /* instructions type ccccc */ + case _traced_get_5atoms: + pc = NEXTOP(pc,ccccc); + break; + /* instructions type cccccc */ + case _traced_get_6atoms: + pc = NEXTOP(pc,cccccc); + break; + /* instructions type clll */ + case _traced_if_not_then: + pc = NEXTOP(pc,clll); + break; + /* instructions type d */ + case _traced_write_float: + pc = NEXTOP(pc,d); + break; + /* instructions type e */ + case _traced_Nstop: + case _traced_allocate: + case _traced_copy_idb_term: + case _traced_expand_index: + case _traced_index_blob: + case _traced_index_dbref: + case _traced_index_long: + case _traced_index_pred: + case _traced_lock_pred: + case _traced_op_fail: + case _traced_p_equal: + case _traced_p_functor: + case _traced_pop: + case _traced_retry_eam: + case _traced_spy_pred: + case _traced_thread_local: + case _traced_trust_fail: + case _traced_undef_p: + case _traced_unify_idb_term: + case _traced_unlock_lu: + case _traced_write_l_list: + case _traced_write_list: + case _traced_write_void: + pc = NEXTOP(pc,e); + break; + /* instructions type fa */ + case _traced_write_l_struc: + case _traced_write_struct: + pc = NEXTOP(pc,fa); + break; + /* instructions type i */ + case _traced_write_longint: + pc = NEXTOP(pc,i); + break; + /* instructions type l */ + case _traced_Ystop: + case _traced_jump: + case _traced_jump_if_var: + case _traced_move_back: + case _traced_p_dif: + case _traced_p_eq: + case _traced_retry2: + case _traced_retry3: + case _traced_retry4: + case _traced_skip: + case _traced_try_clause2: + case _traced_try_clause3: + case _traced_try_clause4: + case _traced_try_in: + pc = NEXTOP(pc,l); + break; + /* instructions type llll */ + case _traced_switch_on_type: + pc = NEXTOP(pc,llll); + break; + /* instructions type lp */ + case _traced_user_switch: + pc = NEXTOP(pc,lp); + break; + /* instructions type o */ + case _traced_unify_l_list: + case _traced_unify_l_list_write: + case _traced_unify_l_void: + case _traced_unify_l_void_write: + case _traced_unify_list: + case _traced_unify_list_write: + case _traced_unify_void: + case _traced_unify_void_write: + pc = NEXTOP(pc,o); + break; + /* instructions type oD */ + case _traced_unify_dbterm: + case _traced_unify_l_dbterm: + pc = NEXTOP(pc,oD); + break; + /* instructions type oN */ + case _traced_unify_bigint: + case _traced_unify_l_bigint: + pc = NEXTOP(pc,oN); + break; + /* instructions type oc */ + case _traced_unify_atom: + case _traced_unify_atom_write: + case _traced_unify_l_atom: + case _traced_unify_l_atom_write: + pc = NEXTOP(pc,oc); + break; + /* instructions type od */ + case _traced_unify_float: + case _traced_unify_float_write: + case _traced_unify_l_float: + case _traced_unify_l_float_write: + pc = NEXTOP(pc,od); + break; + /* instructions type ofa */ + case _traced_unify_l_struc: + case _traced_unify_l_struc_write: + case _traced_unify_struct: + case _traced_unify_struct_write: + pc = NEXTOP(pc,ofa); + break; + /* instructions type oi */ + case _traced_unify_l_longint: + case _traced_unify_l_longint_write: + case _traced_unify_longint: + case _traced_unify_longint_write: + pc = NEXTOP(pc,oi); + break; + /* instructions type ollll */ + case _traced_switch_list_nl: + pc = NEXTOP(pc,ollll); + break; + /* instructions type os */ + case _traced_run_eam: + case _traced_unify_l_n_voids: + case _traced_unify_l_n_voids_write: + case _traced_unify_n_voids: + case _traced_unify_n_voids_write: + pc = NEXTOP(pc,os); + break; + /* instructions type osc */ + case _traced_unify_n_atoms: + case _traced_unify_n_atoms_write: + pc = NEXTOP(pc,osc); + break; + /* instructions type ox */ + case _traced_save_appl_x: + case _traced_save_appl_x_write: + case _traced_save_pair_x: + case _traced_save_pair_x_write: + case _traced_unify_l_x_loc: + case _traced_unify_l_x_loc_write: + case _traced_unify_l_x_val: + case _traced_unify_l_x_val_write: + case _traced_unify_l_x_var: + case _traced_unify_l_x_var_write: + case _traced_unify_x_loc: + case _traced_unify_x_loc_write: + case _traced_unify_x_val: + case _traced_unify_x_val_write: + case _traced_unify_x_var: + case _traced_unify_x_var_write: + pc = NEXTOP(pc,ox); + break; + /* instructions type oxx */ + case _traced_unify_l_x_var2: + case _traced_unify_l_x_var2_write: + case _traced_unify_x_var2: + case _traced_unify_x_var2_write: + pc = NEXTOP(pc,oxx); + break; + /* instructions type oy */ + case _traced_save_appl_y: + case _traced_save_appl_y_write: + case _traced_save_pair_y: + case _traced_save_pair_y_write: + case _traced_unify_l_y_loc: + case _traced_unify_l_y_loc_write: + case _traced_unify_l_y_val: + case _traced_unify_l_y_val_write: + case _traced_unify_l_y_var: + case _traced_unify_l_y_var_write: + case _traced_unify_y_loc: + case _traced_unify_y_loc_write: + case _traced_unify_y_val: + case _traced_unify_y_val_write: + case _traced_unify_y_var: + case _traced_unify_y_var_write: + pc = NEXTOP(pc,oy); + break; + /* instructions type p */ + case _traced_count_call: + case _traced_count_retry: + case _traced_deallocate: + case _traced_enter_profiling: + case _traced_lock_lu: + case _traced_procceed: + case _traced_retry_profiled: + pc = NEXTOP(pc,p); + break; + /* instructions type plxxs */ + case _traced_call_bfunc_xx: + pc = NEXTOP(pc,plxxs); + break; + /* instructions type plxys */ + case _traced_call_bfunc_xy: + case _traced_call_bfunc_yx: + pc = NEXTOP(pc,plxys); + break; + /* instructions type plyys */ + case _traced_call_bfunc_yy: + pc = NEXTOP(pc,plyys); + break; + /* instructions type pp */ + case _traced_dexecute: + case _traced_execute: + case _traced_execute_cpred: + clause_code = TRUE; + pp = pc->y_u.pp.p0; + pc = NEXTOP(pc,pp); + break; + /* instructions type s */ + case _traced_cut: + case _traced_cut_e: + case _traced_cut_t: + case _traced_pop_n: + case _traced_write_n_voids: + pc = NEXTOP(pc,s); + break; + /* instructions type sc */ + case _traced_write_n_atoms: + pc = NEXTOP(pc,sc); + break; + /* instructions type sllll */ + case _traced_switch_on_sub_arg_type: + pc = NEXTOP(pc,sllll); + break; + /* instructions type slp */ + case _traced_call_c_wfail: + pc = NEXTOP(pc,slp); + break; + /* instructions type sssl */ + case _traced_go_on_cons: + case _traced_go_on_func: + case _traced_if_cons: + case _traced_if_func: + case _traced_switch_on_cons: + case _traced_switch_on_func: + pc = NEXTOP(pc,sssl); + break; + /* instructions type sssllp */ + case _traced_expand_clauses: + return found_expand_index(pc, startp, endp, codeptr PASS_REGS); + pc = NEXTOP(pc,sssllp); + break; + /* instructions type x */ + case _traced_get_list: + case _traced_put_list: + case _traced_save_b_x: + case _traced_write_x_loc: + case _traced_write_x_val: + case _traced_write_x_var: + pc = NEXTOP(pc,x); + break; + /* instructions type xD */ + case _traced_get_dbterm: + case _traced_put_dbterm: + pc = NEXTOP(pc,xD); + break; + /* instructions type xN */ + case _traced_get_bigint: + case _traced_put_bigint: + pc = NEXTOP(pc,xN); + break; + /* instructions type xc */ + case _traced_get_atom: + case _traced_put_atom: + pc = NEXTOP(pc,xc); + break; + /* instructions type xd */ + case _traced_get_float: + case _traced_put_float: + pc = NEXTOP(pc,xd); + break; + /* instructions type xfa */ + case _traced_get_struct: + case _traced_put_struct: + pc = NEXTOP(pc,xfa); + break; + /* instructions type xi */ + case _traced_get_longint: + case _traced_put_longint: + pc = NEXTOP(pc,xi); + break; + /* instructions type xl */ + case _traced_p_atom_x: + case _traced_p_atomic_x: + case _traced_p_compound_x: + case _traced_p_db_ref_x: + case _traced_p_float_x: + case _traced_p_integer_x: + case _traced_p_nonvar_x: + case _traced_p_number_x: + case _traced_p_primitive_x: + case _traced_p_var_x: + pc = NEXTOP(pc,xl); + break; + /* instructions type xll */ + case _traced_jump_if_nonvar: + pc = NEXTOP(pc,xll); + break; + /* instructions type xllll */ + case _traced_switch_on_arg_type: + pc = NEXTOP(pc,xllll); + break; + /* instructions type xps */ + case _traced_commit_b_x: + pc = NEXTOP(pc,xps); + break; + /* instructions type xx */ + case _traced_get_x_val: + case _traced_get_x_var: + case _traced_gl_void_valx: + case _traced_gl_void_varx: + case _traced_glist_valx: + case _traced_put_x_val: + case _traced_put_x_var: + pc = NEXTOP(pc,xx); + break; + /* instructions type xxc */ + case _traced_p_func2s_cv: + pc = NEXTOP(pc,xxc); + break; + /* instructions type xxn */ + case _traced_p_and_vc: + case _traced_p_arg_cv: + case _traced_p_div_cv: + case _traced_p_div_vc: + case _traced_p_func2s_vc: + case _traced_p_minus_cv: + case _traced_p_or_vc: + case _traced_p_plus_vc: + case _traced_p_sll_cv: + case _traced_p_sll_vc: + case _traced_p_slr_cv: + case _traced_p_slr_vc: + case _traced_p_times_vc: + pc = NEXTOP(pc,xxn); + break; + /* instructions type xxx */ + case _traced_p_and_vv: + case _traced_p_arg_vv: + case _traced_p_div_vv: + case _traced_p_func2f_xx: + case _traced_p_func2s_vv: + case _traced_p_minus_vv: + case _traced_p_or_vv: + case _traced_p_plus_vv: + case _traced_p_sll_vv: + case _traced_p_slr_vv: + case _traced_p_times_vv: + pc = NEXTOP(pc,xxx); + break; + /* instructions type xxxx */ + case _traced_put_xx_val: + pc = NEXTOP(pc,xxxx); + break; + /* instructions type xxy */ + case _traced_p_func2f_xy: + pc = NEXTOP(pc,xxy); + break; + /* instructions type y */ + case _traced_save_b_y: + case _traced_write_y_loc: + case _traced_write_y_val: + case _traced_write_y_var: + pc = NEXTOP(pc,y); + break; + /* instructions type yl */ + case _traced_p_atom_y: + case _traced_p_atomic_y: + case _traced_p_compound_y: + case _traced_p_db_ref_y: + case _traced_p_float_y: + case _traced_p_integer_y: + case _traced_p_nonvar_y: + case _traced_p_number_y: + case _traced_p_primitive_y: + case _traced_p_var_y: + pc = NEXTOP(pc,yl); + break; + /* instructions type yps */ + case _traced_commit_b_y: + pc = NEXTOP(pc,yps); + break; + /* instructions type yx */ + case _traced_get_y_val: + case _traced_get_y_var: + case _traced_gl_void_valy: + case _traced_gl_void_vary: + case _traced_glist_valy: + case _traced_put_unsafe: + case _traced_put_y_val: + case _traced_put_y_var: + pc = NEXTOP(pc,yx); + break; + /* instructions type yxn */ + case _traced_p_and_y_vc: + case _traced_p_arg_y_cv: + case _traced_p_div_y_cv: + case _traced_p_div_y_vc: + case _traced_p_func2s_y_cv: + case _traced_p_func2s_y_vc: + case _traced_p_minus_y_cv: + case _traced_p_or_y_vc: + case _traced_p_plus_y_vc: + case _traced_p_sll_y_cv: + case _traced_p_sll_y_vc: + case _traced_p_slr_y_cv: + case _traced_p_slr_y_vc: + case _traced_p_times_y_vc: + pc = NEXTOP(pc,yxn); + break; + /* instructions type yxx */ + case _traced_p_and_y_vv: + case _traced_p_arg_y_vv: + case _traced_p_div_y_vv: + case _traced_p_func2f_yx: + case _traced_p_func2s_y_vv: + case _traced_p_minus_y_vv: + case _traced_p_or_y_vv: + case _traced_p_plus_y_vv: + case _traced_p_sll_y_vv: + case _traced_p_slr_y_vv: + case _traced_p_times_y_vv: + pc = NEXTOP(pc,yxx); + break; + /* instructions type yyx */ + case _traced_p_func2f_yy: + pc = NEXTOP(pc,yyx); + break; + /* instructions type yyxx */ + case _traced_get_yy_var: + case _traced_put_y_vals: + pc = NEXTOP(pc,yyxx); + break; +#ifdef YAPOR + /* instructions type Otapl */ + case _traced_getwork: + case _traced_getwork_seq: + case _traced_sync: + clause_code = FALSE; + pp = pc->y_u.Otapl.p; + pc = NEXTOP(pc,Otapl); + break; + /* instructions type e */ + case _traced_getwork_first_time: + pc = NEXTOP(pc,e); + break; +#endif +#ifdef TABLING + /* instructions type Otapl */ + case _traced_table_answer_resolution: + case _traced_table_answer_resolution_completion: + case _traced_table_completion: + case _traced_table_load_answer: + case _traced_table_retry: + case _traced_table_retry_me: + case _traced_table_trust: + case _traced_table_trust_me: + case _traced_table_try: + case _traced_table_try_answer: + case _traced_table_try_me: + case _traced_table_try_single: + clause_code = FALSE; + pp = pc->y_u.Otapl.p; + pc = NEXTOP(pc,Otapl); + break; + /* instructions type e */ + case _traced_clause_with_cut: + pc = NEXTOP(pc,e); + break; + /* instructions type s */ + case _traced_table_new_answer: + pc = NEXTOP(pc,s); + break; + /* instructions type e */ + case _traced_trie_do_appl: + case _traced_trie_do_appl_in_pair: + case _traced_trie_do_atom: + case _traced_trie_do_atom_in_pair: + case _traced_trie_do_bigint: + case _traced_trie_do_double: + case _traced_trie_do_extension: + case _traced_trie_do_gterm: + case _traced_trie_do_longint: + case _traced_trie_do_null: + case _traced_trie_do_null_in_pair: + case _traced_trie_do_pair: + case _traced_trie_do_val: + case _traced_trie_do_val_in_pair: + case _traced_trie_do_var: + case _traced_trie_do_var_in_pair: + case _traced_trie_retry_appl: + case _traced_trie_retry_appl_in_pair: + case _traced_trie_retry_atom: + case _traced_trie_retry_atom_in_pair: + case _traced_trie_retry_bigint: + case _traced_trie_retry_double: + case _traced_trie_retry_extension: + case _traced_trie_retry_gterm: + case _traced_trie_retry_longint: + case _traced_trie_retry_null: + case _traced_trie_retry_null_in_pair: + case _traced_trie_retry_pair: + case _traced_trie_retry_val: + case _traced_trie_retry_val_in_pair: + case _traced_trie_retry_var: + case _traced_trie_retry_var_in_pair: + case _traced_trie_trust_appl: + case _traced_trie_trust_appl_in_pair: + case _traced_trie_trust_atom: + case _traced_trie_trust_atom_in_pair: + case _traced_trie_trust_bigint: + case _traced_trie_trust_double: + case _traced_trie_trust_extension: + case _traced_trie_trust_gterm: + case _traced_trie_trust_longint: + case _traced_trie_trust_null: + case _traced_trie_trust_null_in_pair: + case _traced_trie_trust_pair: + case _traced_trie_trust_val: + case _traced_trie_trust_val_in_pair: + case _traced_trie_trust_var: + case _traced_trie_trust_var_in_pair: + case _traced_trie_try_appl: + case _traced_trie_try_appl_in_pair: + case _traced_trie_try_atom: + case _traced_trie_try_atom_in_pair: + case _traced_trie_try_bigint: + case _traced_trie_try_double: + case _traced_trie_try_extension: + case _traced_trie_try_gterm: + case _traced_trie_try_longint: + case _traced_trie_try_null: + case _traced_trie_try_null_in_pair: + case _traced_trie_try_pair: + case _traced_trie_try_val: + case _traced_trie_try_val_in_pair: + case _traced_trie_try_var: + case _traced_trie_try_var_in_pair: + pc = NEXTOP(pc,e); + break; +#endif #endif /* this instruction is hardwired */ +#ifdef YAP_JIT + case _traced_or_last: +#ifdef YAPOR + pp = pc->y_u.Osblp.p0; + if (pp->PredFlags & MegaClausePredFlag) + return found_mega_clause(pp, startp, endp); + clause_code = TRUE; + pc = NEXTOP(pc,Osblp); +#else + pp = pc->y_u.p.p; + if (pp->PredFlags & MegaClausePredFlag) + return found_mega_clause(pp, startp, endp); + clause_code = TRUE; + pc = NEXTOP(pc,p); +#endif +#endif case _or_last: #ifdef YAPOR pp = pc->y_u.Osblp.p0; diff --git a/JIT/CMakeLists.txt b/JIT/CMakeLists.txt new file mode 100644 index 000000000..0cff928a9 --- /dev/null +++ b/JIT/CMakeLists.txt @@ -0,0 +1,62 @@ +set(LIBJIT_MAJOR_VERSION 0) +set(LIBJIT_MINOR_VERSION 2) +set(LIBJIT_PATCH_VERSION 1) +set(LIBJIT_FULL_VERSION + ${LIBJIT_MAJOR_VERSION}.${LIBJIT_MINOR_VERSION}.${LIBJIT_PATCH_VERSION}) + + +set(LIBJIT_SOURCES + jit_analysispreds.c + jit_configpreds.c + jit_statisticpreds.c + jit_codegenpreds.c + jit_debugpreds.c + jit_transformpreds.c + JIT_Compiler.cpp + ) + +# The following variables are defined: +# LLVM_FOUND - true if LLVM was found +# LLVM_CXXFLAGS - C++ compiler flags for files that include LLVM headers. +# LLVM_HOST_TARGET - Target triple used to configure LLVM. +# LLVM_INCLUDE_DIRS - Directory containing LLVM include files. +# LLVM_LDFLAGS - Linker flags to add when linking against LLVM +# (includes -LLLVM_LIBRARY_DIRS). +# LLVM_LIBRARIES - Full paths to the library files to link against. +# LLVM_LIBRARY_DIRS - Directory containing LLVM libraries. +# LLVM_ROOT_DIR - The root directory of the LLVM installation. +# llvm-config is searched for in ${LLVM_ROOT_DIR}/bin. +# LLVM_VERSION_MAJOR - Major version of LLVM. +# LLVM_VERSION_MINOR - Minor version of LLVM. +# LLVM_VERSION_STRING - Full LLVM version string (e.g. 2.9). +# +# Note: The variable names were chosen in conformance with the offical CMake +# guidelines, see ${CMAKE_ROOT}/Modules/readme.txt. + +# Try suffixed versions to pick up the newest LLVM install available on Debian +# derivatives. +# We also want an user-specified LLVM_ROOT_DIR to take precedence over the +# system default locations such as /usr/local/bin. Executing find_program() +# multiples times is the approach recommended in the docs. + + +# ugh +set (POSITION_INDEPENDENT_CODE TRUE) + +set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} ${LLVM_CXXFLAGS}) + +add_library (libyapjit SHARED + ${LIBJIT_SOURCES}) + +set_target_properties(libyapjit + PROPERTIES + # RPATH ${libdir} VERSION ${LIBJIT_FULL_VERSION} + # SOVERSION ${LIBJIT_MAJOR_VERSION}.${LIBJIT_MINOR_VERSION} + POSITION_INDEPENDENT_CODE TRUE + OUTPUT_NAME YapJIT + ) + +target_link_libraries(libyapjit libYap ${LLVM_LIBRARIES}) + + + diff --git a/JIT/HPP/IsGround.h b/JIT/HPP/IsGround.h index a35001958..f707d45fe 100644 --- a/JIT/HPP/IsGround.h +++ b/JIT/HPP/IsGround.h @@ -9,2411 +9,2410 @@ IsGround(yamop* _p) { n += 1; switch(op){ case _Ystop : - _p = ((yamop *)(&((_p)->u.l.next))); + _p = ((yamop *)(&((_p)->y_u.l.next))); break; case _Nstop : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _try_me : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _retry_me : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _trust_me : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _enter_profiling : - _p = ((yamop *)(&((_p)->u.p.next))); + _p = ((yamop *)(&((_p)->y_u.p.next))); break; case _retry_profiled : - _p = ((yamop *)(&((_p)->u.p.next))); + _p = ((yamop *)(&((_p)->y_u.p.next))); break; case _profiled_retry_me : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _profiled_trust_me : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _profiled_retry_logical : - _p = ((yamop *)(&((_p)->u.OtaLl.next))); + _p = ((yamop *)(&((_p)->y_u.OtaLl.next))); break; case _profiled_trust_logical : - _p = ((yamop *)(&((_p)->u.OtILl.next))); + _p = ((yamop *)(&((_p)->y_u.OtILl.next))); break; case _count_call : - _p = ((yamop *)(&((_p)->u.p.next))); + _p = ((yamop *)(&((_p)->y_u.p.next))); break; case _count_retry : - _p = ((yamop *)(&((_p)->u.p.next))); + _p = ((yamop *)(&((_p)->y_u.p.next))); break; case _count_retry_me : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _count_trust_me : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _count_retry_logical : - _p = ((yamop *)(&((_p)->u.OtaLl.next))); + _p = ((yamop *)(&((_p)->y_u.OtaLl.next))); break; case _count_trust_logical : - _p = ((yamop *)(&((_p)->u.OtILl.next))); + _p = ((yamop *)(&((_p)->y_u.OtILl.next))); break; case _lock_lu : - _p = ((yamop *)(&((_p)->u.p.next))); + _p = ((yamop *)(&((_p)->y_u.p.next))); break; case _unlock_lu : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _alloc_for_logical_pred : - _p = ((yamop *)(&((_p)->u.L.next))); + _p = ((yamop *)(&((_p)->y_u.L.next))); break; case _copy_idb_term : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _unify_idb_term : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _ensure_space : - _p = ((yamop *)(&((_p)->u.Osbpa.next))); + _p = ((yamop *)(&((_p)->y_u.Osbpa.next))); break; case _spy_or_trymark : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _try_and_mark : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _count_retry_and_mark : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _profiled_retry_and_mark : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _retry_and_mark : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _trust_fail : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _op_fail : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _cut : - _p = ((yamop *)(&((_p)->u.s.next))); + _p = ((yamop *)(&((_p)->y_u.s.next))); c = 1; break; case _cut_t : - _p = ((yamop *)(&((_p)->u.s.next))); + _p = ((yamop *)(&((_p)->y_u.s.next))); c = 1; break; case _cut_e : - _p = ((yamop *)(&((_p)->u.s.next))); + _p = ((yamop *)(&((_p)->y_u.s.next))); c = 1; break; case _save_b_x : - _p = ((yamop *)(&((_p)->u.x.next))); + _p = ((yamop *)(&((_p)->y_u.x.next))); break; case _save_b_y : - _p = ((yamop *)(&((_p)->u.y.next))); + _p = ((yamop *)(&((_p)->y_u.y.next))); break; case _commit_b_x : - _p = ((yamop *)(&((_p)->u.xps.next))); + _p = ((yamop *)(&((_p)->y_u.xps.next))); break; case _commit_b_y : - _p = ((yamop *)(&((_p)->u.yps.next))); + _p = ((yamop *)(&((_p)->y_u.yps.next))); break; case _execute : - _p = ((yamop *)(&((_p)->u.pp.next))); + _p = ((yamop *)(&((_p)->y_u.pp.next))); l = (CELL)_p; if (n > 5) return 0; break; case _dexecute : - _p = ((yamop *)(&((_p)->u.pp.next))); + _p = ((yamop *)(&((_p)->y_u.pp.next))); l = (CELL)_p; if (n > 5) return 0; break; case _fcall : - _p = ((yamop *)(&((_p)->u.Osbpp.next))); + _p = ((yamop *)(&((_p)->y_u.Osbpp.next))); if (c || n <= 3) { c = 0; break; } return 0; case _call : - _p = ((yamop *)(&((_p)->u.Osbpp.next))); + _p = ((yamop *)(&((_p)->y_u.Osbpp.next))); if (c || n <= 3) { c = 0; break; } return 0; case _procceed : - _p = ((yamop *)(&((_p)->u.p.next))); + _p = ((yamop *)(&((_p)->y_u.p.next))); l = (CELL)_p; break; case _allocate : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _deallocate : - _p = ((yamop *)(&((_p)->u.p.next))); + _p = ((yamop *)(&((_p)->y_u.p.next))); break; #ifdef BEAM case _retry_eam : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; #endif #ifdef BEAM case _run_eam : - _p = ((yamop *)(&((_p)->u.os.next))); + _p = ((yamop *)(&((_p)->y_u.os.next))); break; #endif case _get_x_var : - _p = ((yamop *)(&((_p)->u.xx.next))); + _p = ((yamop *)(&((_p)->y_u.xx.next))); break; case _get_y_var : - _p = ((yamop *)(&((_p)->u.yx.next))); + _p = ((yamop *)(&((_p)->y_u.yx.next))); break; case _get_yy_var : - _p = ((yamop *)(&((_p)->u.yyxx.next))); + _p = ((yamop *)(&((_p)->y_u.yyxx.next))); break; case _get_x_val : - _p = ((yamop *)(&((_p)->u.xx.next))); + _p = ((yamop *)(&((_p)->y_u.xx.next))); break; case _get_y_val : - _p = ((yamop *)(&((_p)->u.yx.next))); + _p = ((yamop *)(&((_p)->y_u.yx.next))); break; case _get_atom : - _p = ((yamop *)(&((_p)->u.xc.next))); + _p = ((yamop *)(&((_p)->y_u.xc.next))); break; case _get_2atoms : - _p = ((yamop *)(&((_p)->u.cc.next))); + _p = ((yamop *)(&((_p)->y_u.cc.next))); break; case _get_3atoms : - _p = ((yamop *)(&((_p)->u.ccc.next))); + _p = ((yamop *)(&((_p)->y_u.ccc.next))); break; case _get_4atoms : - _p = ((yamop *)(&((_p)->u.cccc.next))); + _p = ((yamop *)(&((_p)->y_u.cccc.next))); break; case _get_5atoms : - _p = ((yamop *)(&((_p)->u.ccccc.next))); + _p = ((yamop *)(&((_p)->y_u.ccccc.next))); break; case _get_6atoms : - _p = ((yamop *)(&((_p)->u.cccccc.next))); + _p = ((yamop *)(&((_p)->y_u.cccccc.next))); break; case _get_list : - _p = ((yamop *)(&((_p)->u.x.next))); + _p = ((yamop *)(&((_p)->y_u.x.next))); break; case _get_struct : - _p = ((yamop *)(&((_p)->u.xfa.next))); + _p = ((yamop *)(&((_p)->y_u.xfa.next))); break; case _get_float : - _p = ((yamop *)(&((_p)->u.xd.next))); + _p = ((yamop *)(&((_p)->y_u.xd.next))); break; case _get_longint : - _p = ((yamop *)(&((_p)->u.xi.next))); + _p = ((yamop *)(&((_p)->y_u.xi.next))); break; case _get_bigint : - _p = ((yamop *)(&((_p)->u.xN.next))); + _p = ((yamop *)(&((_p)->y_u.xN.next))); break; case _get_dbterm : - _p = ((yamop *)(&((_p)->u.xD.next))); + _p = ((yamop *)(&((_p)->y_u.xD.next))); break; case _glist_valx : - _p = ((yamop *)(&((_p)->u.xx.next))); + _p = ((yamop *)(&((_p)->y_u.xx.next))); break; case _glist_valy : - _p = ((yamop *)(&((_p)->u.yx.next))); + _p = ((yamop *)(&((_p)->y_u.yx.next))); break; case _gl_void_varx : - _p = ((yamop *)(&((_p)->u.xx.next))); + _p = ((yamop *)(&((_p)->y_u.xx.next))); break; case _gl_void_vary : - _p = ((yamop *)(&((_p)->u.yx.next))); + _p = ((yamop *)(&((_p)->y_u.yx.next))); break; case _gl_void_valx : - _p = ((yamop *)(&((_p)->u.xx.next))); + _p = ((yamop *)(&((_p)->y_u.xx.next))); break; case _gl_void_valy : - _p = ((yamop *)(&((_p)->u.yx.next))); + _p = ((yamop *)(&((_p)->y_u.yx.next))); break; case _unify_x_var : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _unify_x_var_write : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _unify_l_x_var : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _unify_l_x_var_write : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _unify_x_var2 : - _p = ((yamop *)(&((_p)->u.oxx.next))); + _p = ((yamop *)(&((_p)->y_u.oxx.next))); break; case _unify_x_var2_write : - _p = ((yamop *)(&((_p)->u.oxx.next))); + _p = ((yamop *)(&((_p)->y_u.oxx.next))); break; case _unify_l_x_var2 : - _p = ((yamop *)(&((_p)->u.oxx.next))); + _p = ((yamop *)(&((_p)->y_u.oxx.next))); break; case _unify_l_x_var2_write : - _p = ((yamop *)(&((_p)->u.oxx.next))); + _p = ((yamop *)(&((_p)->y_u.oxx.next))); break; case _unify_y_var : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _unify_y_var_write : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _unify_l_y_var : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _unify_l_y_var_write : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _unify_x_val : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _unify_x_val_write : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _unify_l_x_val : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _unify_l_x_val_write : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _unify_y_val : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _unify_y_val_write : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _unify_l_y_val : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _unify_l_y_val_write : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _unify_x_loc : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _unify_x_loc_write : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _unify_l_x_loc : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _unify_l_x_loc_write : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _unify_y_loc : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _unify_y_loc_write : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _unify_l_y_loc : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _unify_l_y_loc_write : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _unify_void : - _p = ((yamop *)(&((_p)->u.o.next))); + _p = ((yamop *)(&((_p)->y_u.o.next))); break; case _unify_void_write : - _p = ((yamop *)(&((_p)->u.o.next))); + _p = ((yamop *)(&((_p)->y_u.o.next))); break; case _unify_l_void : - _p = ((yamop *)(&((_p)->u.o.next))); + _p = ((yamop *)(&((_p)->y_u.o.next))); break; case _unify_l_void_write : - _p = ((yamop *)(&((_p)->u.o.next))); + _p = ((yamop *)(&((_p)->y_u.o.next))); break; case _unify_n_voids : - _p = ((yamop *)(&((_p)->u.os.next))); + _p = ((yamop *)(&((_p)->y_u.os.next))); break; case _unify_n_voids_write : - _p = ((yamop *)(&((_p)->u.os.next))); + _p = ((yamop *)(&((_p)->y_u.os.next))); break; case _unify_l_n_voids : - _p = ((yamop *)(&((_p)->u.os.next))); + _p = ((yamop *)(&((_p)->y_u.os.next))); break; case _unify_l_n_voids_write : - _p = ((yamop *)(&((_p)->u.os.next))); + _p = ((yamop *)(&((_p)->y_u.os.next))); break; case _unify_atom : - _p = ((yamop *)(&((_p)->u.oc.next))); + _p = ((yamop *)(&((_p)->y_u.oc.next))); break; case _unify_atom_write : - _p = ((yamop *)(&((_p)->u.oc.next))); + _p = ((yamop *)(&((_p)->y_u.oc.next))); break; case _unify_l_atom : - _p = ((yamop *)(&((_p)->u.oc.next))); + _p = ((yamop *)(&((_p)->y_u.oc.next))); break; case _unify_l_atom_write : - _p = ((yamop *)(&((_p)->u.oc.next))); + _p = ((yamop *)(&((_p)->y_u.oc.next))); break; case _unify_n_atoms : - _p = ((yamop *)(&((_p)->u.osc.next))); + _p = ((yamop *)(&((_p)->y_u.osc.next))); break; case _unify_n_atoms_write : - _p = ((yamop *)(&((_p)->u.osc.next))); + _p = ((yamop *)(&((_p)->y_u.osc.next))); break; case _unify_float : - _p = ((yamop *)(&((_p)->u.od.next))); + _p = ((yamop *)(&((_p)->y_u.od.next))); break; case _unify_float_write : - _p = ((yamop *)(&((_p)->u.od.next))); + _p = ((yamop *)(&((_p)->y_u.od.next))); break; case _unify_l_float : - _p = ((yamop *)(&((_p)->u.od.next))); + _p = ((yamop *)(&((_p)->y_u.od.next))); break; case _unify_l_float_write : - _p = ((yamop *)(&((_p)->u.od.next))); + _p = ((yamop *)(&((_p)->y_u.od.next))); break; case _unify_longint : - _p = ((yamop *)(&((_p)->u.oi.next))); + _p = ((yamop *)(&((_p)->y_u.oi.next))); break; case _unify_longint_write : - _p = ((yamop *)(&((_p)->u.oi.next))); + _p = ((yamop *)(&((_p)->y_u.oi.next))); break; case _unify_l_longint : - _p = ((yamop *)(&((_p)->u.oi.next))); + _p = ((yamop *)(&((_p)->y_u.oi.next))); break; case _unify_l_longint_write : - _p = ((yamop *)(&((_p)->u.oi.next))); + _p = ((yamop *)(&((_p)->y_u.oi.next))); break; case _unify_bigint : - _p = ((yamop *)(&((_p)->u.oN.next))); + _p = ((yamop *)(&((_p)->y_u.oN.next))); break; case _unify_l_bigint : - _p = ((yamop *)(&((_p)->u.oN.next))); + _p = ((yamop *)(&((_p)->y_u.oN.next))); break; case _unify_dbterm : - _p = ((yamop *)(&((_p)->u.oD.next))); + _p = ((yamop *)(&((_p)->y_u.oD.next))); break; case _unify_l_dbterm : - _p = ((yamop *)(&((_p)->u.oD.next))); + _p = ((yamop *)(&((_p)->y_u.oD.next))); break; case _unify_list : - _p = ((yamop *)(&((_p)->u.o.next))); + _p = ((yamop *)(&((_p)->y_u.o.next))); break; case _unify_list_write : - _p = ((yamop *)(&((_p)->u.o.next))); + _p = ((yamop *)(&((_p)->y_u.o.next))); break; case _unify_l_list : - _p = ((yamop *)(&((_p)->u.o.next))); + _p = ((yamop *)(&((_p)->y_u.o.next))); break; case _unify_l_list_write : - _p = ((yamop *)(&((_p)->u.o.next))); + _p = ((yamop *)(&((_p)->y_u.o.next))); break; case _unify_struct : - _p = ((yamop *)(&((_p)->u.ofa.next))); + _p = ((yamop *)(&((_p)->y_u.ofa.next))); break; case _unify_struct_write : - _p = ((yamop *)(&((_p)->u.ofa.next))); + _p = ((yamop *)(&((_p)->y_u.ofa.next))); break; case _unify_l_struc : - _p = ((yamop *)(&((_p)->u.ofa.next))); + _p = ((yamop *)(&((_p)->y_u.ofa.next))); break; case _unify_l_struc_write : - _p = ((yamop *)(&((_p)->u.ofa.next))); + _p = ((yamop *)(&((_p)->y_u.ofa.next))); break; case _put_x_var : - _p = ((yamop *)(&((_p)->u.xx.next))); + _p = ((yamop *)(&((_p)->y_u.xx.next))); break; case _put_y_var : - _p = ((yamop *)(&((_p)->u.yx.next))); + _p = ((yamop *)(&((_p)->y_u.yx.next))); break; case _put_x_val : - _p = ((yamop *)(&((_p)->u.xx.next))); + _p = ((yamop *)(&((_p)->y_u.xx.next))); break; case _put_xx_val : - _p = ((yamop *)(&((_p)->u.xxxx.next))); + _p = ((yamop *)(&((_p)->y_u.xxxx.next))); break; case _put_y_val : - _p = ((yamop *)(&((_p)->u.yx.next))); + _p = ((yamop *)(&((_p)->y_u.yx.next))); break; case _put_y_vals : - _p = ((yamop *)(&((_p)->u.yyxx.next))); + _p = ((yamop *)(&((_p)->y_u.yyxx.next))); break; case _put_unsafe : - _p = ((yamop *)(&((_p)->u.yx.next))); + _p = ((yamop *)(&((_p)->y_u.yx.next))); break; case _put_atom : - _p = ((yamop *)(&((_p)->u.xc.next))); + _p = ((yamop *)(&((_p)->y_u.xc.next))); break; case _put_dbterm : - _p = ((yamop *)(&((_p)->u.xD.next))); + _p = ((yamop *)(&((_p)->y_u.xD.next))); break; case _put_bigint : - _p = ((yamop *)(&((_p)->u.xN.next))); + _p = ((yamop *)(&((_p)->y_u.xN.next))); break; case _put_float : - _p = ((yamop *)(&((_p)->u.xd.next))); + _p = ((yamop *)(&((_p)->y_u.xd.next))); break; case _put_longint : - _p = ((yamop *)(&((_p)->u.xi.next))); + _p = ((yamop *)(&((_p)->y_u.xi.next))); break; case _put_list : - _p = ((yamop *)(&((_p)->u.x.next))); + _p = ((yamop *)(&((_p)->y_u.x.next))); break; case _put_struct : - _p = ((yamop *)(&((_p)->u.xfa.next))); + _p = ((yamop *)(&((_p)->y_u.xfa.next))); break; case _write_x_var : - _p = ((yamop *)(&((_p)->u.x.next))); + _p = ((yamop *)(&((_p)->y_u.x.next))); break; case _write_void : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _write_n_voids : - _p = ((yamop *)(&((_p)->u.s.next))); + _p = ((yamop *)(&((_p)->y_u.s.next))); break; case _write_y_var : - _p = ((yamop *)(&((_p)->u.y.next))); + _p = ((yamop *)(&((_p)->y_u.y.next))); break; case _write_x_val : - _p = ((yamop *)(&((_p)->u.x.next))); + _p = ((yamop *)(&((_p)->y_u.x.next))); break; case _write_x_loc : - _p = ((yamop *)(&((_p)->u.x.next))); + _p = ((yamop *)(&((_p)->y_u.x.next))); break; case _write_y_val : - _p = ((yamop *)(&((_p)->u.y.next))); + _p = ((yamop *)(&((_p)->y_u.y.next))); break; case _write_y_loc : - _p = ((yamop *)(&((_p)->u.y.next))); + _p = ((yamop *)(&((_p)->y_u.y.next))); break; case _write_atom : - _p = ((yamop *)(&((_p)->u.c.next))); + _p = ((yamop *)(&((_p)->y_u.c.next))); break; case _write_bigint : - _p = ((yamop *)(&((_p)->u.N.next))); + _p = ((yamop *)(&((_p)->y_u.N.next))); break; case _write_dbterm : - _p = ((yamop *)(&((_p)->u.D.next))); + _p = ((yamop *)(&((_p)->y_u.D.next))); break; case _write_float : - _p = ((yamop *)(&((_p)->u.d.next))); + _p = ((yamop *)(&((_p)->y_u.d.next))); break; case _write_longint : - _p = ((yamop *)(&((_p)->u.i.next))); + _p = ((yamop *)(&((_p)->y_u.i.next))); break; case _write_n_atoms : - _p = ((yamop *)(&((_p)->u.sc.next))); + _p = ((yamop *)(&((_p)->y_u.sc.next))); break; case _write_list : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _write_l_list : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _write_struct : - _p = ((yamop *)(&((_p)->u.fa.next))); + _p = ((yamop *)(&((_p)->y_u.fa.next))); break; case _write_l_struc : - _p = ((yamop *)(&((_p)->u.fa.next))); + _p = ((yamop *)(&((_p)->y_u.fa.next))); break; case _save_pair_x : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _save_pair_x_write : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _save_pair_y : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _save_pair_y_write : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _save_appl_x : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _save_appl_x_write : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _save_appl_y : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _save_appl_y_write : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _jump : - _p = ((yamop *)(&((_p)->u.l.next))); + _p = ((yamop *)(&((_p)->y_u.l.next))); break; case _move_back : - _p = ((yamop *)(&((_p)->u.l.next))); + _p = ((yamop *)(&((_p)->y_u.l.next))); break; case _skip : - _p = ((yamop *)(&((_p)->u.l.next))); + _p = ((yamop *)(&((_p)->y_u.l.next))); break; case _either : - _p = ((yamop *)(&((_p)->u.Osblp.next))); + _p = ((yamop *)(&((_p)->y_u.Osblp.next))); break; case _or_else : - _p = ((yamop *)(&((_p)->u.Osblp.next))); + _p = ((yamop *)(&((_p)->y_u.Osblp.next))); break; case _pop_n : - _p = ((yamop *)(&((_p)->u.s.next))); + _p = ((yamop *)(&((_p)->y_u.s.next))); break; case _pop : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _call_cpred : - _p = ((yamop *)(&((_p)->u.Osbpp.next))); + _p = ((yamop *)(&((_p)->y_u.Osbpp.next))); break; case _execute_cpred : - _p = ((yamop *)(&((_p)->u.pp.next))); + _p = ((yamop *)(&((_p)->y_u.pp.next))); break; case _call_usercpred : - _p = ((yamop *)(&((_p)->u.Osbpp.next))); + _p = ((yamop *)(&((_p)->y_u.Osbpp.next))); break; case _call_c_wfail : - _p = ((yamop *)(&((_p)->u.slp.next))); + _p = ((yamop *)(&((_p)->y_u.slp.next))); break; case _try_c : - _p = ((yamop *)(&((_p)->u.OtapFs.next))); + _p = ((yamop *)(&((_p)->y_u.OtapFs.next))); break; case _retry_c : - _p = ((yamop *)(&((_p)->u.OtapFs.next))); + _p = ((yamop *)(&((_p)->y_u.OtapFs.next))); break; #ifdef CUT_C case _cut_c : - _p = ((yamop *)(&((_p)->u.OtapFs.next))); + _p = ((yamop *)(&((_p)->y_u.OtapFs.next))); c = 1; break; #endif case _try_userc : - _p = ((yamop *)(&((_p)->u.OtapFs.next))); + _p = ((yamop *)(&((_p)->y_u.OtapFs.next))); break; case _retry_userc : - _p = ((yamop *)(&((_p)->u.OtapFs.next))); + _p = ((yamop *)(&((_p)->y_u.OtapFs.next))); break; #ifdef CUT_C case _cut_userc : - _p = ((yamop *)(&((_p)->u.OtapFs.next))); + _p = ((yamop *)(&((_p)->y_u.OtapFs.next))); c = 1; break; #endif case _lock_pred : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _index_pred : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; #ifdef THREADS case _thread_local : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; #endif case _expand_index : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _expand_clauses : - _p = ((yamop *)(&((_p)->u.sssllp.next))); + _p = ((yamop *)(&((_p)->y_u.sssllp.next))); break; case _undef_p : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _spy_pred : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _try_clause : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _try_clause2 : - _p = ((yamop *)(&((_p)->u.l.next))); + _p = ((yamop *)(&((_p)->y_u.l.next))); break; case _try_clause3 : - _p = ((yamop *)(&((_p)->u.l.next))); + _p = ((yamop *)(&((_p)->y_u.l.next))); break; case _try_clause4 : - _p = ((yamop *)(&((_p)->u.l.next))); + _p = ((yamop *)(&((_p)->y_u.l.next))); break; case _retry : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _retry2 : - _p = ((yamop *)(&((_p)->u.l.next))); + _p = ((yamop *)(&((_p)->y_u.l.next))); break; case _retry3 : - _p = ((yamop *)(&((_p)->u.l.next))); + _p = ((yamop *)(&((_p)->y_u.l.next))); break; case _retry4 : - _p = ((yamop *)(&((_p)->u.l.next))); + _p = ((yamop *)(&((_p)->y_u.l.next))); break; case _trust : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _try_in : - _p = ((yamop *)(&((_p)->u.l.next))); - break; - case _enter_lu_pred : - _p = ((yamop *)(&((_p)->u.Illss.next))); + _p = ((yamop *)(&((_p)->y_u.l.next))); break; case _try_logical : - _p = ((yamop *)(&((_p)->u.OtaLl.next))); + _p = ((yamop *)(&((_p)->y_u.OtaLl.next))); break; case _retry_logical : - _p = ((yamop *)(&((_p)->u.OtaLl.next))); + _p = ((yamop *)(&((_p)->y_u.OtaLl.next))); break; case _trust_logical : - _p = ((yamop *)(&((_p)->u.OtILl.next))); + _p = ((yamop *)(&((_p)->y_u.OtILl.next))); break; case _user_switch : - _p = ((yamop *)(&((_p)->u.lp.next))); + _p = ((yamop *)(&((_p)->y_u.lp.next))); break; case _switch_on_type : - _p = ((yamop *)(&((_p)->u.llll.next))); + _p = ((yamop *)(&((_p)->y_u.llll.next))); break; case _switch_list_nl : - _p = ((yamop *)(&((_p)->u.ollll.next))); + _p = ((yamop *)(&((_p)->y_u.ollll.next))); break; case _switch_on_arg_type : - _p = ((yamop *)(&((_p)->u.xllll.next))); + _p = ((yamop *)(&((_p)->y_u.xllll.next))); break; case _switch_on_sub_arg_type : - _p = ((yamop *)(&((_p)->u.sllll.next))); + _p = ((yamop *)(&((_p)->y_u.sllll.next))); break; case _jump_if_var : - _p = ((yamop *)(&((_p)->u.l.next))); + _p = ((yamop *)(&((_p)->y_u.l.next))); break; case _jump_if_nonvar : - _p = ((yamop *)(&((_p)->u.xll.next))); + _p = ((yamop *)(&((_p)->y_u.xll.next))); break; case _if_not_then : - _p = ((yamop *)(&((_p)->u.clll.next))); + _p = ((yamop *)(&((_p)->y_u.clll.next))); break; case _switch_on_func : - _p = ((yamop *)(&((_p)->u.sssl.next))); + _p = ((yamop *)(&((_p)->y_u.sssl.next))); break; case _switch_on_cons : - _p = ((yamop *)(&((_p)->u.sssl.next))); + _p = ((yamop *)(&((_p)->y_u.sssl.next))); break; case _go_on_func : - _p = ((yamop *)(&((_p)->u.sssl.next))); + _p = ((yamop *)(&((_p)->y_u.sssl.next))); break; case _go_on_cons : - _p = ((yamop *)(&((_p)->u.sssl.next))); + _p = ((yamop *)(&((_p)->y_u.sssl.next))); break; case _if_func : - _p = ((yamop *)(&((_p)->u.sssl.next))); + _p = ((yamop *)(&((_p)->y_u.sssl.next))); break; case _if_cons : - _p = ((yamop *)(&((_p)->u.sssl.next))); + _p = ((yamop *)(&((_p)->y_u.sssl.next))); break; case _index_dbref : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _index_blob : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _index_long : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _jit_handler : - _p = ((yamop *)(&((_p)->u.jhc.next))); + _p = ((yamop *)(&((_p)->y_u.J.next))); break; case _p_atom_x : - _p = ((yamop *)(&((_p)->u.xl.next))); + _p = ((yamop *)(&((_p)->y_u.xl.next))); break; case _p_atom_y : - _p = ((yamop *)(&((_p)->u.yl.next))); + _p = ((yamop *)(&((_p)->y_u.yl.next))); break; case _p_atomic_x : - _p = ((yamop *)(&((_p)->u.xl.next))); + _p = ((yamop *)(&((_p)->y_u.xl.next))); break; case _p_atomic_y : - _p = ((yamop *)(&((_p)->u.yl.next))); + _p = ((yamop *)(&((_p)->y_u.yl.next))); break; case _p_integer_x : - _p = ((yamop *)(&((_p)->u.xl.next))); + _p = ((yamop *)(&((_p)->y_u.xl.next))); break; case _p_integer_y : - _p = ((yamop *)(&((_p)->u.yl.next))); + _p = ((yamop *)(&((_p)->y_u.yl.next))); break; case _p_nonvar_x : - _p = ((yamop *)(&((_p)->u.xl.next))); + _p = ((yamop *)(&((_p)->y_u.xl.next))); break; case _p_nonvar_y : - _p = ((yamop *)(&((_p)->u.yl.next))); + _p = ((yamop *)(&((_p)->y_u.yl.next))); break; case _p_number_x : - _p = ((yamop *)(&((_p)->u.xl.next))); + _p = ((yamop *)(&((_p)->y_u.xl.next))); break; case _p_number_y : - _p = ((yamop *)(&((_p)->u.yl.next))); + _p = ((yamop *)(&((_p)->y_u.yl.next))); break; case _p_var_x : - _p = ((yamop *)(&((_p)->u.xl.next))); + _p = ((yamop *)(&((_p)->y_u.xl.next))); break; case _p_var_y : - _p = ((yamop *)(&((_p)->u.yl.next))); + _p = ((yamop *)(&((_p)->y_u.yl.next))); break; case _p_db_ref_x : - _p = ((yamop *)(&((_p)->u.xl.next))); + _p = ((yamop *)(&((_p)->y_u.xl.next))); break; case _p_db_ref_y : - _p = ((yamop *)(&((_p)->u.yl.next))); + _p = ((yamop *)(&((_p)->y_u.yl.next))); break; case _p_primitive_x : - _p = ((yamop *)(&((_p)->u.xl.next))); + _p = ((yamop *)(&((_p)->y_u.xl.next))); break; case _p_primitive_y : - _p = ((yamop *)(&((_p)->u.yl.next))); + _p = ((yamop *)(&((_p)->y_u.yl.next))); break; case _p_compound_x : - _p = ((yamop *)(&((_p)->u.xl.next))); + _p = ((yamop *)(&((_p)->y_u.xl.next))); break; case _p_compound_y : - _p = ((yamop *)(&((_p)->u.yl.next))); + _p = ((yamop *)(&((_p)->y_u.yl.next))); break; case _p_float_x : - _p = ((yamop *)(&((_p)->u.xl.next))); + _p = ((yamop *)(&((_p)->y_u.xl.next))); break; case _p_float_y : - _p = ((yamop *)(&((_p)->u.yl.next))); + _p = ((yamop *)(&((_p)->y_u.yl.next))); break; case _p_plus_vv : - _p = ((yamop *)(&((_p)->u.xxx.next))); + _p = ((yamop *)(&((_p)->y_u.xxx.next))); break; case _p_plus_vc : - _p = ((yamop *)(&((_p)->u.xxn.next))); + _p = ((yamop *)(&((_p)->y_u.xxn.next))); break; case _p_plus_y_vv : - _p = ((yamop *)(&((_p)->u.yxx.next))); + _p = ((yamop *)(&((_p)->y_u.yxx.next))); break; case _p_plus_y_vc : - _p = ((yamop *)(&((_p)->u.yxn.next))); + _p = ((yamop *)(&((_p)->y_u.yxn.next))); break; case _p_minus_vv : - _p = ((yamop *)(&((_p)->u.xxx.next))); + _p = ((yamop *)(&((_p)->y_u.xxx.next))); break; case _p_minus_cv : - _p = ((yamop *)(&((_p)->u.xxn.next))); + _p = ((yamop *)(&((_p)->y_u.xxn.next))); break; case _p_minus_y_vv : - _p = ((yamop *)(&((_p)->u.yxx.next))); + _p = ((yamop *)(&((_p)->y_u.yxx.next))); break; case _p_minus_y_cv : - _p = ((yamop *)(&((_p)->u.yxn.next))); + _p = ((yamop *)(&((_p)->y_u.yxn.next))); break; case _p_times_vv : - _p = ((yamop *)(&((_p)->u.xxx.next))); + _p = ((yamop *)(&((_p)->y_u.xxx.next))); break; case _p_times_vc : - _p = ((yamop *)(&((_p)->u.xxn.next))); + _p = ((yamop *)(&((_p)->y_u.xxn.next))); break; case _p_times_y_vv : - _p = ((yamop *)(&((_p)->u.yxx.next))); + _p = ((yamop *)(&((_p)->y_u.yxx.next))); break; case _p_times_y_vc : - _p = ((yamop *)(&((_p)->u.yxn.next))); + _p = ((yamop *)(&((_p)->y_u.yxn.next))); break; case _p_div_vv : - _p = ((yamop *)(&((_p)->u.xxx.next))); + _p = ((yamop *)(&((_p)->y_u.xxx.next))); break; case _p_div_vc : - _p = ((yamop *)(&((_p)->u.xxn.next))); + _p = ((yamop *)(&((_p)->y_u.xxn.next))); break; case _p_div_cv : - _p = ((yamop *)(&((_p)->u.xxn.next))); + _p = ((yamop *)(&((_p)->y_u.xxn.next))); break; case _p_div_y_vv : - _p = ((yamop *)(&((_p)->u.yxx.next))); + _p = ((yamop *)(&((_p)->y_u.yxx.next))); break; case _p_div_y_vc : - _p = ((yamop *)(&((_p)->u.yxn.next))); + _p = ((yamop *)(&((_p)->y_u.yxn.next))); break; case _p_div_y_cv : - _p = ((yamop *)(&((_p)->u.yxn.next))); + _p = ((yamop *)(&((_p)->y_u.yxn.next))); break; case _p_and_vv : - _p = ((yamop *)(&((_p)->u.xxx.next))); + _p = ((yamop *)(&((_p)->y_u.xxx.next))); break; case _p_and_vc : - _p = ((yamop *)(&((_p)->u.xxn.next))); + _p = ((yamop *)(&((_p)->y_u.xxn.next))); break; case _p_and_y_vv : - _p = ((yamop *)(&((_p)->u.yxx.next))); + _p = ((yamop *)(&((_p)->y_u.yxx.next))); break; case _p_and_y_vc : - _p = ((yamop *)(&((_p)->u.yxn.next))); + _p = ((yamop *)(&((_p)->y_u.yxn.next))); break; case _p_or_vv : - _p = ((yamop *)(&((_p)->u.xxx.next))); + _p = ((yamop *)(&((_p)->y_u.xxx.next))); break; case _p_or_vc : - _p = ((yamop *)(&((_p)->u.xxn.next))); + _p = ((yamop *)(&((_p)->y_u.xxn.next))); break; case _p_or_y_vv : - _p = ((yamop *)(&((_p)->u.yxx.next))); + _p = ((yamop *)(&((_p)->y_u.yxx.next))); break; case _p_or_y_vc : - _p = ((yamop *)(&((_p)->u.yxn.next))); + _p = ((yamop *)(&((_p)->y_u.yxn.next))); break; case _p_sll_vv : - _p = ((yamop *)(&((_p)->u.xxx.next))); + _p = ((yamop *)(&((_p)->y_u.xxx.next))); break; case _p_sll_vc : - _p = ((yamop *)(&((_p)->u.xxn.next))); + _p = ((yamop *)(&((_p)->y_u.xxn.next))); break; case _p_sll_cv : - _p = ((yamop *)(&((_p)->u.xxn.next))); + _p = ((yamop *)(&((_p)->y_u.xxn.next))); break; case _p_sll_y_vv : - _p = ((yamop *)(&((_p)->u.yxx.next))); + _p = ((yamop *)(&((_p)->y_u.yxx.next))); break; case _p_sll_y_vc : - _p = ((yamop *)(&((_p)->u.yxn.next))); + _p = ((yamop *)(&((_p)->y_u.yxn.next))); break; case _p_sll_y_cv : - _p = ((yamop *)(&((_p)->u.yxn.next))); + _p = ((yamop *)(&((_p)->y_u.yxn.next))); break; case _p_slr_vv : - _p = ((yamop *)(&((_p)->u.xxx.next))); + _p = ((yamop *)(&((_p)->y_u.xxx.next))); break; case _p_slr_vc : - _p = ((yamop *)(&((_p)->u.xxn.next))); + _p = ((yamop *)(&((_p)->y_u.xxn.next))); break; case _p_slr_cv : - _p = ((yamop *)(&((_p)->u.xxn.next))); + _p = ((yamop *)(&((_p)->y_u.xxn.next))); break; case _p_slr_y_vv : - _p = ((yamop *)(&((_p)->u.yxx.next))); + _p = ((yamop *)(&((_p)->y_u.yxx.next))); break; case _p_slr_y_vc : - _p = ((yamop *)(&((_p)->u.yxn.next))); + _p = ((yamop *)(&((_p)->y_u.yxn.next))); break; case _p_slr_y_cv : - _p = ((yamop *)(&((_p)->u.yxn.next))); + _p = ((yamop *)(&((_p)->y_u.yxn.next))); break; case _call_bfunc_xx : - _p = ((yamop *)(&((_p)->u.plxxs.next))); + _p = ((yamop *)(&((_p)->y_u.plxxs.next))); break; case _call_bfunc_yx : - _p = ((yamop *)(&((_p)->u.plxys.next))); + _p = ((yamop *)(&((_p)->y_u.plxys.next))); break; case _call_bfunc_xy : - _p = ((yamop *)(&((_p)->u.plxys.next))); + _p = ((yamop *)(&((_p)->y_u.plxys.next))); break; case _call_bfunc_yy : - _p = ((yamop *)(&((_p)->u.plyys.next))); + _p = ((yamop *)(&((_p)->y_u.plyys.next))); break; case _p_equal : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _p_dif : - _p = ((yamop *)(&((_p)->u.l.next))); + _p = ((yamop *)(&((_p)->y_u.l.next))); break; case _p_eq : - _p = ((yamop *)(&((_p)->u.l.next))); + _p = ((yamop *)(&((_p)->y_u.l.next))); break; case _p_arg_vv : - _p = ((yamop *)(&((_p)->u.xxx.next))); + _p = ((yamop *)(&((_p)->y_u.xxx.next))); break; case _p_arg_cv : - _p = ((yamop *)(&((_p)->u.xxn.next))); + _p = ((yamop *)(&((_p)->y_u.xxn.next))); break; case _p_arg_y_vv : - _p = ((yamop *)(&((_p)->u.yxx.next))); + _p = ((yamop *)(&((_p)->y_u.yxx.next))); break; case _p_arg_y_cv : - _p = ((yamop *)(&((_p)->u.yxn.next))); + _p = ((yamop *)(&((_p)->y_u.yxn.next))); break; case _p_func2s_vv : - _p = ((yamop *)(&((_p)->u.xxx.next))); + _p = ((yamop *)(&((_p)->y_u.xxx.next))); break; case _p_func2s_cv : - _p = ((yamop *)(&((_p)->u.xxc.next))); + _p = ((yamop *)(&((_p)->y_u.xxc.next))); break; case _p_func2s_vc : - _p = ((yamop *)(&((_p)->u.xxn.next))); + _p = ((yamop *)(&((_p)->y_u.xxn.next))); break; case _p_func2s_y_vv : - _p = ((yamop *)(&((_p)->u.yxx.next))); + _p = ((yamop *)(&((_p)->y_u.yxx.next))); break; case _p_func2s_y_cv : - _p = ((yamop *)(&((_p)->u.yxn.next))); + _p = ((yamop *)(&((_p)->y_u.yxn.next))); break; case _p_func2s_y_vc : - _p = ((yamop *)(&((_p)->u.yxn.next))); + _p = ((yamop *)(&((_p)->y_u.yxn.next))); break; case _p_func2f_xx : - _p = ((yamop *)(&((_p)->u.xxx.next))); + _p = ((yamop *)(&((_p)->y_u.xxx.next))); break; case _p_func2f_xy : - _p = ((yamop *)(&((_p)->u.xxy.next))); + _p = ((yamop *)(&((_p)->y_u.xxy.next))); break; case _p_func2f_yx : - _p = ((yamop *)(&((_p)->u.yxx.next))); + _p = ((yamop *)(&((_p)->y_u.yxx.next))); break; case _p_func2f_yy : - _p = ((yamop *)(&((_p)->u.yyx.next))); + _p = ((yamop *)(&((_p)->y_u.yyx.next))); break; case _p_functor : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _p_execute2 : - _p = ((yamop *)(&((_p)->u.Osbpp.next))); + _p = ((yamop *)(&((_p)->y_u.Osbpp.next))); break; case _p_execute : - _p = ((yamop *)(&((_p)->u.Osbmp.next))); + _p = ((yamop *)(&((_p)->y_u.Osbmp.next))); break; case _p_execute_tail : - _p = ((yamop *)(&((_p)->u.Osbpp.next))); + _p = ((yamop *)(&((_p)->y_u.Osbpp.next))); break; #ifdef YAPOR case _getwork_first_time : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _getwork : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _getwork_seq : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _sync : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; #endif #ifdef TABLING #ifdef TABLING_INNER_CUTS case _clause_with_cut : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; #endif case _table_load_answer : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _table_try_answer : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _table_try_single : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _table_try_me : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _table_try : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _table_retry_me : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _table_retry : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _table_trust_me : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _table_trust : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _table_new_answer : - _p = ((yamop *)(&((_p)->u.s.next))); + _p = ((yamop *)(&((_p)->y_u.s.next))); break; case _table_answer_resolution : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _table_completion : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; #ifdef THREADS_CONSUMER_SHARING case _table_answer_resolution_completion: - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; #endif case _trie_do_var : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_trust_var : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_try_var : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_retry_var : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_do_var_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_trust_var_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_try_var_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_retry_var_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_do_val : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_trust_val : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_try_val : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_retry_val : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_do_val_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_trust_val_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_try_val_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_retry_val_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_do_atom : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_trust_atom : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_try_atom : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_retry_atom : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_do_atom_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_trust_atom_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_try_atom_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_retry_atom_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_do_null : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_trust_null : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_try_null : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_retry_null : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_do_null_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_trust_null_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_try_null_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_retry_null_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_do_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_trust_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_try_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_retry_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_do_appl : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_trust_appl : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_try_appl : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_retry_appl : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_do_appl_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_trust_appl_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_try_appl_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_retry_appl_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_do_extension : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_trust_extension : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_try_extension : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_retry_extension : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_do_double : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_trust_double : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_try_double : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_retry_double : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_do_longint : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_trust_longint : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_try_longint : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_retry_longint : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_do_gterm : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_trust_gterm : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_try_gterm : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_retry_gterm : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; #endif #ifdef YAPOR case _or_last : - _p = ((yamop *)(&((_p)->u.sblp.next))); + _p = ((yamop *)(&((_p)->y_u.sblp.next))); break; #else case _or_last : - _p = ((yamop *)(&((_p)->u.p.next))); + _p = ((yamop *)(&((_p)->y_u.p.next))); break; #endif case _traced_Ystop : - _p = ((yamop *)(&((_p)->u.l.next))); + _p = ((yamop *)(&((_p)->y_u.l.next))); break; case _traced_Nstop : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_try_me : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _traced_retry_me : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _traced_trust_me : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _traced_enter_profiling : - _p = ((yamop *)(&((_p)->u.p.next))); + _p = ((yamop *)(&((_p)->y_u.p.next))); break; case _traced_retry_profiled : - _p = ((yamop *)(&((_p)->u.p.next))); + _p = ((yamop *)(&((_p)->y_u.p.next))); break; case _traced_profiled_retry_me : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _traced_profiled_trust_me : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _traced_profiled_retry_logical : - _p = ((yamop *)(&((_p)->u.OtaLl.next))); + _p = ((yamop *)(&((_p)->y_u.OtaLl.next))); break; case _traced_profiled_trust_logical : - _p = ((yamop *)(&((_p)->u.OtILl.next))); + _p = ((yamop *)(&((_p)->y_u.OtILl.next))); break; case _traced_count_call : - _p = ((yamop *)(&((_p)->u.p.next))); + _p = ((yamop *)(&((_p)->y_u.p.next))); break; case _traced_count_retry : - _p = ((yamop *)(&((_p)->u.p.next))); + _p = ((yamop *)(&((_p)->y_u.p.next))); break; case _traced_count_retry_me : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _traced_count_trust_me : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _traced_count_retry_logical : - _p = ((yamop *)(&((_p)->u.OtaLl.next))); + _p = ((yamop *)(&((_p)->y_u.OtaLl.next))); break; case _traced_count_trust_logical : - _p = ((yamop *)(&((_p)->u.OtILl.next))); + _p = ((yamop *)(&((_p)->y_u.OtILl.next))); break; case _traced_lock_lu : - _p = ((yamop *)(&((_p)->u.p.next))); + _p = ((yamop *)(&((_p)->y_u.p.next))); break; case _traced_unlock_lu : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_alloc_for_logical_pred : - _p = ((yamop *)(&((_p)->u.L.next))); + _p = ((yamop *)(&((_p)->y_u.L.next))); break; case _traced_copy_idb_term : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_unify_idb_term : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_ensure_space : - _p = ((yamop *)(&((_p)->u.Osbpa.next))); + _p = ((yamop *)(&((_p)->y_u.Osbpa.next))); break; case _traced_spy_or_trymark : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _traced_try_and_mark : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _traced_count_retry_and_mark : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _traced_profiled_retry_and_mark : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _traced_retry_and_mark : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _traced_trust_fail : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_op_fail : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_cut : - _p = ((yamop *)(&((_p)->u.s.next))); + _p = ((yamop *)(&((_p)->y_u.s.next))); c = 1; break; case _traced_cut_t : - _p = ((yamop *)(&((_p)->u.s.next))); + _p = ((yamop *)(&((_p)->y_u.s.next))); c = 1; break; case _traced_cut_e : - _p = ((yamop *)(&((_p)->u.s.next))); + _p = ((yamop *)(&((_p)->y_u.s.next))); c = 1; break; case _traced_save_b_x : - _p = ((yamop *)(&((_p)->u.x.next))); + _p = ((yamop *)(&((_p)->y_u.x.next))); break; case _traced_save_b_y : - _p = ((yamop *)(&((_p)->u.y.next))); + _p = ((yamop *)(&((_p)->y_u.y.next))); break; case _traced_commit_b_x : - _p = ((yamop *)(&((_p)->u.xps.next))); + _p = ((yamop *)(&((_p)->y_u.xps.next))); break; case _traced_commit_b_y : - _p = ((yamop *)(&((_p)->u.yps.next))); + _p = ((yamop *)(&((_p)->y_u.yps.next))); break; case _traced_execute : - _p = ((yamop *)(&((_p)->u.pp.next))); + _p = ((yamop *)(&((_p)->y_u.pp.next))); l = (CELL)_p; if (n > 5) return 0; break; case _traced_dexecute : - _p = ((yamop *)(&((_p)->u.pp.next))); + _p = ((yamop *)(&((_p)->y_u.pp.next))); l = (CELL)_p; if (n > 5) return 0; break; case _traced_fcall : - _p = ((yamop *)(&((_p)->u.Osbpp.next))); + _p = ((yamop *)(&((_p)->y_u.Osbpp.next))); if (c || n <= 3) { c = 0; break; } return 0; case _traced_call : - _p = ((yamop *)(&((_p)->u.Osbpp.next))); + _p = ((yamop *)(&((_p)->y_u.Osbpp.next))); if (c || n <= 3) { c = 0; break; } return 0; case _traced_procceed : - _p = ((yamop *)(&((_p)->u.p.next))); + _p = ((yamop *)(&((_p)->y_u.p.next))); l = (CELL)_p; break; case _traced_allocate : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_deallocate : - _p = ((yamop *)(&((_p)->u.p.next))); + _p = ((yamop *)(&((_p)->y_u.p.next))); break; #ifdef BEAM case _traced_retry_eam : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; #endif #ifdef BEAM case _traced_run_eam : - _p = ((yamop *)(&((_p)->u.os.next))); + _p = ((yamop *)(&((_p)->y_u.os.next))); break; #endif case _traced_get_x_var : - _p = ((yamop *)(&((_p)->u.xx.next))); + _p = ((yamop *)(&((_p)->y_u.xx.next))); break; case _traced_get_y_var : - _p = ((yamop *)(&((_p)->u.yx.next))); + _p = ((yamop *)(&((_p)->y_u.yx.next))); break; case _traced_get_yy_var : - _p = ((yamop *)(&((_p)->u.yyxx.next))); + _p = ((yamop *)(&((_p)->y_u.yyxx.next))); break; case _traced_get_x_val : - _p = ((yamop *)(&((_p)->u.xx.next))); + _p = ((yamop *)(&((_p)->y_u.xx.next))); break; case _traced_get_y_val : - _p = ((yamop *)(&((_p)->u.yx.next))); + _p = ((yamop *)(&((_p)->y_u.yx.next))); break; case _traced_get_atom : - _p = ((yamop *)(&((_p)->u.xc.next))); + _p = ((yamop *)(&((_p)->y_u.xc.next))); break; case _traced_get_2atoms : - _p = ((yamop *)(&((_p)->u.cc.next))); + _p = ((yamop *)(&((_p)->y_u.cc.next))); break; case _traced_get_3atoms : - _p = ((yamop *)(&((_p)->u.ccc.next))); + _p = ((yamop *)(&((_p)->y_u.ccc.next))); break; case _traced_get_4atoms : - _p = ((yamop *)(&((_p)->u.cccc.next))); + _p = ((yamop *)(&((_p)->y_u.cccc.next))); break; case _traced_get_5atoms : - _p = ((yamop *)(&((_p)->u.ccccc.next))); + _p = ((yamop *)(&((_p)->y_u.ccccc.next))); break; case _traced_get_6atoms : - _p = ((yamop *)(&((_p)->u.cccccc.next))); + _p = ((yamop *)(&((_p)->y_u.cccccc.next))); break; case _traced_get_list : - _p = ((yamop *)(&((_p)->u.x.next))); + _p = ((yamop *)(&((_p)->y_u.x.next))); break; case _traced_get_struct : - _p = ((yamop *)(&((_p)->u.xfa.next))); + _p = ((yamop *)(&((_p)->y_u.xfa.next))); break; case _traced_get_float : - _p = ((yamop *)(&((_p)->u.xd.next))); + _p = ((yamop *)(&((_p)->y_u.xd.next))); break; case _traced_get_longint : - _p = ((yamop *)(&((_p)->u.xi.next))); + _p = ((yamop *)(&((_p)->y_u.xi.next))); break; case _traced_get_bigint : - _p = ((yamop *)(&((_p)->u.xN.next))); + _p = ((yamop *)(&((_p)->y_u.xN.next))); break; case _traced_get_dbterm : - _p = ((yamop *)(&((_p)->u.xD.next))); + _p = ((yamop *)(&((_p)->y_u.xD.next))); break; case _traced_glist_valx : - _p = ((yamop *)(&((_p)->u.xx.next))); + _p = ((yamop *)(&((_p)->y_u.xx.next))); break; case _traced_glist_valy : - _p = ((yamop *)(&((_p)->u.yx.next))); + _p = ((yamop *)(&((_p)->y_u.yx.next))); break; case _traced_gl_void_varx : - _p = ((yamop *)(&((_p)->u.xx.next))); + _p = ((yamop *)(&((_p)->y_u.xx.next))); break; case _traced_gl_void_vary : - _p = ((yamop *)(&((_p)->u.yx.next))); + _p = ((yamop *)(&((_p)->y_u.yx.next))); break; case _traced_gl_void_valx : - _p = ((yamop *)(&((_p)->u.xx.next))); + _p = ((yamop *)(&((_p)->y_u.xx.next))); break; case _traced_gl_void_valy : - _p = ((yamop *)(&((_p)->u.yx.next))); + _p = ((yamop *)(&((_p)->y_u.yx.next))); break; case _traced_unify_x_var : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _traced_unify_x_var_write : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _traced_unify_l_x_var : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _traced_unify_l_x_var_write : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _traced_unify_x_var2 : - _p = ((yamop *)(&((_p)->u.oxx.next))); + _p = ((yamop *)(&((_p)->y_u.oxx.next))); break; case _traced_unify_x_var2_write : - _p = ((yamop *)(&((_p)->u.oxx.next))); + _p = ((yamop *)(&((_p)->y_u.oxx.next))); break; case _traced_unify_l_x_var2 : - _p = ((yamop *)(&((_p)->u.oxx.next))); + _p = ((yamop *)(&((_p)->y_u.oxx.next))); break; case _traced_unify_l_x_var2_write : - _p = ((yamop *)(&((_p)->u.oxx.next))); + _p = ((yamop *)(&((_p)->y_u.oxx.next))); break; case _traced_unify_y_var : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _traced_unify_y_var_write : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _traced_unify_l_y_var : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _traced_unify_l_y_var_write : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _traced_unify_x_val : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _traced_unify_x_val_write : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _traced_unify_l_x_val : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _traced_unify_l_x_val_write : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _traced_unify_y_val : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _traced_unify_y_val_write : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _traced_unify_l_y_val : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _traced_unify_l_y_val_write : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _traced_unify_x_loc : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _traced_unify_x_loc_write : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _traced_unify_l_x_loc : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _traced_unify_l_x_loc_write : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _traced_unify_y_loc : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _traced_unify_y_loc_write : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _traced_unify_l_y_loc : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _traced_unify_l_y_loc_write : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _traced_unify_void : - _p = ((yamop *)(&((_p)->u.o.next))); + _p = ((yamop *)(&((_p)->y_u.o.next))); break; case _traced_unify_void_write : - _p = ((yamop *)(&((_p)->u.o.next))); + _p = ((yamop *)(&((_p)->y_u.o.next))); break; case _traced_unify_l_void : - _p = ((yamop *)(&((_p)->u.o.next))); + _p = ((yamop *)(&((_p)->y_u.o.next))); break; case _traced_unify_l_void_write : - _p = ((yamop *)(&((_p)->u.o.next))); + _p = ((yamop *)(&((_p)->y_u.o.next))); break; case _traced_unify_n_voids : - _p = ((yamop *)(&((_p)->u.os.next))); + _p = ((yamop *)(&((_p)->y_u.os.next))); break; case _traced_unify_n_voids_write : - _p = ((yamop *)(&((_p)->u.os.next))); + _p = ((yamop *)(&((_p)->y_u.os.next))); break; case _traced_unify_l_n_voids : - _p = ((yamop *)(&((_p)->u.os.next))); + _p = ((yamop *)(&((_p)->y_u.os.next))); break; case _traced_unify_l_n_voids_write : - _p = ((yamop *)(&((_p)->u.os.next))); + _p = ((yamop *)(&((_p)->y_u.os.next))); break; case _traced_unify_atom : - _p = ((yamop *)(&((_p)->u.oc.next))); + _p = ((yamop *)(&((_p)->y_u.oc.next))); break; case _traced_unify_atom_write : - _p = ((yamop *)(&((_p)->u.oc.next))); + _p = ((yamop *)(&((_p)->y_u.oc.next))); break; case _traced_unify_l_atom : - _p = ((yamop *)(&((_p)->u.oc.next))); + _p = ((yamop *)(&((_p)->y_u.oc.next))); break; case _traced_unify_l_atom_write : - _p = ((yamop *)(&((_p)->u.oc.next))); + _p = ((yamop *)(&((_p)->y_u.oc.next))); break; case _traced_unify_n_atoms : - _p = ((yamop *)(&((_p)->u.osc.next))); + _p = ((yamop *)(&((_p)->y_u.osc.next))); break; case _traced_unify_n_atoms_write : - _p = ((yamop *)(&((_p)->u.osc.next))); + _p = ((yamop *)(&((_p)->y_u.osc.next))); break; case _traced_unify_float : - _p = ((yamop *)(&((_p)->u.od.next))); + _p = ((yamop *)(&((_p)->y_u.od.next))); break; case _traced_unify_float_write : - _p = ((yamop *)(&((_p)->u.od.next))); + _p = ((yamop *)(&((_p)->y_u.od.next))); break; case _traced_unify_l_float : - _p = ((yamop *)(&((_p)->u.od.next))); + _p = ((yamop *)(&((_p)->y_u.od.next))); break; case _traced_unify_l_float_write : - _p = ((yamop *)(&((_p)->u.od.next))); + _p = ((yamop *)(&((_p)->y_u.od.next))); break; case _traced_unify_longint : - _p = ((yamop *)(&((_p)->u.oi.next))); + _p = ((yamop *)(&((_p)->y_u.oi.next))); break; case _traced_unify_longint_write : - _p = ((yamop *)(&((_p)->u.oi.next))); + _p = ((yamop *)(&((_p)->y_u.oi.next))); break; case _traced_unify_l_longint : - _p = ((yamop *)(&((_p)->u.oi.next))); + _p = ((yamop *)(&((_p)->y_u.oi.next))); break; case _traced_unify_l_longint_write : - _p = ((yamop *)(&((_p)->u.oi.next))); + _p = ((yamop *)(&((_p)->y_u.oi.next))); break; case _traced_unify_bigint : - _p = ((yamop *)(&((_p)->u.oN.next))); + _p = ((yamop *)(&((_p)->y_u.oN.next))); break; case _traced_unify_l_bigint : - _p = ((yamop *)(&((_p)->u.oN.next))); + _p = ((yamop *)(&((_p)->y_u.oN.next))); break; case _traced_unify_dbterm : - _p = ((yamop *)(&((_p)->u.oD.next))); + _p = ((yamop *)(&((_p)->y_u.oD.next))); break; case _traced_unify_l_dbterm : - _p = ((yamop *)(&((_p)->u.oD.next))); + _p = ((yamop *)(&((_p)->y_u.oD.next))); break; case _traced_unify_list : - _p = ((yamop *)(&((_p)->u.o.next))); + _p = ((yamop *)(&((_p)->y_u.o.next))); break; case _traced_unify_list_write : - _p = ((yamop *)(&((_p)->u.o.next))); + _p = ((yamop *)(&((_p)->y_u.o.next))); break; case _traced_unify_l_list : - _p = ((yamop *)(&((_p)->u.o.next))); + _p = ((yamop *)(&((_p)->y_u.o.next))); break; case _traced_unify_l_list_write : - _p = ((yamop *)(&((_p)->u.o.next))); + _p = ((yamop *)(&((_p)->y_u.o.next))); break; case _traced_unify_struct : - _p = ((yamop *)(&((_p)->u.ofa.next))); + _p = ((yamop *)(&((_p)->y_u.ofa.next))); break; case _traced_unify_struct_write : - _p = ((yamop *)(&((_p)->u.ofa.next))); + _p = ((yamop *)(&((_p)->y_u.ofa.next))); break; case _traced_unify_l_struc : - _p = ((yamop *)(&((_p)->u.ofa.next))); + _p = ((yamop *)(&((_p)->y_u.ofa.next))); break; case _traced_unify_l_struc_write : - _p = ((yamop *)(&((_p)->u.ofa.next))); + _p = ((yamop *)(&((_p)->y_u.ofa.next))); break; case _traced_put_x_var : - _p = ((yamop *)(&((_p)->u.xx.next))); + _p = ((yamop *)(&((_p)->y_u.xx.next))); break; case _traced_put_y_var : - _p = ((yamop *)(&((_p)->u.yx.next))); + _p = ((yamop *)(&((_p)->y_u.yx.next))); break; case _traced_put_x_val : - _p = ((yamop *)(&((_p)->u.xx.next))); + _p = ((yamop *)(&((_p)->y_u.xx.next))); break; case _traced_put_xx_val : - _p = ((yamop *)(&((_p)->u.xxxx.next))); + _p = ((yamop *)(&((_p)->y_u.xxxx.next))); break; case _traced_put_y_val : - _p = ((yamop *)(&((_p)->u.yx.next))); + _p = ((yamop *)(&((_p)->y_u.yx.next))); break; case _traced_put_y_vals : - _p = ((yamop *)(&((_p)->u.yyxx.next))); + _p = ((yamop *)(&((_p)->y_u.yyxx.next))); break; case _traced_put_unsafe : - _p = ((yamop *)(&((_p)->u.yx.next))); + _p = ((yamop *)(&((_p)->y_u.yx.next))); break; case _traced_put_atom : - _p = ((yamop *)(&((_p)->u.xc.next))); + _p = ((yamop *)(&((_p)->y_u.xc.next))); break; case _traced_put_dbterm : - _p = ((yamop *)(&((_p)->u.xD.next))); + _p = ((yamop *)(&((_p)->y_u.xD.next))); break; case _traced_put_bigint : - _p = ((yamop *)(&((_p)->u.xN.next))); + _p = ((yamop *)(&((_p)->y_u.xN.next))); break; case _traced_put_float : - _p = ((yamop *)(&((_p)->u.xd.next))); + _p = ((yamop *)(&((_p)->y_u.xd.next))); break; case _traced_put_longint : - _p = ((yamop *)(&((_p)->u.xi.next))); + _p = ((yamop *)(&((_p)->y_u.xi.next))); break; case _traced_put_list : - _p = ((yamop *)(&((_p)->u.x.next))); + _p = ((yamop *)(&((_p)->y_u.x.next))); break; case _traced_put_struct : - _p = ((yamop *)(&((_p)->u.xfa.next))); + _p = ((yamop *)(&((_p)->y_u.xfa.next))); break; case _traced_write_x_var : - _p = ((yamop *)(&((_p)->u.x.next))); + _p = ((yamop *)(&((_p)->y_u.x.next))); break; case _traced_write_void : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_write_n_voids : - _p = ((yamop *)(&((_p)->u.s.next))); + _p = ((yamop *)(&((_p)->y_u.s.next))); break; case _traced_write_y_var : - _p = ((yamop *)(&((_p)->u.y.next))); + _p = ((yamop *)(&((_p)->y_u.y.next))); break; case _traced_write_x_val : - _p = ((yamop *)(&((_p)->u.x.next))); + _p = ((yamop *)(&((_p)->y_u.x.next))); break; case _traced_write_x_loc : - _p = ((yamop *)(&((_p)->u.x.next))); + _p = ((yamop *)(&((_p)->y_u.x.next))); break; case _traced_write_y_val : - _p = ((yamop *)(&((_p)->u.y.next))); + _p = ((yamop *)(&((_p)->y_u.y.next))); break; case _traced_write_y_loc : - _p = ((yamop *)(&((_p)->u.y.next))); + _p = ((yamop *)(&((_p)->y_u.y.next))); break; case _traced_write_atom : - _p = ((yamop *)(&((_p)->u.c.next))); + _p = ((yamop *)(&((_p)->y_u.c.next))); break; case _traced_write_bigint : - _p = ((yamop *)(&((_p)->u.N.next))); + _p = ((yamop *)(&((_p)->y_u.N.next))); break; case _traced_write_dbterm : - _p = ((yamop *)(&((_p)->u.D.next))); + _p = ((yamop *)(&((_p)->y_u.D.next))); break; case _traced_write_float : - _p = ((yamop *)(&((_p)->u.d.next))); + _p = ((yamop *)(&((_p)->y_u.d.next))); break; case _traced_write_longint : - _p = ((yamop *)(&((_p)->u.i.next))); + _p = ((yamop *)(&((_p)->y_u.i.next))); break; case _traced_write_n_atoms : - _p = ((yamop *)(&((_p)->u.sc.next))); + _p = ((yamop *)(&((_p)->y_u.sc.next))); break; case _traced_write_list : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_write_l_list : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_write_struct : - _p = ((yamop *)(&((_p)->u.fa.next))); + _p = ((yamop *)(&((_p)->y_u.fa.next))); break; case _traced_write_l_struc : - _p = ((yamop *)(&((_p)->u.fa.next))); + _p = ((yamop *)(&((_p)->y_u.fa.next))); break; case _traced_save_pair_x : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _traced_save_pair_x_write : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _traced_save_pair_y : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _traced_save_pair_y_write : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _traced_save_appl_x : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _traced_save_appl_x_write : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _traced_save_appl_y : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _traced_save_appl_y_write : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _traced_jump : - _p = ((yamop *)(&((_p)->u.l.next))); + _p = ((yamop *)(&((_p)->y_u.l.next))); break; case _traced_move_back : - _p = ((yamop *)(&((_p)->u.l.next))); + _p = ((yamop *)(&((_p)->y_u.l.next))); break; case _traced_skip : - _p = ((yamop *)(&((_p)->u.l.next))); + _p = ((yamop *)(&((_p)->y_u.l.next))); break; case _traced_either : - _p = ((yamop *)(&((_p)->u.Osblp.next))); + _p = ((yamop *)(&((_p)->y_u.Osblp.next))); break; case _traced_or_else : - _p = ((yamop *)(&((_p)->u.Osblp.next))); + _p = ((yamop *)(&((_p)->y_u.Osblp.next))); break; case _traced_pop_n : - _p = ((yamop *)(&((_p)->u.s.next))); + _p = ((yamop *)(&((_p)->y_u.s.next))); break; case _traced_pop : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_call_cpred : - _p = ((yamop *)(&((_p)->u.Osbpp.next))); + _p = ((yamop *)(&((_p)->y_u.Osbpp.next))); break; case _traced_execute_cpred : - _p = ((yamop *)(&((_p)->u.pp.next))); + _p = ((yamop *)(&((_p)->y_u.pp.next))); break; case _traced_call_usercpred : - _p = ((yamop *)(&((_p)->u.Osbpp.next))); + _p = ((yamop *)(&((_p)->y_u.Osbpp.next))); break; case _traced_call_c_wfail : - _p = ((yamop *)(&((_p)->u.slp.next))); + _p = ((yamop *)(&((_p)->y_u.slp.next))); break; case _traced_try_c : - _p = ((yamop *)(&((_p)->u.OtapFs.next))); + _p = ((yamop *)(&((_p)->y_u.OtapFs.next))); break; case _traced_retry_c : - _p = ((yamop *)(&((_p)->u.OtapFs.next))); + _p = ((yamop *)(&((_p)->y_u.OtapFs.next))); break; #ifdef CUT_C case _traced_cut_c : - _p = ((yamop *)(&((_p)->u.OtapFs.next))); + _p = ((yamop *)(&((_p)->y_u.OtapFs.next))); c = 1; break; #endif case _traced_try_userc : - _p = ((yamop *)(&((_p)->u.OtapFs.next))); + _p = ((yamop *)(&((_p)->y_u.OtapFs.next))); break; case _traced_retry_userc : - _p = ((yamop *)(&((_p)->u.OtapFs.next))); + _p = ((yamop *)(&((_p)->y_u.OtapFs.next))); break; #ifdef CUT_C case _traced_cut_userc : - _p = ((yamop *)(&((_p)->u.OtapFs.next))); + _p = ((yamop *)(&((_p)->y_u.OtapFs.next))); c = 1; break; #endif case _traced_lock_pred : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_index_pred : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; #ifdef THREADS case _traced_thread_local : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; #endif case _traced_expand_index : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_expand_clauses : - _p = ((yamop *)(&((_p)->u.sssllp.next))); + _p = ((yamop *)(&((_p)->y_u.sssllp.next))); break; case _traced_undef_p : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_spy_pred : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_try_clause : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _traced_try_clause2 : - _p = ((yamop *)(&((_p)->u.l.next))); + _p = ((yamop *)(&((_p)->y_u.l.next))); break; case _traced_try_clause3 : - _p = ((yamop *)(&((_p)->u.l.next))); + _p = ((yamop *)(&((_p)->y_u.l.next))); break; case _traced_try_clause4 : - _p = ((yamop *)(&((_p)->u.l.next))); + _p = ((yamop *)(&((_p)->y_u.l.next))); break; case _traced_retry : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _traced_retry2 : - _p = ((yamop *)(&((_p)->u.l.next))); + _p = ((yamop *)(&((_p)->y_u.l.next))); break; case _traced_retry3 : - _p = ((yamop *)(&((_p)->u.l.next))); + _p = ((yamop *)(&((_p)->y_u.l.next))); break; case _traced_retry4 : - _p = ((yamop *)(&((_p)->u.l.next))); + _p = ((yamop *)(&((_p)->y_u.l.next))); break; case _traced_trust : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _traced_try_in : - _p = ((yamop *)(&((_p)->u.l.next))); + _p = ((yamop *)(&((_p)->y_u.l.next))); break; case _traced_enter_lu_pred : - _p = ((yamop *)(&((_p)->u.Illss.next))); + _p = ((yamop *)(&((_p)->y_u.Illss.next))); break; case _traced_try_logical : - _p = ((yamop *)(&((_p)->u.OtaLl.next))); + _p = ((yamop *)(&((_p)->y_u.OtaLl.next))); break; case _traced_retry_logical : - _p = ((yamop *)(&((_p)->u.OtaLl.next))); + _p = ((yamop *)(&((_p)->y_u.OtaLl.next))); break; case _traced_trust_logical : - _p = ((yamop *)(&((_p)->u.OtILl.next))); + _p = ((yamop *)(&((_p)->y_u.OtILl.next))); break; case _traced_user_switch : - _p = ((yamop *)(&((_p)->u.lp.next))); + _p = ((yamop *)(&((_p)->y_u.lp.next))); break; case _traced_switch_on_type : - _p = ((yamop *)(&((_p)->u.llll.next))); + _p = ((yamop *)(&((_p)->y_u.llll.next))); break; case _traced_switch_list_nl : - _p = ((yamop *)(&((_p)->u.ollll.next))); + _p = ((yamop *)(&((_p)->y_u.ollll.next))); break; case _traced_switch_on_arg_type : - _p = ((yamop *)(&((_p)->u.xllll.next))); + _p = ((yamop *)(&((_p)->y_u.xllll.next))); break; case _traced_switch_on_sub_arg_type : - _p = ((yamop *)(&((_p)->u.sllll.next))); + _p = ((yamop *)(&((_p)->y_u.sllll.next))); break; case _traced_jump_if_var : - _p = ((yamop *)(&((_p)->u.l.next))); + _p = ((yamop *)(&((_p)->y_u.l.next))); break; case _traced_jump_if_nonvar : - _p = ((yamop *)(&((_p)->u.xll.next))); + _p = ((yamop *)(&((_p)->y_u.xll.next))); break; case _traced_if_not_then : - _p = ((yamop *)(&((_p)->u.clll.next))); + _p = ((yamop *)(&((_p)->y_u.clll.next))); break; case _traced_switch_on_func : - _p = ((yamop *)(&((_p)->u.sssl.next))); + _p = ((yamop *)(&((_p)->y_u.sssl.next))); break; case _traced_switch_on_cons : - _p = ((yamop *)(&((_p)->u.sssl.next))); + _p = ((yamop *)(&((_p)->y_u.sssl.next))); break; case _traced_go_on_func : - _p = ((yamop *)(&((_p)->u.sssl.next))); + _p = ((yamop *)(&((_p)->y_u.sssl.next))); break; case _traced_go_on_cons : - _p = ((yamop *)(&((_p)->u.sssl.next))); + _p = ((yamop *)(&((_p)->y_u.sssl.next))); break; case _traced_if_func : - _p = ((yamop *)(&((_p)->u.sssl.next))); + _p = ((yamop *)(&((_p)->y_u.sssl.next))); break; case _traced_if_cons : - _p = ((yamop *)(&((_p)->u.sssl.next))); + _p = ((yamop *)(&((_p)->y_u.sssl.next))); break; case _traced_index_dbref : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_index_blob : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_index_long : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_jit_handler : - _p = ((yamop *)(&((_p)->u.jhc.next))); + _p = ((yamop *)(&((_p)->y_u.J.next))); break; case _traced_p_atom_x : - _p = ((yamop *)(&((_p)->u.xl.next))); + _p = ((yamop *)(&((_p)->y_u.xl.next))); break; case _traced_p_atom_y : - _p = ((yamop *)(&((_p)->u.yl.next))); + _p = ((yamop *)(&((_p)->y_u.yl.next))); break; case _traced_p_atomic_x : - _p = ((yamop *)(&((_p)->u.xl.next))); + _p = ((yamop *)(&((_p)->y_u.xl.next))); break; case _traced_p_atomic_y : - _p = ((yamop *)(&((_p)->u.yl.next))); + _p = ((yamop *)(&((_p)->y_u.yl.next))); break; case _traced_p_integer_x : - _p = ((yamop *)(&((_p)->u.xl.next))); + _p = ((yamop *)(&((_p)->y_u.xl.next))); break; case _traced_p_integer_y : - _p = ((yamop *)(&((_p)->u.yl.next))); + _p = ((yamop *)(&((_p)->y_u.yl.next))); break; case _traced_p_nonvar_x : - _p = ((yamop *)(&((_p)->u.xl.next))); + _p = ((yamop *)(&((_p)->y_u.xl.next))); break; case _traced_p_nonvar_y : - _p = ((yamop *)(&((_p)->u.yl.next))); + _p = ((yamop *)(&((_p)->y_u.yl.next))); break; case _traced_p_number_x : - _p = ((yamop *)(&((_p)->u.xl.next))); + _p = ((yamop *)(&((_p)->y_u.xl.next))); break; case _traced_p_number_y : - _p = ((yamop *)(&((_p)->u.yl.next))); + _p = ((yamop *)(&((_p)->y_u.yl.next))); break; case _traced_p_var_x : - _p = ((yamop *)(&((_p)->u.xl.next))); + _p = ((yamop *)(&((_p)->y_u.xl.next))); break; case _traced_p_var_y : - _p = ((yamop *)(&((_p)->u.yl.next))); + _p = ((yamop *)(&((_p)->y_u.yl.next))); break; case _traced_p_db_ref_x : - _p = ((yamop *)(&((_p)->u.xl.next))); + _p = ((yamop *)(&((_p)->y_u.xl.next))); break; case _traced_p_db_ref_y : - _p = ((yamop *)(&((_p)->u.yl.next))); + _p = ((yamop *)(&((_p)->y_u.yl.next))); break; case _traced_p_primitive_x : - _p = ((yamop *)(&((_p)->u.xl.next))); + _p = ((yamop *)(&((_p)->y_u.xl.next))); break; case _traced_p_primitive_y : - _p = ((yamop *)(&((_p)->u.yl.next))); + _p = ((yamop *)(&((_p)->y_u.yl.next))); break; case _traced_p_compound_x : - _p = ((yamop *)(&((_p)->u.xl.next))); + _p = ((yamop *)(&((_p)->y_u.xl.next))); break; case _traced_p_compound_y : - _p = ((yamop *)(&((_p)->u.yl.next))); + _p = ((yamop *)(&((_p)->y_u.yl.next))); break; case _traced_p_float_x : - _p = ((yamop *)(&((_p)->u.xl.next))); + _p = ((yamop *)(&((_p)->y_u.xl.next))); break; case _traced_p_float_y : - _p = ((yamop *)(&((_p)->u.yl.next))); + _p = ((yamop *)(&((_p)->y_u.yl.next))); break; case _traced_p_plus_vv : - _p = ((yamop *)(&((_p)->u.xxx.next))); + _p = ((yamop *)(&((_p)->y_u.xxx.next))); break; case _traced_p_plus_vc : - _p = ((yamop *)(&((_p)->u.xxn.next))); + _p = ((yamop *)(&((_p)->y_u.xxn.next))); break; case _traced_p_plus_y_vv : - _p = ((yamop *)(&((_p)->u.yxx.next))); + _p = ((yamop *)(&((_p)->y_u.yxx.next))); break; case _traced_p_plus_y_vc : - _p = ((yamop *)(&((_p)->u.yxn.next))); + _p = ((yamop *)(&((_p)->y_u.yxn.next))); break; case _traced_p_minus_vv : - _p = ((yamop *)(&((_p)->u.xxx.next))); + _p = ((yamop *)(&((_p)->y_u.xxx.next))); break; case _traced_p_minus_cv : - _p = ((yamop *)(&((_p)->u.xxn.next))); + _p = ((yamop *)(&((_p)->y_u.xxn.next))); break; case _traced_p_minus_y_vv : - _p = ((yamop *)(&((_p)->u.yxx.next))); + _p = ((yamop *)(&((_p)->y_u.yxx.next))); break; case _traced_p_minus_y_cv : - _p = ((yamop *)(&((_p)->u.yxn.next))); + _p = ((yamop *)(&((_p)->y_u.yxn.next))); break; case _traced_p_times_vv : - _p = ((yamop *)(&((_p)->u.xxx.next))); + _p = ((yamop *)(&((_p)->y_u.xxx.next))); break; case _traced_p_times_vc : - _p = ((yamop *)(&((_p)->u.xxn.next))); + _p = ((yamop *)(&((_p)->y_u.xxn.next))); break; case _traced_p_times_y_vv : - _p = ((yamop *)(&((_p)->u.yxx.next))); + _p = ((yamop *)(&((_p)->y_u.yxx.next))); break; case _traced_p_times_y_vc : - _p = ((yamop *)(&((_p)->u.yxn.next))); + _p = ((yamop *)(&((_p)->y_u.yxn.next))); break; case _traced_p_div_vv : - _p = ((yamop *)(&((_p)->u.xxx.next))); + _p = ((yamop *)(&((_p)->y_u.xxx.next))); break; case _traced_p_div_vc : - _p = ((yamop *)(&((_p)->u.xxn.next))); + _p = ((yamop *)(&((_p)->y_u.xxn.next))); break; case _traced_p_div_cv : - _p = ((yamop *)(&((_p)->u.xxn.next))); + _p = ((yamop *)(&((_p)->y_u.xxn.next))); break; case _traced_p_div_y_vv : - _p = ((yamop *)(&((_p)->u.yxx.next))); + _p = ((yamop *)(&((_p)->y_u.yxx.next))); break; case _traced_p_div_y_vc : - _p = ((yamop *)(&((_p)->u.yxn.next))); + _p = ((yamop *)(&((_p)->y_u.yxn.next))); break; case _traced_p_div_y_cv : - _p = ((yamop *)(&((_p)->u.yxn.next))); + _p = ((yamop *)(&((_p)->y_u.yxn.next))); break; case _traced_p_and_vv : - _p = ((yamop *)(&((_p)->u.xxx.next))); + _p = ((yamop *)(&((_p)->y_u.xxx.next))); break; case _traced_p_and_vc : - _p = ((yamop *)(&((_p)->u.xxn.next))); + _p = ((yamop *)(&((_p)->y_u.xxn.next))); break; case _traced_p_and_y_vv : - _p = ((yamop *)(&((_p)->u.yxx.next))); + _p = ((yamop *)(&((_p)->y_u.yxx.next))); break; case _traced_p_and_y_vc : - _p = ((yamop *)(&((_p)->u.yxn.next))); + _p = ((yamop *)(&((_p)->y_u.yxn.next))); break; case _traced_p_or_vv : - _p = ((yamop *)(&((_p)->u.xxx.next))); + _p = ((yamop *)(&((_p)->y_u.xxx.next))); break; case _traced_p_or_vc : - _p = ((yamop *)(&((_p)->u.xxn.next))); + _p = ((yamop *)(&((_p)->y_u.xxn.next))); break; case _traced_p_or_y_vv : - _p = ((yamop *)(&((_p)->u.yxx.next))); + _p = ((yamop *)(&((_p)->y_u.yxx.next))); break; case _traced_p_or_y_vc : - _p = ((yamop *)(&((_p)->u.yxn.next))); + _p = ((yamop *)(&((_p)->y_u.yxn.next))); break; case _traced_p_sll_vv : - _p = ((yamop *)(&((_p)->u.xxx.next))); + _p = ((yamop *)(&((_p)->y_u.xxx.next))); break; case _traced_p_sll_vc : - _p = ((yamop *)(&((_p)->u.xxn.next))); + _p = ((yamop *)(&((_p)->y_u.xxn.next))); break; case _traced_p_sll_cv : - _p = ((yamop *)(&((_p)->u.xxn.next))); + _p = ((yamop *)(&((_p)->y_u.xxn.next))); break; case _traced_p_sll_y_vv : - _p = ((yamop *)(&((_p)->u.yxx.next))); + _p = ((yamop *)(&((_p)->y_u.yxx.next))); break; case _traced_p_sll_y_vc : - _p = ((yamop *)(&((_p)->u.yxn.next))); + _p = ((yamop *)(&((_p)->y_u.yxn.next))); break; case _traced_p_sll_y_cv : - _p = ((yamop *)(&((_p)->u.yxn.next))); + _p = ((yamop *)(&((_p)->y_u.yxn.next))); break; case _traced_p_slr_vv : - _p = ((yamop *)(&((_p)->u.xxx.next))); + _p = ((yamop *)(&((_p)->y_u.xxx.next))); break; case _traced_p_slr_vc : - _p = ((yamop *)(&((_p)->u.xxn.next))); + _p = ((yamop *)(&((_p)->y_u.xxn.next))); break; case _traced_p_slr_cv : - _p = ((yamop *)(&((_p)->u.xxn.next))); + _p = ((yamop *)(&((_p)->y_u.xxn.next))); break; case _traced_p_slr_y_vv : - _p = ((yamop *)(&((_p)->u.yxx.next))); + _p = ((yamop *)(&((_p)->y_u.yxx.next))); break; case _traced_p_slr_y_vc : - _p = ((yamop *)(&((_p)->u.yxn.next))); + _p = ((yamop *)(&((_p)->y_u.yxn.next))); break; case _traced_p_slr_y_cv : - _p = ((yamop *)(&((_p)->u.yxn.next))); + _p = ((yamop *)(&((_p)->y_u.yxn.next))); break; case _traced_call_bfunc_xx : - _p = ((yamop *)(&((_p)->u.plxxs.next))); + _p = ((yamop *)(&((_p)->y_u.plxxs.next))); break; case _traced_call_bfunc_yx : - _p = ((yamop *)(&((_p)->u.plxys.next))); + _p = ((yamop *)(&((_p)->y_u.plxys.next))); break; case _traced_call_bfunc_xy : - _p = ((yamop *)(&((_p)->u.plxys.next))); + _p = ((yamop *)(&((_p)->y_u.plxys.next))); break; case _traced_call_bfunc_yy : - _p = ((yamop *)(&((_p)->u.plyys.next))); + _p = ((yamop *)(&((_p)->y_u.plyys.next))); break; case _traced_p_equal : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_p_dif : - _p = ((yamop *)(&((_p)->u.l.next))); + _p = ((yamop *)(&((_p)->y_u.l.next))); break; case _traced_p_eq : - _p = ((yamop *)(&((_p)->u.l.next))); + _p = ((yamop *)(&((_p)->y_u.l.next))); break; case _traced_p_arg_vv : - _p = ((yamop *)(&((_p)->u.xxx.next))); + _p = ((yamop *)(&((_p)->y_u.xxx.next))); break; case _traced_p_arg_cv : - _p = ((yamop *)(&((_p)->u.xxn.next))); + _p = ((yamop *)(&((_p)->y_u.xxn.next))); break; case _traced_p_arg_y_vv : - _p = ((yamop *)(&((_p)->u.yxx.next))); + _p = ((yamop *)(&((_p)->y_u.yxx.next))); break; case _traced_p_arg_y_cv : - _p = ((yamop *)(&((_p)->u.yxn.next))); + _p = ((yamop *)(&((_p)->y_u.yxn.next))); break; case _traced_p_func2s_vv : - _p = ((yamop *)(&((_p)->u.xxx.next))); + _p = ((yamop *)(&((_p)->y_u.xxx.next))); break; case _traced_p_func2s_cv : - _p = ((yamop *)(&((_p)->u.xxc.next))); + _p = ((yamop *)(&((_p)->y_u.xxc.next))); break; case _traced_p_func2s_vc : - _p = ((yamop *)(&((_p)->u.xxn.next))); + _p = ((yamop *)(&((_p)->y_u.xxn.next))); break; case _traced_p_func2s_y_vv : - _p = ((yamop *)(&((_p)->u.yxx.next))); + _p = ((yamop *)(&((_p)->y_u.yxx.next))); break; case _traced_p_func2s_y_cv : - _p = ((yamop *)(&((_p)->u.yxn.next))); + _p = ((yamop *)(&((_p)->y_u.yxn.next))); break; case _traced_p_func2s_y_vc : - _p = ((yamop *)(&((_p)->u.yxn.next))); + _p = ((yamop *)(&((_p)->y_u.yxn.next))); break; case _traced_p_func2f_xx : - _p = ((yamop *)(&((_p)->u.xxx.next))); + _p = ((yamop *)(&((_p)->y_u.xxx.next))); break; case _traced_p_func2f_xy : - _p = ((yamop *)(&((_p)->u.xxy.next))); + _p = ((yamop *)(&((_p)->y_u.xxy.next))); break; case _traced_p_func2f_yx : - _p = ((yamop *)(&((_p)->u.yxx.next))); + _p = ((yamop *)(&((_p)->y_u.yxx.next))); break; case _traced_p_func2f_yy : - _p = ((yamop *)(&((_p)->u.yyx.next))); + _p = ((yamop *)(&((_p)->y_u.yyx.next))); break; case _traced_p_functor : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_p_execute2 : - _p = ((yamop *)(&((_p)->u.Osbpp.next))); + _p = ((yamop *)(&((_p)->y_u.Osbpp.next))); break; case _traced_p_execute : - _p = ((yamop *)(&((_p)->u.Osbmp.next))); + _p = ((yamop *)(&((_p)->y_u.Osbmp.next))); break; case _traced_p_execute_tail : - _p = ((yamop *)(&((_p)->u.Osbpp.next))); + _p = ((yamop *)(&((_p)->y_u.Osbpp.next))); break; #ifdef YAPOR case _traced_getwork_first_time : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_getwork : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _traced_getwork_seq : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _traced_sync : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; #endif #ifdef TABLING #ifdef TABLING_INNER_CUTS case _traced_clause_with_cut : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; #endif case _traced_table_load_answer : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _traced_table_try_answer : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _traced_table_try_single : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _traced_table_try_me : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _traced_table_try : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _traced_table_retry_me : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _traced_table_retry : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _traced_table_trust_me : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _traced_table_trust : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _traced_table_new_answer : - _p = ((yamop *)(&((_p)->u.s.next))); + _p = ((yamop *)(&((_p)->y_u.s.next))); break; case _traced_table_answer_resolution : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _traced_table_completion : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; #ifdef THREADS_CONSUMER_SHARING case _traced_table_answer_resolution_completion: - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; #endif case _traced_trie_do_var : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_trust_var : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_try_var : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_retry_var : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_do_var_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_trust_var_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_try_var_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_retry_var_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_do_val : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_trust_val : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_try_val : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_retry_val : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_do_val_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_trust_val_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_try_val_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_retry_val_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_do_atom : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_trust_atom : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_try_atom : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_retry_atom : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_do_atom_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_trust_atom_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_try_atom_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_retry_atom_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_do_null : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_trust_null : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_try_null : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_retry_null : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_do_null_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_trust_null_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_try_null_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_retry_null_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_do_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_trust_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_try_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_retry_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_do_appl : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_trust_appl : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_try_appl : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_retry_appl : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_do_appl_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_trust_appl_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_try_appl_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_retry_appl_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_do_extension : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_trust_extension : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_try_extension : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_retry_extension : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_do_double : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_trust_double : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_try_double : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_retry_double : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_do_longint : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_trust_longint : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_try_longint : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_retry_longint : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_do_gterm : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_trust_gterm : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_try_gterm : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_retry_gterm : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; #endif #ifdef YAPOR case _traced_or_last : - _p = ((yamop *)(&((_p)->u.sblp.next))); + _p = ((yamop *)(&((_p)->y_u.sblp.next))); break; #else case _traced_or_last : - _p = ((yamop *)(&((_p)->u.p.next))); + _p = ((yamop *)(&((_p)->y_u.p.next))); break; #endif + default: + return 0; } } return 1; diff --git a/JIT/HPP/JIT.hpp b/JIT/HPP/JIT.hpp new file mode 100644 index 000000000..2db27fa2d --- /dev/null +++ b/JIT/HPP/JIT.hpp @@ -0,0 +1,24 @@ +#ifndef JIT_HPP +#define JIT_HPP + +#ifdef __cplusplus + +#include +#include +#include +#include +#include +#include +#include +#include "config.h" +#include "absmi.h" + +using namespace std; + +#else + +#define LIMIT_COUNT 4096 + +#endif + +#endif diff --git a/JIT/HPP/JIT_Compiler.hpp b/JIT/HPP/JIT_Compiler.hpp new file mode 100644 index 000000000..1b7800871 --- /dev/null +++ b/JIT/HPP/JIT_Compiler.hpp @@ -0,0 +1,109 @@ +#ifndef JIT_COMPILER_HPP +#define JIT_COMPILER_HPP + +#ifdef __cplusplus + +#include "llvm/IR/LLVMContext.h" +#include "llvm/IR/Module.h" +#include "llvm/IR/Constants.h" +#include "llvm/IR/DerivedTypes.h" +#include "llvm/IR/Instructions.h" +#include "llvm/Linker/Linker.h" +#include "llvm/PassManager.h" +#include "llvm/Analysis/CallGraphSCCPass.h" +#include "llvm/ADT/Statistic.h" +#include "llvm/ADT/StringSet.h" +#include "llvm/ADT/Triple.h" +#include "llvm/IR/IRPrintingPasses.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/IRReader/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/IR/IRBuilder.h" +//#include "llvm/Support/PathV1.h" +#include "llvm/IR/TypeBuilder.h" +#include "llvm/Support/ToolOutputFile.h" +#include "llvm/IR/DataLayout.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/IR/DebugInfo.h" +#include "llvm/IR/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" +#include "llvm/Transforms/ObjCARC.h" +#include "llvm/Support/FileSystem.h" + +using namespace llvm; + +#include +#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); +extern "C" void shutdown_llvm(); + +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 diff --git a/JIT/HPP/PassPrinters.h b/JIT/HPP/PassPrinters.h new file mode 100644 index 000000000..91c7317c7 --- /dev/null +++ b/JIT/HPP/PassPrinters.h @@ -0,0 +1,47 @@ +//===- PassPrinters.h - Utilities to print analysis info for passes -------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +/// +/// \file +/// \brief Utilities to print analysis info for various kinds of passes. +/// +//===----------------------------------------------------------------------===// +#ifndef LLVM_TOOLS_OPT_PASSPRINTERS_H +#define LLVM_TOOLS_OPT_PASSPRINTERS_H + +namespace llvm { + + class BasicBlockPass; + class CallGraphSCCPass; + class FunctionPass; + class ModulePass; + class LoopPass; + class PassInfo; + class RegionPass; + class raw_ostream; + + FunctionPass *createFunctionPassPrinter(const PassInfo *passInfo, raw_ostream &out, + bool Quiet); + + CallGraphSCCPass *createCallGraphPassPrinter(const PassInfo *passInfo, + raw_ostream &out, bool Quiet); + + ModulePass *createModulePassPrinter(const PassInfo *passInfo, raw_ostream &out, + bool Quiet); + + LoopPass *createLoopPassPrinter(const PassInfo *passInfo, raw_ostream &out, + bool Quiet); + + RegionPass *createRegionPassPrinter(const PassInfo *passInfo, raw_ostream &out, + bool Quiet); + + BasicBlockPass *createBasicBlockPassPrinter(const PassInfo *passInfo, + raw_ostream &out, bool Quiet); +} + +#endif // LLVM_TOOLS_OPT_PASSPRINTERS_H diff --git a/JIT/HPP/PassPrinters.hpp b/JIT/HPP/PassPrinters.hpp new file mode 100644 index 000000000..4d2553af7 --- /dev/null +++ b/JIT/HPP/PassPrinters.hpp @@ -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 HOLDERS +* 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 *PInfo) : + CallGraphSCCPass(ID), PassToPrint(PInfo) { + 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(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 *PInfo) + : ModulePass(ID), PassToPrint(PInfo) { + 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(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 *PInfo) + : FunctionPass(ID), PassToPrint(PInfo) { + 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(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 *PInfo) : + LoopPass(ID), PassToPrint(PInfo) { + 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(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 *PInfo) : RegionPass(ID), + PassToPrint(PInfo) { + 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(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; diff --git a/JIT/HPP/Yap_BasicBlocks.h b/JIT/HPP/Yap_BasicBlocks.h index a8e64b8ac..2606d3d1d 100644 --- a/JIT/HPP/Yap_BasicBlocks.h +++ b/JIT/HPP/Yap_BasicBlocks.h @@ -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, diff --git a/JIT/HPP/jit_predicates.hpp b/JIT/HPP/jit_predicates.hpp new file mode 100644 index 000000000..090bbf850 --- /dev/null +++ b/JIT/HPP/jit_predicates.hpp @@ -0,0 +1,45 @@ +#include "Yap.h" +#include "clause.h" +#include "eval.h" +#if HAVE_ERRNO_H +#include +#else +extern int errno; +#endif +#include +#include + +#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 diff --git a/JIT/HPP/lastop.h b/JIT/HPP/lastop.h index f81cbd3a0..1fe127ccd 100644 --- a/JIT/HPP/lastop.h +++ b/JIT/HPP/lastop.h @@ -8,2389 +8,2389 @@ lastop_of(yamop* _p) { lastp = _p; switch(op){ case _Ystop : - _p = ((yamop *)(&((_p)->u.l.next))); + _p = ((yamop *)(&((_p)->y_u.l.next))); break; case _Nstop : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _try_me : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _retry_me : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _trust_me : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _enter_profiling : - _p = ((yamop *)(&((_p)->u.p.next))); + _p = ((yamop *)(&((_p)->y_u.p.next))); break; case _retry_profiled : - _p = ((yamop *)(&((_p)->u.p.next))); + _p = ((yamop *)(&((_p)->y_u.p.next))); break; case _profiled_retry_me : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _profiled_trust_me : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _profiled_retry_logical : - _p = ((yamop *)(&((_p)->u.OtaLl.next))); + _p = ((yamop *)(&((_p)->y_u.OtaLl.next))); break; case _profiled_trust_logical : - _p = ((yamop *)(&((_p)->u.OtILl.next))); + _p = ((yamop *)(&((_p)->y_u.OtILl.next))); break; case _count_call : - _p = ((yamop *)(&((_p)->u.p.next))); + _p = ((yamop *)(&((_p)->y_u.p.next))); break; case _count_retry : - _p = ((yamop *)(&((_p)->u.p.next))); + _p = ((yamop *)(&((_p)->y_u.p.next))); break; case _count_retry_me : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _count_trust_me : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _count_retry_logical : - _p = ((yamop *)(&((_p)->u.OtaLl.next))); + _p = ((yamop *)(&((_p)->y_u.OtaLl.next))); break; case _count_trust_logical : - _p = ((yamop *)(&((_p)->u.OtILl.next))); + _p = ((yamop *)(&((_p)->y_u.OtILl.next))); break; case _lock_lu : - _p = ((yamop *)(&((_p)->u.p.next))); + _p = ((yamop *)(&((_p)->y_u.p.next))); break; case _unlock_lu : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _alloc_for_logical_pred : - _p = ((yamop *)(&((_p)->u.L.next))); + _p = ((yamop *)(&((_p)->y_u.L.next))); break; case _copy_idb_term : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _unify_idb_term : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _ensure_space : - _p = ((yamop *)(&((_p)->u.Osbpa.next))); + _p = ((yamop *)(&((_p)->y_u.Osbpa.next))); break; case _spy_or_trymark : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _try_and_mark : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _count_retry_and_mark : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _profiled_retry_and_mark : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _retry_and_mark : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _trust_fail : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _op_fail : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _cut : - _p = ((yamop *)(&((_p)->u.s.next))); + _p = ((yamop *)(&((_p)->y_u.s.next))); break; case _cut_t : - _p = ((yamop *)(&((_p)->u.s.next))); + _p = ((yamop *)(&((_p)->y_u.s.next))); break; case _cut_e : - _p = ((yamop *)(&((_p)->u.s.next))); + _p = ((yamop *)(&((_p)->y_u.s.next))); break; case _save_b_x : - _p = ((yamop *)(&((_p)->u.x.next))); + _p = ((yamop *)(&((_p)->y_u.x.next))); break; case _save_b_y : - _p = ((yamop *)(&((_p)->u.y.next))); + _p = ((yamop *)(&((_p)->y_u.y.next))); break; case _commit_b_x : - _p = ((yamop *)(&((_p)->u.xps.next))); + _p = ((yamop *)(&((_p)->y_u.xps.next))); break; case _commit_b_y : - _p = ((yamop *)(&((_p)->u.yps.next))); + _p = ((yamop *)(&((_p)->y_u.yps.next))); break; case _execute : - _p = ((yamop *)(&((_p)->u.pp.next))); + _p = ((yamop *)(&((_p)->y_u.pp.next))); break; case _dexecute : - _p = ((yamop *)(&((_p)->u.pp.next))); + _p = ((yamop *)(&((_p)->y_u.pp.next))); break; case _fcall : - _p = ((yamop *)(&((_p)->u.Osbpp.next))); + _p = ((yamop *)(&((_p)->y_u.Osbpp.next))); break; case _call : - _p = ((yamop *)(&((_p)->u.Osbpp.next))); + _p = ((yamop *)(&((_p)->y_u.Osbpp.next))); break; case _procceed : - _p = ((yamop *)(&((_p)->u.p.next))); + _p = ((yamop *)(&((_p)->y_u.p.next))); l = (CELL)_p; break; case _allocate : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _deallocate : - _p = ((yamop *)(&((_p)->u.p.next))); + _p = ((yamop *)(&((_p)->y_u.p.next))); break; #ifdef BEAM case _retry_eam : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; #endif #ifdef BEAM case _run_eam : - _p = ((yamop *)(&((_p)->u.os.next))); + _p = ((yamop *)(&((_p)->y_u.os.next))); break; #endif case _get_x_var : - _p = ((yamop *)(&((_p)->u.xx.next))); + _p = ((yamop *)(&((_p)->y_u.xx.next))); break; case _get_y_var : - _p = ((yamop *)(&((_p)->u.yx.next))); + _p = ((yamop *)(&((_p)->y_u.yx.next))); break; case _get_yy_var : - _p = ((yamop *)(&((_p)->u.yyxx.next))); + _p = ((yamop *)(&((_p)->y_u.yyxx.next))); break; case _get_x_val : - _p = ((yamop *)(&((_p)->u.xx.next))); + _p = ((yamop *)(&((_p)->y_u.xx.next))); break; case _get_y_val : - _p = ((yamop *)(&((_p)->u.yx.next))); + _p = ((yamop *)(&((_p)->y_u.yx.next))); break; case _get_atom : - _p = ((yamop *)(&((_p)->u.xc.next))); + _p = ((yamop *)(&((_p)->y_u.xc.next))); break; case _get_2atoms : - _p = ((yamop *)(&((_p)->u.cc.next))); + _p = ((yamop *)(&((_p)->y_u.cc.next))); break; case _get_3atoms : - _p = ((yamop *)(&((_p)->u.ccc.next))); + _p = ((yamop *)(&((_p)->y_u.ccc.next))); break; case _get_4atoms : - _p = ((yamop *)(&((_p)->u.cccc.next))); + _p = ((yamop *)(&((_p)->y_u.cccc.next))); break; case _get_5atoms : - _p = ((yamop *)(&((_p)->u.ccccc.next))); + _p = ((yamop *)(&((_p)->y_u.ccccc.next))); break; case _get_6atoms : - _p = ((yamop *)(&((_p)->u.cccccc.next))); + _p = ((yamop *)(&((_p)->y_u.cccccc.next))); break; case _get_list : - _p = ((yamop *)(&((_p)->u.x.next))); + _p = ((yamop *)(&((_p)->y_u.x.next))); break; case _get_struct : - _p = ((yamop *)(&((_p)->u.xfa.next))); + _p = ((yamop *)(&((_p)->y_u.xfa.next))); break; case _get_float : - _p = ((yamop *)(&((_p)->u.xd.next))); + _p = ((yamop *)(&((_p)->y_u.xd.next))); break; case _get_longint : - _p = ((yamop *)(&((_p)->u.xi.next))); + _p = ((yamop *)(&((_p)->y_u.xi.next))); break; case _get_bigint : - _p = ((yamop *)(&((_p)->u.xN.next))); + _p = ((yamop *)(&((_p)->y_u.xN.next))); break; case _get_dbterm : - _p = ((yamop *)(&((_p)->u.xD.next))); + _p = ((yamop *)(&((_p)->y_u.xD.next))); break; case _glist_valx : - _p = ((yamop *)(&((_p)->u.xx.next))); + _p = ((yamop *)(&((_p)->y_u.xx.next))); break; case _glist_valy : - _p = ((yamop *)(&((_p)->u.yx.next))); + _p = ((yamop *)(&((_p)->y_u.yx.next))); break; case _gl_void_varx : - _p = ((yamop *)(&((_p)->u.xx.next))); + _p = ((yamop *)(&((_p)->y_u.xx.next))); break; case _gl_void_vary : - _p = ((yamop *)(&((_p)->u.yx.next))); + _p = ((yamop *)(&((_p)->y_u.yx.next))); break; case _gl_void_valx : - _p = ((yamop *)(&((_p)->u.xx.next))); + _p = ((yamop *)(&((_p)->y_u.xx.next))); break; case _gl_void_valy : - _p = ((yamop *)(&((_p)->u.yx.next))); + _p = ((yamop *)(&((_p)->y_u.yx.next))); break; case _unify_x_var : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _unify_x_var_write : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _unify_l_x_var : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _unify_l_x_var_write : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _unify_x_var2 : - _p = ((yamop *)(&((_p)->u.oxx.next))); + _p = ((yamop *)(&((_p)->y_u.oxx.next))); break; case _unify_x_var2_write : - _p = ((yamop *)(&((_p)->u.oxx.next))); + _p = ((yamop *)(&((_p)->y_u.oxx.next))); break; case _unify_l_x_var2 : - _p = ((yamop *)(&((_p)->u.oxx.next))); + _p = ((yamop *)(&((_p)->y_u.oxx.next))); break; case _unify_l_x_var2_write : - _p = ((yamop *)(&((_p)->u.oxx.next))); + _p = ((yamop *)(&((_p)->y_u.oxx.next))); break; case _unify_y_var : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _unify_y_var_write : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _unify_l_y_var : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _unify_l_y_var_write : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _unify_x_val : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _unify_x_val_write : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _unify_l_x_val : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _unify_l_x_val_write : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _unify_y_val : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _unify_y_val_write : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _unify_l_y_val : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _unify_l_y_val_write : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _unify_x_loc : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _unify_x_loc_write : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _unify_l_x_loc : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _unify_l_x_loc_write : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _unify_y_loc : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _unify_y_loc_write : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _unify_l_y_loc : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _unify_l_y_loc_write : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _unify_void : - _p = ((yamop *)(&((_p)->u.o.next))); + _p = ((yamop *)(&((_p)->y_u.o.next))); break; case _unify_void_write : - _p = ((yamop *)(&((_p)->u.o.next))); + _p = ((yamop *)(&((_p)->y_u.o.next))); break; case _unify_l_void : - _p = ((yamop *)(&((_p)->u.o.next))); + _p = ((yamop *)(&((_p)->y_u.o.next))); break; case _unify_l_void_write : - _p = ((yamop *)(&((_p)->u.o.next))); + _p = ((yamop *)(&((_p)->y_u.o.next))); break; case _unify_n_voids : - _p = ((yamop *)(&((_p)->u.os.next))); + _p = ((yamop *)(&((_p)->y_u.os.next))); break; case _unify_n_voids_write : - _p = ((yamop *)(&((_p)->u.os.next))); + _p = ((yamop *)(&((_p)->y_u.os.next))); break; case _unify_l_n_voids : - _p = ((yamop *)(&((_p)->u.os.next))); + _p = ((yamop *)(&((_p)->y_u.os.next))); break; case _unify_l_n_voids_write : - _p = ((yamop *)(&((_p)->u.os.next))); + _p = ((yamop *)(&((_p)->y_u.os.next))); break; case _unify_atom : - _p = ((yamop *)(&((_p)->u.oc.next))); + _p = ((yamop *)(&((_p)->y_u.oc.next))); break; case _unify_atom_write : - _p = ((yamop *)(&((_p)->u.oc.next))); + _p = ((yamop *)(&((_p)->y_u.oc.next))); break; case _unify_l_atom : - _p = ((yamop *)(&((_p)->u.oc.next))); + _p = ((yamop *)(&((_p)->y_u.oc.next))); break; case _unify_l_atom_write : - _p = ((yamop *)(&((_p)->u.oc.next))); + _p = ((yamop *)(&((_p)->y_u.oc.next))); break; case _unify_n_atoms : - _p = ((yamop *)(&((_p)->u.osc.next))); + _p = ((yamop *)(&((_p)->y_u.osc.next))); break; case _unify_n_atoms_write : - _p = ((yamop *)(&((_p)->u.osc.next))); + _p = ((yamop *)(&((_p)->y_u.osc.next))); break; case _unify_float : - _p = ((yamop *)(&((_p)->u.od.next))); + _p = ((yamop *)(&((_p)->y_u.od.next))); break; case _unify_float_write : - _p = ((yamop *)(&((_p)->u.od.next))); + _p = ((yamop *)(&((_p)->y_u.od.next))); break; case _unify_l_float : - _p = ((yamop *)(&((_p)->u.od.next))); + _p = ((yamop *)(&((_p)->y_u.od.next))); break; case _unify_l_float_write : - _p = ((yamop *)(&((_p)->u.od.next))); + _p = ((yamop *)(&((_p)->y_u.od.next))); break; case _unify_longint : - _p = ((yamop *)(&((_p)->u.oi.next))); + _p = ((yamop *)(&((_p)->y_u.oi.next))); break; case _unify_longint_write : - _p = ((yamop *)(&((_p)->u.oi.next))); + _p = ((yamop *)(&((_p)->y_u.oi.next))); break; case _unify_l_longint : - _p = ((yamop *)(&((_p)->u.oi.next))); + _p = ((yamop *)(&((_p)->y_u.oi.next))); break; case _unify_l_longint_write : - _p = ((yamop *)(&((_p)->u.oi.next))); + _p = ((yamop *)(&((_p)->y_u.oi.next))); break; case _unify_bigint : - _p = ((yamop *)(&((_p)->u.oN.next))); + _p = ((yamop *)(&((_p)->y_u.oN.next))); break; case _unify_l_bigint : - _p = ((yamop *)(&((_p)->u.oN.next))); + _p = ((yamop *)(&((_p)->y_u.oN.next))); break; case _unify_dbterm : - _p = ((yamop *)(&((_p)->u.oD.next))); + _p = ((yamop *)(&((_p)->y_u.oD.next))); break; case _unify_l_dbterm : - _p = ((yamop *)(&((_p)->u.oD.next))); + _p = ((yamop *)(&((_p)->y_u.oD.next))); break; case _unify_list : - _p = ((yamop *)(&((_p)->u.o.next))); + _p = ((yamop *)(&((_p)->y_u.o.next))); break; case _unify_list_write : - _p = ((yamop *)(&((_p)->u.o.next))); + _p = ((yamop *)(&((_p)->y_u.o.next))); break; case _unify_l_list : - _p = ((yamop *)(&((_p)->u.o.next))); + _p = ((yamop *)(&((_p)->y_u.o.next))); break; case _unify_l_list_write : - _p = ((yamop *)(&((_p)->u.o.next))); + _p = ((yamop *)(&((_p)->y_u.o.next))); break; case _unify_struct : - _p = ((yamop *)(&((_p)->u.ofa.next))); + _p = ((yamop *)(&((_p)->y_u.ofa.next))); break; case _unify_struct_write : - _p = ((yamop *)(&((_p)->u.ofa.next))); + _p = ((yamop *)(&((_p)->y_u.ofa.next))); break; case _unify_l_struc : - _p = ((yamop *)(&((_p)->u.ofa.next))); + _p = ((yamop *)(&((_p)->y_u.ofa.next))); break; case _unify_l_struc_write : - _p = ((yamop *)(&((_p)->u.ofa.next))); + _p = ((yamop *)(&((_p)->y_u.ofa.next))); break; case _put_x_var : - _p = ((yamop *)(&((_p)->u.xx.next))); + _p = ((yamop *)(&((_p)->y_u.xx.next))); break; case _put_y_var : - _p = ((yamop *)(&((_p)->u.yx.next))); + _p = ((yamop *)(&((_p)->y_u.yx.next))); break; case _put_x_val : - _p = ((yamop *)(&((_p)->u.xx.next))); + _p = ((yamop *)(&((_p)->y_u.xx.next))); break; case _put_xx_val : - _p = ((yamop *)(&((_p)->u.xxxx.next))); + _p = ((yamop *)(&((_p)->y_u.xxxx.next))); break; case _put_y_val : - _p = ((yamop *)(&((_p)->u.yx.next))); + _p = ((yamop *)(&((_p)->y_u.yx.next))); break; case _put_y_vals : - _p = ((yamop *)(&((_p)->u.yyxx.next))); + _p = ((yamop *)(&((_p)->y_u.yyxx.next))); break; case _put_unsafe : - _p = ((yamop *)(&((_p)->u.yx.next))); + _p = ((yamop *)(&((_p)->y_u.yx.next))); break; case _put_atom : - _p = ((yamop *)(&((_p)->u.xc.next))); + _p = ((yamop *)(&((_p)->y_u.xc.next))); break; case _put_dbterm : - _p = ((yamop *)(&((_p)->u.xD.next))); + _p = ((yamop *)(&((_p)->y_u.xD.next))); break; case _put_bigint : - _p = ((yamop *)(&((_p)->u.xN.next))); + _p = ((yamop *)(&((_p)->y_u.xN.next))); break; case _put_float : - _p = ((yamop *)(&((_p)->u.xd.next))); + _p = ((yamop *)(&((_p)->y_u.xd.next))); break; case _put_longint : - _p = ((yamop *)(&((_p)->u.xi.next))); + _p = ((yamop *)(&((_p)->y_u.xi.next))); break; case _put_list : - _p = ((yamop *)(&((_p)->u.x.next))); + _p = ((yamop *)(&((_p)->y_u.x.next))); break; case _put_struct : - _p = ((yamop *)(&((_p)->u.xfa.next))); + _p = ((yamop *)(&((_p)->y_u.xfa.next))); break; case _write_x_var : - _p = ((yamop *)(&((_p)->u.x.next))); + _p = ((yamop *)(&((_p)->y_u.x.next))); break; case _write_void : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _write_n_voids : - _p = ((yamop *)(&((_p)->u.s.next))); + _p = ((yamop *)(&((_p)->y_u.s.next))); break; case _write_y_var : - _p = ((yamop *)(&((_p)->u.y.next))); + _p = ((yamop *)(&((_p)->y_u.y.next))); break; case _write_x_val : - _p = ((yamop *)(&((_p)->u.x.next))); + _p = ((yamop *)(&((_p)->y_u.x.next))); break; case _write_x_loc : - _p = ((yamop *)(&((_p)->u.x.next))); + _p = ((yamop *)(&((_p)->y_u.x.next))); break; case _write_y_val : - _p = ((yamop *)(&((_p)->u.y.next))); + _p = ((yamop *)(&((_p)->y_u.y.next))); break; case _write_y_loc : - _p = ((yamop *)(&((_p)->u.y.next))); + _p = ((yamop *)(&((_p)->y_u.y.next))); break; case _write_atom : - _p = ((yamop *)(&((_p)->u.c.next))); + _p = ((yamop *)(&((_p)->y_u.c.next))); break; case _write_bigint : - _p = ((yamop *)(&((_p)->u.N.next))); + _p = ((yamop *)(&((_p)->y_u.N.next))); break; case _write_dbterm : - _p = ((yamop *)(&((_p)->u.D.next))); + _p = ((yamop *)(&((_p)->y_u.D.next))); break; case _write_float : - _p = ((yamop *)(&((_p)->u.d.next))); + _p = ((yamop *)(&((_p)->y_u.d.next))); break; case _write_longint : - _p = ((yamop *)(&((_p)->u.i.next))); + _p = ((yamop *)(&((_p)->y_u.i.next))); break; case _write_n_atoms : - _p = ((yamop *)(&((_p)->u.sc.next))); + _p = ((yamop *)(&((_p)->y_u.sc.next))); break; case _write_list : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _write_l_list : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _write_struct : - _p = ((yamop *)(&((_p)->u.fa.next))); + _p = ((yamop *)(&((_p)->y_u.fa.next))); break; case _write_l_struc : - _p = ((yamop *)(&((_p)->u.fa.next))); + _p = ((yamop *)(&((_p)->y_u.fa.next))); break; case _save_pair_x : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _save_pair_x_write : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _save_pair_y : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _save_pair_y_write : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _save_appl_x : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _save_appl_x_write : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _save_appl_y : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _save_appl_y_write : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _jump : - _p = ((yamop *)(&((_p)->u.l.next))); + _p = ((yamop *)(&((_p)->y_u.l.next))); break; case _move_back : - _p = ((yamop *)(&((_p)->u.l.next))); + _p = ((yamop *)(&((_p)->y_u.l.next))); break; case _skip : - _p = ((yamop *)(&((_p)->u.l.next))); + _p = ((yamop *)(&((_p)->y_u.l.next))); break; case _either : - _p = ((yamop *)(&((_p)->u.Osblp.next))); + _p = ((yamop *)(&((_p)->y_u.Osblp.next))); break; case _or_else : - _p = ((yamop *)(&((_p)->u.Osblp.next))); + _p = ((yamop *)(&((_p)->y_u.Osblp.next))); break; case _pop_n : - _p = ((yamop *)(&((_p)->u.s.next))); + _p = ((yamop *)(&((_p)->y_u.s.next))); break; case _pop : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _call_cpred : - _p = ((yamop *)(&((_p)->u.Osbpp.next))); + _p = ((yamop *)(&((_p)->y_u.Osbpp.next))); break; case _execute_cpred : - _p = ((yamop *)(&((_p)->u.pp.next))); + _p = ((yamop *)(&((_p)->y_u.pp.next))); break; case _call_usercpred : - _p = ((yamop *)(&((_p)->u.Osbpp.next))); + _p = ((yamop *)(&((_p)->y_u.Osbpp.next))); break; case _call_c_wfail : - _p = ((yamop *)(&((_p)->u.slp.next))); + _p = ((yamop *)(&((_p)->y_u.slp.next))); break; case _try_c : - _p = ((yamop *)(&((_p)->u.OtapFs.next))); + _p = ((yamop *)(&((_p)->y_u.OtapFs.next))); break; case _retry_c : - _p = ((yamop *)(&((_p)->u.OtapFs.next))); + _p = ((yamop *)(&((_p)->y_u.OtapFs.next))); break; #ifdef CUT_C case _cut_c : - _p = ((yamop *)(&((_p)->u.OtapFs.next))); + _p = ((yamop *)(&((_p)->y_u.OtapFs.next))); break; #endif case _try_userc : - _p = ((yamop *)(&((_p)->u.OtapFs.next))); + _p = ((yamop *)(&((_p)->y_u.OtapFs.next))); break; case _retry_userc : - _p = ((yamop *)(&((_p)->u.OtapFs.next))); + _p = ((yamop *)(&((_p)->y_u.OtapFs.next))); break; #ifdef CUT_C case _cut_userc : - _p = ((yamop *)(&((_p)->u.OtapFs.next))); + _p = ((yamop *)(&((_p)->y_u.OtapFs.next))); break; #endif case _lock_pred : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _index_pred : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; #ifdef THREADS case _thread_local : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; #endif case _expand_index : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _expand_clauses : - _p = ((yamop *)(&((_p)->u.sssllp.next))); + _p = ((yamop *)(&((_p)->y_u.sssllp.next))); break; case _undef_p : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _spy_pred : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _try_clause : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _try_clause2 : - _p = ((yamop *)(&((_p)->u.l.next))); + _p = ((yamop *)(&((_p)->y_u.l.next))); break; case _try_clause3 : - _p = ((yamop *)(&((_p)->u.l.next))); + _p = ((yamop *)(&((_p)->y_u.l.next))); break; case _try_clause4 : - _p = ((yamop *)(&((_p)->u.l.next))); + _p = ((yamop *)(&((_p)->y_u.l.next))); break; case _retry : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _retry2 : - _p = ((yamop *)(&((_p)->u.l.next))); + _p = ((yamop *)(&((_p)->y_u.l.next))); break; case _retry3 : - _p = ((yamop *)(&((_p)->u.l.next))); + _p = ((yamop *)(&((_p)->y_u.l.next))); break; case _retry4 : - _p = ((yamop *)(&((_p)->u.l.next))); + _p = ((yamop *)(&((_p)->y_u.l.next))); break; case _trust : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _try_in : - _p = ((yamop *)(&((_p)->u.l.next))); - break; - case _enter_lu_pred : - _p = ((yamop *)(&((_p)->u.Illss.next))); + _p = ((yamop *)(&((_p)->y_u.l.next))); break; case _try_logical : - _p = ((yamop *)(&((_p)->u.OtaLl.next))); + _p = ((yamop *)(&((_p)->y_u.OtaLl.next))); break; case _retry_logical : - _p = ((yamop *)(&((_p)->u.OtaLl.next))); + _p = ((yamop *)(&((_p)->y_u.OtaLl.next))); break; case _trust_logical : - _p = ((yamop *)(&((_p)->u.OtILl.next))); + _p = ((yamop *)(&((_p)->y_u.OtILl.next))); break; case _user_switch : - _p = ((yamop *)(&((_p)->u.lp.next))); + _p = ((yamop *)(&((_p)->y_u.lp.next))); break; case _switch_on_type : - _p = ((yamop *)(&((_p)->u.llll.next))); + _p = ((yamop *)(&((_p)->y_u.llll.next))); break; case _switch_list_nl : - _p = ((yamop *)(&((_p)->u.ollll.next))); + _p = ((yamop *)(&((_p)->y_u.ollll.next))); break; case _switch_on_arg_type : - _p = ((yamop *)(&((_p)->u.xllll.next))); + _p = ((yamop *)(&((_p)->y_u.xllll.next))); break; case _switch_on_sub_arg_type : - _p = ((yamop *)(&((_p)->u.sllll.next))); + _p = ((yamop *)(&((_p)->y_u.sllll.next))); break; case _jump_if_var : - _p = ((yamop *)(&((_p)->u.l.next))); + _p = ((yamop *)(&((_p)->y_u.l.next))); break; case _jump_if_nonvar : - _p = ((yamop *)(&((_p)->u.xll.next))); + _p = ((yamop *)(&((_p)->y_u.xll.next))); break; case _if_not_then : - _p = ((yamop *)(&((_p)->u.clll.next))); + _p = ((yamop *)(&((_p)->y_u.clll.next))); break; case _switch_on_func : - _p = ((yamop *)(&((_p)->u.sssl.next))); + _p = ((yamop *)(&((_p)->y_u.sssl.next))); break; case _switch_on_cons : - _p = ((yamop *)(&((_p)->u.sssl.next))); + _p = ((yamop *)(&((_p)->y_u.sssl.next))); break; case _go_on_func : - _p = ((yamop *)(&((_p)->u.sssl.next))); + _p = ((yamop *)(&((_p)->y_u.sssl.next))); break; case _go_on_cons : - _p = ((yamop *)(&((_p)->u.sssl.next))); + _p = ((yamop *)(&((_p)->y_u.sssl.next))); break; case _if_func : - _p = ((yamop *)(&((_p)->u.sssl.next))); + _p = ((yamop *)(&((_p)->y_u.sssl.next))); break; case _if_cons : - _p = ((yamop *)(&((_p)->u.sssl.next))); + _p = ((yamop *)(&((_p)->y_u.sssl.next))); break; case _index_dbref : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _index_blob : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _index_long : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _jit_handler : - _p = ((yamop *)(&((_p)->u.jhc.next))); + _p = ((yamop *)(&((_p)->y_u.J.next))); break; case _p_atom_x : - _p = ((yamop *)(&((_p)->u.xl.next))); + _p = ((yamop *)(&((_p)->y_u.xl.next))); break; case _p_atom_y : - _p = ((yamop *)(&((_p)->u.yl.next))); + _p = ((yamop *)(&((_p)->y_u.yl.next))); break; case _p_atomic_x : - _p = ((yamop *)(&((_p)->u.xl.next))); + _p = ((yamop *)(&((_p)->y_u.xl.next))); break; case _p_atomic_y : - _p = ((yamop *)(&((_p)->u.yl.next))); + _p = ((yamop *)(&((_p)->y_u.yl.next))); break; case _p_integer_x : - _p = ((yamop *)(&((_p)->u.xl.next))); + _p = ((yamop *)(&((_p)->y_u.xl.next))); break; case _p_integer_y : - _p = ((yamop *)(&((_p)->u.yl.next))); + _p = ((yamop *)(&((_p)->y_u.yl.next))); break; case _p_nonvar_x : - _p = ((yamop *)(&((_p)->u.xl.next))); + _p = ((yamop *)(&((_p)->y_u.xl.next))); break; case _p_nonvar_y : - _p = ((yamop *)(&((_p)->u.yl.next))); + _p = ((yamop *)(&((_p)->y_u.yl.next))); break; case _p_number_x : - _p = ((yamop *)(&((_p)->u.xl.next))); + _p = ((yamop *)(&((_p)->y_u.xl.next))); break; case _p_number_y : - _p = ((yamop *)(&((_p)->u.yl.next))); + _p = ((yamop *)(&((_p)->y_u.yl.next))); break; case _p_var_x : - _p = ((yamop *)(&((_p)->u.xl.next))); + _p = ((yamop *)(&((_p)->y_u.xl.next))); break; case _p_var_y : - _p = ((yamop *)(&((_p)->u.yl.next))); + _p = ((yamop *)(&((_p)->y_u.yl.next))); break; case _p_db_ref_x : - _p = ((yamop *)(&((_p)->u.xl.next))); + _p = ((yamop *)(&((_p)->y_u.xl.next))); break; case _p_db_ref_y : - _p = ((yamop *)(&((_p)->u.yl.next))); + _p = ((yamop *)(&((_p)->y_u.yl.next))); break; case _p_primitive_x : - _p = ((yamop *)(&((_p)->u.xl.next))); + _p = ((yamop *)(&((_p)->y_u.xl.next))); break; case _p_primitive_y : - _p = ((yamop *)(&((_p)->u.yl.next))); + _p = ((yamop *)(&((_p)->y_u.yl.next))); break; case _p_compound_x : - _p = ((yamop *)(&((_p)->u.xl.next))); + _p = ((yamop *)(&((_p)->y_u.xl.next))); break; case _p_compound_y : - _p = ((yamop *)(&((_p)->u.yl.next))); + _p = ((yamop *)(&((_p)->y_u.yl.next))); break; case _p_float_x : - _p = ((yamop *)(&((_p)->u.xl.next))); + _p = ((yamop *)(&((_p)->y_u.xl.next))); break; case _p_float_y : - _p = ((yamop *)(&((_p)->u.yl.next))); + _p = ((yamop *)(&((_p)->y_u.yl.next))); break; case _p_plus_vv : - _p = ((yamop *)(&((_p)->u.xxx.next))); + _p = ((yamop *)(&((_p)->y_u.xxx.next))); break; case _p_plus_vc : - _p = ((yamop *)(&((_p)->u.xxn.next))); + _p = ((yamop *)(&((_p)->y_u.xxn.next))); break; case _p_plus_y_vv : - _p = ((yamop *)(&((_p)->u.yxx.next))); + _p = ((yamop *)(&((_p)->y_u.yxx.next))); break; case _p_plus_y_vc : - _p = ((yamop *)(&((_p)->u.yxn.next))); + _p = ((yamop *)(&((_p)->y_u.yxn.next))); break; case _p_minus_vv : - _p = ((yamop *)(&((_p)->u.xxx.next))); + _p = ((yamop *)(&((_p)->y_u.xxx.next))); break; case _p_minus_cv : - _p = ((yamop *)(&((_p)->u.xxn.next))); + _p = ((yamop *)(&((_p)->y_u.xxn.next))); break; case _p_minus_y_vv : - _p = ((yamop *)(&((_p)->u.yxx.next))); + _p = ((yamop *)(&((_p)->y_u.yxx.next))); break; case _p_minus_y_cv : - _p = ((yamop *)(&((_p)->u.yxn.next))); + _p = ((yamop *)(&((_p)->y_u.yxn.next))); break; case _p_times_vv : - _p = ((yamop *)(&((_p)->u.xxx.next))); + _p = ((yamop *)(&((_p)->y_u.xxx.next))); break; case _p_times_vc : - _p = ((yamop *)(&((_p)->u.xxn.next))); + _p = ((yamop *)(&((_p)->y_u.xxn.next))); break; case _p_times_y_vv : - _p = ((yamop *)(&((_p)->u.yxx.next))); + _p = ((yamop *)(&((_p)->y_u.yxx.next))); break; case _p_times_y_vc : - _p = ((yamop *)(&((_p)->u.yxn.next))); + _p = ((yamop *)(&((_p)->y_u.yxn.next))); break; case _p_div_vv : - _p = ((yamop *)(&((_p)->u.xxx.next))); + _p = ((yamop *)(&((_p)->y_u.xxx.next))); break; case _p_div_vc : - _p = ((yamop *)(&((_p)->u.xxn.next))); + _p = ((yamop *)(&((_p)->y_u.xxn.next))); break; case _p_div_cv : - _p = ((yamop *)(&((_p)->u.xxn.next))); + _p = ((yamop *)(&((_p)->y_u.xxn.next))); break; case _p_div_y_vv : - _p = ((yamop *)(&((_p)->u.yxx.next))); + _p = ((yamop *)(&((_p)->y_u.yxx.next))); break; case _p_div_y_vc : - _p = ((yamop *)(&((_p)->u.yxn.next))); + _p = ((yamop *)(&((_p)->y_u.yxn.next))); break; case _p_div_y_cv : - _p = ((yamop *)(&((_p)->u.yxn.next))); + _p = ((yamop *)(&((_p)->y_u.yxn.next))); break; case _p_and_vv : - _p = ((yamop *)(&((_p)->u.xxx.next))); + _p = ((yamop *)(&((_p)->y_u.xxx.next))); break; case _p_and_vc : - _p = ((yamop *)(&((_p)->u.xxn.next))); + _p = ((yamop *)(&((_p)->y_u.xxn.next))); break; case _p_and_y_vv : - _p = ((yamop *)(&((_p)->u.yxx.next))); + _p = ((yamop *)(&((_p)->y_u.yxx.next))); break; case _p_and_y_vc : - _p = ((yamop *)(&((_p)->u.yxn.next))); + _p = ((yamop *)(&((_p)->y_u.yxn.next))); break; case _p_or_vv : - _p = ((yamop *)(&((_p)->u.xxx.next))); + _p = ((yamop *)(&((_p)->y_u.xxx.next))); break; case _p_or_vc : - _p = ((yamop *)(&((_p)->u.xxn.next))); + _p = ((yamop *)(&((_p)->y_u.xxn.next))); break; case _p_or_y_vv : - _p = ((yamop *)(&((_p)->u.yxx.next))); + _p = ((yamop *)(&((_p)->y_u.yxx.next))); break; case _p_or_y_vc : - _p = ((yamop *)(&((_p)->u.yxn.next))); + _p = ((yamop *)(&((_p)->y_u.yxn.next))); break; case _p_sll_vv : - _p = ((yamop *)(&((_p)->u.xxx.next))); + _p = ((yamop *)(&((_p)->y_u.xxx.next))); break; case _p_sll_vc : - _p = ((yamop *)(&((_p)->u.xxn.next))); + _p = ((yamop *)(&((_p)->y_u.xxn.next))); break; case _p_sll_cv : - _p = ((yamop *)(&((_p)->u.xxn.next))); + _p = ((yamop *)(&((_p)->y_u.xxn.next))); break; case _p_sll_y_vv : - _p = ((yamop *)(&((_p)->u.yxx.next))); + _p = ((yamop *)(&((_p)->y_u.yxx.next))); break; case _p_sll_y_vc : - _p = ((yamop *)(&((_p)->u.yxn.next))); + _p = ((yamop *)(&((_p)->y_u.yxn.next))); break; case _p_sll_y_cv : - _p = ((yamop *)(&((_p)->u.yxn.next))); + _p = ((yamop *)(&((_p)->y_u.yxn.next))); break; case _p_slr_vv : - _p = ((yamop *)(&((_p)->u.xxx.next))); + _p = ((yamop *)(&((_p)->y_u.xxx.next))); break; case _p_slr_vc : - _p = ((yamop *)(&((_p)->u.xxn.next))); + _p = ((yamop *)(&((_p)->y_u.xxn.next))); break; case _p_slr_cv : - _p = ((yamop *)(&((_p)->u.xxn.next))); + _p = ((yamop *)(&((_p)->y_u.xxn.next))); break; case _p_slr_y_vv : - _p = ((yamop *)(&((_p)->u.yxx.next))); + _p = ((yamop *)(&((_p)->y_u.yxx.next))); break; case _p_slr_y_vc : - _p = ((yamop *)(&((_p)->u.yxn.next))); + _p = ((yamop *)(&((_p)->y_u.yxn.next))); break; case _p_slr_y_cv : - _p = ((yamop *)(&((_p)->u.yxn.next))); + _p = ((yamop *)(&((_p)->y_u.yxn.next))); break; case _call_bfunc_xx : - _p = ((yamop *)(&((_p)->u.plxxs.next))); + _p = ((yamop *)(&((_p)->y_u.plxxs.next))); break; case _call_bfunc_yx : - _p = ((yamop *)(&((_p)->u.plxys.next))); + _p = ((yamop *)(&((_p)->y_u.plxys.next))); break; case _call_bfunc_xy : - _p = ((yamop *)(&((_p)->u.plxys.next))); + _p = ((yamop *)(&((_p)->y_u.plxys.next))); break; case _call_bfunc_yy : - _p = ((yamop *)(&((_p)->u.plyys.next))); + _p = ((yamop *)(&((_p)->y_u.plyys.next))); break; case _p_equal : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _p_dif : - _p = ((yamop *)(&((_p)->u.l.next))); + _p = ((yamop *)(&((_p)->y_u.l.next))); break; case _p_eq : - _p = ((yamop *)(&((_p)->u.l.next))); + _p = ((yamop *)(&((_p)->y_u.l.next))); break; case _p_arg_vv : - _p = ((yamop *)(&((_p)->u.xxx.next))); + _p = ((yamop *)(&((_p)->y_u.xxx.next))); break; case _p_arg_cv : - _p = ((yamop *)(&((_p)->u.xxn.next))); + _p = ((yamop *)(&((_p)->y_u.xxn.next))); break; case _p_arg_y_vv : - _p = ((yamop *)(&((_p)->u.yxx.next))); + _p = ((yamop *)(&((_p)->y_u.yxx.next))); break; case _p_arg_y_cv : - _p = ((yamop *)(&((_p)->u.yxn.next))); + _p = ((yamop *)(&((_p)->y_u.yxn.next))); break; case _p_func2s_vv : - _p = ((yamop *)(&((_p)->u.xxx.next))); + _p = ((yamop *)(&((_p)->y_u.xxx.next))); break; case _p_func2s_cv : - _p = ((yamop *)(&((_p)->u.xxc.next))); + _p = ((yamop *)(&((_p)->y_u.xxc.next))); break; case _p_func2s_vc : - _p = ((yamop *)(&((_p)->u.xxn.next))); + _p = ((yamop *)(&((_p)->y_u.xxn.next))); break; case _p_func2s_y_vv : - _p = ((yamop *)(&((_p)->u.yxx.next))); + _p = ((yamop *)(&((_p)->y_u.yxx.next))); break; case _p_func2s_y_cv : - _p = ((yamop *)(&((_p)->u.yxn.next))); + _p = ((yamop *)(&((_p)->y_u.yxn.next))); break; case _p_func2s_y_vc : - _p = ((yamop *)(&((_p)->u.yxn.next))); + _p = ((yamop *)(&((_p)->y_u.yxn.next))); break; case _p_func2f_xx : - _p = ((yamop *)(&((_p)->u.xxx.next))); + _p = ((yamop *)(&((_p)->y_u.xxx.next))); break; case _p_func2f_xy : - _p = ((yamop *)(&((_p)->u.xxy.next))); + _p = ((yamop *)(&((_p)->y_u.xxy.next))); break; case _p_func2f_yx : - _p = ((yamop *)(&((_p)->u.yxx.next))); + _p = ((yamop *)(&((_p)->y_u.yxx.next))); break; case _p_func2f_yy : - _p = ((yamop *)(&((_p)->u.yyx.next))); + _p = ((yamop *)(&((_p)->y_u.yyx.next))); break; case _p_functor : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _p_execute2 : - _p = ((yamop *)(&((_p)->u.Osbpp.next))); + _p = ((yamop *)(&((_p)->y_u.Osbpp.next))); break; case _p_execute : - _p = ((yamop *)(&((_p)->u.Osbmp.next))); + _p = ((yamop *)(&((_p)->y_u.Osbmp.next))); break; case _p_execute_tail : - _p = ((yamop *)(&((_p)->u.Osbpp.next))); + _p = ((yamop *)(&((_p)->y_u.Osbpp.next))); break; #ifdef YAPOR case _getwork_first_time : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _getwork : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _getwork_seq : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _sync : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; #endif #ifdef TABLING #ifdef TABLING_INNER_CUTS case _clause_with_cut : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; #endif case _table_load_answer : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _table_try_answer : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _table_try_single : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _table_try_me : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _table_try : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _table_retry_me : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _table_retry : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _table_trust_me : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _table_trust : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _table_new_answer : - _p = ((yamop *)(&((_p)->u.s.next))); + _p = ((yamop *)(&((_p)->y_u.s.next))); break; case _table_answer_resolution : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _table_completion : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; #ifdef THREADS_CONSUMER_SHARING case _table_answer_resolution_completion: - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; #endif case _trie_do_var : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_trust_var : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_try_var : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_retry_var : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_do_var_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_trust_var_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_try_var_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_retry_var_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_do_val : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_trust_val : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_try_val : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_retry_val : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_do_val_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_trust_val_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_try_val_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_retry_val_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_do_atom : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_trust_atom : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_try_atom : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_retry_atom : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_do_atom_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_trust_atom_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_try_atom_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_retry_atom_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_do_null : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_trust_null : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_try_null : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_retry_null : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_do_null_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_trust_null_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_try_null_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_retry_null_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_do_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_trust_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_try_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_retry_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_do_appl : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_trust_appl : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_try_appl : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_retry_appl : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_do_appl_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_trust_appl_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_try_appl_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_retry_appl_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_do_extension : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_trust_extension : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_try_extension : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_retry_extension : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_do_double : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_trust_double : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_try_double : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_retry_double : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_do_longint : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_trust_longint : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_try_longint : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_retry_longint : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_do_gterm : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_trust_gterm : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_try_gterm : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _trie_retry_gterm : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; #endif #ifdef YAPOR case _or_last : - _p = ((yamop *)(&((_p)->u.sblp.next))); + _p = ((yamop *)(&((_p)->y_u.sblp.next))); break; #else case _or_last : - _p = ((yamop *)(&((_p)->u.p.next))); + _p = ((yamop *)(&((_p)->y_u.p.next))); break; #endif case _traced_Ystop : - _p = ((yamop *)(&((_p)->u.l.next))); + _p = ((yamop *)(&((_p)->y_u.l.next))); break; case _traced_Nstop : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_try_me : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _traced_retry_me : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _traced_trust_me : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _traced_enter_profiling : - _p = ((yamop *)(&((_p)->u.p.next))); + _p = ((yamop *)(&((_p)->y_u.p.next))); break; case _traced_retry_profiled : - _p = ((yamop *)(&((_p)->u.p.next))); + _p = ((yamop *)(&((_p)->y_u.p.next))); break; case _traced_profiled_retry_me : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _traced_profiled_trust_me : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _traced_profiled_retry_logical : - _p = ((yamop *)(&((_p)->u.OtaLl.next))); + _p = ((yamop *)(&((_p)->y_u.OtaLl.next))); break; case _traced_profiled_trust_logical : - _p = ((yamop *)(&((_p)->u.OtILl.next))); + _p = ((yamop *)(&((_p)->y_u.OtILl.next))); break; case _traced_count_call : - _p = ((yamop *)(&((_p)->u.p.next))); + _p = ((yamop *)(&((_p)->y_u.p.next))); break; case _traced_count_retry : - _p = ((yamop *)(&((_p)->u.p.next))); + _p = ((yamop *)(&((_p)->y_u.p.next))); break; case _traced_count_retry_me : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _traced_count_trust_me : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _traced_count_retry_logical : - _p = ((yamop *)(&((_p)->u.OtaLl.next))); + _p = ((yamop *)(&((_p)->y_u.OtaLl.next))); break; case _traced_count_trust_logical : - _p = ((yamop *)(&((_p)->u.OtILl.next))); + _p = ((yamop *)(&((_p)->y_u.OtILl.next))); break; case _traced_lock_lu : - _p = ((yamop *)(&((_p)->u.p.next))); + _p = ((yamop *)(&((_p)->y_u.p.next))); break; case _traced_unlock_lu : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_alloc_for_logical_pred : - _p = ((yamop *)(&((_p)->u.L.next))); + _p = ((yamop *)(&((_p)->y_u.L.next))); break; case _traced_copy_idb_term : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_unify_idb_term : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_ensure_space : - _p = ((yamop *)(&((_p)->u.Osbpa.next))); + _p = ((yamop *)(&((_p)->y_u.Osbpa.next))); break; case _traced_spy_or_trymark : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _traced_try_and_mark : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _traced_count_retry_and_mark : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _traced_profiled_retry_and_mark : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _traced_retry_and_mark : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _traced_trust_fail : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_op_fail : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_cut : - _p = ((yamop *)(&((_p)->u.s.next))); + _p = ((yamop *)(&((_p)->y_u.s.next))); break; case _traced_cut_t : - _p = ((yamop *)(&((_p)->u.s.next))); + _p = ((yamop *)(&((_p)->y_u.s.next))); break; case _traced_cut_e : - _p = ((yamop *)(&((_p)->u.s.next))); + _p = ((yamop *)(&((_p)->y_u.s.next))); break; case _traced_save_b_x : - _p = ((yamop *)(&((_p)->u.x.next))); + _p = ((yamop *)(&((_p)->y_u.x.next))); break; case _traced_save_b_y : - _p = ((yamop *)(&((_p)->u.y.next))); + _p = ((yamop *)(&((_p)->y_u.y.next))); break; case _traced_commit_b_x : - _p = ((yamop *)(&((_p)->u.xps.next))); + _p = ((yamop *)(&((_p)->y_u.xps.next))); break; case _traced_commit_b_y : - _p = ((yamop *)(&((_p)->u.yps.next))); + _p = ((yamop *)(&((_p)->y_u.yps.next))); break; case _traced_execute : - _p = ((yamop *)(&((_p)->u.pp.next))); + _p = ((yamop *)(&((_p)->y_u.pp.next))); break; case _traced_dexecute : - _p = ((yamop *)(&((_p)->u.pp.next))); + _p = ((yamop *)(&((_p)->y_u.pp.next))); break; case _traced_fcall : - _p = ((yamop *)(&((_p)->u.Osbpp.next))); + _p = ((yamop *)(&((_p)->y_u.Osbpp.next))); break; case _traced_call : - _p = ((yamop *)(&((_p)->u.Osbpp.next))); + _p = ((yamop *)(&((_p)->y_u.Osbpp.next))); break; case _traced_procceed : - _p = ((yamop *)(&((_p)->u.p.next))); + _p = ((yamop *)(&((_p)->y_u.p.next))); l = (CELL)_p; break; case _traced_allocate : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_deallocate : - _p = ((yamop *)(&((_p)->u.p.next))); + _p = ((yamop *)(&((_p)->y_u.p.next))); break; #ifdef BEAM case _traced_retry_eam : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; #endif #ifdef BEAM case _traced_run_eam : - _p = ((yamop *)(&((_p)->u.os.next))); + _p = ((yamop *)(&((_p)->y_u.os.next))); break; #endif case _traced_get_x_var : - _p = ((yamop *)(&((_p)->u.xx.next))); + _p = ((yamop *)(&((_p)->y_u.xx.next))); break; case _traced_get_y_var : - _p = ((yamop *)(&((_p)->u.yx.next))); + _p = ((yamop *)(&((_p)->y_u.yx.next))); break; case _traced_get_yy_var : - _p = ((yamop *)(&((_p)->u.yyxx.next))); + _p = ((yamop *)(&((_p)->y_u.yyxx.next))); break; case _traced_get_x_val : - _p = ((yamop *)(&((_p)->u.xx.next))); + _p = ((yamop *)(&((_p)->y_u.xx.next))); break; case _traced_get_y_val : - _p = ((yamop *)(&((_p)->u.yx.next))); + _p = ((yamop *)(&((_p)->y_u.yx.next))); break; case _traced_get_atom : - _p = ((yamop *)(&((_p)->u.xc.next))); + _p = ((yamop *)(&((_p)->y_u.xc.next))); break; case _traced_get_2atoms : - _p = ((yamop *)(&((_p)->u.cc.next))); + _p = ((yamop *)(&((_p)->y_u.cc.next))); break; case _traced_get_3atoms : - _p = ((yamop *)(&((_p)->u.ccc.next))); + _p = ((yamop *)(&((_p)->y_u.ccc.next))); break; case _traced_get_4atoms : - _p = ((yamop *)(&((_p)->u.cccc.next))); + _p = ((yamop *)(&((_p)->y_u.cccc.next))); break; case _traced_get_5atoms : - _p = ((yamop *)(&((_p)->u.ccccc.next))); + _p = ((yamop *)(&((_p)->y_u.ccccc.next))); break; case _traced_get_6atoms : - _p = ((yamop *)(&((_p)->u.cccccc.next))); + _p = ((yamop *)(&((_p)->y_u.cccccc.next))); break; case _traced_get_list : - _p = ((yamop *)(&((_p)->u.x.next))); + _p = ((yamop *)(&((_p)->y_u.x.next))); break; case _traced_get_struct : - _p = ((yamop *)(&((_p)->u.xfa.next))); + _p = ((yamop *)(&((_p)->y_u.xfa.next))); break; case _traced_get_float : - _p = ((yamop *)(&((_p)->u.xd.next))); + _p = ((yamop *)(&((_p)->y_u.xd.next))); break; case _traced_get_longint : - _p = ((yamop *)(&((_p)->u.xi.next))); + _p = ((yamop *)(&((_p)->y_u.xi.next))); break; case _traced_get_bigint : - _p = ((yamop *)(&((_p)->u.xN.next))); + _p = ((yamop *)(&((_p)->y_u.xN.next))); break; case _traced_get_dbterm : - _p = ((yamop *)(&((_p)->u.xD.next))); + _p = ((yamop *)(&((_p)->y_u.xD.next))); break; case _traced_glist_valx : - _p = ((yamop *)(&((_p)->u.xx.next))); + _p = ((yamop *)(&((_p)->y_u.xx.next))); break; case _traced_glist_valy : - _p = ((yamop *)(&((_p)->u.yx.next))); + _p = ((yamop *)(&((_p)->y_u.yx.next))); break; case _traced_gl_void_varx : - _p = ((yamop *)(&((_p)->u.xx.next))); + _p = ((yamop *)(&((_p)->y_u.xx.next))); break; case _traced_gl_void_vary : - _p = ((yamop *)(&((_p)->u.yx.next))); + _p = ((yamop *)(&((_p)->y_u.yx.next))); break; case _traced_gl_void_valx : - _p = ((yamop *)(&((_p)->u.xx.next))); + _p = ((yamop *)(&((_p)->y_u.xx.next))); break; case _traced_gl_void_valy : - _p = ((yamop *)(&((_p)->u.yx.next))); + _p = ((yamop *)(&((_p)->y_u.yx.next))); break; case _traced_unify_x_var : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _traced_unify_x_var_write : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _traced_unify_l_x_var : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _traced_unify_l_x_var_write : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _traced_unify_x_var2 : - _p = ((yamop *)(&((_p)->u.oxx.next))); + _p = ((yamop *)(&((_p)->y_u.oxx.next))); break; case _traced_unify_x_var2_write : - _p = ((yamop *)(&((_p)->u.oxx.next))); + _p = ((yamop *)(&((_p)->y_u.oxx.next))); break; case _traced_unify_l_x_var2 : - _p = ((yamop *)(&((_p)->u.oxx.next))); + _p = ((yamop *)(&((_p)->y_u.oxx.next))); break; case _traced_unify_l_x_var2_write : - _p = ((yamop *)(&((_p)->u.oxx.next))); + _p = ((yamop *)(&((_p)->y_u.oxx.next))); break; case _traced_unify_y_var : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _traced_unify_y_var_write : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _traced_unify_l_y_var : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _traced_unify_l_y_var_write : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _traced_unify_x_val : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _traced_unify_x_val_write : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _traced_unify_l_x_val : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _traced_unify_l_x_val_write : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _traced_unify_y_val : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _traced_unify_y_val_write : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _traced_unify_l_y_val : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _traced_unify_l_y_val_write : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _traced_unify_x_loc : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _traced_unify_x_loc_write : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _traced_unify_l_x_loc : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _traced_unify_l_x_loc_write : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _traced_unify_y_loc : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _traced_unify_y_loc_write : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _traced_unify_l_y_loc : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _traced_unify_l_y_loc_write : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _traced_unify_void : - _p = ((yamop *)(&((_p)->u.o.next))); + _p = ((yamop *)(&((_p)->y_u.o.next))); break; case _traced_unify_void_write : - _p = ((yamop *)(&((_p)->u.o.next))); + _p = ((yamop *)(&((_p)->y_u.o.next))); break; case _traced_unify_l_void : - _p = ((yamop *)(&((_p)->u.o.next))); + _p = ((yamop *)(&((_p)->y_u.o.next))); break; case _traced_unify_l_void_write : - _p = ((yamop *)(&((_p)->u.o.next))); + _p = ((yamop *)(&((_p)->y_u.o.next))); break; case _traced_unify_n_voids : - _p = ((yamop *)(&((_p)->u.os.next))); + _p = ((yamop *)(&((_p)->y_u.os.next))); break; case _traced_unify_n_voids_write : - _p = ((yamop *)(&((_p)->u.os.next))); + _p = ((yamop *)(&((_p)->y_u.os.next))); break; case _traced_unify_l_n_voids : - _p = ((yamop *)(&((_p)->u.os.next))); + _p = ((yamop *)(&((_p)->y_u.os.next))); break; case _traced_unify_l_n_voids_write : - _p = ((yamop *)(&((_p)->u.os.next))); + _p = ((yamop *)(&((_p)->y_u.os.next))); break; case _traced_unify_atom : - _p = ((yamop *)(&((_p)->u.oc.next))); + _p = ((yamop *)(&((_p)->y_u.oc.next))); break; case _traced_unify_atom_write : - _p = ((yamop *)(&((_p)->u.oc.next))); + _p = ((yamop *)(&((_p)->y_u.oc.next))); break; case _traced_unify_l_atom : - _p = ((yamop *)(&((_p)->u.oc.next))); + _p = ((yamop *)(&((_p)->y_u.oc.next))); break; case _traced_unify_l_atom_write : - _p = ((yamop *)(&((_p)->u.oc.next))); + _p = ((yamop *)(&((_p)->y_u.oc.next))); break; case _traced_unify_n_atoms : - _p = ((yamop *)(&((_p)->u.osc.next))); + _p = ((yamop *)(&((_p)->y_u.osc.next))); break; case _traced_unify_n_atoms_write : - _p = ((yamop *)(&((_p)->u.osc.next))); + _p = ((yamop *)(&((_p)->y_u.osc.next))); break; case _traced_unify_float : - _p = ((yamop *)(&((_p)->u.od.next))); + _p = ((yamop *)(&((_p)->y_u.od.next))); break; case _traced_unify_float_write : - _p = ((yamop *)(&((_p)->u.od.next))); + _p = ((yamop *)(&((_p)->y_u.od.next))); break; case _traced_unify_l_float : - _p = ((yamop *)(&((_p)->u.od.next))); + _p = ((yamop *)(&((_p)->y_u.od.next))); break; case _traced_unify_l_float_write : - _p = ((yamop *)(&((_p)->u.od.next))); + _p = ((yamop *)(&((_p)->y_u.od.next))); break; case _traced_unify_longint : - _p = ((yamop *)(&((_p)->u.oi.next))); + _p = ((yamop *)(&((_p)->y_u.oi.next))); break; case _traced_unify_longint_write : - _p = ((yamop *)(&((_p)->u.oi.next))); + _p = ((yamop *)(&((_p)->y_u.oi.next))); break; case _traced_unify_l_longint : - _p = ((yamop *)(&((_p)->u.oi.next))); + _p = ((yamop *)(&((_p)->y_u.oi.next))); break; case _traced_unify_l_longint_write : - _p = ((yamop *)(&((_p)->u.oi.next))); + _p = ((yamop *)(&((_p)->y_u.oi.next))); break; case _traced_unify_bigint : - _p = ((yamop *)(&((_p)->u.oN.next))); + _p = ((yamop *)(&((_p)->y_u.oN.next))); break; case _traced_unify_l_bigint : - _p = ((yamop *)(&((_p)->u.oN.next))); + _p = ((yamop *)(&((_p)->y_u.oN.next))); break; case _traced_unify_dbterm : - _p = ((yamop *)(&((_p)->u.oD.next))); + _p = ((yamop *)(&((_p)->y_u.oD.next))); break; case _traced_unify_l_dbterm : - _p = ((yamop *)(&((_p)->u.oD.next))); + _p = ((yamop *)(&((_p)->y_u.oD.next))); break; case _traced_unify_list : - _p = ((yamop *)(&((_p)->u.o.next))); + _p = ((yamop *)(&((_p)->y_u.o.next))); break; case _traced_unify_list_write : - _p = ((yamop *)(&((_p)->u.o.next))); + _p = ((yamop *)(&((_p)->y_u.o.next))); break; case _traced_unify_l_list : - _p = ((yamop *)(&((_p)->u.o.next))); + _p = ((yamop *)(&((_p)->y_u.o.next))); break; case _traced_unify_l_list_write : - _p = ((yamop *)(&((_p)->u.o.next))); + _p = ((yamop *)(&((_p)->y_u.o.next))); break; case _traced_unify_struct : - _p = ((yamop *)(&((_p)->u.ofa.next))); + _p = ((yamop *)(&((_p)->y_u.ofa.next))); break; case _traced_unify_struct_write : - _p = ((yamop *)(&((_p)->u.ofa.next))); + _p = ((yamop *)(&((_p)->y_u.ofa.next))); break; case _traced_unify_l_struc : - _p = ((yamop *)(&((_p)->u.ofa.next))); + _p = ((yamop *)(&((_p)->y_u.ofa.next))); break; case _traced_unify_l_struc_write : - _p = ((yamop *)(&((_p)->u.ofa.next))); + _p = ((yamop *)(&((_p)->y_u.ofa.next))); break; case _traced_put_x_var : - _p = ((yamop *)(&((_p)->u.xx.next))); + _p = ((yamop *)(&((_p)->y_u.xx.next))); break; case _traced_put_y_var : - _p = ((yamop *)(&((_p)->u.yx.next))); + _p = ((yamop *)(&((_p)->y_u.yx.next))); break; case _traced_put_x_val : - _p = ((yamop *)(&((_p)->u.xx.next))); + _p = ((yamop *)(&((_p)->y_u.xx.next))); break; case _traced_put_xx_val : - _p = ((yamop *)(&((_p)->u.xxxx.next))); + _p = ((yamop *)(&((_p)->y_u.xxxx.next))); break; case _traced_put_y_val : - _p = ((yamop *)(&((_p)->u.yx.next))); + _p = ((yamop *)(&((_p)->y_u.yx.next))); break; case _traced_put_y_vals : - _p = ((yamop *)(&((_p)->u.yyxx.next))); + _p = ((yamop *)(&((_p)->y_u.yyxx.next))); break; case _traced_put_unsafe : - _p = ((yamop *)(&((_p)->u.yx.next))); + _p = ((yamop *)(&((_p)->y_u.yx.next))); break; case _traced_put_atom : - _p = ((yamop *)(&((_p)->u.xc.next))); + _p = ((yamop *)(&((_p)->y_u.xc.next))); break; case _traced_put_dbterm : - _p = ((yamop *)(&((_p)->u.xD.next))); + _p = ((yamop *)(&((_p)->y_u.xD.next))); break; case _traced_put_bigint : - _p = ((yamop *)(&((_p)->u.xN.next))); + _p = ((yamop *)(&((_p)->y_u.xN.next))); break; case _traced_put_float : - _p = ((yamop *)(&((_p)->u.xd.next))); + _p = ((yamop *)(&((_p)->y_u.xd.next))); break; case _traced_put_longint : - _p = ((yamop *)(&((_p)->u.xi.next))); + _p = ((yamop *)(&((_p)->y_u.xi.next))); break; case _traced_put_list : - _p = ((yamop *)(&((_p)->u.x.next))); + _p = ((yamop *)(&((_p)->y_u.x.next))); break; case _traced_put_struct : - _p = ((yamop *)(&((_p)->u.xfa.next))); + _p = ((yamop *)(&((_p)->y_u.xfa.next))); break; case _traced_write_x_var : - _p = ((yamop *)(&((_p)->u.x.next))); + _p = ((yamop *)(&((_p)->y_u.x.next))); break; case _traced_write_void : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_write_n_voids : - _p = ((yamop *)(&((_p)->u.s.next))); + _p = ((yamop *)(&((_p)->y_u.s.next))); break; case _traced_write_y_var : - _p = ((yamop *)(&((_p)->u.y.next))); + _p = ((yamop *)(&((_p)->y_u.y.next))); break; case _traced_write_x_val : - _p = ((yamop *)(&((_p)->u.x.next))); + _p = ((yamop *)(&((_p)->y_u.x.next))); break; case _traced_write_x_loc : - _p = ((yamop *)(&((_p)->u.x.next))); + _p = ((yamop *)(&((_p)->y_u.x.next))); break; case _traced_write_y_val : - _p = ((yamop *)(&((_p)->u.y.next))); + _p = ((yamop *)(&((_p)->y_u.y.next))); break; case _traced_write_y_loc : - _p = ((yamop *)(&((_p)->u.y.next))); + _p = ((yamop *)(&((_p)->y_u.y.next))); break; case _traced_write_atom : - _p = ((yamop *)(&((_p)->u.c.next))); + _p = ((yamop *)(&((_p)->y_u.c.next))); break; case _traced_write_bigint : - _p = ((yamop *)(&((_p)->u.N.next))); + _p = ((yamop *)(&((_p)->y_u.N.next))); break; case _traced_write_dbterm : - _p = ((yamop *)(&((_p)->u.D.next))); + _p = ((yamop *)(&((_p)->y_u.D.next))); break; case _traced_write_float : - _p = ((yamop *)(&((_p)->u.d.next))); + _p = ((yamop *)(&((_p)->y_u.d.next))); break; case _traced_write_longint : - _p = ((yamop *)(&((_p)->u.i.next))); + _p = ((yamop *)(&((_p)->y_u.i.next))); break; case _traced_write_n_atoms : - _p = ((yamop *)(&((_p)->u.sc.next))); + _p = ((yamop *)(&((_p)->y_u.sc.next))); break; case _traced_write_list : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_write_l_list : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_write_struct : - _p = ((yamop *)(&((_p)->u.fa.next))); + _p = ((yamop *)(&((_p)->y_u.fa.next))); break; case _traced_write_l_struc : - _p = ((yamop *)(&((_p)->u.fa.next))); + _p = ((yamop *)(&((_p)->y_u.fa.next))); break; case _traced_save_pair_x : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _traced_save_pair_x_write : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _traced_save_pair_y : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _traced_save_pair_y_write : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _traced_save_appl_x : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _traced_save_appl_x_write : - _p = ((yamop *)(&((_p)->u.ox.next))); + _p = ((yamop *)(&((_p)->y_u.ox.next))); break; case _traced_save_appl_y : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _traced_save_appl_y_write : - _p = ((yamop *)(&((_p)->u.oy.next))); + _p = ((yamop *)(&((_p)->y_u.oy.next))); break; case _traced_jump : - _p = ((yamop *)(&((_p)->u.l.next))); + _p = ((yamop *)(&((_p)->y_u.l.next))); break; case _traced_move_back : - _p = ((yamop *)(&((_p)->u.l.next))); + _p = ((yamop *)(&((_p)->y_u.l.next))); break; case _traced_skip : - _p = ((yamop *)(&((_p)->u.l.next))); + _p = ((yamop *)(&((_p)->y_u.l.next))); break; case _traced_either : - _p = ((yamop *)(&((_p)->u.Osblp.next))); + _p = ((yamop *)(&((_p)->y_u.Osblp.next))); break; case _traced_or_else : - _p = ((yamop *)(&((_p)->u.Osblp.next))); + _p = ((yamop *)(&((_p)->y_u.Osblp.next))); break; case _traced_pop_n : - _p = ((yamop *)(&((_p)->u.s.next))); + _p = ((yamop *)(&((_p)->y_u.s.next))); break; case _traced_pop : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_call_cpred : - _p = ((yamop *)(&((_p)->u.Osbpp.next))); + _p = ((yamop *)(&((_p)->y_u.Osbpp.next))); break; case _traced_execute_cpred : - _p = ((yamop *)(&((_p)->u.pp.next))); + _p = ((yamop *)(&((_p)->y_u.pp.next))); break; case _traced_call_usercpred : - _p = ((yamop *)(&((_p)->u.Osbpp.next))); + _p = ((yamop *)(&((_p)->y_u.Osbpp.next))); break; case _traced_call_c_wfail : - _p = ((yamop *)(&((_p)->u.slp.next))); + _p = ((yamop *)(&((_p)->y_u.slp.next))); break; case _traced_try_c : - _p = ((yamop *)(&((_p)->u.OtapFs.next))); + _p = ((yamop *)(&((_p)->y_u.OtapFs.next))); break; case _traced_retry_c : - _p = ((yamop *)(&((_p)->u.OtapFs.next))); + _p = ((yamop *)(&((_p)->y_u.OtapFs.next))); break; #ifdef CUT_C case _traced_cut_c : - _p = ((yamop *)(&((_p)->u.OtapFs.next))); + _p = ((yamop *)(&((_p)->y_u.OtapFs.next))); break; #endif case _traced_try_userc : - _p = ((yamop *)(&((_p)->u.OtapFs.next))); + _p = ((yamop *)(&((_p)->y_u.OtapFs.next))); break; case _traced_retry_userc : - _p = ((yamop *)(&((_p)->u.OtapFs.next))); + _p = ((yamop *)(&((_p)->y_u.OtapFs.next))); break; #ifdef CUT_C case _traced_cut_userc : - _p = ((yamop *)(&((_p)->u.OtapFs.next))); + _p = ((yamop *)(&((_p)->y_u.OtapFs.next))); break; #endif case _traced_lock_pred : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_index_pred : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; #ifdef THREADS case _traced_thread_local : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; #endif case _traced_expand_index : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_expand_clauses : - _p = ((yamop *)(&((_p)->u.sssllp.next))); + _p = ((yamop *)(&((_p)->y_u.sssllp.next))); break; case _traced_undef_p : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_spy_pred : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_try_clause : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _traced_try_clause2 : - _p = ((yamop *)(&((_p)->u.l.next))); + _p = ((yamop *)(&((_p)->y_u.l.next))); break; case _traced_try_clause3 : - _p = ((yamop *)(&((_p)->u.l.next))); + _p = ((yamop *)(&((_p)->y_u.l.next))); break; case _traced_try_clause4 : - _p = ((yamop *)(&((_p)->u.l.next))); + _p = ((yamop *)(&((_p)->y_u.l.next))); break; case _traced_retry : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _traced_retry2 : - _p = ((yamop *)(&((_p)->u.l.next))); + _p = ((yamop *)(&((_p)->y_u.l.next))); break; case _traced_retry3 : - _p = ((yamop *)(&((_p)->u.l.next))); + _p = ((yamop *)(&((_p)->y_u.l.next))); break; case _traced_retry4 : - _p = ((yamop *)(&((_p)->u.l.next))); + _p = ((yamop *)(&((_p)->y_u.l.next))); break; case _traced_trust : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _traced_try_in : - _p = ((yamop *)(&((_p)->u.l.next))); + _p = ((yamop *)(&((_p)->y_u.l.next))); break; case _traced_enter_lu_pred : - _p = ((yamop *)(&((_p)->u.Illss.next))); + _p = ((yamop *)(&((_p)->y_u.Illss.next))); break; case _traced_try_logical : - _p = ((yamop *)(&((_p)->u.OtaLl.next))); + _p = ((yamop *)(&((_p)->y_u.OtaLl.next))); break; case _traced_retry_logical : - _p = ((yamop *)(&((_p)->u.OtaLl.next))); + _p = ((yamop *)(&((_p)->y_u.OtaLl.next))); break; case _traced_trust_logical : - _p = ((yamop *)(&((_p)->u.OtILl.next))); + _p = ((yamop *)(&((_p)->y_u.OtILl.next))); break; case _traced_user_switch : - _p = ((yamop *)(&((_p)->u.lp.next))); + _p = ((yamop *)(&((_p)->y_u.lp.next))); break; case _traced_switch_on_type : - _p = ((yamop *)(&((_p)->u.llll.next))); + _p = ((yamop *)(&((_p)->y_u.llll.next))); break; case _traced_switch_list_nl : - _p = ((yamop *)(&((_p)->u.ollll.next))); + _p = ((yamop *)(&((_p)->y_u.ollll.next))); break; case _traced_switch_on_arg_type : - _p = ((yamop *)(&((_p)->u.xllll.next))); + _p = ((yamop *)(&((_p)->y_u.xllll.next))); break; case _traced_switch_on_sub_arg_type : - _p = ((yamop *)(&((_p)->u.sllll.next))); + _p = ((yamop *)(&((_p)->y_u.sllll.next))); break; case _traced_jump_if_var : - _p = ((yamop *)(&((_p)->u.l.next))); + _p = ((yamop *)(&((_p)->y_u.l.next))); break; case _traced_jump_if_nonvar : - _p = ((yamop *)(&((_p)->u.xll.next))); + _p = ((yamop *)(&((_p)->y_u.xll.next))); break; case _traced_if_not_then : - _p = ((yamop *)(&((_p)->u.clll.next))); + _p = ((yamop *)(&((_p)->y_u.clll.next))); break; case _traced_switch_on_func : - _p = ((yamop *)(&((_p)->u.sssl.next))); + _p = ((yamop *)(&((_p)->y_u.sssl.next))); break; case _traced_switch_on_cons : - _p = ((yamop *)(&((_p)->u.sssl.next))); + _p = ((yamop *)(&((_p)->y_u.sssl.next))); break; case _traced_go_on_func : - _p = ((yamop *)(&((_p)->u.sssl.next))); + _p = ((yamop *)(&((_p)->y_u.sssl.next))); break; case _traced_go_on_cons : - _p = ((yamop *)(&((_p)->u.sssl.next))); + _p = ((yamop *)(&((_p)->y_u.sssl.next))); break; case _traced_if_func : - _p = ((yamop *)(&((_p)->u.sssl.next))); + _p = ((yamop *)(&((_p)->y_u.sssl.next))); break; case _traced_if_cons : - _p = ((yamop *)(&((_p)->u.sssl.next))); + _p = ((yamop *)(&((_p)->y_u.sssl.next))); break; case _traced_index_dbref : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_index_blob : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_index_long : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_jit_handler : - _p = ((yamop *)(&((_p)->u.jhc.next))); + _p = ((yamop *)(&((_p)->y_u.J.next))); break; case _traced_p_atom_x : - _p = ((yamop *)(&((_p)->u.xl.next))); + _p = ((yamop *)(&((_p)->y_u.xl.next))); break; case _traced_p_atom_y : - _p = ((yamop *)(&((_p)->u.yl.next))); + _p = ((yamop *)(&((_p)->y_u.yl.next))); break; case _traced_p_atomic_x : - _p = ((yamop *)(&((_p)->u.xl.next))); + _p = ((yamop *)(&((_p)->y_u.xl.next))); break; case _traced_p_atomic_y : - _p = ((yamop *)(&((_p)->u.yl.next))); + _p = ((yamop *)(&((_p)->y_u.yl.next))); break; case _traced_p_integer_x : - _p = ((yamop *)(&((_p)->u.xl.next))); + _p = ((yamop *)(&((_p)->y_u.xl.next))); break; case _traced_p_integer_y : - _p = ((yamop *)(&((_p)->u.yl.next))); + _p = ((yamop *)(&((_p)->y_u.yl.next))); break; case _traced_p_nonvar_x : - _p = ((yamop *)(&((_p)->u.xl.next))); + _p = ((yamop *)(&((_p)->y_u.xl.next))); break; case _traced_p_nonvar_y : - _p = ((yamop *)(&((_p)->u.yl.next))); + _p = ((yamop *)(&((_p)->y_u.yl.next))); break; case _traced_p_number_x : - _p = ((yamop *)(&((_p)->u.xl.next))); + _p = ((yamop *)(&((_p)->y_u.xl.next))); break; case _traced_p_number_y : - _p = ((yamop *)(&((_p)->u.yl.next))); + _p = ((yamop *)(&((_p)->y_u.yl.next))); break; case _traced_p_var_x : - _p = ((yamop *)(&((_p)->u.xl.next))); + _p = ((yamop *)(&((_p)->y_u.xl.next))); break; case _traced_p_var_y : - _p = ((yamop *)(&((_p)->u.yl.next))); + _p = ((yamop *)(&((_p)->y_u.yl.next))); break; case _traced_p_db_ref_x : - _p = ((yamop *)(&((_p)->u.xl.next))); + _p = ((yamop *)(&((_p)->y_u.xl.next))); break; case _traced_p_db_ref_y : - _p = ((yamop *)(&((_p)->u.yl.next))); + _p = ((yamop *)(&((_p)->y_u.yl.next))); break; case _traced_p_primitive_x : - _p = ((yamop *)(&((_p)->u.xl.next))); + _p = ((yamop *)(&((_p)->y_u.xl.next))); break; case _traced_p_primitive_y : - _p = ((yamop *)(&((_p)->u.yl.next))); + _p = ((yamop *)(&((_p)->y_u.yl.next))); break; case _traced_p_compound_x : - _p = ((yamop *)(&((_p)->u.xl.next))); + _p = ((yamop *)(&((_p)->y_u.xl.next))); break; case _traced_p_compound_y : - _p = ((yamop *)(&((_p)->u.yl.next))); + _p = ((yamop *)(&((_p)->y_u.yl.next))); break; case _traced_p_float_x : - _p = ((yamop *)(&((_p)->u.xl.next))); + _p = ((yamop *)(&((_p)->y_u.xl.next))); break; case _traced_p_float_y : - _p = ((yamop *)(&((_p)->u.yl.next))); + _p = ((yamop *)(&((_p)->y_u.yl.next))); break; case _traced_p_plus_vv : - _p = ((yamop *)(&((_p)->u.xxx.next))); + _p = ((yamop *)(&((_p)->y_u.xxx.next))); break; case _traced_p_plus_vc : - _p = ((yamop *)(&((_p)->u.xxn.next))); + _p = ((yamop *)(&((_p)->y_u.xxn.next))); break; case _traced_p_plus_y_vv : - _p = ((yamop *)(&((_p)->u.yxx.next))); + _p = ((yamop *)(&((_p)->y_u.yxx.next))); break; case _traced_p_plus_y_vc : - _p = ((yamop *)(&((_p)->u.yxn.next))); + _p = ((yamop *)(&((_p)->y_u.yxn.next))); break; case _traced_p_minus_vv : - _p = ((yamop *)(&((_p)->u.xxx.next))); + _p = ((yamop *)(&((_p)->y_u.xxx.next))); break; case _traced_p_minus_cv : - _p = ((yamop *)(&((_p)->u.xxn.next))); + _p = ((yamop *)(&((_p)->y_u.xxn.next))); break; case _traced_p_minus_y_vv : - _p = ((yamop *)(&((_p)->u.yxx.next))); + _p = ((yamop *)(&((_p)->y_u.yxx.next))); break; case _traced_p_minus_y_cv : - _p = ((yamop *)(&((_p)->u.yxn.next))); + _p = ((yamop *)(&((_p)->y_u.yxn.next))); break; case _traced_p_times_vv : - _p = ((yamop *)(&((_p)->u.xxx.next))); + _p = ((yamop *)(&((_p)->y_u.xxx.next))); break; case _traced_p_times_vc : - _p = ((yamop *)(&((_p)->u.xxn.next))); + _p = ((yamop *)(&((_p)->y_u.xxn.next))); break; case _traced_p_times_y_vv : - _p = ((yamop *)(&((_p)->u.yxx.next))); + _p = ((yamop *)(&((_p)->y_u.yxx.next))); break; case _traced_p_times_y_vc : - _p = ((yamop *)(&((_p)->u.yxn.next))); + _p = ((yamop *)(&((_p)->y_u.yxn.next))); break; case _traced_p_div_vv : - _p = ((yamop *)(&((_p)->u.xxx.next))); + _p = ((yamop *)(&((_p)->y_u.xxx.next))); break; case _traced_p_div_vc : - _p = ((yamop *)(&((_p)->u.xxn.next))); + _p = ((yamop *)(&((_p)->y_u.xxn.next))); break; case _traced_p_div_cv : - _p = ((yamop *)(&((_p)->u.xxn.next))); + _p = ((yamop *)(&((_p)->y_u.xxn.next))); break; case _traced_p_div_y_vv : - _p = ((yamop *)(&((_p)->u.yxx.next))); + _p = ((yamop *)(&((_p)->y_u.yxx.next))); break; case _traced_p_div_y_vc : - _p = ((yamop *)(&((_p)->u.yxn.next))); + _p = ((yamop *)(&((_p)->y_u.yxn.next))); break; case _traced_p_div_y_cv : - _p = ((yamop *)(&((_p)->u.yxn.next))); + _p = ((yamop *)(&((_p)->y_u.yxn.next))); break; case _traced_p_and_vv : - _p = ((yamop *)(&((_p)->u.xxx.next))); + _p = ((yamop *)(&((_p)->y_u.xxx.next))); break; case _traced_p_and_vc : - _p = ((yamop *)(&((_p)->u.xxn.next))); + _p = ((yamop *)(&((_p)->y_u.xxn.next))); break; case _traced_p_and_y_vv : - _p = ((yamop *)(&((_p)->u.yxx.next))); + _p = ((yamop *)(&((_p)->y_u.yxx.next))); break; case _traced_p_and_y_vc : - _p = ((yamop *)(&((_p)->u.yxn.next))); + _p = ((yamop *)(&((_p)->y_u.yxn.next))); break; case _traced_p_or_vv : - _p = ((yamop *)(&((_p)->u.xxx.next))); + _p = ((yamop *)(&((_p)->y_u.xxx.next))); break; case _traced_p_or_vc : - _p = ((yamop *)(&((_p)->u.xxn.next))); + _p = ((yamop *)(&((_p)->y_u.xxn.next))); break; case _traced_p_or_y_vv : - _p = ((yamop *)(&((_p)->u.yxx.next))); + _p = ((yamop *)(&((_p)->y_u.yxx.next))); break; case _traced_p_or_y_vc : - _p = ((yamop *)(&((_p)->u.yxn.next))); + _p = ((yamop *)(&((_p)->y_u.yxn.next))); break; case _traced_p_sll_vv : - _p = ((yamop *)(&((_p)->u.xxx.next))); + _p = ((yamop *)(&((_p)->y_u.xxx.next))); break; case _traced_p_sll_vc : - _p = ((yamop *)(&((_p)->u.xxn.next))); + _p = ((yamop *)(&((_p)->y_u.xxn.next))); break; case _traced_p_sll_cv : - _p = ((yamop *)(&((_p)->u.xxn.next))); + _p = ((yamop *)(&((_p)->y_u.xxn.next))); break; case _traced_p_sll_y_vv : - _p = ((yamop *)(&((_p)->u.yxx.next))); + _p = ((yamop *)(&((_p)->y_u.yxx.next))); break; case _traced_p_sll_y_vc : - _p = ((yamop *)(&((_p)->u.yxn.next))); + _p = ((yamop *)(&((_p)->y_u.yxn.next))); break; case _traced_p_sll_y_cv : - _p = ((yamop *)(&((_p)->u.yxn.next))); + _p = ((yamop *)(&((_p)->y_u.yxn.next))); break; case _traced_p_slr_vv : - _p = ((yamop *)(&((_p)->u.xxx.next))); + _p = ((yamop *)(&((_p)->y_u.xxx.next))); break; case _traced_p_slr_vc : - _p = ((yamop *)(&((_p)->u.xxn.next))); + _p = ((yamop *)(&((_p)->y_u.xxn.next))); break; case _traced_p_slr_cv : - _p = ((yamop *)(&((_p)->u.xxn.next))); + _p = ((yamop *)(&((_p)->y_u.xxn.next))); break; case _traced_p_slr_y_vv : - _p = ((yamop *)(&((_p)->u.yxx.next))); + _p = ((yamop *)(&((_p)->y_u.yxx.next))); break; case _traced_p_slr_y_vc : - _p = ((yamop *)(&((_p)->u.yxn.next))); + _p = ((yamop *)(&((_p)->y_u.yxn.next))); break; case _traced_p_slr_y_cv : - _p = ((yamop *)(&((_p)->u.yxn.next))); + _p = ((yamop *)(&((_p)->y_u.yxn.next))); break; case _traced_call_bfunc_xx : - _p = ((yamop *)(&((_p)->u.plxxs.next))); + _p = ((yamop *)(&((_p)->y_u.plxxs.next))); break; case _traced_call_bfunc_yx : - _p = ((yamop *)(&((_p)->u.plxys.next))); + _p = ((yamop *)(&((_p)->y_u.plxys.next))); break; case _traced_call_bfunc_xy : - _p = ((yamop *)(&((_p)->u.plxys.next))); + _p = ((yamop *)(&((_p)->y_u.plxys.next))); break; case _traced_call_bfunc_yy : - _p = ((yamop *)(&((_p)->u.plyys.next))); + _p = ((yamop *)(&((_p)->y_u.plyys.next))); break; case _traced_p_equal : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_p_dif : - _p = ((yamop *)(&((_p)->u.l.next))); + _p = ((yamop *)(&((_p)->y_u.l.next))); break; case _traced_p_eq : - _p = ((yamop *)(&((_p)->u.l.next))); + _p = ((yamop *)(&((_p)->y_u.l.next))); break; case _traced_p_arg_vv : - _p = ((yamop *)(&((_p)->u.xxx.next))); + _p = ((yamop *)(&((_p)->y_u.xxx.next))); break; case _traced_p_arg_cv : - _p = ((yamop *)(&((_p)->u.xxn.next))); + _p = ((yamop *)(&((_p)->y_u.xxn.next))); break; case _traced_p_arg_y_vv : - _p = ((yamop *)(&((_p)->u.yxx.next))); + _p = ((yamop *)(&((_p)->y_u.yxx.next))); break; case _traced_p_arg_y_cv : - _p = ((yamop *)(&((_p)->u.yxn.next))); + _p = ((yamop *)(&((_p)->y_u.yxn.next))); break; case _traced_p_func2s_vv : - _p = ((yamop *)(&((_p)->u.xxx.next))); + _p = ((yamop *)(&((_p)->y_u.xxx.next))); break; case _traced_p_func2s_cv : - _p = ((yamop *)(&((_p)->u.xxc.next))); + _p = ((yamop *)(&((_p)->y_u.xxc.next))); break; case _traced_p_func2s_vc : - _p = ((yamop *)(&((_p)->u.xxn.next))); + _p = ((yamop *)(&((_p)->y_u.xxn.next))); break; case _traced_p_func2s_y_vv : - _p = ((yamop *)(&((_p)->u.yxx.next))); + _p = ((yamop *)(&((_p)->y_u.yxx.next))); break; case _traced_p_func2s_y_cv : - _p = ((yamop *)(&((_p)->u.yxn.next))); + _p = ((yamop *)(&((_p)->y_u.yxn.next))); break; case _traced_p_func2s_y_vc : - _p = ((yamop *)(&((_p)->u.yxn.next))); + _p = ((yamop *)(&((_p)->y_u.yxn.next))); break; case _traced_p_func2f_xx : - _p = ((yamop *)(&((_p)->u.xxx.next))); + _p = ((yamop *)(&((_p)->y_u.xxx.next))); break; case _traced_p_func2f_xy : - _p = ((yamop *)(&((_p)->u.xxy.next))); + _p = ((yamop *)(&((_p)->y_u.xxy.next))); break; case _traced_p_func2f_yx : - _p = ((yamop *)(&((_p)->u.yxx.next))); + _p = ((yamop *)(&((_p)->y_u.yxx.next))); break; case _traced_p_func2f_yy : - _p = ((yamop *)(&((_p)->u.yyx.next))); + _p = ((yamop *)(&((_p)->y_u.yyx.next))); break; case _traced_p_functor : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_p_execute2 : - _p = ((yamop *)(&((_p)->u.Osbpp.next))); + _p = ((yamop *)(&((_p)->y_u.Osbpp.next))); break; case _traced_p_execute : - _p = ((yamop *)(&((_p)->u.Osbmp.next))); + _p = ((yamop *)(&((_p)->y_u.Osbmp.next))); break; case _traced_p_execute_tail : - _p = ((yamop *)(&((_p)->u.Osbpp.next))); + _p = ((yamop *)(&((_p)->y_u.Osbpp.next))); break; #ifdef YAPOR case _traced_getwork_first_time : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_getwork : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _traced_getwork_seq : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _traced_sync : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; #endif #ifdef TABLING #ifdef TABLING_INNER_CUTS case _traced_clause_with_cut : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; #endif case _traced_table_load_answer : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _traced_table_try_answer : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _traced_table_try_single : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _traced_table_try_me : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _traced_table_try : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _traced_table_retry_me : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _traced_table_retry : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _traced_table_trust_me : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _traced_table_trust : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _traced_table_new_answer : - _p = ((yamop *)(&((_p)->u.s.next))); + _p = ((yamop *)(&((_p)->y_u.s.next))); break; case _traced_table_answer_resolution : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; case _traced_table_completion : - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; #ifdef THREADS_CONSUMER_SHARING case _traced_table_answer_resolution_completion: - _p = ((yamop *)(&((_p)->u.Otapl.next))); + _p = ((yamop *)(&((_p)->y_u.Otapl.next))); break; #endif case _traced_trie_do_var : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_trust_var : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_try_var : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_retry_var : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_do_var_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_trust_var_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_try_var_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_retry_var_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_do_val : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_trust_val : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_try_val : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_retry_val : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_do_val_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_trust_val_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_try_val_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_retry_val_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_do_atom : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_trust_atom : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_try_atom : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_retry_atom : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_do_atom_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_trust_atom_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_try_atom_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_retry_atom_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_do_null : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_trust_null : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_try_null : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_retry_null : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_do_null_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_trust_null_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_try_null_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_retry_null_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_do_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_trust_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_try_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_retry_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_do_appl : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_trust_appl : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_try_appl : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_retry_appl : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_do_appl_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_trust_appl_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_try_appl_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_retry_appl_in_pair : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_do_extension : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_trust_extension : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_try_extension : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_retry_extension : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_do_double : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_trust_double : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_try_double : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_retry_double : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_do_longint : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_trust_longint : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_try_longint : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_retry_longint : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_do_gterm : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_trust_gterm : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_try_gterm : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; case _traced_trie_retry_gterm : - _p = ((yamop *)(&((_p)->u.e.next))); + _p = ((yamop *)(&((_p)->y_u.e.next))); break; #endif #ifdef YAPOR case _traced_or_last : - _p = ((yamop *)(&((_p)->u.sblp.next))); + _p = ((yamop *)(&((_p)->y_u.sblp.next))); break; #else case _traced_or_last : - _p = ((yamop *)(&((_p)->u.p.next))); + _p = ((yamop *)(&((_p)->y_u.p.next))); break; #endif + default: + printf("Bad argument in lastop\n"); + return NULL; } } return lastp; diff --git a/JIT/HPP/nextof.hpp b/JIT/HPP/nextof.hpp new file mode 100644 index 000000000..9e9ac3955 --- /dev/null +++ b/JIT/HPP/nextof.hpp @@ -0,0 +1,2390 @@ +void NextOf(yamop**); + +void +NextOf(yamop** _p) { + op_numbers op = Yap_op_from_opcode((*_p)->opc); + switch(op){ + case _Ystop : + (*_p) = ((yamop *)(&((*_p)->y_u.l.next))); + break; + case _Nstop : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _try_me : + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; + case _retry_me : + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; + case _trust_me : + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; + case _enter_profiling : + (*_p) = ((yamop *)(&((*_p)->y_u.p.next))); + break; + case _retry_profiled : + (*_p) = ((yamop *)(&((*_p)->y_u.p.next))); + break; + case _profiled_retry_me : + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; + case _profiled_trust_me : + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; + case _profiled_retry_logical : + (*_p) = ((yamop *)(&((*_p)->y_u.OtaLl.next))); + break; + case _profiled_trust_logical : + (*_p) = ((yamop *)(&((*_p)->y_u.OtILl.next))); + break; + case _count_call : + (*_p) = ((yamop *)(&((*_p)->y_u.p.next))); + break; + case _count_retry : + (*_p) = ((yamop *)(&((*_p)->y_u.p.next))); + break; + case _count_retry_me : + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; + case _count_trust_me : + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; + case _count_retry_logical : + (*_p) = ((yamop *)(&((*_p)->y_u.OtaLl.next))); + break; + case _count_trust_logical : + (*_p) = ((yamop *)(&((*_p)->y_u.OtILl.next))); + break; + case _lock_lu : + (*_p) = ((yamop *)(&((*_p)->y_u.p.next))); + break; + case _unlock_lu : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _alloc_for_logical_pred : + (*_p) = ((yamop *)(&((*_p)->y_u.L.next))); + break; + case _copy_idb_term : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _unify_idb_term : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _ensure_space : + (*_p) = ((yamop *)(&((*_p)->y_u.Osbpa.next))); + break; + case _spy_or_trymark : + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; + case _try_and_mark : + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; + case _count_retry_and_mark : + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; + case _profiled_retry_and_mark : + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; + case _retry_and_mark : + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; + case _trust_fail : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _op_fail : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _cut : + (*_p) = ((yamop *)(&((*_p)->y_u.s.next))); + break; + case _cut_t : + (*_p) = ((yamop *)(&((*_p)->y_u.s.next))); + break; + case _cut_e : + (*_p) = ((yamop *)(&((*_p)->y_u.s.next))); + break; + case _save_b_x : + (*_p) = ((yamop *)(&((*_p)->y_u.x.next))); + break; + case _save_b_y : + (*_p) = ((yamop *)(&((*_p)->y_u.y.next))); + break; + case _commit_b_x : + (*_p) = ((yamop *)(&((*_p)->y_u.xps.next))); + break; + case _commit_b_y : + (*_p) = ((yamop *)(&((*_p)->y_u.yps.next))); + break; + case _execute : + (*_p) = ((yamop *)(&((*_p)->y_u.pp.next))); + break; + case _dexecute : + (*_p) = ((yamop *)(&((*_p)->y_u.pp.next))); + break; + case _fcall : + (*_p) = ((yamop *)(&((*_p)->y_u.Osbpp.next))); + break; + case _call : + (*_p) = ((yamop *)(&((*_p)->y_u.Osbpp.next))); + break; + case _procceed : + (*_p) = ((yamop *)(&((*_p)->y_u.p.next))); + break; + case _allocate : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _deallocate : + (*_p) = ((yamop *)(&((*_p)->y_u.p.next))); + break; +#ifdef BEAM + case _retry_eam : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; +#endif +#ifdef BEAM + case _run_eam : + (*_p) = ((yamop *)(&((*_p)->y_u.os.next))); + break; +#endif + case _get_x_var : + (*_p) = ((yamop *)(&((*_p)->y_u.xx.next))); + break; + case _get_y_var : + (*_p) = ((yamop *)(&((*_p)->y_u.yx.next))); + break; + case _get_yy_var : + (*_p) = ((yamop *)(&((*_p)->y_u.yyxx.next))); + break; + case _get_x_val : + (*_p) = ((yamop *)(&((*_p)->y_u.xx.next))); + break; + case _get_y_val : + (*_p) = ((yamop *)(&((*_p)->y_u.yx.next))); + break; + case _get_atom : + (*_p) = ((yamop *)(&((*_p)->y_u.xc.next))); + break; + case _get_2atoms : + (*_p) = ((yamop *)(&((*_p)->y_u.cc.next))); + break; + case _get_3atoms : + (*_p) = ((yamop *)(&((*_p)->y_u.ccc.next))); + break; + case _get_4atoms : + (*_p) = ((yamop *)(&((*_p)->y_u.cccc.next))); + break; + case _get_5atoms : + (*_p) = ((yamop *)(&((*_p)->y_u.ccccc.next))); + break; + case _get_6atoms : + (*_p) = ((yamop *)(&((*_p)->y_u.cccccc.next))); + break; + case _get_list : + (*_p) = ((yamop *)(&((*_p)->y_u.x.next))); + break; + case _get_struct : + (*_p) = ((yamop *)(&((*_p)->y_u.xfa.next))); + break; + case _get_float : + (*_p) = ((yamop *)(&((*_p)->y_u.xd.next))); + break; + case _get_longint : + (*_p) = ((yamop *)(&((*_p)->y_u.xi.next))); + break; + case _get_bigint : + (*_p) = ((yamop *)(&((*_p)->y_u.xN.next))); + break; + case _get_dbterm : + (*_p) = ((yamop *)(&((*_p)->y_u.xD.next))); + break; + case _glist_valx : + (*_p) = ((yamop *)(&((*_p)->y_u.xx.next))); + break; + case _glist_valy : + (*_p) = ((yamop *)(&((*_p)->y_u.yx.next))); + break; + case _gl_void_varx : + (*_p) = ((yamop *)(&((*_p)->y_u.xx.next))); + break; + case _gl_void_vary : + (*_p) = ((yamop *)(&((*_p)->y_u.yx.next))); + break; + case _gl_void_valx : + (*_p) = ((yamop *)(&((*_p)->y_u.xx.next))); + break; + case _gl_void_valy : + (*_p) = ((yamop *)(&((*_p)->y_u.yx.next))); + break; + case _unify_x_var : + (*_p) = ((yamop *)(&((*_p)->y_u.ox.next))); + break; + case _unify_x_var_write : + (*_p) = ((yamop *)(&((*_p)->y_u.ox.next))); + break; + case _unify_l_x_var : + (*_p) = ((yamop *)(&((*_p)->y_u.ox.next))); + break; + case _unify_l_x_var_write : + (*_p) = ((yamop *)(&((*_p)->y_u.ox.next))); + break; + case _unify_x_var2 : + (*_p) = ((yamop *)(&((*_p)->y_u.oxx.next))); + break; + case _unify_x_var2_write : + (*_p) = ((yamop *)(&((*_p)->y_u.oxx.next))); + break; + case _unify_l_x_var2 : + (*_p) = ((yamop *)(&((*_p)->y_u.oxx.next))); + break; + case _unify_l_x_var2_write : + (*_p) = ((yamop *)(&((*_p)->y_u.oxx.next))); + break; + case _unify_y_var : + (*_p) = ((yamop *)(&((*_p)->y_u.oy.next))); + break; + case _unify_y_var_write : + (*_p) = ((yamop *)(&((*_p)->y_u.oy.next))); + break; + case _unify_l_y_var : + (*_p) = ((yamop *)(&((*_p)->y_u.oy.next))); + break; + case _unify_l_y_var_write : + (*_p) = ((yamop *)(&((*_p)->y_u.oy.next))); + break; + case _unify_x_val : + (*_p) = ((yamop *)(&((*_p)->y_u.ox.next))); + break; + case _unify_x_val_write : + (*_p) = ((yamop *)(&((*_p)->y_u.ox.next))); + break; + case _unify_l_x_val : + (*_p) = ((yamop *)(&((*_p)->y_u.ox.next))); + break; + case _unify_l_x_val_write : + (*_p) = ((yamop *)(&((*_p)->y_u.ox.next))); + break; + case _unify_y_val : + (*_p) = ((yamop *)(&((*_p)->y_u.oy.next))); + break; + case _unify_y_val_write : + (*_p) = ((yamop *)(&((*_p)->y_u.oy.next))); + break; + case _unify_l_y_val : + (*_p) = ((yamop *)(&((*_p)->y_u.oy.next))); + break; + case _unify_l_y_val_write : + (*_p) = ((yamop *)(&((*_p)->y_u.oy.next))); + break; + case _unify_x_loc : + (*_p) = ((yamop *)(&((*_p)->y_u.ox.next))); + break; + case _unify_x_loc_write : + (*_p) = ((yamop *)(&((*_p)->y_u.ox.next))); + break; + case _unify_l_x_loc : + (*_p) = ((yamop *)(&((*_p)->y_u.ox.next))); + break; + case _unify_l_x_loc_write : + (*_p) = ((yamop *)(&((*_p)->y_u.ox.next))); + break; + case _unify_y_loc : + (*_p) = ((yamop *)(&((*_p)->y_u.oy.next))); + break; + case _unify_y_loc_write : + (*_p) = ((yamop *)(&((*_p)->y_u.oy.next))); + break; + case _unify_l_y_loc : + (*_p) = ((yamop *)(&((*_p)->y_u.oy.next))); + break; + case _unify_l_y_loc_write : + (*_p) = ((yamop *)(&((*_p)->y_u.oy.next))); + break; + case _unify_void : + (*_p) = ((yamop *)(&((*_p)->y_u.o.next))); + break; + case _unify_void_write : + (*_p) = ((yamop *)(&((*_p)->y_u.o.next))); + break; + case _unify_l_void : + (*_p) = ((yamop *)(&((*_p)->y_u.o.next))); + break; + case _unify_l_void_write : + (*_p) = ((yamop *)(&((*_p)->y_u.o.next))); + break; + case _unify_n_voids : + (*_p) = ((yamop *)(&((*_p)->y_u.os.next))); + break; + case _unify_n_voids_write : + (*_p) = ((yamop *)(&((*_p)->y_u.os.next))); + break; + case _unify_l_n_voids : + (*_p) = ((yamop *)(&((*_p)->y_u.os.next))); + break; + case _unify_l_n_voids_write : + (*_p) = ((yamop *)(&((*_p)->y_u.os.next))); + break; + case _unify_atom : + (*_p) = ((yamop *)(&((*_p)->y_u.oc.next))); + break; + case _unify_atom_write : + (*_p) = ((yamop *)(&((*_p)->y_u.oc.next))); + break; + case _unify_l_atom : + (*_p) = ((yamop *)(&((*_p)->y_u.oc.next))); + break; + case _unify_l_atom_write : + (*_p) = ((yamop *)(&((*_p)->y_u.oc.next))); + break; + case _unify_n_atoms : + (*_p) = ((yamop *)(&((*_p)->y_u.osc.next))); + break; + case _unify_n_atoms_write : + (*_p) = ((yamop *)(&((*_p)->y_u.osc.next))); + break; + case _unify_float : + (*_p) = ((yamop *)(&((*_p)->y_u.od.next))); + break; + case _unify_float_write : + (*_p) = ((yamop *)(&((*_p)->y_u.od.next))); + break; + case _unify_l_float : + (*_p) = ((yamop *)(&((*_p)->y_u.od.next))); + break; + case _unify_l_float_write : + (*_p) = ((yamop *)(&((*_p)->y_u.od.next))); + break; + case _unify_longint : + (*_p) = ((yamop *)(&((*_p)->y_u.oi.next))); + break; + case _unify_longint_write : + (*_p) = ((yamop *)(&((*_p)->y_u.oi.next))); + break; + case _unify_l_longint : + (*_p) = ((yamop *)(&((*_p)->y_u.oi.next))); + break; + case _unify_l_longint_write : + (*_p) = ((yamop *)(&((*_p)->y_u.oi.next))); + break; + case _unify_bigint : + (*_p) = ((yamop *)(&((*_p)->y_u.oN.next))); + break; + case _unify_l_bigint : + (*_p) = ((yamop *)(&((*_p)->y_u.oN.next))); + break; + case _unify_dbterm : + (*_p) = ((yamop *)(&((*_p)->y_u.oD.next))); + break; + case _unify_l_dbterm : + (*_p) = ((yamop *)(&((*_p)->y_u.oD.next))); + break; + case _unify_list : + (*_p) = ((yamop *)(&((*_p)->y_u.o.next))); + break; + case _unify_list_write : + (*_p) = ((yamop *)(&((*_p)->y_u.o.next))); + break; + case _unify_l_list : + (*_p) = ((yamop *)(&((*_p)->y_u.o.next))); + break; + case _unify_l_list_write : + (*_p) = ((yamop *)(&((*_p)->y_u.o.next))); + break; + case _unify_struct : + (*_p) = ((yamop *)(&((*_p)->y_u.ofa.next))); + break; + case _unify_struct_write : + (*_p) = ((yamop *)(&((*_p)->y_u.ofa.next))); + break; + case _unify_l_struc : + (*_p) = ((yamop *)(&((*_p)->y_u.ofa.next))); + break; + case _unify_l_struc_write : + (*_p) = ((yamop *)(&((*_p)->y_u.ofa.next))); + break; + case _put_x_var : + (*_p) = ((yamop *)(&((*_p)->y_u.xx.next))); + break; + case _put_y_var : + (*_p) = ((yamop *)(&((*_p)->y_u.yx.next))); + break; + case _put_x_val : + (*_p) = ((yamop *)(&((*_p)->y_u.xx.next))); + break; + case _put_xx_val : + (*_p) = ((yamop *)(&((*_p)->y_u.xxxx.next))); + break; + case _put_y_val : + (*_p) = ((yamop *)(&((*_p)->y_u.yx.next))); + break; + case _put_y_vals : + (*_p) = ((yamop *)(&((*_p)->y_u.yyxx.next))); + break; + case _put_unsafe : + (*_p) = ((yamop *)(&((*_p)->y_u.yx.next))); + break; + case _put_atom : + (*_p) = ((yamop *)(&((*_p)->y_u.xc.next))); + break; + case _put_dbterm : + (*_p) = ((yamop *)(&((*_p)->y_u.xD.next))); + break; + case _put_bigint : + (*_p) = ((yamop *)(&((*_p)->y_u.xN.next))); + break; + case _put_float : + (*_p) = ((yamop *)(&((*_p)->y_u.xd.next))); + break; + case _put_longint : + (*_p) = ((yamop *)(&((*_p)->y_u.xi.next))); + break; + case _put_list : + (*_p) = ((yamop *)(&((*_p)->y_u.x.next))); + break; + case _put_struct : + (*_p) = ((yamop *)(&((*_p)->y_u.xfa.next))); + break; + case _write_x_var : + (*_p) = ((yamop *)(&((*_p)->y_u.x.next))); + break; + case _write_void : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _write_n_voids : + (*_p) = ((yamop *)(&((*_p)->y_u.s.next))); + break; + case _write_y_var : + (*_p) = ((yamop *)(&((*_p)->y_u.y.next))); + break; + case _write_x_val : + (*_p) = ((yamop *)(&((*_p)->y_u.x.next))); + break; + case _write_x_loc : + (*_p) = ((yamop *)(&((*_p)->y_u.x.next))); + break; + case _write_y_val : + (*_p) = ((yamop *)(&((*_p)->y_u.y.next))); + break; + case _write_y_loc : + (*_p) = ((yamop *)(&((*_p)->y_u.y.next))); + break; + case _write_atom : + (*_p) = ((yamop *)(&((*_p)->y_u.c.next))); + break; + case _write_bigint : + (*_p) = ((yamop *)(&((*_p)->y_u.N.next))); + break; + case _write_dbterm : + (*_p) = ((yamop *)(&((*_p)->y_u.D.next))); + break; + case _write_float : + (*_p) = ((yamop *)(&((*_p)->y_u.d.next))); + break; + case _write_longint : + (*_p) = ((yamop *)(&((*_p)->y_u.i.next))); + break; + case _write_n_atoms : + (*_p) = ((yamop *)(&((*_p)->y_u.sc.next))); + break; + case _write_list : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _write_l_list : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _write_struct : + (*_p) = ((yamop *)(&((*_p)->y_u.fa.next))); + break; + case _write_l_struc : + (*_p) = ((yamop *)(&((*_p)->y_u.fa.next))); + break; + case _save_pair_x : + (*_p) = ((yamop *)(&((*_p)->y_u.ox.next))); + break; + case _save_pair_x_write : + (*_p) = ((yamop *)(&((*_p)->y_u.ox.next))); + break; + case _save_pair_y : + (*_p) = ((yamop *)(&((*_p)->y_u.oy.next))); + break; + case _save_pair_y_write : + (*_p) = ((yamop *)(&((*_p)->y_u.oy.next))); + break; + case _save_appl_x : + (*_p) = ((yamop *)(&((*_p)->y_u.ox.next))); + break; + case _save_appl_x_write : + (*_p) = ((yamop *)(&((*_p)->y_u.ox.next))); + break; + case _save_appl_y : + (*_p) = ((yamop *)(&((*_p)->y_u.oy.next))); + break; + case _save_appl_y_write : + (*_p) = ((yamop *)(&((*_p)->y_u.oy.next))); + break; + case _jump : + (*_p) = ((yamop *)(&((*_p)->y_u.l.next))); + break; + case _move_back : + (*_p) = ((yamop *)(&((*_p)->y_u.l.next))); + break; + case _skip : + (*_p) = ((yamop *)(&((*_p)->y_u.l.next))); + break; + case _either : + (*_p) = ((yamop *)(&((*_p)->y_u.Osblp.next))); + break; + case _or_else : + (*_p) = ((yamop *)(&((*_p)->y_u.Osblp.next))); + break; + case _pop_n : + (*_p) = ((yamop *)(&((*_p)->y_u.s.next))); + break; + case _pop : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _call_cpred : + (*_p) = ((yamop *)(&((*_p)->y_u.Osbpp.next))); + break; + case _execute_cpred : + (*_p) = ((yamop *)(&((*_p)->y_u.pp.next))); + break; + case _call_usercpred : + (*_p) = ((yamop *)(&((*_p)->y_u.Osbpp.next))); + break; + case _call_c_wfail : + (*_p) = ((yamop *)(&((*_p)->y_u.slp.next))); + break; + case _try_c : + (*_p) = ((yamop *)(&((*_p)->y_u.OtapFs.next))); + break; + case _retry_c : + (*_p) = ((yamop *)(&((*_p)->y_u.OtapFs.next))); + break; +#ifdef CUT_C + case _cut_c : + (*_p) = ((yamop *)(&((*_p)->y_u.OtapFs.next))); + break; +#endif + case _try_userc : + (*_p) = ((yamop *)(&((*_p)->y_u.OtapFs.next))); + break; + case _retry_userc : + (*_p) = ((yamop *)(&((*_p)->y_u.OtapFs.next))); + break; +#ifdef CUT_C + case _cut_userc : + (*_p) = ((yamop *)(&((*_p)->y_u.OtapFs.next))); + break; +#endif + case _lock_pred : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _index_pred : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; +#ifdef THREADS + case _thread_local : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; +#endif + case _expand_index : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _expand_clauses : + (*_p) = ((yamop *)(&((*_p)->y_u.sssllp.next))); + break; + case _undef_p : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _spy_pred : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _try_clause : + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; + case _try_clause2 : + (*_p) = ((yamop *)(&((*_p)->y_u.l.next))); + break; + case _try_clause3 : + (*_p) = ((yamop *)(&((*_p)->y_u.l.next))); + break; + case _try_clause4 : + (*_p) = ((yamop *)(&((*_p)->y_u.l.next))); + break; + case _retry : + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; + case _retry2 : + (*_p) = ((yamop *)(&((*_p)->y_u.l.next))); + break; + case _retry3 : + (*_p) = ((yamop *)(&((*_p)->y_u.l.next))); + break; + case _retry4 : + (*_p) = ((yamop *)(&((*_p)->y_u.l.next))); + break; + case _trust : + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; + case _try_in : + (*_p) = ((yamop *)(&((*_p)->y_u.l.next))); + break; + case _try_logical : + (*_p) = ((yamop *)(&((*_p)->y_u.OtaLl.next))); + break; + case _retry_logical : + (*_p) = ((yamop *)(&((*_p)->y_u.OtaLl.next))); + break; + case _trust_logical : + (*_p) = ((yamop *)(&((*_p)->y_u.OtILl.next))); + break; + case _user_switch : + (*_p) = ((yamop *)(&((*_p)->y_u.lp.next))); + break; + case _switch_on_type : + (*_p) = ((yamop *)(&((*_p)->y_u.llll.next))); + break; + case _switch_list_nl : + (*_p) = ((yamop *)(&((*_p)->y_u.ollll.next))); + break; + case _switch_on_arg_type : + (*_p) = ((yamop *)(&((*_p)->y_u.xllll.next))); + break; + case _switch_on_sub_arg_type : + (*_p) = ((yamop *)(&((*_p)->y_u.sllll.next))); + break; + case _jump_if_var : + (*_p) = ((yamop *)(&((*_p)->y_u.l.next))); + break; + case _jump_if_nonvar : + (*_p) = ((yamop *)(&((*_p)->y_u.xll.next))); + break; + case _if_not_then : + (*_p) = ((yamop *)(&((*_p)->y_u.clll.next))); + break; + case _switch_on_func : + (*_p) = ((yamop *)(&((*_p)->y_u.sssl.next))); + break; + case _switch_on_cons : + (*_p) = ((yamop *)(&((*_p)->y_u.sssl.next))); + break; + case _go_on_func : + (*_p) = ((yamop *)(&((*_p)->y_u.sssl.next))); + break; + case _go_on_cons : + (*_p) = ((yamop *)(&((*_p)->y_u.sssl.next))); + break; + case _if_func : + (*_p) = ((yamop *)(&((*_p)->y_u.sssl.next))); + break; + case _if_cons : + (*_p) = ((yamop *)(&((*_p)->y_u.sssl.next))); + break; + case _index_dbref : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _index_blob : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _index_long : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _jit_handler : + (*_p) = ((yamop *)(&((*_p)->y_u.J.next))); + break; + case _p_atom_x : + (*_p) = ((yamop *)(&((*_p)->y_u.xl.next))); + break; + case _p_atom_y : + (*_p) = ((yamop *)(&((*_p)->y_u.yl.next))); + break; + case _p_atomic_x : + (*_p) = ((yamop *)(&((*_p)->y_u.xl.next))); + break; + case _p_atomic_y : + (*_p) = ((yamop *)(&((*_p)->y_u.yl.next))); + break; + case _p_integer_x : + (*_p) = ((yamop *)(&((*_p)->y_u.xl.next))); + break; + case _p_integer_y : + (*_p) = ((yamop *)(&((*_p)->y_u.yl.next))); + break; + case _p_nonvar_x : + (*_p) = ((yamop *)(&((*_p)->y_u.xl.next))); + break; + case _p_nonvar_y : + (*_p) = ((yamop *)(&((*_p)->y_u.yl.next))); + break; + case _p_number_x : + (*_p) = ((yamop *)(&((*_p)->y_u.xl.next))); + break; + case _p_number_y : + (*_p) = ((yamop *)(&((*_p)->y_u.yl.next))); + break; + case _p_var_x : + (*_p) = ((yamop *)(&((*_p)->y_u.xl.next))); + break; + case _p_var_y : + (*_p) = ((yamop *)(&((*_p)->y_u.yl.next))); + break; + case _p_db_ref_x : + (*_p) = ((yamop *)(&((*_p)->y_u.xl.next))); + break; + case _p_db_ref_y : + (*_p) = ((yamop *)(&((*_p)->y_u.yl.next))); + break; + case _p_primitive_x : + (*_p) = ((yamop *)(&((*_p)->y_u.xl.next))); + break; + case _p_primitive_y : + (*_p) = ((yamop *)(&((*_p)->y_u.yl.next))); + break; + case _p_compound_x : + (*_p) = ((yamop *)(&((*_p)->y_u.xl.next))); + break; + case _p_compound_y : + (*_p) = ((yamop *)(&((*_p)->y_u.yl.next))); + break; + case _p_float_x : + (*_p) = ((yamop *)(&((*_p)->y_u.xl.next))); + break; + case _p_float_y : + (*_p) = ((yamop *)(&((*_p)->y_u.yl.next))); + break; + case _p_plus_vv : + (*_p) = ((yamop *)(&((*_p)->y_u.xxx.next))); + break; + case _p_plus_vc : + (*_p) = ((yamop *)(&((*_p)->y_u.xxn.next))); + break; + case _p_plus_y_vv : + (*_p) = ((yamop *)(&((*_p)->y_u.yxx.next))); + break; + case _p_plus_y_vc : + (*_p) = ((yamop *)(&((*_p)->y_u.yxn.next))); + break; + case _p_minus_vv : + (*_p) = ((yamop *)(&((*_p)->y_u.xxx.next))); + break; + case _p_minus_cv : + (*_p) = ((yamop *)(&((*_p)->y_u.xxn.next))); + break; + case _p_minus_y_vv : + (*_p) = ((yamop *)(&((*_p)->y_u.yxx.next))); + break; + case _p_minus_y_cv : + (*_p) = ((yamop *)(&((*_p)->y_u.yxn.next))); + break; + case _p_times_vv : + (*_p) = ((yamop *)(&((*_p)->y_u.xxx.next))); + break; + case _p_times_vc : + (*_p) = ((yamop *)(&((*_p)->y_u.xxn.next))); + break; + case _p_times_y_vv : + (*_p) = ((yamop *)(&((*_p)->y_u.yxx.next))); + break; + case _p_times_y_vc : + (*_p) = ((yamop *)(&((*_p)->y_u.yxn.next))); + break; + case _p_div_vv : + (*_p) = ((yamop *)(&((*_p)->y_u.xxx.next))); + break; + case _p_div_vc : + (*_p) = ((yamop *)(&((*_p)->y_u.xxn.next))); + break; + case _p_div_cv : + (*_p) = ((yamop *)(&((*_p)->y_u.xxn.next))); + break; + case _p_div_y_vv : + (*_p) = ((yamop *)(&((*_p)->y_u.yxx.next))); + break; + case _p_div_y_vc : + (*_p) = ((yamop *)(&((*_p)->y_u.yxn.next))); + break; + case _p_div_y_cv : + (*_p) = ((yamop *)(&((*_p)->y_u.yxn.next))); + break; + case _p_and_vv : + (*_p) = ((yamop *)(&((*_p)->y_u.xxx.next))); + break; + case _p_and_vc : + (*_p) = ((yamop *)(&((*_p)->y_u.xxn.next))); + break; + case _p_and_y_vv : + (*_p) = ((yamop *)(&((*_p)->y_u.yxx.next))); + break; + case _p_and_y_vc : + (*_p) = ((yamop *)(&((*_p)->y_u.yxn.next))); + break; + case _p_or_vv : + (*_p) = ((yamop *)(&((*_p)->y_u.xxx.next))); + break; + case _p_or_vc : + (*_p) = ((yamop *)(&((*_p)->y_u.xxn.next))); + break; + case _p_or_y_vv : + (*_p) = ((yamop *)(&((*_p)->y_u.yxx.next))); + break; + case _p_or_y_vc : + (*_p) = ((yamop *)(&((*_p)->y_u.yxn.next))); + break; + case _p_sll_vv : + (*_p) = ((yamop *)(&((*_p)->y_u.xxx.next))); + break; + case _p_sll_vc : + (*_p) = ((yamop *)(&((*_p)->y_u.xxn.next))); + break; + case _p_sll_cv : + (*_p) = ((yamop *)(&((*_p)->y_u.xxn.next))); + break; + case _p_sll_y_vv : + (*_p) = ((yamop *)(&((*_p)->y_u.yxx.next))); + break; + case _p_sll_y_vc : + (*_p) = ((yamop *)(&((*_p)->y_u.yxn.next))); + break; + case _p_sll_y_cv : + (*_p) = ((yamop *)(&((*_p)->y_u.yxn.next))); + break; + case _p_slr_vv : + (*_p) = ((yamop *)(&((*_p)->y_u.xxx.next))); + break; + case _p_slr_vc : + (*_p) = ((yamop *)(&((*_p)->y_u.xxn.next))); + break; + case _p_slr_cv : + (*_p) = ((yamop *)(&((*_p)->y_u.xxn.next))); + break; + case _p_slr_y_vv : + (*_p) = ((yamop *)(&((*_p)->y_u.yxx.next))); + break; + case _p_slr_y_vc : + (*_p) = ((yamop *)(&((*_p)->y_u.yxn.next))); + break; + case _p_slr_y_cv : + (*_p) = ((yamop *)(&((*_p)->y_u.yxn.next))); + break; + case _call_bfunc_xx : + (*_p) = ((yamop *)(&((*_p)->y_u.plxxs.next))); + break; + case _call_bfunc_yx : + (*_p) = ((yamop *)(&((*_p)->y_u.plxys.next))); + break; + case _call_bfunc_xy : + (*_p) = ((yamop *)(&((*_p)->y_u.plxys.next))); + break; + case _call_bfunc_yy : + (*_p) = ((yamop *)(&((*_p)->y_u.plyys.next))); + break; + case _p_equal : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _p_dif : + (*_p) = ((yamop *)(&((*_p)->y_u.l.next))); + break; + case _p_eq : + (*_p) = ((yamop *)(&((*_p)->y_u.l.next))); + break; + case _p_arg_vv : + (*_p) = ((yamop *)(&((*_p)->y_u.xxx.next))); + break; + case _p_arg_cv : + (*_p) = ((yamop *)(&((*_p)->y_u.xxn.next))); + break; + case _p_arg_y_vv : + (*_p) = ((yamop *)(&((*_p)->y_u.yxx.next))); + break; + case _p_arg_y_cv : + (*_p) = ((yamop *)(&((*_p)->y_u.yxn.next))); + break; + case _p_func2s_vv : + (*_p) = ((yamop *)(&((*_p)->y_u.xxx.next))); + break; + case _p_func2s_cv : + (*_p) = ((yamop *)(&((*_p)->y_u.xxc.next))); + break; + case _p_func2s_vc : + (*_p) = ((yamop *)(&((*_p)->y_u.xxn.next))); + break; + case _p_func2s_y_vv : + (*_p) = ((yamop *)(&((*_p)->y_u.yxx.next))); + break; + case _p_func2s_y_cv : + (*_p) = ((yamop *)(&((*_p)->y_u.yxn.next))); + break; + case _p_func2s_y_vc : + (*_p) = ((yamop *)(&((*_p)->y_u.yxn.next))); + break; + case _p_func2f_xx : + (*_p) = ((yamop *)(&((*_p)->y_u.xxx.next))); + break; + case _p_func2f_xy : + (*_p) = ((yamop *)(&((*_p)->y_u.xxy.next))); + break; + case _p_func2f_yx : + (*_p) = ((yamop *)(&((*_p)->y_u.yxx.next))); + break; + case _p_func2f_yy : + (*_p) = ((yamop *)(&((*_p)->y_u.yyx.next))); + break; + case _p_functor : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _p_execute2 : + (*_p) = ((yamop *)(&((*_p)->y_u.Osbpp.next))); + break; + case _p_execute : + (*_p) = ((yamop *)(&((*_p)->y_u.Osbmp.next))); + break; + case _p_execute_tail : + (*_p) = ((yamop *)(&((*_p)->y_u.Osbpp.next))); + break; +#ifdef YAPOR + case _getwork_first_time : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _getwork : + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; + case _getwork_seq : + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; + case _sync : + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; +#endif +#ifdef TABLING +#ifdef TABLING_INNER_CUTS + case _clause_with_cut : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; +#endif + case _table_load_answer : + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; + case _table_try_answer : + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; + case _table_try_single : + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; + case _table_try_me : + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; + case _table_try : + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; + case _table_retry_me : + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; + case _table_retry : + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; + case _table_trust_me : + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; + case _table_trust : + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; + case _table_new_answer : + (*_p) = ((yamop *)(&((*_p)->y_u.s.next))); + break; + case _table_answer_resolution : + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; + case _table_completion : + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; +#ifdef THREADS_CONSUMER_SHARING + case _table_answer_resolution_completion: + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; +#endif + case _trie_do_var : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _trie_trust_var : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _trie_try_var : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _trie_retry_var : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _trie_do_var_in_pair : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _trie_trust_var_in_pair : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _trie_try_var_in_pair : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _trie_retry_var_in_pair : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _trie_do_val : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _trie_trust_val : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _trie_try_val : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _trie_retry_val : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _trie_do_val_in_pair : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _trie_trust_val_in_pair : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _trie_try_val_in_pair : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _trie_retry_val_in_pair : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _trie_do_atom : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _trie_trust_atom : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _trie_try_atom : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _trie_retry_atom : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _trie_do_atom_in_pair : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _trie_trust_atom_in_pair : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _trie_try_atom_in_pair : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _trie_retry_atom_in_pair : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _trie_do_null : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _trie_trust_null : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _trie_try_null : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _trie_retry_null : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _trie_do_null_in_pair : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _trie_trust_null_in_pair : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _trie_try_null_in_pair : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _trie_retry_null_in_pair : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _trie_do_pair : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _trie_trust_pair : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _trie_try_pair : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _trie_retry_pair : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _trie_do_appl : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _trie_trust_appl : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _trie_try_appl : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _trie_retry_appl : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _trie_do_appl_in_pair : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _trie_trust_appl_in_pair : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _trie_try_appl_in_pair : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _trie_retry_appl_in_pair : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _trie_do_extension : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _trie_trust_extension : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _trie_try_extension : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _trie_retry_extension : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _trie_do_double : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _trie_trust_double : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _trie_try_double : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _trie_retry_double : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _trie_do_longint : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _trie_trust_longint : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _trie_try_longint : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _trie_retry_longint : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _trie_do_gterm : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _trie_trust_gterm : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _trie_try_gterm : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _trie_retry_gterm : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; +#endif +#ifdef YAPOR + case _or_last : + (*_p) = ((yamop *)(&((*_p)->y_u.sblp.next))); + break; +#else + case _or_last : + (*_p) = ((yamop *)(&((*_p)->y_u.p.next))); + break; +#endif + case _traced_Ystop : + (*_p) = ((yamop *)(&((*_p)->y_u.l.next))); + break; + case _traced_Nstop : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_try_me : + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; + case _traced_retry_me : + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; + case _traced_trust_me : + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; + case _traced_enter_profiling : + (*_p) = ((yamop *)(&((*_p)->y_u.p.next))); + break; + case _traced_retry_profiled : + (*_p) = ((yamop *)(&((*_p)->y_u.p.next))); + break; + case _traced_profiled_retry_me : + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; + case _traced_profiled_trust_me : + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; + case _traced_profiled_retry_logical : + (*_p) = ((yamop *)(&((*_p)->y_u.OtaLl.next))); + break; + case _traced_profiled_trust_logical : + (*_p) = ((yamop *)(&((*_p)->y_u.OtILl.next))); + break; + case _traced_count_call : + (*_p) = ((yamop *)(&((*_p)->y_u.p.next))); + break; + case _traced_count_retry : + (*_p) = ((yamop *)(&((*_p)->y_u.p.next))); + break; + case _traced_count_retry_me : + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; + case _traced_count_trust_me : + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; + case _traced_count_retry_logical : + (*_p) = ((yamop *)(&((*_p)->y_u.OtaLl.next))); + break; + case _traced_count_trust_logical : + (*_p) = ((yamop *)(&((*_p)->y_u.OtILl.next))); + break; + case _traced_lock_lu : + (*_p) = ((yamop *)(&((*_p)->y_u.p.next))); + break; + case _traced_unlock_lu : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_alloc_for_logical_pred : + (*_p) = ((yamop *)(&((*_p)->y_u.L.next))); + break; + case _traced_copy_idb_term : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_unify_idb_term : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_ensure_space : + (*_p) = ((yamop *)(&((*_p)->y_u.Osbpa.next))); + break; + case _traced_spy_or_trymark : + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; + case _traced_try_and_mark : + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; + case _traced_count_retry_and_mark : + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; + case _traced_profiled_retry_and_mark : + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; + case _traced_retry_and_mark : + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; + case _traced_trust_fail : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_op_fail : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_cut : + (*_p) = ((yamop *)(&((*_p)->y_u.s.next))); + break; + case _traced_cut_t : + (*_p) = ((yamop *)(&((*_p)->y_u.s.next))); + break; + case _traced_cut_e : + (*_p) = ((yamop *)(&((*_p)->y_u.s.next))); + break; + case _traced_save_b_x : + (*_p) = ((yamop *)(&((*_p)->y_u.x.next))); + break; + case _traced_save_b_y : + (*_p) = ((yamop *)(&((*_p)->y_u.y.next))); + break; + case _traced_commit_b_x : + (*_p) = ((yamop *)(&((*_p)->y_u.xps.next))); + break; + case _traced_commit_b_y : + (*_p) = ((yamop *)(&((*_p)->y_u.yps.next))); + break; + case _traced_execute : + (*_p) = ((yamop *)(&((*_p)->y_u.pp.next))); + break; + case _traced_dexecute : + (*_p) = ((yamop *)(&((*_p)->y_u.pp.next))); + break; + case _traced_fcall : + (*_p) = ((yamop *)(&((*_p)->y_u.Osbpp.next))); + break; + case _traced_call : + (*_p) = ((yamop *)(&((*_p)->y_u.Osbpp.next))); + break; + case _traced_procceed : + (*_p) = ((yamop *)(&((*_p)->y_u.p.next))); + break; + case _traced_allocate : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_deallocate : + (*_p) = ((yamop *)(&((*_p)->y_u.p.next))); + break; +#ifdef BEAM + case _traced_retry_eam : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; +#endif +#ifdef BEAM + case _traced_run_eam : + (*_p) = ((yamop *)(&((*_p)->y_u.os.next))); + break; +#endif + case _traced_get_x_var : + (*_p) = ((yamop *)(&((*_p)->y_u.xx.next))); + break; + case _traced_get_y_var : + (*_p) = ((yamop *)(&((*_p)->y_u.yx.next))); + break; + case _traced_get_yy_var : + (*_p) = ((yamop *)(&((*_p)->y_u.yyxx.next))); + break; + case _traced_get_x_val : + (*_p) = ((yamop *)(&((*_p)->y_u.xx.next))); + break; + case _traced_get_y_val : + (*_p) = ((yamop *)(&((*_p)->y_u.yx.next))); + break; + case _traced_get_atom : + (*_p) = ((yamop *)(&((*_p)->y_u.xc.next))); + break; + case _traced_get_2atoms : + (*_p) = ((yamop *)(&((*_p)->y_u.cc.next))); + break; + case _traced_get_3atoms : + (*_p) = ((yamop *)(&((*_p)->y_u.ccc.next))); + break; + case _traced_get_4atoms : + (*_p) = ((yamop *)(&((*_p)->y_u.cccc.next))); + break; + case _traced_get_5atoms : + (*_p) = ((yamop *)(&((*_p)->y_u.ccccc.next))); + break; + case _traced_get_6atoms : + (*_p) = ((yamop *)(&((*_p)->y_u.cccccc.next))); + break; + case _traced_get_list : + (*_p) = ((yamop *)(&((*_p)->y_u.x.next))); + break; + case _traced_get_struct : + (*_p) = ((yamop *)(&((*_p)->y_u.xfa.next))); + break; + case _traced_get_float : + (*_p) = ((yamop *)(&((*_p)->y_u.xd.next))); + break; + case _traced_get_longint : + (*_p) = ((yamop *)(&((*_p)->y_u.xi.next))); + break; + case _traced_get_bigint : + (*_p) = ((yamop *)(&((*_p)->y_u.xN.next))); + break; + case _traced_get_dbterm : + (*_p) = ((yamop *)(&((*_p)->y_u.xD.next))); + break; + case _traced_glist_valx : + (*_p) = ((yamop *)(&((*_p)->y_u.xx.next))); + break; + case _traced_glist_valy : + (*_p) = ((yamop *)(&((*_p)->y_u.yx.next))); + break; + case _traced_gl_void_varx : + (*_p) = ((yamop *)(&((*_p)->y_u.xx.next))); + break; + case _traced_gl_void_vary : + (*_p) = ((yamop *)(&((*_p)->y_u.yx.next))); + break; + case _traced_gl_void_valx : + (*_p) = ((yamop *)(&((*_p)->y_u.xx.next))); + break; + case _traced_gl_void_valy : + (*_p) = ((yamop *)(&((*_p)->y_u.yx.next))); + break; + case _traced_unify_x_var : + (*_p) = ((yamop *)(&((*_p)->y_u.ox.next))); + break; + case _traced_unify_x_var_write : + (*_p) = ((yamop *)(&((*_p)->y_u.ox.next))); + break; + case _traced_unify_l_x_var : + (*_p) = ((yamop *)(&((*_p)->y_u.ox.next))); + break; + case _traced_unify_l_x_var_write : + (*_p) = ((yamop *)(&((*_p)->y_u.ox.next))); + break; + case _traced_unify_x_var2 : + (*_p) = ((yamop *)(&((*_p)->y_u.oxx.next))); + break; + case _traced_unify_x_var2_write : + (*_p) = ((yamop *)(&((*_p)->y_u.oxx.next))); + break; + case _traced_unify_l_x_var2 : + (*_p) = ((yamop *)(&((*_p)->y_u.oxx.next))); + break; + case _traced_unify_l_x_var2_write : + (*_p) = ((yamop *)(&((*_p)->y_u.oxx.next))); + break; + case _traced_unify_y_var : + (*_p) = ((yamop *)(&((*_p)->y_u.oy.next))); + break; + case _traced_unify_y_var_write : + (*_p) = ((yamop *)(&((*_p)->y_u.oy.next))); + break; + case _traced_unify_l_y_var : + (*_p) = ((yamop *)(&((*_p)->y_u.oy.next))); + break; + case _traced_unify_l_y_var_write : + (*_p) = ((yamop *)(&((*_p)->y_u.oy.next))); + break; + case _traced_unify_x_val : + (*_p) = ((yamop *)(&((*_p)->y_u.ox.next))); + break; + case _traced_unify_x_val_write : + (*_p) = ((yamop *)(&((*_p)->y_u.ox.next))); + break; + case _traced_unify_l_x_val : + (*_p) = ((yamop *)(&((*_p)->y_u.ox.next))); + break; + case _traced_unify_l_x_val_write : + (*_p) = ((yamop *)(&((*_p)->y_u.ox.next))); + break; + case _traced_unify_y_val : + (*_p) = ((yamop *)(&((*_p)->y_u.oy.next))); + break; + case _traced_unify_y_val_write : + (*_p) = ((yamop *)(&((*_p)->y_u.oy.next))); + break; + case _traced_unify_l_y_val : + (*_p) = ((yamop *)(&((*_p)->y_u.oy.next))); + break; + case _traced_unify_l_y_val_write : + (*_p) = ((yamop *)(&((*_p)->y_u.oy.next))); + break; + case _traced_unify_x_loc : + (*_p) = ((yamop *)(&((*_p)->y_u.ox.next))); + break; + case _traced_unify_x_loc_write : + (*_p) = ((yamop *)(&((*_p)->y_u.ox.next))); + break; + case _traced_unify_l_x_loc : + (*_p) = ((yamop *)(&((*_p)->y_u.ox.next))); + break; + case _traced_unify_l_x_loc_write : + (*_p) = ((yamop *)(&((*_p)->y_u.ox.next))); + break; + case _traced_unify_y_loc : + (*_p) = ((yamop *)(&((*_p)->y_u.oy.next))); + break; + case _traced_unify_y_loc_write : + (*_p) = ((yamop *)(&((*_p)->y_u.oy.next))); + break; + case _traced_unify_l_y_loc : + (*_p) = ((yamop *)(&((*_p)->y_u.oy.next))); + break; + case _traced_unify_l_y_loc_write : + (*_p) = ((yamop *)(&((*_p)->y_u.oy.next))); + break; + case _traced_unify_void : + (*_p) = ((yamop *)(&((*_p)->y_u.o.next))); + break; + case _traced_unify_void_write : + (*_p) = ((yamop *)(&((*_p)->y_u.o.next))); + break; + case _traced_unify_l_void : + (*_p) = ((yamop *)(&((*_p)->y_u.o.next))); + break; + case _traced_unify_l_void_write : + (*_p) = ((yamop *)(&((*_p)->y_u.o.next))); + break; + case _traced_unify_n_voids : + (*_p) = ((yamop *)(&((*_p)->y_u.os.next))); + break; + case _traced_unify_n_voids_write : + (*_p) = ((yamop *)(&((*_p)->y_u.os.next))); + break; + case _traced_unify_l_n_voids : + (*_p) = ((yamop *)(&((*_p)->y_u.os.next))); + break; + case _traced_unify_l_n_voids_write : + (*_p) = ((yamop *)(&((*_p)->y_u.os.next))); + break; + case _traced_unify_atom : + (*_p) = ((yamop *)(&((*_p)->y_u.oc.next))); + break; + case _traced_unify_atom_write : + (*_p) = ((yamop *)(&((*_p)->y_u.oc.next))); + break; + case _traced_unify_l_atom : + (*_p) = ((yamop *)(&((*_p)->y_u.oc.next))); + break; + case _traced_unify_l_atom_write : + (*_p) = ((yamop *)(&((*_p)->y_u.oc.next))); + break; + case _traced_unify_n_atoms : + (*_p) = ((yamop *)(&((*_p)->y_u.osc.next))); + break; + case _traced_unify_n_atoms_write : + (*_p) = ((yamop *)(&((*_p)->y_u.osc.next))); + break; + case _traced_unify_float : + (*_p) = ((yamop *)(&((*_p)->y_u.od.next))); + break; + case _traced_unify_float_write : + (*_p) = ((yamop *)(&((*_p)->y_u.od.next))); + break; + case _traced_unify_l_float : + (*_p) = ((yamop *)(&((*_p)->y_u.od.next))); + break; + case _traced_unify_l_float_write : + (*_p) = ((yamop *)(&((*_p)->y_u.od.next))); + break; + case _traced_unify_longint : + (*_p) = ((yamop *)(&((*_p)->y_u.oi.next))); + break; + case _traced_unify_longint_write : + (*_p) = ((yamop *)(&((*_p)->y_u.oi.next))); + break; + case _traced_unify_l_longint : + (*_p) = ((yamop *)(&((*_p)->y_u.oi.next))); + break; + case _traced_unify_l_longint_write : + (*_p) = ((yamop *)(&((*_p)->y_u.oi.next))); + break; + case _traced_unify_bigint : + (*_p) = ((yamop *)(&((*_p)->y_u.oN.next))); + break; + case _traced_unify_l_bigint : + (*_p) = ((yamop *)(&((*_p)->y_u.oN.next))); + break; + case _traced_unify_dbterm : + (*_p) = ((yamop *)(&((*_p)->y_u.oD.next))); + break; + case _traced_unify_l_dbterm : + (*_p) = ((yamop *)(&((*_p)->y_u.oD.next))); + break; + case _traced_unify_list : + (*_p) = ((yamop *)(&((*_p)->y_u.o.next))); + break; + case _traced_unify_list_write : + (*_p) = ((yamop *)(&((*_p)->y_u.o.next))); + break; + case _traced_unify_l_list : + (*_p) = ((yamop *)(&((*_p)->y_u.o.next))); + break; + case _traced_unify_l_list_write : + (*_p) = ((yamop *)(&((*_p)->y_u.o.next))); + break; + case _traced_unify_struct : + (*_p) = ((yamop *)(&((*_p)->y_u.ofa.next))); + break; + case _traced_unify_struct_write : + (*_p) = ((yamop *)(&((*_p)->y_u.ofa.next))); + break; + case _traced_unify_l_struc : + (*_p) = ((yamop *)(&((*_p)->y_u.ofa.next))); + break; + case _traced_unify_l_struc_write : + (*_p) = ((yamop *)(&((*_p)->y_u.ofa.next))); + break; + case _traced_put_x_var : + (*_p) = ((yamop *)(&((*_p)->y_u.xx.next))); + break; + case _traced_put_y_var : + (*_p) = ((yamop *)(&((*_p)->y_u.yx.next))); + break; + case _traced_put_x_val : + (*_p) = ((yamop *)(&((*_p)->y_u.xx.next))); + break; + case _traced_put_xx_val : + (*_p) = ((yamop *)(&((*_p)->y_u.xxxx.next))); + break; + case _traced_put_y_val : + (*_p) = ((yamop *)(&((*_p)->y_u.yx.next))); + break; + case _traced_put_y_vals : + (*_p) = ((yamop *)(&((*_p)->y_u.yyxx.next))); + break; + case _traced_put_unsafe : + (*_p) = ((yamop *)(&((*_p)->y_u.yx.next))); + break; + case _traced_put_atom : + (*_p) = ((yamop *)(&((*_p)->y_u.xc.next))); + break; + case _traced_put_dbterm : + (*_p) = ((yamop *)(&((*_p)->y_u.xD.next))); + break; + case _traced_put_bigint : + (*_p) = ((yamop *)(&((*_p)->y_u.xN.next))); + break; + case _traced_put_float : + (*_p) = ((yamop *)(&((*_p)->y_u.xd.next))); + break; + case _traced_put_longint : + (*_p) = ((yamop *)(&((*_p)->y_u.xi.next))); + break; + case _traced_put_list : + (*_p) = ((yamop *)(&((*_p)->y_u.x.next))); + break; + case _traced_put_struct : + (*_p) = ((yamop *)(&((*_p)->y_u.xfa.next))); + break; + case _traced_write_x_var : + (*_p) = ((yamop *)(&((*_p)->y_u.x.next))); + break; + case _traced_write_void : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_write_n_voids : + (*_p) = ((yamop *)(&((*_p)->y_u.s.next))); + break; + case _traced_write_y_var : + (*_p) = ((yamop *)(&((*_p)->y_u.y.next))); + break; + case _traced_write_x_val : + (*_p) = ((yamop *)(&((*_p)->y_u.x.next))); + break; + case _traced_write_x_loc : + (*_p) = ((yamop *)(&((*_p)->y_u.x.next))); + break; + case _traced_write_y_val : + (*_p) = ((yamop *)(&((*_p)->y_u.y.next))); + break; + case _traced_write_y_loc : + (*_p) = ((yamop *)(&((*_p)->y_u.y.next))); + break; + case _traced_write_atom : + (*_p) = ((yamop *)(&((*_p)->y_u.c.next))); + break; + case _traced_write_bigint : + (*_p) = ((yamop *)(&((*_p)->y_u.N.next))); + break; + case _traced_write_dbterm : + (*_p) = ((yamop *)(&((*_p)->y_u.D.next))); + break; + case _traced_write_float : + (*_p) = ((yamop *)(&((*_p)->y_u.d.next))); + break; + case _traced_write_longint : + (*_p) = ((yamop *)(&((*_p)->y_u.i.next))); + break; + case _traced_write_n_atoms : + (*_p) = ((yamop *)(&((*_p)->y_u.sc.next))); + break; + case _traced_write_list : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_write_l_list : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_write_struct : + (*_p) = ((yamop *)(&((*_p)->y_u.fa.next))); + break; + case _traced_write_l_struc : + (*_p) = ((yamop *)(&((*_p)->y_u.fa.next))); + break; + case _traced_save_pair_x : + (*_p) = ((yamop *)(&((*_p)->y_u.ox.next))); + break; + case _traced_save_pair_x_write : + (*_p) = ((yamop *)(&((*_p)->y_u.ox.next))); + break; + case _traced_save_pair_y : + (*_p) = ((yamop *)(&((*_p)->y_u.oy.next))); + break; + case _traced_save_pair_y_write : + (*_p) = ((yamop *)(&((*_p)->y_u.oy.next))); + break; + case _traced_save_appl_x : + (*_p) = ((yamop *)(&((*_p)->y_u.ox.next))); + break; + case _traced_save_appl_x_write : + (*_p) = ((yamop *)(&((*_p)->y_u.ox.next))); + break; + case _traced_save_appl_y : + (*_p) = ((yamop *)(&((*_p)->y_u.oy.next))); + break; + case _traced_save_appl_y_write : + (*_p) = ((yamop *)(&((*_p)->y_u.oy.next))); + break; + case _traced_jump : + (*_p) = ((yamop *)(&((*_p)->y_u.l.next))); + break; + case _traced_move_back : + (*_p) = ((yamop *)(&((*_p)->y_u.l.next))); + break; + case _traced_skip : + (*_p) = ((yamop *)(&((*_p)->y_u.l.next))); + break; + case _traced_either : + (*_p) = ((yamop *)(&((*_p)->y_u.Osblp.next))); + break; + case _traced_or_else : + (*_p) = ((yamop *)(&((*_p)->y_u.Osblp.next))); + break; + case _traced_pop_n : + (*_p) = ((yamop *)(&((*_p)->y_u.s.next))); + break; + case _traced_pop : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_call_cpred : + (*_p) = ((yamop *)(&((*_p)->y_u.Osbpp.next))); + break; + case _traced_execute_cpred : + (*_p) = ((yamop *)(&((*_p)->y_u.pp.next))); + break; + case _traced_call_usercpred : + (*_p) = ((yamop *)(&((*_p)->y_u.Osbpp.next))); + break; + case _traced_call_c_wfail : + (*_p) = ((yamop *)(&((*_p)->y_u.slp.next))); + break; + case _traced_try_c : + (*_p) = ((yamop *)(&((*_p)->y_u.OtapFs.next))); + break; + case _traced_retry_c : + (*_p) = ((yamop *)(&((*_p)->y_u.OtapFs.next))); + break; +#ifdef CUT_C + case _traced_cut_c : + (*_p) = ((yamop *)(&((*_p)->y_u.OtapFs.next))); + break; +#endif + case _traced_try_userc : + (*_p) = ((yamop *)(&((*_p)->y_u.OtapFs.next))); + break; + case _traced_retry_userc : + (*_p) = ((yamop *)(&((*_p)->y_u.OtapFs.next))); + break; +#ifdef CUT_C + case _traced_cut_userc : + (*_p) = ((yamop *)(&((*_p)->y_u.OtapFs.next))); + break; +#endif + case _traced_lock_pred : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_index_pred : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; +#ifdef THREADS + case _traced_thread_local : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; +#endif + case _traced_expand_index : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_expand_clauses : + (*_p) = ((yamop *)(&((*_p)->y_u.sssllp.next))); + break; + case _traced_undef_p : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_spy_pred : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_try_clause : + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; + case _traced_try_clause2 : + (*_p) = ((yamop *)(&((*_p)->y_u.l.next))); + break; + case _traced_try_clause3 : + (*_p) = ((yamop *)(&((*_p)->y_u.l.next))); + break; + case _traced_try_clause4 : + (*_p) = ((yamop *)(&((*_p)->y_u.l.next))); + break; + case _traced_retry : + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; + case _traced_retry2 : + (*_p) = ((yamop *)(&((*_p)->y_u.l.next))); + break; + case _traced_retry3 : + (*_p) = ((yamop *)(&((*_p)->y_u.l.next))); + break; + case _traced_retry4 : + (*_p) = ((yamop *)(&((*_p)->y_u.l.next))); + break; + case _traced_trust : + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; + case _traced_try_in : + (*_p) = ((yamop *)(&((*_p)->y_u.l.next))); + break; + case _traced_enter_lu_pred : + (*_p) = ((yamop *)(&((*_p)->y_u.Illss.next))); + break; + case _traced_try_logical : + (*_p) = ((yamop *)(&((*_p)->y_u.OtaLl.next))); + break; + case _traced_retry_logical : + (*_p) = ((yamop *)(&((*_p)->y_u.OtaLl.next))); + break; + case _traced_trust_logical : + (*_p) = ((yamop *)(&((*_p)->y_u.OtILl.next))); + break; + case _traced_user_switch : + (*_p) = ((yamop *)(&((*_p)->y_u.lp.next))); + break; + case _traced_switch_on_type : + (*_p) = ((yamop *)(&((*_p)->y_u.llll.next))); + break; + case _traced_switch_list_nl : + (*_p) = ((yamop *)(&((*_p)->y_u.ollll.next))); + break; + case _traced_switch_on_arg_type : + (*_p) = ((yamop *)(&((*_p)->y_u.xllll.next))); + break; + case _traced_switch_on_sub_arg_type : + (*_p) = ((yamop *)(&((*_p)->y_u.sllll.next))); + break; + case _traced_jump_if_var : + (*_p) = ((yamop *)(&((*_p)->y_u.l.next))); + break; + case _traced_jump_if_nonvar : + (*_p) = ((yamop *)(&((*_p)->y_u.xll.next))); + break; + case _traced_if_not_then : + (*_p) = ((yamop *)(&((*_p)->y_u.clll.next))); + break; + case _traced_switch_on_func : + (*_p) = ((yamop *)(&((*_p)->y_u.sssl.next))); + break; + case _traced_switch_on_cons : + (*_p) = ((yamop *)(&((*_p)->y_u.sssl.next))); + break; + case _traced_go_on_func : + (*_p) = ((yamop *)(&((*_p)->y_u.sssl.next))); + break; + case _traced_go_on_cons : + (*_p) = ((yamop *)(&((*_p)->y_u.sssl.next))); + break; + case _traced_if_func : + (*_p) = ((yamop *)(&((*_p)->y_u.sssl.next))); + break; + case _traced_if_cons : + (*_p) = ((yamop *)(&((*_p)->y_u.sssl.next))); + break; + case _traced_index_dbref : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_index_blob : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_index_long : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_jit_handler : + (*_p) = ((yamop *)(&((*_p)->y_u.J.next))); + break; + case _traced_p_atom_x : + (*_p) = ((yamop *)(&((*_p)->y_u.xl.next))); + break; + case _traced_p_atom_y : + (*_p) = ((yamop *)(&((*_p)->y_u.yl.next))); + break; + case _traced_p_atomic_x : + (*_p) = ((yamop *)(&((*_p)->y_u.xl.next))); + break; + case _traced_p_atomic_y : + (*_p) = ((yamop *)(&((*_p)->y_u.yl.next))); + break; + case _traced_p_integer_x : + (*_p) = ((yamop *)(&((*_p)->y_u.xl.next))); + break; + case _traced_p_integer_y : + (*_p) = ((yamop *)(&((*_p)->y_u.yl.next))); + break; + case _traced_p_nonvar_x : + (*_p) = ((yamop *)(&((*_p)->y_u.xl.next))); + break; + case _traced_p_nonvar_y : + (*_p) = ((yamop *)(&((*_p)->y_u.yl.next))); + break; + case _traced_p_number_x : + (*_p) = ((yamop *)(&((*_p)->y_u.xl.next))); + break; + case _traced_p_number_y : + (*_p) = ((yamop *)(&((*_p)->y_u.yl.next))); + break; + case _traced_p_var_x : + (*_p) = ((yamop *)(&((*_p)->y_u.xl.next))); + break; + case _traced_p_var_y : + (*_p) = ((yamop *)(&((*_p)->y_u.yl.next))); + break; + case _traced_p_db_ref_x : + (*_p) = ((yamop *)(&((*_p)->y_u.xl.next))); + break; + case _traced_p_db_ref_y : + (*_p) = ((yamop *)(&((*_p)->y_u.yl.next))); + break; + case _traced_p_primitive_x : + (*_p) = ((yamop *)(&((*_p)->y_u.xl.next))); + break; + case _traced_p_primitive_y : + (*_p) = ((yamop *)(&((*_p)->y_u.yl.next))); + break; + case _traced_p_compound_x : + (*_p) = ((yamop *)(&((*_p)->y_u.xl.next))); + break; + case _traced_p_compound_y : + (*_p) = ((yamop *)(&((*_p)->y_u.yl.next))); + break; + case _traced_p_float_x : + (*_p) = ((yamop *)(&((*_p)->y_u.xl.next))); + break; + case _traced_p_float_y : + (*_p) = ((yamop *)(&((*_p)->y_u.yl.next))); + break; + case _traced_p_plus_vv : + (*_p) = ((yamop *)(&((*_p)->y_u.xxx.next))); + break; + case _traced_p_plus_vc : + (*_p) = ((yamop *)(&((*_p)->y_u.xxn.next))); + break; + case _traced_p_plus_y_vv : + (*_p) = ((yamop *)(&((*_p)->y_u.yxx.next))); + break; + case _traced_p_plus_y_vc : + (*_p) = ((yamop *)(&((*_p)->y_u.yxn.next))); + break; + case _traced_p_minus_vv : + (*_p) = ((yamop *)(&((*_p)->y_u.xxx.next))); + break; + case _traced_p_minus_cv : + (*_p) = ((yamop *)(&((*_p)->y_u.xxn.next))); + break; + case _traced_p_minus_y_vv : + (*_p) = ((yamop *)(&((*_p)->y_u.yxx.next))); + break; + case _traced_p_minus_y_cv : + (*_p) = ((yamop *)(&((*_p)->y_u.yxn.next))); + break; + case _traced_p_times_vv : + (*_p) = ((yamop *)(&((*_p)->y_u.xxx.next))); + break; + case _traced_p_times_vc : + (*_p) = ((yamop *)(&((*_p)->y_u.xxn.next))); + break; + case _traced_p_times_y_vv : + (*_p) = ((yamop *)(&((*_p)->y_u.yxx.next))); + break; + case _traced_p_times_y_vc : + (*_p) = ((yamop *)(&((*_p)->y_u.yxn.next))); + break; + case _traced_p_div_vv : + (*_p) = ((yamop *)(&((*_p)->y_u.xxx.next))); + break; + case _traced_p_div_vc : + (*_p) = ((yamop *)(&((*_p)->y_u.xxn.next))); + break; + case _traced_p_div_cv : + (*_p) = ((yamop *)(&((*_p)->y_u.xxn.next))); + break; + case _traced_p_div_y_vv : + (*_p) = ((yamop *)(&((*_p)->y_u.yxx.next))); + break; + case _traced_p_div_y_vc : + (*_p) = ((yamop *)(&((*_p)->y_u.yxn.next))); + break; + case _traced_p_div_y_cv : + (*_p) = ((yamop *)(&((*_p)->y_u.yxn.next))); + break; + case _traced_p_and_vv : + (*_p) = ((yamop *)(&((*_p)->y_u.xxx.next))); + break; + case _traced_p_and_vc : + (*_p) = ((yamop *)(&((*_p)->y_u.xxn.next))); + break; + case _traced_p_and_y_vv : + (*_p) = ((yamop *)(&((*_p)->y_u.yxx.next))); + break; + case _traced_p_and_y_vc : + (*_p) = ((yamop *)(&((*_p)->y_u.yxn.next))); + break; + case _traced_p_or_vv : + (*_p) = ((yamop *)(&((*_p)->y_u.xxx.next))); + break; + case _traced_p_or_vc : + (*_p) = ((yamop *)(&((*_p)->y_u.xxn.next))); + break; + case _traced_p_or_y_vv : + (*_p) = ((yamop *)(&((*_p)->y_u.yxx.next))); + break; + case _traced_p_or_y_vc : + (*_p) = ((yamop *)(&((*_p)->y_u.yxn.next))); + break; + case _traced_p_sll_vv : + (*_p) = ((yamop *)(&((*_p)->y_u.xxx.next))); + break; + case _traced_p_sll_vc : + (*_p) = ((yamop *)(&((*_p)->y_u.xxn.next))); + break; + case _traced_p_sll_cv : + (*_p) = ((yamop *)(&((*_p)->y_u.xxn.next))); + break; + case _traced_p_sll_y_vv : + (*_p) = ((yamop *)(&((*_p)->y_u.yxx.next))); + break; + case _traced_p_sll_y_vc : + (*_p) = ((yamop *)(&((*_p)->y_u.yxn.next))); + break; + case _traced_p_sll_y_cv : + (*_p) = ((yamop *)(&((*_p)->y_u.yxn.next))); + break; + case _traced_p_slr_vv : + (*_p) = ((yamop *)(&((*_p)->y_u.xxx.next))); + break; + case _traced_p_slr_vc : + (*_p) = ((yamop *)(&((*_p)->y_u.xxn.next))); + break; + case _traced_p_slr_cv : + (*_p) = ((yamop *)(&((*_p)->y_u.xxn.next))); + break; + case _traced_p_slr_y_vv : + (*_p) = ((yamop *)(&((*_p)->y_u.yxx.next))); + break; + case _traced_p_slr_y_vc : + (*_p) = ((yamop *)(&((*_p)->y_u.yxn.next))); + break; + case _traced_p_slr_y_cv : + (*_p) = ((yamop *)(&((*_p)->y_u.yxn.next))); + break; + case _traced_call_bfunc_xx : + (*_p) = ((yamop *)(&((*_p)->y_u.plxxs.next))); + break; + case _traced_call_bfunc_yx : + (*_p) = ((yamop *)(&((*_p)->y_u.plxys.next))); + break; + case _traced_call_bfunc_xy : + (*_p) = ((yamop *)(&((*_p)->y_u.plxys.next))); + break; + case _traced_call_bfunc_yy : + (*_p) = ((yamop *)(&((*_p)->y_u.plyys.next))); + break; + case _traced_p_equal : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_p_dif : + (*_p) = ((yamop *)(&((*_p)->y_u.l.next))); + break; + case _traced_p_eq : + (*_p) = ((yamop *)(&((*_p)->y_u.l.next))); + break; + case _traced_p_arg_vv : + (*_p) = ((yamop *)(&((*_p)->y_u.xxx.next))); + break; + case _traced_p_arg_cv : + (*_p) = ((yamop *)(&((*_p)->y_u.xxn.next))); + break; + case _traced_p_arg_y_vv : + (*_p) = ((yamop *)(&((*_p)->y_u.yxx.next))); + break; + case _traced_p_arg_y_cv : + (*_p) = ((yamop *)(&((*_p)->y_u.yxn.next))); + break; + case _traced_p_func2s_vv : + (*_p) = ((yamop *)(&((*_p)->y_u.xxx.next))); + break; + case _traced_p_func2s_cv : + (*_p) = ((yamop *)(&((*_p)->y_u.xxc.next))); + break; + case _traced_p_func2s_vc : + (*_p) = ((yamop *)(&((*_p)->y_u.xxn.next))); + break; + case _traced_p_func2s_y_vv : + (*_p) = ((yamop *)(&((*_p)->y_u.yxx.next))); + break; + case _traced_p_func2s_y_cv : + (*_p) = ((yamop *)(&((*_p)->y_u.yxn.next))); + break; + case _traced_p_func2s_y_vc : + (*_p) = ((yamop *)(&((*_p)->y_u.yxn.next))); + break; + case _traced_p_func2f_xx : + (*_p) = ((yamop *)(&((*_p)->y_u.xxx.next))); + break; + case _traced_p_func2f_xy : + (*_p) = ((yamop *)(&((*_p)->y_u.xxy.next))); + break; + case _traced_p_func2f_yx : + (*_p) = ((yamop *)(&((*_p)->y_u.yxx.next))); + break; + case _traced_p_func2f_yy : + (*_p) = ((yamop *)(&((*_p)->y_u.yyx.next))); + break; + case _traced_p_functor : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_p_execute2 : + (*_p) = ((yamop *)(&((*_p)->y_u.Osbpp.next))); + break; + case _traced_p_execute : + (*_p) = ((yamop *)(&((*_p)->y_u.Osbmp.next))); + break; + case _traced_p_execute_tail : + (*_p) = ((yamop *)(&((*_p)->y_u.Osbpp.next))); + break; +#ifdef YAPOR + case _traced_getwork_first_time : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_getwork : + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; + case _traced_getwork_seq : + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; + case _traced_sync : + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; +#endif +#ifdef TABLING +#ifdef TABLING_INNER_CUTS + case _traced_clause_with_cut : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; +#endif + case _traced_table_load_answer : + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; + case _traced_table_try_answer : + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; + case _traced_table_try_single : + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; + case _traced_table_try_me : + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; + case _traced_table_try : + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; + case _traced_table_retry_me : + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; + case _traced_table_retry : + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; + case _traced_table_trust_me : + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; + case _traced_table_trust : + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; + case _traced_table_new_answer : + (*_p) = ((yamop *)(&((*_p)->y_u.s.next))); + break; + case _traced_table_answer_resolution : + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; + case _traced_table_completion : + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; +#ifdef THREADS_CONSUMER_SHARING + case _traced_table_answer_resolution_completion: + (*_p) = ((yamop *)(&((*_p)->y_u.Otapl.next))); + break; +#endif + case _traced_trie_do_var : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_trie_trust_var : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_trie_try_var : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_trie_retry_var : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_trie_do_var_in_pair : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_trie_trust_var_in_pair : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_trie_try_var_in_pair : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_trie_retry_var_in_pair : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_trie_do_val : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_trie_trust_val : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_trie_try_val : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_trie_retry_val : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_trie_do_val_in_pair : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_trie_trust_val_in_pair : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_trie_try_val_in_pair : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_trie_retry_val_in_pair : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_trie_do_atom : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_trie_trust_atom : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_trie_try_atom : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_trie_retry_atom : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_trie_do_atom_in_pair : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_trie_trust_atom_in_pair : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_trie_try_atom_in_pair : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_trie_retry_atom_in_pair : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_trie_do_null : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_trie_trust_null : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_trie_try_null : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_trie_retry_null : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_trie_do_null_in_pair : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_trie_trust_null_in_pair : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_trie_try_null_in_pair : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_trie_retry_null_in_pair : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_trie_do_pair : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_trie_trust_pair : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_trie_try_pair : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_trie_retry_pair : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_trie_do_appl : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_trie_trust_appl : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_trie_try_appl : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_trie_retry_appl : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_trie_do_appl_in_pair : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_trie_trust_appl_in_pair : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_trie_try_appl_in_pair : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_trie_retry_appl_in_pair : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_trie_do_extension : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_trie_trust_extension : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_trie_try_extension : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_trie_retry_extension : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_trie_do_double : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_trie_trust_double : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_trie_try_double : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_trie_retry_double : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_trie_do_longint : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_trie_trust_longint : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_trie_try_longint : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_trie_retry_longint : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_trie_do_gterm : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_trie_trust_gterm : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_trie_try_gterm : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; + case _traced_trie_retry_gterm : + (*_p) = ((yamop *)(&((*_p)->y_u.e.next))); + break; +#endif +#ifdef YAPOR + case _traced_or_last : + (*_p) = ((yamop *)(&((*_p)->y_u.sblp.next))); + break; +#else + case _traced_or_last : + (*_p) = ((yamop *)(&((*_p)->y_u.p.next))); + break; +#endif + default: + printf("Bad argument in lastop\n"); + return; + } +} diff --git a/JIT/HPP/print_op.hpp b/JIT/HPP/print_op.hpp new file mode 100644 index 000000000..edffdd55e --- /dev/null +++ b/JIT/HPP/print_op.hpp @@ -0,0 +1,3181 @@ +void print_op(char*, op_numbers, char*); + +void +print_op(char* prepend_term, op_numbers op, char* append_term) { + switch(op){ + case _Ystop : + fprintf(stderr, "%s_Ystop%s", prepend_term, append_term); + break; + + case _Nstop : + fprintf(stderr, "%s_Nstop%s", prepend_term, append_term); + break; + + case _try_me : + fprintf(stderr, "%s_try_me%s", prepend_term, append_term); + break; + + case _retry_me : + fprintf(stderr, "%s_retry_me%s", prepend_term, append_term); + break; + + case _trust_me : + fprintf(stderr, "%s_trust_me%s", prepend_term, append_term); + break; + + case _enter_profiling : + fprintf(stderr, "%s_enter_profiling%s", prepend_term, append_term); + break; + + case _retry_profiled : + fprintf(stderr, "%s_retry_profiled%s", prepend_term, append_term); + break; + + case _profiled_retry_me : + fprintf(stderr, "%s_profiled_retry_me%s", prepend_term, append_term); + break; + + case _profiled_trust_me : + fprintf(stderr, "%s_profiled_trust_me%s", prepend_term, append_term); + break; + + case _profiled_retry_logical : + fprintf(stderr, "%s_profiled_retry_logical%s", prepend_term, append_term); + break; + + case _profiled_trust_logical : + fprintf(stderr, "%s_profiled_trust_logical%s", prepend_term, append_term); + break; + + case _count_call : + fprintf(stderr, "%s_count_call%s", prepend_term, append_term); + break; + + case _count_retry : + fprintf(stderr, "%s_count_retry%s", prepend_term, append_term); + break; + + case _count_retry_me : + fprintf(stderr, "%s_count_retry_me%s", prepend_term, append_term); + break; + + case _count_trust_me : + fprintf(stderr, "%s_count_trust_me%s", prepend_term, append_term); + break; + + case _count_retry_logical : + fprintf(stderr, "%s_count_retry_logical%s", prepend_term, append_term); + break; + + case _count_trust_logical : + fprintf(stderr, "%s_count_trust_logical%s", prepend_term, append_term); + break; + + case _lock_lu : + fprintf(stderr, "%s_lock_lu%s", prepend_term, append_term); + break; + + case _unlock_lu : + fprintf(stderr, "%s_unlock_lu%s", prepend_term, append_term); + break; + + case _alloc_for_logical_pred : + fprintf(stderr, "%s_alloc_for_logical_pred%s", prepend_term, append_term); + break; + + case _copy_idb_term : + fprintf(stderr, "%s_copy_idb_term%s", prepend_term, append_term); + break; + + case _unify_idb_term : + fprintf(stderr, "%s_unify_idb_term%s", prepend_term, append_term); + break; + + case _ensure_space : + fprintf(stderr, "%s_ensure_space%s", prepend_term, append_term); + break; + + case _spy_or_trymark : + fprintf(stderr, "%s_spy_or_trymark%s", prepend_term, append_term); + break; + + case _try_and_mark : + fprintf(stderr, "%s_try_and_mark%s", prepend_term, append_term); + break; + + case _count_retry_and_mark : + fprintf(stderr, "%s_count_retry_and_mark%s", prepend_term, append_term); + break; + + case _profiled_retry_and_mark : + fprintf(stderr, "%s_profiled_retry_and_mark%s", prepend_term, append_term); + break; + + case _retry_and_mark : + fprintf(stderr, "%s_retry_and_mark%s", prepend_term, append_term); + break; + + case _trust_fail : + fprintf(stderr, "%s_trust_fail%s", prepend_term, append_term); + break; + + case _op_fail : + fprintf(stderr, "%s_op_fail%s", prepend_term, append_term); + break; + + case _cut : + fprintf(stderr, "%s_cut%s", prepend_term, append_term); + break; + + case _cut_t : + fprintf(stderr, "%s_cut_t%s", prepend_term, append_term); + break; + + case _cut_e : + fprintf(stderr, "%s_cut_e%s", prepend_term, append_term); + break; + + case _save_b_x : + fprintf(stderr, "%s_save_b_x%s", prepend_term, append_term); + break; + + case _save_b_y : + fprintf(stderr, "%s_save_b_y%s", prepend_term, append_term); + break; + + case _commit_b_x : + fprintf(stderr, "%s_commit_b_x%s", prepend_term, append_term); + break; + + case _commit_b_y : + fprintf(stderr, "%s_commit_b_y%s", prepend_term, append_term); + break; + + case _execute : + fprintf(stderr, "%s_execute%s", prepend_term, append_term); + break; + + case _dexecute : + fprintf(stderr, "%s_dexecute%s", prepend_term, append_term); + break; + + case _fcall : + fprintf(stderr, "%s_fcall%s", prepend_term, append_term); + break; + + case _call : + fprintf(stderr, "%s_call%s", prepend_term, append_term); + break; + + case _procceed : + fprintf(stderr, "%s_procceed%s", prepend_term, append_term); + break; + + case _allocate : + fprintf(stderr, "%s_allocate%s", prepend_term, append_term); + break; + + case _deallocate : + fprintf(stderr, "%s_deallocate%s", prepend_term, append_term); + break; + +#ifdef BEAM + case _retry_eam : + fprintf(stderr, "%s_retry_eam%s", prepend_term, append_term); + break; + +#endif +#ifdef BEAM + case _run_eam : + fprintf(stderr, "%s_run_eam%s", prepend_term, append_term); + break; + +#endif + case _get_x_var : + fprintf(stderr, "%s_get_x_var%s", prepend_term, append_term); + break; + + case _get_y_var : + fprintf(stderr, "%s_get_y_var%s", prepend_term, append_term); + break; + + case _get_yy_var : + fprintf(stderr, "%s_get_yy_var%s", prepend_term, append_term); + break; + + case _get_x_val : + fprintf(stderr, "%s_get_x_val%s", prepend_term, append_term); + break; + + case _get_y_val : + fprintf(stderr, "%s_get_y_val%s", prepend_term, append_term); + break; + + case _get_atom : + fprintf(stderr, "%s_get_atom%s", prepend_term, append_term); + break; + + case _get_2atoms : + fprintf(stderr, "%s_get_2atoms%s", prepend_term, append_term); + break; + + case _get_3atoms : + fprintf(stderr, "%s_get_3atoms%s", prepend_term, append_term); + break; + + case _get_4atoms : + fprintf(stderr, "%s_get_4atoms%s", prepend_term, append_term); + break; + + case _get_5atoms : + fprintf(stderr, "%s_get_5atoms%s", prepend_term, append_term); + break; + + case _get_6atoms : + fprintf(stderr, "%s_get_6atoms%s", prepend_term, append_term); + break; + + case _get_list : + fprintf(stderr, "%s_get_list%s", prepend_term, append_term); + break; + + case _get_struct : + fprintf(stderr, "%s_get_struct%s", prepend_term, append_term); + break; + + case _get_float : + fprintf(stderr, "%s_get_float%s", prepend_term, append_term); + break; + + case _get_longint : + fprintf(stderr, "%s_get_longint%s", prepend_term, append_term); + break; + + case _get_bigint : + fprintf(stderr, "%s_get_bigint%s", prepend_term, append_term); + break; + + case _get_dbterm : + fprintf(stderr, "%s_get_dbterm%s", prepend_term, append_term); + break; + + case _glist_valx : + fprintf(stderr, "%s_glist_valx%s", prepend_term, append_term); + break; + + case _glist_valy : + fprintf(stderr, "%s_glist_valy%s", prepend_term, append_term); + break; + + case _gl_void_varx : + fprintf(stderr, "%s_gl_void_varx%s", prepend_term, append_term); + break; + + case _gl_void_vary : + fprintf(stderr, "%s_gl_void_vary%s", prepend_term, append_term); + break; + + case _gl_void_valx : + fprintf(stderr, "%s_gl_void_valx%s", prepend_term, append_term); + break; + + case _gl_void_valy : + fprintf(stderr, "%s_gl_void_valy%s", prepend_term, append_term); + break; + + case _unify_x_var : + fprintf(stderr, "%s_unify_x_var%s", prepend_term, append_term); + break; + + case _unify_x_var_write : + fprintf(stderr, "%s_unify_x_var_write%s", prepend_term, append_term); + break; + + case _unify_l_x_var : + fprintf(stderr, "%s_unify_l_x_var%s", prepend_term, append_term); + break; + + case _unify_l_x_var_write : + fprintf(stderr, "%s_unify_l_x_var_write%s", prepend_term, append_term); + break; + + case _unify_x_var2 : + fprintf(stderr, "%s_unify_x_var2%s", prepend_term, append_term); + break; + + case _unify_x_var2_write : + fprintf(stderr, "%s_unify_x_var2_write%s", prepend_term, append_term); + break; + + case _unify_l_x_var2 : + fprintf(stderr, "%s_unify_l_x_var2%s", prepend_term, append_term); + break; + + case _unify_l_x_var2_write : + fprintf(stderr, "%s_unify_l_x_var2_write%s", prepend_term, append_term); + break; + + case _unify_y_var : + fprintf(stderr, "%s_unify_y_var%s", prepend_term, append_term); + break; + + case _unify_y_var_write : + fprintf(stderr, "%s_unify_y_var_write%s", prepend_term, append_term); + break; + + case _unify_l_y_var : + fprintf(stderr, "%s_unify_l_y_var%s", prepend_term, append_term); + break; + + case _unify_l_y_var_write : + fprintf(stderr, "%s_unify_l_y_var_write%s", prepend_term, append_term); + break; + + case _unify_x_val : + fprintf(stderr, "%s_unify_x_val%s", prepend_term, append_term); + break; + + case _unify_x_val_write : + fprintf(stderr, "%s_unify_x_val_write%s", prepend_term, append_term); + break; + + case _unify_l_x_val : + fprintf(stderr, "%s_unify_l_x_val%s", prepend_term, append_term); + break; + + case _unify_l_x_val_write : + fprintf(stderr, "%s_uify_l_x_val_write%s", prepend_term, append_term); + break; + + case _unify_y_val : + fprintf(stderr, "%s_unify_y_val%s", prepend_term, append_term); + break; + + case _unify_y_val_write : + fprintf(stderr, "%s_unify_y_val_write%s", prepend_term, append_term); + break; + + case _unify_l_y_val : + fprintf(stderr, "%s_unify_l_y_val%s", prepend_term, append_term); + break; + + case _unify_l_y_val_write : + fprintf(stderr, "%s_unify_l_y_val_write%s", prepend_term, append_term); + break; + + case _unify_x_loc : + fprintf(stderr, "%s_unify_x_loc%s", prepend_term, append_term); + break; + + case _unify_x_loc_write : + fprintf(stderr, "%s_unify_x_loc_write%s", prepend_term, append_term); + break; + + case _unify_l_x_loc : + fprintf(stderr, "%s_unify_l_x_loc%s", prepend_term, append_term); + break; + + case _unify_l_x_loc_write : + fprintf(stderr, "%s_unify_l_x_loc_write%s", prepend_term, append_term); + break; + + case _unify_y_loc : + fprintf(stderr, "%s_unify_y_loc%s", prepend_term, append_term); + break; + + case _unify_y_loc_write : + fprintf(stderr, "%s_unify_y_loc_write%s", prepend_term, append_term); + break; + + case _unify_l_y_loc : + fprintf(stderr, "%s_unify_l_y_loc%s", prepend_term, append_term); + break; + + case _unify_l_y_loc_write : + fprintf(stderr, "%s_unify_l_y_loc_write%s", prepend_term, append_term); + break; + + case _unify_void : + fprintf(stderr, "%s_unify_void%s", prepend_term, append_term); + break; + + case _unify_void_write : + fprintf(stderr, "%s_unify_void_write%s", prepend_term, append_term); + break; + + case _unify_l_void : + fprintf(stderr, "%s_unify_l_void%s", prepend_term, append_term); + break; + + case _unify_l_void_write : + fprintf(stderr, "%s_unify_l_void_write%s", prepend_term, append_term); + break; + + case _unify_n_voids : + fprintf(stderr, "%s_unify_n_voids%s", prepend_term, append_term); + break; + + case _unify_n_voids_write : + fprintf(stderr, "%s_unify_n_voids_write%s", prepend_term, append_term); + break; + + case _unify_l_n_voids : + fprintf(stderr, "%s_unify_l_n_voids%s", prepend_term, append_term); + break; + + case _unify_l_n_voids_write : + fprintf(stderr, "%s_unify_l_n_voids_write%s", prepend_term, append_term); + break; + + case _unify_atom : + fprintf(stderr, "%s_unify_atom%s", prepend_term, append_term); + break; + + case _unify_atom_write : + fprintf(stderr, "%s_unify_atom_write%s", prepend_term, append_term); + break; + + case _unify_l_atom : + fprintf(stderr, "%s_unify_l_atom%s", prepend_term, append_term); + break; + + case _unify_l_atom_write : + fprintf(stderr, "%s_unify_l_atom_write%s", prepend_term, append_term); + break; + + case _unify_n_atoms : + fprintf(stderr, "%s_unify_n_atoms%s", prepend_term, append_term); + break; + + case _unify_n_atoms_write : + fprintf(stderr, "%s_unify_n_atoms_write%s", prepend_term, append_term); + break; + + case _unify_float : + fprintf(stderr, "%s_unify_float%s", prepend_term, append_term); + break; + + case _unify_float_write : + fprintf(stderr, "%s_unify_float_write%s", prepend_term, append_term); + break; + + case _unify_l_float : + fprintf(stderr, "%s_unify_l_float%s", prepend_term, append_term); + break; + + case _unify_l_float_write : + fprintf(stderr, "%s_unify_l_float_write%s", prepend_term, append_term); + break; + + case _unify_longint : + fprintf(stderr, "%s_unify_longint%s", prepend_term, append_term); + break; + + case _unify_longint_write : + fprintf(stderr, "%s_unify_longint_write%s", prepend_term, append_term); + break; + + case _unify_l_longint : + fprintf(stderr, "%s_unify_l_longint%s", prepend_term, append_term); + break; + + case _unify_l_longint_write : + fprintf(stderr, "%s_unify_l_longint_write%s", prepend_term, append_term); + break; + + case _unify_bigint : + fprintf(stderr, "%s_unify_bigint%s", prepend_term, append_term); + break; + + case _unify_l_bigint : + fprintf(stderr, "%s_unify_l_bigint%s", prepend_term, append_term); + break; + + case _unify_dbterm : + fprintf(stderr, "%s_unify_dbterm%s", prepend_term, append_term); + break; + + case _unify_l_dbterm : + fprintf(stderr, "%s_unify_l_dbterm%s", prepend_term, append_term); + break; + + case _unify_list : + fprintf(stderr, "%s_unify_list%s", prepend_term, append_term); + break; + + case _unify_list_write : + fprintf(stderr, "%s_unify_list_write%s", prepend_term, append_term); + break; + + case _unify_l_list : + fprintf(stderr, "%s_unify_l_list%s", prepend_term, append_term); + break; + + case _unify_l_list_write : + fprintf(stderr, "%s_unify_l_list_write%s", prepend_term, append_term); + break; + + case _unify_struct : + fprintf(stderr, "%s_unify_struct%s", prepend_term, append_term); + break; + + case _unify_struct_write : + fprintf(stderr, "%s_unify_struct_write%s", prepend_term, append_term); + break; + + case _unify_l_struc : + fprintf(stderr, "%s_unify_l_struc%s", prepend_term, append_term); + break; + + case _unify_l_struc_write : + fprintf(stderr, "%s_unify_l_struc_write%s", prepend_term, append_term); + break; + + case _put_x_var : + fprintf(stderr, "%s_put_x_var%s", prepend_term, append_term); + break; + + case _put_y_var : + fprintf(stderr, "%s_put_y_var%s", prepend_term, append_term); + break; + + case _put_x_val : + fprintf(stderr, "%s_put_x_val%s", prepend_term, append_term); + break; + + case _put_xx_val : + fprintf(stderr, "%s_put_xx_val%s", prepend_term, append_term); + break; + + case _put_y_val : + fprintf(stderr, "%s_put_y_val%s", prepend_term, append_term); + break; + + case _put_y_vals : + fprintf(stderr, "%s_put_y_vals%s", prepend_term, append_term); + break; + + case _put_unsafe : + fprintf(stderr, "%s_put_unsafe%s", prepend_term, append_term); + break; + + case _put_atom : + fprintf(stderr, "%s_put_atom%s", prepend_term, append_term); + break; + + case _put_dbterm : + fprintf(stderr, "%s_put_dbterm%s", prepend_term, append_term); + break; + + case _put_bigint : + fprintf(stderr, "%s_put_bigint%s", prepend_term, append_term); + break; + + case _put_float : + fprintf(stderr, "%s_put_float%s", prepend_term, append_term); + break; + + case _put_longint : + fprintf(stderr, "%s_put_longint%s", prepend_term, append_term); + break; + + case _put_list : + fprintf(stderr, "%s_put_list%s", prepend_term, append_term); + break; + + case _put_struct : + fprintf(stderr, "%s_put_struct%s", prepend_term, append_term); + break; + + case _write_x_var : + fprintf(stderr, "%s_write_x_var%s", prepend_term, append_term); + break; + + case _write_void : + fprintf(stderr, "%s_write_void%s", prepend_term, append_term); + break; + + case _write_n_voids : + fprintf(stderr, "%s_write_n_voids%s", prepend_term, append_term); + break; + + case _write_y_var : + fprintf(stderr, "%s_write_y_var%s", prepend_term, append_term); + break; + + case _write_x_val : + fprintf(stderr, "%s_write_x_val%s", prepend_term, append_term); + break; + + case _write_x_loc : + fprintf(stderr, "%s_write_x_loc%s", prepend_term, append_term); + break; + + case _write_y_val : + fprintf(stderr, "%s_write_y_val%s", prepend_term, append_term); + break; + + case _write_y_loc : + fprintf(stderr, "%s_write_y_loc%s", prepend_term, append_term); + break; + + case _write_atom : + fprintf(stderr, "%s_write_atom%s", prepend_term, append_term); + break; + + case _write_bigint : + fprintf(stderr, "%s_write_bigint%s", prepend_term, append_term); + break; + + case _write_dbterm : + fprintf(stderr, "%s_write_dbterm%s", prepend_term, append_term); + break; + + case _write_float : + fprintf(stderr, "%s_write_float%s", prepend_term, append_term); + break; + + case _write_longint : + fprintf(stderr, "%s_write_longint%s", prepend_term, append_term); + break; + + case _write_n_atoms : + fprintf(stderr, "%s_write_n_atoms%s", prepend_term, append_term); + break; + + case _write_list : + fprintf(stderr, "%s_write_list%s", prepend_term, append_term); + break; + + case _write_l_list : + fprintf(stderr, "%s_write_l_list%s", prepend_term, append_term); + break; + + case _write_struct : + fprintf(stderr, "%s_write_struct%s", prepend_term, append_term); + break; + + case _write_l_struc : + fprintf(stderr, "%s_write_l_struc%s", prepend_term, append_term); + break; + + case _save_pair_x : + fprintf(stderr, "%s_save_pair_x%s", prepend_term, append_term); + break; + + case _save_pair_x_write : + fprintf(stderr, "%s_save_pair_x_write%s", prepend_term, append_term); + break; + + case _save_pair_y : + fprintf(stderr, "%s_save_pair_y%s", prepend_term, append_term); + break; + + case _save_pair_y_write : + fprintf(stderr, "%s_save_pair_y_write%s", prepend_term, append_term); + break; + + case _save_appl_x : + fprintf(stderr, "%s_save_appl_x%s", prepend_term, append_term); + break; + + case _save_appl_x_write : + fprintf(stderr, "%s_save_appl_x_write%s", prepend_term, append_term); + break; + + case _save_appl_y : + fprintf(stderr, "%s_save_appl_y%s", prepend_term, append_term); + break; + + case _save_appl_y_write : + fprintf(stderr, "%s_save_appl_y_write%s", prepend_term, append_term); + break; + + case _jump : + fprintf(stderr, "%s_jump%s", prepend_term, append_term); + break; + + case _move_back : + fprintf(stderr, "%s_move_back%s", prepend_term, append_term); + break; + + case _skip : + fprintf(stderr, "%s_skip%s", prepend_term, append_term); + break; + + case _either : + fprintf(stderr, "%s_either%s", prepend_term, append_term); + break; + + case _or_else : + fprintf(stderr, "%s_or_else%s", prepend_term, append_term); + break; + + case _pop_n : + fprintf(stderr, "%s_pop_n%s", prepend_term, append_term); + break; + + case _pop : + fprintf(stderr, "%s_pop%s", prepend_term, append_term); + break; + + case _call_cpred : + fprintf(stderr, "%s_call_cpred%s", prepend_term, append_term); + break; + + case _execute_cpred : + fprintf(stderr, "%s_execute_cpred%s", prepend_term, append_term); + break; + + case _call_usercpred : + fprintf(stderr, "%s_call_usercpred%s", prepend_term, append_term); + break; + + case _call_c_wfail : + fprintf(stderr, "%s_call_x_wfail%s", prepend_term, append_term); + break; + + case _try_c : + fprintf(stderr, "%s_try_c%s", prepend_term, append_term); + break; + + case _retry_c : + fprintf(stderr, "%s_retry_c%s", prepend_term, append_term); + break; + +#ifdef CUT_C + case _cut_c : + fprintf(stderr, "%s_cut_c%s", prepend_term, append_term); + break; + +#endif + case _try_userc : + fprintf(stderr, "%s_try_userc%s", prepend_term, append_term); + break; + + case _retry_userc : + fprintf(stderr, "%s_retry_userc%s", prepend_term, append_term); + break; + +#ifdef CUT_C + case _cut_userc : + fprintf(stderr, "%s_cut_userc%s", prepend_term, append_term); + break; + +#endif + case _lock_pred : + fprintf(stderr, "%s_lock_pred%s", prepend_term, append_term); + break; + + case _index_pred : + fprintf(stderr, "%s_index_pred%s", prepend_term, append_term); + break; + +#ifdef THREADS + case _thread_local : + fprintf(stderr, "%s_thread_local%s", prepend_term, append_term); + break; + +#endif + case _expand_index : + fprintf(stderr, "%s_expand_index%s", prepend_term, append_term); + break; + + case _expand_clauses : + fprintf(stderr, "%s_expand_clauses%s", prepend_term, append_term); + break; + + case _undef_p : + fprintf(stderr, "%s_undef_p%s", prepend_term, append_term); + break; + + case _spy_pred : + fprintf(stderr, "%s_spy_pred%s", prepend_term, append_term); + break; + + case _try_clause : + fprintf(stderr, "%s_try_clause%s", prepend_term, append_term); + break; + + case _try_clause2 : + fprintf(stderr, "%s_try_clause2%s", prepend_term, append_term); + break; + + case _try_clause3 : + fprintf(stderr, "%s_try_clause3%s", prepend_term, append_term); + break; + + case _try_clause4 : + fprintf(stderr, "%s_try_clause4%s", prepend_term, append_term); + break; + + case _retry : + fprintf(stderr, "%s_retry%s", prepend_term, append_term); + break; + + case _retry2 : + fprintf(stderr, "%s_retry2%s", prepend_term, append_term); + break; + + case _retry3 : + fprintf(stderr, "%s_retry3%s", prepend_term, append_term); + break; + + case _retry4 : + fprintf(stderr, "%s_retry4%s", prepend_term, append_term); + break; + + case _trust : + fprintf(stderr, "%s_trust%s", prepend_term, append_term); + break; + + case _try_in : + fprintf(stderr, "%s_try_in%s", prepend_term, append_term); + break; + + case _enter_lu_pred : + fprintf(stderr, "%s_enter_lu_pred%s", prepend_term, append_term); + break; + + case _try_logical : + fprintf(stderr, "%s_try_logical%s", prepend_term, append_term); + break; + + case _retry_logical : + fprintf(stderr, "%s_retry_logical%s", prepend_term, append_term); + break; + + case _trust_logical : + fprintf(stderr, "%s_trust_logical%s", prepend_term, append_term); + break; + + case _user_switch : + fprintf(stderr, "%s_user_switch%s", prepend_term, append_term); + break; + + case _switch_on_type : + fprintf(stderr, "%s_switch_on_type%s", prepend_term, append_term); + break; + + case _switch_list_nl : + fprintf(stderr, "%s_switch_list_nl%s", prepend_term, append_term); + break; + + case _switch_on_arg_type : + fprintf(stderr, "%s_switch_on_arg_type%s", prepend_term, append_term); + break; + + case _switch_on_sub_arg_type : + fprintf(stderr, "%s_switch_on_sub_arg_type%s", prepend_term, append_term); + break; + + case _jump_if_var : + fprintf(stderr, "%s_jump_if_var%s", prepend_term, append_term); + break; + + case _jump_if_nonvar : + fprintf(stderr, "%s_jump_if_nonvar%s", prepend_term, append_term); + break; + + case _if_not_then : + fprintf(stderr, "%s_if_not_then%s", prepend_term, append_term); + break; + + case _switch_on_func : + fprintf(stderr, "%s_switch_on_func%s", prepend_term, append_term); + break; + + case _switch_on_cons : + fprintf(stderr, "%s_switch_on_cons%s", prepend_term, append_term); + break; + + case _go_on_func : + fprintf(stderr, "%s_go_on_func%s", prepend_term, append_term); + break; + + case _go_on_cons : + fprintf(stderr, "%s_go_on_cons%s", prepend_term, append_term); + break; + + case _if_func : + fprintf(stderr, "%s_if_func%s", prepend_term, append_term); + break; + + case _if_cons : + fprintf(stderr, "%s_if_cons%s", prepend_term, append_term); + break; + + case _index_dbref : + fprintf(stderr, "%s_index_dbref%s", prepend_term, append_term); + break; + + case _index_blob : + fprintf(stderr, "%s_index_blob%s", prepend_term, append_term); + break; + + case _index_long : + fprintf(stderr, "%s_index_long%s", prepend_term, append_term); + break; + +#if YAP_JIT + case _jit_handler : + fprintf(stderr, "%s_jit_handler%s", prepend_term, append_term); + break; +#endif + + case _p_atom_x : + fprintf(stderr, "%s_p_atom_x%s", prepend_term, append_term); + break; + + case _p_atom_y : + fprintf(stderr, "%s_p_atom_y%s", prepend_term, append_term); + break; + + case _p_atomic_x : + fprintf(stderr, "%s_p_atomic_x%s", prepend_term, append_term); + break; + + case _p_atomic_y : + fprintf(stderr, "%s_p_atomic_y%s", prepend_term, append_term); + break; + + case _p_integer_x : + fprintf(stderr, "%s_p_integer_x%s", prepend_term, append_term); + break; + + case _p_integer_y : + fprintf(stderr, "%s_p_integer_y%s", prepend_term, append_term); + break; + + case _p_nonvar_x : + fprintf(stderr, "%s_p_nonvar_x%s", prepend_term, append_term); + break; + + case _p_nonvar_y : + fprintf(stderr, "%s_p_nonvar_y%s", prepend_term, append_term); + break; + + case _p_number_x : + fprintf(stderr, "%s_p_number_x%s", prepend_term, append_term); + break; + + case _p_number_y : + fprintf(stderr, "%s_p_number_y%s", prepend_term, append_term); + break; + + case _p_var_x : + fprintf(stderr, "%s_p_var_x%s", prepend_term, append_term); + break; + + case _p_var_y : + fprintf(stderr, "%s_p_var_y%s", prepend_term, append_term); + break; + + case _p_db_ref_x : + fprintf(stderr, "%s_p_db_ref_x%s", prepend_term, append_term); + break; + + case _p_db_ref_y : + fprintf(stderr, "%s_p_db_ref_y%s", prepend_term, append_term); + break; + + case _p_primitive_x : + fprintf(stderr, "%s_p_primitive_x%s", prepend_term, append_term); + break; + + case _p_primitive_y : + fprintf(stderr, "%s_p_primitive_y%s", prepend_term, append_term); + break; + + case _p_compound_x : + fprintf(stderr, "%s_p_compound_x%s", prepend_term, append_term); + break; + + case _p_compound_y : + fprintf(stderr, "%s_p_compound_y%s", prepend_term, append_term); + break; + + case _p_float_x : + fprintf(stderr, "%s_p_float_x%s", prepend_term, append_term); + break; + + case _p_float_y : + fprintf(stderr, "%s_p_float_y%s", prepend_term, append_term); + break; + + case _p_plus_vv : + fprintf(stderr, "%s_p_plus_vv%s", prepend_term, append_term); + break; + + case _p_plus_vc : + fprintf(stderr, "%s_p_plus_vc%s", prepend_term, append_term); + break; + + case _p_plus_y_vv : + fprintf(stderr, "%s_p_plus_y_vv%s", prepend_term, append_term); + break; + + case _p_plus_y_vc : + fprintf(stderr, "%s_p_plus_y_vc%s", prepend_term, append_term); + break; + + case _p_minus_vv : + fprintf(stderr, "%s_p_minus_vv%s", prepend_term, append_term); + break; + + case _p_minus_cv : + fprintf(stderr, "%s_p_minus_cv%s", prepend_term, append_term); + break; + + case _p_minus_y_vv : + fprintf(stderr, "%s_p_minus_y_vv%s", prepend_term, append_term); + break; + + case _p_minus_y_cv : + fprintf(stderr, "%s_p_minus_y_cv%s", prepend_term, append_term); + break; + + case _p_times_vv : + fprintf(stderr, "%s_p_times_vv%s", prepend_term, append_term); + break; + + case _p_times_vc : + fprintf(stderr, "%s_p_times_vc%s", prepend_term, append_term); + break; + + case _p_times_y_vv : + fprintf(stderr, "%s_p_times_y_vv%s", prepend_term, append_term); + break; + + case _p_times_y_vc : + fprintf(stderr, "%s_p_times_y_vc%s", prepend_term, append_term); + break; + + case _p_div_vv : + fprintf(stderr, "%s_p_div_vv%s", prepend_term, append_term); + break; + + case _p_div_vc : + fprintf(stderr, "%s_p_div_vc%s", prepend_term, append_term); + break; + + case _p_div_cv : + fprintf(stderr, "%s_p_div_cv%s", prepend_term, append_term); + break; + + case _p_div_y_vv : + fprintf(stderr, "%s_p_div_y_vv%s", prepend_term, append_term); + break; + + case _p_div_y_vc : + fprintf(stderr, "%s_p_div_y_vc%s", prepend_term, append_term); + break; + + case _p_div_y_cv : + fprintf(stderr, "%s_p_div_y_cv%s", prepend_term, append_term); + break; + + case _p_and_vv : + fprintf(stderr, "%s_p_and_vv%s", prepend_term, append_term); + break; + + case _p_and_vc : + fprintf(stderr, "%s_p_and_vc%s", prepend_term, append_term); + break; + + case _p_and_y_vv : + fprintf(stderr, "%s_p_and_y_vv%s", prepend_term, append_term); + break; + + case _p_and_y_vc : + fprintf(stderr, "%s_p_and_y_vc%s", prepend_term, append_term); + break; + + case _p_or_vv : + fprintf(stderr, "%s_p_or_vv%s", prepend_term, append_term); + break; + + case _p_or_vc : + fprintf(stderr, "%s_p_or_vc%s", prepend_term, append_term); + break; + + case _p_or_y_vv : + fprintf(stderr, "%s_p_or_y_vv%s", prepend_term, append_term); + break; + + case _p_or_y_vc : + fprintf(stderr, "%s_p_or_y_vc%s", prepend_term, append_term); + break; + + case _p_sll_vv : + fprintf(stderr, "%s_p_sll_vv%s", prepend_term, append_term); + break; + + case _p_sll_vc : + fprintf(stderr, "%s_p_sll_vc%s", prepend_term, append_term); + break; + + case _p_sll_cv : + fprintf(stderr, "%s_p_sll_cv%s", prepend_term, append_term); + break; + + case _p_sll_y_vv : + fprintf(stderr, "%s_p_sll_y_vv%s", prepend_term, append_term); + break; + + case _p_sll_y_vc : + fprintf(stderr, "%s_p_sll_y_vc%s", prepend_term, append_term); + break; + + case _p_sll_y_cv : + fprintf(stderr, "%s_p_sll_y_cv%s", prepend_term, append_term); + break; + + case _p_slr_vv : + fprintf(stderr, "%s_p_slr_vv%s", prepend_term, append_term); + break; + + case _p_slr_vc : + fprintf(stderr, "%s_p_slr_vc%s", prepend_term, append_term); + break; + + case _p_slr_cv : + fprintf(stderr, "%s_p_slr_cv%s", prepend_term, append_term); + break; + + case _p_slr_y_vv : + fprintf(stderr, "%s_p_slr_y_vv%s", prepend_term, append_term); + break; + + case _p_slr_y_vc : + fprintf(stderr, "%s_p_slr_y_vc%s", prepend_term, append_term); + break; + + case _p_slr_y_cv : + fprintf(stderr, "%s_p_slr_y_cv%s", prepend_term, append_term); + break; + + case _call_bfunc_xx : + fprintf(stderr, "%s_call_bfunc_xx%s", prepend_term, append_term); + break; + + case _call_bfunc_yx : + fprintf(stderr, "%s_call_bfunc_yx%s", prepend_term, append_term); + break; + + case _call_bfunc_xy : + fprintf(stderr, "%s_call_bfunc_xy%s", prepend_term, append_term); + break; + + case _call_bfunc_yy : + fprintf(stderr, "%s_call_bfunc_yy%s", prepend_term, append_term); + break; + + case _p_equal : + fprintf(stderr, "%s_p_equal%s", prepend_term, append_term); + break; + + case _p_dif : + fprintf(stderr, "%s_p_dif%s", prepend_term, append_term); + break; + + case _p_eq : + fprintf(stderr, "%s_p_eq%s", prepend_term, append_term); + break; + + case _p_arg_vv : + fprintf(stderr, "%s_p_arg_vv%s", prepend_term, append_term); + break; + + case _p_arg_cv : + fprintf(stderr, "%s_p_arg_cv%s", prepend_term, append_term); + break; + + case _p_arg_y_vv : + fprintf(stderr, "%s_p_arg_y_vv%s", prepend_term, append_term); + break; + + case _p_arg_y_cv : + fprintf(stderr, "%s_p_arg_y_cv%s", prepend_term, append_term); + break; + + case _p_func2s_vv : + fprintf(stderr, "%s_p_func2s_vv%s", prepend_term, append_term); + break; + + case _p_func2s_cv : + fprintf(stderr, "%s_p_func2s_cv%s", prepend_term, append_term); + break; + + case _p_func2s_vc : + fprintf(stderr, "%s_p_func2s_vc%s", prepend_term, append_term); + break; + + case _p_func2s_y_vv : + fprintf(stderr, "%s_p_func2s_y_vv%s", prepend_term, append_term); + break; + + case _p_func2s_y_cv : + fprintf(stderr, "%s_p_func2s_y_cv%s", prepend_term, append_term); + break; + + case _p_func2s_y_vc : + fprintf(stderr, "%s_p_func2s_y_vc%s", prepend_term, append_term); + break; + + case _p_func2f_xx : + fprintf(stderr, "%s_p_func2f_xx%s", prepend_term, append_term); + break; + + case _p_func2f_xy : + fprintf(stderr, "%s_p_func2f_xy%s", prepend_term, append_term); + break; + + case _p_func2f_yx : + fprintf(stderr, "%s_p_func2f_yx%s", prepend_term, append_term); + break; + + case _p_func2f_yy : + fprintf(stderr, "%s_p_func2f_yy%s", prepend_term, append_term); + break; + + case _p_functor : + fprintf(stderr, "%s_p_functor%s", prepend_term, append_term); + break; + + case _p_execute2 : + fprintf(stderr, "%s_p_execute2%s", prepend_term, append_term); + break; + + case _p_execute : + fprintf(stderr, "%s_p_execute%s", prepend_term, append_term); + break; + + case _p_execute_tail : + fprintf(stderr, "%s_p_execute_tail%s", prepend_term, append_term); + break; + +#ifdef YAPOR + case _getwork_first_time : + fprintf(stderr, "%s_getwork_first_time%s", prepend_term, append_term); + break; + + case _getwork : + fprintf(stderr, "%s_getwork%s", prepend_term, append_term); + break; + + case _getwork_seq : + fprintf(stderr, "%s_getwork_seq%s", prepend_term, append_term); + break; + + case _sync : + fprintf(stderr, "%s_sync%s", prepend_term, append_term); + break; + +#endif +#ifdef TABLING +#ifdef TABLING_INNER_CUTS + case _clause_with_cut : + fprintf(stderr, "%s_clause_with_cut%s", prepend_term, append_term); + break; + +#endif + case _table_load_answer : + fprintf(stderr, "%s_table_load_answer%s", prepend_term, append_term); + break; + + case _table_try_answer : + fprintf(stderr, "%s_table_try_answer%s", prepend_term, append_term); + break; + + case _table_try_single : + fprintf(stderr, "%s_table_try_single%s", prepend_term, append_term); + break; + + case _table_try_me : + fprintf(stderr, "%s_table_try_me%s", prepend_term, append_term); + break; + + case _table_try : + fprintf(stderr, "%s_table_try%s", prepend_term, append_term); + break; + + case _table_retry_me : + fprintf(stderr, "%s_table_retry_me%s", prepend_term, append_term); + break; + + case _table_retry : + fprintf(stderr, "%s_table_retry%s", prepend_term, append_term); + break; + + case _table_trust_me : + fprintf(stderr, "%s_table_trust_me%s", prepend_term, append_term); + break; + + case _table_trust : + fprintf(stderr, "%s_table_trust%s", prepend_term, append_term); + break; + + case _table_new_answer : + fprintf(stderr, "%s_table_new_answer%s", prepend_term, append_term); + break; + + case _table_answer_resolution : + fprintf(stderr, "%s_table_answer_resolution%s", prepend_term, append_term); + break; + + case _table_completion : + fprintf(stderr, "%s_table_completion%s", prepend_term, append_term); + break; + +#ifdef THREADS_CONSUMER_SHARING + case _table_answer_resolution_completion: + fprintf(stderr, "%s_table_answer_resolution_completion%s", prepend_term, append_term); + break; + +#endif + case _trie_do_var : + fprintf(stderr, "%s_trie_do_var%s", prepend_term, append_term); + break; + + case _trie_trust_var : + fprintf(stderr, "%s_trie_trust_var%s", prepend_term, append_term); + break; + + case _trie_try_var : + fprintf(stderr, "%s_trie_try_var%s", prepend_term, append_term); + break; + + case _trie_retry_var : + fprintf(stderr, "%s_trie_retry_var%s", prepend_term, append_term); + break; + + case _trie_do_var_in_pair : + fprintf(stderr, "%s_trie_do_var_in_pair%s", prepend_term, append_term); + break; + + case _trie_trust_var_in_pair : + fprintf(stderr, "%s_trie_trust_var_in_pair%s", prepend_term, append_term); + break; + + case _trie_try_var_in_pair : + fprintf(stderr, "%s_trie_try_var_in_pair%s", prepend_term, append_term); + break; + + case _trie_retry_var_in_pair : + fprintf(stderr, "%s_trie_retry_var_in_pair%s", prepend_term, append_term); + break; + + case _trie_do_val : + fprintf(stderr, "%s_trie_do_val%s", prepend_term, append_term); + break; + + case _trie_trust_val : + fprintf(stderr, "%s_trie_trust_val%s", prepend_term, append_term); + break; + + case _trie_try_val : + fprintf(stderr, "%s_trie_try_val%s", prepend_term, append_term); + break; + + case _trie_retry_val : + fprintf(stderr, "%s_trie_retry_val%s", prepend_term, append_term); + break; + + case _trie_do_val_in_pair : + fprintf(stderr, "%s_trie_do_val_in_pair%s", prepend_term, append_term); + break; + + case _trie_trust_val_in_pair : + fprintf(stderr, "%s_trie_trust_val_in_pair%s", prepend_term, append_term); + break; + + case _trie_try_val_in_pair : + fprintf(stderr, "%s_trie_try_val_in_pair%s", prepend_term, append_term); + break; + + case _trie_retry_val_in_pair : + fprintf(stderr, "%s_trie_retry_val_in_pair%s", prepend_term, append_term); + break; + + case _trie_do_atom : + fprintf(stderr, "%s_trie_do_atom%s", prepend_term, append_term); + break; + + case _trie_trust_atom : + fprintf(stderr, "%s_trie_trust_atom%s", prepend_term, append_term); + break; + + case _trie_try_atom : + fprintf(stderr, "%s_trie_try_atom%s", prepend_term, append_term); + break; + + case _trie_retry_atom : + fprintf(stderr, "%s_trie_retry_atom%s", prepend_term, append_term); + break; + + case _trie_do_atom_in_pair : + fprintf(stderr, "%s_trie_do_atom_in_pair%s", prepend_term, append_term); + break; + + case _trie_trust_atom_in_pair : + fprintf(stderr, "%s_trie_trust_atom_in_pair%s", prepend_term, append_term); + break; + + case _trie_try_atom_in_pair : + fprintf(stderr, "%s_trie_try_atom_in_pair%s", prepend_term, append_term); + break; + + case _trie_retry_atom_in_pair : + fprintf(stderr, "%s_trie_retry_atom_in_pair%s", prepend_term, append_term); + break; + + case _trie_do_null : + fprintf(stderr, "%s_trie_do_null%s", prepend_term, append_term); + break; + + case _trie_trust_null : + fprintf(stderr, "%s_trie_trust_null%s", prepend_term, append_term); + break; + + case _trie_try_null : + fprintf(stderr, "%s_trie_try_null%s", prepend_term, append_term); + break; + + case _trie_retry_null : + fprintf(stderr, "%s_trie_retry_null%s", prepend_term, append_term); + break; + + case _trie_do_null_in_pair : + fprintf(stderr, "%s_trie_do_null_in_pair%s", prepend_term, append_term); + break; + + case _trie_trust_null_in_pair : + fprintf(stderr, "%s_trie_trust_null_in_pair%s", prepend_term, append_term); + break; + + case _trie_try_null_in_pair : + fprintf(stderr, "%s_tri_try_null_in_paire%s", prepend_term, append_term); + break; + + case _trie_retry_null_in_pair : + fprintf(stderr, "%s_trie_retry_null_in_pair%s", prepend_term, append_term); + break; + + case _trie_do_pair : + fprintf(stderr, "%s_trie_do_pair%s", prepend_term, append_term); + break; + + case _trie_trust_pair : + fprintf(stderr, "%s_trie_trust_pair%s", prepend_term, append_term); + break; + + case _trie_try_pair : + fprintf(stderr, "%s_trie_try_pair%s", prepend_term, append_term); + break; + + case _trie_retry_pair : + fprintf(stderr, "%s_trie_retry_pair%s", prepend_term, append_term); + break; + + case _trie_do_appl : + fprintf(stderr, "%s_trie_do_appl%s", prepend_term, append_term); + break; + + case _trie_trust_appl : + fprintf(stderr, "%s_trie_trust_appl%s", prepend_term, append_term); + break; + + case _trie_try_appl : + fprintf(stderr, "%s_trie_try_appl%s", prepend_term, append_term); + break; + + case _trie_retry_appl : + fprintf(stderr, "%s_trie_retry_appl%s", prepend_term, append_term); + break; + + case _trie_do_appl_in_pair : + fprintf(stderr, "%s_trie_do_appl_in_pair%s", prepend_term, append_term); + break; + + case _trie_trust_appl_in_pair : + fprintf(stderr, "%s_trie_trust_appl_in_pair%s", prepend_term, append_term); + break; + + case _trie_try_appl_in_pair : + fprintf(stderr, "%s_trie_trty_appkl_in_pair%s", prepend_term, append_term); + break; + + case _trie_retry_appl_in_pair : + fprintf(stderr, "%s_trie_retry_appl_in_pair%s", prepend_term, append_term); + break; + + case _trie_do_extension : + fprintf(stderr, "%s_trie_do_extension%s", prepend_term, append_term); + break; + + case _trie_trust_extension : + fprintf(stderr, "%s_trie_trust_extension%s", prepend_term, append_term); + break; + + case _trie_try_extension : + fprintf(stderr, "%s_trie_try_extension%s", prepend_term, append_term); + break; + + case _trie_retry_extension : + fprintf(stderr, "%s_trie_retry_extension%s", prepend_term, append_term); + break; + + case _trie_do_double : + fprintf(stderr, "%s_trie_do_double%s", prepend_term, append_term); + break; + + case _trie_trust_double : + fprintf(stderr, "%s_trie_trust_double%s", prepend_term, append_term); + break; + + case _trie_try_double : + fprintf(stderr, "%s_trie_try_double%s", prepend_term, append_term); + break; + + case _trie_retry_double : + fprintf(stderr, "%s_trie_retry_double%s", prepend_term, append_term); + break; + + case _trie_do_longint : + fprintf(stderr, "%s_trie_do_longint%s", prepend_term, append_term); + break; + + case _trie_trust_longint : + fprintf(stderr, "%s_trie_trust_longint%s", prepend_term, append_term); + break; + + case _trie_try_longint : + fprintf(stderr, "%s_trie_try_longint%s", prepend_term, append_term); + break; + + case _trie_retry_longint : + fprintf(stderr, "%s_trie_retry_longint%s", prepend_term, append_term); + break; + + case _trie_do_gterm : + fprintf(stderr, "%s_trie_do_gterm%s", prepend_term, append_term); + break; + + case _trie_trust_gterm : + fprintf(stderr, "%s_trie_trust_gterm%s", prepend_term, append_term); + break; + + case _trie_try_gterm : + fprintf(stderr, "%s_trie_try_gterm%s", prepend_term, append_term); + break; + + case _trie_retry_gterm : + fprintf(stderr, "%s_trie_retry_gterm%s", prepend_term, append_term); + break; + +#endif + /* this instruction is hardwired */ +#ifdef YAPOR + case _or_last : + fprintf(stderr, "%s_or_last%s", prepend_term, append_term); + break; + +#else + case _or_last : + fprintf(stderr, "%s_or_last%s", prepend_term, append_term); + break; + +#endif +#if YAP_JIT + case _traced_Ystop : + fprintf(stderr, "%s_traced_Ystop%s", prepend_term, append_term); + break; + + case _traced_Nstop : + fprintf(stderr, "%s_traced_Nstop%s", prepend_term, append_term); + break; + + case _traced_try_me : + fprintf(stderr, "%s_traced_try_me%s", prepend_term, append_term); + break; + + case _traced_retry_me : + fprintf(stderr, "%s_traced_retry_me%s", prepend_term, append_term); + break; + + case _traced_trust_me : + fprintf(stderr, "%s_traced_trust_me%s", prepend_term, append_term); + break; + + case _traced_enter_profiling : + fprintf(stderr, "%s_traced_enter_profiling%s", prepend_term, append_term); + break; + + case _traced_retry_profiled : + fprintf(stderr, "%s_traced_retry_profiled%s", prepend_term, append_term); + break; + + case _traced_profiled_retry_me : + fprintf(stderr, "%s_traced_profiled_retry_me%s", prepend_term, append_term); + break; + + case _traced_profiled_trust_me : + fprintf(stderr, "%s_traced_profiled_trust_me%s", prepend_term, append_term); + break; + + case _traced_profiled_retry_logical : + fprintf(stderr, "%s_traced_profiled_retry_logical%s", prepend_term, append_term); + break; + + case _traced_profiled_trust_logical : + fprintf(stderr, "%s_traced_profiled_trust_logical%s", prepend_term, append_term); + break; + + case _traced_count_call : + fprintf(stderr, "%s_traced_count_call%s", prepend_term, append_term); + break; + + case _traced_count_retry : + fprintf(stderr, "%s_traced_count_retry%s", prepend_term, append_term); + break; + + case _traced_count_retry_me : + fprintf(stderr, "%s_traced_count_retry_me%s", prepend_term, append_term); + break; + + case _traced_count_trust_me : + fprintf(stderr, "%s_traced_count_trust_me%s", prepend_term, append_term); + break; + + case _traced_count_retry_logical : + fprintf(stderr, "%s_traced_count_retry_logical%s", prepend_term, append_term); + break; + + case _traced_count_trust_logical : + fprintf(stderr, "%s_traced_count_trust_logical%s", prepend_term, append_term); + break; + + case _traced_lock_lu : + fprintf(stderr, "%s_traced_lock_lu%s", prepend_term, append_term); + break; + + case _traced_unlock_lu : + fprintf(stderr, "%s_traced_unlock_lu%s", prepend_term, append_term); + break; + + case _traced_alloc_for_logical_pred : + fprintf(stderr, "%s_traced_alloc_for_logical_pred%s", prepend_term, append_term); + break; + + case _traced_copy_idb_term : + fprintf(stderr, "%s_traced_copy_idb_term%s", prepend_term, append_term); + break; + + case _traced_unify_idb_term : + fprintf(stderr, "%s_traced_unify_idb_term%s", prepend_term, append_term); + break; + + case _traced_ensure_space : + fprintf(stderr, "%s_traced_ensure_space%s", prepend_term, append_term); + break; + + case _traced_spy_or_trymark : + fprintf(stderr, "%s_traced_spy_or_trymark%s", prepend_term, append_term); + break; + + case _traced_try_and_mark : + fprintf(stderr, "%s_traced_try_and_mark%s", prepend_term, append_term); + break; + + case _traced_count_retry_and_mark : + fprintf(stderr, "%s_traced_count_retry_and_mark%s", prepend_term, append_term); + break; + + case _traced_profiled_retry_and_mark : + fprintf(stderr, "%s_traced_profiled_retry_and_mark%s", prepend_term, append_term); + break; + + case _traced_retry_and_mark : + fprintf(stderr, "%s_traced_retry_and_mark%s", prepend_term, append_term); + break; + + case _traced_trust_fail : + fprintf(stderr, "%s_traced_trust_fail%s", prepend_term, append_term); + break; + + case _traced_op_fail : + fprintf(stderr, "%s_traced_op_fail%s", prepend_term, append_term); + break; + + case _traced_cut : + fprintf(stderr, "%s_traced_cut%s", prepend_term, append_term); + break; + + case _traced_cut_t : + fprintf(stderr, "%s_traced_cut_t%s", prepend_term, append_term); + break; + + case _traced_cut_e : + fprintf(stderr, "%s_traced_cut_e%s", prepend_term, append_term); + break; + + case _traced_save_b_x : + fprintf(stderr, "%s_traced_save_b_x%s", prepend_term, append_term); + break; + + case _traced_save_b_y : + fprintf(stderr, "%s_traced_save_b_y%s", prepend_term, append_term); + break; + + case _traced_commit_b_x : + fprintf(stderr, "%s_traced_commit_b_x%s", prepend_term, append_term); + break; + + case _traced_commit_b_y : + fprintf(stderr, "%s_traced_commit_b_y%s", prepend_term, append_term); + break; + + case _traced_execute : + fprintf(stderr, "%s_traced_execute%s", prepend_term, append_term); + break; + + case _traced_dexecute : + fprintf(stderr, "%s_traced_dexecute%s", prepend_term, append_term); + break; + + case _traced_fcall : + fprintf(stderr, "%s_traced_fcall%s", prepend_term, append_term); + break; + + case _traced_call : + fprintf(stderr, "%s_traced_call%s", prepend_term, append_term); + break; + + case _traced_procceed : + fprintf(stderr, "%s_traced_procceed%s", prepend_term, append_term); + break; + + case _traced_allocate : + fprintf(stderr, "%s_traced_allocate%s", prepend_term, append_term); + break; + + case _traced_deallocate : + fprintf(stderr, "%s_traced_deallocate%s", prepend_term, append_term); + break; + +#ifdef BEAM + case _traced_retry_eam : + fprintf(stderr, "%s_traced_retry_eam%s", prepend_term, append_term); + break; + +#endif +#ifdef BEAM + case _traced_run_eam : + fprintf(stderr, "%s_traced_run_eam%s", prepend_term, append_term); + break; + +#endif + case _traced_get_x_var : + fprintf(stderr, "%s_traced_get_x_var%s", prepend_term, append_term); + break; + + case _traced_get_y_var : + fprintf(stderr, "%s_traced_get_y_var%s", prepend_term, append_term); + break; + + case _traced_get_yy_var : + fprintf(stderr, "%s_traced_get_yy_var%s", prepend_term, append_term); + break; + + case _traced_get_x_val : + fprintf(stderr, "%s_traced_get_x_val%s", prepend_term, append_term); + break; + + case _traced_get_y_val : + fprintf(stderr, "%s_traced_get_y_val%s", prepend_term, append_term); + break; + + case _traced_get_atom : + fprintf(stderr, "%s_traced_get_atom%s", prepend_term, append_term); + break; + + case _traced_get_2atoms : + fprintf(stderr, "%s_traced_get_2atoms%s", prepend_term, append_term); + break; + + case _traced_get_3atoms : + fprintf(stderr, "%s_traced_get_3atoms%s", prepend_term, append_term); + break; + + case _traced_get_4atoms : + fprintf(stderr, "%s_traced_get_4atoms%s", prepend_term, append_term); + break; + + case _traced_get_5atoms : + fprintf(stderr, "%s_traced_get_5atoms%s", prepend_term, append_term); + break; + + case _traced_get_6atoms : + fprintf(stderr, "%s_traced_get_6atoms%s", prepend_term, append_term); + break; + + case _traced_get_list : + fprintf(stderr, "%s_traced_get_list%s", prepend_term, append_term); + break; + + case _traced_get_struct : + fprintf(stderr, "%s_traced_get_struct%s", prepend_term, append_term); + break; + + case _traced_get_float : + fprintf(stderr, "%s_traced_get_float%s", prepend_term, append_term); + break; + + case _traced_get_longint : + fprintf(stderr, "%s_traced_get_longint%s", prepend_term, append_term); + break; + + case _traced_get_bigint : + fprintf(stderr, "%s_traced_get_bigint%s", prepend_term, append_term); + break; + + case _traced_get_dbterm : + fprintf(stderr, "%s_traced_get_dbterm%s", prepend_term, append_term); + break; + + case _traced_glist_valx : + fprintf(stderr, "%s_traced_glist_valx%s", prepend_term, append_term); + break; + + case _traced_glist_valy : + fprintf(stderr, "%s_traced_glist_valy%s", prepend_term, append_term); + break; + + case _traced_gl_void_varx : + fprintf(stderr, "%s_traced_gl_void_varx%s", prepend_term, append_term); + break; + + case _traced_gl_void_vary : + fprintf(stderr, "%s_traced_gl_void_vary%s", prepend_term, append_term); + break; + + case _traced_gl_void_valx : + fprintf(stderr, "%s_traced_gl_void_valx%s", prepend_term, append_term); + break; + + case _traced_gl_void_valy : + fprintf(stderr, "%s_traced_gl_void_valy%s", prepend_term, append_term); + break; + + case _traced_unify_x_var : + fprintf(stderr, "%s_traced_unify_x_var%s", prepend_term, append_term); + break; + + case _traced_unify_x_var_write : + fprintf(stderr, "%s_traced_unify_x_var_write%s", prepend_term, append_term); + break; + + case _traced_unify_l_x_var : + fprintf(stderr, "%s_traced_unify_l_x_var%s", prepend_term, append_term); + break; + + case _traced_unify_l_x_var_write : + fprintf(stderr, "%s_traced_unify_l_x_var_write%s", prepend_term, append_term); + break; + + case _traced_unify_x_var2 : + fprintf(stderr, "%s_traced_unify_x_var2%s", prepend_term, append_term); + break; + + case _traced_unify_x_var2_write : + fprintf(stderr, "%s_traced_unify_x_var2_write%s", prepend_term, append_term); + break; + + case _traced_unify_l_x_var2 : + fprintf(stderr, "%s_traced_unify_l_x_var2%s", prepend_term, append_term); + break; + + case _traced_unify_l_x_var2_write : + fprintf(stderr, "%s_traced_unify_l_x_var2_write%s", prepend_term, append_term); + break; + + case _traced_unify_y_var : + fprintf(stderr, "%s_traced_unify_y_var%s", prepend_term, append_term); + break; + + case _traced_unify_y_var_write : + fprintf(stderr, "%s_traced_unify_y_var_write%s", prepend_term, append_term); + break; + + case _traced_unify_l_y_var : + fprintf(stderr, "%s_traced_unify_l_y_var%s", prepend_term, append_term); + break; + + case _traced_unify_l_y_var_write : + fprintf(stderr, "%s_traced_unify_l_y_var_write%s", prepend_term, append_term); + break; + + case _traced_unify_x_val : + fprintf(stderr, "%s_traced_unify_x_val%s", prepend_term, append_term); + break; + + case _traced_unify_x_val_write : + fprintf(stderr, "%s_traced_unify_x_val_write%s", prepend_term, append_term); + break; + + case _traced_unify_l_x_val : + fprintf(stderr, "%s_traced_unify_l_x_val%s", prepend_term, append_term); + break; + + case _traced_unify_l_x_val_write : + fprintf(stderr, "%s_traced_uify_l_x_val_write%s", prepend_term, append_term); + break; + + case _traced_unify_y_val : + fprintf(stderr, "%s_traced_unify_y_val%s", prepend_term, append_term); + break; + + case _traced_unify_y_val_write : + fprintf(stderr, "%s_traced_unify_y_val_write%s", prepend_term, append_term); + break; + + case _traced_unify_l_y_val : + fprintf(stderr, "%s_traced_unify_l_y_val%s", prepend_term, append_term); + break; + + case _traced_unify_l_y_val_write : + fprintf(stderr, "%s_traced_unify_l_y_val_write%s", prepend_term, append_term); + break; + + case _traced_unify_x_loc : + fprintf(stderr, "%s_traced_unify_x_loc%s", prepend_term, append_term); + break; + + case _traced_unify_x_loc_write : + fprintf(stderr, "%s_traced_unify_x_loc_write%s", prepend_term, append_term); + break; + + case _traced_unify_l_x_loc : + fprintf(stderr, "%s_traced_unify_l_x_loc%s", prepend_term, append_term); + break; + + case _traced_unify_l_x_loc_write : + fprintf(stderr, "%s_traced_unify_l_x_loc_write%s", prepend_term, append_term); + break; + + case _traced_unify_y_loc : + fprintf(stderr, "%s_traced_unify_y_loc%s", prepend_term, append_term); + break; + + case _traced_unify_y_loc_write : + fprintf(stderr, "%s_traced_unify_y_loc_write%s", prepend_term, append_term); + break; + + case _traced_unify_l_y_loc : + fprintf(stderr, "%s_traced_unify_l_y_loc%s", prepend_term, append_term); + break; + + case _traced_unify_l_y_loc_write : + fprintf(stderr, "%s_traced_unify_l_y_loc_write%s", prepend_term, append_term); + break; + + case _traced_unify_void : + fprintf(stderr, "%s_traced_unify_void%s", prepend_term, append_term); + break; + + case _traced_unify_void_write : + fprintf(stderr, "%s_traced_unify_void_write%s", prepend_term, append_term); + break; + + case _traced_unify_l_void : + fprintf(stderr, "%s_traced_unify_l_void%s", prepend_term, append_term); + break; + + case _traced_unify_l_void_write : + fprintf(stderr, "%s_traced_unify_l_void_write%s", prepend_term, append_term); + break; + + case _traced_unify_n_voids : + fprintf(stderr, "%s_traced_unify_n_voids%s", prepend_term, append_term); + break; + + case _traced_unify_n_voids_write : + fprintf(stderr, "%s_traced_unify_n_voids_write%s", prepend_term, append_term); + break; + + case _traced_unify_l_n_voids : + fprintf(stderr, "%s_traced_unify_l_n_voids%s", prepend_term, append_term); + break; + + case _traced_unify_l_n_voids_write : + fprintf(stderr, "%s_traced_unify_l_n_voids_write%s", prepend_term, append_term); + break; + + case _traced_unify_atom : + fprintf(stderr, "%s_traced_unify_atom%s", prepend_term, append_term); + break; + + case _traced_unify_atom_write : + fprintf(stderr, "%s_traced_unify_atom_write%s", prepend_term, append_term); + break; + + case _traced_unify_l_atom : + fprintf(stderr, "%s_traced_unify_l_atom%s", prepend_term, append_term); + break; + + case _traced_unify_l_atom_write : + fprintf(stderr, "%s_traced_unify_l_atom_write%s", prepend_term, append_term); + break; + + case _traced_unify_n_atoms : + fprintf(stderr, "%s_traced_unify_n_atoms%s", prepend_term, append_term); + break; + + case _traced_unify_n_atoms_write : + fprintf(stderr, "%s_traced_unify_n_atoms_write%s", prepend_term, append_term); + break; + + case _traced_unify_float : + fprintf(stderr, "%s_traced_unify_float%s", prepend_term, append_term); + break; + + case _traced_unify_float_write : + fprintf(stderr, "%s_traced_unify_float_write%s", prepend_term, append_term); + break; + + case _traced_unify_l_float : + fprintf(stderr, "%s_traced_unify_l_float%s", prepend_term, append_term); + break; + + case _traced_unify_l_float_write : + fprintf(stderr, "%s_traced_unify_l_float_write%s", prepend_term, append_term); + break; + + case _traced_unify_longint : + fprintf(stderr, "%s_traced_unify_longint%s", prepend_term, append_term); + break; + + case _traced_unify_longint_write : + fprintf(stderr, "%s_traced_unify_longint_write%s", prepend_term, append_term); + break; + + case _traced_unify_l_longint : + fprintf(stderr, "%s_traced_unify_l_longint%s", prepend_term, append_term); + break; + + case _traced_unify_l_longint_write : + fprintf(stderr, "%s_traced_unify_l_longint_write%s", prepend_term, append_term); + break; + + case _traced_unify_bigint : + fprintf(stderr, "%s_traced_unify_bigint%s", prepend_term, append_term); + break; + + case _traced_unify_l_bigint : + fprintf(stderr, "%s_traced_unify_l_bigint%s", prepend_term, append_term); + break; + + case _traced_unify_dbterm : + fprintf(stderr, "%s_traced_unify_dbterm%s", prepend_term, append_term); + break; + + case _traced_unify_l_dbterm : + fprintf(stderr, "%s_traced_unify_l_dbterm%s", prepend_term, append_term); + break; + + case _traced_unify_list : + fprintf(stderr, "%s_traced_unify_list%s", prepend_term, append_term); + break; + + case _traced_unify_list_write : + fprintf(stderr, "%s_traced_unify_list_write%s", prepend_term, append_term); + break; + + case _traced_unify_l_list : + fprintf(stderr, "%s_traced_unify_l_list%s", prepend_term, append_term); + break; + + case _traced_unify_l_list_write : + fprintf(stderr, "%s_traced_unify_l_list_write%s", prepend_term, append_term); + break; + + case _traced_unify_struct : + fprintf(stderr, "%s_traced_unify_struct%s", prepend_term, append_term); + break; + + case _traced_unify_struct_write : + fprintf(stderr, "%s_traced_unify_struct_write%s", prepend_term, append_term); + break; + + case _traced_unify_l_struc : + fprintf(stderr, "%s_traced_unify_l_struc%s", prepend_term, append_term); + break; + + case _traced_unify_l_struc_write : + fprintf(stderr, "%s_traced_unify_l_struc_write%s", prepend_term, append_term); + break; + + case _traced_put_x_var : + fprintf(stderr, "%s_traced_put_x_var%s", prepend_term, append_term); + break; + + case _traced_put_y_var : + fprintf(stderr, "%s_traced_put_y_var%s", prepend_term, append_term); + break; + + case _traced_put_x_val : + fprintf(stderr, "%s_traced_put_x_val%s", prepend_term, append_term); + break; + + case _traced_put_xx_val : + fprintf(stderr, "%s_traced_put_xx_val%s", prepend_term, append_term); + break; + + case _traced_put_y_val : + fprintf(stderr, "%s_traced_put_y_val%s", prepend_term, append_term); + break; + + case _traced_put_y_vals : + fprintf(stderr, "%s_traced_put_y_vals%s", prepend_term, append_term); + break; + + case _traced_put_unsafe : + fprintf(stderr, "%s_traced_put_unsafe%s", prepend_term, append_term); + break; + + case _traced_put_atom : + fprintf(stderr, "%s_traced_put_atom%s", prepend_term, append_term); + break; + + case _traced_put_dbterm : + fprintf(stderr, "%s_traced_put_dbterm%s", prepend_term, append_term); + break; + + case _traced_put_bigint : + fprintf(stderr, "%s_traced_put_bigint%s", prepend_term, append_term); + break; + + case _traced_put_float : + fprintf(stderr, "%s_traced_put_float%s", prepend_term, append_term); + break; + + case _traced_put_longint : + fprintf(stderr, "%s_traced_put_longint%s", prepend_term, append_term); + break; + + case _traced_put_list : + fprintf(stderr, "%s_traced_put_list%s", prepend_term, append_term); + break; + + case _traced_put_struct : + fprintf(stderr, "%s_traced_put_struct%s", prepend_term, append_term); + break; + + case _traced_write_x_var : + fprintf(stderr, "%s_traced_write_x_var%s", prepend_term, append_term); + break; + + case _traced_write_void : + fprintf(stderr, "%s_traced_write_void%s", prepend_term, append_term); + break; + + case _traced_write_n_voids : + fprintf(stderr, "%s_traced_write_n_voids%s", prepend_term, append_term); + break; + + case _traced_write_y_var : + fprintf(stderr, "%s_traced_write_y_var%s", prepend_term, append_term); + break; + + case _traced_write_x_val : + fprintf(stderr, "%s_traced_write_x_val%s", prepend_term, append_term); + break; + + case _traced_write_x_loc : + fprintf(stderr, "%s_traced_write_x_loc%s", prepend_term, append_term); + break; + + case _traced_write_y_val : + fprintf(stderr, "%s_traced_write_y_val%s", prepend_term, append_term); + break; + + case _traced_write_y_loc : + fprintf(stderr, "%s_traced_write_y_loc%s", prepend_term, append_term); + break; + + case _traced_write_atom : + fprintf(stderr, "%s_traced_write_atom%s", prepend_term, append_term); + break; + + case _traced_write_bigint : + fprintf(stderr, "%s_traced_write_bigint%s", prepend_term, append_term); + break; + + case _traced_write_dbterm : + fprintf(stderr, "%s_traced_write_dbterm%s", prepend_term, append_term); + break; + + case _traced_write_float : + fprintf(stderr, "%s_traced_write_float%s", prepend_term, append_term); + break; + + case _traced_write_longint : + fprintf(stderr, "%s_traced_write_longint%s", prepend_term, append_term); + break; + + case _traced_write_n_atoms : + fprintf(stderr, "%s_traced_write_n_atoms%s", prepend_term, append_term); + break; + + case _traced_write_list : + fprintf(stderr, "%s_traced_write_list%s", prepend_term, append_term); + break; + + case _traced_write_l_list : + fprintf(stderr, "%s_traced_write_l_list%s", prepend_term, append_term); + break; + + case _traced_write_struct : + fprintf(stderr, "%s_traced_write_struct%s", prepend_term, append_term); + break; + + case _traced_write_l_struc : + fprintf(stderr, "%s_traced_write_l_struc%s", prepend_term, append_term); + break; + + case _traced_save_pair_x : + fprintf(stderr, "%s_traced_save_pair_x%s", prepend_term, append_term); + break; + + case _traced_save_pair_x_write : + fprintf(stderr, "%s_traced_save_pair_x_write%s", prepend_term, append_term); + break; + + case _traced_save_pair_y : + fprintf(stderr, "%s_traced_save_pair_y%s", prepend_term, append_term); + break; + + case _traced_save_pair_y_write : + fprintf(stderr, "%s_traced_save_pair_y_write%s", prepend_term, append_term); + break; + + case _traced_save_appl_x : + fprintf(stderr, "%s_traced_save_appl_x%s", prepend_term, append_term); + break; + + case _traced_save_appl_x_write : + fprintf(stderr, "%s_traced_save_appl_x_write%s", prepend_term, append_term); + break; + + case _traced_save_appl_y : + fprintf(stderr, "%s_traced_save_appl_y%s", prepend_term, append_term); + break; + + case _traced_save_appl_y_write : + fprintf(stderr, "%s_traced_save_appl_y_write%s", prepend_term, append_term); + break; + + case _traced_jump : + fprintf(stderr, "%s_traced_jump%s", prepend_term, append_term); + break; + + case _traced_move_back : + fprintf(stderr, "%s_traced_move_back%s", prepend_term, append_term); + break; + + case _traced_skip : + fprintf(stderr, "%s_traced_skip%s", prepend_term, append_term); + break; + + case _traced_either : + fprintf(stderr, "%s_traced_either%s", prepend_term, append_term); + break; + + case _traced_or_else : + fprintf(stderr, "%s_traced_or_else%s", prepend_term, append_term); + break; + + case _traced_pop_n : + fprintf(stderr, "%s_traced_pop_n%s", prepend_term, append_term); + break; + + case _traced_pop : + fprintf(stderr, "%s_traced_pop%s", prepend_term, append_term); + break; + + case _traced_call_cpred : + fprintf(stderr, "%s_traced_call_cpred%s", prepend_term, append_term); + break; + + case _traced_execute_cpred : + fprintf(stderr, "%s_traced_execute_cpred%s", prepend_term, append_term); + break; + + case _traced_call_usercpred : + fprintf(stderr, "%s_traced_call_usercpred%s", prepend_term, append_term); + break; + + case _traced_call_c_wfail : + fprintf(stderr, "%s_traced_call_x_wfail%s", prepend_term, append_term); + break; + + case _traced_try_c : + fprintf(stderr, "%s_traced_try_c%s", prepend_term, append_term); + break; + + case _traced_retry_c : + fprintf(stderr, "%s_traced_retry_c%s", prepend_term, append_term); + break; + +#ifdef CUT_C + case _traced_cut_c : + fprintf(stderr, "%s_traced_cut_c%s", prepend_term, append_term); + break; + +#endif + case _traced_try_userc : + fprintf(stderr, "%s_traced_try_userc%s", prepend_term, append_term); + break; + + case _traced_retry_userc : + fprintf(stderr, "%s_traced_retry_userc%s", prepend_term, append_term); + break; + +#ifdef CUT_C + case _traced_cut_userc : + fprintf(stderr, "%s_traced_cut_userc%s", prepend_term, append_term); + break; + +#endif + case _traced_lock_pred : + fprintf(stderr, "%s_traced_lock_pred%s", prepend_term, append_term); + break; + + case _traced_index_pred : + fprintf(stderr, "%s_traced_index_pred%s", prepend_term, append_term); + break; + +#ifdef THREADS + case _traced_thread_local : + fprintf(stderr, "%s_traced_thread_local%s", prepend_term, append_term); + break; + +#endif + case _traced_expand_index : + fprintf(stderr, "%s_traced_expand_index%s", prepend_term, append_term); + break; + + case _traced_expand_clauses : + fprintf(stderr, "%s_traced_expand_clauses%s", prepend_term, append_term); + break; + + case _traced_undef_p : + fprintf(stderr, "%s_traced_undef_p%s", prepend_term, append_term); + break; + + case _traced_spy_pred : + fprintf(stderr, "%s_traced_spy_pred%s", prepend_term, append_term); + break; + + case _traced_try_clause : + fprintf(stderr, "%s_traced_try_clause%s", prepend_term, append_term); + break; + + case _traced_try_clause2 : + fprintf(stderr, "%s_traced_try_clause2%s", prepend_term, append_term); + break; + + case _traced_try_clause3 : + fprintf(stderr, "%s_traced_try_clause3%s", prepend_term, append_term); + break; + + case _traced_try_clause4 : + fprintf(stderr, "%s_traced_try_clause4%s", prepend_term, append_term); + break; + + case _traced_retry : + fprintf(stderr, "%s_traced_retry%s", prepend_term, append_term); + break; + + case _traced_retry2 : + fprintf(stderr, "%s_traced_retry2%s", prepend_term, append_term); + break; + + case _traced_retry3 : + fprintf(stderr, "%s_traced_retry3%s", prepend_term, append_term); + break; + + case _traced_retry4 : + fprintf(stderr, "%s_traced_retry4%s", prepend_term, append_term); + break; + + case _traced_trust : + fprintf(stderr, "%s_traced_trust%s", prepend_term, append_term); + break; + + case _traced_try_in : + fprintf(stderr, "%s_traced_try_in%s", prepend_term, append_term); + break; + + case _traced_enter_lu_pred : + fprintf(stderr, "%s_traced_enter_lu_pred%s", prepend_term, append_term); + break; + + case _traced_try_logical : + fprintf(stderr, "%s_traced_try_logical%s", prepend_term, append_term); + break; + + case _traced_retry_logical : + fprintf(stderr, "%s_traced_retry_logical%s", prepend_term, append_term); + break; + + case _traced_trust_logical : + fprintf(stderr, "%s_traced_trust_logical%s", prepend_term, append_term); + break; + + case _traced_user_switch : + fprintf(stderr, "%s_traced_user_switch%s", prepend_term, append_term); + break; + + case _traced_switch_on_type : + fprintf(stderr, "%s_traced_switch_on_type%s", prepend_term, append_term); + break; + + case _traced_switch_list_nl : + fprintf(stderr, "%s_traced_switch_list_nl%s", prepend_term, append_term); + break; + + case _traced_switch_on_arg_type : + fprintf(stderr, "%s_traced_switch_on_arg_type%s", prepend_term, append_term); + break; + + case _traced_switch_on_sub_arg_type : + fprintf(stderr, "%s_traced_switch_on_sub_arg_type%s", prepend_term, append_term); + break; + + case _traced_jump_if_var : + fprintf(stderr, "%s_traced_jump_if_var%s", prepend_term, append_term); + break; + + case _traced_jump_if_nonvar : + fprintf(stderr, "%s_traced_jump_if_nonvar%s", prepend_term, append_term); + break; + + case _traced_if_not_then : + fprintf(stderr, "%s_traced_if_not_then%s", prepend_term, append_term); + break; + + case _traced_switch_on_func : + fprintf(stderr, "%s_traced_switch_on_func%s", prepend_term, append_term); + break; + + case _traced_switch_on_cons : + fprintf(stderr, "%s_traced_switch_on_cons%s", prepend_term, append_term); + break; + + case _traced_go_on_func : + fprintf(stderr, "%s_traced_go_on_func%s", prepend_term, append_term); + break; + + case _traced_go_on_cons : + fprintf(stderr, "%s_traced_go_on_cons%s", prepend_term, append_term); + break; + + case _traced_if_func : + fprintf(stderr, "%s_traced_if_func%s", prepend_term, append_term); + break; + + case _traced_if_cons : + fprintf(stderr, "%s_traced_if_cons%s", prepend_term, append_term); + break; + + case _traced_index_dbref : + fprintf(stderr, "%s_traced_index_dbref%s", prepend_term, append_term); + break; + + case _traced_index_blob : + fprintf(stderr, "%s_traced_index_blob%s", prepend_term, append_term); + break; + + case _traced_index_long : + fprintf(stderr, "%s_traced_index_long%s", prepend_term, append_term); + break; + + case _traced_jit_handler : + fprintf(stderr, "%s_traced_jit_handler%s", prepend_term, append_term); + break; + + case _traced_p_atom_x : + fprintf(stderr, "%s_traced_p_atom_x%s", prepend_term, append_term); + break; + + case _traced_p_atom_y : + fprintf(stderr, "%s_traced_p_atom_y%s", prepend_term, append_term); + break; + + case _traced_p_atomic_x : + fprintf(stderr, "%s_traced_p_atomic_x%s", prepend_term, append_term); + break; + + case _traced_p_atomic_y : + fprintf(stderr, "%s_traced_p_atomic_y%s", prepend_term, append_term); + break; + + case _traced_p_integer_x : + fprintf(stderr, "%s_traced_p_integer_x%s", prepend_term, append_term); + break; + + case _traced_p_integer_y : + fprintf(stderr, "%s_traced_p_integer_y%s", prepend_term, append_term); + break; + + case _traced_p_nonvar_x : + fprintf(stderr, "%s_traced_p_nonvar_x%s", prepend_term, append_term); + break; + + case _traced_p_nonvar_y : + fprintf(stderr, "%s_traced_p_nonvar_y%s", prepend_term, append_term); + break; + + case _traced_p_number_x : + fprintf(stderr, "%s_traced_p_number_x%s", prepend_term, append_term); + break; + + case _traced_p_number_y : + fprintf(stderr, "%s_traced_p_number_y%s", prepend_term, append_term); + break; + + case _traced_p_var_x : + fprintf(stderr, "%s_traced_p_var_x%s", prepend_term, append_term); + break; + + case _traced_p_var_y : + fprintf(stderr, "%s_traced_p_var_y%s", prepend_term, append_term); + break; + + case _traced_p_db_ref_x : + fprintf(stderr, "%s_traced_p_db_ref_x%s", prepend_term, append_term); + break; + + case _traced_p_db_ref_y : + fprintf(stderr, "%s_traced_p_db_ref_y%s", prepend_term, append_term); + break; + + case _traced_p_primitive_x : + fprintf(stderr, "%s_traced_p_primitive_x%s", prepend_term, append_term); + break; + + case _traced_p_primitive_y : + fprintf(stderr, "%s_traced_p_primitive_y%s", prepend_term, append_term); + break; + + case _traced_p_compound_x : + fprintf(stderr, "%s_traced_p_compound_x%s", prepend_term, append_term); + break; + + case _traced_p_compound_y : + fprintf(stderr, "%s_traced_p_compound_y%s", prepend_term, append_term); + break; + + case _traced_p_float_x : + fprintf(stderr, "%s_traced_p_float_x%s", prepend_term, append_term); + break; + + case _traced_p_float_y : + fprintf(stderr, "%s_traced_p_float_y%s", prepend_term, append_term); + break; + + case _traced_p_plus_vv : + fprintf(stderr, "%s_traced_p_plus_vv%s", prepend_term, append_term); + break; + + case _traced_p_plus_vc : + fprintf(stderr, "%s_traced_p_plus_vc%s", prepend_term, append_term); + break; + + case _traced_p_plus_y_vv : + fprintf(stderr, "%s_traced_p_plus_y_vv%s", prepend_term, append_term); + break; + + case _traced_p_plus_y_vc : + fprintf(stderr, "%s_traced_p_plus_y_vc%s", prepend_term, append_term); + break; + + case _traced_p_minus_vv : + fprintf(stderr, "%s_traced_p_minus_vv%s", prepend_term, append_term); + break; + + case _traced_p_minus_cv : + fprintf(stderr, "%s_traced_p_minus_cv%s", prepend_term, append_term); + break; + + case _traced_p_minus_y_vv : + fprintf(stderr, "%s_traced_p_minus_y_vv%s", prepend_term, append_term); + break; + + case _traced_p_minus_y_cv : + fprintf(stderr, "%s_traced_p_minus_y_cv%s", prepend_term, append_term); + break; + + case _traced_p_times_vv : + fprintf(stderr, "%s_traced_p_times_vv%s", prepend_term, append_term); + break; + + case _traced_p_times_vc : + fprintf(stderr, "%s_traced_p_times_vc%s", prepend_term, append_term); + break; + + case _traced_p_times_y_vv : + fprintf(stderr, "%s_traced_p_times_y_vv%s", prepend_term, append_term); + break; + + case _traced_p_times_y_vc : + fprintf(stderr, "%s_traced_p_times_y_vc%s", prepend_term, append_term); + break; + + case _traced_p_div_vv : + fprintf(stderr, "%s_traced_p_div_vv%s", prepend_term, append_term); + break; + + case _traced_p_div_vc : + fprintf(stderr, "%s_traced_p_div_vc%s", prepend_term, append_term); + break; + + case _traced_p_div_cv : + fprintf(stderr, "%s_traced_p_div_cv%s", prepend_term, append_term); + break; + + case _traced_p_div_y_vv : + fprintf(stderr, "%s_traced_p_div_y_vv%s", prepend_term, append_term); + break; + + case _traced_p_div_y_vc : + fprintf(stderr, "%s_traced_p_div_y_vc%s", prepend_term, append_term); + break; + + case _traced_p_div_y_cv : + fprintf(stderr, "%s_traced_p_div_y_cv%s", prepend_term, append_term); + break; + + case _traced_p_and_vv : + fprintf(stderr, "%s_traced_p_and_vv%s", prepend_term, append_term); + break; + + case _traced_p_and_vc : + fprintf(stderr, "%s_traced_p_and_vc%s", prepend_term, append_term); + break; + + case _traced_p_and_y_vv : + fprintf(stderr, "%s_traced_p_and_y_vv%s", prepend_term, append_term); + break; + + case _traced_p_and_y_vc : + fprintf(stderr, "%s_traced_p_and_y_vc%s", prepend_term, append_term); + break; + + case _traced_p_or_vv : + fprintf(stderr, "%s_traced_p_or_vv%s", prepend_term, append_term); + break; + + case _traced_p_or_vc : + fprintf(stderr, "%s_traced_p_or_vc%s", prepend_term, append_term); + break; + + case _traced_p_or_y_vv : + fprintf(stderr, "%s_traced_p_or_y_vv%s", prepend_term, append_term); + break; + + case _traced_p_or_y_vc : + fprintf(stderr, "%s_traced_p_or_y_vc%s", prepend_term, append_term); + break; + + case _traced_p_sll_vv : + fprintf(stderr, "%s_traced_p_sll_vv%s", prepend_term, append_term); + break; + + case _traced_p_sll_vc : + fprintf(stderr, "%s_traced_p_sll_vc%s", prepend_term, append_term); + break; + + case _traced_p_sll_cv : + fprintf(stderr, "%s_traced_p_sll_cv%s", prepend_term, append_term); + break; + + case _traced_p_sll_y_vv : + fprintf(stderr, "%s_traced_p_sll_y_vv%s", prepend_term, append_term); + break; + + case _traced_p_sll_y_vc : + fprintf(stderr, "%s_traced_p_sll_y_vc%s", prepend_term, append_term); + break; + + case _traced_p_sll_y_cv : + fprintf(stderr, "%s_traced_p_sll_y_cv%s", prepend_term, append_term); + break; + + case _traced_p_slr_vv : + fprintf(stderr, "%s_traced_p_slr_vv%s", prepend_term, append_term); + break; + + case _traced_p_slr_vc : + fprintf(stderr, "%s_traced_p_slr_vc%s", prepend_term, append_term); + break; + + case _traced_p_slr_cv : + fprintf(stderr, "%s_traced_p_slr_cv%s", prepend_term, append_term); + break; + + case _traced_p_slr_y_vv : + fprintf(stderr, "%s_traced_p_slr_y_vv%s", prepend_term, append_term); + break; + + case _traced_p_slr_y_vc : + fprintf(stderr, "%s_traced_p_slr_y_vc%s", prepend_term, append_term); + break; + + case _traced_p_slr_y_cv : + fprintf(stderr, "%s_traced_p_slr_y_cv%s", prepend_term, append_term); + break; + + case _traced_call_bfunc_xx : + fprintf(stderr, "%s_traced_call_bfunc_xx%s", prepend_term, append_term); + break; + + case _traced_call_bfunc_yx : + fprintf(stderr, "%s_traced_call_bfunc_yx%s", prepend_term, append_term); + break; + + case _traced_call_bfunc_xy : + fprintf(stderr, "%s_traced_call_bfunc_xy%s", prepend_term, append_term); + break; + + case _traced_call_bfunc_yy : + fprintf(stderr, "%s_traced_call_bfunc_yy%s", prepend_term, append_term); + break; + + case _traced_p_equal : + fprintf(stderr, "%s_traced_p_equal%s", prepend_term, append_term); + break; + + case _traced_p_dif : + fprintf(stderr, "%s_traced_p_dif%s", prepend_term, append_term); + break; + + case _traced_p_eq : + fprintf(stderr, "%s_traced_p_eq%s", prepend_term, append_term); + break; + + case _traced_p_arg_vv : + fprintf(stderr, "%s_traced_p_arg_vv%s", prepend_term, append_term); + break; + + case _traced_p_arg_cv : + fprintf(stderr, "%s_traced_p_arg_cv%s", prepend_term, append_term); + break; + + case _traced_p_arg_y_vv : + fprintf(stderr, "%s_traced_p_arg_y_vv%s", prepend_term, append_term); + break; + + case _traced_p_arg_y_cv : + fprintf(stderr, "%s_traced_p_arg_y_cv%s", prepend_term, append_term); + break; + + case _traced_p_func2s_vv : + fprintf(stderr, "%s_traced_p_func2s_vv%s", prepend_term, append_term); + break; + + case _traced_p_func2s_cv : + fprintf(stderr, "%s_traced_p_func2s_cv%s", prepend_term, append_term); + break; + + case _traced_p_func2s_vc : + fprintf(stderr, "%s_traced_p_func2s_vc%s", prepend_term, append_term); + break; + + case _traced_p_func2s_y_vv : + fprintf(stderr, "%s_traced_p_func2s_y_vv%s", prepend_term, append_term); + break; + + case _traced_p_func2s_y_cv : + fprintf(stderr, "%s_traced_p_func2s_y_cv%s", prepend_term, append_term); + break; + + case _traced_p_func2s_y_vc : + fprintf(stderr, "%s_traced_p_func2s_y_vc%s", prepend_term, append_term); + break; + + case _traced_p_func2f_xx : + fprintf(stderr, "%s_traced_p_func2f_xx%s", prepend_term, append_term); + break; + + case _traced_p_func2f_xy : + fprintf(stderr, "%s_traced_p_func2f_xy%s", prepend_term, append_term); + break; + + case _traced_p_func2f_yx : + fprintf(stderr, "%s_traced_p_func2f_yx%s", prepend_term, append_term); + break; + + case _traced_p_func2f_yy : + fprintf(stderr, "%s_traced_p_func2f_yy%s", prepend_term, append_term); + break; + + case _traced_p_functor : + fprintf(stderr, "%s_traced_p_functor%s", prepend_term, append_term); + break; + + case _traced_p_execute2 : + fprintf(stderr, "%s_traced_p_execute2%s", prepend_term, append_term); + break; + + case _traced_p_execute : + fprintf(stderr, "%s_traced_p_execute%s", prepend_term, append_term); + break; + + case _traced_p_execute_tail : + fprintf(stderr, "%s_traced_p_execute_tail%s", prepend_term, append_term); + break; + +#ifdef YAPOR + case _traced_getwork_first_time : + fprintf(stderr, "%s_traced_getwork_first_time%s", prepend_term, append_term); + break; + + case _traced_getwork : + fprintf(stderr, "%s_traced_getwork%s", prepend_term, append_term); + break; + + case _traced_getwork_seq : + fprintf(stderr, "%s_traced_getwork_seq%s", prepend_term, append_term); + break; + + case _traced_sync : + fprintf(stderr, "%s_traced_sync%s", prepend_term, append_term); + break; + +#endif +#ifdef TABLING +#ifdef TABLING_INNER_CUTS + case _traced_clause_with_cut : + fprintf(stderr, "%s_traced_clause_with_cut%s", prepend_term, append_term); + break; + +#endif + case _traced_table_load_answer : + fprintf(stderr, "%s_traced_table_load_answer%s", prepend_term, append_term); + break; + + case _traced_table_try_answer : + fprintf(stderr, "%s_traced_table_try_answer%s", prepend_term, append_term); + break; + + case _traced_table_try_single : + fprintf(stderr, "%s_traced_table_try_single%s", prepend_term, append_term); + break; + + case _traced_table_try_me : + fprintf(stderr, "%s_traced_table_try_me%s", prepend_term, append_term); + break; + + case _traced_table_try : + fprintf(stderr, "%s_traced_table_try%s", prepend_term, append_term); + break; + + case _traced_table_retry_me : + fprintf(stderr, "%s_traced_table_retry_me%s", prepend_term, append_term); + break; + + case _traced_table_retry : + fprintf(stderr, "%s_traced_table_retry%s", prepend_term, append_term); + break; + + case _traced_table_trust_me : + fprintf(stderr, "%s_traced_table_trust_me%s", prepend_term, append_term); + break; + + case _traced_table_trust : + fprintf(stderr, "%s_traced_table_trust%s", prepend_term, append_term); + break; + + case _traced_table_new_answer : + fprintf(stderr, "%s_traced_table_new_answer%s", prepend_term, append_term); + break; + + case _traced_table_answer_resolution : + fprintf(stderr, "%s_traced_table_answer_resolution%s", prepend_term, append_term); + break; + + case _traced_table_completion : + fprintf(stderr, "%s_traced_table_completion%s", prepend_term, append_term); + break; + +#ifdef THREADS_CONSUMER_SHARING + case _traced_table_answer_resolution_completion: + fprintf(stderr, "%s_traced_table_answer_resolution_completion%s", prepend_term, append_term); + break; + +#endif + case _traced_trie_do_var : + fprintf(stderr, "%s_traced_trie_do_var%s", prepend_term, append_term); + break; + + case _traced_trie_trust_var : + fprintf(stderr, "%s_traced_trie_trust_var%s", prepend_term, append_term); + break; + + case _traced_trie_try_var : + fprintf(stderr, "%s_traced_trie_try_var%s", prepend_term, append_term); + break; + + case _traced_trie_retry_var : + fprintf(stderr, "%s_traced_trie_retry_var%s", prepend_term, append_term); + break; + + case _traced_trie_do_var_in_pair : + fprintf(stderr, "%s_traced_trie_do_var_in_pair%s", prepend_term, append_term); + break; + + case _traced_trie_trust_var_in_pair : + fprintf(stderr, "%s_traced_trie_trust_var_in_pair%s", prepend_term, append_term); + break; + + case _traced_trie_try_var_in_pair : + fprintf(stderr, "%s_traced_trie_try_var_in_pair%s", prepend_term, append_term); + break; + + case _traced_trie_retry_var_in_pair : + fprintf(stderr, "%s_traced_trie_retry_var_in_pair%s", prepend_term, append_term); + break; + + case _traced_trie_do_val : + fprintf(stderr, "%s_traced_trie_do_val%s", prepend_term, append_term); + break; + + case _traced_trie_trust_val : + fprintf(stderr, "%s_traced_trie_trust_val%s", prepend_term, append_term); + break; + + case _traced_trie_try_val : + fprintf(stderr, "%s_traced_trie_try_val%s", prepend_term, append_term); + break; + + case _traced_trie_retry_val : + fprintf(stderr, "%s_traced_trie_retry_val%s", prepend_term, append_term); + break; + + case _traced_trie_do_val_in_pair : + fprintf(stderr, "%s_traced_trie_do_val_in_pair%s", prepend_term, append_term); + break; + + case _traced_trie_trust_val_in_pair : + fprintf(stderr, "%s_traced_trie_trust_val_in_pair%s", prepend_term, append_term); + break; + + case _traced_trie_try_val_in_pair : + fprintf(stderr, "%s_traced_trie_try_val_in_pair%s", prepend_term, append_term); + break; + + case _traced_trie_retry_val_in_pair : + fprintf(stderr, "%s_traced_trie_retry_val_in_pair%s", prepend_term, append_term); + break; + + case _traced_trie_do_atom : + fprintf(stderr, "%s_traced_trie_do_atom%s", prepend_term, append_term); + break; + + case _traced_trie_trust_atom : + fprintf(stderr, "%s_traced_trie_trust_atom%s", prepend_term, append_term); + break; + + case _traced_trie_try_atom : + fprintf(stderr, "%s_traced_trie_try_atom%s", prepend_term, append_term); + break; + + case _traced_trie_retry_atom : + fprintf(stderr, "%s_traced_trie_retry_atom%s", prepend_term, append_term); + break; + + case _traced_trie_do_atom_in_pair : + fprintf(stderr, "%s_traced_trie_do_atom_in_pair%s", prepend_term, append_term); + break; + + case _traced_trie_trust_atom_in_pair : + fprintf(stderr, "%s_traced_trie_trust_atom_in_pair%s", prepend_term, append_term); + break; + + case _traced_trie_try_atom_in_pair : + fprintf(stderr, "%s_traced_trie_try_atom_in_pair%s", prepend_term, append_term); + break; + + case _traced_trie_retry_atom_in_pair : + fprintf(stderr, "%s_traced_trie_retry_atom_in_pair%s", prepend_term, append_term); + break; + + case _traced_trie_do_null : + fprintf(stderr, "%s_traced_trie_do_null%s", prepend_term, append_term); + break; + + case _traced_trie_trust_null : + fprintf(stderr, "%s_traced_trie_trust_null%s", prepend_term, append_term); + break; + + case _traced_trie_try_null : + fprintf(stderr, "%s_traced_trie_try_null%s", prepend_term, append_term); + break; + + case _traced_trie_retry_null : + fprintf(stderr, "%s_traced_trie_retry_null%s", prepend_term, append_term); + break; + + case _traced_trie_do_null_in_pair : + fprintf(stderr, "%s_traced_trie_do_null_in_pair%s", prepend_term, append_term); + break; + + case _traced_trie_trust_null_in_pair : + fprintf(stderr, "%s_traced_trie_trust_null_in_pair%s", prepend_term, append_term); + break; + + case _traced_trie_try_null_in_pair : + fprintf(stderr, "%s_traced_tri_try_null_in_paire%s", prepend_term, append_term); + break; + + case _traced_trie_retry_null_in_pair : + fprintf(stderr, "%s_traced_trie_retry_null_in_pair%s", prepend_term, append_term); + break; + + case _traced_trie_do_pair : + fprintf(stderr, "%s_traced_trie_do_pair%s", prepend_term, append_term); + break; + + case _traced_trie_trust_pair : + fprintf(stderr, "%s_traced_trie_trust_pair%s", prepend_term, append_term); + break; + + case _traced_trie_try_pair : + fprintf(stderr, "%s_traced_trie_try_pair%s", prepend_term, append_term); + break; + + case _traced_trie_retry_pair : + fprintf(stderr, "%s_traced_trie_retry_pair%s", prepend_term, append_term); + break; + + case _traced_trie_do_appl : + fprintf(stderr, "%s_traced_trie_do_appl%s", prepend_term, append_term); + break; + + case _traced_trie_trust_appl : + fprintf(stderr, "%s_traced_trie_trust_appl%s", prepend_term, append_term); + break; + + case _traced_trie_try_appl : + fprintf(stderr, "%s_traced_trie_try_appl%s", prepend_term, append_term); + break; + + case _traced_trie_retry_appl : + fprintf(stderr, "%s_traced_trie_retry_appl%s", prepend_term, append_term); + break; + + case _traced_trie_do_appl_in_pair : + fprintf(stderr, "%s_traced_trie_do_appl_in_pair%s", prepend_term, append_term); + break; + + case _traced_trie_trust_appl_in_pair : + fprintf(stderr, "%s_traced_trie_trust_appl_in_pair%s", prepend_term, append_term); + break; + + case _traced_trie_try_appl_in_pair : + fprintf(stderr, "%s_traced_trie_trty_appkl_in_pair%s", prepend_term, append_term); + break; + + case _traced_trie_retry_appl_in_pair : + fprintf(stderr, "%s_traced_trie_retry_appl_in_pair%s", prepend_term, append_term); + break; + + case _traced_trie_do_extension : + fprintf(stderr, "%s_traced_trie_do_extension%s", prepend_term, append_term); + break; + + case _traced_trie_trust_extension : + fprintf(stderr, "%s_traced_trie_trust_extension%s", prepend_term, append_term); + break; + + case _traced_trie_try_extension : + fprintf(stderr, "%s_traced_trie_try_extension%s", prepend_term, append_term); + break; + + case _traced_trie_retry_extension : + fprintf(stderr, "%s_traced_trie_retry_extension%s", prepend_term, append_term); + break; + + case _traced_trie_do_double : + fprintf(stderr, "%s_traced_trie_do_double%s", prepend_term, append_term); + break; + + case _traced_trie_trust_double : + fprintf(stderr, "%s_traced_trie_trust_double%s", prepend_term, append_term); + break; + + case _traced_trie_try_double : + fprintf(stderr, "%s_traced_trie_try_double%s", prepend_term, append_term); + break; + + case _traced_trie_retry_double : + fprintf(stderr, "%s_traced_trie_retry_double%s", prepend_term, append_term); + break; + + case _traced_trie_do_longint : + fprintf(stderr, "%s_traced_trie_do_longint%s", prepend_term, append_term); + break; + + case _traced_trie_trust_longint : + fprintf(stderr, "%s_traced_trie_trust_longint%s", prepend_term, append_term); + break; + + case _traced_trie_try_longint : + fprintf(stderr, "%s_traced_trie_try_longint%s", prepend_term, append_term); + break; + + case _traced_trie_retry_longint : + fprintf(stderr, "%s_traced_trie_retry_longint%s", prepend_term, append_term); + break; + + case _traced_trie_do_gterm : + fprintf(stderr, "%s_traced_trie_do_gterm%s", prepend_term, append_term); + break; + + case _traced_trie_trust_gterm : + fprintf(stderr, "%s_traced_trie_trust_gterm%s", prepend_term, append_term); + break; + + case _traced_trie_try_gterm : + fprintf(stderr, "%s_traced_trie_try_gterm%s", prepend_term, append_term); + break; + + case _traced_trie_retry_gterm : + fprintf(stderr, "%s_traced_trie_retry_gterm%s", prepend_term, append_term); + break; + +#endif + /* this instruction is hardwired */ +#ifdef YAPOR + case _traced_or_last : + fprintf(stderr, "%s_traced_or_last%s", prepend_term, append_term); + break; +#else + case _traced_or_last : + fprintf(stderr, "%s_traced_or_last%s", prepend_term, append_term); + break; +#endif + +#endif /* YAP_JIT */ + } + } + +void print_nop(op_numbers); + +void +print_nop(op_numbers op) { + print_op("", op, "\n"); +} diff --git a/JIT/HPP/sprint_op.hpp b/JIT/HPP/sprint_op.hpp new file mode 100644 index 000000000..1d1cc4e9b --- /dev/null +++ b/JIT/HPP/sprint_op.hpp @@ -0,0 +1,3179 @@ +void sprint_op(char*, char*, op_numbers, char*); + +void +sprint_op(char *out, char* prepend_term, op_numbers op, char* append_term) { + char tmp[1024]; + switch(op){ + case _Ystop : + sprintf(tmp, "_Ystop"); + break; + + case _Nstop : + sprintf(tmp, "_Nstop"); + break; + + case _try_me : + sprintf(tmp, "_try_me"); + break; + + case _retry_me : + sprintf(tmp, "_retry_me"); + break; + + case _trust_me : + sprintf(tmp, "_trust_me"); + break; + + case _enter_profiling : + sprintf(tmp, "_enter_profiling"); + break; + + case _retry_profiled : + sprintf(tmp, "_retry_profiled"); + break; + + case _profiled_retry_me : + sprintf(tmp, "_profiled_retry_me"); + break; + + case _profiled_trust_me : + sprintf(tmp, "_profiled_trust_me"); + break; + + case _profiled_retry_logical : + sprintf(tmp, "_profiled_retry_logical"); + break; + + case _profiled_trust_logical : + sprintf(tmp, "_profiled_trust_logical"); + break; + + case _count_call : + sprintf(tmp, "_count_call"); + break; + + case _count_retry : + sprintf(tmp, "_count_retry"); + break; + + case _count_retry_me : + sprintf(tmp, "_count_retry_me"); + break; + + case _count_trust_me : + sprintf(tmp, "_count_trust_me"); + break; + + case _count_retry_logical : + sprintf(tmp, "_count_retry_logical"); + break; + + case _count_trust_logical : + sprintf(tmp, "_count_trust_logical"); + break; + + case _lock_lu : + sprintf(tmp, "_lock_lu"); + break; + + case _unlock_lu : + sprintf(tmp, "_unlock_lu"); + break; + + case _alloc_for_logical_pred : + sprintf(tmp, "_alloc_for_logical_pred"); + break; + + case _copy_idb_term : + sprintf(tmp, "_copy_idb_term"); + break; + + case _unify_idb_term : + sprintf(tmp, "_unify_idb_term"); + break; + + case _ensure_space : + sprintf(tmp, "_ensure_space"); + break; + + case _spy_or_trymark : + sprintf(tmp, "_spy_or_trymark"); + break; + + case _try_and_mark : + sprintf(tmp, "_try_and_mark"); + break; + + case _count_retry_and_mark : + sprintf(tmp, "_count_retry_and_mark"); + break; + + case _profiled_retry_and_mark : + sprintf(tmp, "_profiled_retry_and_mark"); + break; + + case _retry_and_mark : + sprintf(tmp, "_retry_and_mark"); + break; + + case _trust_fail : + sprintf(tmp, "_trust_fail"); + break; + + case _op_fail : + sprintf(tmp, "_op_fail"); + break; + + case _cut : + sprintf(tmp, "_cut"); + break; + + case _cut_t : + sprintf(tmp, "_cut_t"); + break; + + case _cut_e : + sprintf(tmp, "_cut_e"); + break; + + case _save_b_x : + sprintf(tmp, "_save_b_x"); + break; + + case _save_b_y : + sprintf(tmp, "_save_b_y"); + break; + + case _commit_b_x : + sprintf(tmp, "_commit_b_x"); + break; + + case _commit_b_y : + sprintf(tmp, "_commit_b_y"); + break; + + case _execute : + sprintf(tmp, "_execute"); + break; + + case _dexecute : + sprintf(tmp, "_dexecute"); + break; + + case _fcall : + sprintf(tmp, "_fcall"); + break; + + case _call : + sprintf(tmp, "_call"); + break; + + case _procceed : + sprintf(tmp, "_procceed"); + break; + + case _allocate : + sprintf(tmp, "_allocate"); + break; + + case _deallocate : + sprintf(tmp, "_deallocate"); + break; + +#ifdef BEAM + case _retry_eam : + sprintf(tmp, "_retry_eam"); + break; + +#endif +#ifdef BEAM + case _run_eam : + sprintf(tmp, "_run_eam"); + break; + +#endif + case _get_x_var : + sprintf(tmp, "_get_x_var"); + break; + + case _get_y_var : + sprintf(tmp, "_get_y_var"); + break; + + case _get_yy_var : + sprintf(tmp, "_get_yy_var"); + break; + + case _get_x_val : + sprintf(tmp, "_get_x_val"); + break; + + case _get_y_val : + sprintf(tmp, "_get_y_val"); + break; + + case _get_atom : + sprintf(tmp, "_get_atom"); + break; + + case _get_2atoms : + sprintf(tmp, "_get_2atoms"); + break; + + case _get_3atoms : + sprintf(tmp, "_get_3atoms"); + break; + + case _get_4atoms : + sprintf(tmp, "_get_4atoms"); + break; + + case _get_5atoms : + sprintf(tmp, "_get_5atoms"); + break; + + case _get_6atoms : + sprintf(tmp, "_get_6atoms"); + break; + + case _get_list : + sprintf(tmp, "_get_list"); + break; + + case _get_struct : + sprintf(tmp, "_get_struct"); + break; + + case _get_float : + sprintf(tmp, "_get_float"); + break; + + case _get_longint : + sprintf(tmp, "_get_longint"); + break; + + case _get_bigint : + sprintf(tmp, "_get_bigint"); + break; + + case _get_dbterm : + sprintf(tmp, "_get_dbterm"); + break; + + case _glist_valx : + sprintf(tmp, "_glist_valx"); + break; + + case _glist_valy : + sprintf(tmp, "_glist_valy"); + break; + + case _gl_void_varx : + sprintf(tmp, "_gl_void_varx"); + break; + + case _gl_void_vary : + sprintf(tmp, "_gl_void_vary"); + break; + + case _gl_void_valx : + sprintf(tmp, "_gl_void_valx"); + break; + + case _gl_void_valy : + sprintf(tmp, "_gl_void_valy"); + break; + + case _unify_x_var : + sprintf(tmp, "_unify_x_var"); + break; + + case _unify_x_var_write : + sprintf(tmp, "_unify_x_var_write"); + break; + + case _unify_l_x_var : + sprintf(tmp, "_unify_l_x_var"); + break; + + case _unify_l_x_var_write : + sprintf(tmp, "_unify_l_x_var_write"); + break; + + case _unify_x_var2 : + sprintf(tmp, "_unify_x_var2"); + break; + + case _unify_x_var2_write : + sprintf(tmp, "_unify_x_var2_write"); + break; + + case _unify_l_x_var2 : + sprintf(tmp, "_unify_l_x_var2"); + break; + + case _unify_l_x_var2_write : + sprintf(tmp, "_unify_l_x_var2_write"); + break; + + case _unify_y_var : + sprintf(tmp, "_unify_y_var"); + break; + + case _unify_y_var_write : + sprintf(tmp, "_unify_y_var_write"); + break; + + case _unify_l_y_var : + sprintf(tmp, "_unify_l_y_var"); + break; + + case _unify_l_y_var_write : + sprintf(tmp, "_unify_l_y_var_write"); + break; + + case _unify_x_val : + sprintf(tmp, "_unify_x_val"); + break; + + case _unify_x_val_write : + sprintf(tmp, "_unify_x_val_write"); + break; + + case _unify_l_x_val : + sprintf(tmp, "_unify_l_x_val"); + break; + + case _unify_l_x_val_write : + sprintf(tmp, "_uify_l_x_val_write"); + break; + + case _unify_y_val : + sprintf(tmp, "_unify_y_val"); + break; + + case _unify_y_val_write : + sprintf(tmp, "_unify_y_val_write"); + break; + + case _unify_l_y_val : + sprintf(tmp, "_unify_l_y_val"); + break; + + case _unify_l_y_val_write : + sprintf(tmp, "_unify_l_y_val_write"); + break; + + case _unify_x_loc : + sprintf(tmp, "_unify_x_loc"); + break; + + case _unify_x_loc_write : + sprintf(tmp, "_unify_x_loc_write"); + break; + + case _unify_l_x_loc : + sprintf(tmp, "_unify_l_x_loc"); + break; + + case _unify_l_x_loc_write : + sprintf(tmp, "_unify_l_x_loc_write"); + break; + + case _unify_y_loc : + sprintf(tmp, "_unify_y_loc"); + break; + + case _unify_y_loc_write : + sprintf(tmp, "_unify_y_loc_write"); + break; + + case _unify_l_y_loc : + sprintf(tmp, "_unify_l_y_loc"); + break; + + case _unify_l_y_loc_write : + sprintf(tmp, "_unify_l_y_loc_write"); + break; + + case _unify_void : + sprintf(tmp, "_unify_void"); + break; + + case _unify_void_write : + sprintf(tmp, "_unify_void_write"); + break; + + case _unify_l_void : + sprintf(tmp, "_unify_l_void"); + break; + + case _unify_l_void_write : + sprintf(tmp, "_unify_l_void_write"); + break; + + case _unify_n_voids : + sprintf(tmp, "_unify_n_voids"); + break; + + case _unify_n_voids_write : + sprintf(tmp, "_unify_n_voids_write"); + break; + + case _unify_l_n_voids : + sprintf(tmp, "_unify_l_n_voids"); + break; + + case _unify_l_n_voids_write : + sprintf(tmp, "_unify_l_n_voids_write"); + break; + + case _unify_atom : + sprintf(tmp, "_unify_atom"); + break; + + case _unify_atom_write : + sprintf(tmp, "_unify_atom_write"); + break; + + case _unify_l_atom : + sprintf(tmp, "_unify_l_atom"); + break; + + case _unify_l_atom_write : + sprintf(tmp, "_unify_l_atom_write"); + break; + + case _unify_n_atoms : + sprintf(tmp, "_unify_n_atoms"); + break; + + case _unify_n_atoms_write : + sprintf(tmp, "_unify_n_atoms_write"); + break; + + case _unify_float : + sprintf(tmp, "_unify_float"); + break; + + case _unify_float_write : + sprintf(tmp, "_unify_float_write"); + break; + + case _unify_l_float : + sprintf(tmp, "_unify_l_float"); + break; + + case _unify_l_float_write : + sprintf(tmp, "_unify_l_float_write"); + break; + + case _unify_longint : + sprintf(tmp, "_unify_longint"); + break; + + case _unify_longint_write : + sprintf(tmp, "_unify_longint_write"); + break; + + case _unify_l_longint : + sprintf(tmp, "_unify_l_longint"); + break; + + case _unify_l_longint_write : + sprintf(tmp, "_unify_l_longint_write"); + break; + + case _unify_bigint : + sprintf(tmp, "_unify_bigint"); + break; + + case _unify_l_bigint : + sprintf(tmp, "_unify_l_bigint"); + break; + + case _unify_dbterm : + sprintf(tmp, "_unify_dbterm"); + break; + + case _unify_l_dbterm : + sprintf(tmp, "_unify_l_dbterm"); + break; + + case _unify_list : + sprintf(tmp, "_unify_list"); + break; + + case _unify_list_write : + sprintf(tmp, "_unify_list_write"); + break; + + case _unify_l_list : + sprintf(tmp, "_unify_l_list"); + break; + + case _unify_l_list_write : + sprintf(tmp, "_unify_l_list_write"); + break; + + case _unify_struct : + sprintf(tmp, "_unify_struct"); + break; + + case _unify_struct_write : + sprintf(tmp, "_unify_struct_write"); + break; + + case _unify_l_struc : + sprintf(tmp, "_unify_l_struc"); + break; + + case _unify_l_struc_write : + sprintf(tmp, "_unify_l_struc_write"); + break; + + case _put_x_var : + sprintf(tmp, "_put_x_var"); + break; + + case _put_y_var : + sprintf(tmp, "_put_y_var"); + break; + + case _put_x_val : + sprintf(tmp, "_put_x_val"); + break; + + case _put_xx_val : + sprintf(tmp, "_put_xx_val"); + break; + + case _put_y_val : + sprintf(tmp, "_put_y_val"); + break; + + case _put_y_vals : + sprintf(tmp, "_put_y_vals"); + break; + + case _put_unsafe : + sprintf(tmp, "_put_unsafe"); + break; + + case _put_atom : + sprintf(tmp, "_put_atom"); + break; + + case _put_dbterm : + sprintf(tmp, "_put_dbterm"); + break; + + case _put_bigint : + sprintf(tmp, "_put_bigint"); + break; + + case _put_float : + sprintf(tmp, "_put_float"); + break; + + case _put_longint : + sprintf(tmp, "_put_longint"); + break; + + case _put_list : + sprintf(tmp, "_put_list"); + break; + + case _put_struct : + sprintf(tmp, "_put_struct"); + break; + + case _write_x_var : + sprintf(tmp, "_write_x_var"); + break; + + case _write_void : + sprintf(tmp, "_write_void"); + break; + + case _write_n_voids : + sprintf(tmp, "_write_n_voids"); + break; + + case _write_y_var : + sprintf(tmp, "_write_y_var"); + break; + + case _write_x_val : + sprintf(tmp, "_write_x_val"); + break; + + case _write_x_loc : + sprintf(tmp, "_write_x_loc"); + break; + + case _write_y_val : + sprintf(tmp, "_write_y_val"); + break; + + case _write_y_loc : + sprintf(tmp, "_write_y_loc"); + break; + + case _write_atom : + sprintf(tmp, "_write_atom"); + break; + + case _write_bigint : + sprintf(tmp, "_write_bigint"); + break; + + case _write_dbterm : + sprintf(tmp, "_write_dbterm"); + break; + + case _write_float : + sprintf(tmp, "_write_float"); + break; + + case _write_longint : + sprintf(tmp, "_write_longint"); + break; + + case _write_n_atoms : + sprintf(tmp, "_write_n_atoms"); + break; + + case _write_list : + sprintf(tmp, "_write_list"); + break; + + case _write_l_list : + sprintf(tmp, "_write_l_list"); + break; + + case _write_struct : + sprintf(tmp, "_write_struct"); + break; + + case _write_l_struc : + sprintf(tmp, "_write_l_struc"); + break; + + case _save_pair_x : + sprintf(tmp, "_save_pair_x"); + break; + + case _save_pair_x_write : + sprintf(tmp, "_save_pair_x_write"); + break; + + case _save_pair_y : + sprintf(tmp, "_save_pair_y"); + break; + + case _save_pair_y_write : + sprintf(tmp, "_save_pair_y_write"); + break; + + case _save_appl_x : + sprintf(tmp, "_save_appl_x"); + break; + + case _save_appl_x_write : + sprintf(tmp, "_save_appl_x_write"); + break; + + case _save_appl_y : + sprintf(tmp, "_save_appl_y"); + break; + + case _save_appl_y_write : + sprintf(tmp, "_save_appl_y_write"); + break; + + case _jump : + sprintf(tmp, "_jump"); + break; + + case _move_back : + sprintf(tmp, "_move_back"); + break; + + case _skip : + sprintf(tmp, "_skip"); + break; + + case _either : + sprintf(tmp, "_either"); + break; + + case _or_else : + sprintf(tmp, "_or_else"); + break; + + case _pop_n : + sprintf(tmp, "_pop_n"); + break; + + case _pop : + sprintf(tmp, "_pop"); + break; + + case _call_cpred : + sprintf(tmp, "_call_cpred"); + break; + + case _execute_cpred : + sprintf(tmp, "_execute_cpred"); + break; + + case _call_usercpred : + sprintf(tmp, "_call_usercpred"); + break; + + case _call_c_wfail : + sprintf(tmp, "_call_x_wfail"); + break; + + case _try_c : + sprintf(tmp, "_try_c"); + break; + + case _retry_c : + sprintf(tmp, "_retry_c"); + break; + +#ifdef CUT_C + case _cut_c : + sprintf(tmp, "_cut_c"); + break; + +#endif + case _try_userc : + sprintf(tmp, "_try_userc"); + break; + + case _retry_userc : + sprintf(tmp, "_retry_userc"); + break; + +#ifdef CUT_C + case _cut_userc : + sprintf(tmp, "_cut_userc"); + break; + +#endif + case _lock_pred : + sprintf(tmp, "_lock_pred"); + break; + + case _index_pred : + sprintf(tmp, "_index_pred"); + break; + +#ifdef THREADS + case _thread_local : + sprintf(tmp, "_thread_local"); + break; + +#endif + case _expand_index : + sprintf(tmp, "_expand_index"); + break; + + case _expand_clauses : + sprintf(tmp, "_expand_clauses"); + break; + + case _undef_p : + sprintf(tmp, "_undef_p"); + break; + + case _spy_pred : + sprintf(tmp, "_spy_pred"); + break; + + case _try_clause : + sprintf(tmp, "_try_clause"); + break; + + case _try_clause2 : + sprintf(tmp, "_try_clause2"); + break; + + case _try_clause3 : + sprintf(tmp, "_try_clause3"); + break; + + case _try_clause4 : + sprintf(tmp, "_try_clause4"); + break; + + case _retry : + sprintf(tmp, "_retry"); + break; + + case _retry2 : + sprintf(tmp, "_retry2"); + break; + + case _retry3 : + sprintf(tmp, "_retry3"); + break; + + case _retry4 : + sprintf(tmp, "_retry4"); + break; + + case _trust : + sprintf(tmp, "_trust"); + break; + + case _try_in : + sprintf(tmp, "_try_in"); + break; + + case _try_logical : + sprintf(tmp, "_try_logical"); + break; + + case _retry_logical : + sprintf(tmp, "_retry_logical"); + break; + + case _trust_logical : + sprintf(tmp, "_trust_logical"); + break; + + case _user_switch : + sprintf(tmp, "_user_switch"); + break; + + case _switch_on_type : + sprintf(tmp, "_switch_on_type"); + break; + + case _switch_list_nl : + sprintf(tmp, "_switch_list_nl"); + break; + + case _switch_on_arg_type : + sprintf(tmp, "_switch_on_arg_type"); + break; + + case _switch_on_sub_arg_type : + sprintf(tmp, "_switch_on_sub_arg_type"); + break; + + case _jump_if_var : + sprintf(tmp, "_jump_if_var"); + break; + + case _jump_if_nonvar : + sprintf(tmp, "_jump_if_nonvar"); + break; + + case _if_not_then : + sprintf(tmp, "_if_not_then"); + break; + + case _switch_on_func : + sprintf(tmp, "_switch_on_func"); + break; + + case _switch_on_cons : + sprintf(tmp, "_switch_on_cons"); + break; + + case _go_on_func : + sprintf(tmp, "_go_on_func"); + break; + + case _go_on_cons : + sprintf(tmp, "_go_on_cons"); + break; + + case _if_func : + sprintf(tmp, "_if_func"); + break; + + case _if_cons : + sprintf(tmp, "_if_cons"); + break; + + case _index_dbref : + sprintf(tmp, "_index_dbref"); + break; + + case _index_blob : + sprintf(tmp, "_index_blob"); + break; + + case _index_long : + sprintf(tmp, "_index_long"); + break; + +#ifdef YAP_JIT + case _jit_handler : + sprintf(tmp, "_jit_handler"); + break; +#endif /*YAP_JIT*/ + + case _p_atom_x : + sprintf(tmp, "_p_atom_x"); + break; + + case _p_atom_y : + sprintf(tmp, "_p_atom_y"); + break; + + case _p_atomic_x : + sprintf(tmp, "_p_atomic_x"); + break; + + case _p_atomic_y : + sprintf(tmp, "_p_atomic_y"); + break; + + case _p_integer_x : + sprintf(tmp, "_p_integer_x"); + break; + + case _p_integer_y : + sprintf(tmp, "_p_integer_y"); + break; + + case _p_nonvar_x : + sprintf(tmp, "_p_nonvar_x"); + break; + + case _p_nonvar_y : + sprintf(tmp, "_p_nonvar_y"); + break; + + case _p_number_x : + sprintf(tmp, "_p_number_x"); + break; + + case _p_number_y : + sprintf(tmp, "_p_number_y"); + break; + + case _p_var_x : + sprintf(tmp, "_p_var_x"); + break; + + case _p_var_y : + sprintf(tmp, "_p_var_y"); + break; + + case _p_db_ref_x : + sprintf(tmp, "_p_db_ref_x"); + break; + + case _p_db_ref_y : + sprintf(tmp, "_p_db_ref_y"); + break; + + case _p_primitive_x : + sprintf(tmp, "_p_primitive_x"); + break; + + case _p_primitive_y : + sprintf(tmp, "_p_primitive_y"); + break; + + case _p_compound_x : + sprintf(tmp, "_p_compound_x"); + break; + + case _p_compound_y : + sprintf(tmp, "_p_compound_y"); + break; + + case _p_float_x : + sprintf(tmp, "_p_float_x"); + break; + + case _p_float_y : + sprintf(tmp, "_p_float_y"); + break; + + case _p_plus_vv : + sprintf(tmp, "_p_plus_vv"); + break; + + case _p_plus_vc : + sprintf(tmp, "_p_plus_vc"); + break; + + case _p_plus_y_vv : + sprintf(tmp, "_p_plus_y_vv"); + break; + + case _p_plus_y_vc : + sprintf(tmp, "_p_plus_y_vc"); + break; + + case _p_minus_vv : + sprintf(tmp, "_p_minus_vv"); + break; + + case _p_minus_cv : + sprintf(tmp, "_p_minus_cv"); + break; + + case _p_minus_y_vv : + sprintf(tmp, "_p_minus_y_vv"); + break; + + case _p_minus_y_cv : + sprintf(tmp, "_p_minus_y_cv"); + break; + + case _p_times_vv : + sprintf(tmp, "_p_times_vv"); + break; + + case _p_times_vc : + sprintf(tmp, "_p_times_vc"); + break; + + case _p_times_y_vv : + sprintf(tmp, "_p_times_y_vv"); + break; + + case _p_times_y_vc : + sprintf(tmp, "_p_times_y_vc"); + break; + + case _p_div_vv : + sprintf(tmp, "_p_div_vv"); + break; + + case _p_div_vc : + sprintf(tmp, "_p_div_vc"); + break; + + case _p_div_cv : + sprintf(tmp, "_p_div_cv"); + break; + + case _p_div_y_vv : + sprintf(tmp, "_p_div_y_vv"); + break; + + case _p_div_y_vc : + sprintf(tmp, "_p_div_y_vc"); + break; + + case _p_div_y_cv : + sprintf(tmp, "_p_div_y_cv"); + break; + + case _p_and_vv : + sprintf(tmp, "_p_and_vv"); + break; + + case _p_and_vc : + sprintf(tmp, "_p_and_vc"); + break; + + case _p_and_y_vv : + sprintf(tmp, "_p_and_y_vv"); + break; + + case _p_and_y_vc : + sprintf(tmp, "_p_and_y_vc"); + break; + + case _p_or_vv : + sprintf(tmp, "_p_or_vv"); + break; + + case _p_or_vc : + sprintf(tmp, "_p_or_vc"); + break; + + case _p_or_y_vv : + sprintf(tmp, "_p_or_y_vv"); + break; + + case _p_or_y_vc : + sprintf(tmp, "_p_or_y_vc"); + break; + + case _p_sll_vv : + sprintf(tmp, "_p_sll_vv"); + break; + + case _p_sll_vc : + sprintf(tmp, "_p_sll_vc"); + break; + + case _p_sll_cv : + sprintf(tmp, "_p_sll_cv"); + break; + + case _p_sll_y_vv : + sprintf(tmp, "_p_sll_y_vv"); + break; + + case _p_sll_y_vc : + sprintf(tmp, "_p_sll_y_vc"); + break; + + case _p_sll_y_cv : + sprintf(tmp, "_p_sll_y_cv"); + break; + + case _p_slr_vv : + sprintf(tmp, "_p_slr_vv"); + break; + + case _p_slr_vc : + sprintf(tmp, "_p_slr_vc"); + break; + + case _p_slr_cv : + sprintf(tmp, "_p_slr_cv"); + break; + + case _p_slr_y_vv : + sprintf(tmp, "_p_slr_y_vv"); + break; + + case _p_slr_y_vc : + sprintf(tmp, "_p_slr_y_vc"); + break; + + case _p_slr_y_cv : + sprintf(tmp, "_p_slr_y_cv"); + break; + + case _call_bfunc_xx : + sprintf(tmp, "_call_bfunc_xx"); + break; + + case _call_bfunc_yx : + sprintf(tmp, "_call_bfunc_yx"); + break; + + case _call_bfunc_xy : + sprintf(tmp, "_call_bfunc_xy"); + break; + + case _call_bfunc_yy : + sprintf(tmp, "_call_bfunc_yy"); + break; + + case _p_equal : + sprintf(tmp, "_p_equal"); + break; + + case _p_dif : + sprintf(tmp, "_p_dif"); + break; + + case _p_eq : + sprintf(tmp, "_p_eq"); + break; + + case _p_arg_vv : + sprintf(tmp, "_p_arg_vv"); + break; + + case _p_arg_cv : + sprintf(tmp, "_p_arg_cv"); + break; + + case _p_arg_y_vv : + sprintf(tmp, "_p_arg_y_vv"); + break; + + case _p_arg_y_cv : + sprintf(tmp, "_p_arg_y_cv"); + break; + + case _p_func2s_vv : + sprintf(tmp, "_p_func2s_vv"); + break; + + case _p_func2s_cv : + sprintf(tmp, "_p_func2s_cv"); + break; + + case _p_func2s_vc : + sprintf(tmp, "_p_func2s_vc"); + break; + + case _p_func2s_y_vv : + sprintf(tmp, "_p_func2s_y_vv"); + break; + + case _p_func2s_y_cv : + sprintf(tmp, "_p_func2s_y_cv"); + break; + + case _p_func2s_y_vc : + sprintf(tmp, "_p_func2s_y_vc"); + break; + + case _p_func2f_xx : + sprintf(tmp, "_p_func2f_xx"); + break; + + case _p_func2f_xy : + sprintf(tmp, "_p_func2f_xy"); + break; + + case _p_func2f_yx : + sprintf(tmp, "_p_func2f_yx"); + break; + + case _p_func2f_yy : + sprintf(tmp, "_p_func2f_yy"); + break; + + case _p_functor : + sprintf(tmp, "_p_functor"); + break; + + case _p_execute2 : + sprintf(tmp, "_p_execute2"); + break; + + case _p_execute : + sprintf(tmp, "_p_execute"); + break; + + case _p_execute_tail : + sprintf(tmp, "_p_execute_tail"); + break; + +#ifdef YAPOR + case _getwork_first_time : + sprintf(tmp, "_getwork_first_time"); + break; + + case _getwork : + sprintf(tmp, "_getwork"); + break; + + case _getwork_seq : + sprintf(tmp, "_getwork_seq"); + break; + + case _sync : + sprintf(tmp, "_sync"); + break; + +#endif +#ifdef TABLING +#ifdef TABLING_INNER_CUTS + case _clause_with_cut : + sprintf(tmp, "_clause_with_cut"); + break; + +#endif + case _table_load_answer : + sprintf(tmp, "_table_load_answer"); + break; + + case _table_try_answer : + sprintf(tmp, "_table_try_answer"); + break; + + case _table_try_single : + sprintf(tmp, "_table_try_single"); + break; + + case _table_try_me : + sprintf(tmp, "_table_try_me"); + break; + + case _table_try : + sprintf(tmp, "_table_try"); + break; + + case _table_retry_me : + sprintf(tmp, "_table_retry_me"); + break; + + case _table_retry : + sprintf(tmp, "_table_retry"); + break; + + case _table_trust_me : + sprintf(tmp, "_table_trust_me"); + break; + + case _table_trust : + sprintf(tmp, "_table_trust"); + break; + + case _table_new_answer : + sprintf(tmp, "_table_new_answer"); + break; + + case _table_answer_resolution : + sprintf(tmp, "_table_answer_resolution"); + break; + + case _table_completion : + sprintf(tmp, "_table_completion"); + break; + +#ifdef THREADS_CONSUMER_SHARING + case _table_answer_resolution_completion: + sprintf(tmp, "_table_answer_resolution_completion"); + break; + +#endif + case _trie_do_var : + sprintf(tmp, "_trie_do_var"); + break; + + case _trie_trust_var : + sprintf(tmp, "_trie_trust_var"); + break; + + case _trie_try_var : + sprintf(tmp, "_trie_try_var"); + break; + + case _trie_retry_var : + sprintf(tmp, "_trie_retry_var"); + break; + + case _trie_do_var_in_pair : + sprintf(tmp, "_trie_do_var_in_pair"); + break; + + case _trie_trust_var_in_pair : + sprintf(tmp, "_trie_trust_var_in_pair"); + break; + + case _trie_try_var_in_pair : + sprintf(tmp, "_trie_try_var_in_pair"); + break; + + case _trie_retry_var_in_pair : + sprintf(tmp, "_trie_retry_var_in_pair"); + break; + + case _trie_do_val : + sprintf(tmp, "_trie_do_val"); + break; + + case _trie_trust_val : + sprintf(tmp, "_trie_trust_val"); + break; + + case _trie_try_val : + sprintf(tmp, "_trie_try_val"); + break; + + case _trie_retry_val : + sprintf(tmp, "_trie_retry_val"); + break; + + case _trie_do_val_in_pair : + sprintf(tmp, "_trie_do_val_in_pair"); + break; + + case _trie_trust_val_in_pair : + sprintf(tmp, "_trie_trust_val_in_pair"); + break; + + case _trie_try_val_in_pair : + sprintf(tmp, "_trie_try_val_in_pair"); + break; + + case _trie_retry_val_in_pair : + sprintf(tmp, "_trie_retry_val_in_pair"); + break; + + case _trie_do_atom : + sprintf(tmp, "_trie_do_atom"); + break; + + case _trie_trust_atom : + sprintf(tmp, "_trie_trust_atom"); + break; + + case _trie_try_atom : + sprintf(tmp, "_trie_try_atom"); + break; + + case _trie_retry_atom : + sprintf(tmp, "_trie_retry_atom"); + break; + + case _trie_do_atom_in_pair : + sprintf(tmp, "_trie_do_atom_in_pair"); + break; + + case _trie_trust_atom_in_pair : + sprintf(tmp, "_trie_trust_atom_in_pair"); + break; + + case _trie_try_atom_in_pair : + sprintf(tmp, "_trie_try_atom_in_pair"); + break; + + case _trie_retry_atom_in_pair : + sprintf(tmp, "_trie_retry_atom_in_pair"); + break; + + case _trie_do_null : + sprintf(tmp, "_trie_do_null"); + break; + + case _trie_trust_null : + sprintf(tmp, "_trie_trust_null"); + break; + + case _trie_try_null : + sprintf(tmp, "_trie_try_null"); + break; + + case _trie_retry_null : + sprintf(tmp, "_trie_retry_null"); + break; + + case _trie_do_null_in_pair : + sprintf(tmp, "_trie_do_null_in_pair"); + break; + + case _trie_trust_null_in_pair : + sprintf(tmp, "_trie_trust_null_in_pair"); + break; + + case _trie_try_null_in_pair : + sprintf(tmp, "_tri_try_null_in_paire"); + break; + + case _trie_retry_null_in_pair : + sprintf(tmp, "_trie_retry_null_in_pair"); + break; + + case _trie_do_pair : + sprintf(tmp, "_trie_do_pair"); + break; + + case _trie_trust_pair : + sprintf(tmp, "_trie_trust_pair"); + break; + + case _trie_try_pair : + sprintf(tmp, "_trie_try_pair"); + break; + + case _trie_retry_pair : + sprintf(tmp, "_trie_retry_pair"); + break; + + case _trie_do_appl : + sprintf(tmp, "_trie_do_appl"); + break; + + case _trie_trust_appl : + sprintf(tmp, "_trie_trust_appl"); + break; + + case _trie_try_appl : + sprintf(tmp, "_trie_try_appl"); + break; + + case _trie_retry_appl : + sprintf(tmp, "_trie_retry_appl"); + break; + + case _trie_do_appl_in_pair : + sprintf(tmp, "_trie_do_appl_in_pair"); + break; + + case _trie_trust_appl_in_pair : + sprintf(tmp, "_trie_trust_appl_in_pair"); + break; + + case _trie_try_appl_in_pair : + sprintf(tmp, "_trie_trty_appkl_in_pair"); + break; + + case _trie_retry_appl_in_pair : + sprintf(tmp, "_trie_retry_appl_in_pair"); + break; + + case _trie_do_extension : + sprintf(tmp, "_trie_do_extension"); + break; + + case _trie_trust_extension : + sprintf(tmp, "_trie_trust_extension"); + break; + + case _trie_try_extension : + sprintf(tmp, "_trie_try_extension"); + break; + + case _trie_retry_extension : + sprintf(tmp, "_trie_retry_extension"); + break; + + case _trie_do_double : + sprintf(tmp, "_trie_do_double"); + break; + + case _trie_trust_double : + sprintf(tmp, "_trie_trust_double"); + break; + + case _trie_try_double : + sprintf(tmp, "_trie_try_double"); + break; + + case _trie_retry_double : + sprintf(tmp, "_trie_retry_double"); + break; + + case _trie_do_longint : + sprintf(tmp, "_trie_do_longint"); + break; + + case _trie_trust_longint : + sprintf(tmp, "_trie_trust_longint"); + break; + + case _trie_try_longint : + sprintf(tmp, "_trie_try_longint"); + break; + + case _trie_retry_longint : + sprintf(tmp, "_trie_retry_longint"); + break; + + case _trie_do_gterm : + sprintf(tmp, "_trie_do_gterm"); + break; + + case _trie_trust_gterm : + sprintf(tmp, "_trie_trust_gterm"); + break; + + case _trie_try_gterm : + sprintf(tmp, "_trie_try_gterm"); + break; + + case _trie_retry_gterm : + sprintf(tmp, "_trie_retry_gterm"); + break; + +#endif + /* this instruction is hardwired */ +#ifdef YAPOR + case _or_last : + sprintf(tmp, "_or_last"); + break; + +#else + case _or_last : + sprintf(tmp, "_or_last"); + break; + +#endif + +#ifdef YAP_JIT + case _traced_Ystop : + sprintf(tmp, "_traced_Ystop"); + break; + + case _traced_Nstop : + sprintf(tmp, "_traced_Nstop"); + break; + + case _traced_try_me : + sprintf(tmp, "_traced_try_me"); + break; + + case _traced_retry_me : + sprintf(tmp, "_traced_retry_me"); + break; + + case _traced_trust_me : + sprintf(tmp, "_traced_trust_me"); + break; + + case _traced_enter_profiling : + sprintf(tmp, "_traced_enter_profiling"); + break; + + case _traced_retry_profiled : + sprintf(tmp, "_traced_retry_profiled"); + break; + + case _traced_profiled_retry_me : + sprintf(tmp, "_traced_profiled_retry_me"); + break; + + case _traced_profiled_trust_me : + sprintf(tmp, "_traced_profiled_trust_me"); + break; + + case _traced_profiled_retry_logical : + sprintf(tmp, "_traced_profiled_retry_logical"); + break; + + case _traced_profiled_trust_logical : + sprintf(tmp, "_traced_profiled_trust_logical"); + break; + + case _traced_count_call : + sprintf(tmp, "_traced_count_call"); + break; + + case _traced_count_retry : + sprintf(tmp, "_traced_count_retry"); + break; + + case _traced_count_retry_me : + sprintf(tmp, "_traced_count_retry_me"); + break; + + case _traced_count_trust_me : + sprintf(tmp, "_traced_count_trust_me"); + break; + + case _traced_count_retry_logical : + sprintf(tmp, "_traced_count_retry_logical"); + break; + + case _traced_count_trust_logical : + sprintf(tmp, "_traced_count_trust_logical"); + break; + + case _traced_lock_lu : + sprintf(tmp, "_traced_lock_lu"); + break; + + case _traced_unlock_lu : + sprintf(tmp, "_traced_unlock_lu"); + break; + + case _traced_alloc_for_logical_pred : + sprintf(tmp, "_traced_alloc_for_logical_pred"); + break; + + case _traced_copy_idb_term : + sprintf(tmp, "_traced_copy_idb_term"); + break; + + case _traced_unify_idb_term : + sprintf(tmp, "_traced_unify_idb_term"); + break; + + case _traced_ensure_space : + sprintf(tmp, "_traced_ensure_space"); + break; + + case _traced_spy_or_trymark : + sprintf(tmp, "_traced_spy_or_trymark"); + break; + + case _traced_try_and_mark : + sprintf(tmp, "_traced_try_and_mark"); + break; + + case _traced_count_retry_and_mark : + sprintf(tmp, "_traced_count_retry_and_mark"); + break; + + case _traced_profiled_retry_and_mark : + sprintf(tmp, "_traced_profiled_retry_and_mark"); + break; + + case _traced_retry_and_mark : + sprintf(tmp, "_traced_retry_and_mark"); + break; + + case _traced_trust_fail : + sprintf(tmp, "_traced_trust_fail"); + break; + + case _traced_op_fail : + sprintf(tmp, "_traced_op_fail"); + break; + + case _traced_cut : + sprintf(tmp, "_traced_cut"); + break; + + case _traced_cut_t : + sprintf(tmp, "_traced_cut_t"); + break; + + case _traced_cut_e : + sprintf(tmp, "_traced_cut_e"); + break; + + case _traced_save_b_x : + sprintf(tmp, "_traced_save_b_x"); + break; + + case _traced_save_b_y : + sprintf(tmp, "_traced_save_b_y"); + break; + + case _traced_commit_b_x : + sprintf(tmp, "_traced_commit_b_x"); + break; + + case _traced_commit_b_y : + sprintf(tmp, "_traced_commit_b_y"); + break; + + case _traced_execute : + sprintf(tmp, "_traced_execute"); + break; + + case _traced_dexecute : + sprintf(tmp, "_traced_dexecute"); + break; + + case _traced_fcall : + sprintf(tmp, "_traced_fcall"); + break; + + case _traced_call : + sprintf(tmp, "_traced_call"); + break; + + case _traced_procceed : + sprintf(tmp, "_traced_procceed"); + break; + + case _traced_allocate : + sprintf(tmp, "_traced_allocate"); + break; + + case _traced_deallocate : + sprintf(tmp, "_traced_deallocate"); + break; + +#ifdef BEAM + case _traced_retry_eam : + sprintf(tmp, "_traced_retry_eam"); + break; + +#endif +#ifdef BEAM + case _traced_run_eam : + sprintf(tmp, "_traced_run_eam"); + break; + +#endif + case _traced_get_x_var : + sprintf(tmp, "_traced_get_x_var"); + break; + + case _traced_get_y_var : + sprintf(tmp, "_traced_get_y_var"); + break; + + case _traced_get_yy_var : + sprintf(tmp, "_traced_get_yy_var"); + break; + + case _traced_get_x_val : + sprintf(tmp, "_traced_get_x_val"); + break; + + case _traced_get_y_val : + sprintf(tmp, "_traced_get_y_val"); + break; + + case _traced_get_atom : + sprintf(tmp, "_traced_get_atom"); + break; + + case _traced_get_2atoms : + sprintf(tmp, "_traced_get_2atoms"); + break; + + case _traced_get_3atoms : + sprintf(tmp, "_traced_get_3atoms"); + break; + + case _traced_get_4atoms : + sprintf(tmp, "_traced_get_4atoms"); + break; + + case _traced_get_5atoms : + sprintf(tmp, "_traced_get_5atoms"); + break; + + case _traced_get_6atoms : + sprintf(tmp, "_traced_get_6atoms"); + break; + + case _traced_get_list : + sprintf(tmp, "_traced_get_list"); + break; + + case _traced_get_struct : + sprintf(tmp, "_traced_get_struct"); + break; + + case _traced_get_float : + sprintf(tmp, "_traced_get_float"); + break; + + case _traced_get_longint : + sprintf(tmp, "_traced_get_longint"); + break; + + case _traced_get_bigint : + sprintf(tmp, "_traced_get_bigint"); + break; + + case _traced_get_dbterm : + sprintf(tmp, "_traced_get_dbterm"); + break; + + case _traced_glist_valx : + sprintf(tmp, "_traced_glist_valx"); + break; + + case _traced_glist_valy : + sprintf(tmp, "_traced_glist_valy"); + break; + + case _traced_gl_void_varx : + sprintf(tmp, "_traced_gl_void_varx"); + break; + + case _traced_gl_void_vary : + sprintf(tmp, "_traced_gl_void_vary"); + break; + + case _traced_gl_void_valx : + sprintf(tmp, "_traced_gl_void_valx"); + break; + + case _traced_gl_void_valy : + sprintf(tmp, "_traced_gl_void_valy"); + break; + + case _traced_unify_x_var : + sprintf(tmp, "_traced_unify_x_var"); + break; + + case _traced_unify_x_var_write : + sprintf(tmp, "_traced_unify_x_var_write"); + break; + + case _traced_unify_l_x_var : + sprintf(tmp, "_traced_unify_l_x_var"); + break; + + case _traced_unify_l_x_var_write : + sprintf(tmp, "_traced_unify_l_x_var_write"); + break; + + case _traced_unify_x_var2 : + sprintf(tmp, "_traced_unify_x_var2"); + break; + + case _traced_unify_x_var2_write : + sprintf(tmp, "_traced_unify_x_var2_write"); + break; + + case _traced_unify_l_x_var2 : + sprintf(tmp, "_traced_unify_l_x_var2"); + break; + + case _traced_unify_l_x_var2_write : + sprintf(tmp, "_traced_unify_l_x_var2_write"); + break; + + case _traced_unify_y_var : + sprintf(tmp, "_traced_unify_y_var"); + break; + + case _traced_unify_y_var_write : + sprintf(tmp, "_traced_unify_y_var_write"); + break; + + case _traced_unify_l_y_var : + sprintf(tmp, "_traced_unify_l_y_var"); + break; + + case _traced_unify_l_y_var_write : + sprintf(tmp, "_traced_unify_l_y_var_write"); + break; + + case _traced_unify_x_val : + sprintf(tmp, "_traced_unify_x_val"); + break; + + case _traced_unify_x_val_write : + sprintf(tmp, "_traced_unify_x_val_write"); + break; + + case _traced_unify_l_x_val : + sprintf(tmp, "_traced_unify_l_x_val"); + break; + + case _traced_unify_l_x_val_write : + sprintf(tmp, "_traced_uify_l_x_val_write"); + break; + + case _traced_unify_y_val : + sprintf(tmp, "_traced_unify_y_val"); + break; + + case _traced_unify_y_val_write : + sprintf(tmp, "_traced_unify_y_val_write"); + break; + + case _traced_unify_l_y_val : + sprintf(tmp, "_traced_unify_l_y_val"); + break; + + case _traced_unify_l_y_val_write : + sprintf(tmp, "_traced_unify_l_y_val_write"); + break; + + case _traced_unify_x_loc : + sprintf(tmp, "_traced_unify_x_loc"); + break; + + case _traced_unify_x_loc_write : + sprintf(tmp, "_traced_unify_x_loc_write"); + break; + + case _traced_unify_l_x_loc : + sprintf(tmp, "_traced_unify_l_x_loc"); + break; + + case _traced_unify_l_x_loc_write : + sprintf(tmp, "_traced_unify_l_x_loc_write"); + break; + + case _traced_unify_y_loc : + sprintf(tmp, "_traced_unify_y_loc"); + break; + + case _traced_unify_y_loc_write : + sprintf(tmp, "_traced_unify_y_loc_write"); + break; + + case _traced_unify_l_y_loc : + sprintf(tmp, "_traced_unify_l_y_loc"); + break; + + case _traced_unify_l_y_loc_write : + sprintf(tmp, "_traced_unify_l_y_loc_write"); + break; + + case _traced_unify_void : + sprintf(tmp, "_traced_unify_void"); + break; + + case _traced_unify_void_write : + sprintf(tmp, "_traced_unify_void_write"); + break; + + case _traced_unify_l_void : + sprintf(tmp, "_traced_unify_l_void"); + break; + + case _traced_unify_l_void_write : + sprintf(tmp, "_traced_unify_l_void_write"); + break; + + case _traced_unify_n_voids : + sprintf(tmp, "_traced_unify_n_voids"); + break; + + case _traced_unify_n_voids_write : + sprintf(tmp, "_traced_unify_n_voids_write"); + break; + + case _traced_unify_l_n_voids : + sprintf(tmp, "_traced_unify_l_n_voids"); + break; + + case _traced_unify_l_n_voids_write : + sprintf(tmp, "_traced_unify_l_n_voids_write"); + break; + + case _traced_unify_atom : + sprintf(tmp, "_traced_unify_atom"); + break; + + case _traced_unify_atom_write : + sprintf(tmp, "_traced_unify_atom_write"); + break; + + case _traced_unify_l_atom : + sprintf(tmp, "_traced_unify_l_atom"); + break; + + case _traced_unify_l_atom_write : + sprintf(tmp, "_traced_unify_l_atom_write"); + break; + + case _traced_unify_n_atoms : + sprintf(tmp, "_traced_unify_n_atoms"); + break; + + case _traced_unify_n_atoms_write : + sprintf(tmp, "_traced_unify_n_atoms_write"); + break; + + case _traced_unify_float : + sprintf(tmp, "_traced_unify_float"); + break; + + case _traced_unify_float_write : + sprintf(tmp, "_traced_unify_float_write"); + break; + + case _traced_unify_l_float : + sprintf(tmp, "_traced_unify_l_float"); + break; + + case _traced_unify_l_float_write : + sprintf(tmp, "_traced_unify_l_float_write"); + break; + + case _traced_unify_longint : + sprintf(tmp, "_traced_unify_longint"); + break; + + case _traced_unify_longint_write : + sprintf(tmp, "_traced_unify_longint_write"); + break; + + case _traced_unify_l_longint : + sprintf(tmp, "_traced_unify_l_longint"); + break; + + case _traced_unify_l_longint_write : + sprintf(tmp, "_traced_unify_l_longint_write"); + break; + + case _traced_unify_bigint : + sprintf(tmp, "_traced_unify_bigint"); + break; + + case _traced_unify_l_bigint : + sprintf(tmp, "_traced_unify_l_bigint"); + break; + + case _traced_unify_dbterm : + sprintf(tmp, "_traced_unify_dbterm"); + break; + + case _traced_unify_l_dbterm : + sprintf(tmp, "_traced_unify_l_dbterm"); + break; + + case _traced_unify_list : + sprintf(tmp, "_traced_unify_list"); + break; + + case _traced_unify_list_write : + sprintf(tmp, "_traced_unify_list_write"); + break; + + case _traced_unify_l_list : + sprintf(tmp, "_traced_unify_l_list"); + break; + + case _traced_unify_l_list_write : + sprintf(tmp, "_traced_unify_l_list_write"); + break; + + case _traced_unify_struct : + sprintf(tmp, "_traced_unify_struct"); + break; + + case _traced_unify_struct_write : + sprintf(tmp, "_traced_unify_struct_write"); + break; + + case _traced_unify_l_struc : + sprintf(tmp, "_traced_unify_l_struc"); + break; + + case _traced_unify_l_struc_write : + sprintf(tmp, "_traced_unify_l_struc_write"); + break; + + case _traced_put_x_var : + sprintf(tmp, "_traced_put_x_var"); + break; + + case _traced_put_y_var : + sprintf(tmp, "_traced_put_y_var"); + break; + + case _traced_put_x_val : + sprintf(tmp, "_traced_put_x_val"); + break; + + case _traced_put_xx_val : + sprintf(tmp, "_traced_put_xx_val"); + break; + + case _traced_put_y_val : + sprintf(tmp, "_traced_put_y_val"); + break; + + case _traced_put_y_vals : + sprintf(tmp, "_traced_put_y_vals"); + break; + + case _traced_put_unsafe : + sprintf(tmp, "_traced_put_unsafe"); + break; + + case _traced_put_atom : + sprintf(tmp, "_traced_put_atom"); + break; + + case _traced_put_dbterm : + sprintf(tmp, "_traced_put_dbterm"); + break; + + case _traced_put_bigint : + sprintf(tmp, "_traced_put_bigint"); + break; + + case _traced_put_float : + sprintf(tmp, "_traced_put_float"); + break; + + case _traced_put_longint : + sprintf(tmp, "_traced_put_longint"); + break; + + case _traced_put_list : + sprintf(tmp, "_traced_put_list"); + break; + + case _traced_put_struct : + sprintf(tmp, "_traced_put_struct"); + break; + + case _traced_write_x_var : + sprintf(tmp, "_traced_write_x_var"); + break; + + case _traced_write_void : + sprintf(tmp, "_traced_write_void"); + break; + + case _traced_write_n_voids : + sprintf(tmp, "_traced_write_n_voids"); + break; + + case _traced_write_y_var : + sprintf(tmp, "_traced_write_y_var"); + break; + + case _traced_write_x_val : + sprintf(tmp, "_traced_write_x_val"); + break; + + case _traced_write_x_loc : + sprintf(tmp, "_traced_write_x_loc"); + break; + + case _traced_write_y_val : + sprintf(tmp, "_traced_write_y_val"); + break; + + case _traced_write_y_loc : + sprintf(tmp, "_traced_write_y_loc"); + break; + + case _traced_write_atom : + sprintf(tmp, "_traced_write_atom"); + break; + + case _traced_write_bigint : + sprintf(tmp, "_traced_write_bigint"); + break; + + case _traced_write_dbterm : + sprintf(tmp, "_traced_write_dbterm"); + break; + + case _traced_write_float : + sprintf(tmp, "_traced_write_float"); + break; + + case _traced_write_longint : + sprintf(tmp, "_traced_write_longint"); + break; + + case _traced_write_n_atoms : + sprintf(tmp, "_traced_write_n_atoms"); + break; + + case _traced_write_list : + sprintf(tmp, "_traced_write_list"); + break; + + case _traced_write_l_list : + sprintf(tmp, "_traced_write_l_list"); + break; + + case _traced_write_struct : + sprintf(tmp, "_traced_write_struct"); + break; + + case _traced_write_l_struc : + sprintf(tmp, "_traced_write_l_struc"); + break; + + case _traced_save_pair_x : + sprintf(tmp, "_traced_save_pair_x"); + break; + + case _traced_save_pair_x_write : + sprintf(tmp, "_traced_save_pair_x_write"); + break; + + case _traced_save_pair_y : + sprintf(tmp, "_traced_save_pair_y"); + break; + + case _traced_save_pair_y_write : + sprintf(tmp, "_traced_save_pair_y_write"); + break; + + case _traced_save_appl_x : + sprintf(tmp, "_traced_save_appl_x"); + break; + + case _traced_save_appl_x_write : + sprintf(tmp, "_traced_save_appl_x_write"); + break; + + case _traced_save_appl_y : + sprintf(tmp, "_traced_save_appl_y"); + break; + + case _traced_save_appl_y_write : + sprintf(tmp, "_traced_save_appl_y_write"); + break; + + case _traced_jump : + sprintf(tmp, "_traced_jump"); + break; + + case _traced_move_back : + sprintf(tmp, "_traced_move_back"); + break; + + case _traced_skip : + sprintf(tmp, "_traced_skip"); + break; + + case _traced_either : + sprintf(tmp, "_traced_either"); + break; + + case _traced_or_else : + sprintf(tmp, "_traced_or_else"); + break; + + case _traced_pop_n : + sprintf(tmp, "_traced_pop_n"); + break; + + case _traced_pop : + sprintf(tmp, "_traced_pop"); + break; + + case _traced_call_cpred : + sprintf(tmp, "_traced_call_cpred"); + break; + + case _traced_execute_cpred : + sprintf(tmp, "_traced_execute_cpred"); + break; + + case _traced_call_usercpred : + sprintf(tmp, "_traced_call_usercpred"); + break; + + case _traced_call_c_wfail : + sprintf(tmp, "_traced_call_x_wfail"); + break; + + case _traced_try_c : + sprintf(tmp, "_traced_try_c"); + break; + + case _traced_retry_c : + sprintf(tmp, "_traced_retry_c"); + break; + +#ifdef CUT_C + case _traced_cut_c : + sprintf(tmp, "_traced_cut_c"); + break; + +#endif + case _traced_try_userc : + sprintf(tmp, "_traced_try_userc"); + break; + + case _traced_retry_userc : + sprintf(tmp, "_traced_retry_userc"); + break; + +#ifdef CUT_C + case _traced_cut_userc : + sprintf(tmp, "_traced_cut_userc"); + break; + +#endif + case _traced_lock_pred : + sprintf(tmp, "_traced_lock_pred"); + break; + + case _traced_index_pred : + sprintf(tmp, "_traced_index_pred"); + break; + +#ifdef THREADS + case _traced_thread_local : + sprintf(tmp, "_traced_thread_local"); + break; + +#endif + case _traced_expand_index : + sprintf(tmp, "_traced_expand_index"); + break; + + case _traced_expand_clauses : + sprintf(tmp, "_traced_expand_clauses"); + break; + + case _traced_undef_p : + sprintf(tmp, "_traced_undef_p"); + break; + + case _traced_spy_pred : + sprintf(tmp, "_traced_spy_pred"); + break; + + case _traced_try_clause : + sprintf(tmp, "_traced_try_clause"); + break; + + case _traced_try_clause2 : + sprintf(tmp, "_traced_try_clause2"); + break; + + case _traced_try_clause3 : + sprintf(tmp, "_traced_try_clause3"); + break; + + case _traced_try_clause4 : + sprintf(tmp, "_traced_try_clause4"); + break; + + case _traced_retry : + sprintf(tmp, "_traced_retry"); + break; + + case _traced_retry2 : + sprintf(tmp, "_traced_retry2"); + break; + + case _traced_retry3 : + sprintf(tmp, "_traced_retry3"); + break; + + case _traced_retry4 : + sprintf(tmp, "_traced_retry4"); + break; + + case _traced_trust : + sprintf(tmp, "_traced_trust"); + break; + + case _traced_try_in : + sprintf(tmp, "_traced_try_in"); + break; + + case _traced_enter_lu_pred : + sprintf(tmp, "_traced_enter_lu_pred"); + break; + + case _traced_try_logical : + sprintf(tmp, "_traced_try_logical"); + break; + + case _traced_retry_logical : + sprintf(tmp, "_traced_retry_logical"); + break; + + case _traced_trust_logical : + sprintf(tmp, "_traced_trust_logical"); + break; + + case _traced_user_switch : + sprintf(tmp, "_traced_user_switch"); + break; + + case _traced_switch_on_type : + sprintf(tmp, "_traced_switch_on_type"); + break; + + case _traced_switch_list_nl : + sprintf(tmp, "_traced_switch_list_nl"); + break; + + case _traced_switch_on_arg_type : + sprintf(tmp, "_traced_switch_on_arg_type"); + break; + + case _traced_switch_on_sub_arg_type : + sprintf(tmp, "_traced_switch_on_sub_arg_type"); + break; + + case _traced_jump_if_var : + sprintf(tmp, "_traced_jump_if_var"); + break; + + case _traced_jump_if_nonvar : + sprintf(tmp, "_traced_jump_if_nonvar"); + break; + + case _traced_if_not_then : + sprintf(tmp, "_traced_if_not_then"); + break; + + case _traced_switch_on_func : + sprintf(tmp, "_traced_switch_on_func"); + break; + + case _traced_switch_on_cons : + sprintf(tmp, "_traced_switch_on_cons"); + break; + + case _traced_go_on_func : + sprintf(tmp, "_traced_go_on_func"); + break; + + case _traced_go_on_cons : + sprintf(tmp, "_traced_go_on_cons"); + break; + + case _traced_if_func : + sprintf(tmp, "_traced_if_func"); + break; + + case _traced_if_cons : + sprintf(tmp, "_traced_if_cons"); + break; + + case _traced_index_dbref : + sprintf(tmp, "_traced_index_dbref"); + break; + + case _traced_index_blob : + sprintf(tmp, "_traced_index_blob"); + break; + + case _traced_index_long : + sprintf(tmp, "_traced_index_long"); + break; + + case _traced_jit_handler : + sprintf(tmp, "_traced_jit_handler"); + break; + + case _traced_p_atom_x : + sprintf(tmp, "_traced_p_atom_x"); + break; + + case _traced_p_atom_y : + sprintf(tmp, "_traced_p_atom_y"); + break; + + case _traced_p_atomic_x : + sprintf(tmp, "_traced_p_atomic_x"); + break; + + case _traced_p_atomic_y : + sprintf(tmp, "_traced_p_atomic_y"); + break; + + case _traced_p_integer_x : + sprintf(tmp, "_traced_p_integer_x"); + break; + + case _traced_p_integer_y : + sprintf(tmp, "_traced_p_integer_y"); + break; + + case _traced_p_nonvar_x : + sprintf(tmp, "_traced_p_nonvar_x"); + break; + + case _traced_p_nonvar_y : + sprintf(tmp, "_traced_p_nonvar_y"); + break; + + case _traced_p_number_x : + sprintf(tmp, "_traced_p_number_x"); + break; + + case _traced_p_number_y : + sprintf(tmp, "_traced_p_number_y"); + break; + + case _traced_p_var_x : + sprintf(tmp, "_traced_p_var_x"); + break; + + case _traced_p_var_y : + sprintf(tmp, "_traced_p_var_y"); + break; + + case _traced_p_db_ref_x : + sprintf(tmp, "_traced_p_db_ref_x"); + break; + + case _traced_p_db_ref_y : + sprintf(tmp, "_traced_p_db_ref_y"); + break; + + case _traced_p_primitive_x : + sprintf(tmp, "_traced_p_primitive_x"); + break; + + case _traced_p_primitive_y : + sprintf(tmp, "_traced_p_primitive_y"); + break; + + case _traced_p_compound_x : + sprintf(tmp, "_traced_p_compound_x"); + break; + + case _traced_p_compound_y : + sprintf(tmp, "_traced_p_compound_y"); + break; + + case _traced_p_float_x : + sprintf(tmp, "_traced_p_float_x"); + break; + + case _traced_p_float_y : + sprintf(tmp, "_traced_p_float_y"); + break; + + case _traced_p_plus_vv : + sprintf(tmp, "_traced_p_plus_vv"); + break; + + case _traced_p_plus_vc : + sprintf(tmp, "_traced_p_plus_vc"); + break; + + case _traced_p_plus_y_vv : + sprintf(tmp, "_traced_p_plus_y_vv"); + break; + + case _traced_p_plus_y_vc : + sprintf(tmp, "_traced_p_plus_y_vc"); + break; + + case _traced_p_minus_vv : + sprintf(tmp, "_traced_p_minus_vv"); + break; + + case _traced_p_minus_cv : + sprintf(tmp, "_traced_p_minus_cv"); + break; + + case _traced_p_minus_y_vv : + sprintf(tmp, "_traced_p_minus_y_vv"); + break; + + case _traced_p_minus_y_cv : + sprintf(tmp, "_traced_p_minus_y_cv"); + break; + + case _traced_p_times_vv : + sprintf(tmp, "_traced_p_times_vv"); + break; + + case _traced_p_times_vc : + sprintf(tmp, "_traced_p_times_vc"); + break; + + case _traced_p_times_y_vv : + sprintf(tmp, "_traced_p_times_y_vv"); + break; + + case _traced_p_times_y_vc : + sprintf(tmp, "_traced_p_times_y_vc"); + break; + + case _traced_p_div_vv : + sprintf(tmp, "_traced_p_div_vv"); + break; + + case _traced_p_div_vc : + sprintf(tmp, "_traced_p_div_vc"); + break; + + case _traced_p_div_cv : + sprintf(tmp, "_traced_p_div_cv"); + break; + + case _traced_p_div_y_vv : + sprintf(tmp, "_traced_p_div_y_vv"); + break; + + case _traced_p_div_y_vc : + sprintf(tmp, "_traced_p_div_y_vc"); + break; + + case _traced_p_div_y_cv : + sprintf(tmp, "_traced_p_div_y_cv"); + break; + + case _traced_p_and_vv : + sprintf(tmp, "_traced_p_and_vv"); + break; + + case _traced_p_and_vc : + sprintf(tmp, "_traced_p_and_vc"); + break; + + case _traced_p_and_y_vv : + sprintf(tmp, "_traced_p_and_y_vv"); + break; + + case _traced_p_and_y_vc : + sprintf(tmp, "_traced_p_and_y_vc"); + break; + + case _traced_p_or_vv : + sprintf(tmp, "_traced_p_or_vv"); + break; + + case _traced_p_or_vc : + sprintf(tmp, "_traced_p_or_vc"); + break; + + case _traced_p_or_y_vv : + sprintf(tmp, "_traced_p_or_y_vv"); + break; + + case _traced_p_or_y_vc : + sprintf(tmp, "_traced_p_or_y_vc"); + break; + + case _traced_p_sll_vv : + sprintf(tmp, "_traced_p_sll_vv"); + break; + + case _traced_p_sll_vc : + sprintf(tmp, "_traced_p_sll_vc"); + break; + + case _traced_p_sll_cv : + sprintf(tmp, "_traced_p_sll_cv"); + break; + + case _traced_p_sll_y_vv : + sprintf(tmp, "_traced_p_sll_y_vv"); + break; + + case _traced_p_sll_y_vc : + sprintf(tmp, "_traced_p_sll_y_vc"); + break; + + case _traced_p_sll_y_cv : + sprintf(tmp, "_traced_p_sll_y_cv"); + break; + + case _traced_p_slr_vv : + sprintf(tmp, "_traced_p_slr_vv"); + break; + + case _traced_p_slr_vc : + sprintf(tmp, "_traced_p_slr_vc"); + break; + + case _traced_p_slr_cv : + sprintf(tmp, "_traced_p_slr_cv"); + break; + + case _traced_p_slr_y_vv : + sprintf(tmp, "_traced_p_slr_y_vv"); + break; + + case _traced_p_slr_y_vc : + sprintf(tmp, "_traced_p_slr_y_vc"); + break; + + case _traced_p_slr_y_cv : + sprintf(tmp, "_traced_p_slr_y_cv"); + break; + + case _traced_call_bfunc_xx : + sprintf(tmp, "_traced_call_bfunc_xx"); + break; + + case _traced_call_bfunc_yx : + sprintf(tmp, "_traced_call_bfunc_yx"); + break; + + case _traced_call_bfunc_xy : + sprintf(tmp, "_traced_call_bfunc_xy"); + break; + + case _traced_call_bfunc_yy : + sprintf(tmp, "_traced_call_bfunc_yy"); + break; + + case _traced_p_equal : + sprintf(tmp, "_traced_p_equal"); + break; + + case _traced_p_dif : + sprintf(tmp, "_traced_p_dif"); + break; + + case _traced_p_eq : + sprintf(tmp, "_traced_p_eq"); + break; + + case _traced_p_arg_vv : + sprintf(tmp, "_traced_p_arg_vv"); + break; + + case _traced_p_arg_cv : + sprintf(tmp, "_traced_p_arg_cv"); + break; + + case _traced_p_arg_y_vv : + sprintf(tmp, "_traced_p_arg_y_vv"); + break; + + case _traced_p_arg_y_cv : + sprintf(tmp, "_traced_p_arg_y_cv"); + break; + + case _traced_p_func2s_vv : + sprintf(tmp, "_traced_p_func2s_vv"); + break; + + case _traced_p_func2s_cv : + sprintf(tmp, "_traced_p_func2s_cv"); + break; + + case _traced_p_func2s_vc : + sprintf(tmp, "_traced_p_func2s_vc"); + break; + + case _traced_p_func2s_y_vv : + sprintf(tmp, "_traced_p_func2s_y_vv"); + break; + + case _traced_p_func2s_y_cv : + sprintf(tmp, "_traced_p_func2s_y_cv"); + break; + + case _traced_p_func2s_y_vc : + sprintf(tmp, "_traced_p_func2s_y_vc"); + break; + + case _traced_p_func2f_xx : + sprintf(tmp, "_traced_p_func2f_xx"); + break; + + case _traced_p_func2f_xy : + sprintf(tmp, "_traced_p_func2f_xy"); + break; + + case _traced_p_func2f_yx : + sprintf(tmp, "_traced_p_func2f_yx"); + break; + + case _traced_p_func2f_yy : + sprintf(tmp, "_traced_p_func2f_yy"); + break; + + case _traced_p_functor : + sprintf(tmp, "_traced_p_functor"); + break; + + case _traced_p_execute2 : + sprintf(tmp, "_traced_p_execute2"); + break; + + case _traced_p_execute : + sprintf(tmp, "_traced_p_execute"); + break; + + case _traced_p_execute_tail : + sprintf(tmp, "_traced_p_execute_tail"); + break; + +#ifdef YAPOR + case _traced_getwork_first_time : + sprintf(tmp, "_traced_getwork_first_time"); + break; + + case _traced_getwork : + sprintf(tmp, "_traced_getwork"); + break; + + case _traced_getwork_seq : + sprintf(tmp, "_traced_getwork_seq"); + break; + + case _traced_sync : + sprintf(tmp, "_traced_sync"); + break; + +#endif +#ifdef TABLING +#ifdef TABLING_INNER_CUTS + case _traced_clause_with_cut : + sprintf(tmp, "_traced_clause_with_cut"); + break; + +#endif + case _traced_table_load_answer : + sprintf(tmp, "_traced_table_load_answer"); + break; + + case _traced_table_try_answer : + sprintf(tmp, "_traced_table_try_answer"); + break; + + case _traced_table_try_single : + sprintf(tmp, "_traced_table_try_single"); + break; + + case _traced_table_try_me : + sprintf(tmp, "_traced_table_try_me"); + break; + + case _traced_table_try : + sprintf(tmp, "_traced_table_try"); + break; + + case _traced_table_retry_me : + sprintf(tmp, "_traced_table_retry_me"); + break; + + case _traced_table_retry : + sprintf(tmp, "_traced_table_retry"); + break; + + case _traced_table_trust_me : + sprintf(tmp, "_traced_table_trust_me"); + break; + + case _traced_table_trust : + sprintf(tmp, "_traced_table_trust"); + break; + + case _traced_table_new_answer : + sprintf(tmp, "_traced_table_new_answer"); + break; + + case _traced_table_answer_resolution : + sprintf(tmp, "_traced_table_answer_resolution"); + break; + + case _traced_table_completion : + sprintf(tmp, "_traced_table_completion"); + break; + +#ifdef THREADS_CONSUMER_SHARING + case _traced_table_answer_resolution_completion: + sprintf(tmp, "_traced_table_answer_resolution_completion"); + break; + +#endif + case _traced_trie_do_var : + sprintf(tmp, "_traced_trie_do_var"); + break; + + case _traced_trie_trust_var : + sprintf(tmp, "_traced_trie_trust_var"); + break; + + case _traced_trie_try_var : + sprintf(tmp, "_traced_trie_try_var"); + break; + + case _traced_trie_retry_var : + sprintf(tmp, "_traced_trie_retry_var"); + break; + + case _traced_trie_do_var_in_pair : + sprintf(tmp, "_traced_trie_do_var_in_pair"); + break; + + case _traced_trie_trust_var_in_pair : + sprintf(tmp, "_traced_trie_trust_var_in_pair"); + break; + + case _traced_trie_try_var_in_pair : + sprintf(tmp, "_traced_trie_try_var_in_pair"); + break; + + case _traced_trie_retry_var_in_pair : + sprintf(tmp, "_traced_trie_retry_var_in_pair"); + break; + + case _traced_trie_do_val : + sprintf(tmp, "_traced_trie_do_val"); + break; + + case _traced_trie_trust_val : + sprintf(tmp, "_traced_trie_trust_val"); + break; + + case _traced_trie_try_val : + sprintf(tmp, "_traced_trie_try_val"); + break; + + case _traced_trie_retry_val : + sprintf(tmp, "_traced_trie_retry_val"); + break; + + case _traced_trie_do_val_in_pair : + sprintf(tmp, "_traced_trie_do_val_in_pair"); + break; + + case _traced_trie_trust_val_in_pair : + sprintf(tmp, "_traced_trie_trust_val_in_pair"); + break; + + case _traced_trie_try_val_in_pair : + sprintf(tmp, "_traced_trie_try_val_in_pair"); + break; + + case _traced_trie_retry_val_in_pair : + sprintf(tmp, "_traced_trie_retry_val_in_pair"); + break; + + case _traced_trie_do_atom : + sprintf(tmp, "_traced_trie_do_atom"); + break; + + case _traced_trie_trust_atom : + sprintf(tmp, "_traced_trie_trust_atom"); + break; + + case _traced_trie_try_atom : + sprintf(tmp, "_traced_trie_try_atom"); + break; + + case _traced_trie_retry_atom : + sprintf(tmp, "_traced_trie_retry_atom"); + break; + + case _traced_trie_do_atom_in_pair : + sprintf(tmp, "_traced_trie_do_atom_in_pair"); + break; + + case _traced_trie_trust_atom_in_pair : + sprintf(tmp, "_traced_trie_trust_atom_in_pair"); + break; + + case _traced_trie_try_atom_in_pair : + sprintf(tmp, "_traced_trie_try_atom_in_pair"); + break; + + case _traced_trie_retry_atom_in_pair : + sprintf(tmp, "_traced_trie_retry_atom_in_pair"); + break; + + case _traced_trie_do_null : + sprintf(tmp, "_traced_trie_do_null"); + break; + + case _traced_trie_trust_null : + sprintf(tmp, "_traced_trie_trust_null"); + break; + + case _traced_trie_try_null : + sprintf(tmp, "_traced_trie_try_null"); + break; + + case _traced_trie_retry_null : + sprintf(tmp, "_traced_trie_retry_null"); + break; + + case _traced_trie_do_null_in_pair : + sprintf(tmp, "_traced_trie_do_null_in_pair"); + break; + + case _traced_trie_trust_null_in_pair : + sprintf(tmp, "_traced_trie_trust_null_in_pair"); + break; + + case _traced_trie_try_null_in_pair : + sprintf(tmp, "_traced_tri_try_null_in_paire"); + break; + + case _traced_trie_retry_null_in_pair : + sprintf(tmp, "_traced_trie_retry_null_in_pair"); + break; + + case _traced_trie_do_pair : + sprintf(tmp, "_traced_trie_do_pair"); + break; + + case _traced_trie_trust_pair : + sprintf(tmp, "_traced_trie_trust_pair"); + break; + + case _traced_trie_try_pair : + sprintf(tmp, "_traced_trie_try_pair"); + break; + + case _traced_trie_retry_pair : + sprintf(tmp, "_traced_trie_retry_pair"); + break; + + case _traced_trie_do_appl : + sprintf(tmp, "_traced_trie_do_appl"); + break; + + case _traced_trie_trust_appl : + sprintf(tmp, "_traced_trie_trust_appl"); + break; + + case _traced_trie_try_appl : + sprintf(tmp, "_traced_trie_try_appl"); + break; + + case _traced_trie_retry_appl : + sprintf(tmp, "_traced_trie_retry_appl"); + break; + + case _traced_trie_do_appl_in_pair : + sprintf(tmp, "_traced_trie_do_appl_in_pair"); + break; + + case _traced_trie_trust_appl_in_pair : + sprintf(tmp, "_traced_trie_trust_appl_in_pair"); + break; + + case _traced_trie_try_appl_in_pair : + sprintf(tmp, "_traced_trie_trty_appkl_in_pair"); + break; + + case _traced_trie_retry_appl_in_pair : + sprintf(tmp, "_traced_trie_retry_appl_in_pair"); + break; + + case _traced_trie_do_extension : + sprintf(tmp, "_traced_trie_do_extension"); + break; + + case _traced_trie_trust_extension : + sprintf(tmp, "_traced_trie_trust_extension"); + break; + + case _traced_trie_try_extension : + sprintf(tmp, "_traced_trie_try_extension"); + break; + + case _traced_trie_retry_extension : + sprintf(tmp, "_traced_trie_retry_extension"); + break; + + case _traced_trie_do_double : + sprintf(tmp, "_traced_trie_do_double"); + break; + + case _traced_trie_trust_double : + sprintf(tmp, "_traced_trie_trust_double"); + break; + + case _traced_trie_try_double : + sprintf(tmp, "_traced_trie_try_double"); + break; + + case _traced_trie_retry_double : + sprintf(tmp, "_traced_trie_retry_double"); + break; + + case _traced_trie_do_longint : + sprintf(tmp, "_traced_trie_do_longint"); + break; + + case _traced_trie_trust_longint : + sprintf(tmp, "_traced_trie_trust_longint"); + break; + + case _traced_trie_try_longint : + sprintf(tmp, "_traced_trie_try_longint"); + break; + + case _traced_trie_retry_longint : + sprintf(tmp, "_traced_trie_retry_longint"); + break; + + case _traced_trie_do_gterm : + sprintf(tmp, "_traced_trie_do_gterm"); + break; + + case _traced_trie_trust_gterm : + sprintf(tmp, "_traced_trie_trust_gterm"); + break; + + case _traced_trie_try_gterm : + sprintf(tmp, "_traced_trie_try_gterm"); + break; + + case _traced_trie_retry_gterm : + sprintf(tmp, "_traced_trie_retry_gterm"); + break; + +#endif + /* this instruction is hardwired */ +#ifdef YAPOR + case _traced_or_last : + sprintf(tmp, "_traced_or_last"); + break; + +#else + case _traced_or_last : + sprintf(tmp, "_traced_or_last"); + break; + +#endif + default: + tmp[0] = '\0'; +#endif /* YAP_JIT */ + + } + strcpy(out, prepend_term); + strcat(out, tmp); + strcat(out, append_term); + } diff --git a/JIT/HPP/yaam_macros.hpp b/JIT/HPP/yaam_macros.hpp new file mode 100644 index 000000000..4faec1f85 --- /dev/null +++ b/JIT/HPP/yaam_macros.hpp @@ -0,0 +1,1311 @@ +typedef enum { + #include "Yap_BasicBlocks.h" +} YAP_BBs; + +#ifndef _NATIVE + +#include "lastop.h" +#include "sprintblock.h" +#include "sprint_op.hpp" + +static inline Int +set_last_deeply(BlocksContext* b, BlocksContext** last) { + BlocksContext *last1, *last2; + while (b) { + if (b->blockty == MULTIPLE_DESTINY && b->thisp == BLOCKADDRESS && b->u.mdb.id == BLOCK) { + *last = b; + return 1; + } + if (b->blockty == CONDITIONAL_HEADER) { + Int _if = set_last_deeply(b->u.kb._if, &last1); + Int _else = set_last_deeply(b->u.kb._else, &last2); + if (_if || _else) { + if (_if) *last = last1; + else *last = last2; + return 1; + } + } + b = (BlocksContext*)b->next; + } + *last = NULL; + return 0; +} + +#ifdef USE_GMP +#define FUNCTOR_LARGE_INT "(CELL)f0 == (CELL)FunctorLongInt || (CELL)f0 == (CELL)FunctorBigInt" +#else +#define FUNCTOR_LARGE_INT "(CELL)f0 == (CELL)FunctorLongInt" +#endif + +#define SET_DEPTH(yaam_block) \ + { \ + inst_depth = 0; \ + if (yaam_block == GET_X_VAL_INSTINIT) { \ + inst_depth = 2; \ + } \ + } + +#define BACK_TO_HEADER() \ + { \ + while (curblock->prev) { \ + curblock = (BlocksContext*)curblock->prev; \ + } \ + curblock = (BlocksContext*)curblock->u.xb.header; \ + } + +#define FREE(N) \ + { \ + int j; \ + for (j = 0; j < N; j++) { \ + free(cexp[j]); \ + } \ + free(cexp); \ + free(condty); \ + } + +#define YAAM_BLOCK_IS_DEEPB_MULTIPLE_DESTINY(yaam_block) \ + yaam_block == GL_VOID_VALX_GLIST_VOID_VALX_NONVAR_NONVAR || \ + yaam_block == GL_VOID_VALX_GLIST_VOID_VALX_READ || \ + yaam_block == GL_VOID_VALY_GLIST_VOID_VALY_NONVAR_NONVAR || \ + yaam_block == GL_VOID_VALY_GLIST_VOID_VALY_READ || \ + yaam_block == UNIFY_X_VAL_UVALX_NONVAR_NONVAR || \ + yaam_block == UNIFY_L_X_VAL_ULVALX_NONVAR_NONVAR || \ + +#define EMIT_CONDITIONAL2_BLOCK(yaam_block, EXP1, EXP2, F1, F2) \ + if (first_valid_conditional) { \ + EMIT_2DEEP_BLOCK_TEST(yaam_block, EXP1, EXP2, F1, F2); \ + first_valid_conditional = 0; \ + } \ + else { \ + EMIT_DEEPFK_BLOCK_TEST(yaam_block); \ + } + +#define EMIT_CONDITIONAL1_BLOCK(yaam_block, EXP1, F1) \ + if (first_valid_conditional) { \ + EMIT_1DEEP_BLOCK_TEST(yaam_block, EXP1, F1); \ + first_valid_conditional = 0; \ + } \ + else { \ + EMIT_DEEPFK_BLOCK_TEST(yaam_block); \ + } + +#if defined(YAPOR) || defined(THREADS) +#define YAAM_BLOCK_IS_SIMPLEB_MULTIPLE_DESTINY(yaam_block) \ + yaam_block == YAAM_UNIFYBOUND || \ + yaam_block == PROFILED_RETRY_LOGICAL_END || \ + yaam_block == PROFILED_TRUST_LOGICAL_END || \ + yaam_block == COUNT_RETRY_LOGICAL_END || \ + yaam_block == COUNT_TRUST_LOGICAL_END || \ + yaam_block == LOCK_LU_END || \ + yaam_block == TRY_AND_MARK_YAPOR_THREADS_NOYAPOR_IF || \ +#else /* defined(YAPOR) || defined(THREADS) */ +#define YAAM_BLOCK_IS_SIMPLEB_MULTIPLE_DESTINY(yaam_block) \ + yaam_block == YAAM_UNIFYBOUND || \ + yaam_block == PROFILED_RETRY_LOGICAL_END || \ + yaam_block == PROFILED_TRUST_LOGICAL_END || \ + yaam_block == COUNT_RETRY_LOGICAL_END || \ + yaam_block == COUNT_TRUST_LOGICAL_END || \ + yaam_block == LOCK_LU_END +#endif + +#if YAP_DBG_PREDS +#define PRINT_BLOCK_MAC(yaam_block) print_block(yaam_block, ON_PROFILED_INTERPRETER); +#else /* YAP_DBG_PREDS */ +#define PRINT_BLOCK_MAC(yaam_block) +#endif /* YAP_DBG_PREDS */ + +#if YAP_STAT_PREDS +#define INIT_SPENT_PROF_TIME_FOR_HEAD(i) \ + struct rusage rustart, ruend; \ + struct timeval timstart, timend; \ + getrusage(RUSAGE_SELF, &rustart); + +#define COMPLETE_SPENT_PROF_TIME_FOR_HEAD(i) \ + getrusage(RUSAGE_SELF, &ruend); \ + timstart = rustart.ru_utime; \ + timend = ruend.ru_utime; \ + double spenttime = ((double)timend.tv_sec - (double)timstart.tv_sec) + ((double)timend.tv_usec - (double)timstart.tv_usec) / 1000000.0; \ + IntermediatecodeArea->area.profiling_time[i] += spenttime; + +#define INIT_SPENT_PROF_TIME() \ + struct rusage rustart, ruend; \ + struct timeval timstart, timend; \ + getrusage(RUSAGE_SELF, &rustart); + +#define COMPLETE_SPENT_PROF_TIME() \ + getrusage(RUSAGE_SELF, &ruend); \ + timstart = rustart.ru_utime; \ + timend = ruend.ru_utime; \ + double spenttime = ((double)timend.tv_sec - (double)timstart.tv_sec) + ((double)timend.tv_usec - (double)timstart.tv_usec) / 1000000.0; \ + IntermediatecodeArea->area.profiling_time[i] += spenttime; + +#else /* YAP_STAT_PREDS */ +#define INIT_SPENT_PROF_TIME_FOR_HEAD(i) + +#define COMPLETE_SPENT_PROF_TIME_FOR_HEAD(i) + +#define INIT_SPENT_PROF_TIME() + +#define COMPLETE_SPENT_PROF_TIME() + +#endif /* YAP_STAT_PREDS */ + +static void EMIT_MULTIPLE_DESTINY_BLOCK_TEST(YAP_BBs); + +static void +EMIT_MULTIPLE_DESTINY_BLOCK_TEST(YAP_BBs yaam_block) { + if (IntermediatecodeArea->n) { + PRINT_BLOCK_MAC(yaam_block); + int i; + for (i = 0; i < IntermediatecodeArea->n; i++) { + if (IntermediatecodeArea->area.t && + IntermediatecodeArea->area.ok && + IntermediatecodeArea->area.isactive && + IntermediatecodeArea->area.isactive[i]) + { + INIT_SPENT_PROF_TIME(); + curtrace = &IntermediatecodeArea->area.t[i]; + BlocksContext *curblock; + if (!globalcurblock) curblock = (*curtrace)->bc; + else curblock = globalcurblock[i]; + while (curblock->next) { + if ( (curblock->blockty == SIMPLE && curblock->thisp == (CELL)curpreg && curblock->u.sb.id == (UInt)yaam_block) || + (curblock->blockty == MULTIPLE_DESTINY && curblock->thisp == (CELL)curpreg && curblock->u.mdb.id == (UInt)yaam_block) ) + { break; } + curblock = (BlocksContext*)curblock->next; + } + if (!curblock->next && + (curblock->blockty != SIMPLE || curblock->thisp != (CELL)curpreg || curblock->u.sb.id != (UInt)yaam_block) && + (curblock->blockty != MULTIPLE_DESTINY || curblock->thisp != (CELL)curpreg || curblock->u.mdb.id != (UInt)yaam_block) + ) { + BlocksContext* t = (BlocksContext*)malloc(sizeof(BlocksContext)); + t->thisp = (CELL)curpreg; + t->next = 0; + t->prev = (CELL)curblock; + t->blockty = MULTIPLE_DESTINY; + t->u.mdb.id = (UInt)yaam_block; + t->u.mdb.ndest = 0; + t->u.mdb.nfaillabels = 0; + t->u.mdb.destiny.p = NULL; + t->u.mdb.destiny.labels = NULL; + t->u.mdb.faildestiny.p = NULL; + t->u.mdb.faildestiny.labels = NULL; + (*curtrace)->n += 1; + curblock->next = (CELL)t; + IntermediatecodeArea->area.lastblock[i] = t; + } + else { + IntermediatecodeArea->area.lastblock[i] = curblock; + } + COMPLETE_SPENT_PROF_TIME(); + } + } + } +} + +static void EMIT_SIMPLE_BLOCK_TEST(YAP_BBs); + +static void +EMIT_SIMPLE_BLOCK_TEST(YAP_BBs yaam_block) { + if (IntermediatecodeArea->n) { + PRINT_BLOCK_MAC(yaam_block); + int i; + for (i = 0; i < IntermediatecodeArea->n; i++) { + if (IntermediatecodeArea->area.t && + IntermediatecodeArea->area.ok && + IntermediatecodeArea->area.isactive && + IntermediatecodeArea->area.isactive[i]) + { + INIT_SPENT_PROF_TIME(); + curtrace = &IntermediatecodeArea->area.t[i]; + BlocksContext *curblock; + if (!globalcurblock) curblock = (*curtrace)->bc; + else curblock = globalcurblock[i]; + while (curblock->next) { + if ( (curblock->blockty == SIMPLE && curblock->thisp == (CELL)curpreg && curblock->u.sb.id == (UInt)yaam_block) || + (curblock->blockty == MULTIPLE_DESTINY && curblock->thisp == (CELL)curpreg && curblock->u.mdb.id == (UInt)yaam_block) ) + { break; } + curblock = (BlocksContext*)curblock->next; + } + if (!curblock->next && + (curblock->blockty != SIMPLE || curblock->thisp != (CELL)curpreg || curblock->u.sb.id != (UInt)yaam_block) && + (curblock->blockty != MULTIPLE_DESTINY || curblock->thisp != (CELL)curpreg || curblock->u.mdb.id != (UInt)yaam_block) + ) { + BlocksContext* t = (BlocksContext*)malloc(sizeof(BlocksContext)); + t->thisp = (CELL)curpreg; + t->next = 0; + t->prev = (CELL)curblock; + t->blockty = SIMPLE; + t->u.sb.id = (UInt)yaam_block; + t->u.sb.label_destiny = NULL; + (*curtrace)->n += 1; + curblock->next = (CELL)t; + IntermediatecodeArea->area.lastblock[i] = t; + } + else { + IntermediatecodeArea->area.lastblock[i] = curblock; + } + COMPLETE_SPENT_PROF_TIME(); + } + } + } +} + +#define EMIT_3DEEP_BLOCK(yaam_block, EXP1, EXP2, EXP3, N1, N2, N3) \ + if (IntermediatecodeArea->n) { \ + char *tmp = (char*) malloc(2048*sizeof(char)); \ + sprint_block((YAP_BBs)yaam_block, &tmp); \ + fprintf(stderr, "OOps!! Encontrei um bloco não instrumentado corretamente -- %s\n", tmp); \ + free(tmp); \ + exit(1); \ + } + +#define EMIT_2DEEP_BLOCK(yaam_block, EXP1, EXP2, N1, N2) \ + if (IntermediatecodeArea->n) { \ + char *tmp = (char*) malloc(2048*sizeof(char)); \ + sprint_block((YAP_BBs)yaam_block, &tmp); \ + fprintf(stderr, "OOps!! Encontrei um bloco não instrumentado corretamente -- %s\n", tmp); \ + free(tmp); \ + exit(1); \ + } + +#define EMIT_1DEEP_BLOCK(yaam_block, EXP, N) \ + if (IntermediatecodeArea->n) { \ + char *tmp = (char*) malloc(2048*sizeof(char)); \ + sprint_block((YAP_BBs)yaam_block, &tmp); \ + fprintf(stderr, "OOps!! Encontrei um bloco não instrumentado corretamente -- %s\n", tmp); \ + free(tmp); \ + exit(1); \ + } + +#define EMIT_SIMPLE_BLOCK(yaam_block) \ + if (IntermediatecodeArea->n) { \ + char *tmp = (char*) malloc(2048*sizeof(char)); \ + sprint_block((YAP_BBs)yaam_block, &tmp); \ + fprintf(stderr, "OOps!! Encontrei um bloco não instrumentado corretamente -- %s\n", tmp); \ + } + + +#define REDEFINE_DESTINY(A, B) \ + if ((A)->blockty == SIMPLE_ENTRY) { \ + strcpy((A)->u.eb.label_destiny, B->u.eb.label_entry); \ + } \ + else if ((A)->blockty == SIMPLE) { \ + strcpy((A)->u.sb.label_destiny, B->u.eb.label_entry); \ + } + +#define SET_FAILDESTINY_AS_MULTIPLE(B, i) \ + int k = 0; \ + while (k < IntermediatecodeArea->area.lastblock[i]->u.mdb.nfaillabels) { \ + if (!strcmp(IntermediatecodeArea->area.lastblock[i]->u.mdb.faildestiny.labels[k], (B)->u.eb.label_entry)) break; \ + k++; \ + } \ + if (k == IntermediatecodeArea->area.lastblock[i]->u.mdb.nfaillabels) { \ + IntermediatecodeArea->area.lastblock[i]->u.mdb.nfaillabels++; \ + IntermediatecodeArea->area.lastblock[i]->u.mdb.faildestiny.p = (UInt*)realloc(IntermediatecodeArea->area.lastblock[i]->u.mdb.faildestiny.p, IntermediatecodeArea->area.lastblock[i]->u.mdb.nfaillabels*sizeof(UInt)); \ + IntermediatecodeArea->area.lastblock[i]->u.mdb.faildestiny.p[IntermediatecodeArea->area.lastblock[i]->u.mdb.nfaillabels-1] = (B)->thisp; \ + IntermediatecodeArea->area.lastblock[i]->u.mdb.faildestiny.labels = (char**)realloc(IntermediatecodeArea->area.lastblock[i]->u.mdb.faildestiny.labels, IntermediatecodeArea->area.lastblock[i]->u.mdb.nfaillabels*sizeof(char*)); \ + IntermediatecodeArea->area.lastblock[i]->u.mdb.faildestiny.labels[IntermediatecodeArea->area.lastblock[i]->u.mdb.nfaillabels-1] = (char*)malloc(1024*sizeof(char)); \ + strcpy(IntermediatecodeArea->area.lastblock[i]->u.mdb.faildestiny.labels[IntermediatecodeArea->area.lastblock[i]->u.mdb.nfaillabels-1], (B)->u.eb.label_entry); \ + } + +#define SET_DESTINY_AS_MULTIPLE(B, i) \ + int k = 0; \ + while (k < IntermediatecodeArea->area.lastblock[i]->u.mdb.ndest) { \ + if (!strcmp(IntermediatecodeArea->area.lastblock[i]->u.mdb.destiny.labels[k], (B)->u.eb.label_entry)) break; \ + k++; \ + } \ + if (k == IntermediatecodeArea->area.lastblock[i]->u.mdb.ndest) { \ + IntermediatecodeArea->area.lastblock[i]->u.mdb.ndest++; \ + IntermediatecodeArea->area.lastblock[i]->u.mdb.destiny.p = (UInt*)realloc(IntermediatecodeArea->area.lastblock[i]->u.mdb.destiny.p, IntermediatecodeArea->area.lastblock[i]->u.mdb.ndest*sizeof(UInt)); \ + IntermediatecodeArea->area.lastblock[i]->u.mdb.destiny.p[IntermediatecodeArea->area.lastblock[i]->u.mdb.ndest-1] = (B)->thisp; \ + IntermediatecodeArea->area.lastblock[i]->u.mdb.destiny.labels = (char**)realloc(IntermediatecodeArea->area.lastblock[i]->u.mdb.destiny.labels, IntermediatecodeArea->area.lastblock[i]->u.mdb.ndest*sizeof(char*)); \ + IntermediatecodeArea->area.lastblock[i]->u.mdb.destiny.labels[IntermediatecodeArea->area.lastblock[i]->u.mdb.ndest-1] = (char*)malloc(1024*sizeof(char)); \ + strcpy(IntermediatecodeArea->area.lastblock[i]->u.mdb.destiny.labels[IntermediatecodeArea->area.lastblock[i]->u.mdb.ndest-1], (B)->u.eb.label_entry); \ + } + +#define SET_DESTINY(yaam_block, B, i) \ + if (IntermediatecodeArea->area.lastblock[i]) { \ + if (IntermediatecodeArea->area.lastblock[i]->blockty == MULTIPLE_DESTINY) { \ + if (yaam_block == LBL_FAIL_INSTINIT) { \ + SET_FAILDESTINY_AS_MULTIPLE((B), i); \ + } \ + else { \ + SET_DESTINY_AS_MULTIPLE((B), i); \ + } \ + } \ + if (IntermediatecodeArea->area.lastblock[i]->blockty == SIMPLE_ENTRY) { \ + if (!IntermediatecodeArea->area.lastblock[i]->u.eb.label_destiny) { \ + IntermediatecodeArea->area.lastblock[i]->u.eb.label_destiny = (char*)malloc(1024*sizeof(char)); \ + strcpy(IntermediatecodeArea->area.lastblock[i]->u.eb.label_destiny, (B)->u.eb.label_entry); \ + } \ + } \ + else if (IntermediatecodeArea->area.lastblock[i]->blockty == SIMPLE) { \ + if (IntermediatecodeArea->area.lastblock[i]->u.sb.id != NoStackExecute_Exception) { \ + if (!IntermediatecodeArea->area.lastblock[i]->u.sb.label_destiny) { \ + IntermediatecodeArea->area.lastblock[i]->u.sb.label_destiny = (char*)malloc(1024*sizeof(char)); \ + strcpy(IntermediatecodeArea->area.lastblock[i]->u.sb.label_destiny, (B)->u.eb.label_entry); \ + } \ + } \ + } \ + } + +static void EMIT_HEAD_BLOCK(yamop*); + +static void +EMIT_HEAD_BLOCK(yamop* __P) { + INIT_SPENT_PROF_TIME_FOR_HEAD(__P->y_u.jhc.jh->caa.taddress); + if (curtrace) { + curpreg = __P; + if (curpreg == headoftrace && curtrace && (*curtrace)->n) { + SET_DESTINY(JIT_HANDLER_INSTINIT, (*curtrace)->bc, __P->y_u.J.jh->caa.taddress); + } + else { + (*curtrace)->bc = (BlocksContext*)malloc(sizeof(BlocksContext)); + (*curtrace)->bc->blockty = SIMPLE_ENTRY; + (*curtrace)->bc->thisp = (CELL)curpreg; + (*curtrace)->bc->next = 0; + (*curtrace)->bc->prev = 0; + (*curtrace)->bc->u.eb.id = (UInt)JIT_HANDLER_INSTINIT; + (*curtrace)->bc->u.eb.label_destiny = NULL; + (*curtrace)->bc->u.eb.label_entry = (char*)malloc(1024*sizeof(char)); + strcpy((*curtrace)->bc->u.eb.label_entry, "LBL_JIT_HANDLER_INSTINIT"); + char *hex = (char*)malloc(33*sizeof(char)); + sprintf(hex, "_%lX", (UInt)curpreg); + strcat((*curtrace)->bc->u.eb.label_entry, hex); + (*curtrace)->n = 1; + } + } + COMPLETE_SPENT_PROF_TIME_FOR_HEAD(__P->y_u.jhc.jh->caa.taddress); +} + +static void EMIT_ENTRY_BLOCK(yamop*, YAP_BBs); + +static void +EMIT_ENTRY_BLOCK(yamop* __P, YAP_BBs yaam_block) { + if (IntermediatecodeArea->n) { + PRINT_BLOCK_MAC(yaam_block); + if (globalcurblock) { + free(globalcurblock); + globalcurblock = NULL; + } + int i; + for (i = 0; i < IntermediatecodeArea->n; i++) { + if (IntermediatecodeArea->area.t && + IntermediatecodeArea->area.ok && + IntermediatecodeArea->area.isactive && + IntermediatecodeArea->area.isactive[i]) + { + INIT_SPENT_PROF_TIME(); + curtrace = &IntermediatecodeArea->area.t[i]; + curpreg = __P; + BlocksContext *curblock = (*curtrace)->bc; + while (curblock->next) { + if (curblock->blockty == SIMPLE_ENTRY && curblock->thisp == (CELL)curpreg && curblock->u.eb.id == (UInt)yaam_block) { + break; + } + curblock = (BlocksContext*)curblock->next; + } + if (!curblock->next && + (curblock->blockty != SIMPLE_ENTRY || curblock->thisp != (CELL)curpreg || curblock->u.eb.id != (UInt)yaam_block) + ) { + BlocksContext* t = (BlocksContext*)malloc(sizeof(BlocksContext)); + t = (BlocksContext*)malloc(sizeof(BlocksContext)); + t->blockty = SIMPLE_ENTRY; + t->thisp = (CELL)curpreg; + t->next = 0; + t->prev = (CELL)curblock; + t->u.eb.id = (UInt)yaam_block; + t->u.eb.label_destiny = NULL; + t->u.eb.label_entry = (char*)malloc(1024*sizeof(char)); + { + strcpy(t->u.eb.label_entry, "LBL_"); + char *tmp = (char*)malloc(2048*sizeof(char)); + linear_sprint_block(yaam_block, &tmp); + strcat(t->u.eb.label_entry, tmp); + char* hex = (char*)malloc(33*sizeof(char)); + sprintf(hex, "_%lX", (UInt)t->thisp); + strcat(t->u.eb.label_entry, hex); + } + SET_DESTINY(yaam_block, t, i); + if (ineedredefinedest) { + REDEFINE_DESTINY(IntermediatecodeArea->area.lastblock[i], t); + ineedredefinedest = 0; + } + (*curtrace)->n += 1; + curblock->next = (CELL)t; + IntermediatecodeArea->area.lastblock[i] = t; + } + else { + SET_DESTINY(yaam_block, curblock, i); + IntermediatecodeArea->area.lastblock[i] = curblock; + } + COMPLETE_SPENT_PROF_TIME(); + } + } + } +} + +#define EMIT_CONDITIONAL_FAIL(EXP) \ + if (IntermediatecodeArea->n) { \ + int i; \ + BlocksContext** temp_globalcurblock = (BlocksContext**)malloc(IntermediatecodeArea->n * sizeof(BlocksContext*)); \ + for (i = 0; i < IntermediatecodeArea->n; i++) { \ + if (IntermediatecodeArea->area.t && \ + IntermediatecodeArea->area.ok && \ + IntermediatecodeArea->area.isactive && \ + IntermediatecodeArea->area.isactive[i]) \ + { \ + INIT_SPENT_PROF_TIME(); \ + curtrace = &IntermediatecodeArea->area.t[i]; \ + BlocksContext *c; \ + if (!globalcurblock) c = (*curtrace)->bc; \ + else c = globalcurblock[i]; \ + while (c->next) { \ + if (c->blockty == CONDITIONAL_HEADER && c->thisp == (CELL)curpreg && !strcmp(c->u.kb.exp, EXP)) { break; } \ + c = (BlocksContext*)c->next; \ + } \ + if (!c->next && (c->blockty != CONDITIONAL_HEADER || c->thisp != (CELL)curpreg || strcmp(c->u.kb.exp, EXP)) ) { \ + BlocksContext *t = (BlocksContext*)malloc(sizeof(BlocksContext)); \ + t->blockty = CONDITIONAL_HEADER; \ + t->thisp = (CELL)curpreg; \ + t->next = 0; \ + t->prev = (CELL)c; \ + t->u.kb.exp = (char*)malloc(1024*sizeof(char)); \ + strcpy(t->u.kb.exp, EXP); \ + t->u.kb._if = (BlocksContext*)malloc(sizeof(BlocksContext)); \ + t->u.kb._if->blockty = NONE; \ + t->u.kb._if->thisp = (CELL)curpreg; \ + t->u.kb._if->next = 0; \ + t->u.kb._if->prev = 0; \ + t->u.kb._if->u.xb.header = (CELL)t; \ + t->u.kb._else = (BlocksContext*)malloc(sizeof(BlocksContext)); \ + t->u.kb._else->blockty = NONE; \ + t->u.kb._else->thisp = (CELL)curpreg; \ + t->u.kb._else->next = 0; \ + t->u.kb._else->prev = 0; \ + t->u.kb._else->u.xb.header = (CELL)t; \ + c->next = (CELL)t; \ + c = t->u.kb._else; \ + (*curtrace)->n += 2; \ + } \ + else { \ + c = c->u.kb._else; \ + } \ + temp_globalcurblock[i] = c; \ + COMPLETE_SPENT_PROF_TIME(); \ + } \ + } \ + globalcurblock = temp_globalcurblock; \ + } + +#define EMIT_CONDITIONAL_SUCCESS(EXP) \ + if (IntermediatecodeArea->n) { \ + int i; \ + BlocksContext** temp_globalcurblock = (BlocksContext**)malloc(IntermediatecodeArea->n * sizeof(BlocksContext*)); \ + for (i = 0; i < IntermediatecodeArea->n; i++) { \ + if (IntermediatecodeArea->area.t && \ + IntermediatecodeArea->area.ok && \ + IntermediatecodeArea->area.isactive && \ + IntermediatecodeArea->area.isactive[i]) \ + { \ + INIT_SPENT_PROF_TIME(); \ + curtrace = &IntermediatecodeArea->area.t[i]; \ + BlocksContext *c; \ + if (!globalcurblock) c = (*curtrace)->bc; \ + else c = globalcurblock[i]; \ + while (c->next) { \ + if (c->blockty == CONDITIONAL_HEADER && c->thisp == (CELL)curpreg && !strcmp(c->u.kb.exp, EXP)) { break; } \ + c = (BlocksContext*)c->next; \ + } \ + if (!c->next && (c->blockty != CONDITIONAL_HEADER || c->thisp != (CELL)curpreg || strcmp(c->u.kb.exp, EXP)) ) { \ + BlocksContext *t = (BlocksContext*)malloc(sizeof(BlocksContext)); \ + t->blockty = CONDITIONAL_HEADER; \ + t->thisp = (CELL)curpreg; \ + t->next = 0; \ + t->prev = (CELL)c; \ + t->u.kb.exp = (char*)malloc(1024*sizeof(char)); \ + strcpy(t->u.kb.exp, EXP); \ + t->u.kb._if = (BlocksContext*)malloc(sizeof(BlocksContext)); \ + t->u.kb._if->blockty = NONE; \ + t->u.kb._if->thisp = (CELL)curpreg; \ + t->u.kb._if->next = 0; \ + t->u.kb._if->prev = 0; \ + t->u.kb._if->u.xb.header = (CELL)t; \ + t->u.kb._else = (BlocksContext*)malloc(sizeof(BlocksContext)); \ + t->u.kb._else->blockty = NONE; \ + t->u.kb._else->thisp = (CELL)curpreg; \ + t->u.kb._else->next = 0; \ + t->u.kb._else->prev = 0; \ + t->u.kb._else->u.xb.header = (CELL)t; \ + c->next = (CELL)t; \ + c = t->u.kb._if; \ + (*curtrace)->n += 2; \ + } \ + else { \ + c = c->u.kb._if; \ + } \ + temp_globalcurblock[i] = c; \ + COMPLETE_SPENT_PROF_TIME(); \ + } \ + } \ + globalcurblock = temp_globalcurblock; \ + } + +#define EMIT_CONDITIONAL() \ + { \ + BlocksContext *c = (*curtrace)->bc; \ + COUNT i = 0; \ + while (i < ncexp) { \ + while (c->next) { \ + if (c->blockty == CONDITIONAL_HEADER && c->thisp == (CELL)curpreg && !strcmp(c->u.kb.exp, cexp[i])) { break; } \ + c = (BlocksContext*)c->next; \ + } \ + if (!c->next && (c->blockty != CONDITIONAL_HEADER || c->thisp != (CELL)curpreg || strcmp(c->u.kb.exp, cexp[i])) ) { \ + BlocksContext *t = (BlocksContext*)malloc(sizeof(BlocksContext)); \ + t->blockty = CONDITIONAL_HEADER; \ + t->thisp = (CELL)curpreg; \ + t->next = 0; \ + t->prev = (CELL)c; \ + t->u.kb.exp = (char*)malloc(1024*sizeof(char)); \ + strcpy(t->u.kb.exp, cexp[i]); \ + t->u.kb._if = (BlocksContext*)malloc(sizeof(BlocksContext)); \ + t->u.kb._if->blockty = NONE; \ + t->u.kb._if->thisp = (CELL)curpreg; \ + t->u.kb._if->next = 0; \ + t->u.kb._if->prev = 0; \ + t->u.kb._if->u.xb.header = (CELL)t; \ + t->u.kb._else = (BlocksContext*)malloc(sizeof(BlocksContext)); \ + t->u.kb._else->blockty = NONE; \ + t->u.kb._else->thisp = (CELL)curpreg; \ + t->u.kb._else->next = 0; \ + t->u.kb._else->prev = 0; \ + t->u.kb._else->u.xb.header = (CELL)t; \ + c->next = (CELL)t; \ + if (condty[i] == 0) { \ + c = t->u.kb._if; \ + } \ + else { \ + c = t->u.kb._else; \ + } \ + (*curtrace)->n += 2; \ + } \ + else { \ + if (condty[i] == 0) { \ + c = c->u.kb._if; \ + } else { \ + c = c->u.kb._else; \ + } \ + } \ + i++; \ + } \ + curblock = c; \ + } + +#define IF(EXP) EMIT_THIS_BLOCK_AS_IF(EXP); +#define ELSEIF(EXP) EMIT_THIS_BLOCK_AS_ELSEIF(EXP); +#define ELSE() EMIT_THIS_BLOCK_AS_ELSE(); +#define ENDBLOCK() \ + BACK_TO_HEADER(); + +#define SIMPLE_VBLOCK_ND0(block) \ + block == GET_X_VAL_GVALX_NONVAR || \ + block == GET_Y_VAL_GVALY_NONVAR || \ + block == PUT_UNSAFE_PUNSAFE_NONVAR || \ + block == UNIFY_X_LOC_WRITE_UNIFY_X_LOC_NONVAR || \ + block == UNIFY_L_X_LOC_WRITE_ULNIFY_X_LOC_NONVAR || \ + block == UNIFY_Y_LOC_WRITE_UNIFY_Y_LOC_NONVAR || \ + block == UNIFY_L_Y_LOC_WRITE_ULUNIFY_Y_LOC_NONVAR || \ + block == WRITE_X_LOC_W_X_BOUND || \ + block == WRITE_Y_LOC_W_Y_BOUND || \ + block == P_DIF_DIF_NVAR1 || \ + block == P_EQ_P_EQ_NVAR1 || \ + block == P_PLUS_VV_PLUS_VV_NVAR || \ + block == P_PLUS_Y_VV_PLUS_Y_VV_NVAR || \ + block == P_MINUS_VV_MINUS_VV_NVAR || \ + block == P_TIMES_VV_TIMES_VV_NVAR || \ + block == P_DIV_VV_DIV_VV_NVAR || \ + block == P_AND_VV_AND_VV_NVAR || \ + block == P_ARG_VV_TEST_D1 || \ + block == P_ARG_VV_ARG_ARG1_NVAR || \ + block == P_ARG_Y_VV_TEST_D1 || \ + block == P_ARG_Y_VV_ARG_Y_ARG1_NVAR + +#define MULTIPLE_DESTINY_VBLOCK_ND0(block) \ + block == GET_LIST_GLIST_NONVAR || \ + block == GET_ATOM_GATOM_NONVAR || \ + block == GET_STRUCT_GSTRUCT_NONVAR || \ + block == GET_FLOAT_GFLOAT_NONVAR || \ + block == GL_VOID_VARX_GLIST_VOID_VARX_READ || \ + block == GL_VOID_VARY_GLIST_VOID_VARY_READ || \ + block == UNIFY_ATOM_UATOM_NONVAR || \ + block == UNIFY_L_ATOM_ULATOM_NONVAR || \ + block == UNIFY_LIST_READMODE || \ + block == UNIFY_L_LIST_READMODE || \ + block == UNIFY_STRUCT_READMODE || \ + block == UNIFY_L_STRUC_READMODE + +#define MULTIPLE_DESTINY_VBLOCK_ND1(block) \ + block == P_ARG_CV_ARG_ARG2_VC_NVAR + +#define MULTIPLE_DESTINY_VBLOCK_ND0_ND1(block) \ + block == GET_X_VAL_GVALX_NONVAR_NONVAR || \ + block == GET_Y_VAL_GVALY_NONVAR_NONVAR || \ + block == CALL_BFUNC_XX_CALL_BFUNC_XX2_NVAR_INT || \ + block == CALL_BFUNC_YX_CALL_BFUNC_YX2_NVAR_INT || \ + block == CALL_BFUNC_XY_CALL_BFUNC_XY2_NVAR_INT || \ + block == CALL_BFUNC_YY_CALL_BFUNC_YY2_NVAR_INT || \ + block == P_DIF_DIF_NVAR1_NVAR2 || \ + block == P_EQ_P_EQ_NVAR1_NVAR2 || \ + block == P_ARG_VV_ARG_ARG2_NVAR || \ + block == P_ARG_Y_VV_ARG_Y_ARG2_NVAR + +#define MULTIPLE_DESTINY_VBLOCK_D0_ND1(block) \ + block == GET_X_VAL_GVALX_VAR_NONVAR || \ + block == GET_Y_VAL_GVALY_VAR_NONVAR || \ + block == P_EQ_P_EQ_VAR1_NVAR2 + +static inline int +found_entry(char* key, yamop* p) { + int i = 0; + while (i < p->y_u.J.jh->tcc.cf->nentries && strcmp(p->y_u.J.jh->tcc.cf->entries[i], key)) { + i++; + } + if (i == p->y_u.J.jh->tcc.cf->nentries) return 0; + return 1; +} + +static inline void +emit_blocks_buf (BlocksContext* mt, short nident, char buf[], yamop* p) { + BlocksContext* prevblock = NULL; + char* tmp = (char*)malloc(2048*sizeof(char)); + int i; + //yamop* lastp = lastop_of(p); + short foundlast = 0; + //CELL oldp; + short first = 1; + char *lastlabel = (char*)malloc(1024*sizeof(char)); + while (mt) { + /*if (foundlast) { + if (oldp != mt->thisp) break; + } + if (mt->thisp == (CELL)lastp) { + foundlast = 1; + oldp = mt->thisp; + }*/ + if (mt->blockty == SIMPLE_ENTRY) { + //if ((YAP_BBs)mt->u.eb.id == IF_NOT_THEN_INSTINIT) { strcpy(buf, ""); break; } + p->y_u.J.jh->tcc.cf->emit = 1; + i = 0; + /*while (i < p->y_u.J.jh->cf->nemited) { + if (!strcmp(p->y_u.J.jh->cf->emited_blocks[i], mt->u.eb.label_entry)) { + p->y_u.J.jh->cf->emit = 0; + break; + } + i += 1; + }*/ + if (p->y_u.J.jh->tcc.cf->emit) { + { + p->y_u.J.jh->tcc.cf->leastonce = 1; + p->y_u.J.jh->tcc.cf->nemited += 1; + p->y_u.J.jh->tcc.cf->emited_blocks = (char**)realloc(p->y_u.J.jh->tcc.cf->emited_blocks, p->y_u.J.jh->tcc.cf->nemited*sizeof(char*)); + p->y_u.J.jh->tcc.cf->emited_blocks[p->y_u.J.jh->tcc.cf->nemited-1] = (char*)malloc(1024*sizeof(char)); + strcpy(p->y_u.J.jh->tcc.cf->emited_blocks[p->y_u.J.jh->tcc.cf->nemited-1], mt->u.eb.label_entry); + } + strcpy(lastlabel, mt->u.eb.label_entry); + if (first) { + sprintf(tmp, "%s:\n{\n", mt->u.eb.label_entry); + first = 0; + } + else sprintf(tmp, "}\n\n%s:\n{\n", mt->u.eb.label_entry); + strcat(buf, tmp); +#if YAP_DBG_PREDS + sprintf(tmp, "print_block((YAP_BBs)%ld, ON_NATIVE);\n", (Int)mt->u.eb.id); + strcat(buf, tmp); +#endif + sprint_block((YAP_BBs)mt->u.eb.id, &tmp); + strcat(buf, tmp); + if (mt->u.eb.label_destiny) { + if (strcmp(mt->u.eb.label_destiny, "")) { + if (found_entry(mt->u.eb.label_destiny, p)) { + sprintf(tmp, "goto %s;\n", mt->u.eb.label_destiny); + } else { + sprintf(tmp, "SUCCESSBACK();\n"); + } + strcat(buf, tmp); + } + } + } + } + else if (mt->blockty == SIMPLE) { + if (p->y_u.J.jh->tcc.cf->emit && (prevblock->u.sb.id != PUT_X_VAL_INSTINIT || mt->u.sb.id != YAAM_DEREF_BODY_D0PT0)) { + Int printif = 0; + if ((YAP_BBs)mt->u.sb.id == YAAM_DEREF_BODY_D0PT0 || (YAP_BBs)mt->u.sb.id == YAAM_DEREF_BODY_D0PT1 || + (YAP_BBs)mt->u.sb.id == YAAM_DEREF_BODY_D0S_SREG || (YAP_BBs)mt->u.sb.id == YAAM_DEREF_BODY_D1PT0 || + (YAP_BBs)mt->u.sb.id == YAAM_DEREF_BODY_D1PT1) { + sprintf(tmp, "/* address = 0x%lX */ ", mt->thisp); + strcat(buf, tmp); + } + if ((YAP_BBs)mt->u.sb.id == CUT_COROUTINING || (YAP_BBs)mt->u.sb.id == CUT_T_COROUTINING || (YAP_BBs)mt->u.sb.id == CUT_E_COROUTINING) { + sprintf(tmp, "#pragma clang diagnostic push\n#pragma clang diagnostic ignored \"-Wunused-value\"\n"); + strcat(buf, tmp); + } +#if YAP_DBG_PREDS + sprintf(tmp, "print_block((YAP_BBs)%ld, ON_NATIVE);\n", (Int)mt->u.sb.id); + strcat(buf, tmp); +#endif + sprint_block((YAP_BBs)mt->u.sb.id, &tmp); + strcat(buf, tmp); + if ((YAP_BBs)mt->u.sb.id == CUT_COROUTINING || (YAP_BBs)mt->u.sb.id == CUT_T_COROUTINING || (YAP_BBs)mt->u.sb.id == CUT_E_COROUTINING) { + sprintf(tmp, "#pragma clang diagnostic pop\n"); + strcat(buf, tmp); + } + if(mt->u.sb.label_destiny) { + if (strcmp(mt->u.sb.label_destiny, "")) { + if (foundlast) { + sprintf(tmp, "SUCCESSBACK();\n"); + strcat(buf, tmp); + } + else { + if (found_entry(mt->u.sb.label_destiny, p)) { + if ( + (YAP_BBs)mt->u.sb.id != NoStackExecute_Exception && + (YAP_BBs)mt->u.sb.id != NoStackDExecute_Exception && + (YAP_BBs)mt->u.sb.id != NoStackCall_Exception && + (YAP_BBs)mt->u.sb.id != NoStackDeallocate_Exception && + (YAP_BBs)mt->u.sb.id != NoStackCut_Exception && + (YAP_BBs)mt->u.sb.id != NoStackCutT_Exception && + (YAP_BBs)mt->u.sb.id != NoStackCutE_Exception && + (YAP_BBs)mt->u.sb.id != NoStackCommitX_Exception && + (YAP_BBs)mt->u.sb.id != NoStackCommitY_Exception && + (YAP_BBs)mt->u.sb.id != NoStackEither_Exception && + (YAP_BBs)mt->u.sb.id != NoStackPExecute_Exception && + (YAP_BBs)mt->u.sb.id != NoStackPExecute2_Exception && + (YAP_BBs)mt->u.sb.id != NoStackPTExecute_Exception) + { + sprintf(tmp, "goto %s;\n", mt->u.sb.label_destiny); + strcat(buf, tmp); + } + } else { + sprintf(tmp, "SUCCESSBACK();\n"); + strcat(buf, tmp); + } + } + } + } + if (printif) { + sprintf(tmp, "}\nelse SUCCESSBACK();\n"); + strcat(buf, tmp); + } + //if (mt->u.sb.id == DEXECUTE_END_END) break; + } + } + else if (mt->blockty == CONDITIONAL_HEADER) { + if (p->y_u.J.jh->tcc.cf->emit) { + if (mt->u.kb._if->next && !(mt->u.kb._else->next)) + emit_blocks_buf(mt->u.kb._if, nident+1, buf, p); + else if (!(mt->u.kb._if->next) && mt->u.kb._else->next) + emit_blocks_buf(mt->u.kb._else, nident+1, buf, p); + else if (mt->u.kb._if->next && mt->u.kb._else->next) { + sprintf(tmp, "if (%s) {\n", mt->u.kb.exp); + strcat(buf, tmp); + emit_blocks_buf(mt->u.kb._if, nident+1, buf, p); + if (p->y_u.J.jh->tcc.cf->printlabel) { + sprintf(tmp, "}\nelse {\n%s:;\n", p->y_u.J.jh->tcc.cf->clabel); + p->y_u.J.jh->tcc.cf->printlabel = 0; + } + else { + sprintf(tmp, "}\nelse {\n"); + } + strcat(buf, tmp); + emit_blocks_buf(mt->u.kb._else, nident+1, buf, p); + sprintf(tmp, "}\n"); + strcat(buf, tmp); + } + } + } + else if (mt->blockty == MULTIPLE_DESTINY) { + Int printif = 0; + if (p->y_u.J.jh->tcc.cf->emit) { +#if YAP_DBG_PREDS + sprintf(tmp, "print_block((YAP_BBs)%ld, ON_NATIVE);\n", (Int)mt->u.mdb.id); + strcat(buf, tmp); +#endif + sprint_block((YAP_BBs)mt->u.mdb.id, &tmp); + strcat(buf, tmp); + if(mt->u.mdb.nfaillabels > 0) { + sprintf(tmp, "if (FAILED) {\n"); + strcat(buf, tmp); + for (i = 0; i < mt->u.mdb.nfaillabels; i++) { + sprintf(tmp, " if ((UInt)(*_PREG) == 0x%lX) goto %s;\n", + mt->u.mdb.faildestiny.p[i], mt->u.mdb.faildestiny.labels[i]); + strcat(buf, tmp); + } + sprintf(tmp, "}\n"); + strcat(buf, tmp); + } + if(mt->u.mdb.ndest > 0) { + /*if ((YAP_BBs)mt->u.mdb.id == DEXECUTE_END_END && (CELL)lastp == mt->thisp) { + sprintf(tmp, "SUCCESSBACK();\n"); + strcat(buf, tmp); + break; + } + else {*/ + //if (found_entry(mt->u.mdb.destiny.labels[0]), p) { + sprintf(tmp, "if ((UInt)(*_PREG) == 0x%lX) goto %s;\n", mt->u.mdb.destiny.p[0], mt->u.mdb.destiny.labels[0]); + //} else { + //sprintf(tmp, "if ((UInt)(*_PREG) == 0x%lX) {\n SUCCESSBACK();\n}\n", mt->u.mdb.destiny.p[0]); + //} + strcat(buf, tmp); + //if ((YAP_BBs)mt->u.mdb.id == PROCCEED_END || (YAP_BBs)mt->u.mdb.id == DEXECUTE_END_END) { + int i; + for (i = 1; i < mt->u.mdb.ndest; i++) { + if (found_entry(mt->u.mdb.destiny.labels[i], p)) { + //if (strcmp(lastlabel, mt->u.mdb.destiny.labels[i])) { + sprintf(tmp, "if ((UInt)(*_PREG) == 0x%lX) goto %s;\n", + mt->u.mdb.destiny.p[i], mt->u.mdb.destiny.labels[i]); + //} + } else { + sprintf(tmp, "if ((UInt)(*_PREG) == 0x%lX) SUCCESSBACK();\n", mt->u.mdb.destiny.p[i]); + } + strcat(buf, tmp); + } + //} + //int k = 0; + //while (k < mt->u.mdb.ndest && Yap_op_from_opcode(((yamop*)(mt->u.mdb.destiny.p[k]))->opc) != _jit_handler) { k++; } + //if (k == mt->u.mdb.ndest) { + sprintf(tmp, "SUCCESSBACK();\n"); + //} + //else { + //sprintf(tmp, "else {\n SUCCESS();\n}\n"); + //} + strcat(buf, tmp); + //} + } + else { + sprintf(tmp, "SUCCESSBACK();\n\n"); + strcat(buf, tmp); + } + if (printif) { + sprintf(tmp, "}\nelse SUCCESSBACK();\n"); + strcat(buf, tmp); + } + } + } + prevblock = mt; + mt = (BlocksContext*)mt->next; + } + free(lastlabel); + free(tmp); +} + +static inline void +fill_entries(BlocksContext* mt, yamop** p) { + while (mt) { + if (mt->blockty == SIMPLE_ENTRY) { + (*p)->y_u.J.jh->tcc.cf->nentries += 1; + (*p)->y_u.J.jh->tcc.cf->entries = (char**)realloc((*p)->y_u.J.jh->tcc.cf->entries, (*p)->y_u.J.jh->tcc.cf->nentries*sizeof(char*)); + (*p)->y_u.J.jh->tcc.cf->entries[(*p)->y_u.J.jh->tcc.cf->nentries-1] = (char*)malloc(1024*sizeof(char)); + strcpy((*p)->y_u.J.jh->tcc.cf->entries[(*p)->y_u.J.jh->tcc.cf->nentries-1], mt->u.eb.label_entry); + } + mt = (BlocksContext*)mt->next; + } +} + +#if YAP_STAT_PREDS +#if YAP_DBG_PREDS +const char* cfile_header_for_trace = "#include \n#include \n#include \n#include \n#include \n\nextern CELL nnexec;\nextern int IUnify_complex(CELL*, CELL*, CELL*);\nextern int iequ_complex(CELL*, CELL*, CELL*);\nextern void print_preg(yamop*);\nextern NativeContext* NativeArea;\nextern yamop* HEADPREG;\nextern CELL BLOCK;\nextern CELL BLOCKADDRESS;\nextern CELL FAILED;\n\nvoid* clause(yamop**, yamop**, CELL**, void*[], void*[]);\n\nvoid* clause(yamop** _PREG, yamop** _CPREG, CELL** _SREG, void* external_labels[], void* OpAddress[]) {\nNativeArea->runs[(*_PREG)->y_u.J.jh->caa.naddress] += 1;\n\n\0"; +#else /* YAP_DBG_PREDS */ +const char* cfile_header_for_trace = "#include \n#include \n#include \n#include \n#include \n\nextern CELL nnexec;\nextern int IUnify_complex(CELL*, CELL*, CELL*);\nextern int iequ_complex(CELL*, CELL*, CELL*);\nextern void print_preg(yamop*);\nextern NativeContext* NativeArea;\nextern yamop* HEADPREG;\nextern CELL BLOCK;\nextern CELL BLOCKADDRESS;\nextern CELL FAILED;\n\nvoid* clause(yamop**, yamop**, CELL**, void*[], void*[]);\n\nvoid* clause(yamop** _PREG, yamop** _CPREG, CELL** _SREG, void* external_labels[], void* OpAddress[]) {\nNativeArea->runs[(*_PREG)->y_u.J.jh->caa.naddress] += 1;\n\n\0"; +#endif /* YAP_DBG_PREDS */ +#else /* YAP_STAT_PREDS */ +#if YAP_DBG_PREDS +const char* cfile_header_for_trace = "#include \n#include \n#include \n#include \n#include \n\nextern CELL nnexec;\nextern int IUnify_complex(CELL*, CELL*, CELL*);\nextern int iequ_complex(CELL*, CELL*, CELL*);\nextern void print_preg(yamop*);\nextern NativeContext* NativeArea;\nextern yamop* HEADPREG;\nextern CELL BLOCK;\nextern CELL BLOCKADDRESS;\nextern CELL FAILED;\n\nvoid* clause(yamop**, yamop**, CELL**, void*[], void*[]);\n\nvoid* clause(yamop** _PREG, yamop** _CPREG, CELL** _SREG, void* external_labels[], void* OpAddress[]) {\n\n\0"; +#else /* YAP_DBG_PREDS */ +const char* cfile_header_for_trace = "#include \n#include \n#include \n#include \n#include \n\nextern CELL nnexec;\nextern int IUnify_complex(CELL*, CELL*, CELL*);\nextern int iequ_complex(CELL*, CELL*, CELL*);\nextern void print_preg(yamop*);\nextern NativeContext* NativeArea;\nextern yamop* HEADPREG;\nextern CELL BLOCK;\nextern CELL BLOCKADDRESS;\nextern CELL FAILED;\n\nvoid* clause(yamop**, yamop**, CELL**, void*[], void*[]);\n\nvoid* clause(yamop** _PREG, yamop** _CPREG, CELL** _SREG, void* external_labels[], void* OpAddress[]) {\n\n\0"; +#endif /* YAP_DBG_PREDS */ +#endif /* YAP_STAT_PREDS */ +const char* cfile_end_for_trace = " | clang -O0 -DCUT_C=1 -DCOROUTINING=1 -DRATIONAL_TREES=1 -DDEBUG=1 -DDEPTH_LIMIT=1 -DTABLING=1 -DHAVE_CONFIG_H -D_YAP_NOT_INSTALLED_=1 -D_NATIVE=1 -I. -I./H -I./include -I./os -I./OPTYap -I./BEAM -I./MYDDAS -I./HPP -xc -c - -o - -emit-llvm\0"; +/*const char* cfile_end = " | clang -O0 -DCUT_C=1 -DCOROUTINING=1 -DRATIONAL_TREES=1 -DDEBUG=1 -DDEPTH_LIMIT=1 -DTABLING=1 -DHAVE_CONFIG_H -D_YAP_NOT_INSTALLED_=1 -D_NATIVE=1 -I. -I./H -I./include -I./os -I./OPTYap -I./BEAM -I./MYDDAS -I./HPP -emit-llvm -xc -c - -o\0";*/ + +static inline Int +emit_intermediate_for_trace (TraceContext *tt, CELL *tsize, char **cmd, yamop* p) { + int i; + if (tt) { + p->y_u.J.jh->tcc.cf->entries = NULL; + p->y_u.J.jh->tcc.cf->nentries = 0; + fill_entries(tt->bc, &p); + p->y_u.J.jh->tcc.cf->clabel = (char*)malloc(1024*sizeof(char)); + p->y_u.J.jh->tcc.cf->labelidx = 0; + p->y_u.J.jh->tcc.cf->printlabel = 0; + p->y_u.J.jh->tcc.cf->emited_blocks = NULL; + p->y_u.J.jh->tcc.cf->nemited = 0; + char *buf = (char*)malloc(0x100000*sizeof(char)); + strcpy(buf, ""); + emit_blocks_buf(tt->bc, 0, buf, p); + { + long int tracesize = strlen(cfile_header_for_trace) + strlen(buf); + if (tracesize > 0x1FBD0 || *tsize == tracesize || ((long int)(*tsize * 0.002 + *tsize)) > tracesize) { + for (i = 0; i < p->y_u.J.jh->tcc.cf->nemited; i++) + free(p->y_u.J.jh->tcc.cf->emited_blocks[i]); + free(p->y_u.J.jh->tcc.cf->emited_blocks); + free(buf); + free(p->y_u.J.jh->tcc.cf->clabel); + int i; + for (i = 0; i < p->y_u.J.jh->tcc.cf->nentries; i++) + free(p->y_u.J.jh->tcc.cf->entries[i]); + free(p->y_u.J.jh->tcc.cf->entries); + return 0; + } + *tsize = tracesize; + } + *cmd = (char*)malloc(0x100000*sizeof(char)); + if (strcmp(buf, "")) { + strcpy(*cmd, cfile_header_for_trace); + strcat(*cmd, buf); + strcat(*cmd, "}\n\n}"); + } else { strcpy(*cmd, ""); } + for (i = 0; i < p->y_u.J.jh->tcc.cf->nemited; i++) + free(p->y_u.J.jh->tcc.cf->emited_blocks[i]); + free(p->y_u.J.jh->tcc.cf->emited_blocks); +#if YAP_DBG_PREDS + if (ExpEnv.debug_struc.pprint_intermediate.print_to_std) { + if (strcmp((char*)ExpEnv.debug_struc.pprint_intermediate.std_name, "STDOUT") == 0) + fprintf(stdout, "%s%s}\n\n}", cfile_header_for_trace, buf); + else if (strcmp((char*)ExpEnv.debug_struc.pprint_intermediate.std_name, "STDERR") == 0) + fprintf(stderr, "%s%s}\n\n}", cfile_header_for_trace, buf); + } + if (ExpEnv.debug_struc.pprint_intermediate.print_to_file) { + char filename[1024]; + sprintf(filename, "%s%ld.c", (char*)ExpEnv.debug_struc.pprint_intermediate.file_name, p->y_u.J.jh->caa.naddress); + FILE *out = fopen(filename, "w"); + fprintf(out, "%s%s}\n\n}", cfile_header_for_trace, buf); + fclose(out); + } +#endif +/* + This block print the trace. + + char filename[1024]; + sprintf(filename, "trace%ld.c", global); + FILE *out = fopen(filename, "w"); + fprintf(out, "%s%s}\n\n}", cfile_header_for_trace, buf); + fclose(out); +*/ + free(buf); + free(p->y_u.J.jh->tcc.cf->clabel); + int i; + for (i = 0; i < p->y_u.J.jh->tcc.cf->nentries; i++) + free(p->y_u.J.jh->tcc.cf->entries[i]); + free(p->y_u.J.jh->tcc.cf->entries); + return strlen(*cmd); + } + return 0; +} + +void emit_intermediate_for_trace_dbg (TraceContext*, yamop*); + +void +emit_intermediate_for_trace_dbg (TraceContext *tt, yamop* p) { + char *buf; + CELL x; + emit_intermediate_for_trace(tt, &x, &buf, p); + fprintf(stdout, "%s%s}\n\n}", cfile_header_for_trace, buf); +} + +#include "nextof.hpp" + +const char* cfile_header_for_clause = "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nextern CELL nnexec;\nextern int IUnify_complex(CELL*, CELL*, CELL*);\nextern int iequ_complex(CELL*, CELL*, CELL*);\nextern void print_preg(yamop*);\nextern NativeContext* NativeArea;\nextern yamop* HEADPREG;\nextern CELL BLOCK;\nextern CELL BLOCKADDRESS;\nextern CELL FAILED;\n\nvoid* clause(yamop**, yamop**, CELL**, void*[], void*[]);\n\nvoid* clause(yamop** _PREG, yamop** _CPREG, CELL** _SREG, void* external_labels[], void* OpAddress[]) {\n\0"; +const char* cfile_end_for_clause = " | clang -O0 -DCUT_C=1 -DCOROUTINING=1 -DRATIONAL_TREES=1 -DDEBUG=1 -DDEPTH_LIMIT=1 -DTABLING=1 -DHAVE_CONFIG_H -D_YAP_NOT_INSTALLED_=1 -D_NATIVE=1 -I. -I./H -I./include -I./os -I./OPTYap -I./BEAM -I./MYDDAS -I./HPP -xc -c - -o - -emit-llvm\0"; +/*const char* cfile_end = " | clang -O0 -DCUT_C=1 -DCOROUTINING=1 -DRATIONAL_TREES=1 -DDEBUG=1 -DDEPTH_LIMIT=1 -DTABLING=1 -DHAVE_CONFIG_H -D_YAP_NOT_INSTALLED_=1 -D_NATIVE=1 -I. -I./H -I./include -I./os -I./OPTYap -I./BEAM -I./MYDDAS -I./HPP -emit-llvm -xc -c - -o\0";*/ + +#define ENTRY_HAS_WRITED_CPART(entry) \ + entry == _unify_x_var || \ + entry == _unify_l_x_var || \ + entry == _unify_x_var2 || \ + entry == _unify_l_x_var2 || \ + entry == _unify_y_var || \ + entry == _unify_l_y_var || \ + entry == _unify_x_val || \ + entry == _unify_l_x_val || \ + entry == _unify_x_loc || \ + entry == _unify_l_x_loc || \ + entry == _unify_atom || \ + entry == _unify_l_atom || \ + entry == _unify_void || \ + entry == _unify_n_voids || \ + entry == _unify_l_n_voids || \ + entry == _unify_l_list || \ + entry == _unify_struct || \ + entry == _unify_l_struc || \ + entry == _unify_l_float || \ + entry == _save_pair_x + +#define SET_ADDRESS_R() \ + strcat(buf, "static void *NOp_Address_R[] = { "); \ + for (i = 0; i < nentries-1; i++) { \ + strcat(buf, "&&"); \ + sprint_op(tmpbuf, "lbl", entries[i], ""); \ + strcat(buf, tmpbuf); \ + strcat(buf, ", "); \ + } \ + strcat(buf, "&&"); \ + sprint_op(tmpbuf, "lbl", entries[nentries-1], ""); \ + strcat(buf, tmpbuf); \ + strcat(buf, " };\n\n"); + +#define SET_ADDRESS_W() \ + strcat(buf, "static void *NOp_Address_W[] = { "); \ + for (i = 0; i < nentries-1; i++) { \ + strcat(buf, "&&"); \ + sprint_op(tmpbuf, "lbl", entries[i], "_write"); \ + strcat(buf, tmpbuf); \ + strcat(buf, ", "); \ + } \ + strcat(buf, "&&"); \ + sprint_op(tmpbuf, "lbl", entries[nentries-1], "_write"); \ + strcat(buf, tmpbuf); \ + strcat(buf, " };\n\n"); + +static inline Int +fe(op_numbers k, op_numbers* e, COUNT n) { + int i = 0; + while (i < n && e[i] != k) i++; + if (i == n) return -1; + return i; +} + +static inline Int +emit_intermediate_for_clause (yamop *p, char **cmd) { + yamop *tmp = p; + yamop *next; + op_numbers* entries = NULL; + COUNT i, nentries = 0; + while (1) { + op_numbers op = Yap_op_from_opcode(p->opc); + if (fe(op, entries, nentries) == -1) { + nentries += 1; + entries = (op_numbers*)realloc(entries, nentries*sizeof(op_numbers)); + entries[nentries-1] = op; + } + if (op == _execute || op == _dexecute || op == _procceed || op == _fcall || op == _call || op == _execute_cpred) break; + if (op == _either) { + NextOf(&p); + } + else if (op == _cut || op == _cut_t || op == _cut_e || op == _commit_b_x || op == _commit_b_y || op == _p_functor) { + NextOf(&p); + NextOf(&p); + } + NextOf(&p); + } + p = tmp; + while (1) { + next = p; + if (Yap_op_from_opcode(next->opc) == _either) { + NextOf(&next); + } + else if (Yap_op_from_opcode(next->opc) == _cut || Yap_op_from_opcode(next->opc) == _cut_t || Yap_op_from_opcode(next->opc) == _cut_e || Yap_op_from_opcode(next->opc) == _commit_b_x || Yap_op_from_opcode(next->opc) == _commit_b_y || Yap_op_from_opcode(next->opc) == _p_functor) { + NextOf(&next); + NextOf(&next); + } + NextOf(&next); + if (Yap_op_from_opcode(p->opc) == _execute || Yap_op_from_opcode(p->opc) == _dexecute || Yap_op_from_opcode(p->opc) == _procceed || Yap_op_from_opcode(p->opc) == _fcall || Yap_op_from_opcode(p->opc) == _call || Yap_op_from_opcode(p->opc) == _execute_cpred) { + p->next_native_r = p->next_native_w = -1; + break; + } + else { + op_numbers op = Yap_op_from_opcode(next->opc); + p->next_native_r =p->next_native_w = fe(op, entries, nentries); + } + if (Yap_op_from_opcode(p->opc) == _either) { + NextOf(&p); + } + else if (Yap_op_from_opcode(p->opc) == _cut || Yap_op_from_opcode(p->opc) == _cut_t || Yap_op_from_opcode(p->opc) == _cut_e || Yap_op_from_opcode(p->opc) == _commit_b_x || Yap_op_from_opcode(p->opc) == _commit_b_y || Yap_op_from_opcode(p->opc) == _p_functor) { + NextOf(&p); + NextOf(&p); + } + NextOf(&p); + } + /*p = tmp; + while(1){ + op_numbers op = Yap_op_from_opcode(p->opc); + print_op("", op, " -- "); + printf("%ld\n", p->next_native_r); + if (op == _execute || op == _dexecute || op == _procceed || op == _fcall || op == _call || op == _execute_cpred) break; + if (op == _either) { + NextOf(&p); + } + else if (op == _cut || op == _cut_t || op == _cut_e || op == _commit_b_x || op == _commit_b_y || op == _p_functor) { + NextOf(&p); + NextOf(&p); + } + NextOf(&p); + }*/ + + char buf[2097152]; + char tmpbuf[1024]; + strcpy(buf, ""); + SET_ADDRESS_R(); + SET_ADDRESS_W(); + strcat(buf, "\n"); + + for (i = 0; i < nentries; i++) { + /* read part */ + sprint_op(tmpbuf, "lbl", entries[i], ""); + strcat(buf, tmpbuf); + strcat(buf, ":\n{\n"); + sprint_op(tmpbuf, " CELL idx = (*_PREG)->next_native_r;\n ", entries[i], "_instinit;\n"); + strcat(buf, tmpbuf); + //sprintf(tmpbuf, " if (idx != -1) goto *NOp_Address[idx];\n else BACK();\n"); + //strcat(buf, tmpbuf); + strcat(buf, "}\n\n"); + + /* written part */ + if (ENTRY_HAS_WRITED_CPART(entries[i])) { + sprint_op(tmpbuf, "lbl", entries[i], "_write"); + strcat(buf, tmpbuf); + strcat(buf, ":\n{\n"); + /*{ + strcpy(tmplbl, tmpbuf); + sprintf(tmpbuf, " printf(\\\"%s!! -- \\\");\n", tmplbl); + strcat(buf, tmpbuf); + sprintf(tmpbuf, " print_op(\\\"\\\", Yap_op_from_opcode((*_PREG)->opc), \\\"!!\\\n\\\");\n"); + strcat(buf, tmpbuf); + }*/ + sprint_op(tmpbuf, " CELL idx = (*_PREG)->next_native_w;\n ", entries[i], "_write_instinit;\n"); + strcat(buf, tmpbuf); + //sprintf(tmpbuf, " if (idx != -1) goto *NOp_Address[idx];\n else BACK();\n"); + //strcat(buf, tmpbuf); + strcat(buf, "}\n\n"); + } + else { + sprint_op(tmpbuf, "lbl", entries[i], "_write:;\n\n"); + strcat(buf, tmpbuf); + } + } + + *cmd = (char*)malloc(2097152*sizeof(char)); + //strcpy(*cmd, "echo \""); + strcpy(*cmd, cfile_header_for_clause); + strcat(*cmd, buf); + strcat(*cmd, "BACK();\n}"); + //strcat(*cmd, cfile_end_for_clause); + +#if YAP_DBG_PREDS + if (ExpEnv.debug_struc.pprint_intermediate.print_to_std) { + if (strcmp((char*)ExpEnv.debug_struc.pprint_intermediate.std_name, "STDOUT") == 0) + fprintf(stdout, "%s%s}\n\n}", cfile_header_for_clause, buf); + else if (strcmp((char*)ExpEnv.debug_struc.pprint_intermediate.std_name, "STDERR") == 0) + fprintf(stderr, "%s%s}\n\n}", cfile_header_for_clause, buf); + } + if (ExpEnv.debug_struc.pprint_intermediate.print_to_file) { + char filename[1024]; + sprintf(filename, "%s%ld.c", (char*)ExpEnv.debug_struc.pprint_intermediate.file_name, p->y_u.J.jh->caa.naddress); + FILE *out = fopen(filename, "w"); + if (out) { + fprintf(out, "%s%s}\n\n}", cfile_header_for_trace, buf); + fclose(out); + free(*cmd); + return 1; + } + free(*cmd); + return 0; + } +#endif + return 0; +} + +static inline void* +recompile(void *pt) +{ + yamop* p = (yamop*)pt; + +#if YAP_STAT_PREDS + struct rusage rustart, ruend; + getrusage(RUSAGE_SELF, &rustart); +#endif + Int v = emit_intermediate_for_trace(IntermediatecodeArea->area.t[p->y_u.J.jh->caa.taddress], &(IntermediatecodeArea->area.t[p->y_u.J.jh->caa.taddress]->tracesize), &(p->y_u.J.jh->tcc.cmd), p); + if (v) { +#if YAP_DBG_PREDS + if (ExpEnv.debug_struc.pprint_me.at_recompilation != 0 && ExpEnv.debug_struc.pprint_me.at_recompilation != 0x1) { + fprintf(stderr, "%s:%d\n", __FILE__, __LINE__); + fprintf(stderr, "%s", (char*)ExpEnv.debug_struc.pprint_me.at_recompilation); + } +#endif +#if YAP_STAT_PREDS + NativeArea->area.nrecomp[p->y_u.J.jh->caa.naddress] += 1; + NativeArea->area.native_size_bytes[p->y_u.J.jh->caa.naddress] = (CELL*)realloc(NativeArea->area.native_size_bytes[p->y_u.J.jh->caa.naddress], NativeArea->area.nrecomp[p->y_u.J.jh->caa.naddress]*sizeof(CELL)); + NativeArea->area.trace_size_bytes[p->y_u.J.jh->caa.naddress] = (CELL*)realloc(NativeArea->area.trace_size_bytes[p->y_u.J.jh->caa.naddress], NativeArea->area.nrecomp[p->y_u.J.jh->caa.naddress]*sizeof(CELL)); + NativeArea->area.trace_size_bytes[p->y_u.J.jh->caa.naddress][NativeArea->area.nrecomp[p->y_u.J.jh->caa.naddress]-1] = v; +#endif + NativeArea->area.p[p->y_u.J.jh->caa.naddress] = call_JIT_Compiler(J, p); + IntermediatecodeArea->area.isactive[p->y_u.J.jh->caa.taddress] = 0; +#if YAP_STAT_PREDS + getrusage(RUSAGE_SELF, &ruend); + NativeArea->area.compilation_time[p->y_u.J.jh->caa.naddress] = (double*)realloc(NativeArea->area.compilation_time[p->y_u.J.jh->caa.naddress], NativeArea->area.nrecomp[p->y_u.J.jh->caa.naddress]*sizeof(double)); + NativeArea->area.compilation_time[p->y_u.J.jh->caa.naddress][NativeArea->area.nrecomp[p->y_u.J.jh->caa.naddress]-1] = + (((double)ruend.ru_utime.tv_sec - (double)rustart.ru_utime.tv_sec) + ((double)ruend.ru_utime.tv_usec - (double)rustart.ru_utime.tv_usec) / 1000000.0); +#endif + } + return NULL; +} + +static inline void* +compile(void *pt) +{ + yamop* p = (yamop*)pt; + +#if YAP_STAT_PREDS + struct rusage rustart, ruend; + getrusage(RUSAGE_SELF, &rustart); +#endif + p->y_u.J.jh->caa.naddress = NativeArea->n; + Int v = emit_intermediate_for_trace(IntermediatecodeArea->area.t[p->y_u.J.jh->caa.taddress], &(IntermediatecodeArea->area.t[p->y_u.J.jh->caa.taddress]->tracesize), &(p->y_u.J.jh->tcc.cmd), p); + if (v) { +#if YAP_DBG_PREDS + if (ExpEnv.debug_struc.pprint_me.at_compilation != 0 && ExpEnv.debug_struc.pprint_me.at_compilation != 0x1) { + fprintf(stderr, "%s:%d\n", __FILE__, __LINE__); + fprintf(stderr, "%s", (char*)ExpEnv.debug_struc.pprint_me.at_compilation); + } +#endif + NativeArea->area.p = (void**)realloc(NativeArea->area.p, (NativeArea->n+1)*sizeof(void*)); + NativeArea->area.ok = (COUNT*)realloc(NativeArea->area.ok, (NativeArea->n+1)*sizeof(COUNT)); + NativeArea->area.pc = (CELL*)realloc(NativeArea->area.pc, (NativeArea->n+1)*sizeof(CELL)); +#if YAP_STAT_PREDS + NativeArea->area.nrecomp = (COUNT*)realloc(NativeArea->area.nrecomp, (NativeArea->n+1)*sizeof(COUNT)); + NativeArea->area.nrecomp[p->y_u.J.jh->caa.naddress] = 1; + NativeArea->area.compilation_time = (double**)realloc(NativeArea->area.compilation_time, (NativeArea->n+1)*sizeof(double*)); + NativeArea->area.native_size_bytes = (CELL**)realloc(NativeArea->area.native_size_bytes, (NativeArea->n+1)*sizeof(CELL*)); + NativeArea->area.native_size_bytes[p->y_u.J.jh->caa.naddress] = (CELL*)malloc(NativeArea->area.nrecomp[p->y_u.J.jh->caa.naddress]*sizeof(CELL)); + NativeArea->area.trace_size_bytes = (CELL**)realloc(NativeArea->area.trace_size_bytes, (NativeArea->n+1)*sizeof(CELL*)); + NativeArea->area.trace_size_bytes[p->y_u.J.jh->caa.naddress] = (CELL*)malloc(NativeArea->area.nrecomp[p->y_u.J.jh->caa.naddress]*sizeof(CELL)); + NativeArea->area.trace_size_bytes[p->y_u.J.jh->caa.naddress][NativeArea->area.nrecomp[p->y_u.J.jh->caa.naddress]-1] = v; + NativeArea->runs = (COUNT*)realloc(NativeArea->runs, (NativeArea->n+1)*sizeof(COUNT)); + NativeArea->t_runs = (double*)realloc(NativeArea->t_runs, (NativeArea->n+1)*sizeof(double)); + NativeArea->success = (COUNT*)realloc(NativeArea->success, (NativeArea->n+1)*sizeof(COUNT)); +#endif + NativeArea->area.ok[p->y_u.J.jh->caa.naddress] = 0; +#if YAP_STAT_PREDS + NativeArea->success[p->y_u.J.jh->caa.naddress] = 0; + NativeArea->runs[p->y_u.J.jh->caa.naddress] = 0; + NativeArea->t_runs[p->y_u.J.jh->caa.naddress] = 0.0; +#endif + NativeArea->n += 1; + NativeArea->area.p[p->y_u.J.jh->caa.naddress] = call_JIT_Compiler(J, p); + NativeArea->area.ok[p->y_u.J.jh->caa.naddress] = 1; + NativeArea->area.pc[p->y_u.J.jh->caa.naddress] = (CELL)p; +#if YAP_STAT_PREDS + getrusage(RUSAGE_SELF, &ruend); + NativeArea->area.compilation_time[p->y_u.J.jh->caa.naddress] = (double*)malloc(NativeArea->area.nrecomp[p->y_u.J.jh->caa.naddress]*sizeof(double)); + NativeArea->area.compilation_time[p->y_u.J.jh->caa.naddress][NativeArea->area.nrecomp[p->y_u.J.jh->caa.naddress]-1] = + (((double)ruend.ru_utime.tv_sec - (double)rustart.ru_utime.tv_sec) + ((double)ruend.ru_utime.tv_usec - (double)rustart.ru_utime.tv_usec) / 1000000.0); +#endif + } + else { + p->y_u.J.jh->caa.naddress = -1; + } + IntermediatecodeArea->area.isactive[p->y_u.J.jh->caa.taddress] = 0; + return NULL; +} + +#endif /*_NATIVE */ diff --git a/JIT/configure.in b/JIT/configure.in index 3cb6566d5..55e69549b 100644 --- a/JIT/configure.in +++ b/JIT/configure.in @@ -49,7 +49,7 @@ if test x"$LLVM_CONFIG" = x"no" ;then AC_MSG_ERROR([--enable-jit was given, but test for LLVM 3.5 failed]) else LLVM_VERSION="`$LLVM_CONFIG --version`" - if test "$LLVM_VERSION" != "3.5.0";then + if test "$LLVM_VERSION" != "3.5.0" -o "$LLVM_VERSION" != "3.5.1";then AC_MSG_ERROR([Test for LLVM 3.5 failed]) fi diff --git a/OPTYap/opt.mavar.h b/OPTYap/opt.mavar.h index 9c01f3072..6620cdea2 100644 --- a/OPTYap/opt.mavar.h +++ b/OPTYap/opt.mavar.h @@ -38,9 +38,9 @@ Yap_MAVAR_HASH(CELL *addr USES_REGS) { OPT_MAVAR_STATIC struct ma_h_entry * Yap_ALLOC_NEW_MASPACE(USES_REGS1) { - ma_h_inner_struct *new = LOCAL_ma_h_top; + ma_h_inner_struct *newS = LOCAL_ma_h_top; LOCAL_ma_h_top++; - return new; + return newS; } OPT_MAVAR_STATIC int diff --git a/OPTYap/or.insts.i b/OPTYap/or.insts.h similarity index 100% rename from OPTYap/or.insts.i rename to OPTYap/or.insts.h diff --git a/OPTYap/tab.insts.i b/OPTYap/tab.insts.h similarity index 100% rename from OPTYap/tab.insts.i rename to OPTYap/tab.insts.h diff --git a/OPTYap/tab.macros.h b/OPTYap/tab.macros.h index 7f5d8b895..ada700cd8 100644 --- a/OPTYap/tab.macros.h +++ b/OPTYap/tab.macros.h @@ -678,14 +678,14 @@ static inline void **__get_insert_thread_bucket(void **buckets, lockvar *buckets /* indirect bucket */ buckets = buckets + THREADS_DIRECT_BUCKETS + (worker_id - THREADS_DIRECT_BUCKETS) / THREADS_DIRECT_BUCKETS; if (*buckets) - return *buckets + (worker_id - THREADS_DIRECT_BUCKETS) % THREADS_DIRECT_BUCKETS; + return (void **)((char *)(*buckets) + (worker_id - THREADS_DIRECT_BUCKETS) % THREADS_DIRECT_BUCKETS); /* insert indirect bucket */ LOCK(*buckets_lock); if (*buckets == NULL) ALLOC_BUCKETS(*buckets, THREADS_DIRECT_BUCKETS); UNLOCK(*buckets_lock); - return *buckets + (worker_id - THREADS_DIRECT_BUCKETS) % THREADS_DIRECT_BUCKETS; + return (void **)((char *)(*buckets) + (worker_id - THREADS_DIRECT_BUCKETS) % THREADS_DIRECT_BUCKETS); } #define get_thread_bucket(b) __get_thread_bucket((b) PASS_REGS) @@ -699,7 +699,7 @@ static inline void **__get_thread_bucket(void **buckets USES_REGS) { /* indirect bucket */ buckets = buckets + THREADS_DIRECT_BUCKETS + (worker_id - THREADS_DIRECT_BUCKETS) / THREADS_DIRECT_BUCKETS; if (*buckets) - return *buckets + (worker_id - THREADS_DIRECT_BUCKETS) % THREADS_DIRECT_BUCKETS; + return (void **)((char *)(buckets) + (worker_id - THREADS_DIRECT_BUCKETS) % THREADS_DIRECT_BUCKETS); /* empty indirect bucket */ return buckets; @@ -1236,15 +1236,15 @@ static inline void __restore_bindings(tr_fr_ptr unbind_tr, tr_fr_ptr rebind_tr U #define expand_auxiliary_stack(s) __expand_auxiliary_stack((s) PASS_REGS) static inline CELL *__expand_auxiliary_stack(CELL *stack USES_REGS) { - void *old_top = LOCAL_TrailTop; + char *old_top = (char *)LOCAL_TrailTop; INFORMATION_MESSAGE("Expanding trail in 64 Kbytes"); if (! Yap_growtrail(K64, TRUE)) { /* TRUE means 'contiguous_only' */ Yap_Error(OUT_OF_TRAIL_ERROR, TermNil, "stack full (STACK_CHECK_EXPAND)"); return NULL; } else { - UInt diff = (void *)LOCAL_TrailTop - old_top; - CELL *new_stack = (CELL *)((void *)stack + diff); - memmove((void *)new_stack, (void *)stack, old_top - (void *)stack); + UInt diff = (char *)LOCAL_TrailTop - old_top; + CELL *new_stack = (CELL *)((char *)stack + diff); + memmove((void *)new_stack, stack, old_top - (char *)stack); return new_stack; } } diff --git a/OPTYap/tab.rational.i b/OPTYap/tab.rational.i deleted file mode 100644 index 907137865..000000000 --- a/OPTYap/tab.rational.i +++ /dev/null @@ -1,77 +0,0 @@ -/************************************************************************ -** ** -** The YapTab/YapOr/OPTYap systems ** -** ** -** YapTab extends the Yap Prolog engine to support sequential tabling ** -** YapOr extends the Yap Prolog engine to support or-parallelism ** -** OPTYap extends the Yap Prolog engine to support or-parallel tabling ** -** ** -** ** -** Yap Prolog was developed at University of Porto, Portugal ** -** ** -************************************************************************/ - -#define RationalMark 7 //0m0...111 -#define IsRationalTerm(TERM) ((int) TERM == 7) - -typedef struct term_array { - void* *terms; - void* *nodes; - size_t length; - size_t capacity; -} term_array; - -void term_array_init(term_array *array, int capacity); -void term_array_free(term_array *array); -void term_array_push(term_array *array, void* t, void* n); -void* term_array_member(term_array array, void* t); - -void term_array_init(term_array *array, int capacity) { - array->length = 0; - array->terms = malloc(capacity * sizeof(void*)); - if (array->terms != NULL) { - array->capacity = capacity; - } else - Yap_Error(RESOURCE_ERROR_MEMORY, TermNil, "Out of memory."); // Handle out-of-memory - array->capacity = capacity; - array->nodes = malloc(capacity * sizeof(void*)); - if (array->nodes == NULL) - Yap_Error(RESOURCE_ERROR_MEMORY, TermNil, "Out of memory."); // Handle out-of-memory -} - -void term_array_free(term_array *array) { - free(array->terms); - free(array->nodes); - array->terms = NULL; - array->nodes = NULL; - array->length = 0; - array->capacity = 0; -} - -void term_array_push(term_array *array, void* t, void* n) { - if (array->length == array->capacity) { - int new_capacity = array->capacity * 2; - void *new_terms = realloc(array->terms, new_capacity * sizeof(void*)); - if (new_terms != NULL) { - array->terms = new_terms; - } else - Yap_Error(RESOURCE_ERROR_MEMORY, TermNil, "Out of memory."); // Handle out-of-memory - void *new_nodes = realloc(array->nodes, new_capacity * sizeof(void *)); - if (new_nodes != NULL) { - array->nodes = new_nodes; - } else - Yap_Error(RESOURCE_ERROR_MEMORY, TermNil, "Out of memory."); // Handle out-of-memory - array->capacity = new_capacity; - } - array->terms[array->length] = t; - array->nodes[array->length] = n; - array->length++; -} - -void* term_array_member(term_array array, void* t) { - int i; - for (i = 0; i < array.length; i++) - if (array.terms[i] == t) return array.nodes[i]; - return NULL; -} - diff --git a/OPTYap/tab.tries.c b/OPTYap/tab.tries.c index 34a94fec2..f8eaf7b00 100644 --- a/OPTYap/tab.tries.c +++ b/OPTYap/tab.tries.c @@ -168,7 +168,7 @@ static struct trie_statistics{ ** Rational Terms Support ** ******************************/ #ifdef TRIE_RATIONAL_TERMS -#include "tab.rational.i" +#include "tab.rational.h" #endif /* RATIONAL TERM SUPPORT FOR TRIES */ @@ -179,7 +179,7 @@ static struct trie_statistics{ #define INCLUDE_SUBGOAL_TRIE_CHECK_INSERT /* subgoal_trie_check_insert_entry */ #define INCLUDE_ANSWER_TRIE_CHECK_INSERT /* answer_trie_check_insert_entry */ #define INCLUDE_GLOBAL_TRIE_CHECK_INSERT /* global_trie_check_insert_entry */ -#include "tab.tries.i" +#include "tab.tries.h" #undef INCLUDE_GLOBAL_TRIE_CHECK_INSERT #undef INCLUDE_ANSWER_TRIE_CHECK_INSERT #undef INCLUDE_SUBGOAL_TRIE_CHECK_INSERT @@ -190,7 +190,7 @@ static struct trie_statistics{ #ifdef GLOBAL_TRIE_FOR_SUBTERMS #define INCLUDE_GLOBAL_TRIE_CHECK_INSERT /* global_trie_check_insert_gt_entry */ #endif /* GLOBAL_TRIE_FOR_SUBTERMS */ -#include "tab.tries.i" +#include "tab.tries.h" #undef INCLUDE_GLOBAL_TRIE_CHECK_INSERT #undef INCLUDE_ANSWER_TRIE_CHECK_INSERT #undef INCLUDE_SUBGOAL_TRIE_CHECK_INSERT @@ -199,7 +199,7 @@ static struct trie_statistics{ #define INCLUDE_SUBGOAL_SEARCH_LOOP /* subgoal_search_loop */ #define INCLUDE_ANSWER_SEARCH_LOOP /* answer_search_loop */ #define INCLUDE_LOAD_ANSWER_LOOP /* load_answer_loop */ -#include "tab.tries.i" +#include "tab.tries.h" #undef INCLUDE_LOAD_ANSWER_LOOP #undef INCLUDE_ANSWER_SEARCH_LOOP #undef INCLUDE_SUBGOAL_SEARCH_LOOP @@ -209,10 +209,10 @@ static struct trie_statistics{ #define INCLUDE_ANSWER_SEARCH_LOOP /* answer_search_terms_loop */ #ifdef TRIE_RATIONAL_TERMS #undef TRIE_RATIONAL_TERMS -#include "tab.tries.i" +#include "tab.tries.h" #define TRIE_RATIONAL_TERMS #else -#include "tab.tries.i" +#include "tab.tries.h" #endif #undef INCLUDE_ANSWER_SEARCH_LOOP #undef INCLUDE_SUBGOAL_SEARCH_LOOP @@ -224,10 +224,10 @@ static struct trie_statistics{ #define INCLUDE_LOAD_ANSWER_LOOP /* load_substitution_loop */ #ifdef TRIE_RATIONAL_TERMS #undef TRIE_RATIONAL_TERMS -#include "tab.tries.i" +#include "tab.tries.h" #define TRIE_RATIONAL_TERMS #else -#include "tab.tries.i" +#include "tab.tries.h" #endif #undef INCLUDE_LOAD_ANSWER_LOOP #undef INCLUDE_ANSWER_SEARCH_LOOP @@ -236,7 +236,7 @@ static struct trie_statistics{ #ifdef MODE_DIRECTED_TABLING #define INCLUDE_ANSWER_SEARCH_MODE_DIRECTED -#include "tab.tries.i" /* answer_search_min_max + answer_search_sum + invalidate_answer_trie */ +#include "tab.tries.h" /* answer_search_min_max + answer_search_sum + invalidate_answer_trie */ #undef INCLUDE_ANSWER_SEARCH_MODE_DIRECTED #endif /* MODE_DIRECTED_TABLING */ diff --git a/OPTYap/tab.tries.i b/OPTYap/tab.tries.i deleted file mode 100644 index 3c7eea8ce..000000000 --- a/OPTYap/tab.tries.i +++ /dev/null @@ -1,2045 +0,0 @@ -/************************************************************************ -** ** -** The YapTab/YapOr/OPTYap systems ** -** ** -** YapTab extends the Yap Prolog engine to support sequential tabling ** -** YapOr extends the Yap Prolog engine to support or-parallelism ** -** OPTYap extends the Yap Prolog engine to support or-parallel tabling ** -** ** -** ** -** Yap Prolog was developed at University of Porto, Portugal ** -** ** -************************************************************************/ - -/********************* -** Macros ** -*********************/ - -#ifdef MODE_GLOBAL_TRIE_ENTRY -#define INCREMENT_GLOBAL_TRIE_REFERENCE(ENTRY) \ - { register gt_node_ptr entry_node = (gt_node_ptr) (ENTRY); \ - TrNode_child(entry_node) = (gt_node_ptr) ((UInt) TrNode_child(entry_node) + 1); \ - } -#define NEW_SUBGOAL_TRIE_NODE(NODE, ENTRY, CHILD, PARENT, NEXT) \ - INCREMENT_GLOBAL_TRIE_REFERENCE(ENTRY); \ - new_subgoal_trie_node(NODE, ENTRY, CHILD, PARENT, NEXT) -#define NEW_ANSWER_TRIE_NODE(NODE, INSTR, ENTRY, CHILD, PARENT, NEXT) \ - INCREMENT_GLOBAL_TRIE_REFERENCE(ENTRY); \ - new_answer_trie_node(NODE, INSTR, ENTRY, CHILD, PARENT, NEXT) -#define NEW_GLOBAL_TRIE_NODE(NODE, ENTRY, CHILD, PARENT, NEXT) \ - INCREMENT_GLOBAL_TRIE_REFERENCE(ENTRY); \ - new_global_trie_node(NODE, ENTRY, CHILD, PARENT, NEXT) -#else -#define NEW_SUBGOAL_TRIE_NODE(NODE, ENTRY, CHILD, PARENT, NEXT) \ - new_subgoal_trie_node(NODE, ENTRY, CHILD, PARENT, NEXT) -#define NEW_ANSWER_TRIE_NODE(NODE, INSTR, ENTRY, CHILD, PARENT, NEXT) \ - new_answer_trie_node(NODE, INSTR, ENTRY, CHILD, PARENT, NEXT) -#define NEW_GLOBAL_TRIE_NODE(NODE, ENTRY, CHILD, PARENT, NEXT) \ - new_global_trie_node(NODE, ENTRY, CHILD, PARENT, NEXT) -#endif /* MODE_GLOBAL_TRIE_ENTRY */ - - -#ifdef MODE_GLOBAL_TRIE_LOOP -#define SUBGOAL_CHECK_INSERT_ENTRY(TAB_ENT, NODE, ENTRY) \ - NODE = global_trie_check_insert_entry(NODE, ENTRY PASS_REGS) -#define ANSWER_CHECK_INSERT_ENTRY(SG_FR, NODE, ENTRY, INSTR) \ - NODE = global_trie_check_insert_entry(NODE, ENTRY PASS_REGS) -#else -#define SUBGOAL_CHECK_INSERT_ENTRY(TAB_ENT, NODE, ENTRY) \ - NODE = subgoal_trie_check_insert_entry(TAB_ENT, NODE, ENTRY PASS_REGS) -#define ANSWER_CHECK_INSERT_ENTRY(SG_FR, NODE, ENTRY, INSTR) \ - NODE = answer_trie_check_insert_entry(SG_FR, NODE, ENTRY, INSTR PASS_REGS) -#endif /* MODE_GLOBAL_TRIE_LOOP */ - - -#ifdef INCLUDE_ANSWER_SEARCH_MODE_DIRECTED -#define ANSWER_SAFE_INSERT_ENTRY(NODE, ENTRY, INSTR) \ - { ans_node_ptr new_node; \ - NEW_ANSWER_TRIE_NODE(new_node, INSTR, ENTRY, NULL, NODE, NULL); \ - TrNode_child(NODE) = new_node; \ - NODE = new_node; \ - } -#ifdef THREADS -#define INVALIDATE_ANSWER_TRIE_NODE(NODE, SG_FR) \ - TrNode_next(NODE) = SgFr_invalid_chain(SG_FR); \ - SgFr_invalid_chain(SG_FR) = NODE -#else -#define INVALIDATE_ANSWER_TRIE_NODE(NODE, SG_FR) \ - FREE_ANSWER_TRIE_NODE(NODE) -#endif /* THREADS */ -#define INVALIDATE_ANSWER_TRIE_LEAF_NODE(NODE, SG_FR) \ - TAG_AS_ANSWER_INVALID_NODE(NODE); \ - TrNode_next(NODE) = SgFr_invalid_chain(SG_FR); \ - SgFr_invalid_chain(SG_FR) = NODE -#endif /* INCLUDE_ANSWER_SEARCH_MODE_DIRECTED */ - - - -/************************************************************************ -** subgoal_trie_check_insert_(gt)_entry ** -************************************************************************/ - -#ifdef INCLUDE_SUBGOAL_TRIE_CHECK_INSERT -#ifndef SUBGOAL_TRIE_LOCK_AT_WRITE_LEVEL /* SUBGOAL_TRIE_LOCK_AT_ENTRY_LEVEL || SUBGOAL_TRIE_LOCK_AT_NODE_LEVEL || ! YAPOR */ -#ifdef MODE_GLOBAL_TRIE_ENTRY -static inline sg_node_ptr subgoal_trie_check_insert_gt_entry(tab_ent_ptr tab_ent, sg_node_ptr parent_node, Term t USES_REGS) { -#else -static inline sg_node_ptr subgoal_trie_check_insert_entry(tab_ent_ptr tab_ent, sg_node_ptr parent_node, Term t USES_REGS) { -#endif /* MODE_GLOBAL_TRIE_ENTRY */ - sg_node_ptr child_node; - - LOCK_SUBGOAL_NODE(parent_node); - child_node = TrNode_child(parent_node); - if (child_node == NULL) { - NEW_SUBGOAL_TRIE_NODE(child_node, t, NULL, parent_node, NULL); - TrNode_child(parent_node) = child_node; - UNLOCK_SUBGOAL_NODE(parent_node); - return child_node; - } - - if (! IS_SUBGOAL_TRIE_HASH(child_node)) { - int count_nodes = 0; - do { - if (TrNode_entry(child_node) == t) { - UNLOCK_SUBGOAL_NODE(parent_node); - return child_node; - } - count_nodes++; - child_node = TrNode_next(child_node); - } while (child_node); - NEW_SUBGOAL_TRIE_NODE(child_node, t, NULL, parent_node, TrNode_child(parent_node)); - count_nodes++; - if (count_nodes >= MAX_NODES_PER_TRIE_LEVEL) { - /* alloc a new hash */ - sg_hash_ptr hash; - sg_node_ptr chain_node, next_node, *bucket; - new_subgoal_trie_hash(hash, count_nodes, tab_ent); - chain_node = child_node; - do { - bucket = Hash_buckets(hash) + HASH_ENTRY(TrNode_entry(chain_node), BASE_HASH_BUCKETS); - next_node = TrNode_next(chain_node); - TrNode_next(chain_node) = *bucket; - *bucket = chain_node; - chain_node = next_node; - } while (chain_node); - TrNode_child(parent_node) = (sg_node_ptr) hash; - } else { - TrNode_child(parent_node) = child_node; - } - UNLOCK_SUBGOAL_NODE(parent_node); - return child_node; - } - - { /* trie nodes with hashing */ - sg_hash_ptr hash; - sg_node_ptr *bucket; - int count_nodes = 0; - hash = (sg_hash_ptr) child_node; - bucket = Hash_buckets(hash) + HASH_ENTRY(t, Hash_num_buckets(hash)); - child_node = *bucket; - while (child_node) { - if (TrNode_entry(child_node) == t) { - UNLOCK_SUBGOAL_NODE(parent_node); - return child_node; - } - count_nodes++; - child_node = TrNode_next(child_node); - } - NEW_SUBGOAL_TRIE_NODE(child_node, t, NULL, parent_node, *bucket); - *bucket = child_node; - Hash_num_nodes(hash)++; - count_nodes++; - if (count_nodes >= MAX_NODES_PER_BUCKET && Hash_num_nodes(hash) > Hash_num_buckets(hash)) { - /* expand current hash */ - sg_node_ptr chain_node, next_node, *old_bucket, *old_hash_buckets, *new_hash_buckets; - int num_buckets; - num_buckets = Hash_num_buckets(hash) * 2; - ALLOC_BUCKETS(new_hash_buckets, num_buckets); - old_hash_buckets = Hash_buckets(hash); - old_bucket = old_hash_buckets + Hash_num_buckets(hash); - do { - if (*--old_bucket) { - chain_node = *old_bucket; - do { - bucket = new_hash_buckets + HASH_ENTRY(TrNode_entry(chain_node), num_buckets); - next_node = TrNode_next(chain_node); - TrNode_next(chain_node) = *bucket; - *bucket = chain_node; - chain_node = next_node; - } while (chain_node); - } - } while (old_bucket != old_hash_buckets); - Hash_buckets(hash) = new_hash_buckets; - Hash_num_buckets(hash) = num_buckets; - FREE_BUCKETS(old_hash_buckets); - } - UNLOCK_SUBGOAL_NODE(parent_node); - return child_node; - } -} -#else /* SUBGOAL_TRIE_LOCK_AT_WRITE_LEVEL */ -#ifdef MODE_GLOBAL_TRIE_ENTRY -static inline sg_node_ptr subgoal_trie_check_insert_gt_entry(tab_ent_ptr tab_ent, sg_node_ptr parent_node, Term t USES_REGS) { -#else -static inline sg_node_ptr subgoal_trie_check_insert_entry(tab_ent_ptr tab_ent, sg_node_ptr parent_node, Term t USES_REGS) { -#endif /* MODE_GLOBAL_TRIE_ENTRY */ - sg_node_ptr child_node; - sg_hash_ptr hash; - - child_node = TrNode_child(parent_node); - if (child_node == NULL) { -#ifdef SUBGOAL_TRIE_ALLOC_BEFORE_CHECK - NEW_SUBGOAL_TRIE_NODE(child_node, t, NULL, parent_node, NULL); -#endif /* SUBGOAL_TRIE_ALLOC_BEFORE_CHECK */ - LOCK_SUBGOAL_NODE(parent_node); - if (TrNode_child(parent_node)) { - sg_node_ptr chain_node = TrNode_child(parent_node); - if (IS_SUBGOAL_TRIE_HASH(chain_node)) { -#ifdef SUBGOAL_TRIE_ALLOC_BEFORE_CHECK - FREE_SUBGOAL_TRIE_NODE(child_node); -#endif /* SUBGOAL_TRIE_ALLOC_BEFORE_CHECK */ - UNLOCK_SUBGOAL_NODE(parent_node); - hash = (sg_hash_ptr) chain_node; - goto subgoal_trie_hash; - } - do { - if (TrNode_entry(chain_node) == t) { -#ifdef SUBGOAL_TRIE_ALLOC_BEFORE_CHECK - FREE_SUBGOAL_TRIE_NODE(child_node); -#endif /* SUBGOAL_TRIE_ALLOC_BEFORE_CHECK */ - UNLOCK_SUBGOAL_NODE(parent_node); - return chain_node; - } - chain_node = TrNode_next(chain_node); - } while (chain_node); -#ifdef SUBGOAL_TRIE_ALLOC_BEFORE_CHECK - TrNode_next(child_node) = TrNode_child(parent_node); -#else - NEW_SUBGOAL_TRIE_NODE(child_node, t, NULL, parent_node, TrNode_child(parent_node)); - } else { - NEW_SUBGOAL_TRIE_NODE(child_node, t, NULL, parent_node, NULL); -#endif /* SUBGOAL_TRIE_ALLOC_BEFORE_CHECK */ - } - TrNode_child(parent_node) = child_node; - UNLOCK_SUBGOAL_NODE(parent_node); - return child_node; - } - - if (! IS_SUBGOAL_TRIE_HASH(child_node)) { - sg_node_ptr first_node = child_node; - int count_nodes = 0; - do { - if (TrNode_entry(child_node) == t) - return child_node; - count_nodes++; - child_node = TrNode_next(child_node); - } while (child_node); -#ifdef SUBGOAL_TRIE_ALLOC_BEFORE_CHECK - NEW_SUBGOAL_TRIE_NODE(child_node, t, NULL, parent_node, first_node); -#endif /* SUBGOAL_TRIE_ALLOC_BEFORE_CHECK */ - LOCK_SUBGOAL_NODE(parent_node); - if (first_node != TrNode_child(parent_node)) { - sg_node_ptr chain_node = TrNode_child(parent_node); - if (IS_SUBGOAL_TRIE_HASH(chain_node)) { -#ifdef SUBGOAL_TRIE_ALLOC_BEFORE_CHECK - FREE_SUBGOAL_TRIE_NODE(child_node); -#endif /* SUBGOAL_TRIE_ALLOC_BEFORE_CHECK */ - UNLOCK_SUBGOAL_NODE(parent_node); - hash = (sg_hash_ptr) chain_node; - goto subgoal_trie_hash; - } - do { - if (TrNode_entry(chain_node) == t) { -#ifdef SUBGOAL_TRIE_ALLOC_BEFORE_CHECK - FREE_SUBGOAL_TRIE_NODE(child_node); -#endif /* SUBGOAL_TRIE_ALLOC_BEFORE_CHECK */ - UNLOCK_SUBGOAL_NODE(parent_node); - return chain_node; - } - count_nodes++; - chain_node = TrNode_next(chain_node); - } while (chain_node != first_node); -#ifdef SUBGOAL_TRIE_ALLOC_BEFORE_CHECK - TrNode_next(child_node) = TrNode_child(parent_node); -#else - NEW_SUBGOAL_TRIE_NODE(child_node, t, NULL, parent_node, TrNode_child(parent_node)); - } else { - NEW_SUBGOAL_TRIE_NODE(child_node, t, NULL, parent_node, first_node); -#endif /* SUBGOAL_TRIE_ALLOC_BEFORE_CHECK */ - } - count_nodes++; - if (count_nodes >= MAX_NODES_PER_TRIE_LEVEL) { - /* alloc a new hash */ - sg_node_ptr chain_node, next_node, *bucket; - new_subgoal_trie_hash(hash, count_nodes, tab_ent); - chain_node = child_node; - do { - bucket = Hash_buckets(hash) + HASH_ENTRY(TrNode_entry(chain_node), BASE_HASH_BUCKETS); - next_node = TrNode_next(chain_node); - TrNode_next(chain_node) = *bucket; - *bucket = chain_node; - chain_node = next_node; - } while (chain_node); - TrNode_child(parent_node) = (sg_node_ptr) hash; - } else { - TrNode_child(parent_node) = child_node; - } - UNLOCK_SUBGOAL_NODE(parent_node); - return child_node; - } - - hash = (sg_hash_ptr) child_node; -subgoal_trie_hash: - { /* trie nodes with hashing */ - sg_node_ptr *bucket, first_node; - int num_buckets, count_nodes = 0; - - do { - num_buckets = Hash_num_buckets(hash); - // __sync_synchronize(); - bucket = Hash_buckets(hash) + HASH_ENTRY(t, num_buckets); - first_node = child_node = *bucket; - } while (num_buckets != Hash_num_buckets(hash)); - while (child_node) { - if (TrNode_entry(child_node) == t) - return child_node; - count_nodes++; - child_node = TrNode_next(child_node); - } -#ifdef SUBGOAL_TRIE_ALLOC_BEFORE_CHECK - NEW_SUBGOAL_TRIE_NODE(child_node, t, NULL, parent_node, first_node); -#endif /* SUBGOAL_TRIE_ALLOC_BEFORE_CHECK */ - LOCK_SUBGOAL_NODE(parent_node); - if (num_buckets != Hash_num_buckets(hash)) { - /* the hash has been expanded */ -#ifdef SUBGOAL_TRIE_ALLOC_BEFORE_CHECK - FREE_SUBGOAL_TRIE_NODE(child_node); -#endif /* SUBGOAL_TRIE_ALLOC_BEFORE_CHECK */ - UNLOCK_SUBGOAL_NODE(parent_node); - goto subgoal_trie_hash; - } - if (first_node != *bucket) { - sg_node_ptr chain_node = *bucket; - do { - if (TrNode_entry(chain_node) == t) { -#ifdef SUBGOAL_TRIE_ALLOC_BEFORE_CHECK - FREE_SUBGOAL_TRIE_NODE(child_node); -#endif /* SUBGOAL_TRIE_ALLOC_BEFORE_CHECK */ - UNLOCK_SUBGOAL_NODE(parent_node); - return chain_node; - } - count_nodes++; - chain_node = TrNode_next(chain_node); - } while (chain_node != first_node); -#ifdef SUBGOAL_TRIE_ALLOC_BEFORE_CHECK - TrNode_next(child_node) = *bucket; -#else - NEW_SUBGOAL_TRIE_NODE(child_node, t, NULL, parent_node, *bucket); - } else { - NEW_SUBGOAL_TRIE_NODE(child_node, t, NULL, parent_node, first_node); -#endif /* SUBGOAL_TRIE_ALLOC_BEFORE_CHECK */ - } - *bucket = child_node; - Hash_num_nodes(hash)++; - count_nodes++; - if (count_nodes >= MAX_NODES_PER_BUCKET && Hash_num_nodes(hash) > Hash_num_buckets(hash)) { - /* expand current hash */ - sg_node_ptr chain_node, next_node, *old_bucket, *old_hash_buckets, *new_hash_buckets; - num_buckets = Hash_num_buckets(hash) * 2; - ALLOC_BUCKETS(new_hash_buckets, num_buckets); - old_hash_buckets = Hash_buckets(hash); - old_bucket = old_hash_buckets + Hash_num_buckets(hash); - do { - if (*--old_bucket) { - chain_node = *old_bucket; - do { - bucket = new_hash_buckets + HASH_ENTRY(TrNode_entry(chain_node), num_buckets); - next_node = TrNode_next(chain_node); - TrNode_next(chain_node) = *bucket; - *bucket = chain_node; - chain_node = next_node; - } while (chain_node); - } - } while (old_bucket != old_hash_buckets); - Hash_buckets(hash) = new_hash_buckets; - Hash_num_buckets(hash) = num_buckets; - FREE_BUCKETS(old_hash_buckets); - } - UNLOCK_SUBGOAL_NODE(parent_node); - return child_node; - } -} -#endif /* SUBGOAL_TRIE_LOCK_LEVEL */ -#endif /* INCLUDE_SUBGOAL_TRIE_CHECK_INSERT */ - - - -/************************************************************************ -** answer_trie_check_insert_(gt)_entry ** -************************************************************************/ - -#ifdef INCLUDE_ANSWER_TRIE_CHECK_INSERT -#ifndef ANSWER_TRIE_LOCK_AT_WRITE_LEVEL /* ANSWER_TRIE_LOCK_AT_ENTRY_LEVEL || ANSWER_TRIE_LOCK_AT_NODE_LEVEL || ! YAPOR */ -#ifdef MODE_GLOBAL_TRIE_ENTRY -static inline ans_node_ptr answer_trie_check_insert_gt_entry(sg_fr_ptr sg_fr, ans_node_ptr parent_node, Term t, int instr USES_REGS) { -#else -static inline ans_node_ptr answer_trie_check_insert_entry(sg_fr_ptr sg_fr, ans_node_ptr parent_node, Term t, int instr USES_REGS) { -#endif /* MODE_GLOBAL_TRIE_ENTRY */ - ans_node_ptr child_node; - - TABLING_ERROR_CHECKING(answer_trie_check_insert_(gt)_entry, IS_ANSWER_LEAF_NODE(parent_node)); - LOCK_ANSWER_NODE(parent_node); - child_node = TrNode_child(parent_node); - if (child_node == NULL) { - NEW_ANSWER_TRIE_NODE(child_node, instr, t, NULL, parent_node, NULL); - TrNode_child(parent_node) = child_node; - UNLOCK_ANSWER_NODE(parent_node); - return child_node; - } - - if (! IS_ANSWER_TRIE_HASH(child_node)) { - int count_nodes = 0; - do { - if (TrNode_entry(child_node) == t) { - UNLOCK_ANSWER_NODE(parent_node); - return child_node; - } - count_nodes++; - child_node = TrNode_next(child_node); - } while (child_node); - NEW_ANSWER_TRIE_NODE(child_node, instr, t, NULL, parent_node, TrNode_child(parent_node)); - count_nodes++; - if (count_nodes >= MAX_NODES_PER_TRIE_LEVEL) { - /* alloc a new hash */ - ans_hash_ptr hash; - ans_node_ptr chain_node, next_node, *bucket; - new_answer_trie_hash(hash, count_nodes, sg_fr); - chain_node = child_node; - do { - bucket = Hash_buckets(hash) + HASH_ENTRY(TrNode_entry(chain_node), BASE_HASH_BUCKETS); - next_node = TrNode_next(chain_node); - TrNode_next(chain_node) = *bucket; - *bucket = chain_node; - chain_node = next_node; - } while (chain_node); - TrNode_child(parent_node) = (ans_node_ptr) hash; - } else { - TrNode_child(parent_node) = child_node; - } - UNLOCK_ANSWER_NODE(parent_node); - return child_node; - } - - { /* trie nodes with hashing */ - ans_hash_ptr hash; - ans_node_ptr *bucket; - int count_nodes = 0; - hash = (ans_hash_ptr) child_node; - bucket = Hash_buckets(hash) + HASH_ENTRY(t, Hash_num_buckets(hash)); - child_node = *bucket; - while (child_node) { - if (TrNode_entry(child_node) == t) { - UNLOCK_ANSWER_NODE(parent_node); - return child_node; - } - count_nodes++; - child_node = TrNode_next(child_node); - } - NEW_ANSWER_TRIE_NODE(child_node, instr, t, NULL, parent_node, *bucket); - *bucket = child_node; - Hash_num_nodes(hash)++; - count_nodes++; - if (count_nodes >= MAX_NODES_PER_BUCKET && Hash_num_nodes(hash) > Hash_num_buckets(hash)) { - /* expand current hash */ - ans_node_ptr chain_node, next_node, *old_bucket, *old_hash_buckets, *new_hash_buckets; - int num_buckets; - num_buckets = Hash_num_buckets(hash) * 2; - ALLOC_BUCKETS(new_hash_buckets, num_buckets); - old_hash_buckets = Hash_buckets(hash); - old_bucket = old_hash_buckets + Hash_num_buckets(hash); - do { - if (*--old_bucket) { - chain_node = *old_bucket; - do { - bucket = new_hash_buckets + HASH_ENTRY(TrNode_entry(chain_node), num_buckets); - next_node = TrNode_next(chain_node); - TrNode_next(chain_node) = *bucket; - *bucket = chain_node; - chain_node = next_node; - } while (chain_node); - } - } while (old_bucket != old_hash_buckets); - Hash_buckets(hash) = new_hash_buckets; - Hash_num_buckets(hash) = num_buckets; - FREE_BUCKETS(old_hash_buckets); - } - UNLOCK_ANSWER_NODE(parent_node); - return child_node; - } -} -#else /* ANSWER_TRIE_LOCK_AT_WRITE_LEVEL */ -#ifdef MODE_GLOBAL_TRIE_ENTRY -static inline ans_node_ptr answer_trie_check_insert_gt_entry(sg_fr_ptr sg_fr, ans_node_ptr parent_node, Term t, int instr USES_REGS) { -#else -static inline ans_node_ptr answer_trie_check_insert_entry(sg_fr_ptr sg_fr, ans_node_ptr parent_node, Term t, int instr USES_REGS) { -#endif /* MODE_GLOBAL_TRIE_ENTRY */ - ans_node_ptr child_node; - ans_hash_ptr hash; - - TABLING_ERROR_CHECKING(answer_trie_check_insert_(gt)_entry, IS_ANSWER_LEAF_NODE(parent_node)); - child_node = TrNode_child(parent_node); - if (child_node == NULL) { -#ifdef ANSWER_TRIE_ALLOC_BEFORE_CHECK - NEW_ANSWER_TRIE_NODE(child_node, instr, t, NULL, parent_node, NULL); -#endif /* ANSWER_TRIE_ALLOC_BEFORE_CHECK */ - LOCK_ANSWER_NODE(parent_node); - if (TrNode_child(parent_node)) { - ans_node_ptr chain_node = TrNode_child(parent_node); - if (IS_ANSWER_TRIE_HASH(chain_node)) { -#ifdef ANSWER_TRIE_ALLOC_BEFORE_CHECK - FREE_ANSWER_TRIE_NODE(child_node); -#endif /* ANSWER_TRIE_ALLOC_BEFORE_CHECK */ - UNLOCK_ANSWER_NODE(parent_node); - hash = (ans_hash_ptr) chain_node; - goto answer_trie_hash; - } - do { - if (TrNode_entry(chain_node) == t) { -#ifdef ANSWER_TRIE_ALLOC_BEFORE_CHECK - FREE_ANSWER_TRIE_NODE(child_node); -#endif /* ANSWER_TRIE_ALLOC_BEFORE_CHECK */ - UNLOCK_ANSWER_NODE(parent_node); - return chain_node; - } - chain_node = TrNode_next(chain_node); - } while (chain_node); -#ifdef ANSWER_TRIE_ALLOC_BEFORE_CHECK - TrNode_next(child_node) = TrNode_child(parent_node); -#else - NEW_ANSWER_TRIE_NODE(child_node, instr, t, NULL, parent_node, TrNode_child(parent_node)); - } else { - NEW_ANSWER_TRIE_NODE(child_node, instr, t, NULL, parent_node, NULL); -#endif /* ANSWER_TRIE_ALLOC_BEFORE_CHECK */ - } - TrNode_child(parent_node) = child_node; - UNLOCK_ANSWER_NODE(parent_node); - return child_node; - } - - if (! IS_ANSWER_TRIE_HASH(child_node)) { - ans_node_ptr first_node = child_node; - int count_nodes = 0; - do { - if (TrNode_entry(child_node) == t) - return child_node; - count_nodes++; - child_node = TrNode_next(child_node); - } while (child_node); -#ifdef ANSWER_TRIE_ALLOC_BEFORE_CHECK - NEW_ANSWER_TRIE_NODE(child_node, instr, t, NULL, parent_node, first_node); -#endif /* ANSWER_TRIE_ALLOC_BEFORE_CHECK */ - LOCK_ANSWER_NODE(parent_node); - if (first_node != TrNode_child(parent_node)) { - ans_node_ptr chain_node = TrNode_child(parent_node); - if (IS_ANSWER_TRIE_HASH(chain_node)) { -#ifdef ANSWER_TRIE_ALLOC_BEFORE_CHECK - FREE_ANSWER_TRIE_NODE(child_node); -#endif /* ANSWER_TRIE_ALLOC_BEFORE_CHECK */ - UNLOCK_ANSWER_NODE(parent_node); - hash = (ans_hash_ptr) chain_node; - goto answer_trie_hash; - } - do { - if (TrNode_entry(chain_node) == t) { -#ifdef ANSWER_TRIE_ALLOC_BEFORE_CHECK - FREE_ANSWER_TRIE_NODE(child_node); -#endif /* ANSWER_TRIE_ALLOC_BEFORE_CHECK */ - UNLOCK_ANSWER_NODE(parent_node); - return chain_node; - } - count_nodes++; - chain_node = TrNode_next(chain_node); - } while (chain_node != first_node); -#ifdef ANSWER_TRIE_ALLOC_BEFORE_CHECK - TrNode_next(child_node) = TrNode_child(parent_node); -#else - NEW_ANSWER_TRIE_NODE(child_node, instr, t, NULL, parent_node, TrNode_child(parent_node)); - } else { - NEW_ANSWER_TRIE_NODE(child_node, instr, t, NULL, parent_node, first_node); -#endif /* ANSWER_TRIE_ALLOC_BEFORE_CHECK */ - } - count_nodes++; - if (count_nodes >= MAX_NODES_PER_TRIE_LEVEL) { - /* alloc a new hash */ - ans_node_ptr chain_node, next_node, *bucket; - new_answer_trie_hash(hash, count_nodes, sg_fr); - chain_node = child_node; - do { - bucket = Hash_buckets(hash) + HASH_ENTRY(TrNode_entry(chain_node), BASE_HASH_BUCKETS); - next_node = TrNode_next(chain_node); - TrNode_next(chain_node) = *bucket; - *bucket = chain_node; - chain_node = next_node; - } while (chain_node); - TrNode_child(parent_node) = (ans_node_ptr) hash; - } else { - TrNode_child(parent_node) = child_node; - } - UNLOCK_ANSWER_NODE(parent_node); - return child_node; - } - - hash = (ans_hash_ptr) child_node; -answer_trie_hash: - { /* trie nodes with hashing */ - ans_node_ptr *bucket, first_node; - int num_buckets, count_nodes = 0; - - do { - num_buckets = Hash_num_buckets(hash); - // __sync_synchronize(); - bucket = Hash_buckets(hash) + HASH_ENTRY(t, num_buckets); - first_node = child_node = *bucket; - } while (num_buckets != Hash_num_buckets(hash)); - while (child_node) { - if (TrNode_entry(child_node) == t) - return child_node; - count_nodes++; - child_node = TrNode_next(child_node); - } -#ifdef ANSWER_TRIE_ALLOC_BEFORE_CHECK - NEW_ANSWER_TRIE_NODE(child_node, instr, t, NULL, parent_node, first_node); -#endif /* ANSWER_TRIE_ALLOC_BEFORE_CHECK */ - LOCK_ANSWER_NODE(parent_node); - if (num_buckets != Hash_num_buckets(hash)) { - /* the hash has been expanded */ -#ifdef ANSWER_TRIE_ALLOC_BEFORE_CHECK - FREE_ANSWER_TRIE_NODE(child_node); -#endif /* ANSWER_TRIE_ALLOC_BEFORE_CHECK */ - UNLOCK_ANSWER_NODE(parent_node); - goto answer_trie_hash; - } - if (first_node != *bucket) { - ans_node_ptr chain_node = *bucket; - do { - if (TrNode_entry(chain_node) == t) { -#ifdef ANSWER_TRIE_ALLOC_BEFORE_CHECK - FREE_ANSWER_TRIE_NODE(child_node); -#endif /* ANSWER_TRIE_ALLOC_BEFORE_CHECK */ - UNLOCK_ANSWER_NODE(parent_node); - return chain_node; - } - count_nodes++; - chain_node = TrNode_next(chain_node); - } while (chain_node != first_node); -#ifdef ANSWER_TRIE_ALLOC_BEFORE_CHECK - TrNode_next(child_node) = *bucket; -#else - NEW_ANSWER_TRIE_NODE(child_node, instr, t, NULL, parent_node, *bucket); - } else { - NEW_ANSWER_TRIE_NODE(child_node, instr, t, NULL, parent_node, first_node); -#endif /* ANSWER_TRIE_ALLOC_BEFORE_CHECK */ - } - *bucket = child_node; - Hash_num_nodes(hash)++; - count_nodes++; - if (count_nodes >= MAX_NODES_PER_BUCKET && Hash_num_nodes(hash) > Hash_num_buckets(hash)) { - /* expand current hash */ - ans_node_ptr chain_node, next_node, *old_bucket, *old_hash_buckets, *new_hash_buckets; - num_buckets = Hash_num_buckets(hash) * 2; - ALLOC_BUCKETS(new_hash_buckets, num_buckets); - old_hash_buckets = Hash_buckets(hash); - old_bucket = old_hash_buckets + Hash_num_buckets(hash); - do { - if (*--old_bucket) { - chain_node = *old_bucket; - do { - bucket = new_hash_buckets + HASH_ENTRY(TrNode_entry(chain_node), num_buckets); - next_node = TrNode_next(chain_node); - TrNode_next(chain_node) = *bucket; - *bucket = chain_node; - chain_node = next_node; - } while (chain_node); - } - } while (old_bucket != old_hash_buckets); - Hash_buckets(hash) = new_hash_buckets; - Hash_num_buckets(hash) = num_buckets; - FREE_BUCKETS(old_hash_buckets); - } - UNLOCK_ANSWER_NODE(parent_node); - return child_node; - } -} -#endif /* ANSWER_TRIE_LOCK_LEVEL */ -#endif /* INCLUDE_ANSWER_TRIE_CHECK_INSERT */ - - - -/************************************************************************ -** global_trie_check_insert_(gt)_entry ** -************************************************************************/ - -#ifdef INCLUDE_GLOBAL_TRIE_CHECK_INSERT -#ifndef GLOBAL_TRIE_LOCK_AT_WRITE_LEVEL /* GLOBAL_TRIE_LOCK_AT_NODE_LEVEL || ! YAPOR */ -#ifdef MODE_GLOBAL_TRIE_ENTRY -static inline gt_node_ptr global_trie_check_insert_gt_entry(gt_node_ptr parent_node, Term t USES_REGS) { -#else -static inline gt_node_ptr global_trie_check_insert_entry(gt_node_ptr parent_node, Term t USES_REGS) { -#endif /* MODE_GLOBAL_TRIE_ENTRY */ - gt_node_ptr child_node; - - LOCK_GLOBAL_NODE(parent_node); - child_node = TrNode_child(parent_node); - if (child_node == NULL) { - NEW_GLOBAL_TRIE_NODE(child_node, t, NULL, parent_node, NULL); - TrNode_child(parent_node) = child_node; - UNLOCK_GLOBAL_NODE(parent_node); - return child_node; - } - - if (! IS_GLOBAL_TRIE_HASH(child_node)) { - int count_nodes = 0; - do { - if (TrNode_entry(child_node) == t) { - UNLOCK_GLOBAL_NODE(parent_node); - return child_node; - } - count_nodes++; - child_node = TrNode_next(child_node); - } while (child_node); - NEW_GLOBAL_TRIE_NODE(child_node, t, NULL, parent_node, TrNode_child(parent_node)); - count_nodes++; - if (count_nodes >= MAX_NODES_PER_TRIE_LEVEL) { - /* alloc a new hash */ - gt_hash_ptr hash; - gt_node_ptr chain_node, next_node, *bucket; - new_global_trie_hash(hash, count_nodes); - chain_node = child_node; - do { - bucket = Hash_buckets(hash) + HASH_ENTRY(TrNode_entry(chain_node), BASE_HASH_BUCKETS); - next_node = TrNode_next(chain_node); - TrNode_next(chain_node) = *bucket; - *bucket = chain_node; - chain_node = next_node; - } while (chain_node); - TrNode_child(parent_node) = (gt_node_ptr) hash; - } else { - TrNode_child(parent_node) = child_node; - } - UNLOCK_GLOBAL_NODE(parent_node); - return child_node; - } - - { /* trie nodes with hashing */ - gt_hash_ptr hash; - gt_node_ptr *bucket; - int count_nodes = 0; - hash = (gt_hash_ptr) child_node; - bucket = Hash_buckets(hash) + HASH_ENTRY(t, Hash_num_buckets(hash)); - child_node = *bucket; - while (child_node) { - if (TrNode_entry(child_node) == t) { - UNLOCK_GLOBAL_NODE(parent_node); - return child_node; - } - count_nodes++; - child_node = TrNode_next(child_node); - } - NEW_GLOBAL_TRIE_NODE(child_node, t, NULL, parent_node, *bucket); - *bucket = child_node; - Hash_num_nodes(hash)++; - count_nodes++; - if (count_nodes >= MAX_NODES_PER_BUCKET && Hash_num_nodes(hash) > Hash_num_buckets(hash)) { - /* expand current hash */ - gt_node_ptr chain_node, next_node, *old_bucket, *old_hash_buckets, *new_hash_buckets; - int num_buckets; - num_buckets = Hash_num_buckets(hash) * 2; - ALLOC_BUCKETS(new_hash_buckets, num_buckets); - old_hash_buckets = Hash_buckets(hash); - old_bucket = old_hash_buckets + Hash_num_buckets(hash); - do { - if (*--old_bucket) { - chain_node = *old_bucket; - do { - bucket = new_hash_buckets + HASH_ENTRY(TrNode_entry(chain_node), num_buckets); - next_node = TrNode_next(chain_node); - TrNode_next(chain_node) = *bucket; - *bucket = chain_node; - chain_node = next_node; - } while (chain_node); - } - } while (old_bucket != old_hash_buckets); - Hash_buckets(hash) = new_hash_buckets; - Hash_num_buckets(hash) = num_buckets; - FREE_BUCKETS(old_hash_buckets); - } - UNLOCK_GLOBAL_NODE(parent_node); - return child_node; - } -} -#else /* GLOBAL_TRIE_LOCK_AT_WRITE_LEVEL */ -#ifdef MODE_GLOBAL_TRIE_ENTRY -static inline gt_node_ptr global_trie_check_insert_gt_entry(gt_node_ptr parent_node, Term t USES_REGS) { -#else -static inline gt_node_ptr global_trie_check_insert_entry(gt_node_ptr parent_node, Term t USES_REGS) { -#endif /* MODE_GLOBAL_TRIE_ENTRY */ - gt_node_ptr child_node; - gt_hash_ptr hash; - - child_node = TrNode_child(parent_node); - if (child_node == NULL) { -#ifdef GLOBAL_TRIE_ALLOC_BEFORE_CHECK - NEW_GLOBAL_TRIE_NODE(child_node, t, NULL, parent_node, NULL); -#endif /* GLOBAL_TRIE_ALLOC_BEFORE_CHECK */ - LOCK_GLOBAL_NODE(parent_node); - if (TrNode_child(parent_node)) { - gt_node_ptr chain_node = TrNode_child(parent_node); - if (IS_GLOBAL_TRIE_HASH(chain_node)) { -#ifdef GLOBAL_TRIE_ALLOC_BEFORE_CHECK - FREE_GLOBAL_TRIE_NODE(child_node); -#endif /* GLOBAL_TRIE_ALLOC_BEFORE_CHECK */ - UNLOCK_GLOBAL_NODE(parent_node); - hash = (gt_hash_ptr) chain_node; - goto global_trie_hash; - } - do { - if (TrNode_entry(chain_node) == t) { -#ifdef GLOBAL_TRIE_ALLOC_BEFORE_CHECK - FREE_GLOBAL_TRIE_NODE(child_node); -#endif /* GLOBAL_TRIE_ALLOC_BEFORE_CHECK */ - UNLOCK_GLOBAL_NODE(parent_node); - return chain_node; - } - chain_node = TrNode_next(chain_node); - } while (chain_node); -#ifdef GLOBAL_TRIE_ALLOC_BEFORE_CHECK - TrNode_next(child_node) = TrNode_child(parent_node); -#else - NEW_GLOBAL_TRIE_NODE(child_node, t, NULL, parent_node, TrNode_child(parent_node)); - } else { - NEW_GLOBAL_TRIE_NODE(child_node, t, NULL, parent_node, NULL); -#endif /* GLOBAL_TRIE_ALLOC_BEFORE_CHECK */ - } - TrNode_child(parent_node) = child_node; - UNLOCK_GLOBAL_NODE(parent_node); - return child_node; - } - - if (! IS_GLOBAL_TRIE_HASH(child_node)) { - gt_node_ptr first_node = child_node; - int count_nodes = 0; - do { - if (TrNode_entry(child_node) == t) - return child_node; - count_nodes++; - child_node = TrNode_next(child_node); - } while (child_node); -#ifdef GLOBAL_TRIE_ALLOC_BEFORE_CHECK - NEW_GLOBAL_TRIE_NODE(child_node, t, NULL, parent_node, first_node); -#endif /* GLOBAL_TRIE_ALLOC_BEFORE_CHECK */ - LOCK_GLOBAL_NODE(parent_node); - if (first_node != TrNode_child(parent_node)) { - gt_node_ptr chain_node = TrNode_child(parent_node); - if (IS_GLOBAL_TRIE_HASH(chain_node)) { -#ifdef GLOBAL_TRIE_ALLOC_BEFORE_CHECK - FREE_GLOBAL_TRIE_NODE(child_node); -#endif /* GLOBAL_TRIE_ALLOC_BEFORE_CHECK */ - UNLOCK_GLOBAL_NODE(parent_node); - hash = (gt_hash_ptr) chain_node; - goto global_trie_hash; - } - do { - if (TrNode_entry(chain_node) == t) { -#ifdef GLOBAL_TRIE_ALLOC_BEFORE_CHECK - FREE_GLOBAL_TRIE_NODE(child_node); -#endif /* GLOBAL_TRIE_ALLOC_BEFORE_CHECK */ - UNLOCK_GLOBAL_NODE(parent_node); - return chain_node; - } - count_nodes++; - chain_node = TrNode_next(chain_node); - } while (chain_node != first_node); -#ifdef GLOBAL_TRIE_ALLOC_BEFORE_CHECK - TrNode_next(child_node) = TrNode_child(parent_node); -#else - NEW_GLOBAL_TRIE_NODE(child_node, t, NULL, parent_node, TrNode_child(parent_node)); - } else { - NEW_GLOBAL_TRIE_NODE(child_node, t, NULL, parent_node, first_node); -#endif /* GLOBAL_TRIE_ALLOC_BEFORE_CHECK */ - } - count_nodes++; - if (count_nodes >= MAX_NODES_PER_TRIE_LEVEL) { - /* alloc a new hash */ - gt_node_ptr chain_node, next_node, *bucket; - new_global_trie_hash(hash, count_nodes); - chain_node = child_node; - do { - bucket = Hash_buckets(hash) + HASH_ENTRY(TrNode_entry(chain_node), BASE_HASH_BUCKETS); - next_node = TrNode_next(chain_node); - TrNode_next(chain_node) = *bucket; - *bucket = chain_node; - chain_node = next_node; - } while (chain_node); - TrNode_child(parent_node) = (gt_node_ptr) hash; - } else { - TrNode_child(parent_node) = child_node; - } - UNLOCK_GLOBAL_NODE(parent_node); - return child_node; - } - - hash = (gt_hash_ptr) child_node; -global_trie_hash: - { /* trie nodes with hashing */ - gt_node_ptr *bucket, first_node; - int num_buckets, count_nodes = 0; - - do { - num_buckets = Hash_num_buckets(hash); - // __sync_synchronize(); - bucket = Hash_buckets(hash) + HASH_ENTRY(t, num_buckets); - first_node = child_node = *bucket; - } while (num_buckets != Hash_num_buckets(hash)); - while (child_node) { - if (TrNode_entry(child_node) == t) - return child_node; - count_nodes++; - child_node = TrNode_next(child_node); - } -#ifdef GLOBAL_TRIE_ALLOC_BEFORE_CHECK - NEW_GLOBAL_TRIE_NODE(child_node, t, NULL, parent_node, first_node); -#endif /* GLOBAL_TRIE_ALLOC_BEFORE_CHECK */ - LOCK_GLOBAL_NODE(parent_node); - if (num_buckets != Hash_num_buckets(hash)) { - /* the hash has been expanded */ -#ifdef GLOBAL_TRIE_ALLOC_BEFORE_CHECK - FREE_GLOBAL_TRIE_NODE(child_node); -#endif /* GLOBAL_TRIE_ALLOC_BEFORE_CHECK */ - UNLOCK_GLOBAL_NODE(parent_node); - goto global_trie_hash; - } - if (first_node != *bucket) { - gt_node_ptr chain_node = *bucket; - do { - if (TrNode_entry(chain_node) == t) { -#ifdef GLOBAL_TRIE_ALLOC_BEFORE_CHECK - FREE_GLOBAL_TRIE_NODE(child_node); -#endif /* GLOBAL_TRIE_ALLOC_BEFORE_CHECK */ - UNLOCK_GLOBAL_NODE(parent_node); - return chain_node; - } - count_nodes++; - chain_node = TrNode_next(chain_node); - } while (chain_node != first_node); -#ifdef GLOBAL_TRIE_ALLOC_BEFORE_CHECK - TrNode_next(child_node) = *bucket; -#else - NEW_GLOBAL_TRIE_NODE(child_node, t, NULL, parent_node, *bucket); - } else { - NEW_GLOBAL_TRIE_NODE(child_node, t, NULL, parent_node, first_node); -#endif /* GLOBAL_TRIE_ALLOC_BEFORE_CHECK */ - } - *bucket = child_node; - Hash_num_nodes(hash)++; - count_nodes++; - if (count_nodes >= MAX_NODES_PER_BUCKET && Hash_num_nodes(hash) > Hash_num_buckets(hash)) { - /* expand current hash */ - gt_node_ptr chain_node, next_node, *old_bucket, *old_hash_buckets, *new_hash_buckets; - num_buckets = Hash_num_buckets(hash) * 2; - ALLOC_BUCKETS(new_hash_buckets, num_buckets); - old_hash_buckets = Hash_buckets(hash); - old_bucket = old_hash_buckets + Hash_num_buckets(hash); - do { - if (*--old_bucket) { - chain_node = *old_bucket; - do { - bucket = new_hash_buckets + HASH_ENTRY(TrNode_entry(chain_node), num_buckets); - next_node = TrNode_next(chain_node); - TrNode_next(chain_node) = *bucket; - *bucket = chain_node; - chain_node = next_node; - } while (chain_node); - } - } while (old_bucket != old_hash_buckets); - Hash_buckets(hash) = new_hash_buckets; - Hash_num_buckets(hash) = num_buckets; - FREE_BUCKETS(old_hash_buckets); - } - UNLOCK_GLOBAL_NODE(parent_node); - return child_node; - } -} -#endif /* GLOBAL_TRIE_LOCK_LEVEL */ -#endif /* INCLUDE_GLOBAL_TRIE_CHECK_INSERT */ - - - -/************************************************************************ -** subgoal_search(_global_trie)(_terms)_loop ** -************************************************************************/ - -#ifdef INCLUDE_SUBGOAL_SEARCH_LOOP -#ifdef MODE_GLOBAL_TRIE_LOOP -#ifdef GLOBAL_TRIE_FOR_SUBTERMS -static inline gt_node_ptr subgoal_search_global_trie_terms_loop(Term t, int *subs_arity_ptr, CELL **stack_vars_ptr, CELL *stack_terms USES_REGS) { -#else -static inline gt_node_ptr subgoal_search_global_trie_loop(Term t, int *subs_arity_ptr, CELL **stack_vars_ptr USES_REGS) { -#endif /* GLOBAL_TRIE_FOR_SUBTERMS */ -#else -#ifdef MODE_TERMS_LOOP -static inline sg_node_ptr subgoal_search_terms_loop(tab_ent_ptr tab_ent, sg_node_ptr current_node, Term t, int *subs_arity_ptr, CELL **stack_vars_ptr USES_REGS) { -#else -static inline sg_node_ptr subgoal_search_loop(tab_ent_ptr tab_ent, sg_node_ptr current_node, Term t, int *subs_arity_ptr, CELL **stack_vars_ptr USES_REGS) { -#endif /* MODE_TERMS_LOOP */ -#endif /* MODE_GLOBAL_TRIE_LOOP */ -/************************************************************************ - =========== - | | - | ... | - | | - ----------- - | VAR_N | <-- stack_vars - ----------- * - | ... | /|\ - ----------- | subs_arity (N+1) - | VAR_0 | \|/ - ----------- * - YENV --> | | - ----------- - | | - | ... | - | | - =========== - | | - | ... | - | | - ----------- - TR --> | | <-- stack_terms_limit - ----------- - | | - | ... | - | | - ----------| - | TERM_N | <-- stack_terms - ----------| * - | ... | /|\ - ----------| | - | TERM_1 | | - ----------| | - | NULL | \|/ - =========== * - LOCAL_TrailTop --> | | - ----------- -************************************************************************/ -#ifdef MODE_GLOBAL_TRIE_LOOP - gt_node_ptr current_node = GLOBAL_root_gt; -#endif /* MODE_GLOBAL_TRIE_LOOP */ - int subs_arity = *subs_arity_ptr; - CELL *stack_vars = *stack_vars_ptr; -#if ! defined(MODE_GLOBAL_TRIE_LOOP) || ! defined(GLOBAL_TRIE_FOR_SUBTERMS) - CELL *stack_terms = (CELL *) LOCAL_TrailTop; -#endif /* ! MODE_GLOBAL_TRIE_LOOP || ! GLOBAL_TRIE_FOR_SUBTERMS */ - CELL *stack_terms_limit = (CELL *) TR; - AUX_STACK_CHECK_EXPAND(stack_terms, stack_terms_limit + 1); /* + 1 because initially we stiil haven't done any STACK_POP_DOWN */ - STACK_PUSH_UP(NULL, stack_terms); - -#if defined(MODE_GLOBAL_TRIE_LOOP) - /* for the global trie, it is safe to skip the IsVarTerm() and IsAtomOrIntTerm() tests in the first iteration */ - goto subgoal_search_loop_non_atomic; -#endif /* MODE_GLOBAL_TRIE_LOOP */ - -#ifdef TRIE_RATIONAL_TERMS - /* Needed structures, variables to support rational terms */ - term_array Ts; - void* CyclicTerm; - term_array_init(&Ts, 10); -#endif /* RATIONAL TERM SUPPORT FOR TRIES */ - - do { - if (IsVarTerm(t)) { - if (IsTableVarTerm(t)) { - t = MakeTableVarTerm(VarIndexOfTerm(t)); - SUBGOAL_CHECK_INSERT_ENTRY(tab_ent, current_node, t); - } else { - if (subs_arity == MAX_TABLE_VARS) - Yap_Error(INTERNAL_ERROR, TermNil, "subgoal_search_loop: MAX_TABLE_VARS exceeded"); - STACK_PUSH_UP(t, stack_vars); - *((CELL *)t) = GLOBAL_table_var_enumerator(subs_arity); - t = MakeTableVarTerm(subs_arity); - subs_arity = subs_arity + 1; - SUBGOAL_CHECK_INSERT_ENTRY(tab_ent, current_node, t); - } - } else if (IsAtomOrIntTerm(t)) { - SUBGOAL_CHECK_INSERT_ENTRY(tab_ent, current_node, t); -#ifdef MODE_TERMS_LOOP - } else { - gt_node_ptr entry_node; -#ifdef GLOBAL_TRIE_FOR_SUBTERMS - entry_node = subgoal_search_global_trie_terms_loop(t, &subs_arity, &stack_vars, stack_terms PASS_REGS); -#else - entry_node = subgoal_search_global_trie_loop(t, &subs_arity, &stack_vars PASS_REGS); -#endif /* GLOBAL_TRIE_FOR_SUBTERMS */ - current_node = subgoal_trie_check_insert_gt_entry(tab_ent, current_node, (Term) entry_node PASS_REGS); -#else /* ! MODE_TERMS_LOOP */ - } else -#ifdef TRIE_RATIONAL_TERMS - if (IsRationalTerm(t)) { - t = STACK_POP_DOWN(stack_terms); - SUBGOAL_CHECK_INSERT_ENTRY(tab_ent, current_node, t); - } else -#endif /* RATIONAL TERM SUPPORT FOR TRIES */ -#if defined(MODE_GLOBAL_TRIE_LOOP) - /* for the global trie, it is safe to start here in the first iteration */ - subgoal_search_loop_non_atomic: -#endif /* MODE_GLOBAL_TRIE_LOOP */ -#ifdef TRIE_COMPACT_PAIRS - if (IsPairTerm(t)) { -#ifdef TRIE_RATIONAL_TERMS - CyclicTerm = NULL; -#endif /* RATIONAL TERM SUPPORT FOR TRIES */ - CELL *aux_pair = RepPair(t); - if (aux_pair == PairTermMark) { - t = STACK_POP_DOWN(stack_terms); -#ifdef TRIE_RATIONAL_TERMS - if (IsPairTerm(t) && ! IsRationalTerm(t)) { - term_array_push(&Ts, (void *) t, (void *) current_node); -#else - if (IsPairTerm(t)) { -#endif /* RATIONAL TERM SUPPORT FOR TRIES */ - aux_pair = RepPair(t); - t = Deref(aux_pair[1]); -#ifdef TRIE_RATIONAL_TERMS - if (IsVarTerm(aux_pair[1]) || IsPairTerm(aux_pair[1])) { - CyclicTerm = term_array_member(Ts, (void *) t); - } - if (CyclicTerm != NULL) { - STACK_PUSH_UP((Term) CyclicTerm, stack_terms); - STACK_PUSH_UP((Term) RationalMark, stack_terms); - STACK_PUSH_UP(AbsPair(PairTermMark), stack_terms); - } else -#endif /* RATIONAL TERM SUPPORT FOR TRIES */ - if (t == TermNil) { - SUBGOAL_CHECK_INSERT_ENTRY(tab_ent, current_node, CompactPairEndList); - } else { - /* AUX_STACK_CHECK_EXPAND(stack_terms, stack_terms_limit + 2); */ - /* AUX_STACK_CHECK_EXPAND is not necessary here because the situation of pushing ** - ** up 3 terms has already initially checked for the CompactPairInit term */ - STACK_PUSH_UP(t, stack_terms); - STACK_PUSH_UP(AbsPair(PairTermMark), stack_terms); - } -#ifdef TRIE_RATIONAL_TERMS - CyclicTerm = NULL; - if (IsVarTerm(aux_pair[0]) || IsPairTerm(aux_pair[0])) - CyclicTerm = term_array_member(Ts, (void *) Deref(aux_pair[0])); - if (CyclicTerm != NULL) { - STACK_PUSH_UP((Term) CyclicTerm, stack_terms); - STACK_PUSH_UP((Term) RationalMark, stack_terms); - } else -#endif /* RATIONAL TERM SUPPORT FOR TRIES */ - STACK_PUSH_UP(Deref(aux_pair[0]), stack_terms); - } else { - SUBGOAL_CHECK_INSERT_ENTRY(tab_ent, current_node, CompactPairEndTerm); - STACK_PUSH_UP(t, stack_terms); - } -#if defined(MODE_GLOBAL_TRIE_LOOP) && defined(GLOBAL_TRIE_FOR_SUBTERMS) - } else if (current_node != GLOBAL_root_gt) { - gt_node_ptr entry_node = subgoal_search_global_trie_terms_loop(t, &subs_arity, &stack_vars, stack_terms PASS_REGS); - current_node = global_trie_check_insert_gt_entry(current_node, (Term) entry_node PASS_REGS); -#endif /* MODE_GLOBAL_TRIE_LOOP && GLOBAL_TRIE_FOR_SUBTERMS */ - } else { -#ifdef TRIE_RATIONAL_TERMS - term_array_push(&Ts, (void *) t, (void *) current_node); -#endif /* RATIONAL TERM SUPPORT FOR TRIES */ - SUBGOAL_CHECK_INSERT_ENTRY(tab_ent, current_node, CompactPairInit); - t = Deref(aux_pair[1]); -#ifdef TRIE_RATIONAL_TERMS - if (IsVarTerm(aux_pair[1]) || IsPairTerm(aux_pair[1])) { - CyclicTerm = term_array_member(Ts, (void *) t); - } - if (CyclicTerm != NULL) { - STACK_PUSH_UP((Term) CyclicTerm, stack_terms); - STACK_PUSH_UP((Term) RationalMark, stack_terms); - STACK_PUSH_UP(AbsPair(PairTermMark), stack_terms); - } else -#endif /* RATIONAL TERM SUPPORT FOR TRIES */ - if (t == TermNil) { - SUBGOAL_CHECK_INSERT_ENTRY(tab_ent, current_node, CompactPairEndList); - } else { - AUX_STACK_CHECK_EXPAND(stack_terms, stack_terms_limit + 2); - STACK_PUSH_UP(t, stack_terms); - STACK_PUSH_UP(AbsPair(PairTermMark), stack_terms); - } -#ifdef TRIE_RATIONAL_TERMS - CyclicTerm = NULL; - if (IsVarTerm(aux_pair[0]) || IsPairTerm(aux_pair[0])) - CyclicTerm = term_array_member(Ts, (void *) Deref(aux_pair[0])); - if (CyclicTerm != NULL) { - STACK_PUSH_UP((Term) CyclicTerm, stack_terms); - STACK_PUSH_UP((Term) RationalMark, stack_terms); - } else -#endif /* RATIONAL TERM SUPPORT FOR TRIES */ - STACK_PUSH_UP(Deref(aux_pair[0]), stack_terms); - } -#if defined(MODE_GLOBAL_TRIE_LOOP) && defined(GLOBAL_TRIE_FOR_SUBTERMS) - } else if (current_node != GLOBAL_root_gt) { - gt_node_ptr entry_node = subgoal_search_global_trie_terms_loop(t, &subs_arity, &stack_vars, stack_terms PASS_REGS); - current_node = global_trie_check_insert_gt_entry(current_node, (Term) entry_node PASS_REGS); -#endif /* MODE_GLOBAL_TRIE_LOOP && GLOBAL_TRIE_FOR_SUBTERMS */ -#else /* ! TRIE_COMPACT_PAIRS */ -#if defined(MODE_GLOBAL_TRIE_LOOP) && defined(GLOBAL_TRIE_FOR_SUBTERMS) - if (current_node != GLOBAL_root_gt) { - gt_node_ptr entry_node = subgoal_search_global_trie_terms_loop(t, &subs_arity, &stack_vars, stack_terms PASS_REGS); - current_node = global_trie_check_insert_gt_entry(current_node, (Term) entry_node PASS_REGS); - } else -#endif /* MODE_GLOBAL_TRIE_LOOP && GLOBAL_TRIE_FOR_SUBTERMS */ - if (IsPairTerm(t)) { - CELL *aux_pair = RepPair(t); - SUBGOAL_CHECK_INSERT_ENTRY(tab_ent, current_node, AbsPair(NULL)); - AUX_STACK_CHECK_EXPAND(stack_terms, stack_terms_limit + 1); - STACK_PUSH_UP(Deref(aux_pair[1]), stack_terms); - STACK_PUSH_UP(Deref(aux_pair[0]), stack_terms); -#endif /* TRIE_COMPACT_PAIRS */ - } else if (IsApplTerm(t)) { - Functor f = FunctorOfTerm(t); - if (f == FunctorDouble) { - union { - Term t_dbl[sizeof(Float)/sizeof(Term)]; - Float dbl; - } u; - u.dbl = FloatOfTerm(t); - SUBGOAL_CHECK_INSERT_ENTRY(tab_ent, current_node, AbsAppl((Term *)f)); -#if SIZEOF_DOUBLE == 2 * SIZEOF_INT_P - SUBGOAL_CHECK_INSERT_ENTRY(tab_ent, current_node, u.t_dbl[1]); -#endif /* SIZEOF_DOUBLE x SIZEOF_INT_P */ - SUBGOAL_CHECK_INSERT_ENTRY(tab_ent, current_node, u.t_dbl[0]); -#ifdef MODE_GLOBAL_TRIE_LOOP - SUBGOAL_CHECK_INSERT_ENTRY(tab_ent, current_node, AbsAppl((Term *)f)); -#endif /* MODE_GLOBAL_TRIE_LOOP */ - } else if (f == FunctorLongInt) { - Int li = LongIntOfTerm(t); - SUBGOAL_CHECK_INSERT_ENTRY(tab_ent, current_node, AbsAppl((Term *)f)); - SUBGOAL_CHECK_INSERT_ENTRY(tab_ent, current_node, li); -#ifdef MODE_GLOBAL_TRIE_LOOP - SUBGOAL_CHECK_INSERT_ENTRY(tab_ent, current_node, AbsAppl((Term *)f)); -#endif /* MODE_GLOBAL_TRIE_LOOP */ - } else if (f == FunctorBigInt || f == FunctorString) { - CELL *new = Yap_HeapStoreOpaqueTerm(t); - SUBGOAL_CHECK_INSERT_ENTRY(tab_ent, current_node, AbsAppl((Term *)f)); - SUBGOAL_CHECK_INSERT_ENTRY(tab_ent, current_node, (CELL)new); -#ifdef MODE_GLOBAL_TRIE_LOOP - SUBGOAL_CHECK_INSERT_ENTRY(tab_ent, current_node, AbsAppl((Term *)f)); -#endif /* MODE_GLOBAL_TRIE_LOOP */ - } else if (f == FunctorDBRef) { - Yap_Error(INTERNAL_ERROR, TermNil, "subgoal_search_loop: unsupported type tag FunctorDBRef"); - } else { -#ifdef TRIE_RATIONAL_TERMS - term_array_push(&Ts, (void *) t, (void *) current_node); -#endif /* RATIONAL TERM SUPPORT FOR TRIES */ - int i; - CELL *aux_appl = RepAppl(t); - SUBGOAL_CHECK_INSERT_ENTRY(tab_ent, current_node, AbsAppl((Term *)f)); - AUX_STACK_CHECK_EXPAND(stack_terms, stack_terms_limit + ArityOfFunctor(f) - 1); - for (i = ArityOfFunctor(f); i >= 1; i--) { -#ifdef TRIE_RATIONAL_TERMS - CyclicTerm = NULL; - if (IsVarTerm(aux_appl[i]) || IsApplTerm(aux_appl[i])) - CyclicTerm = term_array_member(Ts, (void *) Deref(aux_appl[i])); - if (CyclicTerm != NULL) { - STACK_PUSH_UP((Term) CyclicTerm, stack_terms); - STACK_PUSH_UP((Term) RationalMark, stack_terms); - } else -#endif /* RATIONAL TERM SUPPORT FOR TRIES */ - STACK_PUSH_UP(Deref(aux_appl[i]), stack_terms); - } - } - } else { - Yap_Error(INTERNAL_ERROR, TermNil, "subgoal_search_loop: unknown type tag"); -#endif /* MODE_TERMS_LOOP */ - } - t = STACK_POP_DOWN(stack_terms); - } while (t); -#ifdef TRIE_RATIONAL_TERMS - term_array_free(&Ts); -#endif /* RATIONAL TERM SUPPORT FOR TRIES */ - *subs_arity_ptr = subs_arity; - *stack_vars_ptr = stack_vars; - return current_node; -} -#endif /* INCLUDE_SUBGOAL_SEARCH_LOOP */ - - - -/************************************************************************ -** answer_search(_global_trie)(_terms)_loop ** -************************************************************************/ - -#ifdef INCLUDE_ANSWER_SEARCH_LOOP -#ifdef MODE_GLOBAL_TRIE_LOOP -#ifdef GLOBAL_TRIE_FOR_SUBTERMS -static inline gt_node_ptr answer_search_global_trie_terms_loop(Term t, int *vars_arity_ptr, CELL *stack_terms USES_REGS) { -#else -static inline gt_node_ptr answer_search_global_trie_loop(Term t, int *vars_arity_ptr USES_REGS) { -#endif /* GLOBAL_TRIE_FOR_SUBTERMS */ -#else -#ifdef MODE_TERMS_LOOP -static inline ans_node_ptr answer_search_terms_loop(sg_fr_ptr sg_fr, ans_node_ptr current_node, Term t, int *vars_arity_ptr USES_REGS) { -#else -static inline ans_node_ptr answer_search_loop(sg_fr_ptr sg_fr, ans_node_ptr current_node, Term t, int *vars_arity_ptr USES_REGS) { -#endif /* MODE_TERMS_LOOP */ -#endif /* MODE_GLOBAL_TRIE_LOOP */ -/************************************************************************ - =========== - | | - | ... | - | | - ----------- - TR --> | VAR_0 | <-- stack_vars_base - ----------- * - | ... | /|\ - ----------- | vars_arity (N+1) - | VAR_N | \|/ - ----------- * - | | <-- stack_terms_limit - ----------- - | | - | ... | - | | - ----------| - | TERM_N | <-- stack_terms - ----------| * - | ... | /|\ - ----------| | - | TERM_1 | | - ----------| | - | NULL | \|/ - =========== * - LOCAL_TrailTop --> | | - ----------- -************************************************************************/ -#ifdef MODE_GLOBAL_TRIE_LOOP - gt_node_ptr current_node = GLOBAL_root_gt; -#endif /* MODE_GLOBAL_TRIE_LOOP */ - int vars_arity = *vars_arity_ptr; -#if ! defined(MODE_GLOBAL_TRIE_LOOP) || ! defined(GLOBAL_TRIE_FOR_SUBTERMS) - CELL *stack_terms = (CELL *) LOCAL_TrailTop; -#endif /* ! MODE_GLOBAL_TRIE_LOOP || ! GLOBAL_TRIE_FOR_SUBTERMS */ - CELL *stack_vars_base = (CELL *) TR; -#define stack_terms_limit (stack_vars_base + vars_arity) -#ifdef TRIE_COMPACT_PAIRS - int in_pair = 0; -#else -#define in_pair 0 -#endif /* TRIE_COMPACT_PAIRS */ - AUX_STACK_CHECK_EXPAND(stack_terms, stack_terms_limit + 1); /* + 1 because initially we stiil haven't done any STACK_POP_DOWN */ - STACK_PUSH_UP(NULL, stack_terms); - -#if defined(MODE_GLOBAL_TRIE_LOOP) - /* for the global trie, it is safe to skip the IsVarTerm() and IsAtomOrIntTerm() tests in the first iteration */ - goto answer_search_loop_non_atomic; -#endif /* MODE_GLOBAL_TRIE_LOOP */ - -#ifdef TRIE_RATIONAL_TERMS - term_array Ts; - void* CyclicTerm; - term_array_init(&Ts, 10); -#endif /* RATIONAL TERM SUPPORT FOR TRIES */ - - do { - if (IsVarTerm(t)) { - t = Deref(t); - if (IsTableVarTerm(t)) { - t = MakeTableVarTerm(VarIndexOfTerm(t)); - ANSWER_CHECK_INSERT_ENTRY(sg_fr, current_node, t, _trie_retry_val + in_pair); - } else { - if (vars_arity == MAX_TABLE_VARS) - Yap_Error(INTERNAL_ERROR, TermNil, "answer_search_loop: MAX_TABLE_VARS exceeded"); - stack_vars_base[vars_arity] = t; - *((CELL *)t) = GLOBAL_table_var_enumerator(vars_arity); - t = MakeTableVarTerm(vars_arity); - ANSWER_CHECK_INSERT_ENTRY(sg_fr, current_node, t, _trie_retry_var + in_pair); - vars_arity = vars_arity + 1; - } -#ifdef TRIE_COMPACT_PAIRS - in_pair = 0; -#endif /* TRIE_COMPACT_PAIRS */ - } else if (IsAtomOrIntTerm(t)) { - ANSWER_CHECK_INSERT_ENTRY(sg_fr, current_node, t, _trie_retry_atom + in_pair); -#ifdef TRIE_COMPACT_PAIRS - in_pair = 0; -#endif /* TRIE_COMPACT_PAIRS */ -#ifdef MODE_TERMS_LOOP - } else { - gt_node_ptr entry_node; -#ifdef GLOBAL_TRIE_FOR_SUBTERMS - entry_node = answer_search_global_trie_terms_loop(t, &vars_arity, stack_terms PASS_REGS); -#else - entry_node = answer_search_global_trie_loop(t, &vars_arity PASS_REGS); -#endif /* GLOBAL_TRIE_FOR_SUBTERMS */ - current_node = answer_trie_check_insert_gt_entry(sg_fr, current_node, (Term) entry_node, _trie_retry_gterm + in_pair PASS_REGS); -#else /* ! MODE_TERMS_LOOP */ - } else -#ifdef TRIE_RATIONAL_TERMS - if (IsRationalTerm(t)) { - t = STACK_POP_DOWN(stack_terms); - ANSWER_CHECK_INSERT_ENTRY(sg_fr, current_node, t, _trie_retry_var + in_pair); //TODO create _trie_.._rational - } else -#endif /* RATIONAL TERM SUPPORT FOR TRIES */ -#if defined(MODE_GLOBAL_TRIE_LOOP) - /* for the global trie, it is safe to start here in the first iteration */ - answer_search_loop_non_atomic: -#endif /* MODE_GLOBAL_TRIE_LOOP */ -#ifdef TRIE_COMPACT_PAIRS - if (IsPairTerm(t)) { -#ifdef TRIE_RATIONAL_TERMS - CyclicTerm = NULL; -#endif /* RATIONAL TERM SUPPORT FOR TRIES */ - CELL *aux_pair = RepPair(t); - if (aux_pair == PairTermMark) { - t = STACK_POP_DOWN(stack_terms); -#ifdef TRIE_RATIONAL_TERMS - if (IsPairTerm(t) && ! IsRationalTerm(t)) { - term_array_push(&Ts, (void *) t, (void *) current_node); -#else - if (IsPairTerm(t)) { -#endif /* RATIONAL TERM SUPPORT FOR TRIES */ - aux_pair = RepPair(t); - t = Deref(aux_pair[1]); -#ifdef TRIE_RATIONAL_TERMS - if (IsVarTerm(aux_pair[1]) || IsPairTerm(aux_pair[1])) { - CyclicTerm = term_array_member(Ts, (void *) t); - } - if (CyclicTerm != NULL) { - STACK_PUSH_UP((Term) CyclicTerm, stack_terms); // CyclicTerm - STACK_PUSH_UP((Term) RationalMark, stack_terms); - STACK_PUSH_UP(AbsPair(PairTermMark), stack_terms); - in_pair = 4; - } else -#endif /* RATIONAL TERM SUPPORT FOR TRIES */ - if (t == TermNil) { - ANSWER_CHECK_INSERT_ENTRY(sg_fr, current_node, CompactPairEndList, _trie_retry_pair); - } else { - /* AUX_STACK_CHECK_EXPAND(stack_terms, stack_terms_limit + 2); */ - /* AUX_STACK_CHECK_EXPAND is not necessary here because the situation of pushing ** - ** up 3 terms has already initially checked for the CompactPairInit term */ - STACK_PUSH_UP(t, stack_terms); - STACK_PUSH_UP(AbsPair(PairTermMark), stack_terms); - in_pair = 4; - } -#ifdef TRIE_RATIONAL_TERMS - CyclicTerm = NULL; - if (IsVarTerm(aux_pair[0]) || IsPairTerm(aux_pair[0])) - CyclicTerm = term_array_member(Ts, (void *) Deref(aux_pair[0])); - if (CyclicTerm != NULL) { - STACK_PUSH_UP((Term) CyclicTerm, stack_terms); - STACK_PUSH_UP((Term) RationalMark, stack_terms); - } else -#endif /* RATIONAL TERM SUPPORT FOR TRIES */ - STACK_PUSH_UP(Deref(aux_pair[0]), stack_terms); - } else { - ANSWER_CHECK_INSERT_ENTRY(sg_fr, current_node, CompactPairEndTerm, _trie_retry_null); - STACK_PUSH_UP(t, stack_terms); - } -#if defined(MODE_GLOBAL_TRIE_LOOP) && defined(GLOBAL_TRIE_FOR_SUBTERMS) - } else if (current_node != GLOBAL_root_gt) { - gt_node_ptr entry_node = answer_search_global_trie_terms_loop(t, &vars_arity, stack_terms PASS_REGS); - current_node = global_trie_check_insert_gt_entry(current_node, (Term) entry_node PASS_REGS); -#endif /* MODE_GLOBAL_TRIE_LOOP && GLOBAL_TRIE_FOR_SUBTERMS */ - } else { -#ifdef TRIE_RATIONAL_TERMS - term_array_push(&Ts, (void *) t, (void *) current_node); -#endif /* RATIONAL TERM SUPPORT FOR TRIES */ - ANSWER_CHECK_INSERT_ENTRY(sg_fr, current_node, CompactPairInit, _trie_retry_null + in_pair); - t = Deref(aux_pair[1]); -#ifdef TRIE_RATIONAL_TERMS - if (IsVarTerm(aux_pair[1]) || IsPairTerm(aux_pair[1])) { - CyclicTerm = term_array_member(Ts, (void *) t); - } - if (CyclicTerm != NULL) { - STACK_PUSH_UP((Term) CyclicTerm, stack_terms); - STACK_PUSH_UP((Term) RationalMark, stack_terms); - STACK_PUSH_UP(AbsPair(PairTermMark), stack_terms); - in_pair = 4; - } else -#endif /* RATIONAL TERM SUPPORT FOR TRIES */ - if (t == TermNil) { - ANSWER_CHECK_INSERT_ENTRY(sg_fr, current_node, CompactPairEndList, _trie_retry_pair); - in_pair = 0; - } else { - AUX_STACK_CHECK_EXPAND(stack_terms, stack_terms_limit + 2); - STACK_PUSH_UP(t, stack_terms); - STACK_PUSH_UP(AbsPair(PairTermMark), stack_terms); - in_pair = 4; - } -#ifdef TRIE_RATIONAL_TERMS - CyclicTerm = NULL; - if (IsVarTerm(aux_pair[0]) || IsPairTerm(aux_pair[0])) - CyclicTerm = term_array_member(Ts, (void *) Deref(aux_pair[0])); - if (CyclicTerm != NULL) { - STACK_PUSH_UP((Term) CyclicTerm, stack_terms); - STACK_PUSH_UP((Term) RationalMark, stack_terms); - } else -#endif /* RATIONAL TERM SUPPORT FOR TRIES */ - STACK_PUSH_UP(Deref(aux_pair[0]), stack_terms); - } -#if defined(MODE_GLOBAL_TRIE_LOOP) && defined(GLOBAL_TRIE_FOR_SUBTERMS) - } else if (current_node != GLOBAL_root_gt) { - gt_node_ptr entry_node = answer_search_global_trie_terms_loop(t, &vars_arity, stack_terms PASS_REGS); - current_node = global_trie_check_insert_gt_entry(current_node, (Term) entry_node PASS_REGS); -#endif /* MODE_GLOBAL_TRIE_LOOP && GLOBAL_TRIE_FOR_SUBTERMS */ -#else /* ! TRIE_COMPACT_PAIRS */ -#if defined(MODE_GLOBAL_TRIE_LOOP) && defined(GLOBAL_TRIE_FOR_SUBTERMS) - if (current_node != GLOBAL_root_gt) { - gt_node_ptr entry_node = answer_search_global_trie_terms_loop(t, &vars_arity, stack_terms PASS_REGS); - current_node = global_trie_check_insert_gt_entry(current_node, (Term) entry_node PASS_REGS); - } else -#endif /* MODE_GLOBAL_TRIE_LOOP && GLOBAL_TRIE_FOR_SUBTERMS */ - if (IsPairTerm(t)) { - CELL *aux_pair = RepPair(t); - ANSWER_CHECK_INSERT_ENTRY(sg_fr, current_node, AbsPair(NULL), _trie_retry_pair); - AUX_STACK_CHECK_EXPAND(stack_terms, stack_terms_limit + 1); - STACK_PUSH_UP(Deref(aux_pair[1]), stack_terms); - STACK_PUSH_UP(Deref(aux_pair[0]), stack_terms); -#endif /* TRIE_COMPACT_PAIRS */ - } else if (IsApplTerm(t)) { - Functor f = FunctorOfTerm(t); - if (f == FunctorDouble) { - union { - Term t_dbl[sizeof(Float)/sizeof(Term)]; - Float dbl; - } u; - u.dbl = FloatOfTerm(t); - ANSWER_CHECK_INSERT_ENTRY(sg_fr, current_node, AbsAppl((Term *)f), _trie_retry_null + in_pair); -#if SIZEOF_DOUBLE == 2 * SIZEOF_INT_P - ANSWER_CHECK_INSERT_ENTRY(sg_fr, current_node, u.t_dbl[1], _trie_retry_extension); -#endif /* SIZEOF_DOUBLE x SIZEOF_INT_P */ - ANSWER_CHECK_INSERT_ENTRY(sg_fr, current_node, u.t_dbl[0], _trie_retry_extension); - ANSWER_CHECK_INSERT_ENTRY(sg_fr, current_node, AbsAppl((Term *)f), _trie_retry_double); - } else if (f == FunctorLongInt) { - Int li = LongIntOfTerm (t); - ANSWER_CHECK_INSERT_ENTRY(sg_fr, current_node, AbsAppl((Term *)f), _trie_retry_null + in_pair); - ANSWER_CHECK_INSERT_ENTRY(sg_fr, current_node, li, _trie_retry_extension); - ANSWER_CHECK_INSERT_ENTRY(sg_fr, current_node, AbsAppl((Term *)f), _trie_retry_longint); - } else if (f == FunctorBigInt || FunctorString) { - CELL *opq = Yap_HeapStoreOpaqueTerm(t); - ANSWER_CHECK_INSERT_ENTRY(sg_fr, current_node, AbsAppl((Term *)f), _trie_retry_null + in_pair); - ANSWER_CHECK_INSERT_ENTRY(sg_fr, current_node, (CELL)opq, _trie_retry_extension); - ANSWER_CHECK_INSERT_ENTRY(sg_fr, current_node, AbsAppl((Term *)f), _trie_retry_bigint); - } else if (f == FunctorDBRef) { - Yap_Error(INTERNAL_ERROR, TermNil, "answer_search_loop: unsupported type tag FunctorDBRef"); - } else { -#ifdef TRIE_RATIONAL_TERMS - term_array_push(&Ts, (void *) t, (void *) current_node); -#endif /* RATIONAL TERM SUPPORT FOR TRIES */ - int i; - CELL *aux_appl = RepAppl(t); - ANSWER_CHECK_INSERT_ENTRY(sg_fr, current_node, AbsAppl((Term *)f), _trie_retry_appl + in_pair); - AUX_STACK_CHECK_EXPAND(stack_terms, stack_terms_limit + ArityOfFunctor(f) - 1); - for (i = ArityOfFunctor(f); i >= 1; i--) { -#ifdef TRIE_RATIONAL_TERMS - CyclicTerm = NULL; - if (IsVarTerm(aux_appl[i]) || IsApplTerm(aux_appl[i])) - CyclicTerm = term_array_member(Ts, (void *) Deref(aux_appl[i])); - if (CyclicTerm != NULL) { - STACK_PUSH_UP((Term) CyclicTerm, stack_terms); - STACK_PUSH_UP((Term) RationalMark, stack_terms); - } else -#endif /* RATIONAL TERM SUPPORT FOR TRIES */ - STACK_PUSH_UP(Deref(aux_appl[i]), stack_terms); - } - } -#ifdef TRIE_COMPACT_PAIRS - in_pair = 0; -#endif /* TRIE_COMPACT_PAIRS */ - } else { - Yap_Error(INTERNAL_ERROR, TermNil, "answer_search_loop: unknown type tag"); -#endif /* MODE_TERMS_LOOP */ - } - t = STACK_POP_DOWN(stack_terms); - } while (t); -#ifdef TRIE_RATIONAL_TERMS - term_array_free(&Ts); -#endif /* RATIONAL TERM SUPPORT FOR TRIES */ - *vars_arity_ptr = vars_arity; - return current_node; - -#undef stack_terms_limit -#ifndef TRIE_COMPACT_PAIRS -#undef in_pair -#endif /* TRIE_COMPACT_PAIRS */ -} -#endif /* INCLUDE_ANSWER_SEARCH_LOOP */ - - - -/************************************************************** -** answer_search_min_max ** -**************************************************************/ - -#ifdef INCLUDE_ANSWER_SEARCH_MODE_DIRECTED -static inline ans_node_ptr answer_search_min_max(sg_fr_ptr sg_fr, ans_node_ptr current_node, Term t, int mode USES_REGS) { - ans_node_ptr child_node; - Term child_term; - Term trie_value = 0, term_value = t; - int cmp; - - /* start by computing the current value on the trie (trie_value) */ - child_node = TrNode_child(current_node); - child_term = TrNode_entry(child_node); - if (IsIntTerm(child_term)) { - trie_value = child_term; - } else if (IsApplTerm(child_term)) { - Functor f = (Functor) RepAppl(child_term); - child_node = TrNode_child(child_node); - if (f == FunctorLongInt) { - trie_value = MkLongIntTerm( (Int) TrNode_entry(child_node) ); - } else if (f == FunctorDouble) { - union { - Term t_dbl[sizeof(Float)/sizeof(Term)]; - Float dbl; - } u; - u.t_dbl[0] = TrNode_entry(child_node); -#if SIZEOF_DOUBLE == 2 * SIZEOF_INT_P - child_node = TrNode_child(child_node); - u.t_dbl[1] = TrNode_entry(child_node); -#endif /* SIZEOF_DOUBLE x SIZEOF_INT_P */ - trie_value = MkFloatTerm(u.dbl); - } else if (f == FunctorBigInt) { - trie_value = AbsAppl( (CELL *) TrNode_entry(child_node) ); - } else - Yap_Error(INTERNAL_ERROR, TermNil, "answer_search_min_max: invalid arithmetic value"); - child_node = TrNode_child(child_node); - } - - cmp = Yap_acmp( term_value, trie_value PASS_REGS); - /* worse answer */ - if ((mode == MODE_DIRECTED_MIN && cmp > 0) || (mode == MODE_DIRECTED_MAX && cmp < 0)) - return NULL; - /* equal answer */ - if (cmp == 0) - return child_node; - /* better answer */ - if (IsAtomOrIntTerm(t)) { - ANSWER_SAFE_INSERT_ENTRY(current_node, t, _trie_retry_atom); - } else if (IsApplTerm(t)) { - Functor f = FunctorOfTerm(t); - if (f == FunctorDouble) { - union { - Term t_dbl[sizeof(Float)/sizeof(Term)]; - Float dbl; - } u; - u.dbl = FloatOfTerm(t); - ANSWER_SAFE_INSERT_ENTRY(current_node, AbsAppl((Term *)f), _trie_retry_null); -#if SIZEOF_DOUBLE == 2 * SIZEOF_INT_P - ANSWER_SAFE_INSERT_ENTRY(current_node, u.t_dbl[1], _trie_retry_extension); -#endif /* SIZEOF_DOUBLE x SIZEOF_INT_P */ - ANSWER_SAFE_INSERT_ENTRY(current_node, u.t_dbl[0], _trie_retry_extension); - ANSWER_SAFE_INSERT_ENTRY(current_node, AbsAppl((Term *)f), _trie_retry_double); - } else if (f == FunctorLongInt) { - Int li = LongIntOfTerm(t); - ANSWER_SAFE_INSERT_ENTRY(current_node, AbsAppl((Term *)f), _trie_retry_null); - ANSWER_SAFE_INSERT_ENTRY(current_node, li, _trie_retry_extension); - ANSWER_SAFE_INSERT_ENTRY(current_node, AbsAppl((Term *)f), _trie_retry_longint); - } else if (f == FunctorBigInt) { - CELL *li = Yap_HeapStoreOpaqueTerm(t); - ANSWER_SAFE_INSERT_ENTRY(current_node, AbsAppl((Term *)f), _trie_retry_null); - ANSWER_SAFE_INSERT_ENTRY(current_node, (CELL)li, _trie_retry_extension); - ANSWER_SAFE_INSERT_ENTRY(current_node, AbsAppl((Term *)f), _trie_retry_bigint); - } - } - return current_node; -} -#endif /* INCLUDE_ANSWER_SEARCH_MODE_DIRECTED */ - - - -/********************************************************** -** answer_search_sum ** -**********************************************************/ - -#ifdef INCLUDE_ANSWER_SEARCH_MODE_DIRECTED -static inline ans_node_ptr answer_search_sum(sg_fr_ptr sg_fr, ans_node_ptr current_node, Term t USES_REGS) { - ans_node_ptr child_node; - Term child_term; - Term trie_value = 0, term_value = t, sum_value = 0; - - /* start by computing the current value on the trie (trie_value) */ - child_node = TrNode_child(current_node); - child_term = TrNode_entry(child_node); - if (IsIntTerm(child_term)) { - trie_value = child_term; - } else if (IsApplTerm(child_term)) { - Functor f = (Functor) RepAppl(child_term); - child_node = TrNode_child(child_node); - if (f == FunctorLongInt) { - trie_value = MkLongIntTerm( (Int) TrNode_entry(child_node) ); - } else if (f == FunctorDouble) { - union { - Term t_dbl[sizeof(Float)/sizeof(Term)]; - Float dbl; - } u; - u.t_dbl[0] = TrNode_entry(child_node); -#if SIZEOF_DOUBLE == 2 * SIZEOF_INT_P - child_node = TrNode_child(child_node); - u.t_dbl[1] = TrNode_entry(child_node); -#endif /* SIZEOF_DOUBLE x SIZEOF_INT_P */ - trie_value = MkFloatTerm(u.dbl); - } else if (f == FunctorBigInt) { - trie_value = AbsAppl( (CELL *) TrNode_entry(child_node) ); - } else - Yap_Error(INTERNAL_ERROR, TermNil, "answer_search_min_max: invalid arithmetic value"); - child_node = TrNode_child(child_node); - } - - sum_value = p_plus(trie_value, term_value PASS_REGS); - if (IsAtomOrIntTerm(sum_value)) { - ANSWER_SAFE_INSERT_ENTRY(current_node, sum_value, _trie_retry_atom); - } else if (IsApplTerm(sum_value)) { - Functor f = FunctorOfTerm(sum_value); - if (f == FunctorDouble) { - union { - Term t_dbl[sizeof(Float)/sizeof(Term)]; - Float dbl; - } u; - u.dbl = FloatOfTerm(sum_value); - ANSWER_SAFE_INSERT_ENTRY(current_node, AbsAppl((Term *)f), _trie_retry_null); -#if SIZEOF_DOUBLE == 2 * SIZEOF_INT_P - ANSWER_SAFE_INSERT_ENTRY(current_node, u.t_dbl[1], _trie_retry_extension); -#endif /* SIZEOF_DOUBLE x SIZEOF_INT_P */ - ANSWER_SAFE_INSERT_ENTRY(current_node, u.t_dbl[0], _trie_retry_extension); - ANSWER_SAFE_INSERT_ENTRY(current_node, AbsAppl((Term *)f), _trie_retry_double); - } else if (f == FunctorLongInt) { - Int li = LongIntOfTerm(sum_value); - ANSWER_SAFE_INSERT_ENTRY(current_node, AbsAppl((Term *)f), _trie_retry_null); - ANSWER_SAFE_INSERT_ENTRY(current_node, li, _trie_retry_extension); - ANSWER_SAFE_INSERT_ENTRY(current_node, AbsAppl((Term *)f), _trie_retry_longint); - } else if (f == FunctorBigInt) { - CELL *li = Yap_HeapStoreOpaqueTerm(sum_value); - ANSWER_SAFE_INSERT_ENTRY(current_node, AbsAppl((Term *)f), _trie_retry_null); - ANSWER_SAFE_INSERT_ENTRY(current_node, (CELL)li, _trie_retry_extension); - ANSWER_SAFE_INSERT_ENTRY(current_node, AbsAppl((Term *)f), _trie_retry_bigint); - } - } - return current_node; -} -#endif /* INCLUDE_ANSWER_SEARCH_MODE_DIRECTED */ - - - -/*************************************************************** -** invalidate_answer_trie ** -***************************************************************/ - -#ifdef INCLUDE_ANSWER_SEARCH_MODE_DIRECTED -static void invalidate_answer_trie(ans_node_ptr current_node, sg_fr_ptr sg_fr, int position USES_REGS) { - if (IS_ANSWER_TRIE_HASH(current_node)) { - ans_hash_ptr hash; - ans_node_ptr *bucket, *last_bucket; - hash = (ans_hash_ptr) current_node; - bucket = Hash_buckets(hash); - last_bucket = bucket + Hash_num_buckets(hash); - do { - current_node = *bucket; - if (current_node) { - ans_node_ptr next_node = TrNode_next(current_node); - if (IS_ANSWER_LEAF_NODE(current_node)) { - INVALIDATE_ANSWER_TRIE_LEAF_NODE(current_node, sg_fr); - } else { - invalidate_answer_trie(TrNode_child(current_node), sg_fr, TRAVERSE_POSITION_FIRST PASS_REGS); - INVALIDATE_ANSWER_TRIE_NODE(current_node, sg_fr); - } - while (next_node) { - current_node = next_node; - next_node = TrNode_next(current_node); - invalidate_answer_trie(current_node, sg_fr, TRAVERSE_POSITION_NEXT PASS_REGS); - } - } - } while (++bucket != last_bucket); - if (Hash_next(hash)) - Hash_previous(Hash_next(hash)) = Hash_previous(hash); - if (Hash_previous(hash)) - Hash_next(Hash_previous(hash)) = Hash_next(hash); - else - SgFr_hash_chain(sg_fr) = Hash_next(hash); - FREE_BUCKETS(Hash_buckets(hash)); - FREE_ANSWER_TRIE_HASH(hash); - } else { - if (position == TRAVERSE_POSITION_FIRST) { - ans_node_ptr next_node = TrNode_next(current_node); - if (IS_ANSWER_LEAF_NODE(current_node)) { - INVALIDATE_ANSWER_TRIE_LEAF_NODE(current_node, sg_fr); - } else { - invalidate_answer_trie(TrNode_child(current_node), sg_fr, TRAVERSE_POSITION_FIRST PASS_REGS); - INVALIDATE_ANSWER_TRIE_NODE(current_node, sg_fr); - } - while (next_node) { - current_node = next_node; - next_node = TrNode_next(current_node); - invalidate_answer_trie(current_node, sg_fr, TRAVERSE_POSITION_NEXT PASS_REGS); - } - } else { - if (IS_ANSWER_LEAF_NODE(current_node)) { - INVALIDATE_ANSWER_TRIE_LEAF_NODE(current_node, sg_fr); - } else { - invalidate_answer_trie(TrNode_child(current_node), sg_fr, TRAVERSE_POSITION_FIRST PASS_REGS); - INVALIDATE_ANSWER_TRIE_NODE(current_node, sg_fr); - } - } - } - return; -} -#endif /* INCLUDE_ANSWER_SEARCH_MODE_DIRECTED */ - - - -/************************************************************************ -** load_(answer|substitution)_loop ** -************************************************************************/ - -#ifdef INCLUDE_LOAD_ANSWER_LOOP -#ifdef MODE_GLOBAL_TRIE_LOOP -static inline CELL *load_substitution_loop(gt_node_ptr current_node, int *vars_arity_ptr, CELL *stack_terms USES_REGS) { -#else -static inline CELL *load_answer_loop(ans_node_ptr current_node USES_REGS) { -#endif /* MODE_GLOBAL_TRIE_LOOP */ -/************************************************************************ - =========== - | | - | ... | - | | - ----------- - TR --> | VAR_0 | <-- stack_vars_base - ----------- * - | ... | /|\ - ----------- | vars_arity (N+1) - | VAR_N | \|/ - ----------- * - | | <-- stack_terms_limit - ----------- - | | - | ... | - | | - ----------| - | TERM_N | <-- stack_terms - ----------| * - | ... | /|\ - ----------| | stack_terms_pair_offset (TRIE_COMPACT_PAIRS) - | TERM_1 | \|/ - =========== * - LOCAL_TrailTop --> | | <-- stack_terms_base (TRIE_COMPACT_PAIRS) - ----------- -************************************************************************/ -#ifdef MODE_GLOBAL_TRIE_LOOP - int vars_arity = *vars_arity_ptr; -#else - int vars_arity = 0; - CELL *stack_terms = (CELL *) LOCAL_TrailTop; -#endif /* MODE_GLOBAL_TRIE_LOOP */ - CELL *stack_vars_base = (CELL *) TR; -#define stack_terms_limit (stack_vars_base + vars_arity) -#ifdef TRIE_COMPACT_PAIRS -#define stack_terms_base ((CELL *) LOCAL_TrailTop) - int stack_terms_pair_offset = 0; -#endif /* TRIE_COMPACT_PAIRS */ - Term t = TrNode_entry(current_node); -#ifdef MODE_GLOBAL_TRIE_LOOP - current_node = TrNode_parent(current_node); -#else - current_node = (ans_node_ptr) UNTAG_ANSWER_NODE(TrNode_parent(current_node)); -#endif /* MODE_GLOBAL_TRIE_LOOP */ - -#ifdef TRIE_RATIONAL_TERMS - term_array Ts; - void* CyclicTerm; - term_array_init(&Ts, 10); - Term RationalTermTMP; // a temporary temp to be used from the rational code -#endif /* RATIONAL TERM SUPPORT FOR TRIES */ - - do { -#ifdef TRIE_RATIONAL_TERMS - CyclicTerm = term_array_member(Ts, (void *) current_node); -#endif /* RATIONAL TERM SUPPORT FOR TRIES */ - if (IsVarTerm(t)) { -#ifdef TRIE_RATIONAL_TERMS - if (t > VarIndexOfTableTerm(MAX_TABLE_VARS) && TrNode_child((gt_node_ptr) t) != (gt_node_ptr)(1)) { //TODO: substitute the != 1 test to something more appropriate - /* Rational term */ - RationalTermTMP = (Term) term_array_member(Ts, (void *) t); - if (RationalTermTMP) { - /* rational term is assigned a variable already */ - AUX_STACK_CHECK_EXPAND(stack_terms, stack_terms_limit); - STACK_PUSH_UP(RationalTermTMP, stack_terms); - } else { - RationalTermTMP = MkVarTerm(); - STACK_PUSH_UP(RationalTermTMP, stack_terms); - /* memorize the rational term and assign it a variable */ - term_array_push(&Ts, (void *) t, (void *) RationalTermTMP); - } - } else -#endif /* RATIONAL TERM SUPPORT FOR TRIES */ - { -#if ! defined(MODE_GLOBAL_TRIE_LOOP) || defined(GLOBAL_TRIE_FOR_SUBTERMS) - if (t > VarIndexOfTableTerm(MAX_TABLE_VARS)) { - stack_terms = load_substitution_loop((gt_node_ptr) t, &vars_arity, stack_terms PASS_REGS); - } else -#endif /* ! MODE_GLOBAL_TRIE_LOOP || GLOBAL_TRIE_FOR_SUBTERMS */ - { int var_index = VarIndexOfTableTerm(t); - AUX_STACK_CHECK_EXPAND(stack_terms, stack_terms_limit - vars_arity + var_index + 1); - if (var_index >= vars_arity) { - while (vars_arity < var_index) - stack_vars_base[vars_arity++] = 0; - stack_vars_base[vars_arity++] = MkVarTerm(); - } else if (stack_vars_base[var_index] == 0) - stack_vars_base[var_index] = MkVarTerm(); - STACK_PUSH_UP(stack_vars_base[var_index], stack_terms); - } - } - } else if (IsAtomOrIntTerm(t)) { - AUX_STACK_CHECK_EXPAND(stack_terms, stack_terms_limit); -#ifdef TRIE_RATIONAL_TERMS - if (CyclicTerm) { - AUX_STACK_CHECK_EXPAND(stack_terms, stack_terms_limit + 4); - STACK_PUSH_UP((Term) RationalMark, stack_terms); // Add a rational term marker necessary as we read both ways the stack // - STACK_PUSH_UP(t, stack_terms); // Add the term // - STACK_PUSH_UP(CyclicTerm, stack_terms); // Add the variable that the term will unify with // - STACK_PUSH_UP((Term) RationalMark, stack_terms); // Add a rational term marker necessary as we read both ways the stack // - } else -#endif /* RATIONAL TERM SUPPORT FOR TRIES */ - STACK_PUSH_UP(t, stack_terms); - } else if (IsPairTerm(t)) { -#ifdef TRIE_COMPACT_PAIRS - if (t == CompactPairInit) { - Term *stack_aux = stack_terms_base - stack_terms_pair_offset; - Term head, tail = STACK_POP_UP(stack_aux); -#ifdef TRIE_RATIONAL_TERMS - if (IsRationalTerm(tail)) { - Yap_Error(INTERNAL_ERROR, tail, "Rational element of a Rational Term appears as the first Tail of a list"); - } -#endif /* RATIONAL TERM SUPPORT FOR TRIES */ - while (STACK_NOT_EMPTY(stack_aux, stack_terms)) { - head = STACK_POP_UP(stack_aux); -#ifdef TRIE_RATIONAL_TERMS - if (IsRationalTerm(head)) { - head = STACK_POP_UP(stack_aux); // thats the rational term - RationalTermTMP = STACK_POP_UP(stack_aux); // that is the variable to unify with - (void) STACK_POP_UP(stack_aux); // eat the second rational mark - tail = MkPairTerm(head, tail); - Yap_unify(RationalTermTMP, tail); - } else -#endif /* RATIONAL TERM SUPPORT FOR TRIES */ - tail = MkPairTerm(head, tail); - } - stack_terms = stack_terms_base - stack_terms_pair_offset; - stack_terms_pair_offset = (int) STACK_POP_DOWN(stack_terms); - STACK_PUSH_UP(tail, stack_terms); - } else { /* CompactPairEndList / CompactPairEndTerm */ - Term last; - AUX_STACK_CHECK_EXPAND(stack_terms, stack_terms_limit + 1); - last = STACK_POP_DOWN(stack_terms); -#ifdef TRIE_RATIONAL_TERMS - RationalTermTMP = TermNil; - if (IsRationalTerm(last)) { // rather unlikely case the rational term is the last of a list - RationalTermTMP = STACK_POP_DOWN(stack_terms); // in this case we need to invert the term with the end of list - last = STACK_POP_DOWN(stack_terms); // variable to unify with - (void) STACK_POP_DOWN(stack_terms); // eat the second rational mark - } -#endif /* RATIONAL TERM SUPPORT FOR TRIES */ - STACK_PUSH_UP(stack_terms_pair_offset, stack_terms); - stack_terms_pair_offset = (int) (stack_terms_base - stack_terms); - if (t == CompactPairEndList) - STACK_PUSH_UP(TermNil, stack_terms); -#ifdef TRIE_RATIONAL_TERMS - if (RationalTermTMP && RationalTermTMP != TermNil) { - /* most probably this never occurs */ - STACK_PUSH_UP((Term) RationalMark, stack_terms); - STACK_PUSH_UP(last, stack_terms); - STACK_PUSH_UP(RationalTermTMP, stack_terms); - STACK_PUSH_UP((Term) RationalMark, stack_terms); - } else -#endif /* RATIONAL TERM SUPPORT FOR TRIES */ - STACK_PUSH_UP(last, stack_terms); - } -#else /* ! TRIE_COMPACT_PAIRS */ - Term head = STACK_POP_DOWN(stack_terms); - Term tail = STACK_POP_DOWN(stack_terms); - t = MkPairTerm(head, tail); - STACK_PUSH_UP(t, stack_terms); -#endif /* TRIE_COMPACT_PAIRS */ - } else if (IsApplTerm(t)) { - Functor f = (Functor) RepAppl(t); - if (f == FunctorDouble) { - union { - Term t_dbl[sizeof(Float)/sizeof(Term)]; - Float dbl; - } u; - t = TrNode_entry(current_node); - current_node = TrNode_parent(current_node); - u.t_dbl[0] = t; -#if SIZEOF_DOUBLE == 2 * SIZEOF_INT_P - t = TrNode_entry(current_node); - current_node = TrNode_parent(current_node); - u.t_dbl[1] = t; -#endif /* SIZEOF_DOUBLE x SIZEOF_INT_P */ - current_node = TrNode_parent(current_node); - t = MkFloatTerm(u.dbl); - } else if (f == FunctorLongInt) { - Int li = TrNode_entry(current_node); - current_node = TrNode_parent(current_node); - current_node = TrNode_parent(current_node); - t = MkLongIntTerm(li); - } else if (f == FunctorBigInt || f == FunctorString) { - CELL *ptr = (CELL *)TrNode_entry(current_node); - current_node = TrNode_parent(current_node); - current_node = TrNode_parent(current_node); - t = AbsAppl( ptr ); - } else { - int f_arity = ArityOfFunctor(f); - t = Yap_MkApplTerm(f, f_arity, stack_terms); - stack_terms += f_arity; - } - AUX_STACK_CHECK_EXPAND(stack_terms, stack_terms_limit); - STACK_PUSH_UP(t, stack_terms); - } -#ifdef TRIE_RATIONAL_TERMS - if (CyclicTerm) { - RationalTermTMP = STACK_POP_DOWN(stack_terms); - if IsRationalTerm(RationalTermTMP) { - //printf("Special Case\n"); - } else if (IsPairTerm(RationalTermTMP)) { - Yap_unify((Term) CyclicTerm, RationalTermTMP); - } else if (IsApplTerm(RationalTermTMP)) { - Yap_unify((Term) CyclicTerm, RationalTermTMP); - } - STACK_PUSH_UP(RationalTermTMP, stack_terms); - } - RationalTermTMP = TermNil; - CyclicTerm = NULL; -#endif /* RATIONAL TERM SUPPORT FOR TRIES */ - t = TrNode_entry(current_node); - current_node = TrNode_parent(current_node); - } while (current_node); -#ifdef TRIE_RATIONAL_TERMS - term_array_free(&Ts); -#endif /* RATIONAL TERM SUPPORT FOR TRIES */ -#ifdef MODE_GLOBAL_TRIE_LOOP - *vars_arity_ptr = vars_arity; -#endif /* MODE_GLOBAL_TRIE_LOOP */ - return stack_terms; - -#undef stack_terms_limit -#ifdef TRIE_COMPACT_PAIRS -#undef stack_terms_base -#endif /* TRIE_COMPACT_PAIRS */ -} -#endif /* INCLUDE_LOAD_ANSWER_LOOP */ - - - -/*************************** -** Undef Macros ** -***************************/ - -#undef INCREMENT_GLOBAL_TRIE_REFERENCE -#undef NEW_SUBGOAL_TRIE_NODE -#undef NEW_ANSWER_TRIE_NODE -#undef NEW_GLOBAL_TRIE_NODE -#undef SUBGOAL_CHECK_INSERT_ENTRY -#undef ANSWER_CHECK_INSERT_ENTRY diff --git a/OPTYap/tab.tries.insts.i b/OPTYap/tab.tries.insts.h similarity index 100% rename from OPTYap/tab.tries.insts.i rename to OPTYap/tab.tries.insts.h diff --git a/OPTYap/traced_or.insts.h b/OPTYap/traced_or.insts.h new file mode 100644 index 000000000..c282b3ad9 --- /dev/null +++ b/OPTYap/traced_or.insts.h @@ -0,0 +1,41 @@ +/************************************************************************ +** ** +** The YapTab/YapOr/OPTYap systems ** +** ** +** YapTab extends the Yap Prolog engine to support sequential tabling ** +** YapOr extends the Yap Prolog engine to support or-parallelism ** +** OPTYap extends the Yap Prolog engine to support or-parallel tabling ** +** ** +** ** +** Yap Prolog was developed at University of Porto, Portugal ** +** ** +************************************************************************/ + +/* -------------------------------- ** +** Scheduler instructions ** +** -------------------------------- */ + +PBOp(traced_getwork_first_time,e) +{ printf("Or-parallelism not supported by JIT!!\n"); exit(1); } + ENDPBOp(); + + + + + PBOp(traced_getwork,Otapl) + { printf("Or-parallelism not supported by JIT!!\n"); exit(1); } + ENDPBOp(); + + + + /* The idea is to check whether we are the last worker in the node. + If we are, we can go ahead, otherwise we should call the scheduler. */ +PBOp(traced_getwork_seq,Otapl) +{ printf("Or-parallelism not supported by JIT!!\n"); exit(1); } + ENDPBOp(); + + + + PBOp(traced_sync,Otapl) + { printf("Or-parallelism not supported by JIT!!\n"); exit(1); } + ENDPBOp(); diff --git a/OPTYap/traced_tab.insts.h b/OPTYap/traced_tab.insts.h new file mode 100644 index 000000000..ccd15e04f --- /dev/null +++ b/OPTYap/traced_tab.insts.h @@ -0,0 +1,154 @@ +/************************************************************************ +** ** +** The YapTab/YapOr/OPTYap systems ** +** ** +** YapTab extends the Yap Prolog engine to support sequential tabling ** +** YapOr extends the Yap Prolog engine to support or-parallelism ** +** OPTYap extends the Yap Prolog engine to support or-parallel tabling ** +** ** +** ** +** Yap Prolog was developed at University of Porto, Portugal ** +** ** +************************************************************************/ + + + +/************************************************************************ +** clause_with_cut ** +************************************************************************/ + +Op(traced_clause_with_cut, e) + { printf("Tabling not supported by JIT!!\n"); exit(1); } +ENDOp(); + + + +/************************************************************************ +** table_load_answer ** +************************************************************************/ + +PBOp(traced_table_load_answer, Otapl) +{ printf("Or-parallelism not supported by JIT!!\n"); exit(1); } + ENDPBOp(); + + + +/************************************************************************ + ** table_try_answer ** +************************************************************************/ + + PBOp(traced_table_try_answer, Otapl) + { printf("Or-parallelism not supported by JIT!!\n"); exit(1); } + ENDPBOp(); + + + +/************************************************************************ + ** table_try_single ** +************************************************************************/ + + PBOp(traced_table_try_single, Otapl) + { printf("Or-parallelism not supported by JIT!!\n"); exit(1); } + ENDPBOp(); + + + +/************************************************************************ + ** table_try_me ** +************************************************************************/ + + PBOp(traced_table_try_me, Otapl) + { printf("Or-parallelism not supported by JIT!!\n"); exit(1); } + ENDPBOp(); + + + +/************************************************************************ + ** table_try ** +************************************************************************/ + + PBOp(traced_table_try, Otapl) + { printf("Or-parallelism not supported by JIT!!\n"); exit(1); } + + ENDPBOp(); + + + +/************************************************************************ + ** table_retry_me ** +************************************************************************/ + + Op(traced_table_retry_me, Otapl) + { printf("Or-parallelism not supported by JIT!!\n"); exit(1); } + ENDOp(); + + + +/************************************************************************ +** table_retry ** +************************************************************************/ + + Op(traced_table_retry, Otapl) + { printf("Or-parallelism not supported by JIT!!\n"); exit(1); } + ENDOp(); + + + +/************************************************************************ +** table_trust_me ** +************************************************************************/ + + Op(traced_table_trust_me, Otapl) + { printf("Or-parallelism not supported by JIT!!\n"); exit(1); } + ENDOp(); + + + +/************************************************************************ +** table_trust ** +************************************************************************/ + + Op(traced_table_trust, Otapl) + { printf("Or-parallelism not supported by JIT!!\n"); exit(1); } + ENDOp(); + + + +/************************************************************************ +** table_new_answer ** +************************************************************************/ + + PBOp(traced_table_new_answer, s) + { printf("Or-parallelism not supported by JIT!!\n"); exit(1); } + ENDPBOp(); + + + +/************************************************************************ + ** table_answer_resolution ** +************************************************************************/ + + BOp(traced_table_answer_resolution, Otapl) + { printf("Or-parallelism not supported by JIT!!\n"); exit(1); } + ENDBOp(); + + + +/************************************************************************ + ** table_completion ** +************************************************************************/ + + BOp(traced_table_completion, Otapl) + ENDBOp(); + + + +/************************************************************************ +** table_answer_resolution_completion ** +************************************************************************/ + + BOp(traced_table_answer_resolution_completion, Otapl) +#ifdef THREADS_CONSUMER_SHARING + { printf("Or-parallelism not supported by JIT!!\n"); exit(1); } +#endif /* THREADS_CONSUMER_SHARING */ + ENDBOp(); diff --git a/OPTYap/traced_tab.tries.insts.h b/OPTYap/traced_tab.tries.insts.h new file mode 100644 index 000000000..2c8b8437a --- /dev/null +++ b/OPTYap/traced_tab.tries.insts.h @@ -0,0 +1,370 @@ +/************************************************************************ +** ** +** The YapTab/YapOr/OPTYap systems ** +** ** +** YapTab extends the Yap Prolog engine to support sequential tabling ** +** YapOr extends the Yap Prolog engine to support or-parallelism ** +** OPTYap extends the Yap Prolog engine to support or-parallel tabling ** +** ** +** ** +** Yap Prolog was developed at University of Porto, Portugal ** +** ** +************************************************************************/ + +/************************************************************************ +** Trie instructions ** +************************************************************************/ + +PBOp(traced_trie_do_var, e) +{ printf("Tries not supported by JIT!!\n"); exit(1); } + +ENDPBOp(); + + +PBOp(traced_trie_trust_var, e) +{ printf("Tries not supported by JIT!!\n"); exit(1); } +ENDPBOp(); + + +PBOp(traced_trie_try_var, e) + { printf("Tries not supported by JIT!!\n"); exit(1); } +ENDPBOp(); + + + +PBOp(traced_trie_retry_var, e) +{ printf("Tries not supported by JIT!!\n"); exit(1); } +ENDPBOp(); + + + PBOp(traced_trie_do_var_in_pair, e) + { printf("Tries not supported by JIT!!\n"); exit(1); } +ENDPBOp(); + + + PBOp(traced_trie_trust_var_in_pair, e) + { printf("Tries not supported by JIT!!\n"); exit(1); } +ENDPBOp(); + + + PBOp(traced_trie_try_var_in_pair, e) + { printf("Tries not supported by JIT!!\n"); exit(1); } +ENDPBOp(); + + + PBOp(traced_trie_retry_var_in_pair, e) + { printf("Tries not supported by JIT!!\n"); exit(1); } +ENDPBOp(); + + + PBOp(traced_trie_do_val, e) + { printf("Tries not supported by JIT!!\n"); exit(1); } +ENDPBOp(); + + + PBOp(traced_trie_trust_val, e) + { printf("Tries not supported by JIT!!\n"); exit(1); } +ENDPBOp(); + + + PBOp(traced_trie_try_val, e) + { printf("Tries not supported by JIT!!\n"); exit(1); } +ENDPBOp(); + + + PBOp(traced_trie_retry_val, e) + { printf("Tries not supported by JIT!!\n"); exit(1); } +ENDPBOp(); + + + PBOp(traced_trie_do_val_in_pair, e) + { printf("Tries not supported by JIT!!\n"); exit(1); } +ENDPBOp(); + + + PBOp(traced_trie_trust_val_in_pair, e) + { printf("Tries not supported by JIT!!\n"); exit(1); } +ENDPBOp(); + + + PBOp(traced_trie_try_val_in_pair, e) + { printf("Tries not supported by JIT!!\n"); exit(1); } +ENDPBOp(); + + + PBOp(traced_trie_retry_val_in_pair, e) + { printf("Tries not supported by JIT!!\n"); exit(1); } +ENDPBOp(); + + + PBOp(traced_trie_do_atom, e) + { printf("Tries not supported by JIT!!\n"); exit(1); } +ENDPBOp(); + + + PBOp(traced_trie_trust_atom, e) + { printf("Tries not supported by JIT!!\n"); exit(1); } +ENDPBOp(); + + + PBOp(traced_trie_try_atom, e) + { printf("Tries not supported by JIT!!\n"); exit(1); } +ENDPBOp(); + + + PBOp(traced_trie_retry_atom, e) + { printf("Tries not supported by JIT!!\n"); exit(1); } +ENDPBOp(); + + + PBOp(traced_trie_do_atom_in_pair, e) + { printf("Tries not supported by JIT!!\n"); exit(1); } +ENDPBOp(); + + + PBOp(traced_trie_trust_atom_in_pair, e) + { printf("Tries not supported by JIT!!\n"); exit(1); } +ENDPBOp(); + + + PBOp(traced_trie_try_atom_in_pair, e) + { printf("Tries not supported by JIT!!\n"); exit(1); } +ENDPBOp(); + + + PBOp(traced_trie_retry_atom_in_pair, e) + { printf("Tries not supported by JIT!!\n"); exit(1); } +ENDPBOp(); + + + PBOp(traced_trie_do_null, e) + { printf("Tries not supported by JIT!!\n"); exit(1); } +ENDPBOp(); + + + PBOp(traced_trie_trust_null, e) + { printf("Tries not supported by JIT!!\n"); exit(1); } +ENDPBOp(); + + + PBOp(traced_trie_try_null, e) + { printf("Tries not supported by JIT!!\n"); exit(1); } +ENDPBOp(); + + + PBOp(traced_trie_retry_null, e) + { printf("Tries not supported by JIT!!\n"); exit(1); } +ENDPBOp(); + + + PBOp(traced_trie_do_null_in_pair, e) + { printf("Tries not supported by JIT!!\n"); exit(1); } +ENDPBOp(); + + + PBOp(traced_trie_trust_null_in_pair, e) +{ printf("Tries not supported by JIT!!\n"); exit(1); } +ENDPBOp(); + + +PBOp(traced_trie_try_null_in_pair, e) + { printf("Tries not supported by JIT!!\n"); exit(1); } +ENDPBOp(); + + + PBOp(traced_trie_retry_null_in_pair, e) +{ printf("Tries not supported by JIT!!\n"); exit(1); } +ENDPBOp(); + + +PBOp(traced_trie_do_pair, e) + { printf("Tries not supported by JIT!!\n"); exit(1); } +ENDPBOp(); + + + PBOp(traced_trie_trust_pair, e) + { printf("Tries not supported by JIT!!\n"); exit(1); } +ENDPBOp(); + + + PBOp(traced_trie_try_pair, e) + { printf("Tries not supported by JIT!!\n"); exit(1); } +ENDPBOp(); + + + PBOp(traced_trie_retry_pair, e) + { printf("Tries not supported by JIT!!\n"); exit(1); } +ENDPBOp(); + + + PBOp(traced_trie_do_appl, e) + { printf("Tries not supported by JIT!!\n"); exit(1); } +ENDPBOp(); + + + PBOp(traced_trie_trust_appl, e) + { printf("Tries not supported by JIT!!\n"); exit(1); } +ENDPBOp(); + + + PBOp(traced_trie_try_appl, e) + { printf("Tries not supported by JIT!!\n"); exit(1); } +ENDPBOp(); + + + PBOp(traced_trie_retry_appl, e) + { printf("Tries not supported by JIT!!\n"); exit(1); } +ENDPBOp(); + + + PBOp(traced_trie_do_appl_in_pair, e) +{ printf("Tries not supported by JIT!!\n"); exit(1); } +ENDPBOp(); + + + PBOp(traced_trie_trust_appl_in_pair, e) + { printf("Tries not supported by JIT!!\n"); exit(1); } +ENDPBOp(); + + + PBOp(traced_trie_try_appl_in_pair, e) + { printf("Tries not supported by JIT!!\n"); exit(1); } +ENDPBOp(); + + + PBOp(traced_trie_retry_appl_in_pair, e) + { printf("Tries not supported by JIT!!\n"); exit(1); } +ENDPBOp(); + + + PBOp(traced_trie_do_extension, e) + { printf("Tries not supported by JIT!!\n"); exit(1); } +ENDPBOp(); + + + PBOp(traced_trie_trust_extension, e) + { printf("Tries not supported by JIT!!\n"); exit(1); } +ENDPBOp(); + + + PBOp(traced_trie_try_extension, e) + { printf("Tries not supported by JIT!!\n"); exit(1); } +ENDPBOp(); + + + PBOp(traced_trie_retry_extension, e) + { printf("Tries not supported by JIT!!\n"); exit(1); } +ENDPBOp(); + + + PBOp(traced_trie_do_double, e) + register ans_node_ptr node = (ans_node_ptr) PREG; + register CELL *aux_stack = TOP_STACK; + int heap_arity = aux_stack[HEAP_ARITY_ENTRY]; + int vars_arity = aux_stack[VARS_ARITY_ENTRY]; + int subs_arity = aux_stack[SUBS_ARITY_ENTRY]; + volatile union { + Float dbl; + Term ts[SIZEOF_DOUBLE/SIZEOF_INT_P]; + } td; + Term t; + +#if SIZEOF_DOUBLE == 2 * SIZEOF_INT_P + td.ts[0] = aux_stack[HEAP_ENTRY(1)]; + td.ts[1] = aux_stack[HEAP_ENTRY(3)]; /* jump the first extension mark */ + heap_arity -= 4; + TOP_STACK = aux_stack = &aux_stack[4]; /* jump until the second extension mark */ +#else /* SIZEOF_DOUBLE == SIZEOF_INT_P */ + td.ts[0] = aux_stack[HEAP_ENTRY(1)]; + heap_arity -= 2; + TOP_STACK = aux_stack = &aux_stack[2]; /* jump until the extension mark */ +#endif /* SIZEOF_DOUBLE x SIZEOF_INT_P */ + TOP_STACK[HEAP_ARITY_ENTRY] = heap_arity; + t = MkFloatTerm(td.dbl); + aux_stack_term_instr(); + { printf("Tries not supported by JIT!!\n"); exit(1); } +ENDPBOp(); + + + BOp(traced_trie_trust_double, e) + Yap_Error(INTERNAL_ERROR, TermNil, "trie_trust_double: invalid instruction"); + ENDBOp(); + + + BOp(traced_trie_try_double, e) + Yap_Error(INTERNAL_ERROR, TermNil, "trie_try_double: invalid instruction"); + ENDBOp(); + + + BOp(traced_trie_retry_double, e) + Yap_Error(INTERNAL_ERROR, TermNil, "trie_retry_double: invalid instruction"); + ENDBOp(); + + + PBOp(traced_trie_do_longint, e) + register ans_node_ptr node = (ans_node_ptr) PREG; + register CELL *aux_stack = TOP_STACK; + int heap_arity = aux_stack[HEAP_ARITY_ENTRY]; + int vars_arity = aux_stack[VARS_ARITY_ENTRY]; + int subs_arity = aux_stack[SUBS_ARITY_ENTRY]; + Term t = MkLongIntTerm(aux_stack[HEAP_ENTRY(1)]); + + heap_arity -= 2; + TOP_STACK = aux_stack = &aux_stack[2]; /* jump until the extension mark */ + TOP_STACK[HEAP_ARITY_ENTRY] = heap_arity; + aux_stack_term_instr(); + { printf("Tries not supported by JIT!!\n"); exit(1); } +ENDPBOp(); + + + BOp(traced_trie_trust_longint, e) + Yap_Error(INTERNAL_ERROR, TermNil, "trie_trust_longint: invalid instruction"); + ENDBOp(); + + + BOp(traced_trie_try_longint, e) + Yap_Error(INTERNAL_ERROR, TermNil, "traced_trie_try_longint: invalid instruction"); + ENDBOp(); + + + BOp(traced_trie_retry_longint, e) + ENDBOp(); + + + PBOp(traced_trie_do_bigint, e) + { printf("Traced_Tries not supported by JIT!!\n"); exit(1); } +ENDPBOp(); + + + BOp(traced_trie_trust_bigint, e) + ENDBOp(); + + + BOp(traced_trie_try_bigint, e) + ENDBOp(); + + + BOp(traced_trie_retry_bigint, e) + ENDBOp(); + + + + PBOp(traced_trie_do_gterm, e) + + { printf("Traced_Tries not supported by JIT!!\n"); exit(1); } +ENDPBOp(); + + + PBOp(traced_trie_trust_gterm, e) + { printf("Traced_Tries not supported by JIT!!\n"); exit(1); } +ENDPBOp(); + + + PBOp(traced_trie_try_gterm, e) + { printf("Traced_Tries not supported by JIT!!\n"); exit(1); } +ENDPBOp(); + + + PBOp(traced_trie_retry_gterm, e) + { printf("Traced_Tries not supported by JIT!!\n"); exit(1); } +ENDPBOp(); diff --git a/YapTermConfig.h.cmake b/YapTermConfig.h.cmake index 0e83d1de2..a76bf41b9 100644 --- a/YapTermConfig.h.cmake +++ b/YapTermConfig.h.cmake @@ -4,20 +4,55 @@ #define YAP_TERM_CONFIG 1 /* Define sizes of some basic types */ -#undef SIZEOF_INT_P -#undef SIZEOF_INT -#undef SIZEOF_SHORT_INT -#undef SIZEOF_LONG_INT -#undef SIZEOF_LONG_LONG_INT -#undef SIZEOF_FLOAT -#undef SIZEOF_DOUBLE +#ifndef SIZEOF_INT_P +#cmakedefine SIZEOF_INT_P ${SIZEOF_INT_P} +#endif +/* The size of `int', as computed by sizeof. */ +#ifndef SIZEOF_INT +#cmakedefine SIZEOF_INT ${SIZEOF_INT} +#endif + +/* The size of `short int', as computed by sizeof. */ +#ifndef SIZEOF_SHORT_INT +#define SIZEOF_SHORT_INT ${SIZEOF_SHORT_INT} +#endif + +/* The size of `long int', as computed by sizeof. */ +#ifndef SIZEOF_LONG_INT +#cmakedefine SIZEOF_LONG_INT ${SIZEOF_LONG_INT} +#endif + +/* The size of `long long', as computed by sizeof. */ +#ifndef SIZEOF_LONG_LONG +#cmakedefine SIZEOF_LONG_LONG ${SIZEOF_LONG_LONG} +#endif + +/* The size of `float', as computed by sizeof. */ +#ifndef SIZEOF_FLOAT +#cmakedefine SIZEOF_FLOAT ${SIZEOF_FLOAT} +#endif + +/* The size of `float', as computed by sizeof. */ +#ifndef SIZEOF_FLOAT +#cmakedefine SIZEOF_FLOAT ${SIZEOF_FLOAT} +#endif + +/* Define to 1 if you have the header file. */ #ifndef HAVE_INTTYPES_H -#undef HAVE_INTTYPES_H +#cmakedefine HAVE_INTTYPES_H ${HAVE_INTTYPES_H} #endif +/* Define to 1 if you have the header file. */ +#ifndef HAVE_STDBOOL_H +#cmakedefine HAVE_STDBOOL_H ${HAVE_STDBOOL_H} +#endif + + +/* Define to 1 if you have the header file. */ #ifndef HAVE_STDINT_H -#undef HAVE_STDINT_H +#cmakedefine HAVE_STDINT_H ${HAVE_STDINT_H} #endif + #endif diff --git a/cmake/FindLLVM.cmake b/cmake/FindLLVM.cmake new file mode 100644 index 000000000..c6321d2bd --- /dev/null +++ b/cmake/FindLLVM.cmake @@ -0,0 +1,205 @@ +# - Find LLVM headers and libraries. +# This module locates LLVM and adapts the llvm-config output for use with +# CMake. +# +# A given list of COMPONENTS is passed to llvm-config. +# +# The following variables are defined: +# LLVM_FOUND - true if LLVM was found +# LLVM_CXXFLAGS - C++ compiler flags for files that include LLVM headers. +# LLVM_HOST_TARGET - Target triple used to configure LLVM. +# LLVM_INCLUDE_DIRS - Directory containing LLVM include files. +# LLVM_LDFLAGS - Linker flags to add when linking against LLVM +# (includes -LLLVM_LIBRARY_DIRS). +# LLVM_LIBRARIES - Full paths to the library files to link against. +# LLVM_LIBRARY_DIRS - Directory containing LLVM libraries. +# LLVM_ROOT_DIR - The root directory of the LLVM installation. +# llvm-config is searched for in ${LLVM_ROOT_DIR}/bin. +# LLVM_VERSION_MAJOR - Major version of LLVM. +# LLVM_VERSION_MINOR - Minor version of LLVM. +# LLVM_VERSION_STRING - Full LLVM version string (e.g. 2.9). +# +# Note: The variable names were chosen in conformance with the offical CMake +# guidelines, see ${CMAKE_ROOT}/Modules/readme.txt. + +# Try suffixed versions to pick up the newest LLVM install available on Debian +# derivatives. +# We also want an user-specified LLVM_ROOT_DIR to take precedence over the +# system default locations such as /usr/local/bin. Executing find_program() +# multiples times is the approach recommended in the docs. +set(llvm_config_names llvm-config-3.6 llvm-config36 + llvm-config-3.5 llvm-config35 + llvm-config-3.4 llvm-config34 + llvm-config-3.3 llvm-config33 + llvm-config-3.2 llvm-config32 + llvm-config-3.1 llvm-config31 llvm-config + ) + +find_program(LLVM_CONFIG + NAMES ${llvm_config_names} + PATHS ${LLVM_ROOT_DIR}/bin NO_DEFAULT_PATH + DOC "Path to llvm-config tool.") + + IF(APPLE) + set(llvm_config_paths + /sw/bin + /opt/local/bin + /opt/bin + /usr/local/opt/llvm/bin #brew + NO_DEFAULT_PATH + ) + # mac oriented: avoid the default llvm (x-code) + find_program(LLVM_CONFIG + NAMES ${llvm_config_names} + PATHS ${llvm_config_paths} NO_DEFAULT_PATH + DOC "Path to llvm-config tool.") + + ENDIF(APPLE) + +find_program(LLVM_CONFIG NAMES ${llvm_config_names}) + +if ((WIN32 AND NOT(MINGW OR CYGWIN)) OR NOT LLVM_CONFIG) + if (WIN32) + # A bit of a sanity check: + if( NOT EXISTS ${LLVM_ROOT_DIR}/include/llvm ) + message(FATAL_ERROR "LLVM_ROOT_DIR (${LLVM_ROOT_DIR}) is not a valid LLVM install") + endif() + # We incorporate the CMake features provided by LLVM: + set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${LLVM_ROOT_DIR}/share/llvm/cmake") + include(LLVMConfig) + # Set properties + set(LLVM_HOST_TARGET ${TARGET_TRIPLE}) + set(LLVM_VERSION_STRING ${LLVM_PACKAGE_VERSION}) + set(LLVM_CXXFLAGS ${LLVM_DEFINITIONS}) + set(LLVM_LDFLAGS "") + list(REMOVE_ITEM LLVM_FIND_COMPONENTS "all-targets" index) + list(APPEND LLVM_FIND_COMPONENTS ${LLVM_TARGETS_TO_BUILD}) + # Work around LLVM bug 21016 + list(FIND LLVM_TARGETS_TO_BUILD "X86" TARGET_X86) + if(TARGET_X86 GREATER -1) + list(APPEND LLVM_FIND_COMPONENTS x86utils) + endif() + # Similar to the work around above, but for AArch64 + list(FIND LLVM_TARGETS_TO_BUILD "AArch64" TARGET_AArch64) + if(TARGET_AArch64 GREATER -1) + list(APPEND LLVM_FIND_COMPONENTS AArch64Utils) + endif() + list(REMOVE_ITEM LLVM_FIND_COMPONENTS "backend" index) + if(${LLVM_VERSION_STRING} MATCHES "^3\\.[0-2][\\.0-9A-Za-z]*") + # Versions below 3.3 do not support components objcarcopts, option + list(REMOVE_ITEM LLVM_FIND_COMPONENTS "objcarcopts" index) + list(REMOVE_ITEM LLVM_FIND_COMPONENTS "option" index) + endif() + if(${LLVM_VERSION_STRING} MATCHES "^3\\.[0-4][\\.0-9A-Za-z]*") + # Versions below 3.5 do not support components lto, profiledata + list(REMOVE_ITEM LLVM_FIND_COMPONENTS "lto" index) + list(REMOVE_ITEM LLVM_FIND_COMPONENTS "profiledata" index) + endif() + + if(${LLVM_VERSION_STRING} MATCHES "^3\\.[0-4][\\.0-9A-Za-z]*") + llvm_map_components_to_libraries(tmplibs ${LLVM_FIND_COMPONENTS}) + else() + llvm_map_components_to_libnames(tmplibs ${LLVM_FIND_COMPONENTS}) + endif() + if(MSVC) + foreach(lib ${tmplibs}) + list(APPEND LLVM_LIBRARIES "${LLVM_LIBRARY_DIRS}/${CMAKE_STATIC_LIBRARY_PREFIX}${lib}${CMAKE_STATIC_LIBRARY_SUFFIX}") + endforeach() + else() + # Rely on the library search path being set correctly via -L on + # MinGW and others, as the library list returned by + # llvm_map_components_to_libraries also includes imagehlp and psapi. + set(LLVM_LDFLAGS "-L${LLVM_LIBRARY_DIRS}") + set(LLVM_LIBRARIES ${tmplibs}) + endif() + + # When using the CMake LLVM module, LLVM_DEFINITIONS is a list + # instead of a string. Later, the list seperators would entirely + # disappear, replace them by spaces instead. A better fix would be + # to switch to add_definitions() instead of throwing strings around. + string(REPLACE ";" " " LLVM_CXXFLAGS "${LLVM_CXXFLAGS}") + else() + if (NOT FIND_LLVM_QUIETLY) + message(WARNING "Could not find llvm-config. Try manually setting LLVM_CONFIG to the llvm-config executable of the installation to use.") + endif() + endif() +else() + macro(llvm_set var flag) + if(LLVM_FIND_QUIETLY) + set(_quiet_arg ERROR_QUIET) + endif() + execute_process( + COMMAND ${LLVM_CONFIG} --${flag} + OUTPUT_VARIABLE LLVM_${var} + OUTPUT_STRIP_TRAILING_WHITESPACE + ${_quiet_arg} + ) + if(${ARGV2}) + file(TO_CMAKE_PATH "${LLVM_${var}}" LLVM_${var}) + endif() + endmacro() + macro(llvm_set_libs var flag prefix) + if(LLVM_FIND_QUIETLY) + set(_quiet_arg ERROR_QUIET) + endif() + execute_process( + COMMAND ${LLVM_CONFIG} --${flag} ${LLVM_FIND_COMPONENTS} + OUTPUT_VARIABLE tmplibs + OUTPUT_STRIP_TRAILING_WHITESPACE + ${_quiet_arg} + ) + file(TO_CMAKE_PATH "${tmplibs}" tmplibs) + string(REGEX REPLACE "([$^.[|*+?()]|])" "\\\\\\1" pattern "${prefix}/") + string(REGEX MATCHALL "${pattern}[^ ]+" LLVM_${var} ${tmplibs}) + endmacro() + + llvm_set(VERSION_STRING version) + llvm_set(CXXFLAGS cxxflags) + llvm_set(HOST_TARGET host-target) + llvm_set(INCLUDE_DIRS includedir true) + llvm_set(ROOT_DIR prefix true) + + if(${LLVM_VERSION_STRING} MATCHES "^3\\.[0-2][\\.0-9A-Za-z]*") + # Versions below 3.3 do not support components objcarcopts, option + list(REMOVE_ITEM LLVM_FIND_COMPONENTS "objcarcopts" index) + list(REMOVE_ITEM LLVM_FIND_COMPONENTS "option" index) + endif() + if(${LLVM_VERSION_STRING} MATCHES "^3\\.[0-4][\\.0-9A-Za-z]*") + # Versions below 3.5 do not support components lto, profiledata + list(REMOVE_ITEM LLVM_FIND_COMPONENTS "lto" index) + list(REMOVE_ITEM LLVM_FIND_COMPONENTS "profiledata" index) + endif() + + llvm_set(LDFLAGS ldflags) + if(NOT ${LLVM_VERSION_STRING} MATCHES "^3\\.[0-4][\\.0-9A-Za-z]*") + # In LLVM 3.5+, the system library dependencies (e.g. "-lz") are accessed + # using the separate "--system-libs" flag. + llvm_set(SYSTEM_LIBS system-libs) + string(REPLACE "\n" " " LLVM_LDFLAGS "${LLVM_LDFLAGS} ${LLVM_SYSTEM_LIBS}") + endif() + llvm_set(LIBRARY_DIRS libdir true) + llvm_set_libs(LIBRARIES libfiles "${LLVM_LIBRARY_DIRS}") +endif() + +# On CMake builds of LLVM, the output of llvm-config --cxxflags does not +# include -fno-rtti, leading to linker errors. Be sure to add it. +if(CMAKE_COMPILER_IS_GNUCXX OR (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")) + if(NOT ${LLVM_CXXFLAGS} MATCHES "-fno-rtti") + set(LLVM_CXXFLAGS "${LLVM_CXXFLAGS} -fno-rtti") + endif() +endif() + +string(REGEX REPLACE "([0-9]+).*" "\\1" LLVM_VERSION_MAJOR "${LLVM_VERSION_STRING}" ) +string(REGEX REPLACE "[0-9]+\\.([0-9]+).*[A-Za-z]*" "\\1" LLVM_VERSION_MINOR "${LLVM_VERSION_STRING}" ) + +# Use the default CMake facilities for handling QUIET/REQUIRED. +include(FindPackageHandleStandardArgs) + +if(${CMAKE_VERSION} VERSION_LESS "2.8.4") + # The VERSION_VAR argument is not supported on pre-2.8.4, work around this. + set(VERSION_VAR dummy) +endif() + +find_package_handle_standard_args(LLVM + REQUIRED_VARS LLVM_ROOT_DIR LLVM_HOST_TARGET + VERSION_VAR LLVM_VERSION_STRING) diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt deleted file mode 100644 index 0619c5ee3..000000000 --- a/docs/CMakeLists.txt +++ /dev/null @@ -1,18 +0,0 @@ -#CHECK: DOXYGEN -macro_optional_find_package (Doxygen ON) -macro_log_feature (DOXYGEN_FOUND "Doxygen" - "Use DOXYGEN Documentation System " - "http://www.doxygen.org" FALSE) -if (DOXYGEN_FOUND) - # - # DOXYGEN_EXECUTABLE = The path to the doxygen command. - # DOXYGEN_FOUND = Was Doxygen found or not? - # DOXYGEN_VERSION = The version reported by doxygen --version - # - # - # - # :: - # - # DOXYGEN_DOT_EXECUTABLE = The path to the dot program used by doxygen. - # DOXYGEN_DOT_FOUND = Was Dot found or not? -endif (DOXYGEN_FOUND) diff --git a/docs/doxfull.rc b/docs/doxfull.rc index 03b8ecb4d..dee6a6bc7 100644 --- a/docs/doxfull.rc +++ b/docs/doxfull.rc @@ -359,6 +359,7 @@ DISTRIBUTE_GROUP_DOC = NO # \nosubgrouping command. # The default value is: YES. + SUBGROUPING = YES # When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions @@ -370,7 +371,7 @@ SUBGROUPING = YES # SEPARATE_MEMBER_PAGES. # The default value is: NO. -INLINE_GROUPED_CLASSES = NO +INLINE_GROUPED_CLASSES = YES # When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions # with only public data fields or simple typedef fields will be shown inline in @@ -380,7 +381,7 @@ INLINE_GROUPED_CLASSES = NO # Man pages) or section (for LaTeX and RTF). # The default value is: NO. -INLINE_SIMPLE_STRUCTS = NO +INLINE_SIMPLE_STRUCTS = YES # When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or # enum is documented as struct, union, or enum with the name of the typedef. So @@ -484,7 +485,7 @@ HIDE_UNDOC_CLASSES = NO # included in the documentation. # The default value is: NO. -HIDE_FRIEND_COMPOUNDS = NO +HIDE_FRIEND_COMPOUNDS = YES # If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any # documentation blocks found inside the body of a function. If set to NO these diff --git a/include/YapDefs.h b/include/YapDefs.h index 8357b56f6..41f8ebc25 100755 --- a/include/YapDefs.h +++ b/include/YapDefs.h @@ -13,12 +13,43 @@ * comments: Data structures and defines used in the Interface * * * *************************************************************************/ + #ifndef _YAPDEFS_H #define _YAPDEFS_H 1 #include +/* The YAP main types */ +#include "YapTerm.h" + +/* truth-values */ +/* stdbool defines the booleam type, bool, + and the constants false and true */ +#if HAVE_STDBOOL_H +#include +#else +#ifndef true +typedef int _Bool; + +#define bool _Bool; + +#define false 0 +#define true 1 +#endif +#endif /* HAVE_STDBOOL_H */ + +/** + FALSE and TRUE are the pre-standard versions, + still widely used. +*/ +#ifndef TRUE +#define TRUE true +#endif +#ifndef FALSE +#define FALSE false +#endif + #ifdef YAP_H /* if Yap.h is available, just reexport */ @@ -27,9 +58,9 @@ #define YAP_Term Term -typedef UInt YAP_Arity; +#define YAP_Arity arity_t -typedef Term YAP_Module; +#define YAP_Module Term #define YAP_Functor Functor @@ -41,9 +72,9 @@ typedef Term YAP_Module; #define YAP_Float Float -typedef int YAP_Bool; +#define YAP_Bool bool -typedef yhandle_t YAP_handle_t; +#define YAP_handle_t yhandle_t #define YAP_PredEntryPtr struct pred_entry * @@ -58,10 +89,10 @@ typedef yhandle_t YAP_handle_t; #if _WIN64 typedef unsigned long long YAP_CELL; #else -typedef unsigned long YAP_CELL; +typedef uintptr_t YAP_CELL; #endif -typedef int YAP_Bool; +typedef bool YAP_Bool; typedef YAP_CELL YAP_Term; diff --git a/include/YapError.h b/include/YapError.h index 735f73e91..5526ac6a6 100644 --- a/include/YapError.h +++ b/include/YapError.h @@ -23,6 +23,9 @@ typedef enum FATAL_ERROR, INTERNAL_ERROR, INTERNAL_COMPILER_ERROR, +#if !YAP_JIT + NOJIT_ERROR, /* I added */ +#endif PURE_ABORT, CALL_COUNTER_UNDERFLOW, /* ISO_ERRORS */ @@ -59,10 +62,14 @@ typedef enum EXISTENCE_ERROR_SOURCE_SINK, EXISTENCE_ERROR_STREAM, EXISTENCE_ERROR_VARIABLE, + INCOMPATIBLEMODE_WARNING, /* I added */ + INCOMPATIBLE_CODEMODE_WARNING, /* I added */ INSTANTIATION_ERROR, INTERRUPT_ERROR, + INVALID_PARAMETER_TYPE_ERROR, /* I added */ OPERATING_SYSTEM_ERROR, OUT_OF_HEAP_ERROR, + OUT_OF_KNOWNRANGE_ERROR, /* I added */ OUT_OF_STACK_ERROR, OUT_OF_TRAIL_ERROR, OUT_OF_ATTVARS_ERROR, @@ -126,6 +133,7 @@ typedef enum UNKNOWN_ERROR } yap_error_number; + #define JMP_LOCAL_ERROR(v, LAB) \ if (H + 2*(v) > ASP-1024) { \ LOCAL_Error_TYPE = OUT_OF_STACK_ERROR;\ diff --git a/library/tries/tries.c b/library/tries/tries.c index b289697c1..aaf8cc1d0 100644 --- a/library/tries/tries.c +++ b/library/tries/tries.c @@ -32,54 +32,54 @@ typedef struct { /* -------------------------- */ void init_tries(void); -static int p_trie_open(void); -static int p_trie_close(void); -static int p_trie_close_all(void); -static int p_trie_mode(void); -static int p_trie_put_entry(void); -static int p_trie_check_entry(void); -static int p_trie_get_entry(void); -static int p_trie_get_first_entry(void); -static int p_trie_get_last_entry(void); -static int p_trie_traverse_init(void); -static int p_trie_traverse_cont(void); -static int p_trie_remove_entry(void); -static int p_trie_remove_subtree(void); -static int p_trie_join(void); -static int p_trie_intersect(void); -static int p_trie_count_join(void); -static int p_trie_count_intersect(void); -static int p_trie_save(void); -static int p_trie_load(void); -static int p_trie_stats(void); -static int p_trie_max_stats(void); -static int p_trie_usage(void); -static int p_trie_print(void); +static YAP_Bool p_trie_open(void); +static YAP_Bool p_trie_close(void); +static YAP_Bool p_trie_close_all(void); +static YAP_Bool p_trie_mode(void); +static YAP_Bool p_trie_put_entry(void); +static YAP_Bool p_trie_check_entry(void); +static YAP_Bool p_trie_get_entry(void); +static YAP_Bool p_trie_get_first_entry(void); +static YAP_Bool p_trie_get_last_entry(void); +static YAP_Bool p_trie_traverse_init(void); +static YAP_Bool p_trie_traverse_cont(void); +static YAP_Bool p_trie_remove_entry(void); +static YAP_Bool p_trie_remove_subtree(void); +static YAP_Bool p_trie_join(void); +static YAP_Bool p_trie_intersect(void); +static YAP_Bool p_trie_count_join(void); +static YAP_Bool p_trie_count_intersect(void); +static YAP_Bool p_trie_save(void); +static YAP_Bool p_trie_load(void); +static YAP_Bool p_trie_stats(void); +static YAP_Bool p_trie_max_stats(void); +static YAP_Bool p_trie_usage(void); +static YAP_Bool p_trie_print(void); -static int p_trie_traverse_mode(void); -static int p_trie_disable_hash(void); -static int p_trie_enable_hash(void); -static int p_trie_traverse_first(void); -static int p_trie_traverse_next(void); +static YAP_Bool p_trie_traverse_mode(void); +static YAP_Bool p_trie_disable_hash(void); +static YAP_Bool p_trie_enable_hash(void); +static YAP_Bool p_trie_traverse_first(void); +static YAP_Bool p_trie_traverse_next(void); -static int p_trie_to_list(void); +static YAP_Bool p_trie_to_list(void); /* dbtries support */ -static int p_trie_depth_breadth(void); -static int p_trie_get_depth_breadth_reduction_current_data(void); -static int p_trie_get_db_opt_level_count_init(void); -static int p_trie_get_db_opt_level_count_cont(void); -static int p_trie_replace_nested_trie(void); -static int p_trie_db_opt_min_prefix(void); +static YAP_Bool p_trie_depth_breadth(void); +static YAP_Bool p_trie_get_depth_breadth_reduction_current_data(void); +static YAP_Bool p_trie_get_db_opt_level_count_init(void); +static YAP_Bool p_trie_get_db_opt_level_count_cont(void); +static YAP_Bool p_trie_replace_nested_trie(void); +static YAP_Bool p_trie_db_opt_min_prefix(void); /* backwards compatibility */ -static int p_open_trie(void); -static int p_close_trie(void); -static int p_close_all_tries(void); -static int p_put_trie_entry(void); -static int p_get_trie_entry(void); -static int p_remove_trie_entry(void); -static int p_print_trie(void); +static YAP_Bool p_open_trie(void); +static YAP_Bool p_close_trie(void); +static YAP_Bool p_close_all_tries(void); +static YAP_Bool p_put_trie_entry(void); +static YAP_Bool p_get_trie_entry(void); +static YAP_Bool p_remove_trie_entry(void); +static YAP_Bool p_print_trie(void); @@ -146,19 +146,19 @@ void init_tries(void) { /* --------------------------------- */ /* open_trie(-Trie) */ -static int p_open_trie(void) { +static YAP_Bool p_open_trie(void) { return p_trie_open(); } /* close_trie(+Trie) */ -static int p_close_trie(void) { +static YAP_Bool p_close_trie(void) { return p_trie_close(); } /* close_all_tries() */ -static int p_close_all_tries(void) { +static YAP_Bool p_close_all_tries(void) { return p_trie_close_all(); } @@ -168,7 +168,7 @@ static int p_close_all_tries(void) { #define arg_trie YAP_ARG2 #define arg_entry YAP_ARG3 #define arg_ref YAP_ARG4 -static int p_put_trie_entry(void) { +static YAP_Bool p_put_trie_entry(void) { TrData data; const char *mode_str; YAP_Int mode, current_mode; @@ -201,7 +201,7 @@ static int p_put_trie_entry(void) { #define arg_mode YAP_ARG1 #define arg_ref YAP_ARG2 #define arg_entry YAP_ARG3 -static int p_get_trie_entry(void) { +static YAP_Bool p_get_trie_entry(void) { YAP_Term entry; const char *mode_str; YAP_Int mode, current_mode; @@ -230,13 +230,13 @@ static int p_get_trie_entry(void) { /* remove_trie_entry(+Ref) */ -static int p_remove_trie_entry(void) { +static YAP_Bool p_remove_trie_entry(void) { return p_trie_remove_entry(); } /* print_trie(+Trie) */ -static int p_print_trie(void) { +static YAP_Bool p_print_trie(void) { return p_trie_print(); } @@ -248,7 +248,7 @@ static int p_print_trie(void) { /* trie_open(-Trie) */ #define arg_trie YAP_ARG1 -static int p_trie_open(void) { +static YAP_Bool p_trie_open(void) { TrEntry trie; /* check arg */ @@ -264,7 +264,7 @@ static int p_trie_open(void) { /* trie_close(+Trie) */ #define arg_trie YAP_ARG1 -static int p_trie_close(void) { +static YAP_Bool p_trie_close(void) { /* check arg */ if (!YAP_IsIntTerm(arg_trie)) return FALSE; @@ -277,7 +277,7 @@ static int p_trie_close(void) { /* trie_close_all() */ -static int p_trie_close_all(void) { +static YAP_Bool p_trie_close_all(void) { trie_close_all(); return TRUE; } @@ -285,7 +285,7 @@ static int p_trie_close_all(void) { /* trie_mode(?Mode) */ #define arg_mode YAP_ARG1 -static int p_trie_mode(void) { +static YAP_Bool p_trie_mode(void) { YAP_Term mode_term; const char *mode_str; YAP_Int mode; @@ -320,7 +320,7 @@ static int p_trie_mode(void) { #define arg_trie YAP_ARG1 #define arg_entry YAP_ARG2 #define arg_ref YAP_ARG3 -static int p_trie_put_entry(void) { +static YAP_Bool p_trie_put_entry(void) { TrData data; /* check args */ @@ -340,7 +340,7 @@ static int p_trie_put_entry(void) { #define arg_trie YAP_ARG1 #define arg_entry YAP_ARG2 #define arg_ref YAP_ARG3 -static int p_trie_check_entry(void) { +static YAP_Bool p_trie_check_entry(void) { TrData data; /* check args */ @@ -360,7 +360,7 @@ static int p_trie_check_entry(void) { /* trie_get_entry(+Ref,-Entry) */ #define arg_ref YAP_ARG1 #define arg_entry YAP_ARG2 -static int p_trie_get_entry(void) { +static YAP_Bool p_trie_get_entry(void) { YAP_Term entry; /* check args */ @@ -378,7 +378,7 @@ static int p_trie_get_entry(void) { /* trie_get_first_entry(+Trie,-Ref) */ #define arg_trie YAP_ARG1 #define arg_ref YAP_ARG2 -static int p_trie_get_first_entry(void) { +static YAP_Bool p_trie_get_first_entry(void) { TrData data; /* check args */ @@ -397,7 +397,7 @@ static int p_trie_get_first_entry(void) { /* trie_get_last_entry(+Trie,-Ref) */ #define arg_trie YAP_ARG1 #define arg_ref YAP_ARG2 -static int p_trie_get_last_entry(void) { +static YAP_Bool p_trie_get_last_entry(void) { TrData data; /* check args */ @@ -417,7 +417,7 @@ static int p_trie_get_last_entry(void) { #define arg_trie YAP_ARG1 #define arg_init_ref YAP_ARG2 #define arg_ref YAP_ARG3 -static int p_trie_traverse_init(void) { +static YAP_Bool p_trie_traverse_init(void) { TrData data; /* check args */ @@ -442,7 +442,7 @@ static int p_trie_traverse_init(void) { #define arg_trie YAP_ARG1 #define arg_init_ref YAP_ARG2 #define arg_ref YAP_ARG3 -static int p_trie_traverse_cont(void) { +static YAP_Bool p_trie_traverse_cont(void) { TrData data; /* traverse trie */ @@ -459,7 +459,7 @@ static int p_trie_traverse_cont(void) { /* trie_remove_entry(+Ref) */ #define arg_ref YAP_ARG1 -static int p_trie_remove_entry(void) { +static YAP_Bool p_trie_remove_entry(void) { /* check arg */ if (!YAP_IsIntTerm(arg_ref)) return FALSE; @@ -473,7 +473,7 @@ static int p_trie_remove_entry(void) { /* trie_remove_subtree(+Ref) */ #define arg_ref YAP_ARG1 -static int p_trie_remove_subtree(void) { +static YAP_Bool p_trie_remove_subtree(void) { /* check arg */ if (!YAP_IsIntTerm(arg_ref)) return FALSE; @@ -488,7 +488,7 @@ static int p_trie_remove_subtree(void) { /* trie_join(+TrieDest,+TrieSource) */ #define arg_trie_dest YAP_ARG1 #define arg_trie_source YAP_ARG2 -static int p_trie_join(void) { +static YAP_Bool p_trie_join(void) { /* check args */ if (!YAP_IsIntTerm(arg_trie_dest)) return FALSE; @@ -506,7 +506,7 @@ static int p_trie_join(void) { /* trie_intersect(+TrieDest,+TrieSource) */ #define arg_trie_dest YAP_ARG1 #define arg_trie_source YAP_ARG2 -static int p_trie_intersect(void) { +static YAP_Bool p_trie_intersect(void) { /* check args */ if (!YAP_IsIntTerm(arg_trie_dest)) return FALSE; @@ -525,7 +525,7 @@ static int p_trie_intersect(void) { #define arg_trie1 YAP_ARG1 #define arg_trie2 YAP_ARG2 #define arg_entries YAP_ARG3 -static int p_trie_count_join(void) { +static YAP_Bool p_trie_count_join(void) { YAP_Int entries; /* check args */ @@ -547,7 +547,7 @@ static int p_trie_count_join(void) { #define arg_trie1 YAP_ARG1 #define arg_trie2 YAP_ARG2 #define arg_entries YAP_ARG3 -static int p_trie_count_intersect(void) { +static YAP_Bool p_trie_count_intersect(void) { YAP_Int entries; /* check args */ @@ -568,7 +568,7 @@ static int p_trie_count_intersect(void) { /* trie_save(+Trie,+FileName) */ #define arg_trie YAP_ARG1 #define arg_file YAP_ARG2 -static int p_trie_save(void) { +static YAP_Bool p_trie_save(void) { const char *file_str; FILE *file; @@ -596,7 +596,7 @@ static int p_trie_save(void) { /* trie_load(-Trie,+FileName) */ #define arg_trie YAP_ARG1 #define arg_file YAP_ARG2 -static int p_trie_load(void) { +static YAP_Bool p_trie_load(void) { TrEntry data; const char *file_str; FILE *file; @@ -628,7 +628,7 @@ static int p_trie_load(void) { #define arg_tries YAP_ARG2 #define arg_entries YAP_ARG3 #define arg_nodes YAP_ARG4 -static int p_trie_stats(void) { +static YAP_Bool p_trie_stats(void) { YAP_Int memory, tries, entries, nodes; /* get stats */ @@ -654,7 +654,7 @@ static int p_trie_stats(void) { #define arg_tries YAP_ARG2 #define arg_entries YAP_ARG3 #define arg_nodes YAP_ARG4 -static int p_trie_max_stats(void) { +static YAP_Bool p_trie_max_stats(void) { YAP_Int memory, tries, entries, nodes; /* get stats */ @@ -680,7 +680,7 @@ static int p_trie_max_stats(void) { #define arg_entries YAP_ARG2 #define arg_nodes YAP_ARG3 #define arg_virtualnodes YAP_ARG4 -static int p_trie_usage(void) { +static YAP_Bool p_trie_usage(void) { YAP_Int entries, nodes, virtualnodes; /* check arg */ @@ -705,7 +705,7 @@ static int p_trie_usage(void) { /* trie_print(+Trie) */ #define arg_trie YAP_ARG1 -static int p_trie_print(void) { +static YAP_Bool p_trie_print(void) { /* check arg */ if (!YAP_IsIntTerm(arg_trie)) return FALSE; @@ -719,7 +719,7 @@ static int p_trie_print(void) { /* trie_traverse_mode(?Mode) */ #define arg_mode YAP_ARG1 -static int p_trie_traverse_mode(void) { +static YAP_Bool p_trie_traverse_mode(void) { YAP_Term mode_term; const char *mode_str; YAP_Int mode; @@ -753,7 +753,7 @@ static int p_trie_traverse_mode(void) { /* trie_traverse_first(+Trie, -Ref) */ #define arg_trie YAP_ARG1 #define arg_ref YAP_ARG2 -static int p_trie_traverse_first(void) { +static YAP_Bool p_trie_traverse_first(void) { TrData data; /* check arg */ @@ -773,7 +773,7 @@ static int p_trie_traverse_first(void) { /* trie_traverse_next(+Ref, -Ref) */ #define arg_cur YAP_ARG1 #define arg_next YAP_ARG2 -static int p_trie_traverse_next(void) { +static YAP_Bool p_trie_traverse_next(void) { TrData data; /* check arg */ @@ -791,14 +791,14 @@ static int p_trie_traverse_next(void) { /* trie_disable_hash */ -static int p_trie_disable_hash(void) { +static YAP_Bool p_trie_disable_hash(void) { trie_disable_hash_table(); return TRUE; } /* trie_enable_hash */ -static int p_trie_enable_hash(void) { +static YAP_Bool p_trie_enable_hash(void) { trie_enable_hash_table(); return TRUE; } @@ -807,7 +807,7 @@ static int p_trie_enable_hash(void) { /* trie_to_list(+Trie, -List) */ #define arg_trie YAP_ARG1 #define arg_list YAP_ARG2 -static int p_trie_to_list(void) { +static YAP_Bool p_trie_to_list(void) { YAP_Term list; /* check arg */ @@ -829,7 +829,7 @@ static int p_trie_to_list(void) { #define arg_opt_level YAP_ARG4 #define arg_start_counter YAP_ARG5 #define arg_end_counter YAP_ARG6 -static int p_trie_depth_breadth(void) { +static YAP_Bool p_trie_depth_breadth(void) { /* get depth breadth trie */ if (!YAP_IsIntTerm(arg_opt_level)) return FALSE; @@ -851,7 +851,7 @@ static int p_trie_depth_breadth(void) { /* trie_get_depth_breadth_reduction_entry(-Entry) */ #define arg_entry YAP_ARG1 -static int p_trie_get_depth_breadth_reduction_current_data(void) { +static YAP_Bool p_trie_get_depth_breadth_reduction_current_data(void) { TrData data = trie_get_depth_breadth_reduction_current_data(); if (data) return YAP_Unify(arg_entry, YAP_MkIntTerm((YAP_Int) data)); @@ -865,7 +865,7 @@ db_trie_opt_level *opt_level; /* trie_get_depth_breadth_reduction_opt_level_count(?OptLevel, -Count) */ #define arg_opt_level YAP_ARG1 #define arg_count YAP_ARG2 -static int p_trie_get_db_opt_level_count_init(void) { +static YAP_Bool p_trie_get_db_opt_level_count_init(void) { if (YAP_IsIntTerm(arg_opt_level)) { if (YAP_IntOfTerm(arg_opt_level) > 0 && YAP_IntOfTerm(arg_opt_level) < 4) { if (YAP_Unify(arg_count, YAP_MkIntTerm(trie_get_db_opt_level_count(YAP_IntOfTerm(arg_opt_level))))) { @@ -899,7 +899,7 @@ static int p_trie_get_db_opt_level_count_init(void) { /* trie_get_depth_breadth_reduction_opt_level_count(?OptLevel, -Count) */ #define arg_opt_level YAP_ARG1 #define arg_count YAP_ARG2 -static int p_trie_get_db_opt_level_count_cont(void) { +static YAP_Bool p_trie_get_db_opt_level_count_cont(void) { YAP_PRESERVED_DATA(opt_level, db_trie_opt_level); opt_level->value = YAP_MkIntTerm(YAP_IntOfTerm(opt_level->value) + 1); if (YAP_IntOfTerm(opt_level->value) < 4) { @@ -920,7 +920,7 @@ static int p_trie_get_db_opt_level_count_cont(void) { #define arg_trie YAP_ARG1 #define arg_nested_id YAP_ARG2 #define arg_term YAP_ARG3 -static int p_trie_replace_nested_trie(void) { +static YAP_Bool p_trie_replace_nested_trie(void) { if (!YAP_IsIntTerm(arg_nested_id)) return FALSE; if (!YAP_IsNonVarTerm(arg_term)) @@ -935,7 +935,7 @@ static int p_trie_replace_nested_trie(void) { /* trie_db_opt_min_prefix(?MinPrefix) */ #define arg_min_prefix YAP_ARG1 -static int p_trie_db_opt_min_prefix(void) { +static YAP_Bool p_trie_db_opt_min_prefix(void) { YAP_Int min_prefix; /* get mode */ diff --git a/misc/LOCALS b/misc/LOCALS index 7e7b00dde..df9539a77 100755 --- a/misc/LOCALS +++ b/misc/LOCALS @@ -157,11 +157,7 @@ ADDR TrailBase void ADDR TrailTop void char* ErrorMessage void Term Error_Term void -#ifdef THREADS -Term Error_TYPE void -#else yap_error_number Error_TYPE void -#endif UInt Error_Size void char ErrorSay[MAX_ERROR_MSG_SIZE] void jmp_buf IOBotch void diff --git a/misc/buildops b/misc/buildops index 005f21497..48323b5f9 100644 --- a/misc/buildops +++ b/misc/buildops @@ -38,15 +38,26 @@ main :- header_find_clause(F), header_find_clause(H), header_save_clause(S), - file('C/absmi.c', W, C, L, F, H, S), + file('C/absmi_insts.h', W, C, L, F, H, S), start_ifdef("YAPOR", W, C, L, F, H, S), - file('OPTYap/or.insts.i',W, C, L, F, H, S), + file('OPTYap/or.insts.h',W, C, L, F, H, S), end_ifdef(W, C, L, F, H, S), start_ifdef("TABLING", W, C, L, F, H, S), - file('OPTYap/tab.insts.i',W,C,L, F, H, S), + file('OPTYap/tab.insts.h',W,C,L, F, H, S), retractall(op(_,_)), - file('OPTYap/tab.tries.insts.i', W, C, L, F, H, S), + file('OPTYap/tab.tries.insts.h', W, C, L, F, H, S), end_ifdef(W, C, L, F, H, S), + start_ifdef("YAP_JIT", W, C, L, F, H, S), + file('C/traced_absmi_insts.h', W, C, L, F, H, S), + start_ifdef("YAPOR", W, C, L, F, H, S), + file('OPTYap/traced_or.insts.h',W, C, L, F, H, S), + end_ifdef(W, C, L, F, H, S), + start_ifdef("TABLING", W, C, L, F, H, S), + file('OPTYap/traced_tab.insts.h',W,C,L, F, H, S), + retractall(op(_,_)), + file('OPTYap/traced_tab.tries.insts.h', W, C, L, F, H, S), + end_ifdef(W, C, L, F, H, S), + end_ifdef(W, C, L, F, H, S), footer(W), footer_rclause(C), footer_walk_clause(L), @@ -139,14 +150,28 @@ file(I,W,C,L,F,H, S) :- output_save_clause(S). grep_opcode(W, Line) :- -%format('~s~n', [Line]), split(Line," ,();",[OP,Name,Type]), - Name \= "or_last", - check_op(OP), + Name \= "or_last", Name \= "traced_or_last", + check_op(OP), !, special(Name,W), assert(op(Type,Name)), format(W,' OPCODE(~s~36+,~s),~n',[Name,Type]), end_special(Name,W). +grep_opcode(W, Line) :- + split(Line,"# \"<>",["include",File]), + atom_codes(AFile, File), + atomic_concat('C/',AFile,NFile), + ( + catch( open(NFile,read,R), _, fail ) + -> + ( sub_atom( AFile, 0, _, _, traced ) -> format(W,'#if YAP_JIT~n',[]) ; true ), + process(R,grep_opcode(W)), + ( sub_atom( AFile, 0, _, _, traced ) -> format(W,'#endif~n',[]) ; true), + close(R) + ; + true + ). + check_op("Op"). check_op("BOp"). @@ -171,8 +196,7 @@ special_op("table_answer_resolution_completion","THREADS_CONSUMER_SHARING"). special_op("run_eam","BEAM"). special_op("retry_eam","BEAM"). special_op("thread_local","THREADS"). -special_op("lock_lu","THREADS"). -special_op("unlock_lu","THREADS"). +special_op("jit_handler","YAP_JIT"). output_rclause(C) :- setof(T,O^op(T,O),Types), @@ -198,7 +222,7 @@ output_typeinfo(_,_). % tables require access to the table info. special_formats(C,"e") :- !, - format(C,' if (pp == _nstop || op == _copy_idb_term || op == _unify_idb_term) return;~n',[]). + format(C,' if (op == _Nstop || op == _copy_idb_term || op == _unify_idb_term) return;~n',[]). special_formats(C,"l") :- !, format(C,' if (op == _Ystop) return;~n',[]). special_formats(C,"sssl") :- !, @@ -252,6 +276,7 @@ get_op(0'D,"DBGroundTerm"). get_op(0'f,"Func"). get_op(0'F,"ExternalFunction"). get_op(0'i,"IntegerInCode"). +get_op(0'j,"JITCode"). get_op(0'I,"PtoLUIndex"). get_op(0'l,"PtoOp"). get_op(0'L,"PtoLUClause"). @@ -698,7 +723,7 @@ dump_head_action(logical, _, _, L) :- CELL *pt = RepAppl(t); clause->Tag = AbsAppl((CELL *)pt[0]); - if (IsExtensionFunctor(FunctorOfTerm(t))) { + if (IsExtensionFunctor(FunctorOfTerm(t))) { clause->ucd.t_ptr = t; } else { clause->ucd.c_sreg = pt; @@ -718,15 +743,31 @@ dump_head_action(logical, _, _, L) :- /* or_last requires special handling */ footer(W) :- format(W,' /* this instruction is hardwired */~n',[]), - format(W,'#ifdef YAPOR~n',[]), - format(W,' OPCODE(~s~36+,~s)~n',["or_last","sblp"]), + format(W,' /* or_last must be the last instruction. */~n',[]), + format(W,'#ifdef YAP_JIT~n',[]), + format(W,'#ifdef YAPOR~n',[]), + format(W,' OPCODE(~s~36+,~s),~n',["traced_or_last","sblp"]), format(W,'#else~n',[]), - format(W,' OPCODE(~s~36+,~s)~n',["or_last","p"]), - format(W,'#endif~n',[]). + format(W,' OPCODE(~s~36+,~s),~n',["traced_or_last","p"]), + format(W,'#endif~n',[]), + format(W,'#endif~n',[]), + format(W,'#ifdef YAPOR~n',[]), + format(W,' OPCODE(~s~36+,~s),~n',["or_last","sblp"]), + format(W,'#else~n',[]), + format(W,' OPCODE(~s~36+,~s),~n',["or_last","p"]), + format(W,'#endif~n',[]). footer_rclause(W) :- format(W,' /* this instruction is hardwired */~n',[]), + format(W,'#ifdef YAP_JIT~n',[]), + dump_ops(W,["traced_or_last"]), + format(W,'#ifdef YAPOR~n',[]), + output_typeinfo(W,"Osblp"), + format(W,'#else~n',[]), + output_typeinfo(W,"p"), + format(W,'#endif~n',[]), + format(W,'#endif~n',[]), dump_ops(W,["or_last"]), format(W,'#ifdef YAPOR~n',[]), output_typeinfo(W,"Osblp"), @@ -740,13 +781,21 @@ footer_rclause(W) :- footer_walk_clause(W) :- format(W,' /* this instruction is hardwired */~n',[]), - dump_ops(W,["or_last"]), + format(W,'#ifdef YAP_JIT~n',[]), + dump_ops(W,["traced_or_last"]), + format(W,'#ifdef YAPOR~n',[]), + add_pp(W,"Osblp","p0"), + format(W,'#else~n',[]), + add_pp(W,"p","p"), + format(W,'#endif~n',[]), + format(W,'#endif~n',[]), + dump_ops(W,["or_last"]), format(W,'#ifdef YAPOR~n',[]), add_pp(W,"Osblp","p0"), format(W,'#else~n',[]), add_pp(W,"p","p"), format(W,'#endif~n',[]), - format(W,' } + format(W,' } } ',[]). @@ -784,7 +833,7 @@ read_field_by_field(A) :- split(L," ",Statement), read_field_by_field(A,Statement). -read_field_by_field(_,["}","u;"]) :- !. +read_field_by_field(_,["}","y_u;"]) :- !. read_field_by_field(A,["struct","{"]) :- !, read_fields(A,Fields,Type), assert(tinfo(Type,Fields)), @@ -813,6 +862,12 @@ read_fields(A,Fields,Type) :- retract(qual(_)), assert(qual(If)), read_fields(A,Fields,Type) + ; + Statements = ["#if",If] + -> + retract(qual(_)), + assert(qual(If)), + read_fields(A,Fields,Type) ; Statements = ["#endif"|_] -> @@ -1141,7 +1196,7 @@ opinfo("retry_eam",[body]). opinfo("alloc_for_logical_pred",[body]). opinfo("deallocate",[body]). opinfo("table_try_single",[]). -opinfo("native_me",[]). +opinfo("jit_handler",[]). output_save_clause(S) :- setof(T,O^op(T,O),Types), @@ -1151,7 +1206,7 @@ output_save_clause(S) :- output_save_clause(_). output_save_type(S, T) :- -(T=="e" -> start_low_level_trace; true), +%(T=="e" -> start_low_level_trace; true), format(S,' /* instructions type ~s */~n',[T]), setof(Op,op(T,Op),Ops), dump_ops(S,Ops), diff --git a/misc/sysgraph b/misc/sysgraph index 6f627e0db..65f5528a5 100755 --- a/misc/sysgraph +++ b/misc/sysgraph @@ -1,4 +1,4 @@ -#!/usr/local/bin/yap -L -- * +x#!/usr/local/bin/yap -L -- * #. @@ -53,31 +53,18 @@ main :- init, fail. main :- - unix(argv([D])), - working_directory(_, D), - fail. + unix(argv([D])), + load( D/['C'-prolog, + 'os'-prolog, + 'pl'-prolog, + 'OPTYap'-prolog, + 'library'-user, + 'swi/console'-prolog, + 'swi/library'-user, + 'packages'-user + ]), + fail. main :- - % from libraries outside the current directories - assert( node( attributes, woken_att_do/4, 'library/atts.yap', prolog ) ), - fail. -main :- - Dirs = ['C'-prolog, - 'os'-prolog, - 'pl'-prolog, - 'OPTYap'-prolog, - 'library'-user, - 'swi/console'-prolog, - 'swi/library'-user, - 'packages'-user], - dirs( Dirs ), - %%% phase 1: find modules - nb_setval( current_module, user ), - nb_setval( private, false ), - nb_setval( file_entry, user:user ), - init_loop( Dirs ), - maplist( pl_interfs, Dirs ), - %%% phase 2: find C-code predicates - maplist( c_preds, Dirs ), %%% phase 4: construct graph retractall( consulted(_,_) ), % maplist( pl_graphs, Dirs ), @@ -88,880 +75,36 @@ main :- mkdocs. -dirs( Roots ) :- - member( Root-_, Roots ), - absolute_file_name( Root, FRoot ), - rdir( FRoot ), - fail. -dirs( _Roots ). - -rdir( FRoot ) :- - directory_files( FRoot , Files), - member( File, Files ), - atom_concat( [FRoot,'/',File], New0 ), - absolute_file_name( New0, New ), - \+ doskip( New ), - ( - file_property( New, type(directory) ) - -> - File \= '.', - File \= '..', - File \= '.git', - rdir( New ) - ; - assert_new( dir( FRoot, File )) - ), - fail. -rdir(_). - init :- - retractall(dir(_)), - retractall(edge(_)), - retractall(private(_,_)), - retractall(public(_,_)), - retractall(undef(_,_)), - retractall(consulted(_,_)), - retractall(module_on(_,_,_)), - retractall(op_export(_,_,_)), - retractall(exported(_)), - retractall(do_comment(_,_,_,_,_)). + retractall(dir(_)), + retractall(edge(_)), + retractall(private(_,_)), + retractall(public(_,_)), + retractall(undef(_,_)), + retractall(consulted(_,_)), + retractall(module_on(_,_,_)), + retractall(op_export(_,_,_)), + retractall(exported(_)), + retractall(do_comment(_,_,_,_,_)). init :- - user_c_dep(A,B), - do_user_c_dep(A,B), - fail. + user_c_dep(A,B), + do_user_c_dep(A,B), + fail. init :- - user_skip(A), - do_user_skip(A), - fail. + user_skip(A), + do_user_skip(A), + fail. init :- - user_expand(N,A), - do_user_expand(N,A), - fail. + user_expand(N,A), + do_user_expand(N,A), + fail. init :- - catch( make_directory(tmp), _, fail), - fail. + catch( make_directory(tmp), _, fail), + fail. init. init_loop( _Dirs ). -c_preds(Dir - Mod) :- - atom( Dir ), - atom_concat([Dir,'/*'], Pattern), - expand_file_name( Pattern, Files ), - member( File0, Files ), - absolute_file_name( File0, File ), - ( ( sub_atom(File,_,_,0,'.c') - ; - sub_atom(File,_,_,0,'.i') - ; - sub_atom(File,_,_,0,'.C') - ; - sub_atom(File,_,_,0,'.cpp') - ; - sub_atom(File,_,_,0,'.icc') - ; - sub_atom(File,_,_,0,'.h') - ) -> - \+ doskip( File ), - c_file( File , Mod ) - ; - exists_directory( File ), - \+ atom_concat(_, '/.', File), - \+ atom_concat(_, '/..', File), - \+ doskip( File ), - c_preds( File - Mod ) - ), - fail. -c_preds(_). - - -c_file(F, _Mod) :- - consulted( F, _ ), - !. -c_file(F, Mod) :- -% writeln(F), - assert( consulted( F, Mod ) ), - nb_setval( current_module, Mod ), - open(F, read, S, [alias(c_file)]), - repeat, - read_line_to_string( S, String ), - ( String == end_of_file - -> - !, - close(S) - ; - sub_string(String, _, _, _, "PL_extension"), -%writeln(Fields), - c_ext(S, Mod, F), - fail - ; - split_string(String, ",; ()\t\"\'", Fields), %' -%writeln(Fields), - line_count(S, Lines), - c_line(Fields , Mod, F:Lines), - fail - ). - -c_line(["}"], Mod, _) :- !, - nb_setval( current_module, Mod ). -c_line(Line, _Mod, _) :- - append( _, [ "CurrentModule", "=", M|_], Line), - system_mod(M, _Mod, Mod, _), - nb_setval( current_module, Mod ). -c_line(Line, Mod, F: LineP) :- - break_line( Line, N/A, Fu), - assert( node( Mod, N/A, F-LineP, Fu ) ), - handle_pred( Mod, N, A, F ). - -c_ext( S, Mod, F ) :- - repeat, - read_line_to_string( S, String ), - ( - sub_string( String, _, _, _, "NULL" ), - ! - ; - split_string(String, ",; (){}\t\"\'", ["FRG", NS,AS,FS|_]), %' - atom_string(N,NS), - atom_string(Fu,FS), - number_string(A, AS), - stream_property( S, position( Pos ) ), - stream_position_data( line_count, Pos, Line ), - assert( node( Mod , N/A, F-Line, Fu ) ), - handle_pred( Mod, N, A, F ) - ; - split_string(String, ",; (){}\t\"\'", [NS,AS,FS|_]), %' - atom_string(N,NS), - atom_string(Fu,FS), - number_string(A, AS), - stream_property( S, position( Pos ) ), - stream_position_data( line_count, Pos, Line ), - Line0 is Line-1, - assert( node( Mod, N/A, F-Line0, Fu ) ), - handle_pred( Mod, N, A, F ) - ). - - -break_line( Line, N/A, c(Fu)) :- - take_line( Line, NS, AS, FS ), !, - atom_string(N,NS), - atom_string(Fu,FS), - number_string(A, AS). -break_line( Line, N/A, swi(Fu)) :- - take_line( Line, NS, AS, FS ), !, - atom_string(N,NS), - number_string(A, AS), - atomic_concat(["pl_",FS,"_",A,"_va"], Fu). -break_line( Line, N/A, bp(Fu)) :- - take_line( Line, NS, AS, FS ), !, - atom_string(N,NS), - number_string(A, AS), - atomic_concat(["pc_",FS,"_",A], Fu). -break_line( Line, N/A, c(FuE, FuB)) :- - take_line( Line, NS, AS, FSE, FSB ), !, - atom_string(N,NS), - atom_string(FuE,FSE), - atom_string(FuB,FSB), - number_string(A, AS). - -take_line( Line, NS, AS, FS ) :- - append( _, [ "Yap_InitCPred", NS, AS, FS|_], Line), !. -take_line( Line, NS, AS, FS ) :- - append( _, [ "Yap_InitAsmPred", NS, AS, _, FS|_], Line), !. -take_line( Line, NS, AS, FS ) :- - append( _, [ "Yap_InitCmpPred", NS, AS, FS|_], Line), !. -take_line( Line, NS, AS, FS ) :- - append( _, [ "Yap_InitCmpPred", NS, AS, FS|_], Line), !. -take_line( Line, NS, AS, FS ) :- - append( _, [ "YAP_UserCPredicate", NS, FS, AS|_], Line), !. -take_line( Line, NS, AS, FS ) :- - append( _, [ "PRED", NS0, AS, FS|_], Line), !, - append( ["pl_", NS0, AS, "_va"], NS ). -take_line( Line, NS, AS, FS ) :- - append( _, [ "PRED_IMPL", NS0, AS, FS|_], Line), !, - append( ["pl_", NS0, AS, "_va"], NS ). -take_line( Line, NS, AS, FS ) :- - append( _, [ "PL_register_foreign", NS, AS, FS|_], Line), !. -take_line( Line, NS, AS, FS ) :- - append( _, [ "PRED_DEF", NS0, AS, FS|_], Line), !, - append( ["pl_", NS0, AS, "_va"], NS ). -take_line( Line, NS, AS, FS ) :- - append( _, [ "FRG", NS, AS, FS|_], Line), !. -% from odbc -take_line( Line, NS, AS, FS ) :- - append( _, [ "NDET", NS, AS, FS|_], Line), !. -take_line( Line, NS, AS, FS ) :- - append( _, [ "DET", NS, AS, FS|_], Line), !. - - -take_line( Line, AS, FS ) :- - append( _, [ "REGISTER_CPRED", FS, AS], Line), !. - - -take_line( Line, NS, AS, FSE, FSB ) :- - append( _, [ "Yap_InitCPredBack", NS, AS, _, FSE, FSB|_], Line), !. - -system_mod("ATTRIBUTES_MODULE", _, attributes, user ). -system_mod("HACKS_MODULE", _, '$hacks' , sys ). -system_mod("USER_MODULE", _, user, user ). -system_mod("DBLOAD_MODULE", _, '$db_load', sys ). -system_mod("GLOBALS_MODULE", _, globals, sys ). -system_mod("ARG_MODULE", _, arg, sys ). -system_mod("PROLOG_MODULE", _ , prolog, sys ). -system_mod("RANGE_MODULE", _, range, user ). -system_mod("SWI_MODULE", _, swi, sys ). -system_mod("OPERATING_SYSTEM_MODULE", _, operating_system_support , sys ). -system_mod("TERMS_MODULE", _, terms , sys). -system_mod("SYSTEM_MODULE", _, system, sys ). -system_mod("IDB_MODULE", _, idb, user ). -system_mod("CHARSIO_MODULE", _, charsio, sys ). -system_mod("cm", M, M, user ). - -call_c_files( File, Mod, _Fun, [CFile] ) :- - search_file( CFile, File, c, F ), - c_file(F, Mod). -call_c_files( File, Mod, _Fun, CFile ) :- - CFile \= [_|_], - search_file( CFile, File, c, F ), - c_file(F, Mod). - - -pl_interfs(Dir - Mod) :- - \+ doskip( Dir ), - format('% ************* ~a\n', [Dir]), - nb_setval( current_module, Mod ), - atom( Dir ), - directory_files( Dir , Files), - member( File, Files ), - atom_concat([Dir,'/',File], Path), - ( ( sub_atom(File,_,_,0,'.yap') ; sub_atom(File,_,_,0,'.pl') ; sub_atom(File,_,_,0,'.ypp') ) -> - ops_restore, - absolute_file_name( Path, APath ), - pl_interf( APath , Mod ) - ; - exists_directory( Path ), - \+ atom_concat(_, '/.', Path), - \+ atom_concat(_, '/..', Path), - \+ atom_concat(_, '/.git', Path), - absolute_file_name( Path, APath ), - \+ doskip( APath ), - pl_interfs( APath - Mod ) - ), - fail. -pl_interfs(_). - -%% -% pl_interf( File, Mod) -% adds a node to the file graph and marks which files are modules -% -% main side-effect facts like edge( F0-Mod:File ) -% exported( ( FMNATarget :- FMNASource ) ) ou exported(F-M, Op ), -% module_on ( M, File ) -% -pl_interf(F, _Mod) :- - module_on( F , _M, _Is), - !. -pl_interf(F, Mod) :- - consulted(F, Mod ), - !. -pl_interf(F, Mod) :- -% ( sub_atom(F,_,_,_,'matrix.yap') -> spy get_interf ; true ), -% ( sub_atom( F, _, _, 0, 'gecode.yap' ) -> spy user_deps; true ), - assert_new(consulted(F, Mod ) ), - nb_getval( private, Default ), - nb_setval( private, false ), - nb_getval( file_entry, OF:OMod ), - nb_setval( file_entry, F:Mod ), - preprocess_file( F, PF ), - catch( open(PF, read, S, [scripting(true)]) , _, fail ), - repeat, - nb_getval( current_module, MR ), - %( sub_atom(F,_,_,_,'e.yap') -> spy get_interf ; nospyall ), - catch( read_term( S, T, [module( MR ),term_position(Pos)] ), Throw, (ypp(F,Throw), fail)), - ( - T == end_of_file - -> - !, - close(S), - ( - c_dep( F, Fc), - c_file( Fc, MR ), - fail - ; - build_graph( F, MR ), - fail - % cleanup - ; - module_on( F , _M, _Is) - -> - % also, close ops defined in the module M, if M \= Mod - nb_setval( current_module, Mod ), - nb_setval( private, Default ), - nb_setval( file_entry, OF:OMod ) - ; - true - ) - ; - nb_getval( current_module, MC0 ), - stream_position_data( line_count, Pos, Line ), - nb_setval( line, Line ), - ( Mod == prolog -> MC = prolog ; MC = MC0 ), - get_interf( T, F, MC ), - fail - ). - -get_interf( T, _F, _M0 ) :- - var(T), - !. -get_interf( T, _F, _M0 ) :- -% ( T = (:- op(_,_,_)) -> trace ; true ), - var(T), - !. -get_interf( M:T, F, _M0 ) :- !, - get_interf( T, F, M ). -get_interf( goal_expansion(G, M, _) , F, _M0 ) :- - nonvar( G ), - !, - ( var( M ) -> M1 = prolog ; M = M1 ), - functor( G, N, A ), - handle_pred( M1, N, A, F ). -get_interf( goal_expansion(G, _) , F, _M0 ) :- - nonvar( G ), - !, - functor( G, N, A ), - handle_pred( prolog, N, A, F ). -get_interf( ( M:H :- _B), F, _M ) :- - !, - get_interf( H, F, M ). -get_interf( ( goal_expansion(G, M, _) :- _) , F, _M0 ) :- - nonvar( G ), - !, - ( var( M ) -> M1 = prolog ; M = M1 ), - functor( G, N, A ), - handle_pred( M1, N, A, F ). -get_interf( ( goal_expansion(G, _) :- _) , F, _M0 ) :- - nonvar( G ), - !, - functor( G, N, A ), - handle_pred( prolog, N, A, F ). -get_interf( ( M:H --> _B), F, _ ) :- - !, - get_interf( ( H --> _B), F, M ). -get_interf( ( A, _ --> _B), F, M ) :- - get_interf( ( A --> _B), F, M ). -get_interf( (H --> _B), F, M ) :- - !, - functor( H, N, Ar), - Ar2 is Ar+2, - functor( H2, N, Ar2), - get_interf( H2, F, M ). -get_interf( (H :- _B), F, M ) :- - !, - get_interf( H, F, M ). -%% switches to new file n -get_interf( (:- V ), _F, _M ) :- - var( V ), - !. -get_interf( (:- module( NM, Is ) ), F, _M ) :- - !, - assert(module_file( F, NM ) ), - nb_setval( current_module, NM ), - assert( module_on( F , NM, Is) ), - maplist( public(F, NM), Is ), - nb_setval( private, true ). -get_interf( (:- reexport( Loc, Is ) ), F, M ) :- - !, - % find the file - search_file( Loc, F, pl, NF ), - include_files( F, M, Is, NF ), - % extend the interface.rg - retract( module_on( F , M, Is0) ), - append( Is0, Is, NIs ), - assert( module_on( F , M, NIs) ), - maplist( public(F, M), NIs ). -get_interf( (:- use_module( Loc, Is ) ), F, M ) :- !, - !, - include_files( F, M, Is, Loc ). -get_interf( (:- use_module( Loc ) ), F, M ) :- !, - !, - include_files( F, M, Loc ). -% nb_getval(current_module,MM), writeln(NM:MM:M). -get_interf( (:- use_module( Loc, Is, _ ) ), F, M ) :- !, - !, - include_files( F, M, Is, Loc ). -get_interf( (:- consult( Files ) ), F, M ) :- - !, - include_files( F, M, Files ). -get_interf( (:- reconsult( Files ) ), F, M ) :- - !, - include_files( F, M, Files ). -get_interf( (:- ensure_loaded( Files ) ), F, M ) :- - !, - include_files( F, M, Files ). -get_interf( (:- include( Files ) ), F, M ) :- - !, - source_files( F, M, Files ). -get_interf( (:- load_files( Files , [_|_] ) ), F, M ) :- - !, - include_files( F, M, Files ). -get_interf( ( :- ( G -> _ ; _ ) ) , F, M) :- - !, - get_interf( (:- G ) , F, M). -get_interf( (:- catch( G , _, _ ) ) , F, M) :- - !, - get_interf( (:- G ) , F, M). -get_interf( (:- initialization( G , now ) ) , F, M) :- - !, - get_interf( (:- G ) , F, M). -get_interf( (:- load_files( Files , [_|_] ) ), F, M ) :- - !, - include_files( F, M, Files ). -get_interf( (:- [F1|Fs] ), F, M ) :- - !, - include_files( F, M, [F1|Fs] ). -% don't actually use this one. -get_interf( (:- load_foreign_files(Fs, _, Fun) ), F, M ) :- - !, - call_c_files( F, M, Fun, Fs ). -get_interf( (:- load_foreign_library(F) ), F0, M ) :- - !, - always_strip_module(M:F, M1, F1), - call_c_files( F0, M1, '', F1 ). -get_interf( (:- load_foreign_library(F,Fun) ), F0, M ) :- - !, - always_strip_module(M:F, M1, F1), - call_c_files( F0, M1, Fun, F1 ). -get_interf( (:- use_foreign_library(F) ), F0, M ) :- - !, - always_strip_module(M:F, M1, F1), - call_c_files( F0, M1, '', F1 ). -get_interf( (:- system_module( _NM, _Publics, _Hiddens) ), _F, _M ) :- - !. -get_interf( (:- style_checker( _ ) ), _F, _M ) :- - !. -get_interf( (:- dynamic T), F, M ) :- - !, - declare_functors( T, F, M ). -get_interf( (:- multifile T), F, M ) :- % public? - !, - declare_functors( T, F, M ). -get_interf( (:- meta_predicate T), F, M ) :-!, - declare_terms( T, F, M ), % public? - !. -get_interf( (:- '$install_meta_predicate'( H, M) ), F, __M ) :- - !, - declare_functors( H, F, M ). -get_interf( (:- thread_local T), F, M ) :- - !, - declare_functors( T, F, M ). -get_interf( (:- op( X, Y, Z) ), F, M ) :- - !, - always_strip_module(M:Z, M1, Z1), - handle_op( F, M1, op( X, Y, Z1) ). -get_interf( (:- record( Records ) ), F, M ) :- - !, - handle_record( Records, F, M). -get_interf( (:- set_prolog_flag(dollar_as_lower_case,On) ), _F, _M ) :- - !, - set_prolog_flag(dollar_as_lower_case,On). -get_interf( (:- _ ), _F, _M ) :- !. -get_interf( (?- _ ), _F, _M ) :- !. -get_interf( V , _F, _M ) :- - var( V ), - !, - error( instantiation_error ). -get_interf( G , F, M ) :- - functor( G, N, A), - handle_pred( M, N, A, F ), - !. - -% support SWI package record -handle_record( (Records1, Records2), F, M ) :- - !, - handle_record( Records1, F, M ), - handle_record( Records2, F, M ). -handle_record( Record, F, M ) :- - Record =.. [Constructor|Fields], - atom_concat(Constructor, '_data', Data), - handle_pred( M, Data, 3, F), - atom_concat(default_, Constructor, New), - handle_pred( M, New, 1, F), - atom_concat(is_, Constructor, Is), - handle_pred( M, Is, 1, F), - atom_concat(make_, Constructor, Make), - handle_pred( M, Make, 2, F), - handle_pred( M, Make, 3, F), - atom_concat([set_, Constructor,'_fields'], Sets), - handle_pred( M, Sets, 3, F), - handle_pred( M, Sets, 4, F), - atom_concat([set_, Constructor,'_field'], Set), - handle_pred( M, Set, 3, F), - maplist( handle_record_field( Constructor, F, M) , Fields ). - -handle_record_field( Constructor, F, M, Name:_=_ ) :- - !, - handle_record_field_name( Constructor, F, M, Name). -handle_record_field( Constructor, F, M, Name:_ ) :- - !, - handle_record_field_name( Constructor, F, M, Name). -handle_record_field( Constructor, F, M, Name=_ ) :- - !, - handle_record_field_name( Constructor, F, M, Name). -handle_record_field( Constructor, F, M, Name ) :- - handle_record_field_name( Constructor, F, M, Name). - -handle_record_field_name( Constructor, F, M, Name) :- - atom_concat([ Constructor,'_', Name], Val), - handle_pred( M, Val, 2, F), - atom_concat([ set_, Name, '_of_', Constructor ], Set), - handle_pred( M, Set, 3, F), - handle_pred( M, Set, 2, F), - atom_concat([ nb_set_, Name, '_of_', Constructor ], Set), - handle_pred( M, Set, 3, F), - handle_pred( M, Set, 2, F). - -handle_pred( M, N, A, F ) :- - ( - system_mod( _, _, M, sys ) - -> - ( - atom_concat('$',_,N) - -> - private( F, M, N/A ) - ; - public( F, M, N/A ) - ) - ; - ( nb_getval( private, false ) - -> - public( F, M, N/A ) - ; - private( F, M, N/A ) - ) - ). - -handle_op( F, M, Op ) :- - ( nb_getval( private, false ) - -> - public( F, M, Op ) - ; - private( F, M, Op ) - ), - Op = op(X, Y, Z ), - ( ( M == user ; M == prolog ) - -> - op( X, Y, prolog:Z ) - ; - op( X, Y, M:Z ) - ). - -exported( NF, F, NM, M, op(X,Y,Z)) :- - !, - public( NF , NM:op(X,Y,Z) ), - handle_op( F, M , op(X,Y,Z) ). -exported( NF, F, NM, M, N/A) :- !, - % sink no more - retractall( exported(( _ :- F-M:N/A) ) ), - assert_new( exported( (F-M:N/A :- NF-NM:N/A )) ). -exported( NF, F, NM, M, N/A as NN) :- !, - % sink no more - retractall( exported(( _ :- F-M:N/A) ) ), - assert_new( exported( ( F-M:NN/A :- NF-NM:N/A ) ) ). -exported( NF, F, NM, M, N//A) :- !, - A2 is A+2, - % sink no more - retractall( exported(( _ :- F-M:N/A2) ) ), - assert_new( exported( (F-M:N/A2 :- NF-NM:N/A2) ) ). -exported( NF, F, NM, M, N//A as NN) :- !, - A2 is A+2, - % sink no more - retractall( exported(( _ :- F-M:N/A2) ) ), - assert_new( exported( ( F-M:NN/A2 :- NF-NM:N/A2 )) ). - -import_publics( F, ProducerMod, ConsumerMod ) :- - public(F, ProducerMod:op(X,Y,Z) ), - handle_op( F, ConsumerMod, op(X,Y,Z) ), - fail. -import_publics( _F, _ProducerMod, _ConsumerMod ). - -all_imported( ProducerFile, ConsumerFile, ProducerMod, ConsumerMod ) :- - public(ProducerFile, ProducerMod:op(X,Y,Z) ), - handle_op( ConsumerFile, ConsumerMod, op(X,Y,Z) ), - fail. -all_imported( ProducerFile, ConsumerFile, ProducerMod, ConsumerMod ) :- - public(ProducerFile, ProducerMod:N/A ), - exported( ProducerFile, ConsumerFile, ProducerMod, ConsumerMod, N/A ), - fail. -all_imported( _ProducerFile, _ConsumerFile, _ProducerMod, _ConsumerMod ). - - -include_files( F, M, Files ) :- - include_files( F, M, _Is, Files ). - -include_files( F, M, Is, Files ) :- - maplist( include_files( F, M, Is ), Files ), - !. -include_files( F, M, Is, -Files ) :- - !, - include_files( F, M, Is, Files). -include_files( F, M, Is, Files ) :- - !, - always_strip_module(M:Files, M1, NFiles), - include_file( F, M1, Is, NFiles ). -include_files( F, M, Is, Loc ) :- - include_file( F, M, Is, Loc ). - -include_file( F, M, Is, Loc ) :- - is_list( Loc ), !, - maplist( include_file( F, M, Is), Loc ). -include_file( F, M, Is0, Loc ) :- - nb_getval( private, Private ), - % find the file - once( search_file( Loc, F, pl, NF ) ), - % depth visit - pl_interf(NF, M), % should verify Is in _Is - % link b - ( module_on(NF, NM, Is) - -> - ( var(Is0) -> Is = Is0 ; true ), - maplist( exported( NF, F, NM, M) , Is0 ) - ; - all_imported( NF, F, NM, M) - ), - nb_setval( private, Private ). - - -source_files( F, M, Files ) :- - maplist( source_files( F, M ), Files ), - !. -source_files( F, M, Loc ) :- - source_file( F, M, Loc ). - -source_file( F, M, Loc ) :- - once( search_file( Loc, F, pl, NF ) ), - % depth visit - pl_source(NF, F, M). % should verify Is in _Is - -pl_source(F, F0, Mod) :- -% writeln( -F ), - preprocess_file( F, PF ), - catch( open(PF, read, S, []) , _, fail ), - repeat, - nb_getval( current_module, MR ), - %( sub_atom(F,_,_,_,'examples/matrix.yap') -> spy get_interf ; nospyall ), - catch( read_term( S, T, [module( MR ),term_position(Pos)] ), Throw, (writeln(F:MR:Throw), break, fail)), - ( - T == end_of_file - -> - !, - close(S) - ; - nb_getval( current_module, MC0 ), - stream_position_data( line_count, Pos, Line ), - nb_setval( line, Line ), - ( Mod == prolog -> MC = prolog ; MC = MC0 ), - get_interf( T, F0, MC ), - fail - ). - -declare_functors( T, _F, _M1) :- var(T), !, - error( unbound_variable ). -declare_functors( M:T, F, _M1) :- !, - declare_functors( T, F, M). -declare_functors( (T1,T2), F, M1) :- !, - declare_functors( T1, F, M1), - declare_functors( T2, F, M1). -declare_functors( Ts, F, M1) :- - maplist( declare_functor( F, M1), Ts ), !. -declare_functors( T, F, M1) :- - declare_functor( F, M1, T). - -declare_functor(File, M, N/A) :- - handle_pred( M, N, A, File ). - -declare_terms( T, _F, _M1) :- var(T), !, - error( unbound_variable ). -declare_terms( M:T, F, _M1) :- !, - declare_functors( T, F, M). -declare_terms( (N1,N2), F, M) :- - number(N1), - number(N2), - !, - declare_term( F, M, (N1,N2)). -declare_terms( (T1,T2), F, M1) :- !, - declare_terms( T1, F, M1), - declare_terms( T2, F, M1). -declare_terms( Ts, F, M1) :- - maplist( declare_term( F, M1), Ts ), !. -declare_terms( T, F, M1) :- - declare_term( F, M1, T). - -declare_term(F, M, S) :- - functor(S, N, A), - handle_pred( M, N, A, F ). - -pl_graphs(Dir - Mod) :- - format(' ************* GRAPH: ~a ***********************~n', [Dir]), - atom( Dir ), - atom_concat([Dir,'/*'], Pattern), - expand_file_name( Pattern, Files ), - member( File, Files ), - ( ( sub_atom(File,_,_,0,'.yap') ; sub_atom(File,_,_,0,'.pl') ) -> - build_graph( File , Mod ) - ; - exists_directory( File ), - \+ atom_concat(_, '/.', File), - \+ atom_concat(_, '/..', File), - \+ atom_concat(_, '/.git', File), - pl_graphs( File - Mod ) - ), - fail. -pl_graphs(_). - -%% -% pl_graph( File, Mod) -% adds a node to the file graph and marks which files are modules -% -% main side-effect facts like edge( F0-Mod:File ) -% exported( F-M , N/A ) ou exported(F- M. Op ), -% module_on ( M, File ) -% pred ( M :N/A ) -% -build_graph(F, Mod) :- -% writeln(F), - preprocess_file( F, PF ), - catch( open(PF, read, S, [scripting(true)]), _, fail ), - repeat, - nb_getval( current_module, MR ), - catch(read_term( S, T, [term_position(Pos),module(MR),comments(Cs)] ), Throw, (writeln(Throw))), - ( - T == end_of_file - -> - !, - % also, clo ops defined in the module M, if M \= Mod -% ( sub_atom(F,_,_,_,'/matrix.yap') -> start_low_level_trace ; nospyall ), - close(S) - ; - stream_position_data( line_count, Pos, Line ), - maplist( comment, Cs ), - nb_setval( line, Line ), - nb_getval( current_module, MC0 ), - ( Mod == prolog -> MC = prolog ; MC = MC0 ), - get_graph( T, F, Pos, MC ), - fail - ). - - -get_graph( V , _F, _Pos, _M ) :- - var( V ), - !, - error( instantiation_error ). -get_graph( T, _F, _Pos, _M0 ) :- - var(T), - !. -get_graph( M:T, F, _Pos, _M0 ) :- !, - get_graph( T, F, _Pos, M ). -get_graph( ( M:H :- B), F, _Pos, M0 ) :- - !, - get_graph( (H :- M0:B), F, _Pos, M ). -get_graph( ( M:H --> B), F, _Pos, M0 ) :- - !, - get_graph( ( H --> M0:B), F, _Pos, M ). -get_graph( ( A, _ --> B), F, _Pos, M ) :- - get_graph( ( A --> B), F, _Pos, M ). -get_graph( (H --> B), F, _Pos, M ) :- - !, - functor( H, N, Ar), - Ar2 is Ar+2, - add_deps( B, M, M:N/Ar2, F, _Pos, 2 ). -get_graph( (H :- B), F, _Pos, M ) :- - !, - functor( H, N, Ar), - add_deps( B, M, M:N/Ar, F, _Pos, 0 ). -%% switches to new file n -get_graph( (:-include( Fs ) ), F, _Pos, M ) :- - !, - source_graphs( M, F, Fs ). -get_graph( (?- _ ), _F, _Pos, _M ) :- !. -get_graph( (:- _ ), _F, _Pos, _M ) :- !. - -source_graphs( M, F, Fs ) :- - maplist( source_graph( M, F ), Fs ), !. -source_graphs( M, F, Fs ) :- - search_file( Fs, F, pl, NF ), - build_graph( NF , M ), !. - -add_deps(V, _M, _P, _F, _Pos, _) :- - var(V), !. -add_deps(M1:G, _M, _P, _F, _Pos,L) :- - !, - always_strip_module(M1:G, M2, G2), - add_deps(G2, M2, _P, _F, _Pos, L). -add_deps((A,B), M, P, F, _Pos, L) :- - !, - add_deps(A, M, P, F, _Pos, L), - add_deps(B, M, P, F, _Pos, L). -add_deps((A;B), M, P, F, _Pos, L) :- !, - add_deps(A, M, P, F, _Pos, L), - add_deps(B, M, P, F, _Pos, L). -add_deps((A|B), M, P, F, _Pos, L) :- !, - add_deps(A, M, P, F, _Pos, L), - add_deps(B, M, P, F, _Pos, L). -add_deps((A->B), M, P, F, _Pos, L) :- !, - add_deps(A, M, P, F, _Pos, L), - add_deps(B, M, P, F, _Pos, L). -add_deps((A*->B), M, P, F, _Pos, L) :- !, - add_deps(A, M, P, F, _Pos, L), - add_deps(B, M, P, F, _Pos, L). -add_deps(once(A), M, P, F, _Pos, L) :- !, - add_deps(A, M, P, F, _Pos, L). -add_deps({A}, M, P, F, _Pos, 2) :- !, - add_deps(A, M, P, F, _Pos, 0). -add_deps([_|_], M, P, F, Pos, 2) :- - !, - put_dep( (F-M:P :- prolog:'C'/3 ), Pos ). -add_deps(String, _M, _P, _F, _Pos, _) :- string(String), !. -add_deps([], _M, _P, _F, _Pos, 2) :- !. -add_deps(!, _M, _P, _F, _Pos, _) :- !. -add_deps(true, _M, _P, _F, _Pos, 0) :- !. -add_deps(false, _M, _P, _F, _Pos, 0) :- !. -add_deps(fail, _M, _P, _F, _Pos, 0) :- !. -add_deps(repeat, _M, _P, _F, _Pos, 0) :- !. -add_deps(A, M, P, F, Pos, L) :- - % we're home, M:N/Ar -> P=M1:N1/A1 - functor(A, N, Ar0), - Ar is Ar0+L, - put_dep( ( F-M:P :- F-M:N/Ar ), Pos ). - -put_dep( (Target :- F0-M:Goal ), Pos ) :- - exported( ( F0-M:Goal :- F1-M1:N/Ar ) ), !, - %follow ancestor chain - ancestor( ( F1-M1:N/Ar :- FA-MA:NA/Ar ) ), - put_dep( ( Target :- FA-MA:NA/Ar ), Pos ). -% the base case, copying from the same module ( but maybe not same file 0. -put_dep( ( Target :- _F-M:N/Ar ) , _ ) :- - m_exists(M:N/Ar, F0), - !, - assert_new( edge( ( Target :- F0-M:N/Ar ) ) ). -% prolog is visible ( but maybe not same file ). -put_dep( ( Target :- _F-_prolog:N/Ar ), _ ) :- - m_exists(prolog:N/Ar, F0), - !, - assert_new( edge( ( Target :- F0-prolog:N/Ar ) ) ). -put_dep( ( _Target :- _F-Mod:_N/_Ar ), _Pos) :- - var( Mod ), !. -put_dep( ( Target :- F-Mod:N/Ar ), Pos) :- - atom( Mod ), - stream_position_data( line_count, Pos, Line ), - assert_new( undef( (Target :- F-Mod:N/Ar ), Line) ). - -ancestor( ( Younger :- Older) ) :- - exported( ( Mid :- Older ) ), !, - ancestor( ( Younger :- Mid) ). -ancestor( (Older :- Older) ). - -m_exists(P, F) :- private( F, P ), !. -m_exists(P, F) :- public( F, P ). - doubles :- node(M, P, F-_, _), node(M1, P, F1-_, _), @@ -1344,7 +487,9 @@ mkdocs :- close( S2 ), open( 'tmp/groups', write, S3), close( S3 ), - open( 'docs/yapdocs.yap', read, S), + open( 'tmp/groups.yap', write, S4), + close( S4 ), + open( 'docs/yapdocs.yap', read, S), repeat, ( blanks(S, Comment, Rest) @@ -1410,7 +555,11 @@ store_comment(Comment) :- defgroup --> "/**", % */ - blanks, + blanks_or_stars, + "@defgroup". +defgroup --> + "%%", % */ + blanks_or_percs, "@defgroup". page --> @@ -1468,11 +617,22 @@ decl(I0, I) --> [_], decl( I0, I). -blanks --> " ", !, blanks. -blanks --> "\t", !, blanks. -blanks --> []. + skip_early_comment(C) --> + [C], !, + skip_early_comment(C). + skip_early_comment(C) --> + ( " " ; "\t" ; "\n" ), !, + skip_early_comment(C). + skip_early_comment(C) --> + "@" ( "{" ; "}" ), !, + skip_early_comment(C). + skip_early_comment(_) --> []. -atom([A|As]) --> + blanks --> " ", !, blanks. + blanks --> "\t", !, blanks. + blanks --> []. + + atom([A|As]) --> [A], { A >= "a", A =< "z" }, atom2( As ). diff --git a/packages/gecode/dev/Makefile b/packages/gecode/dev/Makefile deleted file mode 100644 index 4464bb185..000000000 --- a/packages/gecode/dev/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -all: - python code-generator.py - -clean: - -rm -f *~ *.pyc diff --git a/packages/gecode/dev/extractor/Makefile b/packages/gecode/dev/extractor/Makefile deleted file mode 100644 index e45782ddc..000000000 --- a/packages/gecode/dev/extractor/Makefile +++ /dev/null @@ -1,36 +0,0 @@ -GECODEDIR := $(shell g++ $(CPPFLAGS) $(CXXFLAGS) -H -E gecodedir.hh 2>&1 >/dev/null | grep gecode/kernel.hh | awk '{print $$2}' | sed 's|/kernel.hh||') -GECODECONFIG := $(GECODEDIR)/support/config.hpp -GECODEVERSION := $(shell cat $(GECODECONFIG) | egrep '\' | awk '{print $$3}' | sed 's/"//g') -PROTOTYPES = ../gecode-prototypes-$(GECODEVERSION).hh -ENUMS = ../gecode-enums-$(GECODEVERSION).py - -all: $(PROTOTYPES) $(ENUMS) - -$(PROTOTYPES): % : xml/namespaceGecode.xml extract-prototypes.xsl - cat notice.hh > $@ || { rm -f $@; exit 1; } - xsltproc extract-prototypes.xsl $< \ - | grep EXPORT \ - | grep -v Symmetry \ - | sed 's/Gecode:://g' \ - | sed 's/< //>/g' \ - | sed 's/ \&/\&/g' \ - | sed 's/, /,/g' \ - | sed 's/forceinline //g' \ - | sed 's/GECODE_INT_EXPORT //g' \ - | sed 's/GECODE_FLOAT_EXPORT //g' \ - | sed 's/GECODE_SET_EXPORT //g' \ - | grep -v '*' | sort >> $@ || { rm -f $@; exit 1; } - -$(ENUMS): % : xml/namespaceGecode.xml extract-enums.xsl - cat notice.py > $@ || { rm -f $@; exit 1; } - xsltproc extract-enums.xsl $< >> $@ || { rm -f $@; exit 1; } - -xml/namespaceGecode.xml: Doxyfile - doxygen Doxyfile - -Doxyfile: Doxyfile.in - cat $< | sed "s#@GECODEDIR@#$(GECODEDIR)#" > $@ || { rm -f $@; exit 1; } - -clean: - -rm -rf *~ gecode-prototypes-*.hh gecode-enums-*.py Doxyfile xml diff --git a/packages/odbc b/packages/odbc index 997245829..d0d1ee4d5 160000 --- a/packages/odbc +++ b/packages/odbc @@ -1 +1 @@ -Subproject commit 9972458293415b2d72276bd67875767bfeed00df +Subproject commit d0d1ee4d58373cc611676103e0a50a3ae451a023