diff --git a/C/absmi.c b/C/absmi.c index 1e289e806..6110b6a73 100644 --- a/C/absmi.c +++ b/C/absmi.c @@ -897,7 +897,7 @@ Yap_absmi(int inp) * Plain try - retry - trust instructions * *****************************************************************/ /* try_me Label,NArgs */ - Op(try_me, ld); + Op(try_me, apl); /* check if enough space between trail and codespace */ check_trail(TR); /* I use YREG =to go through the choicepoint. Usually YREG =is in a @@ -905,9 +905,9 @@ Yap_absmi(int inp) * new register to point at YREG =*/ CACHE_Y(YREG); /* store arguments for procedure */ - store_at_least_one_arg(PREG->u.ld.s); + store_at_least_one_arg(PREG->u.apl.s); /* store abstract machine registers */ - store_yaam_regs(PREG->u.ld.d, 0); + store_yaam_regs(PREG->u.apl.d, 0); /* On a try_me, set cut to point at previous choicepoint, * that is, to the B before the cut. */ @@ -919,17 +919,17 @@ Yap_absmi(int inp) #endif /* YAPOR */ SET_BB(B_YREG); ENDCACHE_Y(); - PREG = NEXTOP(PREG, ld); + PREG = NEXTOP(PREG, apl); GONext(); ENDOp(); /* retry_me Label,NArgs */ - Op(retry_me, ld); + Op(retry_me, apl); CACHE_Y(B); /* After retry, cut should be pointing at the parent * choicepoint for the current B */ - restore_yaam_regs(PREG->u.ld.d); - restore_at_least_one_arg(PREG->u.ld.s); + restore_yaam_regs(PREG->u.apl.d); + restore_at_least_one_arg(PREG->u.apl.s); #ifdef FROZEN_STACKS S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG); set_cut(S_YREG, B->cp_b); @@ -938,17 +938,17 @@ Yap_absmi(int inp) #endif /* FROZEN_STACKS */ SET_BB(B_YREG); ENDCACHE_Y(); - PREG = NEXTOP(PREG, ld); + PREG = NEXTOP(PREG, apl); GONext(); ENDOp(); /* trust_me UnusedLabel,NArgs */ - Op(trust_me, ld); + Op(trust_me, apl); CACHE_Y(B); #ifdef YAPOR if (SCH_top_shared_cp(B)) { SCH_last_alternative(PREG, B_YREG); - restore_at_least_one_arg(PREG->u.ld.s); + restore_at_least_one_arg(PREG->u.apl.s); #ifdef FROZEN_STACKS S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG); #endif /* FROZEN_STACKS */ @@ -958,7 +958,7 @@ Yap_absmi(int inp) #endif /* YAPOR */ { pop_yaam_regs(); - pop_at_least_one_arg(PREG->u.ld.s); + pop_at_least_one_arg(PREG->u.apl.s); /* After trust, cut should be pointing at the new top * choicepoint */ #ifdef FROZEN_STACKS @@ -966,7 +966,7 @@ Yap_absmi(int inp) #endif /* FROZEN_STACKS */ set_cut(S_YREG, B); } - PREG = NEXTOP(PREG, ld); + PREG = NEXTOP(PREG, apl); SET_BB(B_YREG); ENDCACHE_Y(); GONext(); @@ -1007,15 +1007,15 @@ Yap_absmi(int inp) ENDOp(); /* profiled_retry_me Label,NArgs */ - Op(profiled_retry_me, ld); + Op(profiled_retry_me, apl); CACHE_Y(B); /* After retry, cut should be pointing at the parent * choicepoint for the current B */ - LOCK(PREG->u.ld.p->StatisticsForPred.lock); - PREG->u.ld.p->StatisticsForPred.NOfRetries++; - UNLOCK(PREG->u.ld.p->StatisticsForPred.lock); - restore_yaam_regs(PREG->u.ld.d); - restore_args(PREG->u.ld.s); + LOCK(PREG->u.apl.p->StatisticsForPred.lock); + PREG->u.apl.p->StatisticsForPred.NOfRetries++; + UNLOCK(PREG->u.apl.p->StatisticsForPred.lock); + restore_yaam_regs(PREG->u.apl.d); + restore_args(PREG->u.apl.s); #ifdef FROZEN_STACKS S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG); set_cut(S_YREG, B->cp_b); @@ -1024,17 +1024,17 @@ Yap_absmi(int inp) #endif /* FROZEN_STACKS */ SET_BB(B_YREG); ENDCACHE_Y(); - PREG = NEXTOP(PREG, ld); + PREG = NEXTOP(PREG, apl); GONext(); ENDOp(); /* profiled_trust_me UnusedLabel,NArgs */ - Op(profiled_trust_me, ld); + Op(profiled_trust_me, apl); CACHE_Y(B); #ifdef YAPOR if (SCH_top_shared_cp(B)) { SCH_last_alternative(PREG, B_YREG); - restore_args(PREG->u.ld.s); + restore_args(PREG->u.apl.s); #ifdef FROZEN_STACKS S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG); #endif /* FROZEN_STACKS */ @@ -1044,7 +1044,7 @@ Yap_absmi(int inp) #endif /* YAPOR */ { pop_yaam_regs(); - pop_args(PREG->u.ld.s); + pop_args(PREG->u.apl.s); /* After trust, cut should be pointing at the new top * choicepoint */ #ifdef FROZEN_STACKS @@ -1054,31 +1054,31 @@ Yap_absmi(int inp) } SET_BB(B_YREG); ENDCACHE_Y(); - LOCK(PREG->u.ld.p->StatisticsForPred.lock); - PREG->u.ld.p->StatisticsForPred.NOfRetries++; - UNLOCK(PREG->u.ld.p->StatisticsForPred.lock); - PREG = NEXTOP(PREG, ld); + LOCK(PREG->u.apl.p->StatisticsForPred.lock); + PREG->u.apl.p->StatisticsForPred.NOfRetries++; + UNLOCK(PREG->u.apl.p->StatisticsForPred.lock); + PREG = NEXTOP(PREG, apl); GONext(); ENDOp(); - BOp(profiled_retry_logical, lld); + BOp(profiled_retry_logical, aLl); check_trail(TR); { UInt timestamp; CACHE_Y(B); - timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[PREG->u.lld.t.s]); - if (!VALID_TIMESTAMP(timestamp, PREG->u.lld.d)) { + timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[PREG->u.aLl.s]); + if (!VALID_TIMESTAMP(timestamp, PREG->u.aLl.d)) { /* jump to next instruction */ - PREG=PREG->u.lld.n; + PREG=PREG->u.aLl.n; JMPNext(); } - restore_yaam_regs(PREG->u.lld.n); - restore_args(PREG->u.lld.t.s); - LOCK(PREG->u.lld.d->ClPred->StatisticsForPred.lock); - PREG->u.lld.d->ClPred->StatisticsForPred.NOfRetries++; - UNLOCK(PREG->u.lld.d->ClPred->StatisticsForPred.lock); - PREG = PREG->u.lld.d->ClCode; + restore_yaam_regs(PREG->u.aLl.n); + restore_args(PREG->u.aLl.s); + LOCK(PREG->u.aLl.d->ClPred->StatisticsForPred.lock); + PREG->u.aLl.d->ClPred->StatisticsForPred.NOfRetries++; + UNLOCK(PREG->u.aLl.d->ClPred->StatisticsForPred.lock); + PREG = PREG->u.aLl.d->ClCode; #ifdef FROZEN_STACKS S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG); set_cut(S_YREG, B->cp_b); @@ -1091,12 +1091,12 @@ Yap_absmi(int inp) JMPNext(); ENDBOp(); - BOp(profiled_trust_logical, ld); + BOp(profiled_trust_logical, ILl); CACHE_Y(B); { - LogUpdIndex *cl = PREG->u.lld.t.block; + LogUpdIndex *cl = PREG->u.ILl.block; PredEntry *ap = cl->ClPred; - LogUpdClause *lcl = PREG->u.lld.d; + LogUpdClause *lcl = PREG->u.ILl.d; UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]); if (!VALID_TIMESTAMP(timestamp, lcl)) { @@ -1272,13 +1272,13 @@ Yap_absmi(int inp) ENDOp(); /* count_retry_me Label,NArgs */ - Op(count_retry_me, ld); + Op(count_retry_me, apl); CACHE_Y(B); /* After retry, cut should be pointing at the parent * choicepoint for the current B */ - LOCK(((PredEntry *)(PREG->u.ld.p))->StatisticsForPred.lock); - ((PredEntry *)(PREG->u.ld.p))->StatisticsForPred.NOfRetries++; - UNLOCK(((PredEntry *)(PREG->u.ld.p))->StatisticsForPred.lock); + LOCK(((PredEntry *)(PREG->u.apl.p))->StatisticsForPred.lock); + ((PredEntry *)(PREG->u.apl.p))->StatisticsForPred.NOfRetries++; + UNLOCK(((PredEntry *)(PREG->u.apl.p))->StatisticsForPred.lock); RetriesCounter--; if (RetriesCounter == 0 && RetriesCounterOn) { saveregs(); @@ -1293,8 +1293,8 @@ Yap_absmi(int inp) setregs(); JMPNext(); } - restore_yaam_regs(PREG->u.ld.d); - restore_args(PREG->u.ld.s); + restore_yaam_regs(PREG->u.apl.d); + restore_args(PREG->u.apl.s); #ifdef FROZEN_STACKS S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG); set_cut(S_YREG, B->cp_b); @@ -1303,17 +1303,17 @@ Yap_absmi(int inp) #endif /* FROZEN_STACKS */ SET_BB(B_YREG); ENDCACHE_Y(); - PREG = NEXTOP(PREG, ld); + PREG = NEXTOP(PREG, apl); GONext(); ENDOp(); /* count_trust_me UnusedLabel,NArgs */ - Op(count_trust_me, ld); + Op(count_trust_me, apl); CACHE_Y(B); #ifdef YAPOR if (SCH_top_shared_cp(B)) { SCH_last_alternative(PREG, B_YREG); - restore_args(PREG->u.ld.s); + restore_args(PREG->u.apl.s); #ifdef FROZEN_STACKS S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG); #endif /* FROZEN_STACKS */ @@ -1323,7 +1323,7 @@ Yap_absmi(int inp) #endif /* YAPOR */ { pop_yaam_regs(); - pop_args(PREG->u.ld.s); + pop_args(PREG->u.apl.s); /* After trust, cut should be pointing at the new top * choicepoint */ #ifdef FROZEN_STACKS @@ -1347,27 +1347,27 @@ Yap_absmi(int inp) setregs(); JMPNext(); } - LOCK(((PredEntry *)(PREG->u.ld.p))->StatisticsForPred.lock); - ((PredEntry *)(PREG->u.ld.p))->StatisticsForPred.NOfRetries++; - UNLOCK(((PredEntry *)(PREG->u.ld.p))->StatisticsForPred.lock); - PREG = NEXTOP(PREG, ld); + LOCK(((PredEntry *)(PREG->u.apl.p))->StatisticsForPred.lock); + ((PredEntry *)(PREG->u.apl.p))->StatisticsForPred.NOfRetries++; + UNLOCK(((PredEntry *)(PREG->u.apl.p))->StatisticsForPred.lock); + PREG = NEXTOP(PREG, apl); GONext(); ENDOp(); - BOp(count_retry_logical, lld); + BOp(count_retry_logical, aLl); check_trail(TR); { UInt timestamp; CACHE_Y(B); - timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[PREG->u.lld.t.s]); - if (!VALID_TIMESTAMP(timestamp, PREG->u.lld.d)) { + timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[PREG->u.aLl.s]); + if (!VALID_TIMESTAMP(timestamp, PREG->u.aLl.d)) { /* jump to next instruction */ - PREG=PREG->u.lld.n; + PREG=PREG->u.aLl.n; JMPNext(); } - restore_yaam_regs(PREG->u.lld.n); - restore_args(PREG->u.lld.t.s); + restore_yaam_regs(PREG->u.aLl.n); + restore_args(PREG->u.aLl.s); RetriesCounter--; if (RetriesCounter == 0) { saveregs(); @@ -1382,10 +1382,10 @@ Yap_absmi(int inp) setregs(); JMPNext(); } - LOCK(PREG->u.lld.d->ClPred->StatisticsForPred.lock); - PREG->u.lld.d->ClPred->StatisticsForPred.NOfRetries++; - UNLOCK(PREG->u.lld.d->ClPred->StatisticsForPred.lock); - PREG = PREG->u.lld.d->ClCode; + LOCK(PREG->u.aLl.d->ClPred->StatisticsForPred.lock); + PREG->u.aLl.d->ClPred->StatisticsForPred.NOfRetries++; + UNLOCK(PREG->u.aLl.d->ClPred->StatisticsForPred.lock); + PREG = PREG->u.aLl.d->ClCode; #ifdef FROZEN_STACKS S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG); set_cut(S_YREG, B->cp_b); @@ -1398,12 +1398,12 @@ Yap_absmi(int inp) JMPNext(); ENDBOp(); - BOp(count_trust_logical, ld); + BOp(count_trust_logical, ILl); CACHE_Y(B); { - LogUpdIndex *cl = PREG->u.lld.t.block; + LogUpdIndex *cl = PREG->u.ILl.block; PredEntry *ap = cl->ClPred; - LogUpdClause *lcl = PREG->u.lld.d; + LogUpdClause *lcl = PREG->u.ILl.d; UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]); if (!VALID_TIMESTAMP(timestamp, lcl)) { @@ -1548,14 +1548,14 @@ Yap_absmi(int inp) /* enter logical pred */ - BOp(alloc_for_logical_pred, EC); + BOp(alloc_for_logical_pred, L); check_trail(TR); /* say that an environment is using this clause */ /* we have our own copy for the clause */ #if defined(YAPOR) || defined(THREADS) { - LogUpdClause *cl = PREG->u.EC.ClBase; - PredEntry *ap = PREG->u.EC.p; + LogUpdClause *cl = PREG->u.L.ClBase; + PredEntry *ap = cl->ClPred; /* always add an extra reference */ INC_CLREF_COUNT(cl); @@ -1565,18 +1565,14 @@ Yap_absmi(int inp) } #else { - LogUpdClause *cl = (LogUpdClause *)PREG->u.EC.ClBase; + LogUpdClause *cl = (LogUpdClause *)PREG->u.L.ClBase; if (!(cl->ClFlags & InUseMask)) { - /* Clause *cl = (Clause *)PREG->u.EC.ClBase; - - PREG->u.EC.ClTrail = TR-(tr_fr_ptr)Yap_TrailBase; - PREG->u.EC.ClENV = LCL0-YENV;*/ cl->ClFlags |= InUseMask; TRAIL_CLREF(cl); } } #endif - PREG = NEXTOP(PREG, EC); + PREG = NEXTOP(PREG, L); GONext(); ENDBOp(); @@ -1712,48 +1708,48 @@ Yap_absmi(int inp) *****************************************************************/ /* spy_or_trymark */ - BOp(spy_or_trymark, ld); - LOCK(((PredEntry *)(PREG->u.ld.p))->PELock); - PREG = (yamop *)(&(((PredEntry *)(PREG->u.ld.p))->OpcodeOfPred)); - UNLOCK(((PredEntry *)(PREG->u.ld.p))->PELock); + BOp(spy_or_trymark, apl); + LOCK(((PredEntry *)(PREG->u.apl.p))->PELock); + PREG = (yamop *)(&(((PredEntry *)(PREG->u.apl.p))->OpcodeOfPred)); + UNLOCK(((PredEntry *)(PREG->u.apl.p))->PELock); goto dospy; ENDBOp(); /* try_and_mark Label,NArgs */ - BOp(try_and_mark, ld); + BOp(try_and_mark, apl); check_trail(TR); #if defined(YAPOR) || defined(THREADS) #ifdef YAPOR /* The flags I check here should never change during execution */ CUT_wait_leftmost(); #endif /* YAPOR */ - if (PREG->u.ld.p->PredFlags & LogUpdatePredFlag) { - LOCK(PREG->u.ld.p->PELock); - PP = PREG->u.ld.p; + if (PREG->u.apl.p->PredFlags & LogUpdatePredFlag) { + LOCK(PREG->u.apl.p->PELock); + PP = PREG->u.apl.p; } - if (PREG->u.ld.p->CodeOfPred != PREG) { + if (PREG->u.apl.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.ld.p->CodeOfPred; - UNLOCK(PREG->u.ld.p->PELock); + PREG = PREG->u.apl.p->CodeOfPred; + UNLOCK(PREG->u.apl.p->PELock); /* for profiler */ save_pc(); JMPNext(); } #endif CACHE_Y(YREG); - PREG = PREG->u.ld.d; + PREG = PREG->u.apl.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 */ - UNLOCK(((PredEntry *)(PREG->u.ld.p))->PELock); + UNLOCK(((PredEntry *)(PREG->u.apl.p))->PELock); BEGD(d1); - d1 = PREG->u.ld.s; + d1 = PREG->u.apl.s; store_args(d1); store_yaam_regs(PREG, 0); ENDD(d1); @@ -1775,12 +1771,12 @@ Yap_absmi(int inp) TRAIL_CLREF(ClauseCodeToDynamicClause(PREG)); } #endif - PREG = NEXTOP(PREG,ld); + PREG = NEXTOP(PREG,apl); JMPNext(); ENDBOp(); - BOp(count_retry_and_mark, ld); + BOp(count_retry_and_mark, apl); RetriesCounter--; if (RetriesCounter == 0) { saveregs(); @@ -1798,26 +1794,26 @@ Yap_absmi(int inp) /* enter a retry dynamic */ ENDBOp(); - BOp(profiled_retry_and_mark, ld); - LOCK(((PredEntry *)(PREG->u.ld.p))->StatisticsForPred.lock); - ((PredEntry *)(PREG->u.ld.p))->StatisticsForPred.NOfRetries++; - UNLOCK(((PredEntry *)(PREG->u.ld.p))->StatisticsForPred.lock); + BOp(profiled_retry_and_mark, apl); + LOCK(((PredEntry *)(PREG->u.apl.p))->StatisticsForPred.lock); + ((PredEntry *)(PREG->u.apl.p))->StatisticsForPred.NOfRetries++; + UNLOCK(((PredEntry *)(PREG->u.apl.p))->StatisticsForPred.lock); /* enter a retry dynamic */ ENDBOp(); /* retry_and_mark Label,NArgs */ - BOp(retry_and_mark, ld); + BOp(retry_and_mark, apl); #ifdef YAPOR CUT_wait_leftmost(); #endif /* YAPOR */ /* need to make the DB stable until I get the new clause */ - LOCK(PREG->u.ld.p->PELock); + LOCK(PREG->u.apl.p->PELock); CACHE_Y(B); - PREG = PREG->u.ld.d; + PREG = PREG->u.apl.d; LOCK(DynamicLock(PREG)); - UNLOCK(PREG->u.ld.p->PELock); + UNLOCK(PREG->u.apl.p->PELock); restore_yaam_regs(PREG); - restore_args(PREG->u.ld.s); + restore_args(PREG->u.apl.s); #ifdef FROZEN_STACKS S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG); set_cut(S_YREG, B->cp_b); @@ -1837,7 +1833,7 @@ Yap_absmi(int inp) TRAIL_CLREF(ClauseCodeToDynamicClause(PREG)); } #endif - PREG = NEXTOP(PREG,ld); + PREG = NEXTOP(PREG, apl); JMPNext(); ENDBOp(); @@ -1963,7 +1959,7 @@ Yap_absmi(int inp) break; case _retry_c: case _retry_userc: - low_level_trace(retry_pred, ipc->u.lds.p, B->cp_args); + low_level_trace(retry_pred, ipc->u.apFs.p, B->cp_args); break; case _retry_profiled: case _count_retry: @@ -1980,7 +1976,7 @@ Yap_absmi(int inp) case _profiled_retry_and_mark: case _retry: case _trust: - low_level_trace(retry_pred, ipc->u.ld.p, B->cp_args); + low_level_trace(retry_pred, ipc->u.apl.p, B->cp_args); break; case _try_logical: case _retry_logical: @@ -1989,7 +1985,7 @@ Yap_absmi(int inp) case _trust_logical: case _profiled_trust_logical: case _count_trust_logical: - low_level_trace(retry_pred, ipc->u.lld.d->ClPred, B->cp_args); + low_level_trace(retry_pred, ipc->u.ILl.d->ClPred, B->cp_args); break; case _Nstop: case _Ystop: @@ -2362,7 +2358,7 @@ Yap_absmi(int inp) do_commit_b_x: #endif /* skip a void call and a label */ - PREG = NEXTOP(NEXTOP(NEXTOP(PREG, x),sla),l); + PREG = NEXTOP(NEXTOP(NEXTOP(PREG, x),sbpp),l); { choiceptr pt0; #if defined(SBA) && defined(FROZEN_STACKS) @@ -2408,7 +2404,7 @@ Yap_absmi(int inp) ENDCACHE_Y_AS_ENV(); do_commit_b_y: #endif - PREG = NEXTOP(NEXTOP(NEXTOP(PREG, y),sla),l); + PREG = NEXTOP(NEXTOP(NEXTOP(PREG, y),sbpp),l); { choiceptr pt0; #if defined(SBA) && defined(FROZEN_STACKS) @@ -2564,7 +2560,7 @@ Yap_absmi(int inp) ENDCACHE_Y_AS_ENV(); ENDBOp(); - BOp(fcall, sla); + BOp(fcall, sbpp); CACHE_Y_AS_ENV(YREG); ENV_YREG[E_CP] = (CELL) CPREG; ENV_YREG[E_E] = (CELL) ENV; @@ -2574,24 +2570,24 @@ Yap_absmi(int inp) ENDCACHE_Y_AS_ENV(); ENDBOp(); - BOp(call, sla); + BOp(call, sbpp); #ifdef LOW_LEVEL_TRACER if (Yap_do_low_level_trace) { - low_level_trace(enter_pred,PREG->u.sla.sla_u.p,XREGS+1); + low_level_trace(enter_pred,PREG->u.sbpp.p,XREGS+1); } #endif /* LOW_LEVEL_TRACER */ CACHE_Y_AS_ENV(YREG); { PredEntry *pt; - pt = PREG->u.sla.sla_u.p; + pt = PREG->u.sbpp.p; CACHE_A1(); #ifndef NO_CHECKING check_stack(NoStackCall, H); #endif ENV = ENV_YREG; /* Try to preserve the environment */ - ENV_YREG = (CELL *) (((char *) ENV_YREG) + PREG->u.sla.s); - CPREG = NEXTOP(PREG, sla); + ENV_YREG = (CELL *) (((char *) ENV_YREG) + PREG->u.sbpp.s); + CPREG = NEXTOP(PREG, sbpp); ALWAYS_LOOKAHEAD(pt->OpcodeOfPred); PREG = pt->CodeOfPred; /* for profiler */ @@ -2635,14 +2631,14 @@ Yap_absmi(int inp) NoStackCall: /* on X86 machines S will not actually be holding the pointer to pred */ if (ActiveSignals & YAP_CREEP_SIGNAL) { - PredEntry *ap = PREG->u.sla.sla_u.p; + PredEntry *ap = PREG->u.sbpp.p; if (ap->PredFlags & HiddenPredFlag) { CACHE_Y_AS_ENV(YREG); CACHE_A1(); ENV = ENV_YREG; /* Try to preserve the environment */ - ENV_YREG = (CELL *) (((char *) YREG) + PREG->u.sla.s); - CPREG = NEXTOP(PREG, sla); + ENV_YREG = (CELL *) (((char *) YREG) + PREG->u.sbpp.s); + CPREG = NEXTOP(PREG, sbpp); ALWAYS_LOOKAHEAD(ap->OpcodeOfPred); PREG = ap->CodeOfPred; /* for profiler */ @@ -2676,9 +2672,9 @@ Yap_absmi(int inp) goto creepc; } } - SREG = (CELL *) PREG->u.sla.sla_u.p; + SREG = (CELL *) PREG->u.sbpp.p; if (ActiveSignals & YAP_CDOVF_SIGNAL) { - ASP = (CELL *) (((char *) YREG) + PREG->u.sla.s); + ASP = (CELL *) (((char *) YREG) + PREG->u.sbpp.s); if (ASP > (CELL *)PROTECT_FROZEN_B(B)) ASP = (CELL *)PROTECT_FROZEN_B(B); goto noheapleft; @@ -2686,11 +2682,11 @@ Yap_absmi(int inp) if (ActiveSignals) { goto creepc; } - ASP = (CELL *) (((char *) YREG) + PREG->u.sla.s); + ASP = (CELL *) (((char *) YREG) + PREG->u.sbpp.s); if (ASP > (CELL *)PROTECT_FROZEN_B(B)) ASP = (CELL *)PROTECT_FROZEN_B(B); saveregs(); - if (!Yap_gc(((PredEntry *)SREG)->ArityOfPE, YREG, NEXTOP(PREG, sla))) { + if (!Yap_gc(((PredEntry *)SREG)->ArityOfPE, YREG, NEXTOP(PREG, sbpp))) { Yap_Error(OUT_OF_STACK_ERROR,TermNil,Yap_ErrorMessage); } setregs(); @@ -2805,7 +2801,7 @@ Yap_absmi(int inp) /* find something to fool S */ SREG = (CELL *)RepPredProp(Yap_GetPredPropByFunc(Yap_MkFunctor(AtomRestoreRegs,1),0)); if (ActiveSignals & YAP_CDOVF_SIGNAL) { - ASP = (CELL *) (((char *) YREG) + PREG->u.sla.s); + ASP = (CELL *) (((char *) YREG) + PREG->u.sbpp.s); if (ASP > (CELL *)PROTECT_FROZEN_B(B)) ASP = (CELL *)PROTECT_FROZEN_B(B); goto noheapleft; @@ -2813,11 +2809,11 @@ Yap_absmi(int inp) if (ActiveSignals) { goto creep_either; } - ASP = (CELL *) (((char *) YREG) + PREG->u.sla.s); + ASP = (CELL *) (((char *) YREG) + PREG->u.sbpp.s); if (ASP > (CELL *)PROTECT_FROZEN_B(B)) ASP = (CELL *)PROTECT_FROZEN_B(B); saveregs(); - if (!Yap_gc(0, YREG, NEXTOP(PREG, sla))) { + if (!Yap_gc(0, YREG, NEXTOP(PREG, sbpp))) { Yap_Error(OUT_OF_STACK_ERROR,TermNil,Yap_ErrorMessage); } setregs(); @@ -2825,8 +2821,8 @@ Yap_absmi(int inp) creep_either: /* do creep in either */ ENV = YREG; - CPREG = NEXTOP(PREG, sla); - YREG = (CELL *) (((char *) YREG) + PREG->u.sla.s); + CPREG = NEXTOP(PREG, sbpp); + YREG = (CELL *) (((char *) YREG) + PREG->u.sbpp.s); #ifdef FROZEN_STACKS { choiceptr top_b = PROTECT_FROZEN_B(B); @@ -2851,8 +2847,8 @@ Yap_absmi(int inp) creepc: /* do creep in call */ ENV = YREG; - CPREG = NEXTOP(PREG, sla); - YREG = (CELL *) (((char *) YREG) + PREG->u.sla.s); + CPREG = NEXTOP(PREG, sbpp); + YREG = (CELL *) (((char *) YREG) + PREG->u.sbpp.s); #ifdef FROZEN_STACKS { choiceptr top_b = PROTECT_FROZEN_B(B); @@ -4016,26 +4012,26 @@ Yap_absmi(int inp) ENDD(d0); ENDOpRW(); - OpRW(get_struct, xf); + OpRW(get_struct, xfa); BEGD(d0); - d0 = XREG(PREG->u.xf.x); + d0 = XREG(PREG->u.xfa.x); deref_head(d0, gstruct_unk); gstruct_nonvar: if (!IsApplTerm(d0)) FAIL(); /* we have met a compound term */ - START_PREFETCH(xf); + START_PREFETCH(xfa); CACHE_S(); S_SREG = RepAppl(d0); /* check functor */ - d0 = (CELL) (PREG->u.xf.f); + d0 = (CELL) (PREG->u.xfa.f); if (*S_SREG != d0) { FAIL(); } WRITEBACK_S(S_SREG+1); ENDCACHE_S(); - PREG = NEXTOP(PREG, xf); + PREG = NEXTOP(PREG, xfa); /* enter read mode */ GONext(); END_PREFETCH(); @@ -4044,7 +4040,7 @@ Yap_absmi(int inp) deref_body(d0, pt0, gstruct_unk, gstruct_nonvar); /* Enter Write mode */ /* set d1 to be the new structure we are going to create */ - START_PREFETCH_W(xf); + START_PREFETCH_W(xfa); BEGD(d1); d1 = AbsAppl(H); BIND(pt0, d1, bind_gstruct); @@ -4060,10 +4056,10 @@ Yap_absmi(int inp) pt0 = H; ENDD(d1); /* first, put the functor */ - d0 = (CELL) (PREG->u.xf.f); + d0 = (CELL) (PREG->u.xfa.f); *pt0++ = d0; - H = pt0 + PREG->u.xf.a; - PREG = NEXTOP(PREG, xf); + H = pt0 + PREG->u.xfa.a; + PREG = NEXTOP(PREG, xfa); /* set SREG */ SREG = pt0; /* update H */ @@ -5062,13 +5058,6 @@ Yap_absmi(int inp) GONext(); ENDOp(); - OpW(unify_x_val_write, ox); - /* we are in write mode */ - *SREG++ = XREG(PREG->u.ox.x); - PREG = NEXTOP(PREG, ox); - GONextW(); - ENDOpW(); - /* We assume the value in X is pointing to an object in the * global stack */ Op(unify_x_val, ox); @@ -5149,12 +5138,12 @@ Yap_absmi(int inp) ENDD(d0); ENDOp(); - Op(unify_l_x_val_write, ox); + OpW(unify_x_val_write, ox); /* we are in write mode */ - SREG[0] = XREG(PREG->u.ox.x); + *SREG++ = XREG(PREG->u.ox.x); PREG = NEXTOP(PREG, ox); - GONext(); - ENDOp(); + GONextW(); + ENDOpW(); /* We assume the value in X is pointing to an object in the * global stack */ @@ -5231,20 +5220,12 @@ Yap_absmi(int inp) ENDD(d0); ENDOp(); - OpW(unify_y_val_write, oy); + Op(unify_l_x_val_write, ox); /* we are in write mode */ - BEGD(d0); - d0 = YREG[PREG->u.oy.y]; -#ifdef SBA - if (d0 == 0) /* free variable */ - *SREG++ = (CELL)(YREG+PREG->u.oy.y); - else -#endif - *SREG++ = d0; - ENDD(d0); - PREG = NEXTOP(PREG, oy); - GONextW(); - ENDOpW(); + SREG[0] = XREG(PREG->u.ox.x); + PREG = NEXTOP(PREG, ox); + GONext(); + ENDOp(); /* We assume the value in X is pointing to an object in the * global stack */ @@ -5327,20 +5308,20 @@ Yap_absmi(int inp) ENDD(d0); ENDOp(); - Op(unify_l_y_val_write, oy); + OpW(unify_y_val_write, oy); /* we are in write mode */ BEGD(d0); d0 = YREG[PREG->u.oy.y]; #ifdef SBA - if (d0 == 0) /* new variable */ - SREG[0] = (CELL)(YREG+PREG->u.oy.y); + if (d0 == 0) /* free variable */ + *SREG++ = (CELL)(YREG+PREG->u.oy.y); else #endif - SREG[0] = d0; + *SREG++ = d0; ENDD(d0); PREG = NEXTOP(PREG, oy); - GONext(); - ENDOp(); + GONextW(); + ENDOpW(); /* We assume the value in X is pointing to an object in the * global stack */ @@ -5421,39 +5402,20 @@ Yap_absmi(int inp) ENDD(d0); ENDOp(); - OpW(unify_x_loc_write, ox); + Op(unify_l_y_val_write, oy); /* we are in write mode */ BEGD(d0); - d0 = XREG(PREG->u.ox.x); - deref_head(d0, unify_x_loc_unk); - unify_x_loc_nonvar: - *SREG++ = d0; - PREG = NEXTOP(PREG, ox); - GONextW(); - - BEGP(pt0); - deref_body(d0, pt0, unify_x_loc_unk, unify_x_loc_nonvar); - /* move ahead in the instructions */ - PREG = NEXTOP(PREG, ox); - /* d0 is a variable, check whether we need to globalise it */ - if (pt0 < H) { - /* variable is global */ - *SREG++ = Unsigned(pt0); - GONextW(); - } - else { - /* bind our variable to the structure */ - CACHE_S(); - READ_IN_S(); - Bind_Local(pt0, Unsigned(S_SREG)); - RESET_VARIABLE(S_SREG); - WRITEBACK_S(S_SREG+1); - ENDCACHE_S(); - GONextW(); - } - ENDP(pt0); + d0 = YREG[PREG->u.oy.y]; +#ifdef SBA + if (d0 == 0) /* new variable */ + SREG[0] = (CELL)(YREG+PREG->u.oy.y); + else +#endif + SREG[0] = d0; ENDD(d0); - ENDOpW(); + PREG = NEXTOP(PREG, oy); + GONext(); + ENDOp(); /* In the next instructions, we do not know anything about * what is in X */ @@ -5537,30 +5499,35 @@ Yap_absmi(int inp) ENDD(d0); ENDOp(); - Op(unify_l_x_loc_write, ox); + OpW(unify_x_loc_write, ox); /* we are in write mode */ BEGD(d0); d0 = XREG(PREG->u.ox.x); - deref_head(d0, ulnify_x_loc_unk); - ulnify_x_loc_nonvar: - SREG[0] = d0; + deref_head(d0, unify_x_loc_unk); + unify_x_loc_nonvar: + *SREG++ = d0; PREG = NEXTOP(PREG, ox); - GONext(); + GONextW(); BEGP(pt0); - deref_body(d0, pt0, ulnify_x_loc_unk, ulnify_x_loc_nonvar); - /* d0 is a variable, check whether we need to globalise it */ + deref_body(d0, pt0, unify_x_loc_unk, unify_x_loc_nonvar); + /* move ahead in the instructions */ PREG = NEXTOP(PREG, ox); + /* d0 is a variable, check whether we need to globalise it */ if (pt0 < H) { /* variable is global */ - SREG[0] = Unsigned(pt0); - GONext(); + *SREG++ = Unsigned(pt0); + GONextW(); } else { - /* create a new Heap variable and bind our variable to it */ - Bind_Local(pt0, Unsigned(SREG)); - RESET_VARIABLE(SREG); - GONext(); + /* bind our variable to the structure */ + CACHE_S(); + READ_IN_S(); + Bind_Local(pt0, Unsigned(S_SREG)); + RESET_VARIABLE(S_SREG); + WRITEBACK_S(S_SREG+1); + ENDCACHE_S(); + GONextW(); } ENDP(pt0); ENDD(d0); @@ -5639,35 +5606,30 @@ Yap_absmi(int inp) ENDD(d0); ENDOp(); - OpW(unify_y_loc_write, oy); + Op(unify_l_x_loc_write, ox); /* we are in write mode */ BEGD(d0); - BEGP(pt0); - pt0 = YREG+PREG->u.oy.y; - d0 = *pt0; - deref_head(d0, unify_y_loc_unk); - unify_y_loc_nonvar: - *SREG++ = d0; - PREG = NEXTOP(PREG, oy); - GONextW(); + d0 = XREG(PREG->u.ox.x); + deref_head(d0, ulnify_x_loc_unk); + ulnify_x_loc_nonvar: + SREG[0] = d0; + PREG = NEXTOP(PREG, ox); + GONext(); - derefa_body(d0, pt0, unify_y_loc_unk, unify_y_loc_nonvar); + BEGP(pt0); + deref_body(d0, pt0, ulnify_x_loc_unk, ulnify_x_loc_nonvar); /* d0 is a variable, check whether we need to globalise it */ - PREG = NEXTOP(PREG, oy); + PREG = NEXTOP(PREG, ox); if (pt0 < H) { /* variable is global */ - *SREG++ = Unsigned(pt0); - GONextW(); + SREG[0] = Unsigned(pt0); + GONext(); } else { /* create a new Heap variable and bind our variable to it */ - CACHE_S(); - READ_IN_S(); - Bind_Local(pt0, Unsigned(S_SREG)); - RESET_VARIABLE(S_SREG); - WRITEBACK_S(S_SREG+1); - ENDCACHE_S(); - GONextW(); + Bind_Local(pt0, Unsigned(SREG)); + RESET_VARIABLE(SREG); + GONext(); } ENDP(pt0); ENDD(d0); @@ -5755,25 +5717,25 @@ Yap_absmi(int inp) ENDD(d0); ENDOp(); - Op(unify_l_y_loc_write, oy); + OpW(unify_y_loc_write, oy); /* we are in write mode */ BEGD(d0); BEGP(pt0); pt0 = YREG+PREG->u.oy.y; d0 = *pt0; - deref_head(d0, ulunify_y_loc_unk); - ulunify_y_loc_nonvar: - SREG[0] = d0; + deref_head(d0, unify_y_loc_unk); + unify_y_loc_nonvar: + *SREG++ = d0; PREG = NEXTOP(PREG, oy); - GONext(); + GONextW(); - derefa_body(d0, pt0, ulunify_y_loc_unk, ulunify_y_loc_nonvar); + derefa_body(d0, pt0, unify_y_loc_unk, unify_y_loc_nonvar); /* d0 is a variable, check whether we need to globalise it */ PREG = NEXTOP(PREG, oy); if (pt0 < H) { /* variable is global */ - SREG[0] = Unsigned(pt0); - GONext(); + *SREG++ = Unsigned(pt0); + GONextW(); } else { /* create a new Heap variable and bind our variable to it */ @@ -5781,12 +5743,13 @@ Yap_absmi(int inp) READ_IN_S(); Bind_Local(pt0, Unsigned(S_SREG)); RESET_VARIABLE(S_SREG); + WRITEBACK_S(S_SREG+1); ENDCACHE_S(); - GONext(); + GONextW(); } ENDP(pt0); ENDD(d0); - ENDOp(); + ENDOpW(); Op(unify_l_y_loc, oy); /* else we are in read mode */ @@ -5866,6 +5829,45 @@ Yap_absmi(int inp) ENDD(d0); ENDOp(); + Op(unify_l_y_loc_write, oy); + /* we are in write mode */ + BEGD(d0); + BEGP(pt0); + pt0 = YREG+PREG->u.oy.y; + d0 = *pt0; + deref_head(d0, ulunify_y_loc_unk); + ulunify_y_loc_nonvar: + SREG[0] = d0; + PREG = NEXTOP(PREG, oy); + GONext(); + + derefa_body(d0, pt0, ulunify_y_loc_unk, ulunify_y_loc_nonvar); + /* d0 is a variable, check whether we need to globalise it */ + PREG = NEXTOP(PREG, oy); + if (pt0 < H) { + /* variable is global */ + SREG[0] = Unsigned(pt0); + GONext(); + } + else { + /* create a new Heap variable and bind our variable to it */ + CACHE_S(); + READ_IN_S(); + Bind_Local(pt0, Unsigned(S_SREG)); + RESET_VARIABLE(S_SREG); + ENDCACHE_S(); + GONext(); + } + ENDP(pt0); + ENDD(d0); + ENDOp(); + + Op(unify_void, o); + SREG++; + PREG = NEXTOP(PREG, o); + GONext(); + ENDOp(); + OpW(unify_void_write, o); CACHE_S(); READ_IN_S(); @@ -5876,8 +5878,7 @@ Yap_absmi(int inp) GONextW(); ENDOpW(); - Op(unify_void, o); - SREG++; + Op(unify_l_void, o); PREG = NEXTOP(PREG, o); GONext(); ENDOp(); @@ -5888,8 +5889,9 @@ Yap_absmi(int inp) GONext(); ENDOp(); - Op(unify_l_void, o); - PREG = NEXTOP(PREG, o); + Op(unify_n_voids, os); + SREG += PREG->u.os.s; + PREG = NEXTOP(PREG, os); GONext(); ENDOp(); @@ -5909,8 +5911,7 @@ Yap_absmi(int inp) GONextW(); ENDOpW(); - Op(unify_n_voids, os); - SREG += PREG->u.os.s; + Op(unify_l_n_voids, os); PREG = NEXTOP(PREG, os); GONext(); ENDOp(); @@ -5930,29 +5931,6 @@ Yap_absmi(int inp) GONext(); ENDOp(); - Op(unify_l_n_voids, os); - PREG = NEXTOP(PREG, os); - GONext(); - ENDOp(); - - OpW(unify_atom_write, oc); - * SREG++ = PREG->u.oc.c; - PREG = NEXTOP(PREG, oc); - GONextW(); - ENDOpW(); - - OpW(unify_float_write, od); - * SREG++ = AbsAppl(PREG->u.od.d); - PREG = NEXTOP(PREG, od); - GONextW(); - ENDOpW(); - - OpW(unify_longint_write, oi); - * SREG++ = AbsAppl(PREG->u.oi.i); - PREG = NEXTOP(PREG, oi); - GONextW(); - ENDOpW(); - Op(unify_atom, oc); BEGD(d0); BEGP(pt0); @@ -5980,23 +5958,11 @@ Yap_absmi(int inp) ENDD(d0); ENDOp(); - Op(unify_l_float_write, od); - SREG[0] = AbsAppl(PREG->u.od.d); - PREG = NEXTOP(PREG, od); - GONext(); - ENDOp(); - - Op(unify_l_longint_write, oi); - SREG[0] = AbsAppl(PREG->u.oi.i); - PREG = NEXTOP(PREG, oi); - GONext(); - ENDOp(); - - Op(unify_l_atom_write, oc); - SREG[0] = PREG->u.oc.c; + OpW(unify_atom_write, oc); + * SREG++ = PREG->u.oc.c; PREG = NEXTOP(PREG, oc); - GONext(); - ENDOp(); + GONextW(); + ENDOpW(); Op(unify_l_atom, oc); BEGD(d0); @@ -6025,23 +5991,11 @@ Yap_absmi(int inp) ENDD(d0); ENDOp(); - OpW(unify_n_atoms_write, osc); - BEGD(d0); - BEGD(d1); - d0 = PREG->u.osc.s; - d1 = PREG->u.osc.c; - /* write N atoms */ - CACHE_S(); - READ_IN_S(); - PREG = NEXTOP(PREG, osc); - for (; d0 > 0; d0--) - *S_SREG++ = d1; - WRITEBACK_S(S_SREG); - ENDCACHE_S(); - ENDD(d1); - ENDD(d0); - GONextW(); - ENDOpW(); + Op(unify_l_atom_write, oc); + SREG[0] = PREG->u.oc.c; + PREG = NEXTOP(PREG, oc); + GONext(); + ENDOp(); Op(unify_n_atoms, osc); { @@ -6078,6 +6032,24 @@ Yap_absmi(int inp) GONext(); ENDOp(); + OpW(unify_n_atoms_write, osc); + BEGD(d0); + BEGD(d1); + d0 = PREG->u.osc.s; + d1 = PREG->u.osc.c; + /* write N atoms */ + CACHE_S(); + READ_IN_S(); + PREG = NEXTOP(PREG, osc); + for (; d0 > 0; d0--) + *S_SREG++ = d1; + WRITEBACK_S(S_SREG); + ENDCACHE_S(); + ENDD(d1); + ENDD(d0); + GONextW(); + ENDOpW(); + Op(unify_float, od); BEGD(d0); BEGP(pt0); @@ -6126,6 +6098,12 @@ Yap_absmi(int inp) ENDD(d0); ENDOp(); + OpW(unify_float_write, od); + * SREG++ = AbsAppl(PREG->u.od.d); + PREG = NEXTOP(PREG, od); + GONextW(); + ENDOpW(); + Op(unify_l_float, od); BEGD(d0); CACHE_S(); @@ -6173,6 +6151,12 @@ Yap_absmi(int inp) ENDD(d0); ENDOp(); + Op(unify_l_float_write, od); + SREG[0] = AbsAppl(PREG->u.od.d); + PREG = NEXTOP(PREG, od); + GONext(); + ENDOp(); + Op(unify_longint, oi); BEGD(d0); BEGP(pt0); @@ -6216,6 +6200,12 @@ Yap_absmi(int inp) ENDD(d0); ENDOp(); + OpW(unify_longint_write, oi); + * SREG++ = AbsAppl(PREG->u.oi.i); + PREG = NEXTOP(PREG, oi); + GONextW(); + ENDOpW(); + Op(unify_l_longint, oi); BEGD(d0); CACHE_S(); @@ -6258,6 +6248,12 @@ Yap_absmi(int inp) ENDD(d0); ENDOp(); + Op(unify_l_longint_write, oi); + SREG[0] = AbsAppl(PREG->u.oi.i); + PREG = NEXTOP(PREG, oi); + GONext(); + ENDOp(); + Op(unify_bigint, oc); #ifdef USE_GMP BEGD(d0); @@ -6409,24 +6405,6 @@ Yap_absmi(int inp) ENDD(d0); ENDOp(); - OpW(unify_list_write, o); - PREG = NEXTOP(PREG, o); - BEGD(d0); - d0 = AbsPair(H); - CACHE_S(); - READ_IN_S(); - SP -= 2; - SP[0] = WRITE_MODE; - SP[1] = Unsigned(S_SREG + 1); - S_SREG[0] = d0; - S_SREG = H; - H = S_SREG + 2; - WRITEBACK_S(S_SREG); - ENDCACHE_S(); - GONextW(); - ENDD(d0); - ENDOpW(); - OpRW(unify_list, o); *--SP = Unsigned(SREG + 1); *--SP = READ_MODE; @@ -6471,13 +6449,15 @@ Yap_absmi(int inp) ENDD(d0); ENDOpRW(); - OpW(unify_l_list_write, o); - /* we continue in write mode */ + OpW(unify_list_write, o); + PREG = NEXTOP(PREG, o); BEGD(d0); d0 = AbsPair(H); - PREG = NEXTOP(PREG, o); CACHE_S(); READ_IN_S(); + SP -= 2; + SP[0] = WRITE_MODE; + SP[1] = Unsigned(S_SREG + 1); S_SREG[0] = d0; S_SREG = H; H = S_SREG + 2; @@ -6528,34 +6508,30 @@ Yap_absmi(int inp) ENDD(d0); ENDOpRW(); - OpW(unify_struct_write, of); - CACHE_S(); - READ_IN_S(); - *--SP = Unsigned(S_SREG + 1); - *--SP = WRITE_MODE; + OpW(unify_l_list_write, o); /* we continue in write mode */ BEGD(d0); - d0 = AbsAppl(H); + d0 = AbsPair(H); + PREG = NEXTOP(PREG, o); + CACHE_S(); + READ_IN_S(); S_SREG[0] = d0; S_SREG = H; - d0 = (CELL) (PREG->u.of.f); - *S_SREG++ = d0; - H = S_SREG + PREG->u.of.a; - PREG = NEXTOP(PREG, of); + H = S_SREG + 2; WRITEBACK_S(S_SREG); ENDCACHE_S(); - ENDD(d0); GONextW(); + ENDD(d0); ENDOpW(); - OpRW(unify_struct, of); + OpRW(unify_struct, ofa); *--SP = Unsigned(SREG + 1); *--SP = READ_MODE; BEGD(d0); BEGP(pt0); pt0 = SREG; d0 = *pt0; - START_PREFETCH(of); + START_PREFETCH(ofa); deref_head(d0, ustruct_unk); ustruct_nonvar: /* we are in read mode */ @@ -6567,11 +6543,11 @@ Yap_absmi(int inp) /* we continue in read mode */ S_SREG = RepAppl(d0); /* just check functor */ - d0 = (CELL) (PREG->u.of.f); + d0 = (CELL) (PREG->u.ofa.f); if (*S_SREG != d0) { FAIL(); } - PREG = NEXTOP(PREG, of); + PREG = NEXTOP(PREG, ofa); WRITEBACK_S(S_SREG+1); ENDCACHE_S(); GONext(); @@ -6579,7 +6555,7 @@ Yap_absmi(int inp) derefa_body(d0, pt0, ustruct_unk, ustruct_nonvar); /* Enter Write mode */ - START_PREFETCH_W(of); + START_PREFETCH_W(ofa); /* set d1 to be the new structure we are going to create */ BEGD(d1); d1 = AbsAppl(H); @@ -6595,10 +6571,10 @@ Yap_absmi(int inp) pt0 = H; ENDD(d1); /* first, put the functor */ - d0 = (CELL) (PREG->u.of.f); + d0 = (CELL) (PREG->u.ofa.f); *pt0++ = d0; - H = pt0 + PREG->u.of.a; - PREG = NEXTOP(PREG, of); + H = pt0 + PREG->u.ofa.a; + PREG = NEXTOP(PREG, ofa); /* set SREG */ SREG = pt0; /* update H */ @@ -6610,24 +6586,27 @@ Yap_absmi(int inp) ENDD(d0); ENDOpRW(); - OpW(unify_l_struc_write, of); - BEGD(d0); - d0 = AbsAppl(H); + OpW(unify_struct_write, ofa); CACHE_S(); READ_IN_S(); + *--SP = Unsigned(S_SREG + 1); + *--SP = WRITE_MODE; + /* we continue in write mode */ + BEGD(d0); + d0 = AbsAppl(H); S_SREG[0] = d0; S_SREG = H; - d0 = (CELL) (PREG->u.of.f); + d0 = (CELL) (PREG->u.ofa.f); *S_SREG++ = d0; - H = S_SREG + PREG->u.of.a; - PREG = NEXTOP(PREG, of); + H = S_SREG + PREG->u.ofa.a; + PREG = NEXTOP(PREG, ofa); WRITEBACK_S(S_SREG); ENDCACHE_S(); ENDD(d0); GONextW(); ENDOpW(); - OpRW(unify_l_struc, of); + OpRW(unify_l_struc, ofa); BEGD(d0); BEGP(pt0); pt0 = SREG; @@ -6635,25 +6614,25 @@ Yap_absmi(int inp) deref_head(d0, ulstruct_unk); ulstruct_nonvar: /* we are in read mode */ - START_PREFETCH(of); + START_PREFETCH(ofa); if (!IsApplTerm(d0)) { FAIL(); } /* we continue in read mode */ SREG = RepAppl(d0); /* just check functor */ - d0 = (CELL) (PREG->u.of.f); + d0 = (CELL) (PREG->u.ofa.f); if (*SREG++ != d0) { FAIL(); } - PREG = NEXTOP(PREG, of); + PREG = NEXTOP(PREG, ofa); GONext(); END_PREFETCH(); derefa_body(d0, pt0, ulstruct_unk, ulstruct_nonvar); /* Enter Write mode */ /* set d1 to be the new structure we are going to create */ - START_PREFETCH_W(of); + START_PREFETCH_W(ofa); BEGD(d1); d1 = AbsAppl(H); /* we know the variable must be in the heap */ @@ -6668,10 +6647,10 @@ Yap_absmi(int inp) pt0 = H; ENDD(d1); /* first, put the functor */ - d0 = (CELL) (PREG->u.of.f); + d0 = (CELL) (PREG->u.ofa.f); *pt0++ = d0; - H = pt0 + PREG->u.of.a; - PREG = NEXTOP(PREG, of); + H = pt0 + PREG->u.ofa.a; + PREG = NEXTOP(PREG, ofa); /* set SREG */ SREG = pt0; /* update H */ @@ -6681,6 +6660,24 @@ Yap_absmi(int inp) ENDD(d0); ENDOpRW(); + + OpW(unify_l_struc_write, ofa); + BEGD(d0); + d0 = AbsAppl(H); + CACHE_S(); + READ_IN_S(); + S_SREG[0] = d0; + S_SREG = H; + d0 = (CELL) (PREG->u.ofa.f); + *S_SREG++ = d0; + H = S_SREG + PREG->u.ofa.a; + PREG = NEXTOP(PREG, ofa); + WRITEBACK_S(S_SREG); + ENDCACHE_S(); + ENDD(d0); + GONextW(); + ENDOpW(); + /************************************************************************\ * Put Instructions * @@ -6825,16 +6822,16 @@ Yap_absmi(int inp) GONext(); ENDOp(); - Op(put_struct, xf); + Op(put_struct, xfa); BEGD(d0); d0 = AbsAppl(H); - XREG(PREG->u.xf.x) = d0; - d0 = (CELL) (PREG->u.xf.f); + XREG(PREG->u.xfa.x) = d0; + d0 = (CELL) (PREG->u.xfa.f); *H++ = d0; SREG = H; - H += PREG->u.xf.a; + H += PREG->u.xfa.a; ENDD(d0); - PREG = NEXTOP(PREG, xf); + PREG = NEXTOP(PREG, xfa); GONext(); ENDOp(); @@ -7048,36 +7045,36 @@ Yap_absmi(int inp) GONext(); ENDOp(); - Op(write_struct, f); + Op(write_struct, fa); BEGD(d0); d0 = AbsAppl(H); *SREG++ = d0; SP[-1] = Unsigned(SREG); SP[-2] = 1; /* Put instructions follow the main stream */ SP -= 2; - d0 = (CELL) (PREG->u.f.f); + d0 = (CELL) (PREG->u.fa.f); *H++ = d0; ENDD(d0); BEGD(d0); - d0 = PREG->u.f.a; - PREG = NEXTOP(PREG, f); + d0 = PREG->u.fa.a; + PREG = NEXTOP(PREG, fa); SREG = H; H += d0; ENDD(d0); GONext(); ENDOp(); - Op(write_l_struc, f); + Op(write_l_struc, fa); BEGD(d0); d0 = AbsAppl(H); *SREG = d0; - d0 = (CELL) (PREG->u.f.f); + d0 = (CELL) (PREG->u.fa.f); *H++ = d0; SREG = H; ENDD(d0); BEGD(d0); - d0 = PREG->u.f.a; - PREG = NEXTOP(PREG, f); + d0 = PREG->u.fa.a; + PREG = NEXTOP(PREG, fa); H += d0; ENDD(d0); GONext(); @@ -7091,25 +7088,15 @@ Yap_absmi(int inp) * othe instructions. */ - OpW(save_pair_x_write, ox); - XREG(PREG->u.ox.x) = AbsPair(SREG); - PREG = NEXTOP(PREG, ox); - GONextW(); - ENDOpW(); - Op(save_pair_x, ox); XREG(PREG->u.ox.x) = AbsPair(SREG); PREG = NEXTOP(PREG, ox); GONext(); ENDOp(); - OpW(save_pair_y_write, oy); -#if defined(SBA) && defined(FROZEN_STACKS) - Bind_Local(YREG+PREG->u.oy.y,AbsPair(SREG)); -#else - YREG[PREG->u.oy.y] = AbsPair(SREG); -#endif /* SBA && FROZEN_STACKS */ - PREG = NEXTOP(PREG, oy); + OpW(save_pair_x_write, ox); + XREG(PREG->u.ox.x) = AbsPair(SREG); + PREG = NEXTOP(PREG, ox); GONextW(); ENDOpW(); @@ -7123,9 +7110,13 @@ Yap_absmi(int inp) GONext(); ENDOp(); - OpW(save_appl_x_write, ox); - XREG(PREG->u.ox.x) = AbsAppl(SREG - 1); - PREG = NEXTOP(PREG, ox); + OpW(save_pair_y_write, oy); +#if defined(SBA) && defined(FROZEN_STACKS) + Bind_Local(YREG+PREG->u.oy.y,AbsPair(SREG)); +#else + YREG[PREG->u.oy.y] = AbsPair(SREG); +#endif /* SBA && FROZEN_STACKS */ + PREG = NEXTOP(PREG, oy); GONextW(); ENDOpW(); @@ -7135,6 +7126,22 @@ Yap_absmi(int inp) GONext(); ENDOp(); + OpW(save_appl_x_write, ox); + XREG(PREG->u.ox.x) = AbsAppl(SREG - 1); + PREG = NEXTOP(PREG, ox); + GONextW(); + ENDOpW(); + + Op(save_appl_y, oy); +#if defined(SBA) && defined(FROZEN_STACKS) + Bind_Local(YREG+PREG->u.oy.y,AbsAppl(SREG-1)); +#else + YREG[PREG->u.oy.y] = AbsAppl(SREG - 1); +#endif /* SBA && FROZEN_STACKS */ + PREG = NEXTOP(PREG, oy); + GONext(); + ENDOp(); + OpW(save_appl_y_write, oy); #if defined(SBA) && defined(FROZEN_STACKS) Bind_Local(YREG+PREG->u.oy.y,AbsAppl(SREG-1)); @@ -7145,15 +7152,6 @@ Yap_absmi(int inp) GONextW(); ENDOpW(); - Op(save_appl_y, oy); -#if defined(SBA) && defined(FROZEN_STACKS) - Bind_Local(YREG+PREG->u.oy.y,AbsAppl(SREG-1)); -#else - YREG[PREG->u.oy.y] = AbsAppl(SREG - 1); -#endif /* SBA && FROZEN_STACKS */ - PREG = NEXTOP(PREG, oy); - GONext(); - ENDOp(); /************************************************************************\ * Instructions for implemeting 'or;' * @@ -7168,7 +7166,7 @@ Yap_absmi(int inp) was interrupted when waking up goals */ BOp(move_back, l); - PREG = (yamop *)(((char *)PREG)-(Int)(NEXTOP((yamop *)NULL,sla))); + PREG = (yamop *)(((char *)PREG)-(Int)(NEXTOP((yamop *)NULL,sbpp))); JMPNext(); ENDBOp(); @@ -7180,7 +7178,7 @@ Yap_absmi(int inp) JMPNext(); ENDBOp(); - Op(either, sla); + Op(either, sblp); #ifdef LOW_LEVEL_TRACER if (Yap_do_low_level_trace) { low_level_trace(try_or, (PredEntry *)PREG, NULL); @@ -7194,7 +7192,7 @@ Yap_absmi(int inp) #endif BEGD(d0); /* Try to preserve the environment */ - d0 = PREG->u.sla.s; + d0 = PREG->u.sblp.s; BEGCHO(pt1); pt1 = (choiceptr) ((char *) YREG + (yslot) d0); #ifdef FROZEN_STACKS @@ -7213,7 +7211,7 @@ Yap_absmi(int inp) #endif /* FROZEN_STACKS */ pt1 = (choiceptr)(((CELL *) pt1)-1); *(CELL **) pt1 = YREG; - store_yaam_regs_for_either(PREG->u.sla.sla_u.l, PREG); + store_yaam_regs_for_either(PREG->u.sblp.l, PREG); SREG = (CELL *) (B = pt1); #ifdef YAPOR SCH_set_load(pt1); @@ -7221,12 +7219,12 @@ Yap_absmi(int inp) SET_BB(pt1); ENDCHO(pt1); /* skip the current instruction plus the next one */ - PREG = NEXTOP(NEXTOP(PREG, sla),l); + PREG = NEXTOP(NEXTOP(PREG, sblp),l); GONext(); ENDD(d0); ENDOp(); - Op(or_else, sla); + Op(or_else, sblp); H = HBREG = PROTECT_FROZEN_H(B); ENV = B->cp_env; B->cp_cp = PREG; @@ -7236,17 +7234,17 @@ Yap_absmi(int inp) SET_BB(PROTECT_FROZEN_B(B)); #ifdef YAPOR if (SCH_top_shared_cp(B)) { - SCH_new_alternative(PREG, PREG->u.sla.sla_u.l); + SCH_new_alternative(PREG, PREG->u.sblp.l); } else #endif /* YAPOR */ - B->cp_ap = PREG->u.sla.sla_u.l; - PREG = NEXTOP(PREG, sla); + B->cp_ap = PREG->u.sblp.l; + PREG = NEXTOP(PREG, sblp); YREG = (CELL *) B->cp_a1; GONext(); ENDOp(); #ifdef YAPOR - Op(or_last, sla); + Op(or_last, sblp); #else Op(or_last, p); #endif /* YAPOR */ @@ -7275,7 +7273,7 @@ Yap_absmi(int inp) HBREG = PROTECT_FROZEN_H(B); } #ifdef YAPOR - PREG = NEXTOP(PREG, sla); + PREG = NEXTOP(PREG, sblp); #else PREG = NEXTOP(PREG, p); #endif /* YAPOR */ @@ -7339,10 +7337,10 @@ Yap_absmi(int inp) * Call C predicates instructions * \************************************************************************/ - BOp(call_cpred, sla); + BOp(call_cpred, sbpp); - if (!(PREG->u.sla.sla_u.p->PredFlags & (SafePredFlag|HiddenPredFlag))) { + if (!(PREG->u.sbpp.p->PredFlags & (SafePredFlag|HiddenPredFlag))) { CACHE_Y_AS_ENV(YREG); check_stack(NoStackCall, H); ENDCACHE_Y_AS_ENV(); @@ -7356,23 +7354,23 @@ Yap_absmi(int inp) #else if (YREG > (CELL *) top_b) ASP = (CELL *)top_b; #endif /* SBA */ - else ASP = (CELL *)(((char *)YREG) + PREG->u.sla.s); + else ASP = (CELL *)(((char *)YREG) + PREG->u.sbpp.s); } #else if (YREG > (CELL *) B) { ASP = (CELL *) B; } else { - ASP = (CELL *) (((char *) YREG) + PREG->u.sla.s); + ASP = (CELL *) (((char *) YREG) + PREG->u.sbpp.s); } /* for slots to work */ #endif /* FROZEN_STACKS */ #ifdef LOW_LEVEL_TRACER if (Yap_do_low_level_trace) - low_level_trace(enter_pred,PREG->u.sla.sla_u.p,XREGS+1); + low_level_trace(enter_pred,PREG->u.sbpp.p,XREGS+1); #endif /* LOW_LEVEL_TRACE */ BEGD(d0); - CPredicate f = PREG->u.sla.sla_u.p->cs.f_code; - PREG = NEXTOP(PREG, sla); + CPredicate f = PREG->u.sbpp.p->cs.f_code; + PREG = NEXTOP(PREG, sbpp); saveregs(); d0 = (f)(); setregs(); @@ -7391,7 +7389,7 @@ Yap_absmi(int inp) /* trust the C-function we are calling and hence we must */ /* guarantee that *all* machine registers are saved and */ /* restored */ - BOp(call_usercpred, sla); + BOp(call_usercpred, sbpp); CACHE_Y_AS_ENV(YREG); check_stack(NoStackCall, H); ENDCACHE_Y_AS_ENV(); @@ -7403,25 +7401,25 @@ Yap_absmi(int inp) #else if (YREG > (CELL *) top_b) ASP = (CELL *) top_b; #endif /* SBA */ - else ASP = (CELL *)(((char *)YREG) + PREG->u.sla.s); + else ASP = (CELL *)(((char *)YREG) + PREG->u.sbpp.s); } #else if (YREG > (CELL *) B) ASP = (CELL *) B; else { - ASP = (CELL *) (((char *) YREG) + PREG->u.sla.s); + ASP = (CELL *) (((char *) YREG) + PREG->u.sbpp.s); } /* for slots to work */ Yap_StartSlots(); Yap_PrologMode = UserCCallMode; #endif /* FROZEN_STACKS */ { - PredEntry *p = PREG->u.sla.sla_u.p; + PredEntry *p = PREG->u.sbpp.p; #ifdef LOW_LEVEL_TRACER if (Yap_do_low_level_trace) low_level_trace(enter_pred,p,XREGS+1); #endif /* LOW_LEVEL_TRACE */ - PREG = NEXTOP(PREG, sla); + PREG = NEXTOP(PREG, sbpp); saveregs(); save_machine_regs(); @@ -7438,7 +7436,7 @@ Yap_absmi(int inp) JMPNext(); ENDBOp(); - BOp(call_c_wfail, sdl); + BOp(call_c_wfail, sdlp); #ifdef FROZEN_STACKS { choiceptr top_b = PROTECT_FROZEN_B(B); @@ -7449,7 +7447,7 @@ Yap_absmi(int inp) #endif /* SBA */ else { BEGD(d0); - d0 = PREG->u.sdl.s; + d0 = PREG->u.sdlp.s; ASP = ((CELL *)YREG) + d0; ENDD(d0); } @@ -7459,37 +7457,37 @@ Yap_absmi(int inp) ASP = (CELL *) B; else { BEGD(d0); - d0 = PREG->u.sdl.s; + d0 = PREG->u.sdlp.s; ASP = ((CELL *) YREG) + d0; ENDD(d0); } #endif /* FROZEN_STACKS */ { - CPredicate f = PREG->u.sdl.p->cs.f_code; + CPredicate f = PREG->u.sdlp.p->cs.f_code; saveregs(); SREG = (CELL *)((f)()); setregs(); } if (!SREG) - PREG = PREG->u.sdl.l; + PREG = PREG->u.sdlp.l; else - PREG = NEXTOP(PREG, sdl); + PREG = NEXTOP(PREG, sdlp); CACHE_A1(); JMPNext(); ENDBOp(); - BOp(try_c, lds); + BOp(try_c, apFs); #ifdef YAPOR CUT_wait_leftmost(); #endif /* YAPOR */ CACHE_Y(YREG); #ifdef CUT_C /* Alocate space for the cut_c structure*/ - CUT_C_PUSH(NEXTOP(NEXTOP(PREG,lds),lds),S_YREG); + CUT_C_PUSH(NEXTOP(NEXTOP(PREG,apFs),apFs),S_YREG); #endif - S_YREG = S_YREG - PREG->u.lds.extra; - store_args(PREG->u.lds.s); - store_yaam_regs(NEXTOP(PREG, lds), 0); + S_YREG = S_YREG - PREG->u.apFs.extra; + store_args(PREG->u.apFs.s); + store_yaam_regs(NEXTOP(PREG, apFs), 0); B = B_YREG; #ifdef YAPOR SCH_set_load(B_YREG); @@ -7500,7 +7498,7 @@ Yap_absmi(int inp) TRYCC: ASP = (CELL *)B; { - CPredicate f = (CPredicate)(PREG->u.lds.f); + CPredicate f = (CPredicate)(PREG->u.apFs.f); saveregs(); SREG = (CELL *) ((f) ()); /* This last instruction changes B B*/ @@ -7534,7 +7532,7 @@ Yap_absmi(int inp) JMPNext(); ENDBOp(); - BOp(retry_c, lds); + BOp(retry_c, apFs); #ifdef YAPOR CUT_wait_leftmost(); #endif /* YAPOR */ @@ -7546,13 +7544,13 @@ Yap_absmi(int inp) DEPTH =B->cp_depth; #endif HBREG = H; - restore_args(PREG->u.lds.s); + restore_args(PREG->u.apFs.s); ENDCACHE_Y(); goto TRYCC; ENDBOp(); #ifdef CUT_C - BOp(cut_c, lds); + BOp(cut_c, apFs); /*This is a phantom instruction. This is not executed by the WAM*/ #ifdef DEBUG /*If WAM executes this instruction, probably there's an error @@ -7562,18 +7560,18 @@ Yap_absmi(int inp) ENDBOp(); #endif - BOp(try_userc, lds); + BOp(try_userc, apFs); #ifdef YAPOR CUT_wait_leftmost(); #endif /* YAPOR */ CACHE_Y(YREG); #ifdef CUT_C /* Alocate space for the cut_c structure*/ - CUT_C_PUSH(NEXTOP(NEXTOP(PREG,lds),lds),S_YREG); + CUT_C_PUSH(NEXTOP(NEXTOP(PREG,apFs),apFs),S_YREG); #endif - S_YREG = S_YREG - PREG->u.lds.extra; - store_args(PREG->u.lds.s); - store_yaam_regs(NEXTOP(PREG, lds), 0); + S_YREG = S_YREG - PREG->u.apFs.extra; + store_args(PREG->u.apFs.s); + store_yaam_regs(NEXTOP(PREG, apFs), 0); B = B_YREG; #ifdef YAPOR SCH_set_load(B_YREG); @@ -7586,7 +7584,7 @@ Yap_absmi(int inp) ASP = YENV; saveregs(); save_machine_regs(); - SREG = (CELL *) YAP_Execute(PREG->u.lds.p, (CPredicate)(PREG->u.lds.f)); + SREG = (CELL *) YAP_Execute(PREG->u.apFs.p, (CPredicate)(PREG->u.apFs.f)); EX = 0L; restore_machine_regs(); setregs(); @@ -7614,7 +7612,7 @@ Yap_absmi(int inp) JMPNext(); ENDBOp(); - BOp(retry_userc, lds); + BOp(retry_userc, apFs); #ifdef YAPOR CUT_wait_leftmost(); #endif /* YAPOR */ @@ -7626,13 +7624,13 @@ Yap_absmi(int inp) DEPTH =B->cp_depth; #endif HBREG = H; - restore_args(PREG->u.lds.s); + restore_args(PREG->u.apFs.s); ENDCACHE_Y(); goto TRYUSERCC; ENDBOp(); #ifdef CUT_C - BOp(cut_userc, lds); + BOp(cut_userc, apFs); /*This is a phantom instruction. This is not executed by the WAM*/ #ifdef DEBUG /*If WAM executes this instruction, probably there's an error @@ -7769,9 +7767,9 @@ Yap_absmi(int inp) } ENDBOp(); - BOp(expand_clauses, sp); + BOp(expand_clauses, sssllp); { - PredEntry *pe = PREG->u.sp.p; + PredEntry *pe = PREG->u.sssllp.p; yamop *pt0; /* update ASP before calling IPred */ @@ -7964,13 +7962,13 @@ Yap_absmi(int inp) * Try / Retry / Trust for main indexing blocks * \************************************************************************/ - BOp(try_clause, ld); + BOp(try_clause, apl); check_trail(TR); CACHE_Y(YREG); /* Point AP to the code that follows this instruction */ - store_at_least_one_arg(PREG->u.ld.s); - store_yaam_regs(NEXTOP(PREG, ld), 0); - PREG = PREG->u.ld.d; + store_at_least_one_arg(PREG->u.apl.s); + store_yaam_regs(NEXTOP(PREG, apl), 0); + PREG = PREG->u.apl.d; set_cut(S_YREG, B); B = B_YREG; #ifdef YAPOR @@ -8047,10 +8045,10 @@ Yap_absmi(int inp) JMPNext(); ENDBOp(); - BOp(retry, ld); + BOp(retry, apl); CACHE_Y(B); - restore_yaam_regs(NEXTOP(PREG, ld)); - restore_at_least_one_arg(PREG->u.ld.s); + restore_yaam_regs(NEXTOP(PREG, apl)); + restore_at_least_one_arg(PREG->u.apl.s); #ifdef FROZEN_STACKS S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG); set_cut(S_YREG, B->cp_b); @@ -8059,7 +8057,7 @@ Yap_absmi(int inp) #endif /* FROZEN_STACKS */ SET_BB(B_YREG); ENDCACHE_Y(); - PREG = PREG->u.ld.d; + PREG = PREG->u.apl.d; JMPNext(); ENDBOp(); @@ -8117,12 +8115,12 @@ Yap_absmi(int inp) JMPNext(); ENDBOp(); - BOp(trust, ld); + BOp(trust, apl); CACHE_Y(B); #ifdef YAPOR if (SCH_top_shared_cp(B)) { SCH_last_alternative(PREG, B_YREG); - restore_at_least_one_arg(PREG->u.ld.s); + restore_at_least_one_arg(PREG->u.apl.s); #ifdef FROZEN_STACKS S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG); #endif /* FROZEN_STACKS */ @@ -8132,7 +8130,7 @@ Yap_absmi(int inp) #endif /* YAPOR */ { pop_yaam_regs(); - pop_at_least_one_arg(PREG->u.ld.s); + pop_at_least_one_arg(PREG->u.apl.s); #ifdef FROZEN_STACKS S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG); #endif /* FROZEN_STACKS */ @@ -8140,7 +8138,7 @@ Yap_absmi(int inp) } SET_BB(B_YREG); ENDCACHE_Y(); - PREG = PREG->u.ld.d; + PREG = PREG->u.apl.d; JMPNext(); ENDBOp(); @@ -8157,11 +8155,11 @@ Yap_absmi(int inp) \************************************************************************/ /* enter logical pred */ - BOp(enter_lu_pred, Ill); + BOp(enter_lu_pred, Ills); check_trail(TR); /* mark the indexing code */ { - LogUpdIndex *cl = PREG->u.Ill.I; + LogUpdIndex *cl = PREG->u.Ills.I; PredEntry *ap = cl->ClPred; if (ap->LastCallOfPred != LUCALL_EXEC) { @@ -8176,8 +8174,8 @@ Yap_absmi(int inp) /* fprintf(stderr,"R %x--%d--%ul\n",ap,ap->TimeStampOfPred,ap->ArityOfPE);*/ } *--YENV = MkIntegerTerm(ap->TimeStampOfPred); - /* fprintf(stderr,"> %p/%p %d %d\n",cl,ap,ap->TimeStampOfPred,PREG->u.Ill.s);*/ - PREG = PREG->u.Ill.l1; + /* fprintf(stderr,"> %p/%p %d %d\n",cl,ap,ap->TimeStampOfPred,PREG->u.Ills.s);*/ + PREG = PREG->u.Ills.l1; /* indicate the indexing code is being used */ #if defined(YAPOR) || defined(THREADS) /* just store a reference */ @@ -8193,7 +8191,7 @@ Yap_absmi(int inp) GONext(); ENDBOp(); - BOp(try_logical, lld); + BOp(try_logical, aLl); check_trail(TR); { UInt timestamp; @@ -8201,21 +8199,21 @@ Yap_absmi(int inp) CACHE_Y(YREG); timestamp = IntegerOfTerm(S_YREG[0]); - /* fprintf(stderr,"+ %p/%p %d %d %d--%u\n",PREG,PREG->u.lld.d->ClPred,timestamp,PREG->u.lld.d->ClPred->TimeStampOfPred,PREG->u.lld.d->ClTimeStart,PREG->u.lld.d->ClTimeEnd);*/ + /* fprintf(stderr,"+ %p/%p %d %d %d--%u\n",PREG,PREG->u.aLl.d->ClPred,timestamp,PREG->u.aLl.d->ClPred->TimeStampOfPred,PREG->u.aLl.d->ClTimeStart,PREG->u.aLl.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.lld.t.s); - store_yaam_regs(PREG->u.lld.n, 0); + store_args(PREG->u.aLl.s); + store_yaam_regs(PREG->u.aLl.n, 0); set_cut(S_YREG, B); B = B_YREG; #ifdef YAPOR SCH_set_load(B_YREG); #endif /* YAPOR */ - if (!VALID_TIMESTAMP(timestamp, PREG->u.lld.d)) { + if (!VALID_TIMESTAMP(timestamp, PREG->u.aLl.d)) { /* jump to next alternative */ - PREG=PREG->u.lld.n; + PREG=PREG->u.aLl.n; } else { - PREG = PREG->u.lld.d->ClCode; + PREG = PREG->u.aLl.d->ClCode; } SET_BB(B_YREG); ENDCACHE_Y(); @@ -8223,7 +8221,7 @@ Yap_absmi(int inp) JMPNext(); ENDBOp(); - BOp(retry_logical, lld); + BOp(retry_logical, aLl); check_trail(TR); { UInt timestamp; @@ -8231,20 +8229,20 @@ Yap_absmi(int inp) #if defined(YAPOR) || defined(THREADS) if (!PP) { - PP = PREG->u.lld.d->ClPred; + PP = PREG->u.aLl.d->ClPred; LOCK(PP->PELock); } #endif - timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[PREG->u.lld.t.s]); - /* fprintf(stderr,"^ %p/%p %d %d %d--%u\n",PREG,PREG->u.lld.d->ClPred,timestamp,PREG->u.lld.d->ClPred->TimeStampOfPred,PREG->u.lld.d->ClTimeStart,PREG->u.lld.d->ClTimeEnd);*/ - if (!VALID_TIMESTAMP(timestamp, PREG->u.lld.d)) { + timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[PREG->u.aLl.s]); + /* fprintf(stderr,"^ %p/%p %d %d %d--%u\n",PREG,PREG->u.aLl.d->ClPred,timestamp,PREG->u.aLl.d->ClPred->TimeStampOfPred,PREG->u.aLl.d->ClTimeStart,PREG->u.aLl.d->ClTimeEnd);*/ + if (!VALID_TIMESTAMP(timestamp, PREG->u.aLl.d)) { /* jump to next instruction */ - PREG=PREG->u.lld.n; + PREG=PREG->u.aLl.n; JMPNext(); } - restore_yaam_regs(PREG->u.lld.n); - restore_at_least_one_arg(PREG->u.lld.t.s); - PREG = PREG->u.lld.d->ClCode; + restore_yaam_regs(PREG->u.aLl.n); + restore_at_least_one_arg(PREG->u.aLl.s); + PREG = PREG->u.aLl.d->ClCode; #ifdef FROZEN_STACKS S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG); set_cut(S_YREG, B->cp_b); @@ -8257,15 +8255,15 @@ Yap_absmi(int inp) JMPNext(); ENDBOp(); - BOp(trust_logical, ld); + BOp(trust_logical, ILl); CACHE_Y(B); { - LogUpdIndex *cl = PREG->u.lld.t.block; + LogUpdIndex *cl = PREG->u.ILl.block; PredEntry *ap = cl->ClPred; - LogUpdClause *lcl = PREG->u.lld.d; + LogUpdClause *lcl = PREG->u.ILl.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.lld.d->ClCode);*/ + /* fprintf(stderr,"- %p/%p %d %d %p\n",PREG,ap,timestamp,ap->TimeStampOfPred,PREG->u.ILl.d->ClCode);*/ #if defined(YAPOR) || defined(THREADS) if (!PP) { LOCK(ap->PELock); @@ -8811,106 +8809,106 @@ Yap_absmi(int inp) * Basic Primitive Predicates * \************************************************************************/ - Op(p_atom_x, xF); + Op(p_atom_x, xl); BEGD(d0); - d0 = XREG(PREG->u.xF.x); + d0 = XREG(PREG->u.xl.x); deref_head(d0, atom_x_unk); atom_x_nvar: if (IsAtomTerm(d0)) { - PREG = NEXTOP(PREG, xF); + PREG = NEXTOP(PREG, xl); GONext(); } else { - PREG = PREG->u.xF.F; + PREG = PREG->u.xl.F; GONext(); } BEGP(pt0); deref_body(d0, pt0, atom_x_unk, atom_x_nvar); - PREG = PREG->u.xF.F; + PREG = PREG->u.xl.F; GONext(); ENDP(pt0); ENDD(d0); ENDOp(); - Op(p_atom_y, yF); + Op(p_atom_y, yl); BEGD(d0); BEGP(pt0); - pt0 = YREG + PREG->u.yF.y; + pt0 = YREG + PREG->u.yl.y; d0 = *pt0; deref_head(d0, atom_y_unk); atom_y_nvar: if (IsAtomTerm(d0)) { - PREG = NEXTOP(PREG, yF); + PREG = NEXTOP(PREG, yl); GONext(); } else { - PREG = PREG->u.yF.F; + PREG = PREG->u.yl.F; GONext(); } derefa_body(d0, pt0, atom_y_unk, atom_y_nvar); - PREG = PREG->u.yF.F; + PREG = PREG->u.yl.F; GONext(); ENDP(pt0); ENDD(d0); ENDOp(); - Op(p_atomic_x, xF); + Op(p_atomic_x, xl); BEGD(d0); - d0 = XREG(PREG->u.xF.x); + d0 = XREG(PREG->u.xl.x); deref_head(d0, atomic_x_unk); atomic_x_nvar: /* non variable */ if (IsAtomicTerm(d0)) { - PREG = NEXTOP(PREG, xF); + PREG = NEXTOP(PREG, xl); GONext(); } else { - PREG = PREG->u.xF.F; + PREG = PREG->u.xl.F; GONext(); } BEGP(pt0); deref_body(d0, pt0, atomic_x_unk, atomic_x_nvar); - PREG = PREG->u.xF.F; + PREG = PREG->u.xl.F; GONext(); ENDP(pt0); ENDD(d0); ENDOp(); - Op(p_atomic_y, yF); + Op(p_atomic_y, yl); BEGD(d0); BEGP(pt0); - pt0 = YREG + PREG->u.yF.y; + pt0 = YREG + PREG->u.yl.y; d0 = *pt0; deref_head(d0, atomic_y_unk); atomic_y_nvar: /* non variable */ if (IsAtomicTerm(d0)) { - PREG = NEXTOP(PREG, yF); + PREG = NEXTOP(PREG, yl); GONext(); } else { - PREG = PREG->u.yF.F; + PREG = PREG->u.yl.F; GONext(); } derefa_body(d0, pt0, atomic_y_unk, atomic_y_nvar); - PREG = PREG->u.yF.F; + PREG = PREG->u.yl.F; GONext(); ENDP(pt0); ENDD(d0); ENDOp(); - Op(p_integer_x, xF); + Op(p_integer_x, xl); BEGD(d0); - d0 = XREG(PREG->u.xF.x); + d0 = XREG(PREG->u.xl.x); deref_head(d0, integer_x_unk); integer_x_nvar: /* non variable */ if (IsIntTerm(d0)) { - PREG = NEXTOP(PREG, xF); + PREG = NEXTOP(PREG, xl); GONext(); } if (IsApplTerm(d0)) { @@ -8919,35 +8917,35 @@ Yap_absmi(int inp) switch ((CELL)f0) { case (CELL)FunctorLongInt: case (CELL)FunctorBigInt: - PREG = NEXTOP(PREG, xF); + PREG = NEXTOP(PREG, xl); GONext(); default: - PREG = PREG->u.xF.F; + PREG = PREG->u.xl.F; GONext(); } } } - PREG = PREG->u.xF.F; + PREG = PREG->u.xl.F; GONext(); BEGP(pt0); deref_body(d0, pt0, integer_x_unk, integer_x_nvar); - PREG = PREG->u.xF.F; + PREG = PREG->u.xl.F; GONext(); ENDP(pt0); ENDD(d0); ENDOp(); - Op(p_integer_y, yF); + Op(p_integer_y, yl); BEGD(d0); BEGP(pt0); - pt0 = YREG + PREG->u.yF.y; + pt0 = YREG + PREG->u.yl.y; d0 = *pt0; deref_head(d0, integer_y_unk); integer_y_nvar: /* non variable */ if (IsIntTerm(d0)) { - PREG = NEXTOP(PREG, yF); + PREG = NEXTOP(PREG, yl); GONext(); } if (IsApplTerm(d0)) { @@ -8958,65 +8956,65 @@ Yap_absmi(int inp) #ifdef USE_GMP case (CELL)FunctorBigInt: #endif - PREG = NEXTOP(PREG, yF); + PREG = NEXTOP(PREG, yl); GONext(); default: - PREG = PREG->u.yF.F; + PREG = PREG->u.yl.F; GONext(); } } } - PREG = PREG->u.yF.F; + PREG = PREG->u.yl.F; GONext(); derefa_body(d0, pt0, integer_y_unk, integer_y_nvar); - PREG = PREG->u.yF.F; + PREG = PREG->u.yl.F; GONext(); ENDP(pt0); ENDD(d0); ENDOp(); - Op(p_nonvar_x, xF); + Op(p_nonvar_x, xl); BEGD(d0); - d0 = XREG(PREG->u.xF.x); + d0 = XREG(PREG->u.xl.x); deref_head(d0, nonvar_x_unk); nonvar_x_nvar: - PREG = NEXTOP(PREG, xF); + PREG = NEXTOP(PREG, xl); GONext(); BEGP(pt0); deref_body(d0, pt0, nonvar_x_unk, nonvar_x_nvar); - PREG = PREG->u.xF.F; + PREG = PREG->u.xl.F; GONext(); ENDP(pt0); ENDD(d0); ENDOp(); - Op(p_nonvar_y, yF); + Op(p_nonvar_y, yl); BEGD(d0); BEGP(pt0); - pt0 = YREG + PREG->u.yF.y; + pt0 = YREG + PREG->u.yl.y; d0 = *pt0; deref_head(d0, nonvar_y_unk); nonvar_y_nvar: - PREG = NEXTOP(PREG, yF); + PREG = NEXTOP(PREG, yl); GONext(); derefa_body(d0, pt0, nonvar_y_unk, nonvar_y_nvar); - PREG = PREG->u.yF.F; + PREG = PREG->u.yl.F; GONext(); ENDP(pt0); ENDD(d0); ENDOp(); - Op(p_number_x, xF); + Op(p_number_x, xl); BEGD(d0); - d0 = XREG(PREG->u.xF.x); + d0 = XREG(PREG->u.xl.x); deref_head(d0, number_x_unk); number_x_nvar: /* non variable */ if (IsIntTerm(d0)) { - PREG = NEXTOP(PREG, xF); + PREG = NEXTOP(PREG, xl); GONext(); } if (IsApplTerm(d0)) { @@ -9028,36 +9026,36 @@ Yap_absmi(int inp) #ifdef USE_GMP case (CELL)FunctorBigInt: #endif - PREG = NEXTOP(PREG, xF); + PREG = NEXTOP(PREG, xl); GONext(); default: - PREG = PREG->u.xF.F; + PREG = PREG->u.xl.F; GONext(); } } } - PREG = PREG->u.xF.F; + PREG = PREG->u.xl.F; GONext(); BEGP(pt0); deref_body(d0, pt0, number_x_unk, number_x_nvar); - PREG = PREG->u.xF.F; + PREG = PREG->u.xl.F; GONext(); ENDP(pt0); ENDD(d0); ENDOp(); - Op(p_number_y, xF); + Op(p_number_y, xl); BEGD(d0); BEGP(pt0); - pt0 = YREG + PREG->u.yF.y; + pt0 = YREG + PREG->u.yl.y; d0 = *pt0; deref_head(d0, number_y_unk); number_y_nvar: /* non variable */ /* non variable */ if (IsIntTerm(d0)) { - PREG = NEXTOP(PREG, xF); + PREG = NEXTOP(PREG, xl); GONext(); } if (IsApplTerm(d0)) { @@ -9069,88 +9067,88 @@ Yap_absmi(int inp) #ifdef USE_GMP case (CELL)FunctorBigInt: #endif - PREG = NEXTOP(PREG, yF); + PREG = NEXTOP(PREG, yl); GONext(); default: - PREG = PREG->u.yF.F; + PREG = PREG->u.yl.F; GONext(); } } } - PREG = PREG->u.xF.F; + PREG = PREG->u.xl.F; GONext(); derefa_body(d0, pt0, number_y_unk, number_y_nvar); - PREG = PREG->u.yF.F; + PREG = PREG->u.yl.F; GONext(); ENDP(pt0); ENDD(d0); ENDOp(); - Op(p_var_x, xF); + Op(p_var_x, xl); BEGD(d0); - d0 = XREG(PREG->u.xF.x); + d0 = XREG(PREG->u.xl.x); deref_head(d0, var_x_unk); var_x_nvar: /* non variable */ - PREG = PREG->u.xF.F; + PREG = PREG->u.xl.F; GONext(); BEGP(pt0); deref_body(d0, pt0, var_x_unk, var_x_nvar); - PREG = NEXTOP(PREG, xF); + PREG = NEXTOP(PREG, xl); GONext(); ENDP(pt0); ENDD(d0); ENDOp(); - Op(p_var_y, yF); + Op(p_var_y, yl); BEGD(d0); BEGP(pt0); - pt0 = YREG + PREG->u.yF.y; + pt0 = YREG + PREG->u.yl.y; d0 = *pt0; deref_head(d0, var_y_unk); var_y_nvar: /* non variable */ - PREG = PREG->u.yF.F; + PREG = PREG->u.yl.F; GONext(); derefa_body(d0, pt0, var_y_unk, var_y_nvar); - PREG = NEXTOP(PREG, yF); + PREG = NEXTOP(PREG, yl); GONext(); ENDP(pt0); ENDD(d0); ENDOp(); - Op(p_db_ref_x, xF); + Op(p_db_ref_x, xl); BEGD(d0); - d0 = XREG(PREG->u.xF.x); + d0 = XREG(PREG->u.xl.x); deref_head(d0, dbref_x_unk); dbref_x_nvar: /* non variable */ if (IsDBRefTerm(d0)) { /* only allow references to the database, not general references * to go through. */ - PREG = NEXTOP(PREG, xF); + PREG = NEXTOP(PREG, xl); GONext(); } else { - PREG = PREG->u.xF.F; + PREG = PREG->u.xl.F; GONext(); } BEGP(pt0); deref_body(d0, pt0, dbref_x_unk, dbref_x_nvar); - PREG = PREG->u.xF.F; + PREG = PREG->u.xl.F; GONext(); ENDP(pt0); ENDD(d0); ENDOp(); - Op(p_db_ref_y, yF); + Op(p_db_ref_y, yl); BEGD(d0); BEGP(pt0); - pt0 = YREG + PREG->u.yF.y; + pt0 = YREG + PREG->u.yl.y; d0 = *pt0; deref_head(d0, dbref_y_unk); dbref_y_nvar: @@ -9158,177 +9156,177 @@ Yap_absmi(int inp) if (IsDBRefTerm(d0)) { /* only allow references to the database, not general references * to go through. */ - PREG = NEXTOP(PREG, yF); + PREG = NEXTOP(PREG, yl); GONext(); } else { - PREG = PREG->u.yF.F; + PREG = PREG->u.yl.F; GONext(); } derefa_body(d0, pt0, dbref_y_unk, dbref_y_nvar); - PREG = PREG->u.yF.F; + PREG = PREG->u.yl.F; GONext(); ENDP(pt0); ENDD(d0); ENDOp(); - Op(p_primitive_x, xF); + Op(p_primitive_x, xl); BEGD(d0); - d0 = XREG(PREG->u.xF.x); + d0 = XREG(PREG->u.xl.x); deref_head(d0, primi_x_unk); primi_x_nvar: /* non variable */ if (IsPrimitiveTerm(d0)) { - PREG = NEXTOP(PREG, xF); + PREG = NEXTOP(PREG, xl); GONext(); } else { - PREG = PREG->u.xF.F; + PREG = PREG->u.xl.F; GONext(); } BEGP(pt0); deref_body(d0, pt0, primi_x_unk, primi_x_nvar); - PREG = PREG->u.xF.F; + PREG = PREG->u.xl.F; GONext(); ENDP(pt0); ENDD(d0); ENDOp(); - Op(p_primitive_y, yF); + Op(p_primitive_y, yl); BEGD(d0); BEGP(pt0); - pt0 = YREG + PREG->u.yF.y; + pt0 = YREG + PREG->u.yl.y; d0 = *pt0; deref_head(d0, primi_y_unk); primi_y_nvar: /* non variable */ if (IsPrimitiveTerm(d0)) { - PREG = NEXTOP(PREG, yF); + PREG = NEXTOP(PREG, yl); GONext(); } else { - PREG = PREG->u.yF.F; + PREG = PREG->u.yl.F; GONext(); } derefa_body(d0, pt0, primi_y_unk, primi_y_nvar); - PREG = PREG->u.yF.F; + PREG = PREG->u.yl.F; GONext(); ENDP(pt0); ENDD(d0); ENDOp(); - Op(p_compound_x, xF); + Op(p_compound_x, xl); BEGD(d0); - d0 = XREG(PREG->u.xF.x); + d0 = XREG(PREG->u.xl.x); deref_head(d0, compound_x_unk); compound_x_nvar: /* non variable */ if (IsPairTerm(d0)) { - PREG = NEXTOP(PREG, xF); + PREG = NEXTOP(PREG, xl); GONext(); } else if (IsApplTerm(d0)) { if (IsExtensionFunctor(FunctorOfTerm(d0))) { - PREG = PREG->u.xF.F; + PREG = PREG->u.xl.F; GONext(); } - PREG = NEXTOP(PREG, xF); + PREG = NEXTOP(PREG, xl); GONext(); } else { - PREG = PREG->u.xF.F; + PREG = PREG->u.xl.F; GONext(); } BEGP(pt0); deref_body(d0, pt0, compound_x_unk, compound_x_nvar); - PREG = PREG->u.xF.F; + PREG = PREG->u.xl.F; GONext(); ENDP(pt0); ENDD(d0); ENDOp(); - Op(p_compound_y, yF); + Op(p_compound_y, yl); BEGD(d0); BEGP(pt0); - pt0 = YREG + PREG->u.yF.y; + pt0 = YREG + PREG->u.yl.y; d0 = *pt0; deref_head(d0, compound_y_unk); compound_y_nvar: /* non variable */ if (IsPairTerm(d0)) { - PREG = NEXTOP(PREG, yF); + PREG = NEXTOP(PREG, yl); GONext(); } else if (IsApplTerm(d0)) { if (IsExtensionFunctor(FunctorOfTerm(d0))) { - PREG = PREG->u.yF.F; + PREG = PREG->u.yl.F; GONext(); } - PREG = NEXTOP(PREG, yF); + PREG = NEXTOP(PREG, yl); GONext(); } else { - PREG = PREG->u.yF.F; + PREG = PREG->u.yl.F; GONext(); } derefa_body(d0, pt0, compound_y_unk, compound_y_nvar); - PREG = PREG->u.yF.F; + PREG = PREG->u.yl.F; GONext(); ENDP(pt0); ENDD(d0); ENDOp(); - Op(p_float_x, xF); + Op(p_float_x, xl); BEGD(d0); - d0 = XREG(PREG->u.xF.x); + d0 = XREG(PREG->u.xl.x); deref_head(d0, float_x_unk); float_x_nvar: /* non variable */ if (IsFloatTerm(d0)) { - PREG = NEXTOP(PREG, xF); + PREG = NEXTOP(PREG, xl); GONext(); } - PREG = PREG->u.xF.F; + PREG = PREG->u.xl.F; GONext(); BEGP(pt0); deref_body(d0, pt0, float_x_unk, float_x_nvar); - PREG = PREG->u.xF.F; + PREG = PREG->u.xl.F; GONext(); ENDP(pt0); ENDD(d0); ENDOp(); - Op(p_float_y, yF); + Op(p_float_y, yl); BEGD(d0); BEGP(pt0); - pt0 = YREG + PREG->u.yF.y; + pt0 = YREG + PREG->u.yl.y; d0 = *pt0; deref_head(d0, float_y_unk); float_y_nvar: /* non variable */ if (IsFloatTerm(d0)) { - PREG = NEXTOP(PREG, yF); + PREG = NEXTOP(PREG, yl); GONext(); } - PREG = PREG->u.yF.F; + PREG = PREG->u.yl.F; GONext(); derefa_body(d0, pt0, float_y_unk, float_y_nvar); - PREG = PREG->u.yF.F; + PREG = PREG->u.yl.F; GONext(); ENDP(pt0); ENDD(d0); ENDOp(); - Op(p_cut_by_x, xF); + Op(p_cut_by_x, xl); BEGD(d0); - d0 = XREG(PREG->u.xF.x); + d0 = XREG(PREG->u.xl.x); deref_head(d0, cutby_x_unk); cutby_x_nvar: #if defined(SBA) && defined(FROZEN_STACKS) @@ -9336,7 +9334,7 @@ Yap_absmi(int inp) #else if (!IsIntTerm(d0)) { #endif /* SBA && FROZEN_STACKS */ - PREG = NEXTOP(PREG, xF); + PREG = NEXTOP(PREG, xl); GONext(); } BEGCHO(pt0); @@ -9370,7 +9368,7 @@ Yap_absmi(int inp) #endif /* TABLING */ goto trim_trail; } - PREG = NEXTOP(PREG, xF); + PREG = NEXTOP(PREG, xl); ENDCHO(pt0); GONext(); @@ -9383,10 +9381,10 @@ Yap_absmi(int inp) ENDD(d0); ENDOp(); - Op(p_cut_by_y, yF); + Op(p_cut_by_y, yl); BEGD(d0); BEGP(pt0); - pt0 = YREG + PREG->u.yF.y; + pt0 = YREG + PREG->u.yl.y; d0 = *pt0; deref_head(d0, cutby_y_unk); cutby_y_nvar: @@ -9428,7 +9426,7 @@ Yap_absmi(int inp) #endif /* TABLING */ goto trim_trail; } - PREG = NEXTOP(PREG, yF); + PREG = NEXTOP(PREG, yl); GONext(); ENDCHO(pt1); @@ -9740,14 +9738,14 @@ Yap_absmi(int inp) ENDD(d0); ENDOp(); - Op(p_minus_y_cv, ycx); + Op(p_minus_y_cv, yxc); BEGD(d0); - d0 = XREG(PREG->u.ycx.xi); + d0 = XREG(PREG->u.yxc.xi); /* first check pt1 */ deref_head(d0, minus_y_cv_unk); minus_y_cv_nvar: { - Int d1 = PREG->u.ycx.c; + Int d1 = PREG->u.yxc.c; if (IsIntTerm(d0)) { d0 = MkIntegerTerm(d1 - IntOfTerm(d0)); } @@ -9760,8 +9758,8 @@ Yap_absmi(int inp) } } BEGP(pt0); - pt0 = YREG + PREG->u.ycx.y; - PREG = NEXTOP(PREG, ycx); + pt0 = YREG + PREG->u.yxc.y; + PREG = NEXTOP(PREG, yxc); #if defined(SBA) && defined(FROZEN_STACKS) Bind_Local(pt0,d0); #else @@ -10002,14 +10000,14 @@ Yap_absmi(int inp) ENDD(d0); ENDOp(); - Op(p_div_vc, xcx); + Op(p_div_vc, xxc); BEGD(d0); - d0 = XREG(PREG->u.xcx.xi); + d0 = XREG(PREG->u.xxc.xi); /* first check pt1 */ deref_head(d0, div_vc_unk); div_vc_nvar: { - Int d1 = PREG->u.xcx.c; + Int d1 = PREG->u.xxc.c; if (IsIntTerm(d0)) { d0 = MkIntTerm(IntOfTerm(d0) / d1); } @@ -10021,8 +10019,8 @@ Yap_absmi(int inp) FAIL(); } } - XREG(PREG->u.xcx.x) = d0; - PREG = NEXTOP(PREG, xcx); + XREG(PREG->u.xxc.x) = d0; + PREG = NEXTOP(PREG, xxc); GONext(); BEGP(pt0); @@ -10135,12 +10133,12 @@ Yap_absmi(int inp) Op(p_div_y_vc, yxc); BEGD(d0); - d0 = XREG(PREG->u.ycx.xi); + d0 = XREG(PREG->u.yxc.xi); /* first check pt1 */ deref_head(d0, div_y_vc_unk); div_y_vc_nvar: { - Int d1 = PREG->u.ycx.c; + Int d1 = PREG->u.yxc.c; if (IsIntTerm(d0)) { d0 = MkIntTerm(IntOfTerm(d0)/d1); } @@ -10173,14 +10171,14 @@ Yap_absmi(int inp) ENDD(d0); ENDOp(); - Op(p_div_y_cv, ycx); + Op(p_div_y_cv, yxc); BEGD(d0); - d0 = XREG(PREG->u.ycx.xi); + d0 = XREG(PREG->u.yxc.xi); /* first check pt1 */ deref_head(d0, div_y_cv_unk); div_y_cv_nvar: { - Int d1 = PREG->u.ycx.c; + Int d1 = PREG->u.yxc.c; if (IsIntTerm(d0)) { Int div = IntOfTerm(d0); if (div == 0) { @@ -10200,8 +10198,8 @@ Yap_absmi(int inp) } } BEGP(pt0); - pt0 = YREG + PREG->u.ycx.y; - PREG = NEXTOP(PREG, ycx); + pt0 = YREG + PREG->u.yxc.y; + PREG = NEXTOP(PREG, yxc); #if defined(SBA) && defined(FROZEN_STACKS) Bind_Local(pt0,d0); #else @@ -10643,14 +10641,14 @@ Yap_absmi(int inp) ENDD(d0); ENDOp(); - Op(p_sll_cv, xcx); + Op(p_sll_cv, xxc); BEGD(d0); - d0 = XREG(PREG->u.xcx.xi); + d0 = XREG(PREG->u.xxc.xi); /* first check pt1 */ deref_head(d0, sll_cv_unk); sll_cv_nvar: { - Int d1 = PREG->u.xcx.c; + Int d1 = PREG->u.xxc.c; if (IsIntTerm(d0)) { Int i2 = IntOfTerm(d0); if (i2 < 0) @@ -10667,7 +10665,7 @@ Yap_absmi(int inp) if (PREG == (yamop *)FAILCODE) FAIL(); XREG(PREG->u.xxc.x) = d0; - PREG = NEXTOP(PREG, xcx); + PREG = NEXTOP(PREG, xxc); GONext(); BEGP(pt0); @@ -10777,14 +10775,14 @@ Yap_absmi(int inp) ENDOp(); - Op(p_sll_y_cv, ycx); + Op(p_sll_y_cv, yxc); BEGD(d0); - d0 = XREG(PREG->u.ycx.xi); + d0 = XREG(PREG->u.yxc.xi); /* first check pt1 */ deref_head(d0, sll_y_cv_unk); sll_y_cv_nvar: { - Int d1 = PREG->u.ycx.c; + Int d1 = PREG->u.yxc.c; if (IsIntTerm(d0)) { Int i2 = IntOfTerm(d0); if (i2 < 0) @@ -10801,8 +10799,8 @@ Yap_absmi(int inp) if (PREG == (yamop *)FAILCODE) FAIL(); BEGP(pt0); - pt0 = YREG + PREG->u.ycx.y; - PREG = NEXTOP(PREG, ycx); + pt0 = YREG + PREG->u.yxc.y; + PREG = NEXTOP(PREG, yxc); #if defined(SBA) && defined(FROZEN_STACKS) Bind_Local(pt0,d0); #else @@ -10903,14 +10901,14 @@ Yap_absmi(int inp) ENDD(d0); ENDOp(); - Op(p_slr_cv, xcx); + Op(p_slr_cv, xxc); BEGD(d0); - d0 = XREG(PREG->u.xcx.xi); + d0 = XREG(PREG->u.xxc.xi); /* first check pt1 */ deref_head(d0, slr_cv_unk); slr_cv_nvar: { - Int d1 = PREG->u.xcx.c; + Int d1 = PREG->u.xxc.c; if (IsIntTerm(d0)) { Int i2 = IntOfTerm(d0); if (i2 < 0) @@ -10927,7 +10925,7 @@ Yap_absmi(int inp) if (PREG == (yamop *)FAILCODE) FAIL(); XREG(PREG->u.xxc.x) = d0; - PREG = NEXTOP(PREG, xcx); + PREG = NEXTOP(PREG, xxc); GONext(); BEGP(pt0); @@ -11035,14 +11033,14 @@ Yap_absmi(int inp) ENDD(d0); ENDOp(); - Op(p_slr_y_cv, ycx); + Op(p_slr_y_cv, yxc); BEGD(d0); - d0 = XREG(PREG->u.ycx.xi); + d0 = XREG(PREG->u.yxc.xi); /* first check pt1 */ deref_head(d0, slr_y_cv_unk); slr_y_cv_nvar: { - Int d1 = PREG->u.ycx.c; + Int d1 = PREG->u.yxc.c; if (IsIntTerm(d0)) { Int i2 = IntOfTerm(d0); if (i2 < 0) @@ -11059,8 +11057,8 @@ Yap_absmi(int inp) if (PREG == (yamop *)FAILCODE) FAIL(); BEGP(pt0); - pt0 = YREG + PREG->u.ycx.y; - PREG = NEXTOP(PREG, ycx); + pt0 = YREG + PREG->u.yxc.y; + PREG = NEXTOP(PREG, yxc); #if defined(SBA) && defined(FROZEN_STACKS) Bind_Local(pt0,d0); #else @@ -11079,59 +11077,59 @@ Yap_absmi(int inp) ENDD(d0); ENDOp(); - BOp(call_bfunc_xx, llxx); + BOp(call_bfunc_xx, plxxs); BEGD(d0); BEGD(d1); - d0 = XREG(PREG->u.llxx.x1); + d0 = XREG(PREG->u.plxxs.x1); call_bfunc_xx_nvar: - d1 = XREG(PREG->u.llxx.x2); + d1 = XREG(PREG->u.plxxs.x2); call_bfunc_xx2_nvar: deref_head(d0, call_bfunc_xx_unk); deref_head(d1, call_bfunc_xx2_unk); if (IsIntTerm(d0) && IsIntTerm(d1)) { - int flags; + COUNT flags; Int v = IntOfTerm(d0) - IntOfTerm(d1); - flags = PREG->u.llxx.flags; + flags = PREG->u.plxxs.flags; if (v > 0) { if (flags & GT_OK_IN_CMP) { - PREG = NEXTOP(PREG, llxx); + PREG = NEXTOP(PREG, plxxs); JMPNext(); } else { - PREG = PREG->u.llxx.f; + PREG = PREG->u.plxxs.f; JMPNext(); } } else if (v < 0) { if (flags & LT_OK_IN_CMP) { - PREG = NEXTOP(PREG, llxx); + PREG = NEXTOP(PREG, plxxs); JMPNext(); } else { - PREG = PREG->u.llxx.f; + PREG = PREG->u.plxxs.f; JMPNext(); } } else /* if (v == 0) */ { if (flags & EQ_OK_IN_CMP) { - PREG = NEXTOP(PREG, llxx); + PREG = NEXTOP(PREG, plxxs); JMPNext(); } else { - PREG = PREG->u.llxx.f; + PREG = PREG->u.plxxs.f; JMPNext(); } } } exec_bin_cmp_xx: { - CmpPredicate f = PREG->u.llxx.p->cs.d_code; + CmpPredicate f = PREG->u.plxxs.p->cs.d_code; saveregs(); d0 = (CELL) (f) (d0,d1); setregs(); } if (!d0) { if (PREG != FAILCODE) - PREG = PREG->u.llxx.f; + PREG = PREG->u.plxxs.f; JMPNext(); } - PREG = NEXTOP(PREG, llxx); + PREG = NEXTOP(PREG, plxxs); JMPNext(); BEGP(pt0); @@ -11149,12 +11147,12 @@ Yap_absmi(int inp) ENDD(d0); ENDBOp(); - BOp(call_bfunc_yx, llxy); + BOp(call_bfunc_yx, plxys); BEGD(d0); BEGD(d1); BEGP(pt0); - pt0 = YREG + PREG->u.llxy.y; - d1 = XREG(PREG->u.llxy.x); + pt0 = YREG + PREG->u.plxys.y; + d1 = XREG(PREG->u.plxys.x); d0 = *pt0; ENDP(pt0); deref_head(d0, call_bfunc_yx_unk); @@ -11165,46 +11163,46 @@ Yap_absmi(int inp) int flags; Int v = IntOfTerm(d0) - IntOfTerm(d1); - flags = PREG->u.llxy.flags; + flags = PREG->u.plxys.flags; if (v > 0) { if (flags & GT_OK_IN_CMP) { - PREG = NEXTOP(PREG, llxy); + PREG = NEXTOP(PREG, plxys); JMPNext(); } else { - PREG = PREG->u.llxy.f; + PREG = PREG->u.plxys.f; JMPNext(); } } else if (v < 0) { if (flags & LT_OK_IN_CMP) { - PREG = NEXTOP(PREG, llxy); + PREG = NEXTOP(PREG, plxys); JMPNext(); } else { - PREG = PREG->u.llxy.f; + PREG = PREG->u.plxys.f; JMPNext(); } } else /* if (v == 0) */ { if (flags & EQ_OK_IN_CMP) { - PREG = NEXTOP(PREG, llxy); + PREG = NEXTOP(PREG, plxys); JMPNext(); } else { - PREG = PREG->u.llxy.f; + PREG = PREG->u.plxys.f; JMPNext(); } } } exec_bin_cmp_yx: { - CmpPredicate f = PREG->u.llxy.p->cs.d_code; + CmpPredicate f = PREG->u.plxys.p->cs.d_code; saveregs(); d0 = (CELL) (f) (d0,d1); setregs(); } if (!d0) { if (PREG != FAILCODE) - PREG = PREG->u.llxy.f; + PREG = PREG->u.plxys.f; JMPNext(); } - PREG = NEXTOP(PREG, llxy); + PREG = NEXTOP(PREG, plxys); JMPNext(); BEGP(pt0); @@ -11222,12 +11220,12 @@ Yap_absmi(int inp) ENDD(d0); ENDBOp(); - BOp(call_bfunc_xy, llxy); + BOp(call_bfunc_xy, plxys); BEGD(d0); BEGD(d1); BEGP(pt0); - pt0 = YREG + PREG->u.llxy.y; - d0 = XREG(PREG->u.llxy.x); + pt0 = YREG + PREG->u.plxys.y; + d0 = XREG(PREG->u.plxys.x); d1 = *pt0; ENDP(pt0); deref_head(d0, call_bfunc_xy_unk); @@ -11238,46 +11236,46 @@ Yap_absmi(int inp) int flags; Int v = IntOfTerm(d0) - IntOfTerm(d1); - flags = PREG->u.llxy.flags; + flags = PREG->u.plxys.flags; if (v > 0) { if (flags & GT_OK_IN_CMP) { - PREG = NEXTOP(PREG, llxy); + PREG = NEXTOP(PREG, plxys); JMPNext(); } else { - PREG = PREG->u.llxy.f; + PREG = PREG->u.plxys.f; JMPNext(); } } else if (v < 0) { if (flags & LT_OK_IN_CMP) { - PREG = NEXTOP(PREG, llxy); + PREG = NEXTOP(PREG, plxys); JMPNext(); } else { - PREG = PREG->u.llxy.f; + PREG = PREG->u.plxys.f; JMPNext(); } } else /* if (v == 0) */ { if (flags & EQ_OK_IN_CMP) { - PREG = NEXTOP(PREG, llxy); + PREG = NEXTOP(PREG, plxys); JMPNext(); } else { - PREG = PREG->u.llxy.f; + PREG = PREG->u.plxys.f; JMPNext(); } } } exec_bin_cmp_xy: { - CmpPredicate f = PREG->u.llxy.p->cs.d_code; + CmpPredicate f = PREG->u.plxys.p->cs.d_code; saveregs(); d0 = (CELL) (f) (d0,d1); setregs(); } if (!d0) { if (PREG != FAILCODE) - PREG = PREG->u.llxy.f; + PREG = PREG->u.plxys.f; JMPNext(); } - PREG = NEXTOP(PREG, llxy); + PREG = NEXTOP(PREG, plxys); JMPNext(); BEGP(pt0); @@ -11295,13 +11293,13 @@ Yap_absmi(int inp) ENDD(d0); ENDBOp(); - BOp(call_bfunc_yy, llyy); + BOp(call_bfunc_yy, plyys); BEGD(d0); BEGD(d1); BEGP(pt0); - pt0 = YREG + PREG->u.llyy.y1; + pt0 = YREG + PREG->u.plyys.y1; BEGP(pt1); - pt1 = YREG + PREG->u.llyy.y2; + pt1 = YREG + PREG->u.plyys.y2; d0 = *pt0; d1 = *pt1; ENDP(pt1); @@ -11314,46 +11312,46 @@ Yap_absmi(int inp) int flags; Int v = IntOfTerm(d0) - IntOfTerm(d1); - flags = PREG->u.llyy.flags; + flags = PREG->u.plyys.flags; if (v > 0) { if (flags & GT_OK_IN_CMP) { - PREG = NEXTOP(PREG, llyy); + PREG = NEXTOP(PREG, plyys); JMPNext(); } else { - PREG = PREG->u.llyy.f; + PREG = PREG->u.plyys.f; JMPNext(); } } else if (v < 0) { if (flags & LT_OK_IN_CMP) { - PREG = NEXTOP(PREG, llyy); + PREG = NEXTOP(PREG, plyys); JMPNext(); } else { - PREG = PREG->u.llyy.f; + PREG = PREG->u.plyys.f; JMPNext(); } } else /* if (v == 0) */ { if (flags & EQ_OK_IN_CMP) { - PREG = NEXTOP(PREG, llyy); + PREG = NEXTOP(PREG, plyys); JMPNext(); } else { - PREG = PREG->u.llyy.f; + PREG = PREG->u.plyys.f; JMPNext(); } } } exec_bin_cmp_yy: { - CmpPredicate f = PREG->u.llyy.p->cs.d_code; + CmpPredicate f = PREG->u.plyys.p->cs.d_code; saveregs(); d0 = (CELL) (f) (d0,d1); } setregs(); if (!d0) { if (PREG != FAILCODE) - PREG = PREG->u.llyy.f; + PREG = PREG->u.plyys.f; JMPNext(); } - PREG = NEXTOP(PREG, llyy); + PREG = NEXTOP(PREG, plyys); JMPNext(); BEGP(pt0); @@ -12090,7 +12088,7 @@ Yap_absmi(int inp) /* else if arity is 0 just pass d0 through */ /* Ding, ding, we made it */ XREG(PREG->u.xxx.x) = d0; - PREG = NEXTOP(NEXTOP(NEXTOP(PREG, xxx),sla),l); + PREG = NEXTOP(NEXTOP(NEXTOP(PREG, xxx),sbpp),l); GONext(); } else if ((Int)d1 > 0) { @@ -12113,7 +12111,7 @@ Yap_absmi(int inp) if (pt1+d1 > ENV || pt1+d1 > (CELL *)B) { /* make sure we have something to show for our trouble */ saveregs(); - if (!Yap_gcl((1+d1)*sizeof(CELL), 0, YREG, NEXTOP(NEXTOP(PREG,xxx),sla))) { + if (!Yap_gcl((1+d1)*sizeof(CELL), 0, YREG, NEXTOP(NEXTOP(PREG,xxx),sbpp))) { Yap_Error(OUT_OF_STACK_ERROR,TermNil,Yap_ErrorMessage); setregs(); JMPNext(); @@ -12132,11 +12130,11 @@ Yap_absmi(int inp) /* else if arity is 0 just pass d0 through */ /* Ding, ding, we made it */ XREG(PREG->u.xxx.x) = d0; - PREG = NEXTOP(NEXTOP(NEXTOP(PREG, xxx),sla),l); + PREG = NEXTOP(NEXTOP(NEXTOP(PREG, xxx),sbpp),l); GONext(); } else if ((Int)d1 == 0) { XREG(PREG->u.xxx.x) = d0; - PREG = NEXTOP(NEXTOP(NEXTOP(PREG, xxx),sla),l); + PREG = NEXTOP(NEXTOP(NEXTOP(PREG, xxx),sbpp),l); GONext(); } else { saveregs(); @@ -12166,23 +12164,23 @@ Yap_absmi(int inp) ENDD(d0); ENDOp(); - Op(p_func2s_cv, xcx); + Op(p_func2s_cv, xxc); /* A1 is a variable */ restart_func2s_cv: #ifdef LOW_LEVEL_TRACER if (Yap_do_low_level_trace) { RESET_VARIABLE(H); - H[1] = PREG->u.xcx.c; - H[2] = XREG(PREG->u.xcx.xi); + H[1] = PREG->u.xxc.c; + H[2] = XREG(PREG->u.xxc.xi); low_level_trace(enter_pred,RepPredProp(Yap_GetPredPropByFunc(Yap_MkFunctor(Yap_LookupAtom("functor"),3),0)),H); } #endif /* LOW_LEVEL_TRACE */ BEGD(d0); /* We have to build the structure */ - d0 = PREG->u.xcx.c; + d0 = PREG->u.xxc.c; /* we do, let's get the third argument */ BEGD(d1); - d1 = XREG(PREG->u.xcx.xi); + d1 = XREG(PREG->u.xxc.xi); deref_head(d1, func2s_unk2_cv); func2s_nvar2_cv: /* Uuuff, the second and third argument are bound */ @@ -12203,8 +12201,8 @@ Yap_absmi(int inp) H += 2; /* else if arity is 0 just pass d0 through */ /* Ding, ding, we made it */ - XREG(PREG->u.xcx.x) = d0; - PREG = NEXTOP(NEXTOP(NEXTOP(PREG, xcx),sla),l); + XREG(PREG->u.xxc.x) = d0; + PREG = NEXTOP(NEXTOP(NEXTOP(PREG, xxc),sbpp),l); GONext(); } else if ((Int)d1 > 0) { /* now let's build a compound term */ @@ -12226,7 +12224,7 @@ Yap_absmi(int inp) if (pt1+d1 > ENV || pt1+d1 > (CELL *)B) { /* make sure we have something to show for our trouble */ saveregs(); - if (!Yap_gcl((1+d1)*sizeof(CELL), 0, YREG, NEXTOP(NEXTOP(PREG,xcx),sla))) { + if (!Yap_gcl((1+d1)*sizeof(CELL), 0, YREG, NEXTOP(NEXTOP(PREG,xxc),sbpp))) { Yap_Error(OUT_OF_STACK_ERROR,TermNil,Yap_ErrorMessage); setregs(); JMPNext(); @@ -12244,12 +12242,12 @@ Yap_absmi(int inp) ENDP(pt1); /* else if arity is 0 just pass d0 through */ /* Ding, ding, we made it */ - XREG(PREG->u.xcx.x) = d0; - PREG = NEXTOP(NEXTOP(NEXTOP(PREG, xcx),sla),l); + XREG(PREG->u.xxc.x) = d0; + PREG = NEXTOP(NEXTOP(NEXTOP(PREG, xxc),sbpp),l); GONext(); } else if (d1 == 0) { - XREG(PREG->u.xcx.x) = d0; - PREG = NEXTOP(NEXTOP(NEXTOP(PREG, xcx),sla),l); + XREG(PREG->u.xxc.x) = d0; + PREG = NEXTOP(NEXTOP(NEXTOP(PREG, xxc),sbpp),l); GONext(); } else { saveregs(); @@ -12309,13 +12307,13 @@ Yap_absmi(int inp) /* else if arity is 0 just pass d0 through */ /* Ding, ding, we made it */ XREG(PREG->u.xxc.x) = d0; - PREG = NEXTOP(NEXTOP(NEXTOP(PREG, xxc),sla),l); + PREG = NEXTOP(NEXTOP(NEXTOP(PREG, xxc),sbpp),l); GONext(); } /* now let's build a compound term */ if (d1 == 0) { XREG(PREG->u.xxc.x) = d0; - PREG = NEXTOP(NEXTOP(NEXTOP(PREG, xxc),sla),l); + PREG = NEXTOP(NEXTOP(NEXTOP(PREG, xxc),sbpp),l); GONext(); } if (!IsAtomTerm(d0)) { @@ -12336,7 +12334,7 @@ Yap_absmi(int inp) if (pt1+d1 > ENV || pt1+d1 > (CELL *)B) { /* make sure we have something to show for our trouble */ saveregs(); - if (!Yap_gc(0, YREG, NEXTOP(NEXTOP(PREG,xxc),sla))) { + if (!Yap_gc(0, YREG, NEXTOP(NEXTOP(PREG,xxc),sbpp))) { Yap_Error(OUT_OF_STACK_ERROR,TermNil,Yap_ErrorMessage); setregs(); JMPNext(); @@ -12356,7 +12354,7 @@ Yap_absmi(int inp) /* else if arity is 0 just pass d0 through */ /* Ding, ding, we made it */ XREG(PREG->u.xxc.x) = d0; - PREG = NEXTOP(NEXTOP(NEXTOP(PREG, xxc),sla),l); + PREG = NEXTOP(NEXTOP(NEXTOP(PREG, xxc),sbpp),l); GONext(); BEGP(pt1); @@ -12415,7 +12413,7 @@ Yap_absmi(int inp) H += 2; BEGP(pt1); pt1 = YREG + PREG->u.yxx.y; - PREG = NEXTOP(NEXTOP(NEXTOP(PREG, yxx),sla),l); + PREG = NEXTOP(NEXTOP(NEXTOP(PREG, yxx),sbpp),l); #if defined(SBA) && defined(FROZEN_STACKS) Bind_Local(pt1,d0); #else @@ -12443,7 +12441,7 @@ Yap_absmi(int inp) if (pt1+d1 > ENV || pt1+d1 > (CELL *)B) { /* make sure we have something to show for our trouble */ saveregs(); - if (!Yap_gcl((1+d1)*sizeof(CELL), 0, YREG, NEXTOP(NEXTOP(PREG,yxx),sla))) { + if (!Yap_gcl((1+d1)*sizeof(CELL), 0, YREG, NEXTOP(NEXTOP(PREG,yxx),sbpp))) { Yap_Error(OUT_OF_STACK_ERROR,TermNil,Yap_ErrorMessage); setregs(); JMPNext(); @@ -12463,7 +12461,7 @@ Yap_absmi(int inp) /* Ding, ding, we made it */ BEGP(pt1); pt1 = YREG + PREG->u.yxx.y; - PREG = NEXTOP(NEXTOP(NEXTOP(PREG, yxx),sla),l); + PREG = NEXTOP(NEXTOP(NEXTOP(PREG, yxx),sbpp),l); #if defined(SBA) && defined(FROZEN_STACKS) Bind_Local(pt1,d0); #else @@ -12474,7 +12472,7 @@ Yap_absmi(int inp) } else if (d1 == 0) { BEGP(pt1); pt1 = YREG + PREG->u.yxx.y; - PREG = NEXTOP(NEXTOP(NEXTOP(PREG, yxx),sla),l); + PREG = NEXTOP(NEXTOP(NEXTOP(PREG, yxx),sbpp),l); #if defined(SBA) && defined(FROZEN_STACKS) Bind_Local(pt1,d0); #else @@ -12510,23 +12508,23 @@ Yap_absmi(int inp) ENDD(d0); ENDOp(); - Op(p_func2s_y_cv, ycx); + Op(p_func2s_y_cv, yxc); /* A1 is a variable */ restart_func2s_y_cv: #ifdef LOW_LEVEL_TRACER if (Yap_do_low_level_trace) { RESET_VARIABLE(H); - H[1] = PREG->u.ycx.c; - H[2] = XREG(PREG->u.ycx.xi); + H[1] = PREG->u.yxc.c; + H[2] = XREG(PREG->u.yxc.xi); low_level_trace(enter_pred,RepPredProp(Yap_GetPredPropByFunc(Yap_MkFunctor(Yap_LookupAtom("functor"),3),0)),H); } #endif /* LOW_LEVEL_TRACE */ /* We have to build the structure */ BEGD(d0); - d0 = PREG->u.ycx.c; + d0 = PREG->u.yxc.c; /* we do, let's get the third argument */ BEGD(d1); - d1 = XREG(PREG->u.ycx.xi); + d1 = XREG(PREG->u.yxc.xi); deref_head(d1, func2s_y_unk_cv); func2s_y_nvar_cv: /* Uuuff, the second and third argument are bound */ @@ -12548,8 +12546,8 @@ Yap_absmi(int inp) /* else if arity is 0 just pass d0 through */ /* Ding, ding, we made it */ BEGP(pt1); - pt1 = YREG + PREG->u.ycx.y; - PREG = NEXTOP(NEXTOP(NEXTOP(PREG, ycx),sla),l); + pt1 = YREG + PREG->u.yxc.y; + PREG = NEXTOP(NEXTOP(NEXTOP(PREG, yxc),sbpp),l); #if defined(SBA) && defined(FROZEN_STACKS) Bind_Local(pt1,d0); #else @@ -12578,7 +12576,7 @@ Yap_absmi(int inp) if (pt1+d1 > ENV || pt1+d1 > (CELL *)B) { /* make sure we have something to show for our trouble */ saveregs(); - if (!Yap_gcl((1+d1)*sizeof(CELL), 0, YREG, NEXTOP(NEXTOP(PREG,ycx),sla))) { + if (!Yap_gcl((1+d1)*sizeof(CELL), 0, YREG, NEXTOP(NEXTOP(PREG,yxc),sbpp))) { Yap_Error(OUT_OF_STACK_ERROR,TermNil,Yap_ErrorMessage); setregs(); JMPNext(); @@ -12597,8 +12595,8 @@ Yap_absmi(int inp) /* else if arity is 0 just pass d0 through */ /* Ding, ding, we made it */ BEGP(pt1); - pt1 = YREG + PREG->u.ycx.y; - PREG = NEXTOP(NEXTOP(NEXTOP(PREG, ycx),sla),l); + pt1 = YREG + PREG->u.yxc.y; + PREG = NEXTOP(NEXTOP(NEXTOP(PREG, yxc),sbpp),l); #if defined(SBA) && defined(FROZEN_STACKS) Bind_Local(pt1,d0); #else @@ -12608,8 +12606,8 @@ Yap_absmi(int inp) GONext(); } else if (d1 == 0) { BEGP(pt1); - pt1 = YREG + PREG->u.ycx.y; - PREG = NEXTOP(NEXTOP(NEXTOP(PREG, ycx),sla),l); + pt1 = YREG + PREG->u.yxc.y; + PREG = NEXTOP(NEXTOP(NEXTOP(PREG, yxc),sbpp),l); #if defined(SBA) && defined(FROZEN_STACKS) Bind_Local(pt1,d0); #else @@ -12676,7 +12674,7 @@ Yap_absmi(int inp) /* Ding, ding, we made it */ BEGP(pt1); pt1 = YREG + PREG->u.yxc.y; - PREG = NEXTOP(NEXTOP(NEXTOP(PREG, yxc),sla),l); + PREG = NEXTOP(NEXTOP(NEXTOP(PREG, yxc),sbpp),l); #if defined(SBA) && defined(FROZEN_STACKS) Bind_Local(pt1,d0); #else @@ -12688,7 +12686,7 @@ Yap_absmi(int inp) if (d1 == 0) { BEGP(pt1); pt1 = YREG + PREG->u.yxc.y; - PREG = NEXTOP(NEXTOP(NEXTOP(PREG, yxc),sla),l); + PREG = NEXTOP(NEXTOP(NEXTOP(PREG, yxc),sbpp),l); #if defined(SBA) && defined(FROZEN_STACKS) Bind_Local(pt1,d0); #else @@ -12722,7 +12720,7 @@ Yap_absmi(int inp) if (pt1+d1 > ENV || pt1+d1 > (CELL *)B) { /* make sure we have something to show for our trouble */ saveregs(); - if (!Yap_gcl((1+d1)*sizeof(CELL), 0, YREG, NEXTOP(NEXTOP(PREG,yxc),sla))) { + if (!Yap_gcl((1+d1)*sizeof(CELL), 0, YREG, NEXTOP(NEXTOP(PREG,yxc),sbpp))) { Yap_Error(OUT_OF_STACK_ERROR,TermNil,Yap_ErrorMessage); setregs(); JMPNext(); @@ -12742,7 +12740,7 @@ Yap_absmi(int inp) /* Ding, ding, we made it */ BEGP(pt1); pt1 = YREG + PREG->u.yxc.y; - PREG = NEXTOP(NEXTOP(NEXTOP(PREG, yxc),sla),l); + PREG = NEXTOP(NEXTOP(NEXTOP(PREG, yxc),sbpp),l); #if defined(SBA) && defined(FROZEN_STACKS) Bind_Local(pt1,d0); #else @@ -12811,42 +12809,42 @@ Yap_absmi(int inp) ENDD(d0); ENDOp(); - Op(p_func2f_xy, xyx); + Op(p_func2f_xy, xxy); #ifdef LOW_LEVEL_TRACER if (Yap_do_low_level_trace) { - H[0] = XREG(PREG->u.xyx.x); + H[0] = XREG(PREG->u.xxy.x); RESET_VARIABLE(H+1); RESET_VARIABLE(H+2); low_level_trace(enter_pred,RepPredProp(Yap_GetPredPropByFunc(Yap_MkFunctor(Yap_LookupAtom("functor"),3),0)),H); } #endif /* LOW_LEVEL_TRACE */ BEGD(d0); - d0 = XREG(PREG->u.xyx.x); + d0 = XREG(PREG->u.xxy.x); deref_head(d0, func2f_xy_unk); func2f_xy_nvar: if (IsApplTerm(d0)) { Functor d1 = FunctorOfTerm(d0); - CELL *pt0 = YREG+PREG->u.xyx.y2; + CELL *pt0 = YREG+PREG->u.xxy.y2; if (IsExtensionFunctor(d1)) { - XREG(PREG->u.xyx.x1) = d0; - PREG = NEXTOP(PREG, xyx); + XREG(PREG->u.xxy.x1) = d0; + PREG = NEXTOP(PREG, xxy); *pt0 = MkIntTerm(0); GONext(); } - XREG(PREG->u.xyx.x1) = MkAtomTerm(NameOfFunctor(d1)); - PREG = NEXTOP(PREG, xyx); + XREG(PREG->u.xxy.x1) = MkAtomTerm(NameOfFunctor(d1)); + PREG = NEXTOP(PREG, xxy); *pt0 = MkIntegerTerm(ArityOfFunctor(d1)); GONext(); } else if (IsPairTerm(d0)) { - CELL *pt0 = YREG+PREG->u.xyx.y2; - XREG(PREG->u.xyx.x1) = TermDot; - PREG = NEXTOP(PREG, xyx); + CELL *pt0 = YREG+PREG->u.xxy.y2; + XREG(PREG->u.xxy.x1) = TermDot; + PREG = NEXTOP(PREG, xxy); *pt0 = MkIntTerm(2); GONext(); } else { - CELL *pt0 = YREG+PREG->u.xyx.y2; - XREG(PREG->u.xyx.x1) = d0; - PREG = NEXTOP(PREG, xyx); + CELL *pt0 = YREG+PREG->u.xxy.y2; + XREG(PREG->u.xxy.x1) = d0; + PREG = NEXTOP(PREG, xxy); *pt0 = MkIntTerm(0); GONext(); } @@ -13036,13 +13034,13 @@ Yap_absmi(int inp) FAIL(); } /* Done */ - PREG = NEXTOP(NEXTOP(NEXTOP(PREG, e),sla),l); + PREG = NEXTOP(NEXTOP(NEXTOP(PREG, e),sbmp),l); GONext(); BEGP(pt0); deref_body(d1, pt0, func_nvar3_unk, func_nvar3_nvar); /* A3 is a variable, go and bind it */ - PREG = NEXTOP(NEXTOP(NEXTOP(PREG, e),sla),l); + PREG = NEXTOP(NEXTOP(NEXTOP(PREG, e),sbmp),l); BIND(pt0, d0, bind_func_nvar3_var); /* Done */ #ifdef COROUTINING @@ -13112,7 +13110,7 @@ Yap_absmi(int inp) if (pt1+d1 > ENV || pt1+d1 > (CELL *)B) { /* make sure we have something to show for our trouble */ saveregs(); - if (!Yap_gcl((1+d1)*sizeof(CELL), 3, YREG, NEXTOP(NEXTOP(PREG,e),sla))) { + if (!Yap_gcl((1+d1)*sizeof(CELL), 3, YREG, NEXTOP(NEXTOP(PREG,e),sbmp))) { Yap_Error(OUT_OF_STACK_ERROR,TermNil,Yap_ErrorMessage); setregs(); JMPNext(); @@ -13136,7 +13134,7 @@ Yap_absmi(int inp) } /* else if arity is 0 just pass d0 through */ /* Ding, ding, we made it */ - PREG = NEXTOP(NEXTOP(NEXTOP(PREG, e),sla),l); + PREG = NEXTOP(NEXTOP(NEXTOP(PREG, e),sbpp),l); BIND(pt0, d0, bind_func_var_3nvar); #ifdef COROUTINING DO_TRAIL(pt0, d0); @@ -13168,7 +13166,7 @@ Yap_absmi(int inp) ENDD(d0); ENDOp(); - BOp(p_execute2, sla); + BOp(p_execute2, sbpp); { PredEntry *pen; Term mod = ARG2; @@ -13182,7 +13180,7 @@ Yap_absmi(int inp) } CACHE_Y_AS_ENV(YREG); /* Try to preserve the environment */ - ENV_YREG = (CELL *) (((char *) YREG) + PREG->u.sla.s); + ENV_YREG = (CELL *) (((char *) YREG) + PREG->u.sbpp.s); #ifdef FROZEN_STACKS { choiceptr top_b = PROTECT_FROZEN_B(B); @@ -13238,7 +13236,7 @@ Yap_absmi(int inp) } else { goto execute2_metacall; } - ENV_YREG[E_CP] = (CELL)NEXTOP(PREG,sla); + ENV_YREG[E_CP] = (CELL)NEXTOP(PREG,sbpp); ENV_YREG[E_CB] = (CELL)B; ENV_YREG[E_E] = (CELL)ENV; #ifdef DEPTH_LIMIT @@ -13300,7 +13298,7 @@ Yap_absmi(int inp) #ifndef NO_CHECKING check_stack(NoStackPExecute2, H); #endif - CPREG = NEXTOP(PREG, sla); + CPREG = NEXTOP(PREG, sbpp); ALWAYS_LOOKAHEAD(pen->OpcodeOfPred); PREG = pen->CodeOfPred; /* for profiler */ @@ -13353,7 +13351,7 @@ Yap_absmi(int inp) goto creep_pe; } saveregs_and_ycache(); - if (!Yap_gc(((PredEntry *)SREG)->ArityOfPE, ENV, NEXTOP(PREG, sla))) { + if (!Yap_gc(((PredEntry *)SREG)->ArityOfPE, ENV, NEXTOP(PREG, sbpp))) { Yap_Error(OUT_OF_STACK_ERROR,TermNil,Yap_ErrorMessage); } setregs_and_ycache(); @@ -13371,14 +13369,14 @@ Yap_absmi(int inp) } ENDBOp(); - BOp(p_execute, sla); + BOp(p_execute, sbmp); { PredEntry *pen; - Term mod = PREG->u.sla.sla_u.mod; + Term mod = PREG->u.sbmp.mod; CACHE_Y_AS_ENV(YREG); /* Try to preserve the environment */ - ENV_YREG = (CELL *) (((char *) YREG) + PREG->u.sla.s); + ENV_YREG = (CELL *) (((char *) YREG) + PREG->u.sbmp.s); #ifdef FROZEN_STACKS { choiceptr top_b = PROTECT_FROZEN_B(B); @@ -13434,7 +13432,7 @@ Yap_absmi(int inp) } else { goto execute_metacall; } - ENV_YREG[E_CP] = (CELL)NEXTOP(PREG,sla); + ENV_YREG[E_CP] = (CELL)NEXTOP(PREG,sbmp); ENV_YREG[E_CB] = (CELL)B; ENV_YREG[E_E] = (CELL)ENV; #ifdef DEPTH_LIMIT @@ -13496,7 +13494,7 @@ Yap_absmi(int inp) #ifndef NO_CHECKING check_stack(NoStackPExecute, H); #endif - CPREG = NEXTOP(PREG, sla); + CPREG = NEXTOP(PREG, sbmp); ALWAYS_LOOKAHEAD(pen->OpcodeOfPred); PREG = pen->CodeOfPred; /* for profiler */ @@ -13549,7 +13547,7 @@ Yap_absmi(int inp) goto creep_pe; } saveregs_and_ycache(); - if (!Yap_gc(((PredEntry *)SREG)->ArityOfPE, ENV, NEXTOP(PREG, sla))) { + if (!Yap_gc(((PredEntry *)SREG)->ArityOfPE, ENV, NEXTOP(PREG, sbmp))) { Yap_Error(OUT_OF_STACK_ERROR,TermNil,Yap_ErrorMessage); } setregs_and_ycache(); @@ -13559,10 +13557,10 @@ Yap_absmi(int inp) ENDBOp(); creep_pe: /* do creep in call */ - CPREG = NEXTOP(PREG, sla); + CPREG = NEXTOP(PREG, sbmp); goto creep; - BOp(p_execute_tail, sla); + BOp(p_execute_tail, sbpp); { PredEntry *pen; Term mod; @@ -13635,7 +13633,7 @@ Yap_absmi(int inp) ENV = ENV_YREG; ENV_YREG -= EnvSizeInCells+3; d0 = SREG[1]; - CPREG = NEXTOP(COMMA_CODE,sla); + CPREG = NEXTOP(COMMA_CODE,sbpp); execute_comma_comma2: /* create an to execute the call */ deref_head(d0, execute_comma_comma2_unk); @@ -13860,7 +13858,7 @@ Yap_absmi(int inp) } UNLOCK(SignalLock); saveregs(); - if (!Yap_gc(((PredEntry *)SREG)->ArityOfPE, ENV, NEXTOP(PREG, sla))) { + if (!Yap_gc(((PredEntry *)SREG)->ArityOfPE, ENV, NEXTOP(PREG, sbpp))) { Yap_Error(OUT_OF_STACK_ERROR,TermNil,Yap_ErrorMessage); } setregs(); diff --git a/C/amasm.c b/C/amasm.c index 668deff07..5924fa7dc 100644 --- a/C/amasm.c +++ b/C/amasm.c @@ -230,10 +230,10 @@ STATIC_PROTO(OPCODE emit_op, (op_numbers)); STATIC_PROTO(yamop *a_cle, (op_numbers, yamop *, int, struct intermediates *)); STATIC_PROTO(yamop *a_e, (op_numbers, yamop *, int)); STATIC_PROTO(yamop *a_ue, (op_numbers, op_numbers, yamop *, int)); -STATIC_PROTO(yamop *a_v, (op_numbers, yamop *, int, struct PSEUDO *)); -STATIC_PROTO(yamop *a_uv, (Ventry *,op_numbers, op_numbers, yamop *, int)); -STATIC_PROTO(yamop *a_vr, (op_numbers, yamop *, int, struct intermediates *)); -STATIC_PROTO(yamop *a_rv, (op_numbers, OPREG, yamop *, int, struct PSEUDO *)); +STATIC_PROTO(yamop *a_v, (op_numbers, op_numbers, yamop *, int, struct PSEUDO *)); +STATIC_PROTO(yamop *a_uv, (Ventry *,op_numbers, op_numbers, op_numbers, op_numbers, yamop *, int)); +STATIC_PROTO(yamop *a_vr, (op_numbers, op_numbers, yamop *, int, struct intermediates *)); +STATIC_PROTO(yamop *a_rv, (op_numbers, op_numbers, OPREG, yamop *, int, struct PSEUDO *)); STATIC_PROTO(yamop *a_vv, (op_numbers, op_numbers, yamop *, int, struct intermediates *)); STATIC_PROTO(yamop *a_glist, (int *, yamop *, int, struct intermediates *)); STATIC_PROTO(void a_pair, (CELL *, int, struct intermediates *)); @@ -260,7 +260,8 @@ STATIC_PROTO(yamop *a_either, (op_numbers, CELL, CELL, yamop *, int, struct int #endif /* YAPOR */ STATIC_PROTO(yamop *a_gl, (op_numbers, yamop *, int, struct PSEUDO *, struct intermediates *)); STATIC_PROTO(yamop *a_bfunc, (CELL, clause_info *, yamop *, int, struct intermediates *)); -STATIC_PROTO(wamreg compile_cmp_flags, (char *)); +STATIC_PROTO( +COUNT compile_cmp_flags, (char *)); STATIC_PROTO(yamop *a_igl, (CELL, op_numbers, yamop *, int, struct intermediates *)); STATIC_PROTO(yamop *a_xigl, (op_numbers, yamop *, int, struct PSEUDO *)); STATIC_PROTO(yamop *a_ucons, (int *, compiler_vm_op, yamop *, int, struct intermediates *)); @@ -482,15 +483,12 @@ a_lucl(op_numbers opcode, yamop *code_p, int pass_no, struct intermediates *cip, if (pass_no) { LogUpdIndex *lcl = (LogUpdIndex *)cip->code_addr; code_p->opc = emit_op(opcode); - code_p->u.Ill.I = lcl; - cip->current_try_lab = &code_p->u.Ill.l1; - cip->current_trust_lab = &code_p->u.Ill.l2; - code_p->u.Ill.s = cip->cpc->rnd3; -#if defined(YAPOR) || defined(THREADS) - code_p->u.Ill.p = cip->CurrentPred; -#endif + code_p->u.Ills.I = lcl; + cip->current_try_lab = &code_p->u.Ills.l1; + cip->current_trust_lab = &code_p->u.Ills.l2; + code_p->u.Ills.s = cip->cpc->rnd3; } - GONEXT(Ill); + GONEXT(Ills); return code_p; } @@ -501,17 +499,11 @@ a_cle(op_numbers opcode, yamop *code_p, int pass_no, struct intermediates *cip) LogUpdClause *cl = (LogUpdClause *)cip->code_addr; code_p->opc = emit_op(opcode); - code_p->u.EC.ClTrail = 0; - code_p->u.EC.ClENV = 0; - code_p->u.EC.ClRefs = 0; - code_p->u.EC.ClBase = cl; -#if defined(THREADS) || defined(YAPOR) - code_p->u.EC.p = cip->CurrentPred; -#endif + code_p->u.L.ClBase = cl; cl->ClExt = code_p; cl->ClFlags |= LogUpdRuleMask; } - GONEXT(EC); + GONEXT(L); return code_p; } @@ -537,23 +529,23 @@ a_ue(op_numbers opcode, op_numbers opcodew, yamop *code_p, int pass_no) } inline static yamop * -a_v(op_numbers opcode, yamop *code_p, int pass_no, struct PSEUDO *cpc) +a_v(op_numbers opcodex, op_numbers opcodey, yamop *code_p, int pass_no, struct PSEUDO *cpc) { Ventry *ve = (Ventry *) cpc->rnd1; OPREG var_offset; int is_y_var = (ve->KindOfVE == PermVar); var_offset = Var_Ref(ve, is_y_var); - if (ve->KindOfVE == PermVar) { + if (is_y_var) { if (pass_no) { - code_p->opc = emit_op((op_numbers)((int)opcode + is_y_var)); + code_p->opc = emit_op(opcodey); code_p->u.y.y = emit_yreg(var_offset); } GONEXT(y); } else { if (pass_no) { - code_p->opc = emit_op((op_numbers)((int)opcode + is_y_var)); + code_p->opc = emit_op(opcodex); code_p->u.x.x = emit_xreg(var_offset); } GONEXT(x); @@ -562,7 +554,7 @@ a_v(op_numbers opcode, yamop *code_p, int pass_no, struct PSEUDO *cpc) } inline static yamop * -a_uv(Ventry *ve, op_numbers opcode, op_numbers opcodew, yamop *code_p, int pass_no) +a_uv(Ventry *ve, op_numbers opcodex, op_numbers opcodexw, op_numbers opcodey, op_numbers opcodeyw, yamop *code_p, int pass_no) { OPREG var_offset; int is_y_var = (ve->KindOfVE == PermVar); @@ -570,16 +562,16 @@ a_uv(Ventry *ve, op_numbers opcode, op_numbers opcodew, yamop *code_p, int pass_ var_offset = Var_Ref(ve, is_y_var); if (is_y_var) { if (pass_no) { - code_p->opc = emit_op((op_numbers)((int)opcode + is_y_var)); - code_p->u.oy.opcw = emit_op((op_numbers)((int)opcodew + is_y_var)); + code_p->opc = emit_op(opcodey); + code_p->u.oy.opcw = emit_op(opcodeyw); code_p->u.oy.y = emit_yreg(var_offset); } GONEXT(oy); } else { if (pass_no) { - code_p->opc = emit_op((op_numbers)((int)opcode + is_y_var)); - code_p->u.ox.opcw = emit_op((op_numbers)((int)opcodew + is_y_var)); + code_p->opc = emit_op(opcodex); + code_p->u.ox.opcw = emit_op(opcodexw); code_p->u.ox.x = emit_xreg(var_offset); } GONEXT(ox); @@ -614,7 +606,7 @@ a_vv(op_numbers opcode, op_numbers opcodew, yamop *code_p, int pass_no, struct i } inline static yamop * -a_vr(op_numbers opcode, yamop *code_p, int pass_no, struct intermediates *cip) +a_vr(op_numbers opcodex, op_numbers opcodey, yamop *code_p, int pass_no, struct intermediates *cip) { struct PSEUDO *cpc = cip->cpc; Ventry *ve = (Ventry *) cpc->rnd1; @@ -625,13 +617,13 @@ a_vr(op_numbers opcode, yamop *code_p, int pass_no, struct intermediates *cip) OPREG var_offset; var_offset = Var_Ref(ve, is_y_var); - code_p->opc = emit_op((op_numbers)((int)opcode + is_y_var)); + code_p->opc = emit_op(opcodey); code_p->u.yx.y = emit_yreg(var_offset); code_p->u.yx.x = emit_x(cpc->rnd2); } GONEXT(yx); } - else if (opcode == _put_x_val && + else if (opcodex == _put_x_val && cpc->nextInst && cpc->nextInst->op == put_val_op && !(((Ventry *) cpc->nextInst->rnd1)->KindOfVE == PermVar)) { @@ -656,7 +648,7 @@ a_vr(op_numbers opcode, yamop *code_p, int pass_no, struct intermediates *cip) OPREG var_offset; var_offset = Var_Ref(ve, is_y_var); - code_p->opc = emit_op((op_numbers)((int)opcode + is_y_var)); + code_p->opc = emit_op(opcodex); code_p->u.xx.xl = emit_xreg(var_offset); code_p->u.xx.xr = emit_x(cpc->rnd2); } @@ -666,14 +658,14 @@ a_vr(op_numbers opcode, yamop *code_p, int pass_no, struct intermediates *cip) } inline static yamop * -a_rv(op_numbers opcode, OPREG var_offset, yamop *code_p, int pass_no, struct PSEUDO *cpc) +a_rv(op_numbers opcodex, op_numbers opcodey, OPREG var_offset, yamop *code_p, int pass_no, struct PSEUDO *cpc) { Ventry *ve = (Ventry *) cpc->rnd1; int is_y_var = (ve->KindOfVE == PermVar); if (is_y_var) { if (pass_no) { - code_p->opc = emit_op((op_numbers)((int)opcode + is_y_var)); + code_p->opc = emit_op(opcodey); code_p->u.xy.x = emit_x(cpc->rnd2); code_p->u.xy.y = emit_yreg(var_offset); } @@ -681,7 +673,7 @@ a_rv(op_numbers opcode, OPREG var_offset, yamop *code_p, int pass_no, struct PSE } else { if (pass_no) { - code_p->opc = emit_op((op_numbers)((int)opcode + is_y_var)); + code_p->opc = emit_op(opcodex); code_p->u.xx.xl = emit_x(cpc->rnd2); code_p->u.xx.xr = emit_xreg(var_offset); } @@ -792,10 +784,10 @@ a_f(CELL rnd1, op_numbers opcode, yamop *code_p, int pass_no) Functor f = emit_f(rnd1); code_p->opc = emit_op(opcode); - code_p->u.f.f = f; - code_p->u.f.a = ArityOfFunctor(f); + code_p->u.fa.f = f; + code_p->u.fa.a = ArityOfFunctor(f); } - GONEXT(f); + GONEXT(fa); return code_p; } @@ -806,11 +798,11 @@ a_uf(CELL rnd1, op_numbers opcode, op_numbers opcodew, yamop *code_p, int pass_n Functor f = emit_f(rnd1); code_p->opc = emit_op(opcode); - code_p->u.of.opcw = emit_op(opcodew); - code_p->u.of.f = f; - code_p->u.of.a = ArityOfFunctor(f); + code_p->u.ofa.opcw = emit_op(opcodew); + code_p->u.ofa.f = f; + code_p->u.ofa.a = ArityOfFunctor(f); } - GONEXT(of); + GONEXT(ofa); return code_p; } @@ -978,11 +970,11 @@ a_rf(op_numbers opcode, yamop *code_p, int pass_no, struct PSEUDO *cpc) { if (pass_no) { code_p->opc = emit_op(opcode); - code_p->u.xf.x = emit_x(cpc->rnd2); - code_p->u.xf.f = emit_f(cpc->rnd1); - code_p->u.xf.a = ArityOfFunctor(emit_f(cpc->rnd1)); + code_p->u.xfa.x = emit_x(cpc->rnd2); + code_p->u.xfa.f = emit_f(cpc->rnd1); + code_p->u.xfa.a = ArityOfFunctor(emit_f(cpc->rnd1)); } - GONEXT(xf); + GONEXT(xfa); return code_p; } @@ -1243,14 +1235,14 @@ a_p(op_numbers opcode, clause_info *clinfo, yamop *code_p, int pass_no, struct i longjmp(cip->CompilerBotch, 1); } else code_p->opc = emit_op(_call_c_wfail); - code_p->u.sdl.s = + code_p->u.sdlp.s = emit_count(-Signed(RealEnvSize) - CELLSIZE * cip->cpc->rnd2); - code_p->u.sdl.l = + code_p->u.sdlp.l = emit_a(Unsigned(cip->code_addr) + cip->label_offset[clinfo->commit_lab]); - code_p->u.sdl.p = + code_p->u.sdlp.p = emit_pe(RepPredProp(fe)); } - GONEXT(sdl); + GONEXT(sdlp); clinfo->commit_lab = 0; } else { if (pass_no) { @@ -1265,22 +1257,22 @@ a_p(op_numbers opcode, clause_info *clinfo, yamop *code_p, int pass_no, struct i code_p->opc = emit_op(_call_cpred); } } - code_p->u.sla.s = emit_count(-Signed(RealEnvSize) - CELLSIZE + code_p->u.sbpp.s = emit_count(-Signed(RealEnvSize) - CELLSIZE * (cip->cpc->rnd2)); if (RepPredProp(fe)->FunctorOfPred != FunctorExecuteInMod) { - code_p->u.sla.sla_u.p = RepPredProp(fe); + code_p->u.sbpp.p = RepPredProp(fe); } else { - code_p->u.sla.sla_u.mod = cip->cpc->rnd4; + code_p->u.sbmp.mod = cip->cpc->rnd4; } - code_p->u.sla.p0 = clinfo->CurrentPred; + code_p->u.sbpp.p0 = clinfo->CurrentPred; if (cip->cpc->rnd2) { - code_p->u.sla.bmap = emit_bmlabel(cip->cpc->arnds[1], cip); + code_p->u.sbpp.bmap = emit_bmlabel(cip->cpc->arnds[1], cip); } else { /* there is no bitmap as there are no variables in the environment */ - code_p->u.sla.bmap = NULL; + code_p->u.sbpp.bmap = NULL; } } - GONEXT(sla); + GONEXT(sbpp); } return code_p; } @@ -1300,17 +1292,17 @@ a_p(op_numbers opcode, clause_info *clinfo, yamop *code_p, int pass_no, struct i } if (opcode == _call) { if (pass_no) { - code_p->u.sla.s = emit_count(-Signed(RealEnvSize) - CELLSIZE * + code_p->u.sbpp.s = emit_count(-Signed(RealEnvSize) - CELLSIZE * cip->cpc->rnd2); - code_p->u.sla.sla_u.p = RepPredProp(fe); - code_p->u.sla.p0 = clinfo->CurrentPred; + code_p->u.sbpp.p = RepPredProp(fe); + code_p->u.sbpp.p0 = clinfo->CurrentPred; if (cip->cpc->rnd2) - code_p->u.sla.bmap = emit_bmlabel(cip->cpc->arnds[1], cip); + code_p->u.sbpp.bmap = emit_bmlabel(cip->cpc->arnds[1], cip); else /* there is no bitmap as there are no variables in the environment */ - code_p->u.sla.bmap = NULL; + code_p->u.sbpp.bmap = NULL; } - GONEXT(sla); + GONEXT(sbpp); } else if (opcode == _execute || opcode == _dexecute) { @@ -1347,17 +1339,17 @@ a_empty_call(clause_info *clinfo, yamop *code_p, int pass_no, struct intermedia } if (pass_no) { PredEntry *pe = RepPredProp(Yap_GetPredPropByAtom(AtomTrue,0)); - code_p->u.sla.s = emit_count(-Signed(RealEnvSize) - CELLSIZE * + code_p->u.sbpp.s = emit_count(-Signed(RealEnvSize) - CELLSIZE * cip->cpc->rnd2); - code_p->u.sla.sla_u.p = pe; - code_p->u.sla.p0 = clinfo->CurrentPred; + code_p->u.sbpp.p = pe; + code_p->u.sbpp.p0 = clinfo->CurrentPred; if (cip->cpc->rnd2) - code_p->u.sla.bmap = emit_bmlabel(cip->cpc->rnd1, cip); + code_p->u.sbpp.bmap = emit_bmlabel(cip->cpc->rnd1, cip); else /* there is no bitmap as there are no variables in the environment */ - code_p->u.sla.bmap = NULL; + code_p->u.sbpp.bmap = NULL; } - GONEXT(sla); + GONEXT(sbpp); return code_p; } @@ -1372,7 +1364,7 @@ a_pl(op_numbers opcode, PredEntry *pred, yamop *code_p, int pass_no) return code_p; } -static wamreg +static COUNT compile_cmp_flags(char *s) { if (strcmp(s,"=<") == 0) @@ -1401,7 +1393,7 @@ compile_cmp_flags(char *s) return(0); } -wamreg +COUNT Yap_compile_cmp_flags(PredEntry *pred) { return @@ -1425,35 +1417,35 @@ a_bfunc(CELL pred, clause_info *clinfo, yamop *code_p, int pass_no, struct inter if (is_y_var) { if (pass_no) { code_p->opc = emit_op(_call_bfunc_yy); - code_p->u.llyy.p = RepPredProp(((Prop)pred)); + code_p->u.plyys.p = RepPredProp(((Prop)pred)); if (clinfo->commit_lab) { - code_p->u.llyy.f = + code_p->u.plyys.f = emit_a(Unsigned(cip->code_addr) + cip->label_offset[clinfo->commit_lab]); clinfo->commit_lab = 0; } else { - code_p->u.llyy.f = FAILCODE; + code_p->u.plyys.f = FAILCODE; } - code_p->u.llyy.y1 = v1; - code_p->u.llyy.y2 = emit_yreg(var_offset); - code_p->u.llyy.flags = compile_cmp_flags(RepAtom(NameOfFunctor(RepPredProp(((Prop)pred))->FunctorOfPred))->StrOfAE); + code_p->u.plyys.y1 = v1; + code_p->u.plyys.y2 = emit_yreg(var_offset); + code_p->u.plyys.flags = compile_cmp_flags(RepAtom(NameOfFunctor(RepPredProp(((Prop)pred))->FunctorOfPred))->StrOfAE); } - GONEXT(llyy); + GONEXT(plyys); } else { if (pass_no) { code_p->opc = emit_op(_call_bfunc_yx); - code_p->u.llxy.p = RepPredProp(((Prop)pred)); + code_p->u.plxys.p = RepPredProp(((Prop)pred)); if (clinfo->commit_lab) { - code_p->u.llxy.f = + code_p->u.plxys.f = emit_a(Unsigned(cip->code_addr) + cip->label_offset[clinfo->commit_lab]); clinfo->commit_lab = 0; } else { - code_p->u.llxy.f = FAILCODE; + code_p->u.plxys.f = FAILCODE; } - code_p->u.llxy.x = emit_xreg(var_offset); - code_p->u.llxy.y = v1; - code_p->u.llxy.flags = compile_cmp_flags(RepAtom(NameOfFunctor(RepPredProp(((Prop)pred))->FunctorOfPred))->StrOfAE); + code_p->u.plxys.x = emit_xreg(var_offset); + code_p->u.plxys.y = v1; + code_p->u.plxys.flags = compile_cmp_flags(RepAtom(NameOfFunctor(RepPredProp(((Prop)pred))->FunctorOfPred))->StrOfAE); } - GONEXT(llxy); + GONEXT(plxys); } } else { wamreg x1 = emit_xreg(var_offset); @@ -1466,35 +1458,35 @@ a_bfunc(CELL pred, clause_info *clinfo, yamop *code_p, int pass_no, struct inter if (is_y_var) { if (pass_no) { code_p->opc = emit_op(_call_bfunc_xy); - code_p->u.llxy.p = RepPredProp(((Prop)pred)); + code_p->u.plxys.p = RepPredProp(((Prop)pred)); if (clinfo->commit_lab) { - code_p->u.llxy.f = + code_p->u.plxys.f = emit_a(Unsigned(cip->code_addr) + cip->label_offset[clinfo->commit_lab]); clinfo->commit_lab = 0; } else { - code_p->u.llxy.f = FAILCODE; + code_p->u.plxys.f = FAILCODE; } - code_p->u.llxy.x = x1; - code_p->u.llxy.y = emit_yreg(var_offset); - code_p->u.llxy.flags = compile_cmp_flags(RepAtom(NameOfFunctor(RepPredProp(((Prop)pred))->FunctorOfPred))->StrOfAE); + code_p->u.plxys.x = x1; + code_p->u.plxys.y = emit_yreg(var_offset); + code_p->u.plxys.flags = compile_cmp_flags(RepAtom(NameOfFunctor(RepPredProp(((Prop)pred))->FunctorOfPred))->StrOfAE); } - GONEXT(llxy); + GONEXT(plxys); } else { if (pass_no) { code_p->opc = emit_op(_call_bfunc_xx); - code_p->u.llxx.p = RepPredProp(((Prop)pred)); + code_p->u.plxxs.p = RepPredProp(((Prop)pred)); if (clinfo->commit_lab) { - code_p->u.llxx.f = + code_p->u.plxxs.f = emit_a(Unsigned(cip->code_addr) + cip->label_offset[clinfo->commit_lab]); clinfo->commit_lab = 0; } else { - code_p->u.llxx.f = FAILCODE; + code_p->u.plxxs.f = FAILCODE; } - code_p->u.llxx.x1 = x1; - code_p->u.llxx.x2 = emit_xreg(var_offset); - code_p->u.llxx.flags = compile_cmp_flags(RepAtom(NameOfFunctor(RepPredProp(((Prop)pred))->FunctorOfPred))->StrOfAE); + code_p->u.plxxs.x1 = x1; + code_p->u.plxxs.x2 = emit_xreg(var_offset); + code_p->u.plxxs.flags = compile_cmp_flags(RepAtom(NameOfFunctor(RepPredProp(((Prop)pred))->FunctorOfPred))->StrOfAE); } - GONEXT(llxx); + GONEXT(plxxs); } } return code_p; @@ -1793,7 +1785,7 @@ a_try(op_numbers opcode, CELL lab, CELL opr, int nofalts, int hascut, yamop *cod yamop *newcp; /* emit a special instruction and then a label for backpatching */ if (pass_no) { - UInt size = (UInt)NEXTOP((yamop *)NULL,lld); + UInt size = (UInt)NEXTOP((yamop *)NULL,aLl); if ((newcp = (yamop *)Yap_AllocCodeSpace(size)) == NULL) { /* OOOPS, got in trouble, must do a longjmp and recover space */ save_machine_regs(); @@ -1810,15 +1802,15 @@ a_try(op_numbers opcode, CELL lab, CELL opr, int nofalts, int hascut, yamop *cod try-retry-trust instructions allocated in this run */ - newcp->u.lld.n = cip->try_instructions; + newcp->u.aLl.n = cip->try_instructions; cip->try_instructions = newcp; } else { - newcp->u.lld.n = *cip->current_try_lab; + newcp->u.aLl.n = *cip->current_try_lab; *cip->current_try_lab = newcp; } if (opcode == _try_clause) { newcp->opc = emit_op(_try_logical); - newcp->u.lld.t.s = emit_count(opr); + newcp->u.aLl.s = emit_count(opr); } else if (opcode == _retry) { if (ap->PredFlags & CountPredFlag) newcp->opc = emit_op(_count_retry_logical); @@ -1826,7 +1818,7 @@ a_try(op_numbers opcode, CELL lab, CELL opr, int nofalts, int hascut, yamop *cod newcp->opc = emit_op(_profiled_retry_logical); else newcp->opc = emit_op(_retry_logical); - newcp->u.lld.t.s = emit_count(opr); + newcp->u.aLl.s = emit_count(opr); } else { if (ap->PredFlags & CountPredFlag) newcp->opc = emit_op(_count_trust_logical); @@ -1834,11 +1826,11 @@ a_try(op_numbers opcode, CELL lab, CELL opr, int nofalts, int hascut, yamop *cod newcp->opc = emit_op(_profiled_trust_logical); else newcp->opc = emit_op(_trust_logical); - newcp->u.lld.t.block = (LogUpdIndex *)(cip->code_addr); + newcp->u.ILl.block = (LogUpdIndex *)(cip->code_addr); *cip->current_trust_lab = newcp; } - newcp->u.lld.d = ClauseCodeToLogUpdClause(emit_a(lab)); - cip->current_try_lab = &(newcp->u.lld.n); + newcp->u.aLl.d = ClauseCodeToLogUpdClause(emit_a(lab)); + cip->current_try_lab = &(newcp->u.aLl.n); } return code_p; } @@ -1894,11 +1886,11 @@ a_try(op_numbers opcode, CELL lab, CELL opr, int nofalts, int hascut, yamop *cod } if (pass_no) { code_p->opc = emit_op(opcode); - code_p->u.ld.d = emit_a(lab); - code_p->u.ld.s = emit_count(opr); - code_p->u.ld.p = ap; + code_p->u.apl.d = emit_a(lab); + code_p->u.apl.s = emit_count(opr); + code_p->u.apl.p = ap; #ifdef TABLING - code_p->u.ld.te = ap->TableOfPred; + code_p->u.apl.te = ap->TableOfPred; #endif #ifdef YAPOR INIT_YAMOP_LTT(code_p, nofalts); @@ -1908,7 +1900,7 @@ a_try(op_numbers opcode, CELL lab, CELL opr, int nofalts, int hascut, yamop *cod PUT_YAMOP_SEQ(code_p); #endif /* YAPOR */ } - GONEXT(ld); + GONEXT(apl); return code_p; } @@ -1921,9 +1913,9 @@ a_either(op_numbers opcode, CELL opr, CELL lab, yamop *code_p, int pass_no, stru { if (pass_no) { code_p->opc = emit_op(opcode); - code_p->u.sla.s = emit_count(opr); - code_p->u.sla.sla_u.l = emit_a(lab); - code_p->u.sla.p0 = cip->CurrentPred; + code_p->u.sblp.s = emit_count(opr); + code_p->u.sblp.l = emit_a(lab); + code_p->u.sblp.p0 = cip->CurrentPred; #ifdef YAPOR INIT_YAMOP_LTT(code_p, nofalts); if (hascut) @@ -1931,13 +1923,13 @@ a_either(op_numbers opcode, CELL opr, CELL lab, yamop *code_p, int pass_no, stru if (cip->CurrentPred->PredFlags & SequentialPredFlag) PUT_YAMOP_SEQ(code_p); if(opcode != _or_last) { - code_p->u.sla.bmap = emit_bmlabel(cip->cpc->arnds[1], cip); + code_p->u.sblp.bmap = emit_bmlabel(cip->cpc->arnds[1], cip); } #else - code_p->u.sla.bmap = emit_bmlabel(cip->cpc->arnds[1], cip); + code_p->u.sblp.bmap = emit_bmlabel(cip->cpc->arnds[1], cip); #endif /* YAPOR */ } - GONEXT(sla); + GONEXT(sblp); return code_p; } @@ -2017,7 +2009,7 @@ a_uvar(yamop *code_p, int pass_no, struct intermediates *cip) } } #endif /* AGGREGATE_OPS */ - return a_uv((Ventry *) cip->cpc->rnd1, _unify_x_var, _unify_x_var_write, code_p, pass_no); + return a_uv((Ventry *) cip->cpc->rnd1, _unify_x_var, _unify_x_var_write, _unify_y_var, _unify_y_var_write, code_p, pass_no); } else { #if AGGREGATE_OPS @@ -2054,7 +2046,7 @@ static yamop * a_wvar(yamop *code_p, int pass_no, struct intermediates *cip) { if (!no_ref_var()) - return a_v(_write_x_var, code_p, pass_no, cip->cpc); + return a_v(_write_x_var, _write_y_var, code_p, pass_no, cip->cpc); else { #if AGGREGATE_OPS int i = 0; @@ -2091,7 +2083,7 @@ a_glist(int *do_not_optimise_uatomp, yamop *code_p, int pass_no, struct intermed cip->cpc = pnext; is_y_var = (ve->KindOfVE == PermVar); var_offset = Var_Ref(ve, is_y_var); - return a_rv(_glist_valx, var_offset, code_p, pass_no, cip->cpc); + return a_rv(_glist_valx, _glist_valy, var_offset, code_p, pass_no, cip->cpc); } else if (cip->cpc->rnd2 == 1 && pnext->op == unify_atom_op) { *do_not_optimise_uatomp = TRUE; return a_r(cip->cpc->rnd2, _get_list, code_p, pass_no); @@ -2108,7 +2100,10 @@ a_glist(int *do_not_optimise_uatomp, yamop *code_p, int pass_no, struct intermed ppnext->rnd2 = cip->cpc->rnd2; cip->cpc = ppnext; var_offset = Var_Ref(ve, is_y_var); - return a_rv((op_numbers)((int)_gl_void_varx + (cip->cpc->op == unify_last_var_op ? 0 : 2)), var_offset, code_p, pass_no, cip->cpc); + if (cip->cpc->op == unify_last_var_op) + return a_rv(_gl_void_varx, _gl_void_vary, var_offset, code_p, pass_no, cip->cpc); + else + return a_rv(_gl_void_valx, _gl_void_valy, var_offset, code_p, pass_no, cip->cpc); } else { return a_r(cip->cpc->rnd2, _get_list, code_p, pass_no); } @@ -2269,7 +2264,7 @@ a_f2(int var, cmp_op_info *cmp_info, yamop *code_p, int pass_no, struct intermed if (opc <= _primitive) { if (is_y_var) { if (pass_no) { - code_p->u.yF.y = emit_y(ve); + code_p->u.yl.y = emit_y(ve); switch (opc) { case _atom: code_p->opc = opcode(_p_atom_y); @@ -2306,18 +2301,18 @@ a_f2(int var, cmp_op_info *cmp_info, yamop *code_p, int pass_no, struct intermed break; } if (cmp_info->cl_info->commit_lab) { - code_p->u.yF.F = + code_p->u.yl.F = emit_a(Unsigned(cip->code_addr) + cip->label_offset[cmp_info->cl_info->commit_lab]); cmp_info->cl_info->commit_lab = 0; } else { - code_p->u.yF.F = FAILCODE; + code_p->u.yl.F = FAILCODE; } } - GONEXT(yF); + GONEXT(yl); return code_p; } else { if (pass_no) { - code_p->u.xF.x = emit_x(ve->NoOfVE & MaskVarAdrs); + code_p->u.xl.x = emit_x(ve->NoOfVE & MaskVarAdrs); switch (opc) { case _atom: code_p->opc = opcode(_p_atom_x); @@ -2354,14 +2349,14 @@ a_f2(int var, cmp_op_info *cmp_info, yamop *code_p, int pass_no, struct intermed break; } if (cmp_info->cl_info->commit_lab) { - code_p->u.xF.F = + code_p->u.xl.F = emit_a(Unsigned(cip->code_addr) + cip->label_offset[cmp_info->cl_info->commit_lab]); cmp_info->cl_info->commit_lab = 0; } else { - code_p->u.xF.F = FAILCODE; + code_p->u.xl.F = FAILCODE; } } - GONEXT(xF); + GONEXT(xl); return code_p; } } @@ -2394,11 +2389,11 @@ a_f2(int var, cmp_op_info *cmp_info, yamop *code_p, int pass_no, struct intermed if (nve->KindOfVE == PermVar) { if (pass_no) { code_p->opc = emit_op(_p_func2f_xy); - code_p->u.xyx.x1 = emit_x(ve->NoOfVE & MaskVarAdrs); - code_p->u.xyx.y2 = emit_y(nve); - code_p->u.xyx.x = cmp_info->x1_arg; + code_p->u.xxy.x1 = emit_x(ve->NoOfVE & MaskVarAdrs); + code_p->u.xxy.y2 = emit_y(nve); + code_p->u.xxy.x = cmp_info->x1_arg; } - GONEXT(xyx); + GONEXT(xxy); return code_p; } else { if (pass_no) { @@ -2496,11 +2491,11 @@ a_f2(int var, cmp_op_info *cmp_info, yamop *code_p, int pass_no, struct intermed code_p->opc = emit_op(_p_func2s_y_cv); break; } - code_p->u.ycx.y = emit_y(ve); - code_p->u.ycx.c = cmp_info->c_arg; - code_p->u.ycx.xi = cmp_info->x1_arg; + code_p->u.yxc.y = emit_y(ve); + code_p->u.yxc.c = cmp_info->c_arg; + code_p->u.yxc.xi = cmp_info->x1_arg; } - GONEXT(ycx); + GONEXT(yxc); break; case TYPE_XC: if (pass_no) { @@ -2695,11 +2690,11 @@ a_f2(int var, cmp_op_info *cmp_info, yamop *code_p, int pass_no, struct intermed code_p->opc = emit_op(_p_func2s_vc); break; } - code_p->u.xcx.x = emit_x(ve->NoOfVE & MaskVarAdrs); - code_p->u.xcx.c = cmp_info->c_arg; - code_p->u.xcx.xi = cmp_info->x1_arg; + code_p->u.xxc.x = emit_x(ve->NoOfVE & MaskVarAdrs); + code_p->u.xxc.c = cmp_info->c_arg; + code_p->u.xxc.xi = cmp_info->x1_arg; } - GONEXT(xcx); + GONEXT(xxc); break; } } @@ -2926,16 +2921,16 @@ do_pass(int pass_no, yamop **entry_codep, int assembling, int *clause_has_blobsp break; #endif case get_var_op: - code_p = a_vr(_get_x_var, code_p, pass_no, cip); + code_p = a_vr(_get_x_var, _get_y_var, code_p, pass_no, cip); break; case put_var_op: - code_p = a_vr(_put_x_var, code_p, pass_no, cip); + code_p = a_vr(_put_x_var, _put_y_var, code_p, pass_no, cip); break; case get_val_op: - code_p = a_vr(_get_x_val, code_p, pass_no, cip); + code_p = a_vr(_get_x_val, _get_y_val, code_p, pass_no, cip); break; case put_val_op: - code_p = a_vr(_put_x_val, code_p, pass_no, cip); + code_p = a_vr(_put_x_val, _put_y_val, code_p, pass_no, cip); break; case get_num_op: case get_atom_op: @@ -2986,34 +2981,34 @@ do_pass(int pass_no, yamop **entry_codep, int assembling, int *clause_has_blobsp code_p = a_rf(_put_struct, code_p, pass_no, cip->cpc); break; case put_unsafe_op: - code_p = a_vr((op_numbers)((int)_put_unsafe - 1), code_p, pass_no, cip); + code_p = a_vr(_put_unsafe, _put_unsafe, code_p, pass_no, cip); break; case unify_var_op: code_p = a_uvar(code_p, pass_no, cip); break; case unify_last_var_op: - code_p = a_uv((Ventry *) cip->cpc->rnd1, _unify_l_x_var, _unify_l_x_var_write, code_p, pass_no); + code_p = a_uv((Ventry *) cip->cpc->rnd1, _unify_l_x_var, _unify_l_x_var_write, _unify_l_y_var, _unify_l_y_var_write, code_p, pass_no); break; case write_var_op: code_p = a_wvar(code_p, pass_no, cip); break; case unify_local_op: - code_p = a_uv((Ventry *) cip->cpc->rnd1, _unify_x_loc, _unify_x_loc_write, code_p, pass_no); + code_p = a_uv((Ventry *) cip->cpc->rnd1, _unify_x_loc, _unify_x_loc_write, _unify_y_loc, _unify_y_loc_write, code_p, pass_no); break; case unify_val_op: - code_p = a_uv((Ventry *) cip->cpc->rnd1, _unify_x_val, _unify_x_val_write, code_p, pass_no); + code_p = a_uv((Ventry *) cip->cpc->rnd1, _unify_x_val, _unify_x_val_write, _unify_y_val, _unify_y_val_write, code_p, pass_no); break; case unify_last_local_op: - code_p = a_uv((Ventry *) cip->cpc->rnd1, _unify_l_x_loc, _unify_l_x_loc_write, code_p, pass_no); + code_p = a_uv((Ventry *) cip->cpc->rnd1, _unify_l_x_loc, _unify_l_x_loc_write, _unify_l_y_loc, _unify_l_y_loc_write, code_p, pass_no); break; case unify_last_val_op: - code_p = a_uv((Ventry *) cip->cpc->rnd1, _unify_l_x_val, _unify_l_x_val_write, code_p, pass_no); + code_p = a_uv((Ventry *) cip->cpc->rnd1, _unify_l_x_val, _unify_l_x_val_write, _unify_l_y_val, _unify_l_y_val_write, code_p, pass_no); break; case write_local_op: - code_p = a_v(_write_x_loc, code_p, pass_no, cip->cpc); + code_p = a_v(_write_x_loc, _write_y_loc, code_p, pass_no, cip->cpc); break; case write_val_op: - code_p = a_v(_write_x_val, code_p, pass_no, cip->cpc); + code_p = a_v(_write_x_val, _write_y_val, code_p, pass_no, cip->cpc); break; case unify_num_op: case unify_atom_op: @@ -3095,16 +3090,16 @@ do_pass(int pass_no, yamop **entry_codep, int assembling, int *clause_has_blobsp break; case save_b_op: case patch_b_op: - code_p = a_v(_save_b_x, code_p, pass_no, cip->cpc); + code_p = a_v(_save_b_x, _save_b_y, code_p, pass_no, cip->cpc); break; case commit_b_op: - code_p = a_v(_commit_b_x, code_p, pass_no, cip->cpc); + code_p = a_v(_commit_b_x, _commit_b_y, code_p, pass_no, cip->cpc); break; case save_pair_op: - code_p = a_uv((Ventry *) cip->cpc->rnd1, _save_pair_x, _save_pair_x_write, code_p, pass_no); + code_p = a_uv((Ventry *) cip->cpc->rnd1, _save_pair_x, _save_pair_x_write, _save_pair_y, _save_pair_y_write, code_p, pass_no); break; case save_appl_op: - code_p = a_uv((Ventry *) cip->cpc->rnd1, _save_appl_x, _save_appl_x_write, code_p, pass_no); + code_p = a_uv((Ventry *) cip->cpc->rnd1, _save_appl_x, _save_appl_x_write, _save_appl_y, _save_appl_y_write, code_p, pass_no); break; case fail_op: code_p = a_e(_op_fail, code_p, pass_no); @@ -3558,7 +3553,7 @@ Yap_assemble(int mode, Term t, PredEntry *ap, int is_fact, struct intermediates } if (ap->PredFlags & DynamicPredFlag) { size = - (CELL)NEXTOP(NEXTOP(NEXTOP((yamop *)(((DynamicClause *)NULL)->ClCode),ld),sla),e); + (CELL)NEXTOP(NEXTOP(NEXTOP((yamop *)(((DynamicClause *)NULL)->ClCode),apl),sbpp),e); } if ((CELL)code_p > size) size = (CELL)code_p; @@ -3631,28 +3626,28 @@ Yap_InitComma(void) { yamop *code_p = COMMA_CODE; code_p->opc = opcode(_call); - code_p->u.sla.s = emit_count(-Signed(RealEnvSize) - sizeof(CELL) * 3); - code_p->u.sla.sla_u.p = - code_p->u.sla.p0 = + code_p->u.sbpp.s = emit_count(-Signed(RealEnvSize) - sizeof(CELL) * 3); + code_p->u.sbpp.p = + code_p->u.sbpp.p0 = RepPredProp(PredPropByFunc(FunctorComma,0)); - code_p->u.sla.bmap = NULL; - GONEXT(sla); + code_p->u.sbpp.bmap = NULL; + GONEXT(sbpp); if (PRED_GOAL_EXPANSION_ON) { Functor fp = Yap_MkFunctor(Yap_FullLookupAtom("$generate_pred_info"),4); code_p->opc = emit_op(_call_cpred); - code_p->u.sla.s = emit_count(-Signed(RealEnvSize)); - code_p->u.sla.sla_u.p = - code_p->u.sla.p0 = + code_p->u.sbpp.s = emit_count(-Signed(RealEnvSize)); + code_p->u.sbpp.p = + code_p->u.sbpp.p0 = RepPredProp(Yap_GetPredPropByFunc(fp,0)); - code_p->u.sla.bmap = NULL; - GONEXT(sla); + code_p->u.sbpp.bmap = NULL; + GONEXT(sbpp); code_p->opc = emit_op(_call); - code_p->u.sla.s = emit_count(-Signed(RealEnvSize)); - code_p->u.sla.sla_u.p = - code_p->u.sla.p0 = + code_p->u.sbpp.s = emit_count(-Signed(RealEnvSize)); + code_p->u.sbpp.p = + code_p->u.sbpp.p0 = PredMetaCall; - code_p->u.sla.bmap = NULL; - GONEXT(sla); + code_p->u.sbpp.bmap = NULL; + GONEXT(sbpp); code_p->opc = emit_op(_deallocate); GONEXT(e); code_p->opc = emit_op(_procceed); @@ -3668,11 +3663,11 @@ Yap_InitComma(void) GONEXT(e); } code_p->opc = opcode(_p_execute_tail); - code_p->u.sla.s = emit_count(-Signed(RealEnvSize)-3*sizeof(CELL)); - code_p->u.sla.bmap = NULL; - code_p->u.sla.sla_u.p = - code_p->u.sla.p0 = + code_p->u.sbpp.s = emit_count(-Signed(RealEnvSize)-3*sizeof(CELL)); + code_p->u.sbpp.bmap = NULL; + code_p->u.sbpp.p = + code_p->u.sbpp.p0 = RepPredProp(PredPropByFunc(FunctorComma,0)); - GONEXT(sla); + GONEXT(sbpp); } } diff --git a/C/c_interface.c b/C/c_interface.c index ae6917535..e4ae2d94e 100644 --- a/C/c_interface.c +++ b/C/c_interface.c @@ -515,8 +515,8 @@ dogc(void) { UInt arity; - if (P && PREVOP(P,sla)->opc == Yap_opcode(_call_usercpred)) { - arity = PREVOP(P,sla)->u.sla.sla_u.p->ArityOfPE; + if (P && PREVOP(P,sbpp)->opc == Yap_opcode(_call_usercpred)) { + arity = PREVOP(P,sbpp)->u.sbpp.p->ArityOfPE; } else { arity = 0; } @@ -531,8 +531,8 @@ doexpand(UInt sz) { UInt arity; - if (P && PREVOP(P,sla)->opc == Yap_opcode(_call_usercpred)) { - arity = PREVOP(P,sla)->u.sla.sla_u.p->ArityOfPE; + if (P && PREVOP(P,sbpp)->opc == Yap_opcode(_call_usercpred)) { + arity = PREVOP(P,sbpp)->u.sbpp.p->ArityOfPE; } else { arity = 0; } @@ -950,7 +950,7 @@ YAP_ExtraSpaceCut(void) void *ptr; BACKUP_B(); - ptr = (void *)(((CELL *)(Yap_REGS.CUT_C_TOP))-(((yamop *)Yap_REGS.CUT_C_TOP->try_userc_cut_yamop)->u.lds.extra)); + ptr = (void *)(((CELL *)(Yap_REGS.CUT_C_TOP))-(((yamop *)Yap_REGS.CUT_C_TOP->try_userc_cut_yamop)->u.apFs.extra)); RECOVER_B(); return(ptr); @@ -965,7 +965,7 @@ YAP_ExtraSpace(void) BACKUP_H(); /* find a pointer to extra space allocable */ - ptr = (void *)((CELL *)(B+1)+P->u.lds.s); + ptr = (void *)((CELL *)(B+1)+P->u.apFs.s); B->cp_h = H; RECOVER_H(); diff --git a/C/cdmgr.c b/C/cdmgr.c index ef3159052..7c436b3be 100644 --- a/C/cdmgr.c +++ b/C/cdmgr.c @@ -546,7 +546,7 @@ PredForChoicePt(yamop *p_code) { break; case _retry_me: case _trust_me: - return p_code->u.ld.p; + return p_code->u.apl.p; case _try_logical: case _retry_logical: case _trust_logical: @@ -554,7 +554,7 @@ PredForChoicePt(yamop *p_code) { case _count_trust_logical: case _profiled_retry_logical: case _profiled_trust_logical: - return p_code->u.lld.d->ClPred; + return p_code->u.aLl.d->ClPred; #ifdef TABLING case _trie_retry_null: case _trie_trust_null: @@ -583,17 +583,17 @@ PredForChoicePt(yamop *p_code) { /* compile error --> return ENV_ToP(gc_B->cp_cp); */ #endif /* TABLING */ case _or_else: - if (p_code == p_code->u.sla.sla_u.l) { + if (p_code == p_code->u.sblp.l) { /* repeat */ Atom at = Yap_LookupAtom("repeat "); return RepPredProp(PredPropByAtom(at, PROLOG_MODULE)); } else { - return p_code->u.sla.p0; + return p_code->u.sblp.p0; } break; case _or_last: #ifdef YAPOR - return p_code->u.sla.p0; + return p_code->u.sblp.p0; #else return p_code->u.p.p; #endif /* YAPOR */ @@ -606,7 +606,7 @@ PredForChoicePt(yamop *p_code) { p_code = NEXTOP(p_code,l); break; default: - return p_code->u.ld.p; + return p_code->u.apl.p; } } return NULL; @@ -1014,29 +1014,29 @@ static yamop * release_wcls(yamop *cop, OPCODE ecs) { if (cop->opc == ecs) { - cop->u.sp.s3--; - if (!cop->u.sp.s3) { - UInt sz = (UInt)NEXTOP((yamop *)NULL,sp)+cop->u.sp.s1*sizeof(yamop *); + cop->u.sssllp.s3--; + if (!cop->u.sssllp.s3) { + UInt sz = (UInt)NEXTOP((yamop *)NULL,sssllp)+cop->u.sssllp.s1*sizeof(yamop *); LOCK(ExpandClausesListLock); #ifdef DEBUG Yap_expand_clauses_sz -= sz; Yap_ExpandClauses--; #endif - if (cop->u.sp.p->PredFlags & LogUpdatePredFlag) { + if (cop->u.sssllp.p->PredFlags & LogUpdatePredFlag) { Yap_LUIndexSpace_EXT -= sz; } else { Yap_IndexSpace_EXT -= sz; } if (ExpandClausesFirst == cop) - ExpandClausesFirst = cop->u.sp.snext; + ExpandClausesFirst = cop->u.sssllp.snext; if (ExpandClausesLast == cop) { - ExpandClausesLast = cop->u.sp.sprev; + ExpandClausesLast = cop->u.sssllp.sprev; } - if (cop->u.sp.sprev) { - cop->u.sp.sprev->u.sp.snext = cop->u.sp.snext; + if (cop->u.sssllp.sprev) { + cop->u.sssllp.sprev->u.sssllp.snext = cop->u.sssllp.snext; } - if (cop->u.sp.snext) { - cop->u.sp.snext->u.sp.sprev = cop->u.sp.sprev; + if (cop->u.sssllp.snext) { + cop->u.sssllp.snext->u.sssllp.sprev = cop->u.sssllp.sprev; } UNLOCK(ExpandClausesListLock); Yap_InformOfRemoval((CODEADDR)cop); @@ -1084,8 +1084,8 @@ cleanup_dangling_indices(yamop *ipc, yamop *beg, yamop *end, yamop *suspend_code break; case _retry: case _trust: - decrease_ref_counter(ipc->u.ld.d, beg, end, suspend_code); - ipc = NEXTOP(ipc,ld); + decrease_ref_counter(ipc->u.apl.d, beg, end, suspend_code); + ipc = NEXTOP(ipc,apl); break; case _try_clause: case _try_me: @@ -1093,7 +1093,7 @@ cleanup_dangling_indices(yamop *ipc, yamop *beg, yamop *end, yamop *suspend_code case _profiled_trust_me: case _trust_me: case _count_trust_me: - ipc = NEXTOP(ipc,ld); + ipc = NEXTOP(ipc,apl); break; case _try_logical: case _retry_logical: @@ -1101,9 +1101,9 @@ cleanup_dangling_indices(yamop *ipc, yamop *beg, yamop *end, yamop *suspend_code case _profiled_retry_logical: { yamop *oipc = ipc; - decrease_ref_counter(ipc->u.lld.d->ClCode, beg, end, suspend_code); - ipc = ipc->u.lld.n; - Yap_LUIndexSpace_CP -= (UInt)NEXTOP((yamop *)NULL,lld); + decrease_ref_counter(ipc->u.aLl.d->ClCode, beg, end, suspend_code); + ipc = ipc->u.aLl.n; + Yap_LUIndexSpace_CP -= (UInt)NEXTOP((yamop *)NULL,aLl); Yap_FreeCodeSpace((ADDR)oipc); #ifdef DEBUG Yap_DirtyCps--; @@ -1118,23 +1118,23 @@ cleanup_dangling_indices(yamop *ipc, yamop *beg, yamop *end, yamop *suspend_code Yap_DirtyCps--; Yap_FreedCps++; #endif - decrease_ref_counter(ipc->u.lld.d->ClCode, beg, end, suspend_code); - Yap_LUIndexSpace_CP -= (UInt)NEXTOP((yamop *)NULL,lld); + decrease_ref_counter(ipc->u.ILl.d->ClCode, beg, end, suspend_code); + Yap_LUIndexSpace_CP -= (UInt)NEXTOP((yamop *)NULL,ILl); Yap_FreeCodeSpace((ADDR)ipc); return; case _enter_lu_pred: { yamop *oipc = ipc; - if (ipc->u.Ill.I->ClFlags & InUseMask || ipc->u.Ill.I->ClRefCount) + if (ipc->u.Ills.I->ClFlags & InUseMask || ipc->u.Ills.I->ClRefCount) return; #ifdef DEBUG - Yap_DirtyCps+=ipc->u.Ill.s; - Yap_LiveCps-=ipc->u.Ill.s; + Yap_DirtyCps+=ipc->u.Ills.s; + Yap_LiveCps-=ipc->u.Ills.s; #endif - ipc = ipc->u.Ill.l1; + ipc = ipc->u.Ills.l1; /* in case we visit again */ - oipc->u.Ill.l1 = FAILCODE; - oipc->u.Ill.s = 0; + oipc->u.Ills.l1 = FAILCODE; + oipc->u.Ills.s = 0; } break; case _try_in: @@ -1637,12 +1637,12 @@ add_first_dynamic(PredEntry *p, yamop *cp, int spy_flag) /* allocate starter block, containing info needed to start execution, * that is a try_mark to start the code and a fail to finish things up */ cl = - (DynamicClause *) Yap_AllocCodeSpace((Int)NEXTOP(NEXTOP(NEXTOP(ncp,ld),e),l)); + (DynamicClause *) Yap_AllocCodeSpace((Int)NEXTOP(NEXTOP(NEXTOP(ncp,apl),e),l)); if (cl == NIL) { Yap_Error(OUT_OF_HEAP_ERROR,TermNil,"Heap crashed against Stacks"); return; } - Yap_ClauseSpace += (Int)NEXTOP(NEXTOP(NEXTOP(ncp,ld),e),l); + Yap_ClauseSpace += (Int)NEXTOP(NEXTOP(NEXTOP(ncp,apl),e),l); /* skip the first entry, this contains the back link and will always be empty for this entry */ ncp = (yamop *)(((CELL *)ncp)+1); @@ -1658,9 +1658,9 @@ add_first_dynamic(PredEntry *p, yamop *cp, int spy_flag) p->OpcodeOfPred = ncp->opc = Yap_opcode(_spy_or_trymark); else p->OpcodeOfPred = ncp->opc = Yap_opcode(_try_and_mark); - ncp->u.ld.s = p->ArityOfPE; - ncp->u.ld.p = p; - ncp->u.ld.d = cp; + ncp->u.apl.s = p->ArityOfPE; + ncp->u.apl.p = p; + ncp->u.apl.d = cp; /* This is the point we enter the code */ p->cs.p_code.TrueCodeOfPred = p->CodeOfPred = ncp; p->cs.p_code.NOfClauses = 1; @@ -1679,9 +1679,9 @@ add_first_dynamic(PredEntry *p, yamop *cp, int spy_flag) cp->opc = Yap_opcode(_count_retry_and_mark); else cp->opc = Yap_opcode(_retry_and_mark); - cp->u.ld.s = p->ArityOfPE; - cp->u.ld.p = p; - cp->u.ld.d = ncp; + cp->u.apl.s = p->ArityOfPE; + cp->u.apl.p = p; + cp->u.apl.d = ncp; /* also, keep a backpointer for the days you delete the clause */ ClauseCodeToDynamicClause(cp)->ClPrevious = ncp; /* Don't forget to say who is the only clause for the predicate so @@ -1689,7 +1689,7 @@ add_first_dynamic(PredEntry *p, yamop *cp, int spy_flag) p->cs.p_code.LastClause = p->cs.p_code.FirstClause = cp; /* we're only missing what to do when we actually exit the procedure */ - ncp = NEXTOP(ncp,ld); + ncp = NEXTOP(ncp,apl); /* and the last instruction to execute to exit the predicate, note the retry is pointing to this pseudo clause */ ncp->opc = Yap_opcode(_trust_fail); @@ -1741,7 +1741,7 @@ asserta_stat_clause(PredEntry *p, yamop *q, int spy_flag) p->OpcodeOfPred = INDEX_OPCODE; p->CodeOfPred = (yamop *)(&(p->OpcodeOfPred)); } - p->cs.p_code.LastClause->u.ld.d = q; + p->cs.p_code.LastClause->u.apl.d = q; } /* p is already locked */ @@ -1757,22 +1757,22 @@ asserta_dynam_clause(PredEntry *p, yamop *cp) cl->ClPrevious = (yamop *)(p->CodeOfPred); cl->ClFlags |= DynamicMask; UNLOCK(ClauseCodeToDynamicClause(p->cs.p_code.FirstClause)->ClLock); - q->u.ld.d = p->cs.p_code.FirstClause; - q->u.ld.s = p->ArityOfPE; - q->u.ld.p = p; + q->u.apl.d = p->cs.p_code.FirstClause; + q->u.apl.s = p->ArityOfPE; + q->u.apl.p = p; if (p->PredFlags & ProfiledPredFlag) cp->opc = Yap_opcode(_profiled_retry_and_mark); else if (p->PredFlags & CountPredFlag) cp->opc = Yap_opcode(_count_retry_and_mark); else cp->opc = Yap_opcode(_retry_and_mark); - cp->u.ld.s = p->ArityOfPE; - cp->u.ld.p = p; + cp->u.apl.s = p->ArityOfPE; + cp->u.apl.p = p; p->cs.p_code.FirstClause = cp; q = p->CodeOfPred; - q->u.ld.d = cp; - q->u.ld.s = p->ArityOfPE; - q->u.ld.p = p; + q->u.apl.d = cp; + q->u.apl.s = p->ArityOfPE; + q->u.apl.p = p; } @@ -1830,7 +1830,7 @@ assertz_dynam_clause(PredEntry *p, yamop *cp) q = p->cs.p_code.LastClause; LOCK(ClauseCodeToDynamicClause(q)->ClLock); - q->u.ld.d = cp; + q->u.apl.d = cp; p->cs.p_code.LastClause = cp; /* also, keep backpointers for the days we'll delete all the clause */ cl->ClPrevious = q; @@ -1843,9 +1843,9 @@ assertz_dynam_clause(PredEntry *p, yamop *cp) q->opc = Yap_opcode(_count_retry_and_mark); else q->opc = Yap_opcode(_retry_and_mark); - q->u.ld.d = p->CodeOfPred; - q->u.ld.s = p->ArityOfPE; - q->u.ld.p = p; + q->u.apl.d = p->CodeOfPred; + q->u.apl.s = p->ArityOfPE; + q->u.apl.p = p; p->cs.p_code.NOfClauses++; } @@ -3202,16 +3202,16 @@ search_for_static_predicate_in_use(PredEntry *p, int check_everything) if (p->PredFlags & LogUpdatePredFlag) { LogUpdIndex *cl = ClauseCodeToLogUpdIndex(code_beg); if (find_owner_log_index(cl, code_p)) - b_ptr->cp_ap = cur_log_upd_clause(pe, b_ptr->cp_ap->u.ld.d); + b_ptr->cp_ap = cur_log_upd_clause(pe, b_ptr->cp_ap->u.apl.d); } else if (p->PredFlags & MegaClausePredFlag) { StaticIndex *cl = ClauseCodeToStaticIndex(code_beg); if (find_owner_static_index(cl, code_p)) - b_ptr->cp_ap = cur_clause(pe, b_ptr->cp_ap->u.ld.d); + b_ptr->cp_ap = cur_clause(pe, b_ptr->cp_ap->u.apl.d); } else { /* static clause */ StaticIndex *cl = ClauseCodeToStaticIndex(code_beg); if (find_owner_static_index(cl, code_p)) { - b_ptr->cp_ap = cur_clause(pe, b_ptr->cp_ap->u.ld.d); + b_ptr->cp_ap = cur_clause(pe, b_ptr->cp_ap->u.apl.d); } } } @@ -3797,19 +3797,19 @@ ClauseInfoForCode(yamop *codeptr, CODEADDR *startp, CODEADDR *endp) { case _table_answer_resolution: case _table_completion: #endif /* TABLING */ - pc = NEXTOP(pc,ld); + pc = NEXTOP(pc, apl); break; case _try_logical: case _retry_logical: case _count_retry_logical: case _profiled_retry_logical: - pc = pc->u.lld.n; + pc = pc->u.aLl.n; break; case _trust_logical: case _count_trust_logical: case _profiled_trust_logical: { - LogUpdIndex *cl = pc->u.lld.t.block; + LogUpdIndex *cl = pc->u.ILl.block; pp = cl->ClPred; *startp = (CODEADDR)cl; *endp = (CODEADDR)cl+cl->ClSize; @@ -3817,7 +3817,7 @@ ClauseInfoForCode(yamop *codeptr, CODEADDR *startp, CODEADDR *endp) { } case _enter_lu_pred: { - LogUpdIndex *cl = pc->u.Ill.I; + LogUpdIndex *cl = pc->u.Ills.I; pp = cl->ClPred; *startp = (CODEADDR)cl; *endp = (CODEADDR)cl+cl->ClSize; @@ -3873,7 +3873,7 @@ ClauseInfoForCode(yamop *codeptr, CODEADDR *startp, CODEADDR *endp) { /* instructions type EC */ case _alloc_for_logical_pred: { - LogUpdClause *cl = pc->u.EC.ClBase; + LogUpdClause *cl = pc->u.L.ClBase; *startp = (CODEADDR)cl; *endp = (CODEADDR)cl+cl->ClSize; @@ -3967,7 +3967,7 @@ ClauseInfoForCode(yamop *codeptr, CODEADDR *startp, CODEADDR *endp) { case _write_x_loc: pc = NEXTOP(pc,x); break; - /* instructions type xF */ + /* instructions type xl */ case _p_atom_x: case _p_atomic_x: case _p_integer_x: @@ -3979,7 +3979,7 @@ ClauseInfoForCode(yamop *codeptr, CODEADDR *startp, CODEADDR *endp) { case _p_compound_x: case _p_float_x: case _p_cut_by_x: - pc = NEXTOP(pc,xF); + pc = NEXTOP(pc,xl); break; /* instructions type y */ case _save_b_y: @@ -3989,7 +3989,7 @@ ClauseInfoForCode(yamop *codeptr, CODEADDR *startp, CODEADDR *endp) { case _write_y_loc: pc = NEXTOP(pc,y); break; - /* instructions type yF */ + /* instructions type yl */ case _p_atom_y: case _p_atomic_y: case _p_integer_y: @@ -4001,9 +4001,9 @@ ClauseInfoForCode(yamop *codeptr, CODEADDR *startp, CODEADDR *endp) { case _p_compound_y: case _p_float_y: case _p_cut_by_y: - pc = NEXTOP(pc,yF); + pc = NEXTOP(pc,yl); break; - /* instructions type sla */ + /* instructions type sbpp or sbmp */ case _p_execute_tail: case _p_execute: case _p_execute2: @@ -4018,17 +4018,21 @@ ClauseInfoForCode(yamop *codeptr, CODEADDR *startp, CODEADDR *endp) { case _or_last: #endif clause_code = TRUE; - pp = pc->u.sla.sla_u.p; - pc = NEXTOP(pc,sla); + pp = pc->u.sbpp.p; + pc = NEXTOP(pc,sbpp); break; - /* instructions type sla, but for disjunctions */ + /* instructions type sbpp, but for disjunctions */ case _either: case _or_else: + clause_code = TRUE; + pp = pc->u.sblp.p0; + pc = NEXTOP(pc,sblp); + break; case _call_cpred: case _call_usercpred: clause_code = TRUE; - pp = pc->u.sla.p0; - pc = NEXTOP(pc,sla); + pp = pc->u.sbpp.p0; + pc = NEXTOP(pc,sbpp); break; /* instructions type xx */ case _get_x_var: @@ -4088,10 +4092,10 @@ ClauseInfoForCode(yamop *codeptr, CODEADDR *startp, CODEADDR *endp) { case _get_6atoms: pc = NEXTOP(pc,cccccc); break; - /* instructions type xf */ + /* instructions type xfa */ case _get_struct: case _put_struct: - pc = NEXTOP(pc,xf); + pc = NEXTOP(pc,xfa); break; /* instructions type xy */ case _glist_valy: @@ -4196,7 +4200,7 @@ ClauseInfoForCode(yamop *codeptr, CODEADDR *startp, CODEADDR *endp) { case _unify_struct: case _unify_l_struc_write: case _unify_l_struc: - pc = NEXTOP(pc,of); + pc = NEXTOP(pc,ofa); break; /* instructions type s */ case _write_n_voids: @@ -4228,22 +4232,22 @@ ClauseInfoForCode(yamop *codeptr, CODEADDR *startp, CODEADDR *endp) { /* instructions type f */ case _write_struct: case _write_l_struc: - pc = NEXTOP(pc,f); + pc = NEXTOP(pc,fa); break; - /* instructions type sdl */ + /* instructions type sdlp */ case _call_c_wfail: clause_code = TRUE; - pp = pc->u.sdl.p; - pc = NEXTOP(pc,sdl); + pp = pc->u.sdlp.p; + pc = NEXTOP(pc,sdlp); break; - /* instructions type lds */ + /* instructions type apFs */ case _try_c: case _try_userc: case _retry_c: case _retry_userc: clause_code = TRUE; - pp = pc->u.lds.p; - pc = NEXTOP(pc,lds); + pp = pc->u.apFs.p; + pc = NEXTOP(pc,apFs); break; #ifdef CUT_C case _cut_c: @@ -4315,16 +4319,16 @@ ClauseInfoForCode(yamop *codeptr, CODEADDR *startp, CODEADDR *endp) { case _p_slr_cv: case _p_arg_cv: clause_code = TRUE; - pc = NEXTOP(pc,xcx); + pc = NEXTOP(pc,xxc); break; case _p_func2s_cv: clause_code = TRUE; - pc = NEXTOP(pc,xcx); + pc = NEXTOP(pc,xxc); break; - /* instructions type xyx */ + /* instructions type xxy */ case _p_func2f_xy: clause_code = TRUE; - pc = NEXTOP(pc,xyx); + pc = NEXTOP(pc,xxy); break; /* instructions type yxx */ case _p_plus_y_vv: @@ -4360,32 +4364,33 @@ ClauseInfoForCode(yamop *codeptr, CODEADDR *startp, CODEADDR *endp) { clause_code = TRUE; pc = NEXTOP(pc,yxc); break; - /* instructions type ycx */ + /* instructions type yxc */ case _p_sll_y_cv: case _p_slr_y_cv: case _p_arg_y_cv: clause_code = TRUE; - pc = NEXTOP(pc,ycx); + pc = NEXTOP(pc,yxc); break; - /* instructions type ycx */ + /* instructions type yxc */ case _p_func2s_y_cv: clause_code = TRUE; - pc = NEXTOP(pc,ycx); + pc = NEXTOP(pc,yxc); break; - /* instructions type llxx */ + /* instructions type plxxs */ case _call_bfunc_xx: clause_code = TRUE; - pc = NEXTOP(pc,llxx); + pc = NEXTOP(pc,plxxs); break; - /* instructions type llxy */ + /* instructions type plxys */ case _call_bfunc_yx: case _call_bfunc_xy: clause_code = TRUE; - pc = NEXTOP(pc,llxy); + pc = NEXTOP(pc,plxys); break; + /* instructions type plyys */ case _call_bfunc_yy: clause_code = TRUE; - pc = NEXTOP(pc,llyy); + pc = NEXTOP(pc,plyys); break; case _expand_index: pp = ((PredEntry *)(Unsigned(pc)-(CELL)(&(((PredEntry *)NULL)->cs.p_code.ExpandCode)))); @@ -4404,10 +4409,10 @@ ClauseInfoForCode(yamop *codeptr, CODEADDR *startp, CODEADDR *endp) { return pp; case _expand_clauses: /* expansion points may not be found when following the indices tree */ - pp = codeptr->u.sp.p; + pp = codeptr->u.sssllp.p; if (pc == codeptr) { *startp = (CODEADDR)codeptr; - *endp = (CODEADDR)NEXTOP(codeptr,sp); + *endp = (CODEADDR)NEXTOP(codeptr,sssllp); } return pp; case _op_fail: @@ -4895,7 +4900,7 @@ fetch_next_lu_clause(PredEntry *pe, yamop *i_code, Term th, Term tb, Term tr, ya Terms[0] = th; Terms[1] = tb; Terms[2] = tr; - cl = Yap_FollowIndexingCode(pe, i_code, Terms, NEXTOP(PredLogUpdClause->CodeOfPred,ld), cp_ptr); + cl = Yap_FollowIndexingCode(pe, i_code, Terms, NEXTOP(PredLogUpdClause->CodeOfPred,apl), cp_ptr); th = Terms[0]; tb = Terms[1]; tr = Terms[2]; @@ -5028,7 +5033,7 @@ fetch_next_lu_clause_erase(PredEntry *pe, yamop *i_code, Term th, Term tb, Term Terms[0] = th; Terms[1] = tb; Terms[2] = tr; - cl = Yap_FollowIndexingCode(pe, i_code, Terms, NEXTOP(PredLogUpdClauseErase->CodeOfPred,ld), cp_ptr); + cl = Yap_FollowIndexingCode(pe, i_code, Terms, NEXTOP(PredLogUpdClauseErase->CodeOfPred,apl), cp_ptr); th = Terms[0]; tb = Terms[1]; tr = Terms[2]; @@ -5165,7 +5170,7 @@ fetch_next_lu_clause0(PredEntry *pe, yamop *i_code, Term th, Term tb, yamop *cp_ Terms[0] = th; Terms[1] = tb; Terms[2] = TermNil; - cl = Yap_FollowIndexingCode(pe, i_code, Terms, NEXTOP(PredLogUpdClause0->CodeOfPred,ld), cp_ptr); + cl = Yap_FollowIndexingCode(pe, i_code, Terms, NEXTOP(PredLogUpdClause0->CodeOfPred,apl), cp_ptr); th = Terms[0]; tb = Terms[1]; /* don't do this!! I might have stored a choice-point and changed ASP @@ -5307,9 +5312,9 @@ void /* $hidden_predicate(P) */ Yap_UpdateTimestamps(PredEntry *ap) { choiceptr bptr = B; - yamop *cl0 = NEXTOP(PredLogUpdClause0->CodeOfPred,ld); - yamop *cl = NEXTOP(PredLogUpdClause->CodeOfPred,ld); - yamop *cle = NEXTOP(PredLogUpdClauseErase->CodeOfPred,ld); + yamop *cl0 = NEXTOP(PredLogUpdClause0->CodeOfPred,apl); + yamop *cl = NEXTOP(PredLogUpdClause->CodeOfPred,apl); + yamop *cle = NEXTOP(PredLogUpdClauseErase->CodeOfPred,apl); UInt ar = ap->ArityOfPE; UInt *arp, *top, *base; LogUpdClause *lcl; @@ -5333,7 +5338,7 @@ Yap_UpdateTimestamps(PredEntry *ap) case _trust_logical: case _count_trust_logical: case _profiled_trust_logical: - if (bptr->cp_ap->u.lld.d->ClPred == ap) { + if (bptr->cp_ap->u.aLl.d->ClPred == ap) { UInt ts = IntegerOfTerm(bptr->cp_args[ar]); if (ts != arp[0]) { if (arp-H < 1024) { @@ -5397,7 +5402,7 @@ Yap_UpdateTimestamps(PredEntry *ap) case _trust_logical: case _count_trust_logical: case _profiled_trust_logical: - if (bptr->cp_ap->u.lld.d->ClPred == ap) { + if (bptr->cp_ap->u.aLl.d->ClPred == ap) { UInt ts = IntegerOfTerm(bptr->cp_args[ar]); while (ts != arp[0]) arp--; @@ -5439,7 +5444,7 @@ fetch_next_static_clause(PredEntry *pe, yamop *i_code, Term th, Term tb, Term tr Terms[0] = th; Terms[1] = tb; Terms[2] = tr; - cl = (StaticClause *)Yap_FollowIndexingCode(pe, i_code, Terms, NEXTOP(PredStaticClause->CodeOfPred,ld), cp_ptr); + cl = (StaticClause *)Yap_FollowIndexingCode(pe, i_code, Terms, NEXTOP(PredStaticClause->CodeOfPred,apl), cp_ptr); UNLOCK(pe->PELock); th = Terms[0]; tb = Terms[1]; @@ -5954,7 +5959,7 @@ p_env_info(void) env_b = MkIntegerTerm((Int)(LCL0-(CELL *)env[E_CB])); env_cp = (yamop *)env[E_CP]; - pe = PREVOP(env_cp,sla)->u.sla.p0; + pe = PREVOP(env_cp,sbpp)->u.sbpp.p0; taddr = MkIntegerTerm((Int)env); return Yap_unify(ARG3,MkIntegerTerm((Int)env_cp)) && Yap_unify(ARG2, taddr) && @@ -5967,7 +5972,7 @@ p_cpc_info(void) PredEntry *pe; yamop *ipc = (yamop *)IntegerOfTerm(Deref(ARG1)); - pe = PREVOP(ipc,sla)->u.sla.p0; + pe = PREVOP(ipc,sbpp)->u.sbpp.p0; return UnifyPredInfo(pe, 2) && Yap_unify(ARG5,MkIntegerTerm(ClauseId(ipc,pe))); } @@ -6047,12 +6052,12 @@ p_choicepoint_info(void) case _count_trust_logical: case _profiled_retry_logical: case _profiled_trust_logical: - ncl = ipc->u.lld.d->ClCode; - pe = ipc->u.lld.d->ClPred; + ncl = ipc->u.aLl.d->ClCode; + pe = ipc->u.aLl.d->ClPred; t = BuildActivePred(pe, cptr->cp_args); break; case _or_else: - pe = ipc->u.sla.p0; + pe = ipc->u.sblp.p0; ncl = ipc; t = Yap_MkNewApplTerm(FunctorOr, 2); break; @@ -6068,7 +6073,7 @@ p_choicepoint_info(void) t = TermNil; ipc = NEXTOP(ipc,l); if (!ncl) - ncl = ipc->u.ld.d; + ncl = ipc->u.apl.d; go_on = TRUE; break; case _jump: @@ -6079,15 +6084,15 @@ p_choicepoint_info(void) break; case _retry_c: case _retry_userc: - ncl = ipc->u.ld.d; - pe = ipc->u.lds.p; + ncl = NEXTOP(ipc,apFs); + pe = ipc->u.apFs.p; t = BuildActivePred(pe, cptr->cp_args); break; case _retry_profiled: case _count_retry: pe = NULL; t = TermNil; - ncl = ipc->u.ld.d; + ncl = ipc->u.apl.d; ipc = NEXTOP(ipc,p); go_on = TRUE; break; @@ -6102,8 +6107,8 @@ p_choicepoint_info(void) case _retry: case _trust: if (!ncl) - ncl = ipc->u.ld.d; - pe = ipc->u.ld.p; + ncl = ipc->u.apl.d; + pe = ipc->u.apl.p; t = BuildActivePred(pe, cptr->cp_args); break; case _Nstop: diff --git a/C/dbase.c b/C/dbase.c index aa5dcb9bb..3d144b6bf 100644 --- a/C/dbase.c +++ b/C/dbase.c @@ -3696,14 +3696,14 @@ index_sz(LogUpdIndex *x) endop = Yap_opcode(_profiled_trust_logical); else endop = Yap_opcode(_trust_logical); - start = start->u.Ill.l1; + start = start->u.Ills.l1; do { - sz += (UInt)NEXTOP((yamop*)NULL,lld); + sz += (UInt)NEXTOP((yamop*)NULL,aLl); op1 = start->opc; count++; - if (start->u.lld.d->ClFlags & ErasedMask) + if (start->u.aLl.d->ClFlags & ErasedMask) dead++; - start = start->u.lld.n; + start = start->u.aLl.n; } while (op1 != endop); } x = x->ChildIndex; @@ -3989,7 +3989,7 @@ find_next_clause(DBRef ref0) static Int p_jump_to_next_dynamic_clause(void) { - DBRef ref = (DBRef)(((yamop *)((CODEADDR)P-(CELL)NEXTOP((yamop *)NULL,sla)))->u.sla.bmap); + DBRef ref = (DBRef)(((yamop *)((CODEADDR)P-(CELL)NEXTOP((yamop *)NULL,sbpp)))->u.sbpp.bmap); yamop *newp = find_next_clause(ref); if (newp == NULL) { @@ -3998,7 +3998,7 @@ p_jump_to_next_dynamic_clause(void) /* the next alternative to try must be obtained from this clause */ B->cp_ap = newp; /* and next, enter the clause */ - P = NEXTOP(newp,ld); + P = NEXTOP(newp,apl); /* and return like if nothing had happened. */ return TRUE; } @@ -4015,11 +4015,6 @@ complete_lu_erase(LogUpdClause *clau) if (CL_IN_USE(clau)) { return; } - if (clau->ClFlags & LogUpdRuleMask && - clau->ClExt && - clau->ClExt->u.EC.ClRefs > 0) { - return; - } #ifndef THREADS if (clau->ClNext) clau->ClNext->ClPrev = clau->ClPrev; @@ -4150,20 +4145,20 @@ MyEraseClause(DynamicClause *clau) I don't need to lock the clause at this point because I am the last one using it anyway. */ - ref = (DBRef) NEXTOP(clau->ClCode,ld)->u.sla.bmap; + ref = (DBRef) NEXTOP(clau->ClCode,apl)->u.sbpp.bmap; /* don't do nothing if the reference is still in use */ if (DBREF_IN_USE(ref)) return; if ( P == clau->ClCode ) { yamop *np = RTRYCODE; /* make it the next alternative */ - np->u.ld.d = find_next_clause((DBRef)(NEXTOP(P,ld)->u.sla.bmap)); - if (np->u.ld.d == NULL) + np->u.apl.d = find_next_clause((DBRef)(NEXTOP(P,apl)->u.sbpp.bmap)); + if (np->u.apl.d == NULL) P = (yamop *)FAILCODE; else { /* with same arity as before */ - np->u.ld.s = P->u.ld.s; - np->u.ld.p = P->u.ld.p; + np->u.apl.s = P->u.apl.s; + np->u.apl.p = P->u.apl.p; /* go ahead and try this code */ P = np; } @@ -4213,7 +4208,7 @@ PrepareToEraseLogUpdClause(LogUpdClause *clau, DBRef dbr) if (p->cs.p_code.FirstClause != cl) { /* we are not the first clause... */ yamop *prev_code_p = (yamop *)(dbr->Prev->Code); - prev_code_p->u.ld.d = code_p->u.ld.d; + prev_code_p->u.apl.d = code_p->u.apl.d; /* are we the last? */ if (p->cs.p_code.LastClause == cl) p->cs.p_code.LastClause = prev_code_p; @@ -4222,7 +4217,7 @@ PrepareToEraseLogUpdClause(LogUpdClause *clau, DBRef dbr) if (p->cs.p_code.LastClause == p->cs.p_code.FirstClause) { p->cs.p_code.LastClause = p->cs.p_code.FirstClause = NULL; } else { - p->cs.p_code.FirstClause = code_p->u.ld.d; + p->cs.p_code.FirstClause = code_p->u.apl.d; p->cs.p_code.FirstClause->opc = Yap_opcode(_try_me); } @@ -4237,8 +4232,8 @@ PrepareToEraseLogUpdClause(LogUpdClause *clau, DBRef dbr) if (p->cs.p_code.FirstClause == p->cs.p_code.LastClause) { if (p->cs.p_code.FirstClause != NULL) { code_p = p->cs.p_code.FirstClause; - code_p->u.ld.d = p->cs.p_code.FirstClause; - p->cs.p_code.TrueCodeOfPred = NEXTOP(code_p, ld); + code_p->u.apl.d = p->cs.p_code.FirstClause; + p->cs.p_code.TrueCodeOfPred = NEXTOP(code_p, apl); if (p->PredFlags & SpiedPredFlag) { p->OpcodeOfPred = Yap_opcode(_spy_pred); p->CodeOfPred = (yamop *)(&(p->OpcodeOfPred)); @@ -5450,9 +5445,9 @@ void Yap_InitBackDB(void) { Yap_InitCPredBack("$recorded_with_key", 3, 3, in_rded_with_key, co_rded, SyncPredFlag|HiddenPredFlag); - RETRY_C_RECORDED_K_CODE = NEXTOP(PredRecordedWithKey->cs.p_code.FirstClause,lds); + RETRY_C_RECORDED_K_CODE = NEXTOP(PredRecordedWithKey->cs.p_code.FirstClause,apFs); Yap_InitCPredBack("$recordedp", 3, 3, in_rdedp, co_rdedp, SyncPredFlag|HiddenPredFlag); - RETRY_C_RECORDEDP_CODE = NEXTOP(RepPredProp(PredPropByFunc(Yap_MkFunctor(Yap_LookupAtom("$recordedp"), 3),0))->cs.p_code.FirstClause,lds); + RETRY_C_RECORDEDP_CODE = NEXTOP(RepPredProp(PredPropByFunc(Yap_MkFunctor(Yap_LookupAtom("$recordedp"), 3),0))->cs.p_code.FirstClause,apFs); Yap_InitCPredBack("$current_immediate_key", 2, 4, init_current_key, cont_current_key, SyncPredFlag|HiddenPredFlag); } diff --git a/C/gprof.c b/C/gprof.c index ee246c219..df08d2526 100644 --- a/C/gprof.c +++ b/C/gprof.c @@ -790,7 +790,7 @@ showprofres(UInt type) { InCCall++; /* I Was in a C Call */ pc_ptr=y; /* - printf("Aqui está um call_cpred(%p) \n",y->u.sla.sla_u.p->cs.f_code); + printf("Aqui está um call_cpred(%p) \n",y->u.sbpp.p->cs.f_code); for(i=0;i<_std_top && pc_ptr->opc!=Yap_ABSMI_OPCODES[i];i++); printf("Outro syscall diferente %s\n", Yap_op_names[i]); */ @@ -973,11 +973,11 @@ prof_alrm(int signo, siginfo_t *si, void *scv) current_p = P; #endif } else { - op_numbers oop = Yap_op_from_opcode(PREVOP(P,sla)->opc); + op_numbers oop = Yap_op_from_opcode(PREVOP(P,sbpp)->opc); if (oop == _call_cpred || oop == _call_usercpred) { /* doing C-code */ - current_p = PREVOP(P,sla)->u.sla.sla_u.p->CodeOfPred; + current_p = PREVOP(P,sbpp)->u.sbpp.p->CodeOfPred; } else { current_p = P; } diff --git a/C/heapgc.c b/C/heapgc.c index 29510ed85..d3e512e39 100644 --- a/C/heapgc.c +++ b/C/heapgc.c @@ -1817,10 +1817,10 @@ mark_choicepoints(register choiceptr gc_B, tr_fr_ptr saved_TR, int very_verbose) { OPCODE trust_lu = Yap_opcode(_trust_logical); - yamop *lu_cl0 = NEXTOP(PredLogUpdClause0->CodeOfPred,ld), - *lu_cl = NEXTOP(PredLogUpdClause->CodeOfPred,ld), - *lu_cle = NEXTOP(PredLogUpdClauseErase->CodeOfPred,ld), - *su_cl = NEXTOP(PredStaticClause->CodeOfPred,ld); + yamop *lu_cl0 = NEXTOP(PredLogUpdClause0->CodeOfPred,apl), + *lu_cl = NEXTOP(PredLogUpdClause->CodeOfPred,apl), + *lu_cle = NEXTOP(PredLogUpdClauseErase->CodeOfPred,apl), + *su_cl = NEXTOP(PredStaticClause->CodeOfPred,apl); #ifdef TABLING dep_fr_ptr depfr = LOCAL_top_dep_fr; #endif /* TABLING */ @@ -1889,13 +1889,8 @@ mark_choicepoints(register choiceptr gc_B, tr_fr_ptr saved_TR, int very_verbose) if (opnum == _or_else || opnum == _or_last) { /* ; choice point */ mark_environments((CELL_PTR) (gc_B->cp_a1), -#ifdef YAPOR - -gc_B->cp_cp->u.ldl.s / ((OPREG)sizeof(CELL)), - (CELL *)(gc_B->cp_cp->u.ldl.bl) -#else - -gc_B->cp_cp->u.sla.s / ((OPREG)sizeof(CELL)), - gc_B->cp_cp->u.sla.bmap -#endif + -gc_B->cp_cp->u.sblp.s / ((OPREG)sizeof(CELL)), + gc_B->cp_cp->u.sblp.bmap ); } else { /* choicepoint with arguments */ @@ -1943,7 +1938,7 @@ mark_choicepoints(register choiceptr gc_B, tr_fr_ptr saved_TR, int very_verbose) } B = old_b; } - nargs = rtp->u.lds.s+rtp->u.lds.extra; + nargs = rtp->u.apFs.s+rtp->u.apFs.extra; break; case _jump: rtp = rtp->u.l.l; @@ -1980,7 +1975,7 @@ mark_choicepoints(register choiceptr gc_B, tr_fr_ptr saved_TR, int very_verbose) { CELL *vars_ptr, vars; vars_ptr = (CELL *)(GEN_CP(gc_B) + 1); - nargs = rtp->u.ld.s; + nargs = rtp->u.apl.s; while (nargs--) { mark_external_reference(vars_ptr); vars_ptr++; @@ -2096,20 +2091,20 @@ mark_choicepoints(register choiceptr gc_B, tr_fr_ptr saved_TR, int very_verbose) on the other hand it's the only way we can be sure we can reclaim space */ - yamop *end = rtp->u.lld.n; + yamop *end = rtp->u.aLl.n; while (end->opc != trust_lu) - end = end->u.lld.n; - mark_ref_in_use((DBRef)end->u.lld.t.block); + end = end->u.aLl.n; + mark_ref_in_use((DBRef)end->u.ILl.block); } /* mark timestamp */ - nargs = rtp->u.lld.t.s+1; + nargs = rtp->u.aLl.s+1; break; case _trust_logical: case _count_trust_logical: case _profiled_trust_logical: /* mark timestamp */ - mark_ref_in_use((DBRef)rtp->u.lld.t.block); - nargs = rtp->u.lld.d->ClPred->ArityOfPE+1; + mark_ref_in_use((DBRef)rtp->u.ILl.block); + nargs = rtp->u.ILl.d->ClPred->ArityOfPE+1; break; #ifdef DEBUG case _retry_me: @@ -2120,14 +2115,14 @@ mark_choicepoints(register choiceptr gc_B, tr_fr_ptr saved_TR, int very_verbose) case _count_trust_me: case _retry: case _trust: - nargs = rtp->u.ld.s; + nargs = rtp->u.apl.s; break; default: fprintf(Yap_stderr, "OOps in GC: Unexpected opcode: %d\n", opnum); nargs = 0; #else default: - nargs = rtp->u.ld.s; + nargs = rtp->u.apl.s; #endif } @@ -2141,8 +2136,8 @@ mark_choicepoints(register choiceptr gc_B, tr_fr_ptr saved_TR, int very_verbose) mark_db_fixed((CELL *)pt); } else { while (pt->opc != trust_lu) - pt = pt->u.lld.n; - mark_ref_in_use((DBRef)pt->u.lld.t.block); + pt = pt->u.aLl.n; + mark_ref_in_use((DBRef)pt->u.ILl.block); } } /* for each saved register */ @@ -2752,13 +2747,8 @@ sweep_choicepoints(choiceptr gc_B) case _or_last: sweep_environments((CELL_PTR)(gc_B->cp_a1), -#ifdef YAPOR - -gc_B->cp_cp->u.ldl.s / ((OPREG)sizeof(CELL)), - (CELL *)(gc_B->cp_cp->u.ldl.bl) -#else - -gc_B->cp_cp->u.sla.s / ((OPREG)sizeof(CELL)), - gc_B->cp_cp->u.sla.bmap -#endif + -gc_B->cp_cp->u.sblp.s / ((OPREG)sizeof(CELL)), + gc_B->cp_cp->u.sblp.bmap ); break; case _retry_profiled: @@ -2801,7 +2791,7 @@ sweep_choicepoints(choiceptr gc_B) CELL *vars_ptr, vars; sweep_environments(gc_B->cp_env, EnvSize((CELL_PTR) (gc_B->cp_cp)), EnvBMap((CELL_PTR) (gc_B->cp_cp))); vars_ptr = (CELL *)(GEN_CP(gc_B) + 1); - nargs = rtp->u.ld.s; + nargs = rtp->u.apl.s; while(nargs--) { CELL cp_cell = *vars_ptr; if (MARKED_PTR(vars_ptr)) { @@ -2947,12 +2937,12 @@ sweep_choicepoints(choiceptr gc_B) case _count_retry_logical: case _profiled_retry_logical: /* sweep timestamp */ - sweep_b(gc_B, rtp->u.lld.t.s+1); + sweep_b(gc_B, rtp->u.aLl.s+1); break; case _trust_logical: case _count_trust_logical: case _profiled_trust_logical: - sweep_b(gc_B, rtp->u.lld.d->ClPred->ArityOfPE+1); + sweep_b(gc_B, rtp->u.ILl.d->ClPred->ArityOfPE+1); break; case _retry2: sweep_b(gc_B, 2); @@ -2969,8 +2959,8 @@ sweep_choicepoints(choiceptr gc_B) register CELL_PTR saved_reg; /* for each extra saved register */ - for (saved_reg = &(gc_B->cp_a1)+rtp->u.lds.s; - saved_reg < &(gc_B->cp_a1)+rtp->u.lds.s+rtp->u.lds.extra; + for (saved_reg = &(gc_B->cp_a1)+rtp->u.apFs.s; + saved_reg < &(gc_B->cp_a1)+rtp->u.apFs.s+rtp->u.apFs.extra; saved_reg++) { CELL cp_cell = *saved_reg; if (MARKED_PTR(saved_reg)) { @@ -2983,7 +2973,7 @@ sweep_choicepoints(choiceptr gc_B) } /* continue to clean environments and arguments */ default: - sweep_b(gc_B,rtp->u.ld.s); + sweep_b(gc_B,rtp->u.apl.s); } /* link to prev choicepoint */ diff --git a/C/index.c b/C/index.c index 6602c2e6e..0c65a85f0 100644 --- a/C/index.c +++ b/C/index.c @@ -509,33 +509,33 @@ cleanup_sw_on_clauses(CELL larg, UInt sz, OPCODE ecls) } else { yamop *xp = (yamop *)larg; if (xp->opc == ecls) { - if (xp->u.sp.s3 == 1) { - UInt nsz = sz + (UInt)(NEXTOP((yamop *)NULL,sp))+xp->u.sp.s1*sizeof(yamop *); + if (xp->u.sssllp.s3 == 1) { + UInt nsz = sz + (UInt)(NEXTOP((yamop *)NULL,sssllp))+xp->u.sssllp.s1*sizeof(yamop *); LOCK(ExpandClausesListLock); if (ExpandClausesFirst == xp) - ExpandClausesFirst = xp->u.sp.snext; + ExpandClausesFirst = xp->u.sssllp.snext; if (ExpandClausesLast == xp) { - ExpandClausesLast = xp->u.sp.sprev; + ExpandClausesLast = xp->u.sssllp.sprev; } - if (xp->u.sp.sprev) { - xp->u.sp.sprev->u.sp.snext = xp->u.sp.snext; + if (xp->u.sssllp.sprev) { + xp->u.sssllp.sprev->u.sssllp.snext = xp->u.sssllp.snext; } - if (xp->u.sp.snext) { - xp->u.sp.snext->u.sp.sprev = xp->u.sp.sprev; + if (xp->u.sssllp.snext) { + xp->u.sssllp.snext->u.sssllp.sprev = xp->u.sssllp.sprev; } UNLOCK(ExpandClausesListLock); #if DEBUG Yap_ExpandClauses--; - Yap_expand_clauses_sz -= (UInt)(NEXTOP((yamop *)NULL,sp))+xp->u.sp.s1*sizeof(yamop *); + Yap_expand_clauses_sz -= (UInt)(NEXTOP((yamop *)NULL,sssllp))+xp->u.sssllp.s1*sizeof(yamop *); #endif - if (xp->u.sp.p->PredFlags & LogUpdatePredFlag) { - Yap_LUIndexSpace_EXT -= (UInt)NEXTOP((yamop *)NULL,sp)+xp->u.sp.s1*sizeof(yamop *); + if (xp->u.sssllp.p->PredFlags & LogUpdatePredFlag) { + Yap_LUIndexSpace_EXT -= (UInt)NEXTOP((yamop *)NULL,sssllp)+xp->u.sssllp.s1*sizeof(yamop *); } else - Yap_IndexSpace_EXT -= (UInt)(NEXTOP((yamop *)NULL,sp))+xp->u.sp.s1*sizeof(yamop *); + Yap_IndexSpace_EXT -= (UInt)(NEXTOP((yamop *)NULL,sssllp))+xp->u.sssllp.s1*sizeof(yamop *); Yap_FreeCodeSpace((char *)xp); return nsz; } else { - xp->u.sp.s3--; + xp->u.sssllp.s3--; return sz; } } else { @@ -936,11 +936,11 @@ has_cut(yamop *pc) case _table_answer_resolution: case _table_completion: #endif /* TABLING */ - pc = NEXTOP(pc,ld); + pc = NEXTOP(pc,apl); break; - /* instructions type Ill */ + /* instructions type Ills */ case _enter_lu_pred: - pc = pc->u.Ill.l1; + pc = pc->u.Ills.l1; break; case _execute: case _dexecute: @@ -1046,7 +1046,7 @@ has_cut(yamop *pc) pc = NEXTOP(pc,e); break; case _expand_clauses: - pc = NEXTOP(pc,sp); + pc = NEXTOP(pc,sssllp); break; /* instructions type x */ case _save_b_x: @@ -1057,7 +1057,7 @@ has_cut(yamop *pc) case _write_x_loc: pc = NEXTOP(pc,x); break; - /* instructions type xF */ + /* instructions type xl */ case _p_atom_x: case _p_atomic_x: case _p_integer_x: @@ -1068,7 +1068,7 @@ has_cut(yamop *pc) case _p_primitive_x: case _p_compound_x: case _p_float_x: - pc = NEXTOP(pc,xF); + pc = NEXTOP(pc,xl); break; /* instructions type y */ case _save_b_y: @@ -1077,7 +1077,7 @@ has_cut(yamop *pc) case _write_y_loc: pc = NEXTOP(pc,y); break; - /* instructions type yF */ + /* instructions type yl */ case _p_atom_y: case _p_atomic_y: case _p_integer_y: @@ -1088,27 +1088,24 @@ has_cut(yamop *pc) case _p_primitive_y: case _p_compound_y: case _p_float_y: - pc = NEXTOP(pc,yF); + pc = NEXTOP(pc,yl); break; - /* instructions type sla */ + /* instructions type sbpp */ case _p_execute: case _p_execute2: case _fcall: case _call: + case _call_cpred: + case _call_usercpred: + pc = NEXTOP(pc,sbpp); + break; + /* instructions type sblp */ #ifdef YAPOR case _or_last: #endif /* YAPOR */ - pc = NEXTOP(pc,sla); - break; - /* instructions type sla, but for disjunctions */ case _either: case _or_else: - pc = NEXTOP(pc,sla); - break; - /* instructions type sla, but for functions */ - case _call_cpred: - case _call_usercpred: - pc = NEXTOP(pc,sla); + pc = NEXTOP(pc,sblp); break; /* instructions type xx */ case _get_x_var: @@ -1168,10 +1165,10 @@ has_cut(yamop *pc) case _get_6atoms: pc = NEXTOP(pc,cccccc); break; - /* instructions type xf */ + /* instructions type xfa */ case _get_struct: case _put_struct: - pc = NEXTOP(pc,xf); + pc = NEXTOP(pc,xfa); break; /* instructions type xy */ case _glist_valy: @@ -1285,7 +1282,7 @@ has_cut(yamop *pc) case _unify_struct: case _unify_l_struc_write: case _unify_l_struc: - pc = NEXTOP(pc,of); + pc = NEXTOP(pc,ofa); break; /* instructions type s */ case _write_n_voids: @@ -1312,24 +1309,26 @@ has_cut(yamop *pc) case _write_l_struc: pc = NEXTOP(pc,f); break; - /* instructions type sdl */ + /* instructions type sdlp */ case _call_c_wfail: - pc = NEXTOP(pc,sdl); + pc = NEXTOP(pc,sdlp); break; /* instructions type lds */ case _try_c: case _try_userc: pc = NEXTOP(pc,lds); break; - /* instructions type lld */ + /* instructions type aLl,ILl */ case _try_logical: case _retry_logical: case _count_retry_logical: case _profiled_retry_logical: + pc = pc->u.aLl.n; + break; case _trust_logical: case _count_trust_logical: case _profiled_trust_logical: - pc = pc->u.lld.n; + pc = pc->u.ILl.n; break; case _retry_c: case _retry_userc: @@ -1389,14 +1388,14 @@ has_cut(yamop *pc) case _p_sll_cv: case _p_slr_cv: case _p_arg_cv: - pc = NEXTOP(pc,xcx); + pc = NEXTOP(pc,xxc); break; case _p_func2s_cv: - pc = NEXTOP(pc,xcx); + pc = NEXTOP(pc,xxc); break; - /* instructions type xyx */ + /* instructions type xxy */ case _p_func2f_xy: - pc = NEXTOP(pc,xyx); + pc = NEXTOP(pc,xxy); break; /* instructions type yxx */ case _p_plus_y_vv: @@ -1429,27 +1428,27 @@ has_cut(yamop *pc) case _p_func2s_y_vc: pc = NEXTOP(pc,yxc); break; - /* instructions type ycx */ + /* instructions type yxc */ case _p_sll_y_cv: case _p_slr_y_cv: case _p_arg_y_cv: - pc = NEXTOP(pc,ycx); + pc = NEXTOP(pc,yxc); break; - /* instructions type ycx */ + /* instructions type yxc */ case _p_func2s_y_cv: - pc = NEXTOP(pc,ycx); + pc = NEXTOP(pc,yxc); break; - /* instructions type llxx */ + /* instructions type plxxs */ case _call_bfunc_xx: - pc = NEXTOP(pc,llxx); + pc = NEXTOP(pc,plxxs); break; - /* instructions type llxy */ + /* instructions type plxys */ case _call_bfunc_yx: case _call_bfunc_xy: - pc = NEXTOP(pc,llxy); + pc = NEXTOP(pc,plxys); break; case _call_bfunc_yy: - pc = NEXTOP(pc,llyy); + pc = NEXTOP(pc,plyys); break; } } while (TRUE); @@ -1472,7 +1471,7 @@ add_info(ClauseDef *clause, UInt regno) op_numbers op = Yap_op_from_opcode(cl->opc); switch (op) { case _alloc_for_logical_pred: - cl = NEXTOP(cl,EC); + cl = NEXTOP(cl,L); break; case _cut: case _cut_t: @@ -1506,124 +1505,124 @@ add_info(ClauseDef *clause, UInt regno) cl = NEXTOP(cl,x); break; case _p_nonvar_x: - if (cl->u.xF.F != FAILCODE) { + if (cl->u.xl.F != FAILCODE) { clause->Tag = (CELL)NULL; return; } - if (regcopy_in(myregs, nofregs, cl->u.xF.x)) { + if (regcopy_in(myregs, nofregs, cl->u.xl.x)) { clause->Tag = (CELL)NULL; clause->u.t_ptr = (CELL)NULL; return; } - cl = NEXTOP(cl,xF); + cl = NEXTOP(cl,xl); break; case _p_number_x: - if (cl->u.xF.F != FAILCODE) { + if (cl->u.xl.F != FAILCODE) { clause->Tag = (CELL)NULL; return; } - if (regcopy_in(myregs, nofregs, cl->u.xF.x)) { + if (regcopy_in(myregs, nofregs, cl->u.xl.x)) { clause->Tag = (_number+1)*sizeof(CELL); clause->u.t_ptr = (CELL)NULL; return; } - cl = NEXTOP(cl,xF); + cl = NEXTOP(cl,xl); break; case _p_atomic_x: - if (cl->u.xF.F != FAILCODE) { + if (cl->u.xl.F != FAILCODE) { clause->Tag = (CELL)NULL; return; } - if (regcopy_in(myregs, nofregs, cl->u.xF.x)) { + if (regcopy_in(myregs, nofregs, cl->u.xl.x)) { clause->Tag = (_atomic+1)*sizeof(CELL); clause->u.t_ptr = (CELL)NULL; return; } - cl = NEXTOP(cl,xF); + cl = NEXTOP(cl,xl); break; case _p_integer_x: - if (cl->u.xF.F != FAILCODE) { + if (cl->u.xl.F != FAILCODE) { clause->Tag = (CELL)NULL; return; } - if (regcopy_in(myregs, nofregs, cl->u.xF.x)) { + if (regcopy_in(myregs, nofregs, cl->u.xl.x)) { clause->Tag = (_integer+1)*sizeof(CELL); clause->u.t_ptr = (CELL)NULL; return; } - cl = NEXTOP(cl,xF); + cl = NEXTOP(cl,xl); break; case _p_primitive_x: - if (cl->u.xF.F != FAILCODE) { + if (cl->u.xl.F != FAILCODE) { clause->Tag = (CELL)NULL; return; } - if (regcopy_in(myregs, nofregs, cl->u.xF.x)) { + if (regcopy_in(myregs, nofregs, cl->u.xl.x)) { clause->Tag = (_primitive+1)*sizeof(CELL); clause->u.t_ptr = (CELL)NULL; return; } - cl = NEXTOP(cl,xF); + cl = NEXTOP(cl,xl); break; case _p_compound_x: - if (cl->u.xF.F != FAILCODE) { + if (cl->u.xl.F != FAILCODE) { clause->Tag = (CELL)NULL; return; } - if (regcopy_in(myregs, nofregs, cl->u.xF.x)) { + if (regcopy_in(myregs, nofregs, cl->u.xl.x)) { clause->Tag = (_compound+1)*sizeof(CELL); clause->u.t_ptr = (CELL)NULL; return; } - cl = NEXTOP(cl,xF); + cl = NEXTOP(cl,xl); break; case _p_var_x: - if (cl->u.xF.F != FAILCODE) { + if (cl->u.xl.F != FAILCODE) { clause->Tag = (CELL)NULL; return; } - if (regcopy_in(myregs, nofregs, cl->u.xF.x)) { + if (regcopy_in(myregs, nofregs, cl->u.xl.x)) { clause->Tag = (_var+1)*sizeof(CELL); clause->u.t_ptr = (CELL)NULL; return; } - cl = NEXTOP(cl,xF); + cl = NEXTOP(cl,xl); break; case _p_db_ref_x: - if (cl->u.xF.F != FAILCODE) { + if (cl->u.xl.F != FAILCODE) { clause->Tag = (CELL)NULL; return; } - if (regcopy_in(myregs, nofregs, cl->u.xF.x)) { + if (regcopy_in(myregs, nofregs, cl->u.xl.x)) { clause->Tag = AbsAppl((CELL *)FunctorDBRef); clause->u.t_ptr = (CELL)NULL; return; } - cl = NEXTOP(cl,xF); + cl = NEXTOP(cl,xl); break; case _p_float_x: - if (cl->u.xF.F != FAILCODE) { + if (cl->u.xl.F != FAILCODE) { clause->Tag = (CELL)NULL; return; } - if (regcopy_in(myregs, nofregs, cl->u.xF.x)) { + if (regcopy_in(myregs, nofregs, cl->u.xl.x)) { clause->Tag = AbsAppl((CELL *)FunctorDouble); clause->u.t_ptr = (CELL)NULL; return; } - cl = NEXTOP(cl,xF); + cl = NEXTOP(cl,xl); break; case _p_atom_x: - if (cl->u.xF.F != FAILCODE) { + if (cl->u.xl.F != FAILCODE) { clause->Tag = (CELL)NULL; return; } - if (regcopy_in(myregs, nofregs, cl->u.xF.x)) { + if (regcopy_in(myregs, nofregs, cl->u.xl.x)) { clause->Tag = (_atom+1)*sizeof(CELL); clause->u.t_ptr = (CELL)NULL; return; } - cl = NEXTOP(cl,xF); + cl = NEXTOP(cl,xl); break; case _get_list: if (regcopy_in(myregs, nofregs, cl->u.x.x)) { @@ -1651,124 +1650,124 @@ add_info(ClauseDef *clause, UInt regno) cl = NEXTOP(cl,y); break; case _p_nonvar_y: - if (cl->u.yF.F != FAILCODE) { + if (cl->u.yl.F != FAILCODE) { clause->Tag = (CELL)NULL; return; } - if (cl->u.yF.y == ycopy) { + if (cl->u.yl.y == ycopy) { clause->Tag = (CELL)NULL; clause->u.t_ptr = (CELL)NULL; return; } - cl = NEXTOP(cl,yF); + cl = NEXTOP(cl,yl); break; case _p_atomic_y: - if (cl->u.yF.F != FAILCODE) { + if (cl->u.yl.F != FAILCODE) { clause->Tag = (CELL)NULL; return; } - if (ycopy == cl->u.yF.y) { + if (ycopy == cl->u.yl.y) { clause->Tag = (_atomic+1)*sizeof(CELL); clause->u.t_ptr = (CELL)NULL; return; } - cl = NEXTOP(cl,yF); + cl = NEXTOP(cl,yl); break; case _p_integer_y: - if (cl->u.yF.F != FAILCODE) { + if (cl->u.yl.F != FAILCODE) { clause->Tag = (CELL)NULL; return; } - if (ycopy == cl->u.yF.y) { + if (ycopy == cl->u.yl.y) { clause->Tag = (_integer+1)*sizeof(CELL); clause->u.t_ptr = (CELL)NULL; return; } - cl = NEXTOP(cl,yF); + cl = NEXTOP(cl,yl); break; case _p_number_y: - if (cl->u.yF.F != FAILCODE) { + if (cl->u.yl.F != FAILCODE) { clause->Tag = (CELL)NULL; return; } - if (ycopy == cl->u.yF.y) { + if (ycopy == cl->u.yl.y) { clause->Tag = (_number+1)*sizeof(CELL); clause->u.t_ptr = (CELL)NULL; return; } - cl = NEXTOP(cl,yF); + cl = NEXTOP(cl,yl); break; case _p_primitive_y: - if (cl->u.yF.F != FAILCODE) { + if (cl->u.yl.F != FAILCODE) { clause->Tag = (CELL)NULL; return; } - if (ycopy == cl->u.yF.y) { + if (ycopy == cl->u.yl.y) { clause->Tag = (_primitive+1)*sizeof(CELL); clause->u.t_ptr = (CELL)NULL; return; } - cl = NEXTOP(cl,yF); + cl = NEXTOP(cl,yl); break; case _p_compound_y: - if (cl->u.yF.F != FAILCODE) { + if (cl->u.yl.F != FAILCODE) { clause->Tag = (CELL)NULL; return; } - if (ycopy == cl->u.yF.y) { + if (ycopy == cl->u.yl.y) { clause->Tag = (_compound+1)*sizeof(CELL); clause->u.t_ptr = (CELL)NULL; return; } - cl = NEXTOP(cl,yF); + cl = NEXTOP(cl,yl); break; case _p_db_ref_y: - if (cl->u.yF.F != FAILCODE) { + if (cl->u.yl.F != FAILCODE) { clause->Tag = (CELL)NULL; return; } - if (ycopy == cl->u.yF.y) { + if (ycopy == cl->u.yl.y) { clause->Tag = AbsAppl((CELL *)FunctorDBRef); clause->u.t_ptr = (CELL)NULL; return; } - cl = NEXTOP(cl,yF); + cl = NEXTOP(cl,yl); break; case _p_float_y: - if (cl->u.yF.F != FAILCODE) { + if (cl->u.yl.F != FAILCODE) { clause->Tag = (CELL)NULL; return; } - if (ycopy == cl->u.yF.y) { + if (ycopy == cl->u.yl.y) { clause->Tag = AbsAppl((CELL *)FunctorDouble); clause->u.t_ptr = (CELL)NULL; return; } - cl = NEXTOP(cl,yF); + cl = NEXTOP(cl,yl); break; case _p_atom_y: - if (cl->u.yF.F != FAILCODE) { + if (cl->u.yl.F != FAILCODE) { clause->Tag = (CELL)NULL; return; } - if (cl->u.yF.y == ycopy) { + if (cl->u.yl.y == ycopy) { clause->Tag = (_atom+1)*sizeof(CELL); clause->u.t_ptr = (CELL)NULL; return; } - cl = NEXTOP(cl,yF); + cl = NEXTOP(cl,yl); break; case _p_var_y: - if (cl->u.yF.F != FAILCODE) { + if (cl->u.yl.F != FAILCODE) { clause->Tag = (CELL)NULL; return; } - if (cl->u.yF.y == ycopy) { + if (cl->u.yl.y == ycopy) { clause->Tag = (_var+1)*sizeof(CELL); clause->u.t_ptr = (CELL)NULL; return; } - cl = NEXTOP(cl,yF); + cl = NEXTOP(cl,yl); break; case _p_cut_by_y: clause->Tag = (CELL)NULL; @@ -2065,22 +2064,22 @@ add_info(ClauseDef *clause, UInt regno) } break; case _get_struct: - if (regcopy_in(myregs, nofregs, cl->u.xf.x)) { - clause->u.WorkPC = NEXTOP(cl,xf); - clause->Tag = AbsAppl((CELL *)cl->u.xf.f); + if (regcopy_in(myregs, nofregs, cl->u.xfa.x)) { + clause->u.WorkPC = NEXTOP(cl,xfa); + clause->Tag = AbsAppl((CELL *)cl->u.xfa.f); return; } else { - cl = NEXTOP(cl,xf); + cl = NEXTOP(cl,xfa); } break; case _put_struct: - if (regcopy_in(myregs, nofregs, cl->u.xf.x) && - (nofregs = delete_regcopy(myregs, nofregs, cl->u.xf.x)) == 0 && + if (regcopy_in(myregs, nofregs, cl->u.xfa.x) && + (nofregs = delete_regcopy(myregs, nofregs, cl->u.xfa.x)) == 0 && !ycopy) { clause->Tag = (CELL)NULL; return; } else { - cl = NEXTOP(cl,xf); + cl = NEXTOP(cl,xfa); } break; case _glist_valy: @@ -2255,7 +2254,7 @@ add_info(ClauseDef *clause, UInt regno) case _unify_struct: case _unify_l_struc_write: case _unify_l_struc: - cl = NEXTOP(cl,of); + cl = NEXTOP(cl,ofa); break; case _write_n_voids: case _pop_n: @@ -2269,7 +2268,7 @@ add_info(ClauseDef *clause, UInt regno) break; case _write_struct: case _write_l_struc: - cl = NEXTOP(cl,f); + cl = NEXTOP(cl,fa); break; case _call_c_wfail: case _try_c: @@ -2334,22 +2333,22 @@ add_info(ClauseDef *clause, UInt regno) case _p_slr_cv: case _p_arg_cv: case _p_func2s_cv: - if (regcopy_in(myregs, nofregs, cl->u.xcx.x) && - (nofregs = delete_regcopy(myregs, nofregs, cl->u.xcx.x)) == 0 && + if (regcopy_in(myregs, nofregs, cl->u.xxc.x) && + (nofregs = delete_regcopy(myregs, nofregs, cl->u.xxc.x)) == 0 && !ycopy) { clause->Tag = (CELL)NULL; return; } - cl = NEXTOP(cl,xcx); + cl = NEXTOP(cl,xxc); break; case _p_func2f_xy: - if (regcopy_in(myregs, nofregs, cl->u.xyx.x) && - (nofregs = delete_regcopy(myregs, nofregs, cl->u.xyx.x)) == 0 && + if (regcopy_in(myregs, nofregs, cl->u.xxy.x) && + (nofregs = delete_regcopy(myregs, nofregs, cl->u.xxy.x)) == 0 && !ycopy) { clause->Tag = (CELL)NULL; return; } - cl = NEXTOP(cl,xyx); + cl = NEXTOP(cl,xxy); break; case _p_plus_y_vv: case _p_minus_y_vv: @@ -2403,27 +2402,27 @@ add_info(ClauseDef *clause, UInt regno) case _p_slr_y_cv: case _p_arg_y_cv: case _p_func2s_y_cv: - if (cl->u.ycx.y == ycopy) { + if (cl->u.yxc.y == ycopy) { ycopy = 0; /* weird stuff, let's just reset ycopy */ if (nofregs == 0) { clause->Tag = (CELL)NULL; return; } } - cl = NEXTOP(cl,ycx); + cl = NEXTOP(cl,yxc); break; case _lock_lu: cl = NEXTOP(cl,p); break; case _call_bfunc_xx: - cl = NEXTOP(cl,llxx); + cl = NEXTOP(cl,plxxs); break; case _call_bfunc_yx: case _call_bfunc_xy: - cl = NEXTOP(cl,llxy); + cl = NEXTOP(cl,plxys); break; case _call_bfunc_yy: - cl = NEXTOP(cl,llyy); + cl = NEXTOP(cl,plyys); break; case _Ystop: case _Nstop: @@ -2450,7 +2449,7 @@ add_info(ClauseDef *clause, UInt regno) #endif /* YAPOR */ #ifdef TABLING case _table_try_single: - cl = NEXTOP(cl,ld); + cl = NEXTOP(cl,apl); break; case _table_load_answer: case _table_try_answer: @@ -2763,12 +2762,12 @@ add_head_info(ClauseDef *clause, UInt regno) break; */ case _get_struct: - if (cl->u.xf.x == iarg) { - clause->u.WorkPC = NEXTOP(cl,xf); - clause->Tag = AbsAppl((CELL *)cl->u.xf.f); + if (cl->u.xfa.x == iarg) { + clause->u.WorkPC = NEXTOP(cl,xfa); + clause->Tag = AbsAppl((CELL *)cl->u.xfa.f); return; } else { - cl = NEXTOP(cl,xf); + cl = NEXTOP(cl,xfa); } break; case _glist_valy: @@ -2898,7 +2897,7 @@ add_head_info(ClauseDef *clause, UInt regno) case _unify_struct: case _unify_l_struc_write: case _unify_l_struc: - cl = NEXTOP(cl,of); + cl = NEXTOP(cl,ofa); break; case _get_dbterm: cl = NEXTOP(cl,xc); @@ -2949,8 +2948,8 @@ move_next(ClauseDef *clause, UInt regno) switch (op) { case _p_db_ref_x: case _p_float_x: - if (wreg == cl->u.xF.x) { - clause->CurrentCode = NEXTOP(cl,xF); + if (wreg == cl->u.xl.x) { + clause->CurrentCode = NEXTOP(cl,xl); } return; case _get_list: @@ -2987,8 +2986,8 @@ move_next(ClauseDef *clause, UInt regno) case _get_bigint: */ case _get_struct: - if (wreg == cl->u.xf.x) { - clause->CurrentCode = NEXTOP(cl,xf); + if (wreg == cl->u.xfa.x) { + clause->CurrentCode = NEXTOP(cl,xfa); } default: clause->CurrentCode = clause->Code; @@ -3188,15 +3187,15 @@ add_arg_info(ClauseDef *clause, PredEntry *ap, UInt argno) case _unify_struct: case _unify_l_struc: if (argno == 1) { - clause->Tag = AbsAppl((CELL *)cl->u.of.f); - clause->u.WorkPC = NEXTOP(cl,of); + clause->Tag = AbsAppl((CELL *)cl->u.ofa.f); + clause->u.WorkPC = NEXTOP(cl,ofa); return; } /* must skip next n arguments */ - argno += cl->u.of.a-1; + argno += cl->u.ofa.a-1; case _unify_l_struc_write: case _unify_struct_write: - cl = NEXTOP(cl,of); + cl = NEXTOP(cl,ofa); break; case _pop: cl = NEXTOP(cl,e); @@ -3328,7 +3327,7 @@ skip_to_arg(ClauseDef *clause, PredEntry *ap, UInt argno, int at_point) break; case _unify_l_struc_write: case _unify_struct_write: - cl = NEXTOP(cl,of); + cl = NEXTOP(cl,ofa); break; case _pop: cl = NEXTOP(cl,e); @@ -3433,7 +3432,7 @@ emit_trust(ClauseDef *cl, struct intermediates *cint, UInt nxtlbl, int clauses) yamop *clcode = cl->Code; if (ap->PredFlags & TabledPredFlag) - clcode = NEXTOP(clcode, ld); + clcode = NEXTOP(clcode,apl); if (!(ap->PredFlags & LogUpdatePredFlag)) { /* this should not be generated for logical update predicates!! */ if (ap->PredFlags & ProfiledPredFlag) { @@ -3458,7 +3457,7 @@ emit_retry(ClauseDef *cl, struct intermediates *cint, int clauses) yamop *clcode = cl->Code; if (ap->PredFlags & TabledPredFlag) - clcode = NEXTOP(clcode, ld); + clcode = NEXTOP(clcode,apl); if (!(ap->PredFlags & LogUpdatePredFlag)) { /* this should not be generated for logical update predicates!! */ if (ap->PredFlags & ProfiledPredFlag) { @@ -3511,7 +3510,7 @@ emit_try(ClauseDef *cl, struct intermediates *cint, int var_group, int first, in if (ap->PredFlags & LogUpdatePredFlag) { clcode = cl->Code; } else if (ap->PredFlags & TabledPredFlag) { - clcode = NEXTOP(cl->Code, ld); + clcode = NEXTOP(cl->Code,apl); } else { clcode = cl->CurrentCode; } @@ -3846,7 +3845,7 @@ emit_single_switch_case(ClauseDef *min, struct intermediates *cint, int first, i if we still have clauses left, means we already created a CP, so I should avoid creating again */ - return (UInt)NEXTOP(min->CurrentCode,ld); + return (UInt)NEXTOP(min->CurrentCode,apl); } } #endif /* TABLING */ @@ -3865,8 +3864,8 @@ suspend_indexing(ClauseDef *min, ClauseDef *max, PredEntry *ap, struct intermedi if (cint->expand_block && cint->expand_block != (yamop *)(&(ap->cs.p_code.ExpandCode)) && - cint->expand_block->u.sp.s2 < 2*(max-min)) { - cint->expand_block->u.sp.s3++; + cint->expand_block->u.sssllp.s2 < 2*(max-min)) { + cint->expand_block->u.sssllp.s3++; return (UInt)(cint->expand_block); } if (cls < tcls/8) { @@ -3881,7 +3880,7 @@ suspend_indexing(ClauseDef *min, ClauseDef *max, PredEntry *ap, struct intermedi } else { tels = cls; } - sz = (UInt)NEXTOP((yamop *)NULL,sp)+tels*sizeof(yamop *), sz; + sz = (UInt)NEXTOP((yamop *)NULL,sssllp)+tels*sizeof(yamop *), sz; if ((ncode = (yamop *)Yap_AllocCodeSpace(sz)) == NULL) { save_machine_regs(); longjmp(cint->CompilerBotch, 2); @@ -3898,16 +3897,16 @@ suspend_indexing(ClauseDef *min, ClauseDef *max, PredEntry *ap, struct intermedi #ifdef LOW_PROF if (ProfilerOn && Yap_OffLineProfiler) { - Yap_inform_profiler_of_clause(ncode, NEXTOP(ncode,sp), ap, 1); + Yap_inform_profiler_of_clause(ncode, NEXTOP(ncode,sssllp), ap, 1); } #endif /* LOW_PROF */ /* create an expand_block */ ncode->opc = Yap_opcode(_expand_clauses); - ncode->u.sp.p = ap; - ncode->u.sp.s1 = tels; - ncode->u.sp.s2 = cls; - ncode->u.sp.s3 = 1; - st = (yamop **)NEXTOP(ncode,sp); + ncode->u.sssllp.p = ap; + ncode->u.sssllp.s1 = tels; + ncode->u.sssllp.s2 = cls; + ncode->u.sssllp.s3 = 1; + st = (yamop **)NEXTOP(ncode,sssllp); while (min <= max) { *st++ = min->Code; min++; @@ -3917,10 +3916,10 @@ suspend_indexing(ClauseDef *min, ClauseDef *max, PredEntry *ap, struct intermedi cls++; } LOCK(ExpandClausesListLock); - ncode->u.sp.snext = ExpandClausesFirst; - ncode->u.sp.sprev = NULL; + ncode->u.sssllp.snext = ExpandClausesFirst; + ncode->u.sssllp.sprev = NULL; if (ExpandClausesFirst) - ExpandClausesFirst->u.sp.sprev = ncode; + ExpandClausesFirst->u.sssllp.sprev = ncode; ExpandClausesFirst = ncode; if (ExpandClausesLast == NULL) ExpandClausesLast = ncode; @@ -3933,31 +3932,31 @@ suspend_indexing(ClauseDef *min, ClauseDef *max, PredEntry *ap, struct intermedi static void recover_ecls_block(yamop *ipc) { - ipc->u.sp.s3--; - if (!ipc->u.sp.s3) { + ipc->u.sssllp.s3--; + if (!ipc->u.sssllp.s3) { LOCK(ExpandClausesListLock); if (ExpandClausesFirst == ipc) - ExpandClausesFirst = ipc->u.sp.snext; + ExpandClausesFirst = ipc->u.sssllp.snext; if (ExpandClausesLast == ipc) { - ExpandClausesLast = ipc->u.sp.sprev; + ExpandClausesLast = ipc->u.sssllp.sprev; } - if (ipc->u.sp.sprev) { - ipc->u.sp.sprev->u.sp.snext = ipc->u.sp.snext; + if (ipc->u.sssllp.sprev) { + ipc->u.sssllp.sprev->u.sssllp.snext = ipc->u.sssllp.snext; } - if (ipc->u.sp.snext) { - ipc->u.sp.snext->u.sp.sprev = ipc->u.sp.sprev; + if (ipc->u.sssllp.snext) { + ipc->u.sssllp.snext->u.sssllp.sprev = ipc->u.sssllp.sprev; } UNLOCK(ExpandClausesListLock); #if DEBUG Yap_ExpandClauses--; - Yap_expand_clauses_sz -= (UInt)(NEXTOP((yamop *)NULL,sp))+ipc->u.sp.s1*sizeof(yamop *); + Yap_expand_clauses_sz -= (UInt)(NEXTOP((yamop *)NULL,sssllp))+ipc->u.sssllp.s1*sizeof(yamop *); #endif /* no dangling pointers for gprof */ Yap_InformOfRemoval((CODEADDR)ipc); - if (ipc->u.sp.p->PredFlags & LogUpdatePredFlag) { - Yap_LUIndexSpace_EXT -= (UInt)NEXTOP((yamop *)NULL,sp)+ipc->u.sp.s1*sizeof(yamop *); + if (ipc->u.sssllp.p->PredFlags & LogUpdatePredFlag) { + Yap_LUIndexSpace_EXT -= (UInt)NEXTOP((yamop *)NULL,sssllp)+ipc->u.sssllp.s1*sizeof(yamop *); } else - Yap_IndexSpace_EXT -= (UInt)NEXTOP((yamop *)NULL,sp)+ipc->u.sp.s1*sizeof(yamop *); + Yap_IndexSpace_EXT -= (UInt)NEXTOP((yamop *)NULL,sssllp)+ipc->u.sssllp.s1*sizeof(yamop *); Yap_FreeCodeSpace((char *)ipc); } } @@ -5294,23 +5293,23 @@ expand_index(struct intermediates *cint) { case _retry: /* this clause had no indexing */ if (ap->PredFlags & LogUpdatePredFlag) { - first = ClauseCodeToLogUpdClause(ipc->u.ld.d)->ClNext->ClCode; + first = ClauseCodeToLogUpdClause(ipc->u.apl.d)->ClNext->ClCode; } else if (ap->PredFlags & MegaClausePredFlag) { MegaClause *mcl = ClauseCodeToMegaClause(ap->cs.p_code.FirstClause); - first = (yamop *)((char *)ipc->u.ld.d)+mcl->ClItemSize; + first = (yamop *)((char *)ipc->u.apl.d)+mcl->ClItemSize; } else { - first = ClauseCodeToStaticClause(ipc->u.ld.d)->ClNext->ClCode; + first = ClauseCodeToStaticClause(ipc->u.apl.d)->ClNext->ClCode; } isfirstcl = FALSE; - ipc = NEXTOP(ipc,ld); + ipc = NEXTOP(ipc,apl); break; #if TABLING case _table_try: case _table_retry: /* this clause had no indexing */ - first = ClauseCodeToStaticClause(PREVOP(ipc->u.ld.d,ld))->ClNext->ClCode; + first = ClauseCodeToStaticClause(PREVOP(ipc->u.apl.d,apl))->ClNext->ClCode; isfirstcl = FALSE; - ipc = NEXTOP(ipc,ld); + ipc = NEXTOP(ipc,apl); break; #endif /* TABLING */ case _try_clause2: @@ -5324,7 +5323,7 @@ expand_index(struct intermediates *cint) { first = ClauseCodeToLogUpdClause(ipc->u.l.l)->ClNext->ClCode; } else if (ap->PredFlags & MegaClausePredFlag) { MegaClause *mcl = ClauseCodeToMegaClause(ap->cs.p_code.FirstClause); - first = (yamop *)((char *)ipc->u.ld.d)+mcl->ClItemSize; + first = (yamop *)((char *)ipc->u.apl.d)+mcl->ClItemSize; } else { first = ClauseCodeToStaticClause(ipc->u.l.l)->ClNext->ClCode; } @@ -5343,8 +5342,8 @@ expand_index(struct intermediates *cint) { /* ok, we found the start for an indexing block, but we don't if we are going to operate here or not */ /* if we are to commit here, alt will tell us where */ - alt = ipc->u.ld.d; - ipc = NEXTOP(ipc,ld); + alt = ipc->u.apl.d; + ipc = NEXTOP(ipc,apl); /* start of a group, reset stack */ sp = stack; stack[0].pos = 0; @@ -5356,7 +5355,7 @@ expand_index(struct intermediates *cint) { case _table_trust_me: #endif /* TABLING */ /* we will commit to this group for sure */ - ipc = NEXTOP(ipc,ld); + ipc = NEXTOP(ipc,apl); alt = NULL; /* start of a group, reset stack */ sp = stack; @@ -5373,14 +5372,16 @@ expand_index(struct intermediates *cint) { case _retry_logical: case _count_retry_logical: case _profiled_retry_logical: + ipc = ipc->u.aLl.n; + break; case _trust_logical: case _count_trust_logical: case _profiled_trust_logical: - ipc = ipc->u.lld.n; + ipc = ipc->u.ILl.n; break; case _enter_lu_pred: /* no useful info */ - ipc = ipc->u.Ill.l1; + ipc = ipc->u.Ills.l1; break; case _retry_profiled: case _count_retry: @@ -5604,7 +5605,7 @@ expand_index(struct intermediates *cint) { if (alt != NULL && ap->PredFlags & LogUpdatePredFlag) { op_numbers fop = Yap_op_from_opcode(alt->opc); if (fop == _enter_lu_pred) - alt = alt->u.Ill.l1; + alt = alt->u.Ills.l1; } ipc = NULL; break; @@ -5619,7 +5620,7 @@ expand_index(struct intermediates *cint) { ipc = NULL; } else { /* backtrack */ - first = alt->u.ld.d; + first = alt->u.apl.d; ipc = alt; alt = NULL; } @@ -5653,15 +5654,15 @@ expand_index(struct intermediates *cint) { if (op >= _retry2 && op <= _retry4) { last = alt->u.l.l; } else { - last = alt->u.ld.d; + last = alt->u.apl.d; } } else { op_numbers op = Yap_op_from_opcode(alt->opc); if (op == _retry || op == _trust) { - last = alt->u.ld.d; + last = alt->u.apl.d; #ifdef TABLING } else if (op == _table_retry || op == _table_trust) { - last = PREVOP(alt->u.ld.d,ld); + last = PREVOP(alt->u.apl.d,apl); #endif /* TABLING */ } else if (op >= _retry2 && op <= _retry4) { last = alt->u.l.l; @@ -5675,8 +5676,8 @@ expand_index(struct intermediates *cint) { /* ok, we know how many clauses */ yamop *ipc = *labp; /* check all slots, not just the ones with values */ - COUNT nclauses = ipc->u.sp.s1; - yamop **clp = (yamop **)NEXTOP(ipc,sp); + COUNT nclauses = ipc->u.sssllp.s1; + yamop **clp = (yamop **)NEXTOP(ipc,sssllp); eblk = cint->expand_block = ipc; if (cls+2*nclauses > (ClauseDef *)(ASP-4096)) { @@ -6331,43 +6332,43 @@ kill_block(path_stack_entry *sp, PredEntry *ap) static LogUpdClause * find_last_clause(yamop *start) { - while (start->u.lld.d->ClFlags & ErasedMask) - start = start->u.lld.n; + while (start->u.aLl.d->ClFlags & ErasedMask) + start = start->u.aLl.n; /* this should be the available clause */ - return start->u.lld.d; + return start->u.aLl.d; } static void remove_clause_from_index(yamop *header, LogUpdClause *cl) { - yamop **prevp = &(header->u.Ill.l1); - yamop *curp = header->u.Ill.l1; + yamop **prevp = &(header->u.Ills.l1); + yamop *curp = header->u.Ills.l1; - if (curp->u.lld.d == cl) { - yamop *newp = curp->u.lld.n; + if (curp->u.aLl.d == cl) { + yamop *newp = curp->u.aLl.n; newp->opc = curp->opc; *prevp = newp; } else { yamop *ocurp = NULL, *ocurp0 = curp; - while (curp->u.lld.d != cl) { + while (curp->u.aLl.d != cl) { ocurp = curp; - curp = curp->u.lld.n; + curp = curp->u.aLl.n; } /* in case we were the last */ - if (curp == header->u.Ill.l2) - header->u.Ill.l2 = ocurp; + if (curp == header->u.Ills.l2) + header->u.Ills.l2 = ocurp; if (ocurp != ocurp0) ocurp->opc = curp->opc; - ocurp->u.lld.n = curp->u.lld.n; - ocurp->u.lld.t.block = curp->u.lld.t.block; + ocurp->u.ILl.n = curp->u.aLl.n; + ocurp->u.ILl.block = curp->u.ILl.block; } #ifdef DEBUG Yap_DirtyCps--; Yap_FreedCps++; #endif clean_ref_to_clause(cl); - Yap_LUIndexSpace_CP -= (UInt)NEXTOP((yamop*)NULL,lld); + Yap_LUIndexSpace_CP -= (UInt)NEXTOP((yamop*)NULL,ILl); Yap_FreeCodeSpace((ADDR)curp); } @@ -6377,15 +6378,15 @@ remove_dirty_clauses_from_index(yamop *header) LogUpdClause *cl; yamop *previouscurp; OPCODE endop = Yap_opcode(_trust_logical); - yamop **prevp= &(header->u.Ill.l1), *curp = header->u.Ill.l1; + yamop **prevp= &(header->u.Ills.l1), *curp = header->u.Ills.l1; OPCODE startopc = curp->opc; - PredEntry *ap = curp->u.lld.d->ClPred; + PredEntry *ap = curp->u.aLl.d->ClPred; if (ap->PredFlags & CountPredFlag) endop = Yap_opcode(_count_trust_logical); else if (ap->PredFlags & ProfiledPredFlag) endop = Yap_opcode(_profiled_trust_logical); - while ((cl = curp->u.lld.d)->ClFlags & ErasedMask) { + while ((cl = curp->u.aLl.d)->ClFlags & ErasedMask) { yamop *ocurp = curp; #ifdef DEBUG @@ -6393,7 +6394,7 @@ remove_dirty_clauses_from_index(yamop *header) Yap_FreedCps++; #endif clean_ref_to_clause(cl); - curp = curp->u.lld.n; + curp = curp->u.aLl.n; Yap_FreeCodeSpace((ADDR)ocurp); } *prevp = curp; @@ -6401,9 +6402,9 @@ remove_dirty_clauses_from_index(yamop *header) if (curp->opc == endop) return; previouscurp = curp; - curp = curp->u.lld.n; + curp = curp->u.aLl.n; while (TRUE) { - if ((cl = curp->u.lld.d)->ClFlags & ErasedMask) { + if ((cl = curp->u.aLl.d)->ClFlags & ErasedMask) { yamop *ocurp = curp; #ifdef DEBUG @@ -6413,24 +6414,24 @@ remove_dirty_clauses_from_index(yamop *header) clean_ref_to_clause(cl); if (curp->opc == endop) { previouscurp->opc = endop; - previouscurp->u.lld.t.block = curp->u.lld.t.block; - previouscurp->u.lld.n = NULL; - header->u.Ill.l2 = previouscurp; - Yap_LUIndexSpace_CP -= (UInt)NEXTOP((yamop*)NULL,lld); + previouscurp->u.ILl.block = curp->u.ILl.block; + previouscurp->u.ILl.n = NULL; + header->u.Ills.l2 = previouscurp; + Yap_LUIndexSpace_CP -= (UInt)NEXTOP((yamop*)NULL,ILl); Yap_FreeCodeSpace((ADDR)curp); return; } - previouscurp->u.lld.n = curp->u.lld.n; - curp = curp->u.lld.n; - Yap_LUIndexSpace_CP -= (UInt)NEXTOP((yamop*)NULL,lld); + previouscurp->u.aLl.n = curp->u.aLl.n; + curp = curp->u.aLl.n; + Yap_LUIndexSpace_CP -= (UInt)NEXTOP((yamop*)NULL,aLl); Yap_FreeCodeSpace((ADDR)ocurp); } else { previouscurp = curp; if (curp->opc == endop) { - curp->u.lld.n = NULL; + curp->u.ILl.n = NULL; return; } - curp = curp->u.lld.n; + curp = curp->u.aLl.n; } } } @@ -6460,15 +6461,15 @@ kill_clause(yamop *ipc, yamop *bg, yamop *lt, path_stack_entry *sp0, PredEntry * return kill_block(sp+1, ap); } /* weird case ????? */ - if (!start->u.Ill.s){ + if (!start->u.Ills.s){ /* ERROR */ - Yap_Error(INTERNAL_ERROR, TermNil, "Ill.s == 0 %p", ipc); + Yap_Error(INTERNAL_ERROR, TermNil, "Ills.s == 0 %p", ipc); return sp; } - if (start->u.Ill.s == 1) { + if (start->u.Ills.s == 1) { /* we need to discover which clause is left and then die */ path_stack_entry *nsp; - LogUpdClause *tgl = find_last_clause(start->u.Ill.l1); + LogUpdClause *tgl = find_last_clause(start->u.Ills.l1); nsp = sp; while ((--nsp)->flag != block_entry); @@ -6544,7 +6545,7 @@ static_clause(yamop *ipc, PredEntry *ap, int trust) if (ap->PredFlags & MegaClausePredFlag) return (StaticClause *)ipc; if (ap->PredFlags & TabledPredFlag) - ipc = PREVOP(ipc, ld); + ipc = PREVOP(ipc,apl); p = (CELL *)ipc; if (trust) { return ClauseCodeToStaticClause(p); @@ -6556,7 +6557,7 @@ static_clause(yamop *ipc, PredEntry *ap, int trust) switch (op) { case _p_db_ref_x: case _p_float_x: - j = Yap_regnotoreg(ipc->u.xF.x); + j = Yap_regnotoreg(ipc->u.xl.x); break; case _get_list: j = Yap_regnotoreg(ipc->u.x.x); @@ -6642,10 +6643,10 @@ compacta_expand_clauses(yamop *ipc) { /* expand clauses so that you have a hole at the beginning */ /* we know that there is at least one element here */ - yamop **start = (yamop **)(NEXTOP(ipc,sp)); + yamop **start = (yamop **)(NEXTOP(ipc,sssllp)); yamop **ptr, **end; - ptr = end = start+ipc->u.sp.s1; + ptr = end = start+ipc->u.sssllp.s1; while (ptr > start) { yamop *next = *--ptr; @@ -6665,10 +6666,10 @@ compactz_expand_clauses(yamop *ipc) { /* expand clauses so that you have a hole at the beginning */ /* we know that there is at least one element here */ - yamop **start = (yamop **)(NEXTOP(ipc,sp)); + yamop **start = (yamop **)(NEXTOP(ipc,sssllp)); yamop **ptr, **end; - end = start+ipc->u.sp.s1; + end = start+ipc->u.sssllp.s1; ptr = start; while (ptr < end) { @@ -6695,25 +6696,25 @@ add_to_expand_clauses(path_stack_entry **spp, yamop *ipc, ClauseDef *cls, PredEn if (first) { do { - clar = (yamop **)NEXTOP(ipc,sp); + clar = (yamop **)NEXTOP(ipc,sssllp); if (*clar == NULL || clar[0] == cls->Code) { while (*clar == NULL) clar++; if (clar[0] != cls->Code) { clar[-1] = cls->Code; - ipc->u.sp.s2++; + ipc->u.sssllp.s2++; } return pop_path(spp, cls, ap); } } while (compacta_expand_clauses(ipc)); } else { do { - clar = (yamop **)NEXTOP(ipc,sp) + ipc->u.sp.s1; + clar = (yamop **)NEXTOP(ipc,sssllp) + ipc->u.sssllp.s1; if (clar[-1] == NULL || clar[-1] == cls->Code) { while (*--clar == NULL); if (clar[0] != cls->Code) { clar[1] = cls->Code; - ipc->u.sp.s2++; + ipc->u.sssllp.s2++; } return pop_path(spp, cls, ap); } @@ -6731,21 +6732,21 @@ add_to_expand_clauses(path_stack_entry **spp, yamop *ipc, ClauseDef *cls, PredEn static void nullify_expand_clause(yamop *ipc, path_stack_entry *sp, ClauseDef *cls) { - yamop **st = (yamop **)NEXTOP(ipc,sp); - yamop **max = st+ipc->u.sp.s1; + yamop **st = (yamop **)NEXTOP(ipc,sssllp); + yamop **max = st+ipc->u.sssllp.s1; /* make sure we get rid of the reference */ while (st < max) { if (*st && *st == cls->Code) { *st = NULL; - ipc->u.sp.s2--; + ipc->u.sssllp.s2--; break; } st++; } /* if the block has a single element */ - if (ipc->u.sp.s2 == 1) { - yamop **st = (yamop **)NEXTOP(ipc,sp); + if (ipc->u.sssllp.s2 == 1) { + yamop **st = (yamop **)NEXTOP(ipc,sssllp); while ((--sp)->flag != block_entry); while (TRUE) { if (*st && *st != cls->Code) { @@ -6762,7 +6763,7 @@ static yamop * add_try(PredEntry *ap, ClauseDef *cls, yamop *next, struct intermediates *cint) { yamop *newcp; - UInt size = (UInt)NEXTOP((yamop *)NULL,lld); + UInt size = (UInt)NEXTOP((yamop *)NULL,aLl); LogUpdClause *lcl = ClauseCodeToLogUpdClause(cls->Code); if ((newcp = (yamop *)Yap_AllocCodeSpace(size)) == NULL) { @@ -6776,9 +6777,9 @@ add_try(PredEntry *ap, ClauseDef *cls, yamop *next, struct intermediates *cint) Yap_LiveCps++; #endif newcp->opc = Yap_opcode(_try_logical); - newcp->u.lld.t.s = ap->ArityOfPE; - newcp->u.lld.n = next; - newcp->u.lld.d = lcl; + newcp->u.aLl.s = ap->ArityOfPE; + newcp->u.aLl.n = next; + newcp->u.aLl.d = lcl; lcl->ClRefCount++; return newcp; } @@ -6787,7 +6788,7 @@ static yamop * add_trust(LogUpdIndex *icl, ClauseDef *cls, struct intermediates *cint) { yamop *newcp; - UInt size = (UInt)NEXTOP((yamop *)NULL,lld); + UInt size = (UInt)NEXTOP((yamop *)NULL,ILl); LogUpdClause *lcl = ClauseCodeToLogUpdClause(cls->Code); PredEntry *ap = lcl->ClPred; @@ -6807,9 +6808,9 @@ add_trust(LogUpdIndex *icl, ClauseDef *cls, struct intermediates *cint) newcp->opc = Yap_opcode(_profiled_trust_logical); else newcp->opc = Yap_opcode(_trust_logical); - newcp->u.lld.t.block = icl; - newcp->u.lld.n = NULL; - newcp->u.lld.d = lcl; + newcp->u.ILl.block = icl; + newcp->u.ILl.n = NULL; + newcp->u.ILl.d = lcl; lcl->ClRefCount++; return newcp; } @@ -6841,20 +6842,20 @@ add_to_index(struct intermediates *cint, int first, path_stack_entry *sp, Clause /* ERROR */ break; case _enter_lu_pred: - ipc->u.Ill.s++; - icl = ipc->u.Ill.I; + ipc->u.Ills.s++; + icl = ipc->u.Ills.I; if (first) { if (ap->PredFlags & CountPredFlag) - ipc->u.Ill.l1->opc = Yap_opcode(_count_retry_logical); + ipc->u.Ills.l1->opc = Yap_opcode(_count_retry_logical); else if (ap->PredFlags & ProfiledPredFlag) - ipc->u.Ill.l1->opc = Yap_opcode(_profiled_retry_logical); + ipc->u.Ills.l1->opc = Yap_opcode(_profiled_retry_logical); else - ipc->u.Ill.l1->opc = Yap_opcode(_retry_logical); - ipc->u.Ill.l1 = add_try(ap, cls, ipc->u.Ill.l1, cint); + ipc->u.Ills.l1->opc = Yap_opcode(_retry_logical); + ipc->u.Ills.l1 = add_try(ap, cls, ipc->u.Ills.l1, cint); } else { /* just go to next instruction */ yamop *end = add_trust(icl, cls, cint), - *old = ipc->u.Ill.l2; + *old = ipc->u.Ills.l2; /* we used to have two clauses */ if (ap->PredFlags & CountPredFlag) @@ -6863,9 +6864,9 @@ add_to_index(struct intermediates *cint, int first, path_stack_entry *sp, Clause old->opc = Yap_opcode(_profiled_retry_logical); else old->opc = Yap_opcode(_retry_logical); - old->u.lld.n = end; - old->u.lld.t.s = ap->ArityOfPE; - ipc->u.Ill.l2 = end; + old->u.aLl.n = end; + old->u.aLl.s = ap->ArityOfPE; + ipc->u.Ills.l2 = end; } ipc = pop_path(&sp, cls, ap); break; @@ -6878,7 +6879,7 @@ add_to_index(struct intermediates *cint, int first, path_stack_entry *sp, Clause ipc = pop_path(&sp, cls, ap); } else { /* just go to next instruction */ - ipc = NEXTOP(ipc,ld); + ipc = NEXTOP(ipc,apl); } break; case _try_clause2: @@ -6897,7 +6898,7 @@ add_to_index(struct intermediates *cint, int first, path_stack_entry *sp, Clause break; case _retry: /* this clause had no indexing */ - ipc = NEXTOP(ipc,ld); + ipc = NEXTOP(ipc,apl); break; case _retry2: case _retry3: @@ -6909,26 +6910,26 @@ add_to_index(struct intermediates *cint, int first, path_stack_entry *sp, Clause case _retry_me: /* should never be reached both for asserta */ group1 = FALSE; - ipc = ipc->u.ld.d; + ipc = ipc->u.apl.d; break; case _try_me: if (first) { - ipc = NEXTOP(ipc,ld); - alt = ipc->u.ld.d; + ipc = NEXTOP(ipc,apl); + alt = ipc->u.apl.d; } else { - ipc = ipc->u.ld.d; + ipc = ipc->u.apl.d; group1 = FALSE; } break; case _retry_profiled: case _count_retry: - ipc = NEXTOP(ipc, ld); + ipc = NEXTOP(ipc,apl); break; case _profiled_trust_me: case _trust_me: case _count_trust_me: group1 = FALSE; - ipc = NEXTOP(ipc, ld); + ipc = NEXTOP(ipc,apl); break; case _trust: sp = expandz_block(sp, ap, cls, group1, alt, cint); @@ -7429,12 +7430,12 @@ remove_from_index(PredEntry *ap, path_stack_entry *sp, ClauseDef *cls, yamop *bg /* I cannot expand a predicate that starts on a variable, have to expand the index. */ - if (IN_BETWEEN(bg,ipc->u.ld.d,lt)) { + if (IN_BETWEEN(bg,ipc->u.apl.d,lt)) { sp = kill_clause(ipc, bg, lt, sp, ap); ipc = pop_path(&sp, cls, ap); } else { /* just go to next instruction */ - ipc = NEXTOP(ipc,ld); + ipc = NEXTOP(ipc,apl); } break; case _try_clause2: @@ -7455,13 +7456,13 @@ remove_from_index(PredEntry *ap, path_stack_entry *sp, ClauseDef *cls, yamop *bg } break; case _trust: - if (IN_BETWEEN(bg,ipc->u.ld.d,lt)) { + if (IN_BETWEEN(bg,ipc->u.apl.d,lt)) { sp = kill_clause(ipc, bg, lt, sp, ap); } ipc = pop_path(&sp, cls, ap); break; case _enter_lu_pred: - ipc->u.Ill.s--; + ipc->u.Ills.s--; #ifdef DEBUG Yap_DirtyCps++; Yap_LiveCps--; @@ -7472,13 +7473,13 @@ remove_from_index(PredEntry *ap, path_stack_entry *sp, ClauseDef *cls, yamop *bg /* instructions type l */ case _try_me: case _retry_me: - sp = push_path(sp, &(ipc->u.ld.d), cls, cint); - ipc = NEXTOP(ipc,ld); + sp = push_path(sp, &(ipc->u.apl.d), cls, cint); + ipc = NEXTOP(ipc,apl); break; case _profiled_trust_me: case _trust_me: case _count_trust_me: - ipc = NEXTOP(ipc,ld); + ipc = NEXTOP(ipc,apl); break; case _jump: sp = cross_block(sp, &ipc->u.l.l, ap); @@ -7945,16 +7946,16 @@ Yap_FollowIndexingCode(PredEntry *ap, yamop *ipc, Term Terms[3], yamop *ap_pc, y case _table_try: #endif if (b0 == NULL) - store_clause_choice_point(Terms[0], Terms[1], Terms[2], NEXTOP(ipc,ld), ap, ap_pc, cp_pc); + store_clause_choice_point(Terms[0], Terms[1], Terms[2], NEXTOP(ipc,apl), ap, ap_pc, cp_pc); else { B = b0; b0 = NULL; - update_clause_choice_point(NEXTOP(ipc,ld), ap_pc); + update_clause_choice_point(NEXTOP(ipc,apl), ap_pc); } if (lu_pred) - return lu_clause(ipc->u.ld.d, ap); + return lu_clause(ipc->u.apl.d, ap); else - return (LogUpdClause *)static_clause(ipc->u.ld.d, ap, unbounded); + return (LogUpdClause *)static_clause(ipc->u.apl.d, ap, unbounded); case _try_clause2: case _try_clause3: case _try_clause4: @@ -7974,13 +7975,13 @@ Yap_FollowIndexingCode(PredEntry *ap, yamop *ipc, Term Terms[3], yamop *ap_pc, y case _table_try_me: #endif if (b0 == NULL) - store_clause_choice_point(Terms[0], Terms[1], Terms[2], ipc->u.ld.d, ap, ap_pc, cp_pc); + store_clause_choice_point(Terms[0], Terms[1], Terms[2], ipc->u.apl.d, ap, ap_pc, cp_pc); else { B = b0; b0 = NULL; - update_clause_choice_point(ipc->u.ld.d, ap_pc); + update_clause_choice_point(ipc->u.apl.d, ap_pc); } - ipc = NEXTOP(ipc,ld); + ipc = NEXTOP(ipc,apl); break; case _retry_profiled: case _count_retry: @@ -7990,11 +7991,11 @@ Yap_FollowIndexingCode(PredEntry *ap, yamop *ipc, Term Terms[3], yamop *ap_pc, y #if TABLING case _table_retry: #endif - update_clause_choice_point(NEXTOP(ipc,ld),ap_pc); + update_clause_choice_point(NEXTOP(ipc,apl),ap_pc); if (lu_pred) - return lu_clause(ipc->u.ld.d, ap); + return lu_clause(ipc->u.apl.d, ap); else - return (LogUpdClause *)static_clause(ipc->u.ld.d, ap, TRUE); + return (LogUpdClause *)static_clause(ipc->u.apl.d, ap, TRUE); case _retry2: case _retry3: case _retry4: @@ -8004,8 +8005,8 @@ Yap_FollowIndexingCode(PredEntry *ap, yamop *ipc, Term Terms[3], yamop *ap_pc, y else return (LogUpdClause *)static_clause(ipc->u.l.l, ap, TRUE); case _retry_me: - update_clause_choice_point(ipc->u.ld.d,ap_pc); - ipc = NEXTOP(ipc,ld); + update_clause_choice_point(ipc->u.apl.d,ap_pc); + ipc = NEXTOP(ipc,apl); break; case _trust: #if TABLING @@ -8031,9 +8032,9 @@ Yap_FollowIndexingCode(PredEntry *ap, yamop *ipc, Term Terms[3], yamop *ap_pc, y #endif /* YAPOR */ b0 = B; if (lu_pred) - return lu_clause(ipc->u.ld.d, ap); + return lu_clause(ipc->u.apl.d, ap); else - return (LogUpdClause *)static_clause(ipc->u.ld.d, ap, TRUE); + return (LogUpdClause *)static_clause(ipc->u.apl.d, ap, TRUE); case _profiled_trust_me: case _trust_me: case _count_trust_me: @@ -8059,11 +8060,11 @@ Yap_FollowIndexingCode(PredEntry *ap, yamop *ipc, Term Terms[3], yamop *ap_pc, y #else B = B->cp_b; #endif /* YAPOR */ - ipc = NEXTOP(ipc,ld); + ipc = NEXTOP(ipc,apl); break; case _enter_lu_pred: { - LogUpdIndex *cl = ipc->u.Ill.I; + LogUpdIndex *cl = ipc->u.Ills.I; PredEntry *ap = cl->ClPred; if (ap->LastCallOfPred != LUCALL_EXEC) { @@ -8090,52 +8091,52 @@ Yap_FollowIndexingCode(PredEntry *ap, yamop *ipc, Term Terms[3], yamop *ap_pc, y } #endif } - ipc = ipc->u.Ill.l1; + ipc = ipc->u.Ills.l1; break; case _try_logical: if (b0 == NULL) - store_clause_choice_point(Terms[0], Terms[1], Terms[2], ipc->u.lld.n, ap, ap_pc, cp_pc); + store_clause_choice_point(Terms[0], Terms[1], Terms[2], ipc->u.aLl.n, ap, ap_pc, cp_pc); else { B = b0; b0 = NULL; - update_clause_choice_point(ipc->u.lld.n, ap_pc); + update_clause_choice_point(ipc->u.aLl.n, ap_pc); } { UInt timestamp = IntegerOfTerm(((CELL *)(B+1))[5]); - if (!VALID_TIMESTAMP(timestamp, ipc->u.lld.d)) { + if (!VALID_TIMESTAMP(timestamp, ipc->u.aLl.d)) { /* jump to next instruction */ - ipc = ipc->u.lld.n; + ipc = ipc->u.aLl.n; break; } } - return ipc->u.lld.d; + return ipc->u.aLl.d; case _retry_logical: case _profiled_retry_logical: case _count_retry_logical: { UInt timestamp = IntegerOfTerm(((CELL *)(B+1))[5]); - if (!VALID_TIMESTAMP(timestamp, ipc->u.lld.d)) { + if (!VALID_TIMESTAMP(timestamp, ipc->u.aLl.d)) { /* jump to next instruction */ - ipc = ipc->u.lld.n; + ipc = ipc->u.aLl.n; break; } } - update_clause_choice_point(ipc->u.lld.n,ap_pc); - return ipc->u.lld.d; + update_clause_choice_point(ipc->u.ILl.n,ap_pc); + return ipc->u.ILl.d; case _trust_logical: case _count_trust_logical: case _profiled_trust_logical: { UInt timestamp = ((CELL *)(B+1))[5]; - LogUpdIndex *cl = ipc->u.lld.t.block; + LogUpdIndex *cl = ipc->u.ILl.block; LogUpdClause *newpc; - if (!VALID_TIMESTAMP(timestamp, ipc->u.lld.d)) { + if (!VALID_TIMESTAMP(timestamp, ipc->u.ILl.d)) { /* jump to next instruction */ newpc = NULL; } else { - newpc = ipc->u.lld.d; + newpc = ipc->u.ILl.d; } #if defined(YAPOR) || defined(THREADS) B->cp_tr--; @@ -8161,7 +8162,7 @@ Yap_FollowIndexingCode(PredEntry *ap, yamop *ipc, Term Terms[3], yamop *ap_pc, y cl->ClFlags &= ~InUseMask; /* next, recover space for the indexing code if it was erased */ if (cl->ClFlags & (ErasedMask|DirtyMask)) { - LogUpdClause *lcl = ipc->u.lld.d; + LogUpdClause *lcl = ipc->u.ILl.d; /* make sure we don't erase the clause we are jumping to */ if (lcl->ClRefCount == 1 && !(lcl->ClFlags & (DirtyMask|InUseMask))) { lcl->ClFlags |= InUseMask; @@ -8515,26 +8516,26 @@ Yap_NthClause(PredEntry *ap, Int ncls) case _try_clause: case _retry: if (ncls == 1) - return to_clause(ipc->u.ld.d, ap); + return to_clause(ipc->u.apl.d, ap); else if (alt == NULL) { ncls --; /* get there in a fell swoop */ if (ap->PredFlags & ProfiledPredFlag) { if (ap->PredFlags & CountPredFlag) { - ipc = (yamop *)((char *)ipc+ncls*(UInt)NEXTOP(NEXTOP(NEXTOP((yamop *)NULL,ld),p),p)); + ipc = (yamop *)((char *)ipc+ncls*(UInt)NEXTOP(NEXTOP(NEXTOP((yamop *)NULL,apl),p),p)); } else { - ipc = (yamop *)((char *)ipc+ncls*(UInt)NEXTOP(NEXTOP((yamop *)NULL,ld),p)); + ipc = (yamop *)((char *)ipc+ncls*(UInt)NEXTOP(NEXTOP((yamop *)NULL,apl),p)); } } else if (ap->PredFlags & CountPredFlag) { - ipc = (yamop *)((char *)ipc+ncls*(UInt)NEXTOP(NEXTOP((yamop *)NULL,ld),p)); + ipc = (yamop *)((char *)ipc+ncls*(UInt)NEXTOP(NEXTOP((yamop *)NULL,apl),p)); } else { - ipc = (yamop *)((char *)ipc+ncls*(UInt)NEXTOP((yamop *)NULL,ld)); + ipc = (yamop *)((char *)ipc+ncls*(UInt)NEXTOP((yamop *)NULL,apl)); } - return to_clause(ipc->u.ld.d, ap); + return to_clause(ipc->u.apl.d, ap); } else { ncls--; } - ipc = NEXTOP(ipc,ld); + ipc = NEXTOP(ipc,apl); break; case _try_clause2: case _try_clause3: @@ -8572,36 +8573,36 @@ Yap_NthClause(PredEntry *ap, Int ncls) break; case _try_me: case _retry_me: - alt = ipc->u.ld.d; - ipc = NEXTOP(ipc,ld); + alt = ipc->u.apl.d; + ipc = NEXTOP(ipc,apl); break; case _profiled_trust_me: case _trust_me: case _count_trust_me: alt = NULL; - ipc = NEXTOP(ipc,ld); + ipc = NEXTOP(ipc,apl); break; case _try_logical: case _retry_logical: case _count_retry_logical: case _profiled_retry_logical: - if (VALID_TIMESTAMP(ap->TimeStampOfPred, ipc->u.lld.d)) { + if (VALID_TIMESTAMP(ap->TimeStampOfPred, ipc->u.aLl.d)) { if (ncls == 1) - return ipc->u.lld.d; + return ipc->u.aLl.d; ncls--; } - ipc = ipc->u.lld.n; + ipc = ipc->u.aLl.n; break; case _trust_logical: case _count_trust_logical: case _profiled_trust_logical: - if (VALID_TIMESTAMP(ap->TimeStampOfPred, ipc->u.lld.d)) { + if (VALID_TIMESTAMP(ap->TimeStampOfPred, ipc->u.ILl.d)) { if (ncls == 1) - return ipc->u.lld.d; + return ipc->u.ILl.d; } return NULL; case _enter_lu_pred: - ipc = ipc->u.Ill.l1; + ipc = ipc->u.Ills.l1; break; case _lock_lu: ipc = NEXTOP(ipc,p); @@ -8681,7 +8682,7 @@ Yap_CleanUpIndex(LogUpdIndex *blk) start = NEXTOP(start, xll); op = Yap_op_from_opcode(start->opc); } - codep = start->u.Ill.l1; + codep = start->u.Ills.l1; remove_dirty_clauses_from_index(start); } diff --git a/C/init.c b/C/init.c index ca4b3d0ee..0a9d416e6 100644 --- a/C/init.c +++ b/C/init.c @@ -504,9 +504,9 @@ Yap_InitCPred(char *Name, unsigned long int Arity, CPredicate code, int flags) UInt sz; if (flags & SafePredFlag) { - sz = (CELL)NEXTOP(NEXTOP(NEXTOP(p_code,sla),p),l); + sz = (CELL)NEXTOP(NEXTOP(NEXTOP(p_code,sbpp),p),l); } else { - sz = (CELL)NEXTOP(NEXTOP(NEXTOP(NEXTOP(NEXTOP(p_code,e),sla),e),p),l); + sz = (CELL)NEXTOP(NEXTOP(NEXTOP(NEXTOP(NEXTOP(p_code,e),sbpp),e),p),l); } cl = (StaticClause *)Yap_AllocCodeSpace(sz); if (!cl) { @@ -535,12 +535,12 @@ Yap_InitCPred(char *Name, unsigned long int Arity, CPredicate code, int flags) p_code->opc = Yap_opcode(_call_usercpred); else p_code->opc = Yap_opcode(_call_cpred); - p_code->u.sla.bmap = NULL; - p_code->u.sla.s = -Signed(RealEnvSize); - p_code->u.sla.sla_u.p = - p_code->u.sla.p0 = + p_code->u.sbpp.bmap = NULL; + p_code->u.sbpp.s = -Signed(RealEnvSize); + p_code->u.sbpp.p = + p_code->u.sbpp.p0 = pe; - p_code = NEXTOP(p_code,sla); + p_code = NEXTOP(p_code,sbpp); if (!(flags & SafePredFlag)) { p_code->opc = Yap_opcode(_deallocate); p_code = NEXTOP(p_code,e); @@ -571,7 +571,7 @@ Yap_InitCmpPred(char *Name, unsigned long int Arity, CmpPredicate cmp_code, int /* already exists */ } else { while (!cl) { - UInt sz = sizeof(StaticClause)+(CELL)NEXTOP(NEXTOP(NEXTOP(((yamop *)NULL),llxx),p),l); + UInt sz = sizeof(StaticClause)+(CELL)NEXTOP(NEXTOP(NEXTOP(((yamop *)NULL),plxxs),p),l); cl = (StaticClause *)Yap_AllocCodeSpace(sz); if (!cl) { if (!Yap_growheap(FALSE, sz, NULL)) { @@ -594,12 +594,12 @@ Yap_InitCmpPred(char *Name, unsigned long int Arity, CmpPredicate cmp_code, int pe->cs.d_code = cmp_code; pe->ModuleOfPred = CurrentModule; p_code->opc = pe->OpcodeOfPred = Yap_opcode(_call_bfunc_xx); - p_code->u.llxx.p = pe; - p_code->u.llxx.f = FAILCODE; - p_code->u.llxx.x1 = Yap_emit_x(1); - p_code->u.llxx.x2 = Yap_emit_x(2); - p_code->u.llxx.flags = Yap_compile_cmp_flags(pe); - p_code = NEXTOP(p_code,llxx); + p_code->u.plxxs.p = pe; + p_code->u.plxxs.f = FAILCODE; + p_code->u.plxxs.x1 = Yap_emit_x(1); + p_code->u.plxxs.x2 = Yap_emit_x(2); + p_code->u.plxxs.flags = Yap_compile_cmp_flags(pe); + p_code = NEXTOP(p_code,plxxs); p_code->opc = Yap_opcode(_procceed); p_code->u.p.p = pe; p_code = NEXTOP(p_code,p); @@ -625,26 +625,26 @@ Yap_InitAsmPred(char *Name, unsigned long int Arity, int code, CPredicate def, StaticClause *cl; if (pe->CodeOfPred == (yamop *)(&(pe->OpcodeOfPred))) { - cl = (StaticClause *)Yap_AllocCodeSpace((CELL)NEXTOP(NEXTOP(NEXTOP(((yamop *)p_code),sla),p),l)); + cl = (StaticClause *)Yap_AllocCodeSpace((CELL)NEXTOP(NEXTOP(NEXTOP(((yamop *)p_code),sbpp),p),l)); if (!cl) { Yap_Error(OUT_OF_HEAP_ERROR,TermNil,"No Heap Space in InitAsmPred"); return; } - Yap_ClauseSpace += (CELL)NEXTOP(NEXTOP(NEXTOP(((yamop *)p_code),sla),p),l); + Yap_ClauseSpace += (CELL)NEXTOP(NEXTOP(NEXTOP(((yamop *)p_code),sbpp),p),l); } else { cl = ClauseCodeToStaticClause(pe->CodeOfPred); } cl->ClFlags = StaticMask; cl->ClNext = NULL; - cl->ClSize = (CELL)NEXTOP(NEXTOP(NEXTOP(((yamop *)p_code),sla),e),e); + cl->ClSize = (CELL)NEXTOP(NEXTOP(NEXTOP(((yamop *)p_code),sbpp),e),e); cl->usc.ClPred = pe; p_code = cl->ClCode; pe->CodeOfPred = p_code; p_code->opc = pe->OpcodeOfPred = Yap_opcode(_call_cpred); - p_code->u.sla.bmap = NULL; - p_code->u.sla.s = -Signed(RealEnvSize); - p_code->u.sla.sla_u.p = p_code->u.sla.p0 = pe; - p_code = NEXTOP(p_code,sla); + p_code->u.sbpp.bmap = NULL; + p_code->u.sbpp.s = -Signed(RealEnvSize); + p_code->u.sbpp.p = p_code->u.sbpp.p0 = pe; + p_code = NEXTOP(p_code,sbpp); p_code->opc = Yap_opcode(_procceed); p_code->u.p.p = pe; p_code = NEXTOP(p_code,p); @@ -681,8 +681,8 @@ CleanBack(PredEntry *pe, CPredicate Start, CPredicate Cont) INIT_YAMOP_LTT(code, 2); PUT_YAMOP_SEQ(code); #endif /* YAPOR */ - code->u.lds.f = Start; - code = NEXTOP(code,lds); + code->u.apFs.f = Start; + code = NEXTOP(code,apFs); if (pe->PredFlags & UserCPredFlag) code->opc = Yap_opcode(_retry_userc); else @@ -691,14 +691,14 @@ CleanBack(PredEntry *pe, CPredicate Start, CPredicate Cont) INIT_YAMOP_LTT(code, 1); PUT_YAMOP_SEQ(code); #endif /* YAPOR */ - code->u.lds.f = Cont; + code->u.apFs.f = Cont; #ifdef CUT_C - code = NEXTOP(code,lds); + code = NEXTOP(code,apFs); if (pe->PredFlags & UserCPredFlag) code->opc = Yap_opcode(_cut_c); else code->opc = Yap_opcode(_cut_userc); - code->u.lds.f = Cut; + code->u.apFs.f = Cut; #endif } @@ -758,9 +758,9 @@ Yap_InitCPredBack(char *Name, unsigned long int Arity, #endif /* YAPOR */ #ifdef CUT_C - cl = (StaticClause *)Yap_AllocCodeSpace((CELL)NEXTOP(NEXTOP(NEXTOP(NEXTOP(code,lds),lds),lds),l)); + cl = (StaticClause *)Yap_AllocCodeSpace((CELL)NEXTOP(NEXTOP(NEXTOP(NEXTOP(code,apFs),apFs),apFs),l)); #else - cl = (StaticClause *)Yap_AllocCodeSpace((CELL)NEXTOP(NEXTOP(NEXTOP(code,lds),lds),l)); + cl = (StaticClause *)Yap_AllocCodeSpace((CELL)NEXTOP(NEXTOP(NEXTOP(code,apFs),apFs),l)); #endif if (cl == NULL) { @@ -770,13 +770,13 @@ Yap_InitCPredBack(char *Name, unsigned long int Arity, cl->ClFlags = StaticMask; cl->ClNext = NULL; #ifdef CUT_C - Yap_ClauseSpace += (CELL)NEXTOP(NEXTOP(NEXTOP(NEXTOP(code,lds),lds),lds),l); + Yap_ClauseSpace += (CELL)NEXTOP(NEXTOP(NEXTOP(NEXTOP(code,apFs),apFs),apFs),l); cl->ClSize = - (CELL)NEXTOP(NEXTOP(NEXTOP(NEXTOP(code,lds),lds),lds),e); + (CELL)NEXTOP(NEXTOP(NEXTOP(NEXTOP(code,apFs),apFs),apFs),e); #else - Yap_ClauseSpace += (CELL)NEXTOP(NEXTOP(NEXTOP(code,lds),lds),l); + Yap_ClauseSpace += (CELL)NEXTOP(NEXTOP(NEXTOP(code,apFs),apFs),l); cl->ClSize = - (CELL)NEXTOP(NEXTOP(NEXTOP(code,lds),lds),e); + (CELL)NEXTOP(NEXTOP(NEXTOP(code,apFs),apFs),e); #endif cl->usc.ClPred = pe; @@ -787,38 +787,38 @@ Yap_InitCPredBack(char *Name, unsigned long int Arity, pe->OpcodeOfPred = code->opc = Yap_opcode(_try_userc); else pe->OpcodeOfPred = code->opc = Yap_opcode(_try_c); - code->u.lds.f = Start; - code->u.lds.p = pe; - code->u.lds.s = Arity; - code->u.lds.extra = Extra; + code->u.apFs.f = Start; + code->u.apFs.p = pe; + code->u.apFs.s = Arity; + code->u.apFs.extra = Extra; #ifdef YAPOR INIT_YAMOP_LTT(code, 2); PUT_YAMOP_SEQ(code); #endif /* YAPOR */ - code = NEXTOP(code,lds); + code = NEXTOP(code,apFs); if (flags & UserCPredFlag) code->opc = Yap_opcode(_retry_userc); else code->opc = Yap_opcode(_retry_c); - code->u.lds.f = Cont; - code->u.lds.p = pe; - code->u.lds.s = Arity; - code->u.lds.extra = Extra; + code->u.apFs.f = Cont; + code->u.apFs.p = pe; + code->u.apFs.s = Arity; + code->u.apFs.extra = Extra; #ifdef YAPOR INIT_YAMOP_LTT(code, 1); PUT_YAMOP_SEQ(code); #endif /* YAPOR */ - code = NEXTOP(code,lds); + code = NEXTOP(code,apFs); #ifdef CUT_C if (flags & UserCPredFlag) code->opc = Yap_opcode(_cut_userc); else code->opc = Yap_opcode(_cut_c); - code->u.lds.f = Cut; - code->u.lds.p = pe; - code->u.lds.s = Arity; - code->u.lds.extra = Extra; - code = NEXTOP(code,lds); + code->u.apFs.f = Cut; + code->u.apFs.p = pe; + code->u.apFs.s = Arity; + code->u.apFs.extra = Extra; + code = NEXTOP(code,apFs); #endif /* CUT_C */ code->opc = Yap_opcode(_Ystop); code->u.l.l = cl->ClCode; @@ -958,8 +958,8 @@ InitCodes(void) Yap_heap_regs->nocode.opc = Yap_opcode(_Nstop); Yap_heap_regs->rtrycode.opc = Yap_opcode(_retry_and_mark); - Yap_heap_regs->rtrycode.u.ld.s = 0; - Yap_heap_regs->rtrycode.u.ld.d = NIL; + Yap_heap_regs->rtrycode.u.apl.s = 0; + Yap_heap_regs->rtrycode.u.apl.d = NIL; #ifdef YAPOR INIT_YAMOP_LTT(&(Yap_heap_regs->rtrycode), 1); #endif /* YAPOR */ @@ -1309,8 +1309,8 @@ InitCodes(void) modp->PredFlags |= MetaPredFlag; } #ifdef YAPOR - Yap_heap_regs->getwork_code.u.ld.p = RepPredProp(PredPropByAtom(Yap_FullLookupAtom("$getwork"), PROLOG_MODULE)); - Yap_heap_regs->getwork_seq_code.u.ld.p = RepPredProp(PredPropByAtom(Yap_FullLookupAtom("$getwork_seq"), PROLOG_MODULE)); + Yap_heap_regs->getwork_code.u.apl.p = RepPredProp(PredPropByAtom(Yap_FullLookupAtom("$getwork"), PROLOG_MODULE)); + Yap_heap_regs->getwork_seq_code.u.apl.p = RepPredProp(PredPropByAtom(Yap_FullLookupAtom("$getwork_seq"), PROLOG_MODULE)); #endif /* YAPOR */ Yap_heap_regs->db_erased_marker = (DBRef)Yap_AllocCodeSpace(sizeof(DBStruct)); diff --git a/H/YapOpcodes.h b/H/YapOpcodes.h index 2268a4be6..76d08cd8a 100644 --- a/H/YapOpcodes.h +++ b/H/YapOpcodes.h @@ -1,503 +1,380 @@ -/************************************************************************* -* * -* YAP Prolog * -* * -* Yap Prolog was developed at NCCUP - Universidade do Porto * -* * -* Copyright L.Damas, V.S.Costa and Universidade do Porto 1985-1997 * -* * -************************************************************************** -* * -* File: YapOpcodes.h * -* comments: Central Table with all YAP opcodes * -* * -* Last rev: $Date: 2008-07-24 16:02:01 $ * -* $Log: not supported by cvs2svn $ -* Revision 1.45 2008/07/16 10:58:59 vsc -* small fixes -* -* Revision 1.44 2008/03/25 22:03:13 vsc -* fix some icc warnings -* -* Revision 1.43 2007/11/26 23:43:09 vsc -* fixes to support threads and assert correctly, even if inefficiently. -* -* Revision 1.42 2007/11/07 09:25:27 vsc -* speedup meta-calls -* -* Revision 1.41 2007/11/06 17:02:12 vsc -* compile ground terms away. -* -* Revision 1.40 2006/10/10 14:08:17 vsc -* small fixes on threaded implementation. -* -* Revision 1.39 2006/09/20 20:03:51 vsc -* improve indexing on floats -* fix sending large lists to DB -* -* Revision 1.38 2006/04/27 14:13:24 rslopes -* *** empty log message *** -* -* Revision 1.37 2006/03/24 16:34:21 rslopes -* New update to BEAM engine. -* BEAM now uses YAP Indexing (JITI) -* -* Revision 1.36 2005/12/17 03:25:39 vsc -* major changes to support online event-based profiling -* improve error discovery and restart on scanner. -* -* Revision 1.35 2005/11/18 18:50:34 tiagosoares -* support for executing c code when a cut occurs -* -* Revision 1.34 2005/09/08 21:55:48 rslopes -* BEAM for YAP update... -* -* Revision 1.33 2005/08/01 15:40:38 ricroc -* TABLING NEW: better support for incomplete tabling -* -* Revision 1.32 2005/07/06 19:34:11 ricroc -* TABLING: answers for completed calls can now be obtained by loading (new option) or executing (default) them from the trie data structure. -* -* Revision 1.31 2005/07/06 15:10:15 vsc -* improvements to compiler: merged instructions and fixes for -> -* -* Revision 1.30 2005/06/04 07:26:43 ricroc -* long int support for tabling -* -* Revision 1.29 2005/06/03 08:18:25 ricroc -* float support for tabling -* -* Revision 1.28 2005/06/01 20:25:23 vsc -* == and \= should not need a choice-point in -> -* -* Revision 1.27 2005/06/01 14:02:52 vsc -* get_rid of try_me?, retry_me? and trust_me? instructions: they are not -* significantly used nowadays. -* -* Revision 1.26 2005/04/10 04:01:13 vsc -* bug fixes, I hope! -* -* Revision 1.25 2004/10/26 20:16:04 vsc -* More bug fixes for overflow handling -* -* Revision 1.24 2004/09/27 20:45:04 vsc -* Mega clauses -* Fixes to sizeof(expand_clauses) which was being overestimated -* Fixes to profiling+indexing -* Fixes to reallocation of memory after restoring -* Make sure all clauses, even for C, end in _Ystop -* Don't reuse space for Streams -* Fix Stream_F on StreaNo+1 -* -* Revision 1.23 2004/03/31 01:03:10 vsc -* support expand group of clauses -* -* Revision 1.22 2004/03/19 11:35:42 vsc -* trim_trail for default machine -* be more aggressive about try-retry-trust chains. -* - handle cases where block starts with a wait -* - don't use _killed instructions, just let the thing rot by itself. -* -* Revision 1.21 2004/03/10 14:59:55 vsc -* optimise -> for type tests -* * -* * -*************************************************************************/ - OPCODE(Ystop ,l), - OPCODE(Nstop ,e), - OPCODE(execute ,pp), - OPCODE(call ,sla), - OPCODE(procceed ,p), - OPCODE(allocate ,e), - OPCODE(deallocate ,e), - OPCODE(op_fail ,e), + + /* This file was generated automatically by "yap -L misc/buildops" + please do not update */ + + OPCODE(Ystop ,l), + OPCODE(Nstop ,e), + OPCODE(try_me ,apl), + OPCODE(retry_me ,apl), + OPCODE(trust_me ,apl), + OPCODE(enter_profiling ,p), + OPCODE(enter_a_profiling ,e), + OPCODE(retry_profiled ,p), + OPCODE(profiled_retry_me ,apl), + OPCODE(profiled_trust_me ,apl), + OPCODE(profiled_retry_logical ,aLl), + OPCODE(profiled_trust_logical ,ILl), + OPCODE(count_call ,p), + OPCODE(count_a_call ,e), + OPCODE(count_retry ,p), + OPCODE(count_retry_me ,apl), + OPCODE(count_trust_me ,apl), + OPCODE(count_retry_logical ,aLl), + OPCODE(count_trust_logical ,ILl), + OPCODE(lock_lu ,e), + OPCODE(unlock_lu ,e), + OPCODE(alloc_for_logical_pred ,L), + OPCODE(copy_idb_term ,e), + OPCODE(unify_idb_term ,e), + OPCODE(spy_or_trymark ,apl), + OPCODE(try_and_mark ,apl), + OPCODE(count_retry_and_mark ,apl), + OPCODE(profiled_retry_and_mark ,apl), + OPCODE(retry_and_mark ,apl), + OPCODE(trust_fail ,e), + OPCODE(op_fail ,e), + OPCODE(cut ,e), + OPCODE(cut_t ,e), + OPCODE(cut_e ,e), + OPCODE(save_b_x ,x), + OPCODE(save_b_y ,y), + OPCODE(commit_b_x ,x), + OPCODE(commit_b_y ,y), + OPCODE(execute ,pp), + OPCODE(dexecute ,pp), + OPCODE(fcall ,sbpp), + OPCODE(call ,sbpp), + OPCODE(procceed ,p), + OPCODE(allocate ,e), + OPCODE(deallocate ,e), +#ifdef BEAM + OPCODE(retry_eam ,e), +#endif +#ifdef BEAM + OPCODE(run_eam ,os), +#endif + OPCODE(get_x_var ,xx), + OPCODE(get_y_var ,yx), + OPCODE(get_x_val ,xx), + OPCODE(get_y_val ,yx), + OPCODE(get_atom ,xc), + OPCODE(get_2atoms ,cc), + OPCODE(get_3atoms ,ccc), + OPCODE(get_4atoms ,cccc), + OPCODE(get_5atoms ,ccccc), + OPCODE(get_6atoms ,cccccc), + OPCODE(get_list ,x), + OPCODE(get_struct ,xfa), + OPCODE(get_float ,xd), + OPCODE(get_longint ,xi), + OPCODE(get_bigint ,xc), + OPCODE(get_dbterm ,xc), + OPCODE(glist_valx ,xx), + OPCODE(glist_valy ,xy), + OPCODE(gl_void_varx ,xx), + OPCODE(gl_void_vary ,xy), + OPCODE(gl_void_valx ,xx), + OPCODE(gl_void_valy ,xy), + OPCODE(unify_x_var ,ox), + OPCODE(unify_x_var_write ,ox), + OPCODE(unify_l_x_var ,ox), + OPCODE(unify_l_x_var_write ,ox), + OPCODE(unify_x_var2 ,oxx), + OPCODE(unify_x_var2_write ,oxx), + OPCODE(unify_l_x_var2 ,oxx), + OPCODE(unify_l_x_var2_write ,oxx), + OPCODE(unify_y_var ,oy), + OPCODE(unify_y_var_write ,oy), + OPCODE(unify_l_y_var ,oy), + OPCODE(unify_l_y_var_write ,oy), + OPCODE(unify_x_val ,ox), + OPCODE(unify_x_val_write ,ox), + OPCODE(unify_l_x_val ,ox), + OPCODE(unify_l_x_val_write ,ox), + OPCODE(unify_y_val ,oy), + OPCODE(unify_y_val_write ,oy), + OPCODE(unify_l_y_val ,oy), + OPCODE(unify_l_y_val_write ,oy), + OPCODE(unify_x_loc ,ox), + OPCODE(unify_x_loc_write ,ox), + OPCODE(unify_l_x_loc ,ox), + OPCODE(unify_l_x_loc_write ,ox), + OPCODE(unify_y_loc ,oy), + OPCODE(unify_y_loc_write ,oy), + OPCODE(unify_l_y_loc ,oy), + OPCODE(unify_l_y_loc_write ,oy), + OPCODE(unify_void ,o), + OPCODE(unify_void_write ,o), + OPCODE(unify_l_void ,o), + OPCODE(unify_l_void_write ,o), + OPCODE(unify_n_voids ,os), + OPCODE(unify_n_voids_write ,os), + OPCODE(unify_l_n_voids ,os), + OPCODE(unify_l_n_voids_write ,os), + OPCODE(unify_atom ,oc), + OPCODE(unify_atom_write ,oc), + OPCODE(unify_l_atom ,oc), + OPCODE(unify_l_atom_write ,oc), + OPCODE(unify_n_atoms ,osc), + OPCODE(unify_n_atoms_write ,osc), + OPCODE(unify_float ,od), + OPCODE(unify_float_write ,od), + OPCODE(unify_l_float ,od), + OPCODE(unify_l_float_write ,od), + OPCODE(unify_longint ,oi), + OPCODE(unify_longint_write ,oi), + OPCODE(unify_l_longint ,oi), + OPCODE(unify_l_longint_write ,oi), + OPCODE(unify_bigint ,oc), + OPCODE(unify_l_bigint ,oc), + OPCODE(unify_dbterm ,oc), + OPCODE(unify_l_dbterm ,oc), + OPCODE(unify_list ,o), + OPCODE(unify_list_write ,o), + OPCODE(unify_l_list ,o), + OPCODE(unify_l_list_write ,o), + OPCODE(unify_struct ,ofa), + OPCODE(unify_struct_write ,ofa), + OPCODE(unify_l_struc ,ofa), + OPCODE(unify_l_struc_write ,ofa), + OPCODE(put_x_var ,xx), + OPCODE(put_y_var ,yx), + OPCODE(put_x_val ,xx), + OPCODE(put_xx_val ,xxxx), + OPCODE(put_y_val ,yx), + OPCODE(put_unsafe ,yx), + OPCODE(put_atom ,xc), + OPCODE(put_float ,xd), + OPCODE(put_longint ,xi), + OPCODE(put_list ,x), + OPCODE(put_struct ,xfa), + OPCODE(write_x_var ,x), + OPCODE(write_void ,e), + OPCODE(write_n_voids ,s), + OPCODE(write_y_var ,y), + OPCODE(write_x_val ,x), + OPCODE(write_x_loc ,x), + OPCODE(write_y_val ,y), + OPCODE(write_y_loc ,y), + OPCODE(write_atom ,c), + OPCODE(write_float ,d), + OPCODE(write_longint ,i), + OPCODE(write_n_atoms ,sc), + OPCODE(write_list ,e), + OPCODE(write_l_list ,e), + OPCODE(write_struct ,fa), + OPCODE(write_l_struc ,fa), + OPCODE(save_pair_x ,ox), + OPCODE(save_pair_x_write ,ox), + OPCODE(save_pair_y ,oy), + OPCODE(save_pair_y_write ,oy), + OPCODE(save_appl_x ,ox), + 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 ,sblp), + OPCODE(or_else ,sblp), + OPCODE(pop_n ,s), + OPCODE(pop ,e), + OPCODE(call_cpred ,sbpp), + OPCODE(call_usercpred ,sbpp), + OPCODE(call_c_wfail ,sdlp), + OPCODE(try_c ,apFs), + OPCODE(retry_c ,apFs), +#ifdef CUT_C + OPCODE(cut_c ,apFs), +#endif + OPCODE(try_userc ,apFs), + OPCODE(retry_userc ,apFs), +#ifdef CUT_C + OPCODE(cut_userc ,apFs), +#endif + OPCODE(lock_pred ,e), + OPCODE(index_pred ,e), +#ifdef THREADS + OPCODE(thread_local ,e), +#endif + OPCODE(expand_index ,e), + OPCODE(expand_clauses ,sssllp), + OPCODE(undef_p ,e), + OPCODE(spy_pred ,e), + OPCODE(try_clause ,apl), + OPCODE(try_clause2 ,l), + OPCODE(try_clause3 ,l), + OPCODE(try_clause4 ,l), + OPCODE(retry ,apl), + OPCODE(retry2 ,l), + OPCODE(retry3 ,l), + OPCODE(retry4 ,l), + OPCODE(trust ,apl), + OPCODE(try_in ,l), + OPCODE(enter_lu_pred ,Ills), + OPCODE(try_logical ,aLl), + OPCODE(retry_logical ,aLl), + OPCODE(trust_logical ,ILl), + OPCODE(switch_on_type ,llll), + OPCODE(switch_list_nl ,ollll), + OPCODE(switch_on_arg_type ,xllll), + OPCODE(switch_on_sub_arg_type ,sllll), + OPCODE(jump_if_var ,l), + OPCODE(jump_if_nonvar ,xll), + OPCODE(if_not_then ,clll), + OPCODE(switch_on_func ,sssl), + OPCODE(switch_on_cons ,sssl), + OPCODE(go_on_func ,sssl), + OPCODE(go_on_cons ,sssl), + OPCODE(if_func ,sssl), + OPCODE(if_cons ,sssl), + OPCODE(index_dbref ,e), + OPCODE(index_blob ,e), + OPCODE(p_atom_x ,xl), + OPCODE(p_atom_y ,yl), + OPCODE(p_atomic_x ,xl), + OPCODE(p_atomic_y ,yl), + OPCODE(p_integer_x ,xl), + OPCODE(p_integer_y ,yl), + OPCODE(p_nonvar_x ,xl), + OPCODE(p_nonvar_y ,yl), + OPCODE(p_number_x ,xl), + OPCODE(p_number_y ,xl), + OPCODE(p_var_x ,xl), + OPCODE(p_var_y ,yl), + OPCODE(p_db_ref_x ,xl), + OPCODE(p_db_ref_y ,yl), + OPCODE(p_primitive_x ,xl), + OPCODE(p_primitive_y ,yl), + OPCODE(p_compound_x ,xl), + OPCODE(p_compound_y ,yl), + OPCODE(p_float_x ,xl), + OPCODE(p_float_y ,yl), + OPCODE(p_cut_by_x ,xl), + OPCODE(p_cut_by_y ,yl), + OPCODE(p_plus_vv ,xxx), + OPCODE(p_plus_vc ,xxc), + OPCODE(p_plus_y_vv ,yxx), + OPCODE(p_plus_y_vc ,yxc), + OPCODE(p_minus_vv ,xxx), + OPCODE(p_minus_cv ,xxc), + OPCODE(p_minus_y_vv ,yxx), + OPCODE(p_minus_y_cv ,yxc), + OPCODE(p_times_vv ,xxx), + OPCODE(p_times_vc ,xxc), + OPCODE(p_times_y_vv ,yxx), + OPCODE(p_times_y_vc ,yxc), + OPCODE(p_div_vv ,xxx), + OPCODE(p_div_vc ,xxc), + OPCODE(p_div_cv ,xxc), + OPCODE(p_div_y_vv ,yxx), + OPCODE(p_div_y_vc ,yxc), + OPCODE(p_div_y_cv ,yxc), + OPCODE(p_and_vv ,xxx), + OPCODE(p_and_vc ,xxc), + OPCODE(p_and_y_vv ,yxx), + OPCODE(p_and_y_vc ,yxc), + OPCODE(p_or_vv ,xxx), + OPCODE(p_or_vc ,xxc), + OPCODE(p_or_y_vv ,yxx), + OPCODE(p_or_y_vc ,yxc), + OPCODE(p_sll_vv ,xxx), + OPCODE(p_sll_vc ,xxc), + OPCODE(p_sll_cv ,xxc), + OPCODE(p_sll_y_vv ,yxx), + OPCODE(p_sll_y_vc ,yxc), + OPCODE(p_sll_y_cv ,yxc), + OPCODE(p_slr_vv ,xxx), + OPCODE(p_slr_vc ,xxc), + OPCODE(p_slr_cv ,xxc), + OPCODE(p_slr_y_vv ,yxx), + OPCODE(p_slr_y_vc ,yxc), + OPCODE(p_slr_y_cv ,yxc), + OPCODE(call_bfunc_xx ,plxxs), + OPCODE(call_bfunc_yx ,plxys), + OPCODE(call_bfunc_xy ,plxys), + OPCODE(call_bfunc_yy ,plyys), + OPCODE(p_equal ,e), + OPCODE(p_dif ,l), + OPCODE(p_eq ,l), + OPCODE(p_arg_vv ,xxx), + OPCODE(p_arg_cv ,xxc), + OPCODE(p_arg_y_vv ,yxx), + OPCODE(p_arg_y_cv ,xxc), + OPCODE(p_func2s_vv ,xxx), + OPCODE(p_func2s_cv ,xxc), + OPCODE(p_func2s_vc ,xxc), + OPCODE(p_func2s_y_vv ,yxx), + OPCODE(p_func2s_y_cv ,yxc), + OPCODE(p_func2s_y_vc ,yxc), + OPCODE(p_func2f_xx ,xxx), + OPCODE(p_func2f_xy ,xxy), + OPCODE(p_func2f_yx ,yxx), + OPCODE(p_func2f_yy ,yyx), + OPCODE(p_functor ,e), + OPCODE(p_execute2 ,sbpp), + OPCODE(p_execute ,sbmp), + OPCODE(p_execute_tail ,sbpp), #ifdef YAPOR - OPCODE(getwork_first_time ,e), - OPCODE(getwork ,ld), - OPCODE(getwork_seq ,ld), - OPCODE(sync ,ld), -#endif /* YAPOR */ -#ifdef TABLING_INNER_CUTS - OPCODE(clause_with_cut ,e), -#endif /* TABLING_INNER_CUTS */ + OPCODE(getwork_first_time ,e), + OPCODE(getwork ,apl), + OPCODE(getwork_seq ,apl), + OPCODE(sync ,apl), +#endif #ifdef TABLING - OPCODE(table_load_answer ,ld), - OPCODE(table_try_answer ,ld), - OPCODE(table_try_single ,ld), - OPCODE(table_try_me ,ld), - OPCODE(table_try ,ld), - OPCODE(table_retry_me ,ld), - OPCODE(table_retry ,ld), - OPCODE(table_trust_me ,ld), - OPCODE(table_trust ,ld), - OPCODE(table_new_answer ,s), - OPCODE(table_answer_resolution ,ld), - OPCODE(table_completion ,ld), - - OPCODE(trie_do_null ,e), - OPCODE(trie_trust_null ,e), - OPCODE(trie_try_null ,e), - OPCODE(trie_retry_null ,e), - OPCODE(trie_do_var ,e), - OPCODE(trie_trust_var ,e), - OPCODE(trie_try_var ,e), - OPCODE(trie_retry_var ,e), - OPCODE(trie_do_val ,e), - OPCODE(trie_trust_val ,e), - OPCODE(trie_try_val ,e), - OPCODE(trie_retry_val ,e), - OPCODE(trie_do_atom ,e), - OPCODE(trie_trust_atom ,e), - OPCODE(trie_try_atom ,e), - OPCODE(trie_retry_atom ,e), - OPCODE(trie_do_list ,e), - OPCODE(trie_trust_list ,e), - OPCODE(trie_try_list ,e), - OPCODE(trie_retry_list ,e), - OPCODE(trie_do_struct ,e), - OPCODE(trie_trust_struct ,e), - OPCODE(trie_try_struct ,e), - OPCODE(trie_retry_struct ,e), - OPCODE(trie_do_extension ,e), - OPCODE(trie_trust_extension ,e), - OPCODE(trie_try_extension ,e), - OPCODE(trie_retry_extension ,e), - OPCODE(trie_do_float ,e), - OPCODE(trie_trust_float ,e), - OPCODE(trie_try_float ,e), - OPCODE(trie_retry_float ,e), - OPCODE(trie_do_long ,e), - OPCODE(trie_trust_long ,e), - OPCODE(trie_try_long ,e), - OPCODE(trie_retry_long ,e), -#endif /* TABLING */ - OPCODE(try_me ,ld), - OPCODE(retry_me ,ld), - OPCODE(trust_me ,ld), - OPCODE(try_and_mark ,ld), - OPCODE(retry_and_mark ,ld), - OPCODE(try_c ,lds), - OPCODE(retry_c ,lds), -#ifdef CUT_C - OPCODE(cut_c ,lds), -#endif - OPCODE(try_userc ,lds), - OPCODE(retry_userc ,lds), -#ifdef CUT_C - OPCODE(cut_userc ,lds), -#endif - OPCODE(cut ,e), - OPCODE(get_x_var ,xx), - OPCODE(get_y_var ,yx), - OPCODE(get_x_val ,xx), - OPCODE(get_y_val ,yx), - OPCODE(get_atom ,xc), - OPCODE(get_2atoms ,cc), /* peephole */ - OPCODE(get_3atoms ,ccc), /* peephole */ - OPCODE(get_4atoms ,cccc), /* peephole */ - OPCODE(get_5atoms ,ccccc), /* peephole */ - OPCODE(get_6atoms ,cccccc), /* peephole */ - OPCODE(get_float ,xd), - OPCODE(get_longint ,xi), - OPCODE(get_bigint ,xc), - OPCODE(get_dbterm ,xc), - OPCODE(get_list ,x), - OPCODE(get_struct ,xf), - OPCODE(unify_x_var ,ox), - OPCODE(unify_y_var ,oy), - OPCODE(unify_x_val ,ox), - OPCODE(unify_y_val ,oy), - OPCODE(unify_atom ,oc), - OPCODE(unify_float ,od), - OPCODE(unify_longint ,oi), - OPCODE(unify_bigint ,oc), - OPCODE(unify_dbterm ,oc), - OPCODE(unify_list ,o), - OPCODE(unify_struct ,of), - OPCODE(put_x_var ,xx), - OPCODE(put_y_var ,yx), - OPCODE(put_x_val ,xx), - OPCODE(put_y_val ,yx), - OPCODE(put_unsafe ,yx), - OPCODE(put_xx_val ,xxxx), /* peephole */ - OPCODE(put_atom ,xc), - OPCODE(put_float ,xd), - OPCODE(put_longint ,xi), - OPCODE(put_list ,x), - OPCODE(put_struct ,xf), - OPCODE(write_x_var ,x), - OPCODE(write_y_var ,y), - OPCODE(write_x_val ,x), - OPCODE(write_y_val ,y), - OPCODE(write_atom ,c), - OPCODE(write_float ,d), - OPCODE(write_longint ,i), - OPCODE(write_list ,e), - OPCODE(write_struct ,f), - OPCODE(pop ,e), - OPCODE(pop_n ,s), - OPCODE(jump ,l), - OPCODE(move_back ,l), - OPCODE(skip ,l), - OPCODE(either ,sla), - OPCODE(or_else ,sla), + OPCODE(clause_with_cut ,e), + OPCODE(table_load_answer ,apl), + OPCODE(table_try_answer ,apl), + OPCODE(table_try_single ,apl), + OPCODE(table_try_me ,apl), + OPCODE(table_try ,apl), + OPCODE(table_retry_me ,apl), + OPCODE(table_retry ,apl), + OPCODE(table_trust_me ,apl), + OPCODE(table_trust ,apl), + OPCODE(table_new_answer ,s), + OPCODE(table_answer_resolution ,apl), + OPCODE(table_completion ,apl), + OPCODE(trie_do_null ,e), + OPCODE(trie_try_null ,e), + OPCODE(trie_retry_null ,e), + OPCODE(trie_trust_null ,e), + OPCODE(trie_do_var ,e), + OPCODE(trie_try_var ,e), + OPCODE(trie_retry_var ,e), + OPCODE(trie_trust_var ,e), + OPCODE(trie_do_val ,e), + OPCODE(trie_try_val ,e), + OPCODE(trie_retry_val ,e), + OPCODE(trie_trust_val ,e), + OPCODE(trie_do_atom ,e), + OPCODE(trie_try_atom ,e), + OPCODE(trie_retry_atom ,e), + OPCODE(trie_trust_atom ,e), + OPCODE(trie_do_list ,e), + OPCODE(trie_try_list ,e), + OPCODE(trie_retry_list ,e), + OPCODE(trie_trust_list ,e), + OPCODE(trie_do_struct ,e), + OPCODE(trie_try_struct ,e), + OPCODE(trie_retry_struct ,e), + OPCODE(trie_trust_struct ,e), + OPCODE(trie_do_extension ,e), + OPCODE(trie_try_extension ,e), + OPCODE(trie_retry_extension ,e), + OPCODE(trie_trust_extension ,e), + OPCODE(trie_do_float ,e), + OPCODE(trie_try_float ,e), + OPCODE(trie_retry_float ,e), + OPCODE(trie_trust_float ,e), + OPCODE(trie_do_long ,e), + OPCODE(trie_try_long ,e), + OPCODE(trie_retry_long ,e), + OPCODE(trie_trust_long ,e), +#endif + /* this instruction is hardwired */ #ifdef YAPOR - OPCODE(or_last ,sla), + OPCODE(or_last ,sblp) #else - OPCODE(or_last ,p), -#endif /* YAPOR */ -#ifdef BEAM - OPCODE(retry_eam ,e), - OPCODE(run_eam ,os), + OPCODE(or_last ,p) #endif - OPCODE(call_cpred ,sla), - OPCODE(call_usercpred ,sla), - OPCODE(call_c_wfail ,sdl), - OPCODE(call_bfunc_xx ,llxx), - OPCODE(call_bfunc_xy ,llxy), - OPCODE(call_bfunc_yx ,llxy), - OPCODE(call_bfunc_yy ,llyy), - OPCODE(cut_t ,e), - OPCODE(cut_e ,sla), - OPCODE(try_clause ,ld), - OPCODE(try_clause2 ,l), - OPCODE(try_clause3 ,l), - OPCODE(try_clause4 ,l), - OPCODE(retry ,ld), - OPCODE(retry2 ,l), - OPCODE(retry3 ,l), - OPCODE(retry4 ,l), - OPCODE(trust ,ld), - OPCODE(try_in ,l), - OPCODE(enter_lu_pred ,Ill), - OPCODE(try_logical ,lld), - OPCODE(retry_logical ,lld), - OPCODE(trust_logical ,lld), - OPCODE(count_retry_logical ,lld), - OPCODE(count_trust_logical ,lld), - OPCODE(profiled_retry_logical ,lld), - OPCODE(profiled_trust_logical ,lld), - OPCODE(jump_if_var ,l), - OPCODE(jump_if_nonvar ,xll), - OPCODE(switch_on_cons ,sssl), - OPCODE(switch_on_type ,llll), - OPCODE(switch_list_nl ,ollll), - OPCODE(switch_on_arg_type ,xllll), - OPCODE(switch_on_sub_arg_type ,sllll), - OPCODE(go_on_cons ,sssl), - OPCODE(if_cons ,sssl), - OPCODE(switch_on_func ,sssl), - OPCODE(go_on_func ,sssl), - OPCODE(if_func ,sssl), - OPCODE(if_not_then ,clll), - OPCODE(index_dbref ,e), - OPCODE(index_blob ,e), - OPCODE(trust_fail ,e), - OPCODE(index_pred ,e), - OPCODE(lock_pred ,e), - OPCODE(expand_index ,e), - OPCODE(expand_clauses ,sp), - OPCODE(save_b_x ,x), - OPCODE(save_b_y ,y), - OPCODE(commit_b_x ,x), - OPCODE(commit_b_y ,y), - OPCODE(undef_p ,e), - OPCODE(spy_pred ,e), - OPCODE(spy_or_trymark ,ld), - OPCODE(unify_void ,o), - OPCODE(write_void ,e), - OPCODE(save_pair_x ,ox), - OPCODE(save_pair_y ,oy), - OPCODE(save_appl_x ,ox), - OPCODE(save_appl_y ,oy), - OPCODE(unify_n_atoms ,osc), - OPCODE(write_n_atoms ,sc), - OPCODE(unify_n_voids ,os), - OPCODE(write_n_voids ,s), - OPCODE(glist_valx ,xx), /* peephole */ - OPCODE(glist_valy ,xy), /* peephole */ - OPCODE(fcall ,sla), - OPCODE(dexecute ,pp), - OPCODE(gl_void_varx ,xx), /* peephole */ - OPCODE(gl_void_vary ,xy), /* peephole */ - OPCODE(gl_void_valx ,xx), /* peephole */ - OPCODE(gl_void_valy ,xy), /* peephole */ - OPCODE(unify_x_loc ,ox), - OPCODE(unify_y_loc ,oy), - OPCODE(write_x_loc ,ox), - OPCODE(write_y_loc ,oy), - OPCODE(unify_x_var2 ,oxx), - OPCODE(unify_l_struc ,of), - OPCODE(unify_l_list ,o), - OPCODE(write_l_struc ,f), - OPCODE(write_l_list ,e), - OPCODE(unify_l_x_var ,ox), - OPCODE(unify_l_y_var ,oy), - OPCODE(unify_l_x_val ,ox), - OPCODE(unify_l_y_val ,oy), - OPCODE(unify_l_atom ,oc), - OPCODE(unify_l_float ,od), - OPCODE(unify_l_longint ,oi), - OPCODE(unify_l_bigint ,oc), - OPCODE(unify_l_dbterm ,oc), - OPCODE(unify_l_void ,o), - OPCODE(unify_l_n_voids ,os), - OPCODE(unify_l_x_loc ,ox), - OPCODE(unify_l_y_loc ,oy), - OPCODE(unify_l_x_var2 ,oxx), - OPCODE(unify_x_var_write ,ox), - OPCODE(unify_y_var_write ,oy), - OPCODE(unify_x_val_write ,ox), - OPCODE(unify_y_val_write ,oy), - OPCODE(unify_atom_write ,oc), - OPCODE(unify_float_write ,od), - OPCODE(unify_longint_write ,oi), - OPCODE(unify_n_atoms_write ,osc), - OPCODE(unify_list_write ,o), - OPCODE(unify_x_var2_write ,oxx), - OPCODE(unify_struct_write ,of), - OPCODE(unify_void_write ,o), - OPCODE(unify_n_voids_write ,os), - OPCODE(unify_x_loc_write ,ox), - OPCODE(unify_y_loc_write ,oy), - OPCODE(unify_l_x_var_write ,ox), - OPCODE(unify_l_y_var_write ,oy), - OPCODE(unify_l_x_val_write ,ox), - OPCODE(unify_l_y_val_write ,oy), - OPCODE(unify_l_atom_write ,oc), - OPCODE(unify_l_float_write ,od), - OPCODE(unify_l_longint_write ,oi), - OPCODE(unify_l_void_write ,o), - OPCODE(unify_l_n_voids_write ,os), - OPCODE(unify_l_x_loc_write ,ox), - OPCODE(unify_l_y_loc_write ,oy), - OPCODE(unify_l_x_var2_write ,oxx), - OPCODE(unify_l_list_write ,o), - OPCODE(unify_l_struc_write ,of), - OPCODE(save_pair_x_write ,ox), - OPCODE(save_pair_y_write ,oy), - OPCODE(save_appl_x_write ,ox), - OPCODE(save_appl_y_write ,oy), - OPCODE(enter_profiling ,l), - OPCODE(enter_a_profiling ,e), - OPCODE(retry_profiled ,l), - OPCODE(profiled_retry_me ,ld), - OPCODE(profiled_trust_me ,ld), - OPCODE(profiled_retry_and_mark ,ld), - OPCODE(count_call ,l), - OPCODE(count_a_call ,e), - OPCODE(count_retry ,l), - OPCODE(count_retry_me ,ld), - OPCODE(count_trust_me ,ld), - OPCODE(count_retry_and_mark ,ld), - OPCODE(lock_lu ,p), - OPCODE(unlock_lu ,e), - OPCODE(alloc_for_logical_pred ,EC), - OPCODE(unify_idb_term ,e), - OPCODE(copy_idb_term ,e), -#if defined(THREADS) - OPCODE(thread_local ,e), -#endif -#ifdef SFUNC - OPCODE(get_s_f ,), - OPCODE(put_s_f ,), - OPCODE(unify_s_f ,), - OPCODE(write_s_f ,), - OPCODE(unify_s_xvar ,), - OPCODE(unify_s_yvar ,), - OPCODE(write_s_xvar ,), - OPCODE(write_s_yvar ,), - OPCODE(unify_s_xval ,), - OPCODE(unify_s_yval ,), - OPCODE(write_s_xval ,), - OPCODE(write_s_yval ,), - OPCODE(unify_s_a ,), - OPCODE(write_s_a ,), - OPCODE(get_s_end ,), - OPCODE(put_s_end ,), - OPCODE(unify_s_end ,), - OPCODE(write_s_end ,), -#endif /* SFUNC */ - OPCODE(p_atom_x ,xF), - OPCODE(p_atom_y ,yF), - OPCODE(p_atomic_x ,xF), - OPCODE(p_atomic_y ,yF), - OPCODE(p_integer_x ,xF), - OPCODE(p_integer_y ,yF), - OPCODE(p_nonvar_x ,xF), - OPCODE(p_nonvar_y ,yF), - OPCODE(p_number_x ,xF), - OPCODE(p_number_y ,yF), - OPCODE(p_var_x ,xF), - OPCODE(p_var_y ,yF), - OPCODE(p_compound_x ,xF), - OPCODE(p_compound_y ,yF), - OPCODE(p_float_x ,xF), - OPCODE(p_float_y ,yF), - OPCODE(p_db_ref_x ,xF), - OPCODE(p_db_ref_y ,yF), - OPCODE(p_cut_by_x ,xF), - OPCODE(p_cut_by_y ,yF), - OPCODE(p_primitive_x ,xF), - OPCODE(p_primitive_y ,yF), - OPCODE(p_equal ,e), - OPCODE(p_dif ,l), - OPCODE(p_eq ,l), - OPCODE(p_functor ,e), - OPCODE(p_plus_vv ,xxx), - OPCODE(p_plus_vc ,xxc), - OPCODE(p_plus_y_vv ,yxx), - OPCODE(p_plus_y_vc ,yxc), - OPCODE(p_minus_vv ,xxx), - OPCODE(p_minus_cv ,xcx), - OPCODE(p_minus_y_vv ,yxx), - OPCODE(p_minus_y_cv ,ycx), - OPCODE(p_times_vv ,xxx), - OPCODE(p_times_vc ,xxc), - OPCODE(p_times_y_vv ,yxx), - OPCODE(p_times_y_vc ,yxc), - OPCODE(p_div_vv ,xxx), - OPCODE(p_div_cv ,xcx), - OPCODE(p_div_vc ,xxc), - OPCODE(p_div_y_vv ,yxx), - OPCODE(p_div_y_cv ,ycx), - OPCODE(p_div_y_vc ,yxc), - OPCODE(p_and_vv ,xxx), - OPCODE(p_and_vc ,xxc), - OPCODE(p_and_y_vv ,yxx), - OPCODE(p_and_y_vc ,yxc), - OPCODE(p_or_vv ,xxx), - OPCODE(p_or_vc ,xxc), - OPCODE(p_or_y_vv ,yxx), - OPCODE(p_or_y_vc ,yxc), - OPCODE(p_sll_vv ,xxx), - OPCODE(p_sll_cv ,xcx), - OPCODE(p_sll_vc ,xxc), - OPCODE(p_sll_y_vv ,yxx), - OPCODE(p_sll_y_cv ,ycx), - OPCODE(p_sll_y_vc ,yxc), - OPCODE(p_slr_vv ,xcx), - OPCODE(p_slr_vc ,xxc), - OPCODE(p_slr_cv ,xcx), - OPCODE(p_slr_y_vv ,yxx), - OPCODE(p_slr_y_vc ,yxc), - OPCODE(p_slr_y_cv ,ycx), - OPCODE(p_arg_vv ,xxx), - OPCODE(p_arg_cv ,xxc), - OPCODE(p_arg_y_vv ,yxx), - OPCODE(p_arg_y_cv ,yxc), - OPCODE(p_func2s_vv ,xxx), - OPCODE(p_func2s_cv ,xcx), - OPCODE(p_func2s_vc ,xxc), - OPCODE(p_func2s_y_vv ,xxx), - OPCODE(p_func2s_y_cv ,xcx), - OPCODE(p_func2s_y_vc ,xxc), - OPCODE(p_func2f_xx ,xxx), - OPCODE(p_func2f_xy ,xyx), - OPCODE(p_func2f_yx ,yxx), - OPCODE(p_func2f_yy ,yyx), - OPCODE(p_execute ,sla), - OPCODE(p_execute2 ,sla), - OPCODE(p_execute_tail ,e) - - diff --git a/H/amidefs.h b/H/amidefs.h index 5f30f27b7..79b0d6628 100644 --- a/H/amidefs.h +++ b/H/amidefs.h @@ -105,7 +105,7 @@ typedef enum { #undef OPCODE } op_numbers; -#define _std_top _p_execute_tail +#define _std_top _or_last /* use similar trick for keeping instruction names */ #if defined(ANALYST) || defined(DEBUG) @@ -164,12 +164,20 @@ typedef enum { The meaning of the symbols in a abstract machine instruction is: c: constant, is a Term - d: double (functor + unaligned) + b: bitmap (CELL *) + d: double (functor + unaligned double) + f: functor + F: Function, CPredicate + i: large integer (functor + long) l: label, yamop * + L: logic upd clause, logic_upd_clause * + m: module, Term + o: opcode, OPCODE + s: small integer, COUNT + x: wam register, wamreg d: predicate definition - f: functor n: small number x: argument or temporary register y: environment slot @@ -232,38 +240,15 @@ typedef struct yami { CELL next; } d; struct { - Int ClTrail; - Int ClENV; - Int ClRefs; struct logic_upd_clause *ClBase; -#if defined(THREADS) || defined(YAPOR) - struct pred_entry *p; -#endif CELL next; - } EC; + } L; struct { Functor f; Int a; CELL next; - } f; + } fa; struct { - Functor f; - CODEADDR l1; - CODEADDR l2; - CELL next; - } fll; - struct { - wamreg x; - struct yami *f; - CELL next; - } fx; - struct { - yslot y; - struct yami *f; - CELL next; - } fy; - struct { - OPCODE opcw; CELL i[2]; CELL next; } i; @@ -272,11 +257,8 @@ typedef struct yami { struct yami *l1; struct yami *l2; COUNT s; -#if defined(YAPOR) || defined(THREADS) - struct pred_entry *p; -#endif CELL next; - } Ill; + } Ills; struct { struct yami *l; CELL next; @@ -288,11 +270,16 @@ typedef struct yami { #ifdef TABLING struct table_entry *te; /* pointer to table entry */ #endif /* TABLING */ - COUNT s; + Int s; struct pred_entry *p; struct yami *d; CELL next; - } ld; + } apl; + /* 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. + They must have the same fields. + */ struct { #ifdef YAPOR unsigned int or_arg; @@ -300,16 +287,25 @@ typedef struct yami { #ifdef TABLING struct table_entry *te; /* pointer to table entry */ #endif /* TABLING */ - union { - /* either number of arguments or */ - COUNT s; - /* timestamp it was entered */ - struct logic_upd_index *block; - } t; + /* number of arguments */ + COUNT s; struct logic_upd_clause *d; struct yami *n; CELL next; - } lld; + } aLl; + struct { +#ifdef YAPOR + unsigned int or_arg; +#endif /* YAPOR */ +#ifdef TABLING + struct table_entry *te; /* pointer to table entry */ +#endif /* TABLING */ + /* number of arguments */ + struct logic_upd_index *block; + struct logic_upd_clause *d; + struct yami *n; + CELL next; + } ILl; struct { #ifdef YAPOR unsigned int or_arg; @@ -317,30 +313,12 @@ typedef struct yami { #ifdef TABLING struct table_entry *te; /* pointer to table entry */ #endif /* TABLING */ - COUNT s; - struct pred_entry *p; - struct yami *d; - struct yami *bl; - CELL next; - } ldl; - struct { - CODEADDR l; - SMALLUNSGN flags; - CELL next; - } lf; - struct { -#ifdef YAPOR - unsigned int or_arg; -#endif /* YAPOR */ -#ifdef TABLING - struct table_entry *te; /* pointer to table entry */ -#endif /* TABLING */ - COUNT s; + Int s; struct pred_entry *p; CPredicate f; COUNT extra; CELL next; - } lds; + } apFs; struct { struct yami *l1; struct yami *l2; @@ -348,20 +326,6 @@ typedef struct yami { CELL next; } lll; struct { -#ifdef YAPOR - unsigned int or_arg; -#endif /* YAPOR */ -#ifdef TABLING - struct table_entry *te; /* pointer to table entry */ -#endif /* TABLING */ - COUNT s; - struct pred_entry *p; - struct yami *l1; - struct yami *l2; - struct yami *l3; - CELL next; - } slll; - struct { struct yami *l1; struct yami *l2; struct yami *l3; @@ -389,25 +353,25 @@ typedef struct yami { struct yami *f; wamreg x1; wamreg x2; - wamreg flags; + COUNT flags; CELL next; - } llxx; + } plxxs; struct { struct pred_entry *p; struct yami *f; wamreg x; yslot y; - wamreg flags; + COUNT flags; CELL next; - } llxy; + } plxys; struct { struct pred_entry *p; struct yami *f; wamreg y1; yslot y2; - wamreg flags; + COUNT flags; CELL next; - } llyy; + } plyys; struct { OPCODE pop; struct yami *l1; @@ -422,7 +386,7 @@ typedef struct yami { } o; struct { OPCODE opcw; - CELL c; + Term c; CELL next; } oc; struct { @@ -435,7 +399,7 @@ typedef struct yami { Functor f; Int a; CELL next; - } of; + } ofa; struct { OPCODE opcw; CELL i[2]; @@ -481,6 +445,7 @@ typedef struct yami { COUNT s; CELL next; } s; + /* format of expand_clauses */ struct { COUNT s1; COUNT s2; @@ -488,7 +453,7 @@ typedef struct yami { struct yami *sprev, *snext; struct pred_entry *p; CELL next; - } sp; + } sssllp; struct { COUNT s; CELL c; @@ -500,21 +465,39 @@ typedef struct yami { struct yami *l; struct pred_entry *p; CELL next; - } sdl; + } sdlp; + /* the next 3 instructions must have same size and have fields in same order! */ + /* also check env for yes and trustfail code before making any changes */ struct { #ifdef YAPOR unsigned int or_arg; #endif /* YAPOR */ COUNT s; CELL *bmap; - union { - struct yami *l; - struct pred_entry *p; - Term mod; - } sla_u; + struct yami *l; struct pred_entry *p0; CELL next; - } sla; /* also check env for yes and trustfail code before making any changes */ + } sblp; + struct { +#ifdef YAPOR + unsigned int or_arg; +#endif /* YAPOR */ + COUNT s; + CELL *bmap; + struct pred_entry *p; + struct pred_entry *p0; + CELL next; + } sbpp; + struct { +#ifdef YAPOR + unsigned int or_arg; +#endif /* YAPOR */ + COUNT s; + CELL *bmap; + Term mod; + struct pred_entry *p0; + CELL next; + } sbmp; struct { COUNT s; /* size of table */ COUNT e; /* live entries */ @@ -541,12 +524,12 @@ typedef struct yami { Functor f; Int a; CELL next; - } xf; + } xfa; struct { wamreg x; struct yami *F; CELL next; - } xF; + } xl; struct { wamreg x; CELL i[2]; @@ -578,10 +561,10 @@ typedef struct yami { } xxxx; struct { wamreg x; - Int c; wamreg xi; + COUNT c; CELL next; - } xcx, xxc; + } xxc; struct { wamreg x; yslot y; @@ -589,10 +572,10 @@ typedef struct yami { } xy; struct { wamreg x; - yslot y2; wamreg x1; + yslot y2; CELL next; - } xyx; + } xxy; struct { yslot y; CELL next; @@ -601,7 +584,7 @@ typedef struct yami { yslot y; struct yami *F; CELL next; - } yF; + } yl; struct { yslot y; wamreg x; @@ -626,11 +609,11 @@ typedef struct yami { CELL next; } yyy; struct { + wamreg xi; yslot y; Int c; - wamreg xi; CELL next; - } ycx, yxc; + } yxc; } u; } yamop; @@ -780,12 +763,12 @@ typedef struct choicept { #endif #define RealEnvSize (EnvSizeInCells*sizeof(CELL)) -#define ENV_Size(cp) (((yamop *)((CODEADDR)(cp) - (CELL)NEXTOP((yamop *)NULL,sla)))->u.sla.s) -#define ENV_ToP(cp) (((yamop *)((CODEADDR)(cp) - (CELL)NEXTOP((yamop *)NULL,sla)))->u.sla.sla_u.p) -#define ENV_ToOp(cp) (((yamop *)((CODEADDR)(cp) - (CELL)NEXTOP((yamop *)NULL,sla)))->opc) +#define ENV_Size(cp) (((yamop *)((CODEADDR)(cp) - (CELL)NEXTOP((yamop *)NULL,sbpp)))->u.sbpp.s) +#define ENV_ToP(cp) (((yamop *)((CODEADDR)(cp) - (CELL)NEXTOP((yamop *)NULL,sbpp)))->u.sla.p) +#define ENV_ToOp(cp) (((yamop *)((CODEADDR)(cp) - (CELL)NEXTOP((yamop *)NULL,sbpp)))->opc) #define EnvSize(cp) ((-ENV_Size(cp))/(OPREG)sizeof(CELL)) -#define EnvBMap(p) (((yamop *)((CODEADDR)(p) - (CELL)NEXTOP((yamop *)NULL,sla)))->u.sla.bmap) -#define EnvPreg(p) (((yamop *)((CODEADDR)(p) - (CELL)NEXTOP((yamop *)NULL,sla)))->u.sla.p0) +#define EnvBMap(p) (((yamop *)((CODEADDR)(p) - (CELL)NEXTOP((yamop *)NULL,sbpp)))->u.sbpp.bmap) +#define EnvPreg(p) (((yamop *)((CODEADDR)(p) - (CELL)NEXTOP((yamop *)NULL,sbpp)))->u.sbpp.p0) /* access to instructions */ diff --git a/H/clause.h b/H/clause.h index 15d1baecc..5c83699ec 100644 --- a/H/clause.h +++ b/H/clause.h @@ -33,7 +33,7 @@ typedef union CONSULT_OBJ { #define ASSEMBLING_INDEX 1 #define ASSEMBLING_EINDEX 2 -#define NextDynamicClause(X) (((yamop *)X)->u.ld.d) +#define NextDynamicClause(X) (((yamop *)X)->u.apl.d) #define PredFirstClause 0 #define PredMiddleClause 1 @@ -197,7 +197,7 @@ typedef struct dbterm_list { /* amasm.c */ wamreg STD_PROTO(Yap_emit_x,(CELL)); -wamreg STD_PROTO(Yap_compile_cmp_flags,(PredEntry *)); +COUNT STD_PROTO(Yap_compile_cmp_flags,(PredEntry *)); void STD_PROTO(Yap_InitComma,(void)); /* cdmgr.c */ diff --git a/H/rclause.h b/H/rclause.h index ab894eb21..76d1ac6a1 100644 --- a/H/rclause.h +++ b/H/rclause.h @@ -192,30 +192,30 @@ restore_opcodes(yamop *pc) case _table_answer_resolution: case _table_completion: #endif /* TABLING */ - pc->u.ld.p = PtoPredAdjust(pc->u.ld.p); - pc->u.ld.d = PtoOpAdjust(pc->u.ld.d); - pc = NEXTOP(pc,ld); + pc->u.apl.p = PtoPredAdjust(pc->u.apl.p); + pc->u.apl.d = PtoOpAdjust(pc->u.apl.d); + pc = NEXTOP(pc,apl); break; case _try_logical: case _retry_logical: case _count_retry_logical: case _profiled_retry_logical: - pc->u.lld.n = PtoOpAdjust(pc->u.lld.n); - pc->u.lld.d = PtoLUClauseAdjust(pc->u.lld.d); - pc = pc->u.lld.n; + pc->u.aLl.n = PtoOpAdjust(pc->u.aLl.n); + pc->u.aLl.d = PtoLUClauseAdjust(pc->u.aLl.d); + pc = pc->u.aLl.n; break; case _trust_logical: case _count_trust_logical: case _profiled_trust_logical: - pc->u.lld.n = PtoOpAdjust(pc->u.lld.n); - pc->u.lld.d = PtoLUClauseAdjust(pc->u.lld.d); - pc->u.lld.t.block = PtoLUIndexAdjust(pc->u.lld.t.block); + pc->u.ILl.n = PtoOpAdjust(pc->u.ILl.n); + pc->u.ILl.d = PtoLUClauseAdjust(pc->u.ILl.d); + pc->u.ILl.block = PtoLUIndexAdjust(pc->u.ILl.block); return; case _enter_lu_pred: - pc->u.Ill.I = (LogUpdIndex *)PtoOpAdjust((yamop *)(pc->u.Ill.I)); - pc->u.Ill.l1 = PtoOpAdjust(pc->u.Ill.l1); - pc->u.Ill.l2 = PtoOpAdjust(pc->u.Ill.l2); - pc = pc->u.Ill.l1; + pc->u.Ills.I = (LogUpdIndex *)PtoOpAdjust((yamop *)(pc->u.Ills.I)); + pc->u.Ills.l1 = PtoOpAdjust(pc->u.Ills.l1); + pc->u.Ills.l2 = PtoOpAdjust(pc->u.Ills.l2); + pc = pc->u.Ills.l1; break; /* instructions type p */ #if !defined(YAPOR) @@ -259,13 +259,10 @@ restore_opcodes(yamop *pc) pc->u.xll.x = XAdjust(pc->u.xll.x); pc = NEXTOP(pc,xll); break; - /* instructions type EC */ + /* instructions type L */ case _alloc_for_logical_pred: - pc->u.EC.ClBase = (struct logic_upd_clause *)PtoOpAdjust((yamop *)pc->u.EC.ClBase); -#if defined(THREADS) || defined(YAPOR) - pc->u.EC.p = PtoPredAdjust(pc->u.EC.p); -#endif - pc = NEXTOP(pc,EC); + pc->u.L.ClBase = (struct logic_upd_clause *)PtoOpAdjust((yamop *)pc->u.L.ClBase); + pc = NEXTOP(pc,L); break; /* instructions type e */ case _unify_idb_term: @@ -358,7 +355,7 @@ restore_opcodes(yamop *pc) pc->u.x.x = XAdjust(pc->u.x.x); pc = NEXTOP(pc,x); break; - /* instructions type xF */ + /* instructions type xl */ case _p_atom_x: case _p_atomic_x: case _p_integer_x: @@ -370,9 +367,9 @@ restore_opcodes(yamop *pc) case _p_compound_x: case _p_float_x: case _p_cut_by_x: - pc->u.xF.x = XAdjust(pc->u.xF.x); - pc->u.xF.F = PtoOpAdjust(pc->u.xF.F); - pc = NEXTOP(pc,xF); + pc->u.xl.x = XAdjust(pc->u.xl.x); + pc->u.xl.F = PtoOpAdjust(pc->u.xl.F); + pc = NEXTOP(pc,xl); break; case _expand_clauses: Yap_Error(SYSTEM_ERROR, TermNil, @@ -387,7 +384,7 @@ restore_opcodes(yamop *pc) pc->u.y.y = YAdjust(pc->u.y.y); pc = NEXTOP(pc,y); break; - /* instructions type yF */ + /* instructions type yl */ case _p_atom_y: case _p_atomic_y: case _p_integer_y: @@ -399,57 +396,61 @@ restore_opcodes(yamop *pc) case _p_compound_y: case _p_float_y: case _p_cut_by_y: - pc->u.yF.y = YAdjust(pc->u.yF.y); - pc->u.yF.F = PtoOpAdjust(pc->u.yF.F); - pc = NEXTOP(pc,yF); + pc->u.yl.y = YAdjust(pc->u.yl.y); + pc->u.yl.F = PtoOpAdjust(pc->u.yl.F); + pc = NEXTOP(pc,yl); break; - /* instructions type sla */ - case _p_execute_tail: + /* instructions type sbpp */ case _p_execute: + if (pc->u.sbmp.mod != 0) { + pc->u.sbmp.mod = AtomTermAdjust(pc->u.sbmp.mod); + } + pc->u.sbmp.p0 = PtoPredAdjust(pc->u.sbmp.p0); + if (pc->u.sbmp.bmap != NULL) { + pc->u.sbmp.bmap = CellPtoHeapAdjust(pc->u.sbmp.bmap); + } + pc = NEXTOP(pc,sbmp); + break; + case _p_execute_tail: case _p_execute2: - if (pc->u.sla.sla_u.mod != 0) { - if (IsAtomTerm(pc->u.sla.sla_u.mod)) - pc->u.sla.sla_u.mod = AtomTermAdjust(pc->u.sla.sla_u.mod); - else - pc->u.sla.sla_u.p = PtoPredAdjust(pc->u.sla.sla_u.p); + pc->u.sbpp.p = PtoPredAdjust(pc->u.sbpp.p); + pc->u.sbpp.p0 = PtoPredAdjust(pc->u.sbpp.p0); + if (pc->u.sbpp.bmap != NULL) { + pc->u.sbpp.bmap = CellPtoHeapAdjust(pc->u.sbpp.bmap); } - pc->u.sla.p0 = PtoPredAdjust(pc->u.sla.p0); - if (pc->u.sla.bmap != NULL) { - pc->u.sla.bmap = CellPtoHeapAdjust(pc->u.sla.bmap); - } - pc = NEXTOP(pc,sla); + pc = NEXTOP(pc,sbpp); break; case _fcall: case _call: #ifdef YAPOR case _or_last: #endif - pc->u.sla.sla_u.p = PtoPredAdjust(pc->u.sla.sla_u.p); - if (pc->u.sla.bmap != NULL) { - pc->u.sla.bmap = CellPtoHeapAdjust(pc->u.sla.bmap); + pc->u.sbpp.p = PtoPredAdjust(pc->u.sbpp.p); + if (pc->u.sbpp.bmap != NULL) { + pc->u.sbpp.bmap = CellPtoHeapAdjust(pc->u.sbpp.bmap); } - pc->u.sla.p0 = PtoPredAdjust(pc->u.sla.p0); - pc = NEXTOP(pc,sla); + pc->u.sbpp.p0 = PtoPredAdjust(pc->u.sbpp.p0); + pc = NEXTOP(pc,sbpp); break; - /* instructions type sla, but for disjunctions */ + /* instructions type sbpp, but for disjunctions */ case _either: case _or_else: - if (pc->u.sla.bmap != NULL) { - pc->u.sla.bmap = CellPtoHeapAdjust(pc->u.sla.bmap); + if (pc->u.sblp.bmap != NULL) { + pc->u.sblp.bmap = CellPtoHeapAdjust(pc->u.sblp.bmap); } - pc->u.sla.sla_u.l = PtoOpAdjust(pc->u.sla.sla_u.l); - pc->u.sla.p0 = PtoPredAdjust(pc->u.sla.p0); - pc = NEXTOP(pc,sla); + pc->u.sblp.l = PtoOpAdjust(pc->u.sblp.l); + pc->u.sblp.p0 = PtoPredAdjust(pc->u.sblp.p0); + pc = NEXTOP(pc,sblp); break; - /* instructions type sla, but for functions */ + /* instructions type sbpp, but for functions */ case _call_cpred: case _call_usercpred: - pc->u.sla.sla_u.p = PtoPredAdjust(pc->u.sla.sla_u.p); - pc->u.sla.p0 = PtoPredAdjust(pc->u.sla.p0); - if (pc->u.sla.bmap != NULL) { - pc->u.sla.bmap = CellPtoHeapAdjust(pc->u.sla.bmap); + pc->u.sbpp.p = PtoPredAdjust(pc->u.sbpp.p); + pc->u.sbpp.p0 = PtoPredAdjust(pc->u.sbpp.p0); + if (pc->u.sbpp.bmap != NULL) { + pc->u.sbpp.bmap = CellPtoHeapAdjust(pc->u.sbpp.bmap); } - pc = NEXTOP(pc,sla); + pc = NEXTOP(pc,sbpp); break; /* instructions type xx */ case _get_x_var: @@ -682,12 +683,12 @@ restore_opcodes(yamop *pc) } pc = NEXTOP(pc,cccccc); break; - /* instructions type xf */ + /* instructions type xfa */ case _get_struct: case _put_struct: - pc->u.xf.x = XAdjust(pc->u.xf.x); - pc->u.xf.f = FuncAdjust(pc->u.xf.f); - pc = NEXTOP(pc,xf); + pc->u.xfa.x = XAdjust(pc->u.xfa.x); + pc->u.xfa.f = FuncAdjust(pc->u.xfa.f); + pc = NEXTOP(pc,xfa); break; /* instructions type xy */ case _glist_valy: @@ -819,14 +820,14 @@ restore_opcodes(yamop *pc) } pc = NEXTOP(pc,osc); break; - /* instructions type of */ + /* instructions type ofa */ case _unify_struct_write: case _unify_struct: case _unify_l_struc_write: case _unify_l_struc: - pc->u.of.opcw = Yap_opcode(Yap_op_from_opcode(pc->u.of.opcw)); - pc->u.of.f = FuncAdjust(pc->u.of.f); - pc = NEXTOP(pc,of); + pc->u.ofa.opcw = Yap_opcode(Yap_op_from_opcode(pc->u.ofa.opcw)); + pc->u.ofa.f = FuncAdjust(pc->u.ofa.f); + pc = NEXTOP(pc,ofa); break; /* instructions type s */ case _write_n_voids: @@ -872,29 +873,29 @@ restore_opcodes(yamop *pc) /* instructions type f */ case _write_struct: case _write_l_struc: - pc->u.f.f = FuncAdjust(pc->u.f.f); - pc = NEXTOP(pc,f); + pc->u.fa.f = FuncAdjust(pc->u.fa.f); + pc = NEXTOP(pc,fa); break; - /* instructions type sdl */ + /* instructions type sdlp */ case _call_c_wfail: - pc->u.sdl.p = PtoPredAdjust(pc->u.sdl.p); - pc->u.sdl.l = PtoOpAdjust(pc->u.sdl.l); - pc = NEXTOP(pc,sdl); + pc->u.sdlp.p = PtoPredAdjust(pc->u.sdlp.p); + pc->u.sdlp.l = PtoOpAdjust(pc->u.sdlp.l); + pc = NEXTOP(pc,sdlp); break; - /* instructions type lds */ + /* instructions type apFs */ case _try_c: case _try_userc: /* don't need to do no nothing here, initstaff will do it for us */ - pc->u.lds.p = PtoPredAdjust(pc->u.lds.p); - pc = NEXTOP(pc,lds); + pc->u.apFs.p = PtoPredAdjust(pc->u.apFs.p); + pc = NEXTOP(pc,apFs); break; case _retry_c: case _retry_userc: /* don't need to do no nothing here, initstaff will do it for us - pc->u.lds.d = CCodeAdjust(pc->u.lds.d); */ - pc->u.lds.p = PtoPredAdjust(pc->u.lds.p); - pc = NEXTOP(pc,lds); + pc->u.apFs.d = CCodeAdjust(pc->u.apFs.d); */ + pc->u.apFs.p = PtoPredAdjust(pc->u.apFs.p); + pc = NEXTOP(pc,apFs); break; #ifdef CUT_C case _cut_c: @@ -1095,23 +1096,23 @@ restore_opcodes(yamop *pc) case _p_sll_cv: case _p_slr_cv: case _p_arg_cv: - pc->u.xcx.x = XAdjust(pc->u.xcx.x); - pc->u.xcx.xi = XAdjust(pc->u.xcx.xi); - pc = NEXTOP(pc,xcx); + pc->u.xxc.x = XAdjust(pc->u.xxc.x); + pc->u.xxc.xi = XAdjust(pc->u.xxc.xi); + pc = NEXTOP(pc,xxc); break; case _p_func2s_cv: - pc->u.xcx.x = XAdjust(pc->u.xcx.x); - if (IsAtomTerm(pc->u.xcx.c)) - pc->u.xcx.c = AtomTermAdjust(pc->u.xcx.c); - pc->u.xcx.xi = XAdjust(pc->u.xcx.xi); - pc = NEXTOP(pc,xcx); + pc->u.xxc.x = XAdjust(pc->u.xxc.x); + if (IsAtomTerm(pc->u.xxc.c)) + pc->u.xxc.c = AtomTermAdjust(pc->u.xxc.c); + pc->u.xxc.xi = XAdjust(pc->u.xxc.xi); + pc = NEXTOP(pc,xxc); break; - /* instructions type xyx */ + /* instructions type xxy */ case _p_func2f_xy: - pc->u.xyx.x = XAdjust(pc->u.xyx.x); - pc->u.xyx.x1 = XAdjust(pc->u.xyx.x1); - pc->u.xyx.y2 = YAdjust(pc->u.xyx.y2); - pc = NEXTOP(pc,xyx); + pc->u.xxy.x = XAdjust(pc->u.xxy.x); + pc->u.xxy.x1 = XAdjust(pc->u.xxy.x1); + pc->u.xxy.y2 = YAdjust(pc->u.xxy.y2); + pc = NEXTOP(pc,xxy); break; /* instructions type yxx */ case _p_plus_y_vv: @@ -1152,45 +1153,44 @@ restore_opcodes(yamop *pc) pc->u.yxc.xi = XAdjust(pc->u.yxc.xi); pc = NEXTOP(pc,yxc); break; - /* instructions type ycx */ + /* instructions type yxc */ case _p_sll_y_cv: case _p_slr_y_cv: case _p_arg_y_cv: - pc->u.ycx.y = YAdjust(pc->u.ycx.y); - pc->u.ycx.xi = XAdjust(pc->u.ycx.xi); - pc = NEXTOP(pc,ycx); + pc->u.yxc.y = YAdjust(pc->u.yxc.y); + pc->u.yxc.xi = XAdjust(pc->u.yxc.xi); + pc = NEXTOP(pc,yxc); break; - /* instructions type ycx */ case _p_func2s_y_cv: - pc->u.ycx.y = YAdjust(pc->u.ycx.y); - if (IsAtomTerm(pc->u.ycx.c)) - pc->u.ycx.c = AtomTermAdjust(pc->u.ycx.c); - pc->u.ycx.xi = XAdjust(pc->u.ycx.xi); - pc = NEXTOP(pc,ycx); + pc->u.yxc.y = YAdjust(pc->u.yxc.y); + if (IsAtomTerm(pc->u.yxc.c)) + pc->u.yxc.c = AtomTermAdjust(pc->u.yxc.c); + pc->u.yxc.xi = XAdjust(pc->u.yxc.xi); + pc = NEXTOP(pc,yxc); break; - /* instructions type llxx */ + /* instructions type plxxs */ case _call_bfunc_xx: - pc->u.llxx.p = PtoPredAdjust(pc->u.llxx.p); - pc->u.llxx.f = PtoOpAdjust(pc->u.llxx.f); - pc->u.llxx.x1 = XAdjust(pc->u.llxx.x1); - pc->u.llxx.x2 = XAdjust(pc->u.llxx.x2); - pc = NEXTOP(pc,llxx); + pc->u.plxxs.p = PtoPredAdjust(pc->u.plxxs.p); + pc->u.plxxs.f = PtoOpAdjust(pc->u.plxxs.f); + pc->u.plxxs.x1 = XAdjust(pc->u.plxxs.x1); + pc->u.plxxs.x2 = XAdjust(pc->u.plxxs.x2); + pc = NEXTOP(pc,plxxs); break; - /* instructions type llxy */ + /* instructions type plxys */ case _call_bfunc_yx: case _call_bfunc_xy: - pc->u.llxy.p = PtoPredAdjust(pc->u.llxy.p); - pc->u.llxy.f = PtoOpAdjust(pc->u.llxy.f); - pc->u.llxy.x = XAdjust(pc->u.llxy.x); - pc->u.llxy.y = YAdjust(pc->u.llxy.y); - pc = NEXTOP(pc,llxy); + pc->u.plxys.p = PtoPredAdjust(pc->u.plxys.p); + pc->u.plxys.f = PtoOpAdjust(pc->u.plxys.f); + pc->u.plxys.x = XAdjust(pc->u.plxys.x); + pc->u.plxys.y = YAdjust(pc->u.plxys.y); + pc = NEXTOP(pc,plxys); break; case _call_bfunc_yy: - pc->u.llyy.p = PtoPredAdjust(pc->u.llyy.p); - pc->u.llyy.f = PtoOpAdjust(pc->u.llxy.f); - pc->u.llyy.y1 = YAdjust(pc->u.llyy.y1); - pc->u.llyy.y2 = YAdjust(pc->u.llyy.y2); - pc = NEXTOP(pc,llyy); + pc->u.plyys.p = PtoPredAdjust(pc->u.plyys.p); + pc->u.plyys.f = PtoOpAdjust(pc->u.plyys.f); + pc->u.plyys.y1 = YAdjust(pc->u.plyys.y1); + pc->u.plyys.y2 = YAdjust(pc->u.plyys.y2); + pc = NEXTOP(pc,plyys); break; } } while (TRUE); diff --git a/H/rheap.h b/H/rheap.h index 9793beaa6..044645906 100644 --- a/H/rheap.h +++ b/H/rheap.h @@ -244,17 +244,17 @@ static char SccsId[] = "@(#)rheap.c 1.3 3/15/90"; static void do_clean_susp_clauses(yamop *ipc) { COUNT i; - yamop **st = (yamop **)NEXTOP(ipc,sp); + yamop **st = (yamop **)NEXTOP(ipc,sssllp); ipc->opc = Yap_opcode(_expand_clauses); - ipc->u.sp.p = PtoPredAdjust(ipc->u.sp.p); - if (ipc->u.sp.sprev) { - ipc->u.sp.sprev = PtoOpAdjust(ipc->u.sp.sprev); + ipc->u.sssllp.p = PtoPredAdjust(ipc->u.sssllp.p); + if (ipc->u.sssllp.sprev) { + ipc->u.sssllp.sprev = PtoOpAdjust(ipc->u.sssllp.sprev); } - if (ipc->u.sp.snext) { - ipc->u.sp.snext = PtoOpAdjust(ipc->u.sp.snext); + if (ipc->u.sssllp.snext) { + ipc->u.sssllp.snext = PtoOpAdjust(ipc->u.sssllp.snext); } - for (i = 0; i < ipc->u.sp.s1; i++, st++) { + for (i = 0; i < ipc->u.sssllp.s1; i++, st++) { if (*st) { *st = PtoOpAdjust(*st); } @@ -516,7 +516,7 @@ restore_codes(void) yamop *ptr = Yap_heap_regs->expand_clauses_first; while (ptr) { do_clean_susp_clauses(ptr); - ptr = ptr->u.sp.snext; + ptr = ptr->u.sssllp.snext; } } Yap_heap_regs->failcode->opc = Yap_opcode(_op_fail); @@ -542,9 +542,9 @@ restore_codes(void) INIT_YAMOP_LTT(&(Yap_heap_regs->nocode), 1); INIT_YAMOP_LTT(&(Yap_heap_regs->rtrycode), 1); #endif /* YAPOR */ - if (((yamop *)(&Yap_heap_regs->rtrycode))->u.ld.d != NIL) - ((yamop *)(&Yap_heap_regs->rtrycode))->u.ld.d = - PtoOpAdjust(((yamop *)(&Yap_heap_regs->rtrycode))->u.ld.d); + if (((yamop *)(&Yap_heap_regs->rtrycode))->u.apl.d != NIL) + ((yamop *)(&Yap_heap_regs->rtrycode))->u.apl.d = + PtoOpAdjust(((yamop *)(&Yap_heap_regs->rtrycode))->u.apl.d); { int arity; arity = Yap_heap_regs->clausecode->arity; diff --git a/OPTYap/or.insts.i b/OPTYap/or.insts.i index 4d8093edf..78fb85105 100644 --- a/OPTYap/or.insts.i +++ b/OPTYap/or.insts.i @@ -41,7 +41,7 @@ - PBOp(getwork,ld) + PBOp(getwork,apl) #ifdef TABLING if (DepFr_leader_cp(LOCAL_top_dep_fr) == LOCAL_top_cp) { /* the current top node is a leader node with consumer nodes below */ @@ -93,7 +93,7 @@ /* 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(getwork_seq,ld) + PBOp(getwork_seq,apl) LOCK_OR_FRAME(LOCAL_top_or_fr); if (OrFr_alternative(LOCAL_top_or_fr) && BITMAP_alone(OrFr_members(LOCAL_top_or_fr), worker_id)) { @@ -108,9 +108,9 @@ - PBOp(sync,ld) + PBOp(sync,apl) CUT_wait_leftmost(); - PREG = NEXTOP(PREG, ld); + PREG = NEXTOP(PREG, apl); PREFETCH_OP(PREG); GONext(); ENDPBOp(); diff --git a/OPTYap/or.macros.h b/OPTYap/or.macros.h index 40e7bf75d..ddf4d90f8 100644 --- a/OPTYap/or.macros.h +++ b/OPTYap/or.macros.h @@ -75,16 +75,16 @@ STD_PROTO(static inline qg_sol_fr_ptr CUT_prune_solution_frames, (qg_sol_fr_ptr, #define YAMOP_LTT_BITS OOOOPPS!!! Unknown Integer Sizeof #endif /* SIZEOF_INT */ -#define YAMOP_OR_ARG(INST) ((INST)->u.ld.or_arg) -#define YAMOP_LTT(INST) (((INST)->u.ld.or_arg) & YAMOP_LTT_BITS) -#define YAMOP_SEQ(INST) (((INST)->u.ld.or_arg) & YAMOP_SEQ_FLAG) -#define YAMOP_CUT(INST) (((INST)->u.ld.or_arg) & YAMOP_CUT_FLAG) -#define YAMOP_FLAGS(INST) (((INST)->u.ld.or_arg) & YAMOP_FLAGS_BITS) +#define YAMOP_OR_ARG(INST) ((INST)->u.apl.or_arg) +#define YAMOP_LTT(INST) (((INST)->u.apl.or_arg) & YAMOP_LTT_BITS) +#define YAMOP_SEQ(INST) (((INST)->u.apl.or_arg) & YAMOP_SEQ_FLAG) +#define YAMOP_CUT(INST) (((INST)->u.apl.or_arg) & YAMOP_CUT_FLAG) +#define YAMOP_FLAGS(INST) (((INST)->u.apl.or_arg) & YAMOP_FLAGS_BITS) -#define INIT_YAMOP_LTT(INST, LTT) (INST)->u.ld.or_arg = LTT -#define PUT_YAMOP_LTT(INST, LTT) (INST)->u.ld.or_arg = YAMOP_FLAGS(INST) | (LTT) -#define PUT_YAMOP_SEQ(INST) (INST)->u.ld.or_arg |= YAMOP_SEQ_FLAG -#define PUT_YAMOP_CUT(INST) (INST)->u.ld.or_arg |= YAMOP_CUT_FLAG +#define INIT_YAMOP_LTT(INST, LTT) (INST)->u.apl.or_arg = LTT +#define PUT_YAMOP_LTT(INST, LTT) (INST)->u.apl.or_arg = YAMOP_FLAGS(INST) | (LTT) +#define PUT_YAMOP_SEQ(INST) (INST)->u.apl.or_arg |= YAMOP_SEQ_FLAG +#define PUT_YAMOP_CUT(INST) (INST)->u.apl.or_arg |= YAMOP_CUT_FLAG #define BRANCH(WORKER, DEPTH) GLOBAL_branch(WORKER, DEPTH) #define BRANCH_LTT(WORKER, DEPTH) (BRANCH(WORKER, DEPTH) & YAMOP_LTT_BITS) diff --git a/OPTYap/tab.insts.i b/OPTYap/tab.insts.i index c2a36c411..9cfb8de90 100644 --- a/OPTYap/tab.insts.i +++ b/OPTYap/tab.insts.i @@ -272,7 +272,7 @@ - PBOp(table_load_answer, ld) + PBOp(table_load_answer, apl) CELL *subs_ptr; ans_node_ptr ans_node; @@ -299,7 +299,7 @@ - PBOp(table_try_answer, ld) + PBOp(table_try_answer, apl) #ifdef INCOMPLETE_TABLING sg_fr_ptr sg_fr; ans_node_ptr ans_node; @@ -330,16 +330,16 @@ PREG = SgFr_code(sg_fr); if (PREG->opc == Yap_opcode(_table_try)) { /* table_try */ - code_ap = NEXTOP(PREG,ld); - PREG = PREG->u.ld.d; + code_ap = NEXTOP(PREG,apl); + PREG = PREG->u.apl.d; } else if (PREG->opc == Yap_opcode(_table_try_single)) { /* table_try_single */ code_ap = COMPLETION; - PREG = PREG->u.ld.d; + PREG = PREG->u.apl.d; } else { /* table_try_me */ - code_ap = PREG->u.ld.d; - PREG = NEXTOP(PREG,ld); + code_ap = PREG->u.apl.d; + PREG = NEXTOP(PREG,apl); } PREFETCH_OP(PREG); restore_generator_node(SgFr_arity(sg_fr), code_ap); @@ -350,7 +350,7 @@ GONext(); } #else - PREG = PREG->u.ld.d; + PREG = PREG->u.apl.d; PREFETCH_OP(PREG); GONext(); #endif /* INCOMPLETE_TABLING */ @@ -358,12 +358,12 @@ - PBOp(table_try_single, ld) + PBOp(table_try_single, apl) tab_ent_ptr tab_ent; sg_fr_ptr sg_fr; check_trail(TR); - tab_ent = PREG->u.ld.te; + tab_ent = PREG->u.apl.te; YENV2MEM; sg_fr = subgoal_search(PREG, YENV_ADDRESS); MEM2YENV; @@ -372,8 +372,8 @@ /* subgoal new */ init_subgoal_frame(sg_fr); UNLOCK(SgFr_lock(sg_fr)); - store_generator_node(tab_ent, sg_fr, PREG->u.ld.s, COMPLETION); - PREG = PREG->u.ld.d; /* should work also with PREG = NEXTOP(PREG,ld); */ + store_generator_node(tab_ent, sg_fr, PREG->u.apl.s, COMPLETION); + PREG = PREG->u.apl.d; /* should work also with PREG = NEXTOP(PREG,apl); */ PREFETCH_OP(PREG); allocate_environment(); GONext(); @@ -385,7 +385,7 @@ init_subgoal_frame(sg_fr); UNLOCK(SgFr_lock(sg_fr)); SgFr_try_answer(sg_fr) = ans_node; - store_generator_node(tab_ent, sg_fr, PREG->u.ld.s, TRY_ANSWER); + store_generator_node(tab_ent, sg_fr, PREG->u.apl.s, TRY_ANSWER); PREG = (yamop *) CPREG; PREFETCH_OP(PREG); load_answer_trie(ans_node, subs_ptr); @@ -467,12 +467,12 @@ - PBOp(table_try_me, ld) + PBOp(table_try_me, apl) tab_ent_ptr tab_ent; sg_fr_ptr sg_fr; check_trail(TR); - tab_ent = PREG->u.ld.te; + tab_ent = PREG->u.apl.te; YENV2MEM; sg_fr = subgoal_search(PREG, YENV_ADDRESS); MEM2YENV; @@ -481,8 +481,8 @@ /* subgoal new */ init_subgoal_frame(sg_fr); UNLOCK(SgFr_lock(sg_fr)); - store_generator_node(tab_ent, sg_fr, PREG->u.ld.s, PREG->u.ld.d); - PREG = NEXTOP(PREG, ld); + store_generator_node(tab_ent, sg_fr, PREG->u.apl.s, PREG->u.apl.d); + PREG = NEXTOP(PREG, apl); PREFETCH_OP(PREG); allocate_environment(); GONext(); @@ -494,7 +494,7 @@ init_subgoal_frame(sg_fr); UNLOCK(SgFr_lock(sg_fr)); SgFr_try_answer(sg_fr) = ans_node; - store_generator_node(tab_ent, sg_fr, PREG->u.ld.s, TRY_ANSWER); + store_generator_node(tab_ent, sg_fr, PREG->u.apl.s, TRY_ANSWER); PREG = (yamop *) CPREG; PREFETCH_OP(PREG); load_answer_trie(ans_node, subs_ptr); @@ -576,12 +576,12 @@ - PBOp(table_try, ld) + PBOp(table_try, apl) tab_ent_ptr tab_ent; sg_fr_ptr sg_fr; check_trail(TR); - tab_ent = PREG->u.ld.te; + tab_ent = PREG->u.apl.te; YENV2MEM; sg_fr = subgoal_search(PREG, YENV_ADDRESS); MEM2YENV; @@ -590,8 +590,8 @@ /* subgoal new */ init_subgoal_frame(sg_fr); UNLOCK(SgFr_lock(sg_fr)); - store_generator_node(tab_ent, sg_fr, PREG->u.ld.s, NEXTOP(PREG,ld)); - PREG = PREG->u.ld.d; + store_generator_node(tab_ent, sg_fr, PREG->u.apl.s, NEXTOP(PREG,apl)); + PREG = PREG->u.apl.d; PREFETCH_OP(PREG); allocate_environment(); GONext(); @@ -603,7 +603,7 @@ init_subgoal_frame(sg_fr); UNLOCK(SgFr_lock(sg_fr)); SgFr_try_answer(sg_fr) = ans_node; - store_generator_node(tab_ent, sg_fr, PREG->u.ld.s, TRY_ANSWER); + store_generator_node(tab_ent, sg_fr, PREG->u.apl.s, TRY_ANSWER); PREG = (yamop *) CPREG; PREFETCH_OP(PREG); load_answer_trie(ans_node, subs_ptr); @@ -685,49 +685,49 @@ - Op(table_retry_me, ld) - restore_generator_node(PREG->u.ld.s, PREG->u.ld.d); + Op(table_retry_me, apl) + restore_generator_node(PREG->u.apl.s, PREG->u.apl.d); YENV = (CELL *) PROTECT_FROZEN_B(B); set_cut(YENV, B->cp_b); SET_BB(NORM_CP(YENV)); allocate_environment(); - PREG = NEXTOP(PREG,ld); + PREG = NEXTOP(PREG,apl); GONext(); ENDOp(); - Op(table_retry, ld) - restore_generator_node(PREG->u.ld.s, NEXTOP(PREG,ld)); + Op(table_retry, apl) + restore_generator_node(PREG->u.apl.s, NEXTOP(PREG,apl)); YENV = (CELL *) PROTECT_FROZEN_B(B); set_cut(YENV, B->cp_b); SET_BB(NORM_CP(YENV)); allocate_environment(); - PREG = PREG->u.ld.d; + PREG = PREG->u.apl.d; GONext(); ENDOp(); - Op(table_trust_me, ld) - restore_generator_node(PREG->u.ld.s, COMPLETION); + Op(table_trust_me, apl) + restore_generator_node(PREG->u.apl.s, COMPLETION); YENV = (CELL *) PROTECT_FROZEN_B(B); set_cut(YENV, B->cp_b); SET_BB(NORM_CP(YENV)); allocate_environment(); - PREG = NEXTOP(PREG,ld); + PREG = NEXTOP(PREG,apl); GONext(); ENDOp(); - Op(table_trust, ld) - restore_generator_node(PREG->u.ld.s, COMPLETION); + Op(table_trust, apl) + restore_generator_node(PREG->u.apl.s, COMPLETION); YENV = (CELL *) PROTECT_FROZEN_B(B); set_cut(YENV, B->cp_b); SET_BB(NORM_CP(YENV)); allocate_environment(); - PREG = PREG->u.ld.d; + PREG = PREG->u.apl.d; GONext(); ENDOp(); @@ -973,7 +973,7 @@ - BOp(table_answer_resolution, ld) + BOp(table_answer_resolution, apl) #ifdef YAPOR if (SCH_top_shared_cp(B)) { UNLOCK_OR_FRAME(LOCAL_top_or_fr); @@ -1259,7 +1259,7 @@ - BOp(table_completion, ld) + BOp(table_completion, apl) #ifdef YAPOR if (SCH_top_shared_cp(B)) { if (IS_BATCHED_GEN_CP(B)) { diff --git a/OPTYap/tab.structs.h b/OPTYap/tab.structs.h index b8ce36660..2625280d4 100644 --- a/OPTYap/tab.structs.h +++ b/OPTYap/tab.structs.h @@ -88,7 +88,7 @@ typedef struct subgoal_trie_node { typedef struct answer_trie_node { OPCODE trie_instruction; /* u.opc */ #ifdef YAPOR - int or_arg; /* u.ld.or_arg */ + int or_arg; /* u.apl.or_arg */ #endif /* YAPOR */ Term entry; #ifdef TABLE_LOCK_AT_NODE_LEVEL @@ -182,8 +182,8 @@ typedef struct subgoal_frame { #define SgFr_gen_worker(X) ((X)->generator_worker) #define SgFr_gen_top_or_fr(X) ((X)->top_or_frame_on_generator_branch) #define SgFr_code(X) ((X)->code_of_subgoal) -#define SgFr_tab_ent(X) (((X)->code_of_subgoal)->u.ld.te) -#define SgFr_arity(X) (((X)->code_of_subgoal)->u.ld.s) +#define SgFr_tab_ent(X) (((X)->code_of_subgoal)->u.apl.te) +#define SgFr_arity(X) (((X)->code_of_subgoal)->u.apl.s) #define SgFr_state(X) ((X)->state_flag) #define SgFr_gen_cp(X) ((X)->generator_choice_point) #define SgFr_hash_chain(X) ((X)->hash_chain) diff --git a/OPTYap/tab.tries.c b/OPTYap/tab.tries.c index d006c2142..d8fd31932 100644 --- a/OPTYap/tab.tries.c +++ b/OPTYap/tab.tries.c @@ -682,8 +682,8 @@ sg_fr_ptr subgoal_search(yamop *preg, CELL **Yaddr) { tab_ent_ptr tab_ent; sg_fr_ptr sg_fr; - arity = preg->u.ld.s; - tab_ent = preg->u.ld.te; + arity = preg->u.apl.s; + tab_ent = preg->u.apl.te; count_vars = 0; stack_vars = *Yaddr; stack_terms_limit = (CELL *)TR;