diff --git a/C/absmi.c b/C/absmi.c index 1fbc3a572..804f2575b 100644 --- a/C/absmi.c +++ b/C/absmi.c @@ -917,7 +917,7 @@ Yap_absmi(int inp) * Plain try - retry - trust instructions * *****************************************************************/ /* try_me Label,NArgs */ - Op(try_me, apl); + Op(try_me, Otapl); /* check if enough space between trail and codespace */ check_trail(TR); /* I use YREG =to go through the choicepoint. Usually YREG =is in a @@ -925,9 +925,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.apl.s); + store_at_least_one_arg(PREG->u.Otapl.s); /* store abstract machine registers */ - store_yaam_regs(PREG->u.apl.d, 0); + store_yaam_regs(PREG->u.Otapl.d, 0); /* On a try_me, set cut to point at previous choicepoint, * that is, to the B before the cut. */ @@ -939,17 +939,17 @@ Yap_absmi(int inp) #endif /* YAPOR */ SET_BB(B_YREG); ENDCACHE_Y(); - PREG = NEXTOP(PREG, apl); + PREG = NEXTOP(PREG, Otapl); GONext(); ENDOp(); /* retry_me Label,NArgs */ - Op(retry_me, apl); + Op(retry_me, Otapl); CACHE_Y(B); /* After retry, cut should be pointing at the parent * choicepoint for the current B */ - restore_yaam_regs(PREG->u.apl.d); - restore_at_least_one_arg(PREG->u.apl.s); + restore_yaam_regs(PREG->u.Otapl.d); + restore_at_least_one_arg(PREG->u.Otapl.s); #ifdef FROZEN_STACKS S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG); set_cut(S_YREG, B->cp_b); @@ -958,17 +958,17 @@ Yap_absmi(int inp) #endif /* FROZEN_STACKS */ SET_BB(B_YREG); ENDCACHE_Y(); - PREG = NEXTOP(PREG, apl); + PREG = NEXTOP(PREG, Otapl); GONext(); ENDOp(); /* trust_me UnusedLabel,NArgs */ - Op(trust_me, apl); + Op(trust_me, Otapl); CACHE_Y(B); #ifdef YAPOR if (SCH_top_shared_cp(B)) { SCH_last_alternative(PREG, B_YREG); - restore_at_least_one_arg(PREG->u.apl.s); + restore_at_least_one_arg(PREG->u.Otapl.s); #ifdef FROZEN_STACKS S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG); #endif /* FROZEN_STACKS */ @@ -978,7 +978,7 @@ Yap_absmi(int inp) #endif /* YAPOR */ { pop_yaam_regs(); - pop_at_least_one_arg(PREG->u.apl.s); + pop_at_least_one_arg(PREG->u.Otapl.s); /* After trust, cut should be pointing at the new top * choicepoint */ #ifdef FROZEN_STACKS @@ -986,7 +986,7 @@ Yap_absmi(int inp) #endif /* FROZEN_STACKS */ set_cut(S_YREG, B); } - PREG = NEXTOP(PREG, apl); + PREG = NEXTOP(PREG, Otapl); SET_BB(B_YREG); ENDCACHE_Y(); GONext(); @@ -1027,15 +1027,15 @@ Yap_absmi(int inp) ENDOp(); /* profiled_retry_me Label,NArgs */ - Op(profiled_retry_me, apl); + Op(profiled_retry_me, Otapl); CACHE_Y(B); /* After retry, cut should be pointing at the parent * choicepoint for the current B */ - 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); + LOCK(PREG->u.Otapl.p->StatisticsForPred.lock); + PREG->u.Otapl.p->StatisticsForPred.NOfRetries++; + UNLOCK(PREG->u.Otapl.p->StatisticsForPred.lock); + restore_yaam_regs(PREG->u.Otapl.d); + restore_args(PREG->u.Otapl.s); #ifdef FROZEN_STACKS S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG); set_cut(S_YREG, B->cp_b); @@ -1044,17 +1044,17 @@ Yap_absmi(int inp) #endif /* FROZEN_STACKS */ SET_BB(B_YREG); ENDCACHE_Y(); - PREG = NEXTOP(PREG, apl); + PREG = NEXTOP(PREG, Otapl); GONext(); ENDOp(); /* profiled_trust_me UnusedLabel,NArgs */ - Op(profiled_trust_me, apl); + Op(profiled_trust_me, Otapl); CACHE_Y(B); #ifdef YAPOR if (SCH_top_shared_cp(B)) { SCH_last_alternative(PREG, B_YREG); - restore_args(PREG->u.apl.s); + restore_args(PREG->u.Otapl.s); #ifdef FROZEN_STACKS S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG); #endif /* FROZEN_STACKS */ @@ -1064,7 +1064,7 @@ Yap_absmi(int inp) #endif /* YAPOR */ { pop_yaam_regs(); - pop_args(PREG->u.apl.s); + pop_args(PREG->u.Otapl.s); /* After trust, cut should be pointing at the new top * choicepoint */ #ifdef FROZEN_STACKS @@ -1074,31 +1074,31 @@ Yap_absmi(int inp) } SET_BB(B_YREG); ENDCACHE_Y(); - LOCK(PREG->u.apl.p->StatisticsForPred.lock); - PREG->u.apl.p->StatisticsForPred.NOfRetries++; - UNLOCK(PREG->u.apl.p->StatisticsForPred.lock); - PREG = NEXTOP(PREG, apl); + LOCK(PREG->u.Otapl.p->StatisticsForPred.lock); + PREG->u.Otapl.p->StatisticsForPred.NOfRetries++; + UNLOCK(PREG->u.Otapl.p->StatisticsForPred.lock); + PREG = NEXTOP(PREG, Otapl); GONext(); ENDOp(); - BOp(profiled_retry_logical, aLl); + BOp(profiled_retry_logical, OtaLl); check_trail(TR); { UInt timestamp; CACHE_Y(B); - timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[PREG->u.aLl.s]); - if (!VALID_TIMESTAMP(timestamp, PREG->u.aLl.d)) { + timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[PREG->u.OtaLl.s]); + if (!VALID_TIMESTAMP(timestamp, PREG->u.OtaLl.d)) { /* jump to next instruction */ - PREG=PREG->u.aLl.n; + PREG=PREG->u.OtaLl.n; JMPNext(); } - 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; + restore_yaam_regs(PREG->u.OtaLl.n); + restore_args(PREG->u.OtaLl.s); + LOCK(PREG->u.OtaLl.d->ClPred->StatisticsForPred.lock); + PREG->u.OtaLl.d->ClPred->StatisticsForPred.NOfRetries++; + UNLOCK(PREG->u.OtaLl.d->ClPred->StatisticsForPred.lock); + PREG = PREG->u.OtaLl.d->ClCode; #ifdef FROZEN_STACKS S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG); set_cut(S_YREG, B->cp_b); @@ -1111,12 +1111,12 @@ Yap_absmi(int inp) JMPNext(); ENDBOp(); - BOp(profiled_trust_logical, ILl); + BOp(profiled_trust_logical, OtILl); CACHE_Y(B); { - LogUpdIndex *cl = PREG->u.ILl.block; + LogUpdIndex *cl = PREG->u.OtILl.block; PredEntry *ap = cl->ClPred; - LogUpdClause *lcl = PREG->u.ILl.d; + LogUpdClause *lcl = PREG->u.OtILl.d; UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]); if (!VALID_TIMESTAMP(timestamp, lcl)) { @@ -1292,13 +1292,13 @@ Yap_absmi(int inp) ENDOp(); /* count_retry_me Label,NArgs */ - Op(count_retry_me, apl); + Op(count_retry_me, Otapl); CACHE_Y(B); /* After retry, cut should be pointing at the parent * choicepoint for the current B */ - LOCK(((PredEntry *)(PREG->u.apl.p))->StatisticsForPred.lock); - ((PredEntry *)(PREG->u.apl.p))->StatisticsForPred.NOfRetries++; - UNLOCK(((PredEntry *)(PREG->u.apl.p))->StatisticsForPred.lock); + LOCK(((PredEntry *)(PREG->u.Otapl.p))->StatisticsForPred.lock); + ((PredEntry *)(PREG->u.Otapl.p))->StatisticsForPred.NOfRetries++; + UNLOCK(((PredEntry *)(PREG->u.Otapl.p))->StatisticsForPred.lock); RetriesCounter--; if (RetriesCounter == 0 && RetriesCounterOn) { saveregs(); @@ -1313,8 +1313,8 @@ Yap_absmi(int inp) setregs(); JMPNext(); } - restore_yaam_regs(PREG->u.apl.d); - restore_args(PREG->u.apl.s); + restore_yaam_regs(PREG->u.Otapl.d); + restore_args(PREG->u.Otapl.s); #ifdef FROZEN_STACKS S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG); set_cut(S_YREG, B->cp_b); @@ -1323,17 +1323,17 @@ Yap_absmi(int inp) #endif /* FROZEN_STACKS */ SET_BB(B_YREG); ENDCACHE_Y(); - PREG = NEXTOP(PREG, apl); + PREG = NEXTOP(PREG, Otapl); GONext(); ENDOp(); /* count_trust_me UnusedLabel,NArgs */ - Op(count_trust_me, apl); + Op(count_trust_me, Otapl); CACHE_Y(B); #ifdef YAPOR if (SCH_top_shared_cp(B)) { SCH_last_alternative(PREG, B_YREG); - restore_args(PREG->u.apl.s); + restore_args(PREG->u.Otapl.s); #ifdef FROZEN_STACKS S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG); #endif /* FROZEN_STACKS */ @@ -1343,7 +1343,7 @@ Yap_absmi(int inp) #endif /* YAPOR */ { pop_yaam_regs(); - pop_args(PREG->u.apl.s); + pop_args(PREG->u.Otapl.s); /* After trust, cut should be pointing at the new top * choicepoint */ #ifdef FROZEN_STACKS @@ -1367,27 +1367,27 @@ Yap_absmi(int inp) setregs(); JMPNext(); } - 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); + LOCK(((PredEntry *)(PREG->u.Otapl.p))->StatisticsForPred.lock); + ((PredEntry *)(PREG->u.Otapl.p))->StatisticsForPred.NOfRetries++; + UNLOCK(((PredEntry *)(PREG->u.Otapl.p))->StatisticsForPred.lock); + PREG = NEXTOP(PREG, Otapl); GONext(); ENDOp(); - BOp(count_retry_logical, aLl); + BOp(count_retry_logical, OtaLl); check_trail(TR); { UInt timestamp; CACHE_Y(B); - timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[PREG->u.aLl.s]); - if (!VALID_TIMESTAMP(timestamp, PREG->u.aLl.d)) { + timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[PREG->u.OtaLl.s]); + if (!VALID_TIMESTAMP(timestamp, PREG->u.OtaLl.d)) { /* jump to next instruction */ - PREG=PREG->u.aLl.n; + PREG=PREG->u.OtaLl.n; JMPNext(); } - restore_yaam_regs(PREG->u.aLl.n); - restore_args(PREG->u.aLl.s); + restore_yaam_regs(PREG->u.OtaLl.n); + restore_args(PREG->u.OtaLl.s); RetriesCounter--; if (RetriesCounter == 0) { saveregs(); @@ -1402,10 +1402,10 @@ Yap_absmi(int inp) setregs(); JMPNext(); } - 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; + LOCK(PREG->u.OtaLl.d->ClPred->StatisticsForPred.lock); + PREG->u.OtaLl.d->ClPred->StatisticsForPred.NOfRetries++; + UNLOCK(PREG->u.OtaLl.d->ClPred->StatisticsForPred.lock); + PREG = PREG->u.OtaLl.d->ClCode; #ifdef FROZEN_STACKS S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG); set_cut(S_YREG, B->cp_b); @@ -1418,12 +1418,12 @@ Yap_absmi(int inp) JMPNext(); ENDBOp(); - BOp(count_trust_logical, ILl); + BOp(count_trust_logical, OtILl); CACHE_Y(B); { - LogUpdIndex *cl = PREG->u.ILl.block; + LogUpdIndex *cl = PREG->u.OtILl.block; PredEntry *ap = cl->ClPred; - LogUpdClause *lcl = PREG->u.ILl.d; + LogUpdClause *lcl = PREG->u.OtILl.d; UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]); if (!VALID_TIMESTAMP(timestamp, lcl)) { @@ -1728,48 +1728,48 @@ Yap_absmi(int inp) *****************************************************************/ /* spy_or_trymark */ - 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); + BOp(spy_or_trymark, Otapl); + LOCK(((PredEntry *)(PREG->u.Otapl.p))->PELock); + PREG = (yamop *)(&(((PredEntry *)(PREG->u.Otapl.p))->OpcodeOfPred)); + UNLOCK(((PredEntry *)(PREG->u.Otapl.p))->PELock); goto dospy; ENDBOp(); /* try_and_mark Label,NArgs */ - BOp(try_and_mark, apl); + BOp(try_and_mark, Otapl); 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.apl.p->PredFlags & LogUpdatePredFlag) { - LOCK(PREG->u.apl.p->PELock); - PP = PREG->u.apl.p; + if (PREG->u.Otapl.p->PredFlags & LogUpdatePredFlag) { + LOCK(PREG->u.Otapl.p->PELock); + PP = PREG->u.Otapl.p; } - if (PREG->u.apl.p->CodeOfPred != PREG) { + if (PREG->u.Otapl.p->CodeOfPred != PREG) { /* oops, someone changed the procedure under our feet, fortunately this is no big deal because we haven't done anything yet */ PP = NULL; - PREG = PREG->u.apl.p->CodeOfPred; - UNLOCK(PREG->u.apl.p->PELock); + PREG = PREG->u.Otapl.p->CodeOfPred; + UNLOCK(PREG->u.Otapl.p->PELock); /* for profiler */ save_pc(); JMPNext(); } #endif CACHE_Y(YREG); - PREG = PREG->u.apl.d; + PREG = PREG->u.Otapl.d; /* I've got a read lock on the DB, so I don't need to care... niaaahh.... niahhhh... */ LOCK(DynamicLock(PREG)); /* one can now mess around with the predicate */ - UNLOCK(((PredEntry *)(PREG->u.apl.p))->PELock); + UNLOCK(((PredEntry *)(PREG->u.Otapl.p))->PELock); BEGD(d1); - d1 = PREG->u.apl.s; + d1 = PREG->u.Otapl.s; store_args(d1); store_yaam_regs(PREG, 0); ENDD(d1); @@ -1791,12 +1791,12 @@ Yap_absmi(int inp) TRAIL_CLREF(ClauseCodeToDynamicClause(PREG)); } #endif - PREG = NEXTOP(PREG,apl); + PREG = NEXTOP(PREG,Otapl); JMPNext(); ENDBOp(); - BOp(count_retry_and_mark, apl); + BOp(count_retry_and_mark, Otapl); RetriesCounter--; if (RetriesCounter == 0) { saveregs(); @@ -1814,26 +1814,26 @@ Yap_absmi(int inp) /* enter a retry dynamic */ ENDBOp(); - 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); + BOp(profiled_retry_and_mark, Otapl); + LOCK(((PredEntry *)(PREG->u.Otapl.p))->StatisticsForPred.lock); + ((PredEntry *)(PREG->u.Otapl.p))->StatisticsForPred.NOfRetries++; + UNLOCK(((PredEntry *)(PREG->u.Otapl.p))->StatisticsForPred.lock); /* enter a retry dynamic */ ENDBOp(); /* retry_and_mark Label,NArgs */ - BOp(retry_and_mark, apl); + BOp(retry_and_mark, Otapl); #ifdef YAPOR CUT_wait_leftmost(); #endif /* YAPOR */ /* need to make the DB stable until I get the new clause */ - LOCK(PREG->u.apl.p->PELock); + LOCK(PREG->u.Otapl.p->PELock); CACHE_Y(B); - PREG = PREG->u.apl.d; + PREG = PREG->u.Otapl.d; LOCK(DynamicLock(PREG)); - UNLOCK(PREG->u.apl.p->PELock); + UNLOCK(PREG->u.Otapl.p->PELock); restore_yaam_regs(PREG); - restore_args(PREG->u.apl.s); + restore_args(PREG->u.Otapl.s); #ifdef FROZEN_STACKS S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG); set_cut(S_YREG, B->cp_b); @@ -1853,7 +1853,7 @@ Yap_absmi(int inp) TRAIL_CLREF(ClauseCodeToDynamicClause(PREG)); } #endif - PREG = NEXTOP(PREG, apl); + PREG = NEXTOP(PREG, Otapl); JMPNext(); ENDBOp(); @@ -1979,7 +1979,7 @@ Yap_absmi(int inp) break; case _retry_c: case _retry_userc: - low_level_trace(retry_pred, ipc->u.apFs.p, B->cp_args); + low_level_trace(retry_pred, ipc->u.OtapFs.p, B->cp_args); break; case _retry_profiled: case _count_retry: @@ -1996,7 +1996,7 @@ Yap_absmi(int inp) case _profiled_retry_and_mark: case _retry: case _trust: - low_level_trace(retry_pred, ipc->u.apl.p, B->cp_args); + low_level_trace(retry_pred, ipc->u.Otapl.p, B->cp_args); break; case _try_logical: case _retry_logical: @@ -2005,7 +2005,7 @@ Yap_absmi(int inp) case _trust_logical: case _profiled_trust_logical: case _count_trust_logical: - low_level_trace(retry_pred, ipc->u.ILl.d->ClPred, B->cp_args); + low_level_trace(retry_pred, ipc->u.OtILl.d->ClPred, B->cp_args); break; case _Nstop: case _Ystop: @@ -2378,7 +2378,7 @@ Yap_absmi(int inp) do_commit_b_x: #endif /* skip a void call and a label */ - PREG = NEXTOP(NEXTOP(NEXTOP(PREG, xp),sbpp),l); + PREG = NEXTOP(NEXTOP(NEXTOP(PREG, xp),Osbpp),l); { choiceptr pt0; #if defined(SBA) && defined(FROZEN_STACKS) @@ -2424,7 +2424,7 @@ Yap_absmi(int inp) ENDCACHE_Y_AS_ENV(); do_commit_b_y: #endif - PREG = NEXTOP(NEXTOP(NEXTOP(PREG, yp),sbpp),l); + PREG = NEXTOP(NEXTOP(NEXTOP(PREG, yp),Osbpp),l); { choiceptr pt0; #if defined(SBA) && defined(FROZEN_STACKS) @@ -2581,7 +2581,7 @@ Yap_absmi(int inp) ENDCACHE_Y_AS_ENV(); ENDBOp(); - BOp(fcall, sbpp); + BOp(fcall, Osbpp); CACHE_Y_AS_ENV(YREG); ENV_YREG[E_CP] = (CELL) CPREG; ENV_YREG[E_E] = (CELL) ENV; @@ -2591,24 +2591,24 @@ Yap_absmi(int inp) ENDCACHE_Y_AS_ENV(); ENDBOp(); - BOp(call, sbpp); + BOp(call, Osbpp); #ifdef LOW_LEVEL_TRACER if (Yap_do_low_level_trace) { - low_level_trace(enter_pred,PREG->u.sbpp.p,XREGS+1); + low_level_trace(enter_pred,PREG->u.Osbpp.p,XREGS+1); } #endif /* LOW_LEVEL_TRACER */ CACHE_Y_AS_ENV(YREG); { PredEntry *pt; - pt = PREG->u.sbpp.p; + pt = PREG->u.Osbpp.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.sbpp.s); - CPREG = NEXTOP(PREG, sbpp); + ENV_YREG = (CELL *) (((char *) ENV_YREG) + PREG->u.Osbpp.s); + CPREG = NEXTOP(PREG, Osbpp); ALWAYS_LOOKAHEAD(pt->OpcodeOfPred); PREG = pt->CodeOfPred; /* for profiler */ @@ -2650,16 +2650,16 @@ Yap_absmi(int inp) ENDBOp(); NoStackCall: - PP = PREG->u.sbpp.p0; + PP = PREG->u.Osbpp.p0; /* on X86 machines S will not actually be holding the pointer to pred */ if (ActiveSignals & YAP_CREEP_SIGNAL) { - PredEntry *ap = PREG->u.sbpp.p; + PredEntry *ap = PREG->u.Osbpp.p; SREG = (CELL *) ap; goto creepc; } - SREG = (CELL *) PREG->u.sbpp.p; + SREG = (CELL *) PREG->u.Osbpp.p; if (ActiveSignals & YAP_CDOVF_SIGNAL) { - ASP = (CELL *) (((char *) YREG) + PREG->u.sbpp.s); + ASP = (CELL *) (((char *) YREG) + PREG->u.Osbpp.s); if (ASP > (CELL *)PROTECT_FROZEN_B(B)) ASP = (CELL *)PROTECT_FROZEN_B(B); goto noheapleft; @@ -2667,11 +2667,11 @@ Yap_absmi(int inp) if (ActiveSignals) { goto creepc; } - ASP = (CELL *) (((char *) YREG) + PREG->u.sbpp.s); + ASP = (CELL *) (((char *) YREG) + PREG->u.Osbpp.s); if (ASP > (CELL *)PROTECT_FROZEN_B(B)) ASP = (CELL *)PROTECT_FROZEN_B(B); saveregs(); - if (!Yap_gc(((PredEntry *)SREG)->ArityOfPE, YREG, NEXTOP(PREG, sbpp))) { + if (!Yap_gc(((PredEntry *)SREG)->ArityOfPE, YREG, NEXTOP(PREG, Osbpp))) { Yap_Error(OUT_OF_STACK_ERROR,TermNil,Yap_ErrorMessage); } setregs(); @@ -2789,14 +2789,14 @@ Yap_absmi(int inp) /* don't forget I cannot creep at ; */ NoStackEither: - PP = PREG->u.sblp.p0; + PP = PREG->u.Osblp.p0; if (ActiveSignals & YAP_CREEP_SIGNAL) { goto either_notest; } /* 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.sbpp.s); + ASP = (CELL *) (((char *) YREG) + PREG->u.Osbpp.s); if (ASP > (CELL *)PROTECT_FROZEN_B(B)) ASP = (CELL *)PROTECT_FROZEN_B(B); goto noheapleft; @@ -2804,11 +2804,11 @@ Yap_absmi(int inp) if (ActiveSignals) { goto creep_either; } - ASP = (CELL *) (((char *) YREG) + PREG->u.sbpp.s); + ASP = (CELL *) (((char *) YREG) + PREG->u.Osbpp.s); if (ASP > (CELL *)PROTECT_FROZEN_B(B)) ASP = (CELL *)PROTECT_FROZEN_B(B); saveregs(); - if (!Yap_gc(0, YREG, NEXTOP(PREG, sbpp))) { + if (!Yap_gc(0, YREG, NEXTOP(PREG, Osbpp))) { Yap_Error(OUT_OF_STACK_ERROR,TermNil,Yap_ErrorMessage); } setregs(); @@ -2816,8 +2816,8 @@ Yap_absmi(int inp) creep_either: /* do creep in either */ ENV = YREG; - CPREG = NEXTOP(PREG, sbpp); - YREG = (CELL *) (((char *) YREG) + PREG->u.sbpp.s); + CPREG = NEXTOP(PREG, Osbpp); + YREG = (CELL *) (((char *) YREG) + PREG->u.Osbpp.s); #ifdef FROZEN_STACKS { choiceptr top_b = PROTECT_FROZEN_B(B); @@ -2842,8 +2842,8 @@ Yap_absmi(int inp) creepc: /* do creep in call */ ENV = YREG; - CPREG = NEXTOP(PREG, sbpp); - YREG = (CELL *) (((char *) YREG) + PREG->u.sbpp.s); + CPREG = NEXTOP(PREG, Osbpp); + YREG = (CELL *) (((char *) YREG) + PREG->u.Osbpp.s); #ifdef FROZEN_STACKS { choiceptr top_b = PROTECT_FROZEN_B(B); @@ -7169,7 +7169,7 @@ Yap_absmi(int inp) was interrupted when waking up goals */ BOp(move_back, l); - PREG = (yamop *)(((char *)PREG)-(Int)(NEXTOP((yamop *)NULL,sbpp))); + PREG = (yamop *)(((char *)PREG)-(Int)(NEXTOP((yamop *)NULL,Osbpp))); JMPNext(); ENDBOp(); @@ -7181,7 +7181,7 @@ Yap_absmi(int inp) JMPNext(); ENDBOp(); - Op(either, sblp); + Op(either, Osblp); #ifdef LOW_LEVEL_TRACER if (Yap_do_low_level_trace) { low_level_trace(try_or, (PredEntry *)PREG, NULL); @@ -7195,7 +7195,7 @@ Yap_absmi(int inp) #endif BEGD(d0); /* Try to preserve the environment */ - d0 = PREG->u.sblp.s; + d0 = PREG->u.Osblp.s; BEGCHO(pt1); pt1 = (choiceptr) ((char *) YREG + (yslot) d0); #ifdef FROZEN_STACKS @@ -7214,7 +7214,7 @@ Yap_absmi(int inp) #endif /* FROZEN_STACKS */ pt1 = (choiceptr)(((CELL *) pt1)-1); *(CELL **) pt1 = YREG; - store_yaam_regs_for_either(PREG->u.sblp.l, PREG); + store_yaam_regs_for_either(PREG->u.Osblp.l, PREG); SREG = (CELL *) (B = pt1); #ifdef YAPOR SCH_set_load(pt1); @@ -7222,12 +7222,12 @@ Yap_absmi(int inp) SET_BB(pt1); ENDCHO(pt1); /* skip the current instruction plus the next one */ - PREG = NEXTOP(NEXTOP(PREG, sblp),l); + PREG = NEXTOP(NEXTOP(PREG, Osblp),l); GONext(); ENDD(d0); ENDOp(); - Op(or_else, sblp); + Op(or_else, Osblp); H = HBREG = PROTECT_FROZEN_H(B); ENV = B->cp_env; B->cp_cp = PREG; @@ -7237,17 +7237,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.sblp.l); + SCH_new_alternative(PREG, PREG->u.Osblp.l); } else #endif /* YAPOR */ - B->cp_ap = PREG->u.sblp.l; - PREG = NEXTOP(PREG, sblp); + B->cp_ap = PREG->u.Osblp.l; + PREG = NEXTOP(PREG, Osblp); YREG = (CELL *) B->cp_a1; GONext(); ENDOp(); #ifdef YAPOR - Op(or_last, sblp); + Op(or_last, Osblp); #else Op(or_last, p); #endif /* YAPOR */ @@ -7276,7 +7276,7 @@ Yap_absmi(int inp) HBREG = PROTECT_FROZEN_H(B); } #ifdef YAPOR - PREG = NEXTOP(PREG, sblp); + PREG = NEXTOP(PREG, Osblp); #else PREG = NEXTOP(PREG, p); #endif /* YAPOR */ @@ -7340,9 +7340,9 @@ Yap_absmi(int inp) * Call C predicates instructions * \************************************************************************/ - BOp(call_cpred, sbpp); + BOp(call_cpred, Osbpp); - if (!(PREG->u.sbpp.p->PredFlags & (SafePredFlag|HiddenPredFlag))) { + if (!(PREG->u.Osbpp.p->PredFlags & (SafePredFlag|HiddenPredFlag))) { CACHE_Y_AS_ENV(YREG); check_stack(NoStackCall, H); ENDCACHE_Y_AS_ENV(); @@ -7356,23 +7356,23 @@ Yap_absmi(int inp) #else if (YREG > (CELL *) top_b) ASP = (CELL *)top_b; #endif /* SBA */ - else ASP = (CELL *)(((char *)YREG) + PREG->u.sbpp.s); + else ASP = (CELL *)(((char *)YREG) + PREG->u.Osbpp.s); } #else if (YREG > (CELL *) B) { ASP = (CELL *) B; } else { - ASP = (CELL *) (((char *) YREG) + PREG->u.sbpp.s); + ASP = (CELL *) (((char *) YREG) + PREG->u.Osbpp.s); } /* for slots to work */ #endif /* FROZEN_STACKS */ #ifdef LOW_LEVEL_TRACER if (Yap_do_low_level_trace) - low_level_trace(enter_pred,PREG->u.sbpp.p,XREGS+1); + low_level_trace(enter_pred,PREG->u.Osbpp.p,XREGS+1); #endif /* LOW_LEVEL_TRACE */ BEGD(d0); - CPredicate f = PREG->u.sbpp.p->cs.f_code; - PREG = NEXTOP(PREG, sbpp); + CPredicate f = PREG->u.Osbpp.p->cs.f_code; + PREG = NEXTOP(PREG, Osbpp); saveregs(); d0 = (f)(); setregs(); @@ -7473,7 +7473,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, sbpp); + BOp(call_usercpred, Osbpp); CACHE_Y_AS_ENV(YREG); check_stack(NoStackCall, H); ENDCACHE_Y_AS_ENV(); @@ -7485,25 +7485,25 @@ Yap_absmi(int inp) #else if (YREG > (CELL *) top_b) ASP = (CELL *) top_b; #endif /* SBA */ - else ASP = (CELL *)(((char *)YREG) + PREG->u.sbpp.s); + else ASP = (CELL *)(((char *)YREG) + PREG->u.Osbpp.s); } #else if (YREG > (CELL *) B) ASP = (CELL *) B; else { - ASP = (CELL *) (((char *) YREG) + PREG->u.sbpp.s); + ASP = (CELL *) (((char *) YREG) + PREG->u.Osbpp.s); } /* for slots to work */ Yap_StartSlots(); Yap_PrologMode = UserCCallMode; #endif /* FROZEN_STACKS */ { - PredEntry *p = PREG->u.sbpp.p; + PredEntry *p = PREG->u.Osbpp.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, sbpp); + PREG = NEXTOP(PREG, Osbpp); saveregs(); save_machine_regs(); @@ -7560,18 +7560,18 @@ Yap_absmi(int inp) JMPNext(); ENDBOp(); - BOp(try_c, apFs); + BOp(try_c, OtapFs); #ifdef YAPOR CUT_wait_leftmost(); #endif /* YAPOR */ CACHE_Y(YREG); #ifdef CUT_C /* Alocate space for the cut_c structure*/ - CUT_C_PUSH(NEXTOP(NEXTOP(PREG,apFs),apFs),S_YREG); + CUT_C_PUSH(NEXTOP(NEXTOP(PREG,OtapFs),OtapFs),S_YREG); #endif - S_YREG = S_YREG - PREG->u.apFs.extra; - store_args(PREG->u.apFs.s); - store_yaam_regs(NEXTOP(PREG, apFs), 0); + S_YREG = S_YREG - PREG->u.OtapFs.extra; + store_args(PREG->u.OtapFs.s); + store_yaam_regs(NEXTOP(PREG, OtapFs), 0); B = B_YREG; #ifdef YAPOR SCH_set_load(B_YREG); @@ -7582,7 +7582,7 @@ Yap_absmi(int inp) TRYCC: ASP = (CELL *)B; { - CPredicate f = (CPredicate)(PREG->u.apFs.f); + CPredicate f = (CPredicate)(PREG->u.OtapFs.f); saveregs(); SREG = (CELL *) ((f) ()); /* This last instruction changes B B*/ @@ -7616,7 +7616,7 @@ Yap_absmi(int inp) JMPNext(); ENDBOp(); - BOp(retry_c, apFs); + BOp(retry_c, OtapFs); #ifdef YAPOR CUT_wait_leftmost(); #endif /* YAPOR */ @@ -7628,13 +7628,13 @@ Yap_absmi(int inp) DEPTH =B->cp_depth; #endif HBREG = H; - restore_args(PREG->u.apFs.s); + restore_args(PREG->u.OtapFs.s); ENDCACHE_Y(); goto TRYCC; ENDBOp(); #ifdef CUT_C - BOp(cut_c, apFs); + BOp(cut_c, OtapFs); /*This is a phantom instruction. This is not executed by the WAM*/ #ifdef DEBUG /*If WAM executes this instruction, probably there's an error @@ -7644,18 +7644,18 @@ Yap_absmi(int inp) ENDBOp(); #endif - BOp(try_userc, apFs); + BOp(try_userc, OtapFs); #ifdef YAPOR CUT_wait_leftmost(); #endif /* YAPOR */ CACHE_Y(YREG); #ifdef CUT_C /* Alocate space for the cut_c structure*/ - CUT_C_PUSH(NEXTOP(NEXTOP(PREG,apFs),apFs),S_YREG); + CUT_C_PUSH(NEXTOP(NEXTOP(PREG,OtapFs),OtapFs),S_YREG); #endif - S_YREG = S_YREG - PREG->u.apFs.extra; - store_args(PREG->u.apFs.s); - store_yaam_regs(NEXTOP(PREG, apFs), 0); + S_YREG = S_YREG - PREG->u.OtapFs.extra; + store_args(PREG->u.OtapFs.s); + store_yaam_regs(NEXTOP(PREG, OtapFs), 0); B = B_YREG; #ifdef YAPOR SCH_set_load(B_YREG); @@ -7668,7 +7668,7 @@ Yap_absmi(int inp) ASP = YENV; saveregs(); save_machine_regs(); - SREG = (CELL *) YAP_Execute(PREG->u.apFs.p, (CPredicate)(PREG->u.apFs.f)); + SREG = (CELL *) YAP_Execute(PREG->u.OtapFs.p, (CPredicate)(PREG->u.OtapFs.f)); EX = 0L; restore_machine_regs(); setregs(); @@ -7696,7 +7696,7 @@ Yap_absmi(int inp) JMPNext(); ENDBOp(); - BOp(retry_userc, apFs); + BOp(retry_userc, OtapFs); #ifdef YAPOR CUT_wait_leftmost(); #endif /* YAPOR */ @@ -7708,13 +7708,13 @@ Yap_absmi(int inp) DEPTH =B->cp_depth; #endif HBREG = H; - restore_args(PREG->u.apFs.s); + restore_args(PREG->u.OtapFs.s); ENDCACHE_Y(); goto TRYUSERCC; ENDBOp(); #ifdef CUT_C - BOp(cut_userc, apFs); + BOp(cut_userc, OtapFs); /*This is a phantom instruction. This is not executed by the WAM*/ #ifdef DEBUG /*If WAM executes this instruction, probably there's an error @@ -8052,13 +8052,13 @@ Yap_absmi(int inp) * Try / Retry / Trust for main indexing blocks * \************************************************************************/ - BOp(try_clause, apl); + BOp(try_clause, Otapl); check_trail(TR); CACHE_Y(YREG); /* Point AP to the code that follows this instruction */ - store_at_least_one_arg(PREG->u.apl.s); - store_yaam_regs(NEXTOP(PREG, apl), 0); - PREG = PREG->u.apl.d; + store_at_least_one_arg(PREG->u.Otapl.s); + store_yaam_regs(NEXTOP(PREG, Otapl), 0); + PREG = PREG->u.Otapl.d; set_cut(S_YREG, B); B = B_YREG; #ifdef YAPOR @@ -8135,10 +8135,10 @@ Yap_absmi(int inp) JMPNext(); ENDBOp(); - BOp(retry, apl); + BOp(retry, Otapl); CACHE_Y(B); - restore_yaam_regs(NEXTOP(PREG, apl)); - restore_at_least_one_arg(PREG->u.apl.s); + restore_yaam_regs(NEXTOP(PREG, Otapl)); + restore_at_least_one_arg(PREG->u.Otapl.s); #ifdef FROZEN_STACKS S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG); set_cut(S_YREG, B->cp_b); @@ -8147,7 +8147,7 @@ Yap_absmi(int inp) #endif /* FROZEN_STACKS */ SET_BB(B_YREG); ENDCACHE_Y(); - PREG = PREG->u.apl.d; + PREG = PREG->u.Otapl.d; JMPNext(); ENDBOp(); @@ -8205,12 +8205,12 @@ Yap_absmi(int inp) JMPNext(); ENDBOp(); - BOp(trust, apl); + BOp(trust, Otapl); CACHE_Y(B); #ifdef YAPOR if (SCH_top_shared_cp(B)) { SCH_last_alternative(PREG, B_YREG); - restore_at_least_one_arg(PREG->u.apl.s); + restore_at_least_one_arg(PREG->u.Otapl.s); #ifdef FROZEN_STACKS S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG); #endif /* FROZEN_STACKS */ @@ -8220,7 +8220,7 @@ Yap_absmi(int inp) #endif /* YAPOR */ { pop_yaam_regs(); - pop_at_least_one_arg(PREG->u.apl.s); + pop_at_least_one_arg(PREG->u.Otapl.s); #ifdef FROZEN_STACKS S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG); #endif /* FROZEN_STACKS */ @@ -8228,7 +8228,7 @@ Yap_absmi(int inp) } SET_BB(B_YREG); ENDCACHE_Y(); - PREG = PREG->u.apl.d; + PREG = PREG->u.Otapl.d; JMPNext(); ENDBOp(); @@ -8281,7 +8281,7 @@ Yap_absmi(int inp) GONext(); ENDBOp(); - BOp(try_logical, aLl); + BOp(try_logical, OtaLl); check_trail(TR); { UInt timestamp; @@ -8289,21 +8289,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.aLl.d->ClPred,timestamp,PREG->u.aLl.d->ClPred->TimeStampOfPred,PREG->u.aLl.d->ClTimeStart,PREG->u.aLl.d->ClTimeEnd);*/ + /* fprintf(stderr,"+ %p/%p %d %d %d--%u\n",PREG,PREG->u.OtaLl.d->ClPred,timestamp,PREG->u.OtaLl.d->ClPred->TimeStampOfPred,PREG->u.OtaLl.d->ClTimeStart,PREG->u.OtaLl.d->ClTimeEnd);*/ /* 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.aLl.s); - store_yaam_regs(PREG->u.aLl.n, 0); + store_args(PREG->u.OtaLl.s); + store_yaam_regs(PREG->u.OtaLl.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.aLl.d)) { + if (!VALID_TIMESTAMP(timestamp, PREG->u.OtaLl.d)) { /* jump to next alternative */ - PREG=PREG->u.aLl.n; + PREG=PREG->u.OtaLl.n; } else { - PREG = PREG->u.aLl.d->ClCode; + PREG = PREG->u.OtaLl.d->ClCode; } SET_BB(B_YREG); ENDCACHE_Y(); @@ -8311,7 +8311,7 @@ Yap_absmi(int inp) JMPNext(); ENDBOp(); - BOp(retry_logical, aLl); + BOp(retry_logical, OtaLl); check_trail(TR); { UInt timestamp; @@ -8319,20 +8319,20 @@ Yap_absmi(int inp) #if defined(YAPOR) || defined(THREADS) if (!PP) { - PP = PREG->u.aLl.d->ClPred; + PP = PREG->u.OtaLl.d->ClPred; LOCK(PP->PELock); } #endif - 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)) { + timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[PREG->u.OtaLl.s]); + /* fprintf(stderr,"^ %p/%p %d %d %d--%u\n",PREG,PREG->u.OtaLl.d->ClPred,timestamp,PREG->u.OtaLl.d->ClPred->TimeStampOfPred,PREG->u.OtaLl.d->ClTimeStart,PREG->u.OtaLl.d->ClTimeEnd);*/ + if (!VALID_TIMESTAMP(timestamp, PREG->u.OtaLl.d)) { /* jump to next instruction */ - PREG=PREG->u.aLl.n; + PREG=PREG->u.OtaLl.n; JMPNext(); } - restore_yaam_regs(PREG->u.aLl.n); - restore_at_least_one_arg(PREG->u.aLl.s); - PREG = PREG->u.aLl.d->ClCode; + restore_yaam_regs(PREG->u.OtaLl.n); + restore_at_least_one_arg(PREG->u.OtaLl.s); + PREG = PREG->u.OtaLl.d->ClCode; #ifdef FROZEN_STACKS S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG); set_cut(S_YREG, B->cp_b); @@ -8345,15 +8345,15 @@ Yap_absmi(int inp) JMPNext(); ENDBOp(); - BOp(trust_logical, ILl); + BOp(trust_logical, OtILl); CACHE_Y(B); { - LogUpdIndex *cl = PREG->u.ILl.block; + LogUpdIndex *cl = PREG->u.OtILl.block; PredEntry *ap = cl->ClPred; - LogUpdClause *lcl = PREG->u.ILl.d; + LogUpdClause *lcl = PREG->u.OtILl.d; UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]); - /* fprintf(stderr,"- %p/%p %d %d %p\n",PREG,ap,timestamp,ap->TimeStampOfPred,PREG->u.ILl.d->ClCode);*/ + /* fprintf(stderr,"- %p/%p %d %d %p\n",PREG,ap,timestamp,ap->TimeStampOfPred,PREG->u.OtILl.d->ClCode);*/ #if defined(YAPOR) || defined(THREADS) if (!PP) { LOCK(ap->PELock); @@ -12180,7 +12180,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),sbpp),l); + PREG = NEXTOP(NEXTOP(NEXTOP(PREG, xxx),Osbpp),l); GONext(); } else if ((Int)d1 > 0) { @@ -12203,7 +12203,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),sbpp))) { + if (!Yap_gcl((1+d1)*sizeof(CELL), 0, YREG, NEXTOP(NEXTOP(PREG,xxx),Osbpp))) { Yap_Error(OUT_OF_STACK_ERROR,TermNil,Yap_ErrorMessage); setregs(); JMPNext(); @@ -12222,11 +12222,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),sbpp),l); + PREG = NEXTOP(NEXTOP(NEXTOP(PREG, xxx),Osbpp),l); GONext(); } else if ((Int)d1 == 0) { XREG(PREG->u.xxx.x) = d0; - PREG = NEXTOP(NEXTOP(NEXTOP(PREG, xxx),sbpp),l); + PREG = NEXTOP(NEXTOP(NEXTOP(PREG, xxx),Osbpp),l); GONext(); } else { saveregs(); @@ -12294,7 +12294,7 @@ Yap_absmi(int inp) /* else if arity is 0 just pass d0 through */ /* Ding, ding, we made it */ XREG(PREG->u.xxn.x) = d0; - PREG = NEXTOP(NEXTOP(NEXTOP(PREG, xxn),sbpp),l); + PREG = NEXTOP(NEXTOP(NEXTOP(PREG, xxn),Osbpp),l); GONext(); } else if ((Int)d1 > 0) { /* now let's build a compound term */ @@ -12316,7 +12316,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,xxn),sbpp))) { + if (!Yap_gcl((1+d1)*sizeof(CELL), 0, YREG, NEXTOP(NEXTOP(PREG,xxn),Osbpp))) { Yap_Error(OUT_OF_STACK_ERROR,TermNil,Yap_ErrorMessage); setregs(); JMPNext(); @@ -12335,11 +12335,11 @@ Yap_absmi(int inp) /* else if arity is 0 just pass d0 through */ /* Ding, ding, we made it */ XREG(PREG->u.xxn.x) = d0; - PREG = NEXTOP(NEXTOP(NEXTOP(PREG, xxn),sbpp),l); + PREG = NEXTOP(NEXTOP(NEXTOP(PREG, xxn),Osbpp),l); GONext(); } else if (d1 == 0) { XREG(PREG->u.xxn.x) = d0; - PREG = NEXTOP(NEXTOP(NEXTOP(PREG, xxn),sbpp),l); + PREG = NEXTOP(NEXTOP(NEXTOP(PREG, xxn),Osbpp),l); GONext(); } else { saveregs(); @@ -12399,13 +12399,13 @@ Yap_absmi(int inp) /* else if arity is 0 just pass d0 through */ /* Ding, ding, we made it */ XREG(PREG->u.xxn.x) = d0; - PREG = NEXTOP(NEXTOP(NEXTOP(PREG, xxn),sbpp),l); + PREG = NEXTOP(NEXTOP(NEXTOP(PREG, xxn),Osbpp),l); GONext(); } /* now let's build a compound term */ if (d1 == 0) { XREG(PREG->u.xxn.x) = d0; - PREG = NEXTOP(NEXTOP(NEXTOP(PREG, xxn),sbpp),l); + PREG = NEXTOP(NEXTOP(NEXTOP(PREG, xxn),Osbpp),l); GONext(); } if (!IsAtomTerm(d0)) { @@ -12426,7 +12426,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,xxn),sbpp))) { + if (!Yap_gc(0, YREG, NEXTOP(NEXTOP(PREG,xxn),Osbpp))) { Yap_Error(OUT_OF_STACK_ERROR,TermNil,Yap_ErrorMessage); setregs(); JMPNext(); @@ -12446,7 +12446,7 @@ Yap_absmi(int inp) /* else if arity is 0 just pass d0 through */ /* Ding, ding, we made it */ XREG(PREG->u.xxn.x) = d0; - PREG = NEXTOP(NEXTOP(NEXTOP(PREG, xxn),sbpp),l); + PREG = NEXTOP(NEXTOP(NEXTOP(PREG, xxn),Osbpp),l); GONext(); BEGP(pt1); @@ -12505,7 +12505,7 @@ Yap_absmi(int inp) H += 2; BEGP(pt1); pt1 = YREG + PREG->u.yxx.y; - PREG = NEXTOP(NEXTOP(NEXTOP(PREG, yxx),sbpp),l); + PREG = NEXTOP(NEXTOP(NEXTOP(PREG, yxx),Osbpp),l); #if defined(SBA) && defined(FROZEN_STACKS) Bind_Local(pt1,d0); #else @@ -12533,7 +12533,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),sbpp))) { + if (!Yap_gcl((1+d1)*sizeof(CELL), 0, YREG, NEXTOP(NEXTOP(PREG,yxx),Osbpp))) { Yap_Error(OUT_OF_STACK_ERROR,TermNil,Yap_ErrorMessage); setregs(); JMPNext(); @@ -12553,7 +12553,7 @@ Yap_absmi(int inp) /* Ding, ding, we made it */ BEGP(pt1); pt1 = YREG + PREG->u.yxx.y; - PREG = NEXTOP(NEXTOP(NEXTOP(PREG, yxx),sbpp),l); + PREG = NEXTOP(NEXTOP(NEXTOP(PREG, yxx),Osbpp),l); #if defined(SBA) && defined(FROZEN_STACKS) Bind_Local(pt1,d0); #else @@ -12564,7 +12564,7 @@ Yap_absmi(int inp) } else if (d1 == 0) { BEGP(pt1); pt1 = YREG + PREG->u.yxx.y; - PREG = NEXTOP(NEXTOP(NEXTOP(PREG, yxx),sbpp),l); + PREG = NEXTOP(NEXTOP(NEXTOP(PREG, yxx),Osbpp),l); #if defined(SBA) && defined(FROZEN_STACKS) Bind_Local(pt1,d0); #else @@ -12639,7 +12639,7 @@ Yap_absmi(int inp) /* Ding, ding, we made it */ BEGP(pt1); pt1 = YREG + PREG->u.yxn.y; - PREG = NEXTOP(NEXTOP(NEXTOP(PREG, yxn),sbpp),l); + PREG = NEXTOP(NEXTOP(NEXTOP(PREG, yxn),Osbpp),l); #if defined(SBA) && defined(FROZEN_STACKS) Bind_Local(pt1,d0); #else @@ -12668,7 +12668,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,yxn),sbpp))) { + if (!Yap_gcl((1+d1)*sizeof(CELL), 0, YREG, NEXTOP(NEXTOP(PREG,yxn),Osbpp))) { Yap_Error(OUT_OF_STACK_ERROR,TermNil,Yap_ErrorMessage); setregs(); JMPNext(); @@ -12688,7 +12688,7 @@ Yap_absmi(int inp) /* Ding, ding, we made it */ BEGP(pt1); pt1 = YREG + PREG->u.yxn.y; - PREG = NEXTOP(NEXTOP(NEXTOP(PREG, yxn),sbpp),l); + PREG = NEXTOP(NEXTOP(NEXTOP(PREG, yxn),Osbpp),l); #if defined(SBA) && defined(FROZEN_STACKS) Bind_Local(pt1,d0); #else @@ -12699,7 +12699,7 @@ Yap_absmi(int inp) } else if (d1 == 0) { BEGP(pt1); pt1 = YREG + PREG->u.yxn.y; - PREG = NEXTOP(NEXTOP(NEXTOP(PREG, yxn),sbpp),l); + PREG = NEXTOP(NEXTOP(NEXTOP(PREG, yxn),Osbpp),l); #if defined(SBA) && defined(FROZEN_STACKS) Bind_Local(pt1,d0); #else @@ -12766,7 +12766,7 @@ Yap_absmi(int inp) /* Ding, ding, we made it */ BEGP(pt1); pt1 = YREG + PREG->u.yxn.y; - PREG = NEXTOP(NEXTOP(NEXTOP(PREG, yxn),sbpp),l); + PREG = NEXTOP(NEXTOP(NEXTOP(PREG, yxn),Osbpp),l); #if defined(SBA) && defined(FROZEN_STACKS) Bind_Local(pt1,d0); #else @@ -12778,7 +12778,7 @@ Yap_absmi(int inp) if (d1 == 0) { BEGP(pt1); pt1 = YREG + PREG->u.yxn.y; - PREG = NEXTOP(NEXTOP(NEXTOP(PREG, yxn),sbpp),l); + PREG = NEXTOP(NEXTOP(NEXTOP(PREG, yxn),Osbpp),l); #if defined(SBA) && defined(FROZEN_STACKS) Bind_Local(pt1,d0); #else @@ -12812,7 +12812,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,yxn),sbpp))) { + if (!Yap_gcl((1+d1)*sizeof(CELL), 0, YREG, NEXTOP(NEXTOP(PREG,yxn),Osbpp))) { Yap_Error(OUT_OF_STACK_ERROR,TermNil,Yap_ErrorMessage); setregs(); JMPNext(); @@ -12832,7 +12832,7 @@ Yap_absmi(int inp) /* Ding, ding, we made it */ BEGP(pt1); pt1 = YREG + PREG->u.yxn.y; - PREG = NEXTOP(NEXTOP(NEXTOP(PREG, yxn),sbpp),l); + PREG = NEXTOP(NEXTOP(NEXTOP(PREG, yxn),Osbpp),l); #if defined(SBA) && defined(FROZEN_STACKS) Bind_Local(pt1,d0); #else @@ -13126,13 +13126,13 @@ Yap_absmi(int inp) FAIL(); } /* Done */ - PREG = NEXTOP(NEXTOP(NEXTOP(PREG, e),sbmp),l); + PREG = NEXTOP(NEXTOP(NEXTOP(PREG, e),Osbmp),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),sbmp),l); + PREG = NEXTOP(NEXTOP(NEXTOP(PREG, e),Osbmp),l); BIND(pt0, d0, bind_func_nvar3_var); /* Done */ #ifdef COROUTINING @@ -13202,7 +13202,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),sbmp))) { + if (!Yap_gcl((1+d1)*sizeof(CELL), 3, YREG, NEXTOP(NEXTOP(PREG,e),Osbmp))) { Yap_Error(OUT_OF_STACK_ERROR,TermNil,Yap_ErrorMessage); setregs(); JMPNext(); @@ -13226,7 +13226,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),sbpp),l); + PREG = NEXTOP(NEXTOP(NEXTOP(PREG, e),Osbpp),l); BIND(pt0, d0, bind_func_var_3nvar); #ifdef COROUTINING DO_TRAIL(pt0, d0); @@ -13258,7 +13258,7 @@ Yap_absmi(int inp) ENDD(d0); ENDOp(); - BOp(p_execute2, sbpp); + BOp(p_execute2, Osbpp); { PredEntry *pen; Term mod = ARG2; @@ -13272,7 +13272,7 @@ Yap_absmi(int inp) } CACHE_Y_AS_ENV(YREG); /* Try to preserve the environment */ - ENV_YREG = (CELL *) (((char *) YREG) + PREG->u.sbpp.s); + ENV_YREG = (CELL *) (((char *) YREG) + PREG->u.Osbpp.s); #ifdef FROZEN_STACKS { choiceptr top_b = PROTECT_FROZEN_B(B); @@ -13328,7 +13328,7 @@ Yap_absmi(int inp) } else { goto execute2_metacall; } - ENV_YREG[E_CP] = (CELL)NEXTOP(PREG,sbpp); + ENV_YREG[E_CP] = (CELL)NEXTOP(PREG,Osbpp); ENV_YREG[E_CB] = (CELL)B; ENV_YREG[E_E] = (CELL)ENV; #ifdef DEPTH_LIMIT @@ -13390,7 +13390,7 @@ Yap_absmi(int inp) #ifndef NO_CHECKING check_stack(NoStackPExecute2, H); #endif - CPREG = NEXTOP(PREG, sbpp); + CPREG = NEXTOP(PREG, Osbpp); ALWAYS_LOOKAHEAD(pen->OpcodeOfPred); PREG = pen->CodeOfPred; /* for profiler */ @@ -13444,7 +13444,7 @@ Yap_absmi(int inp) goto creep_pe; } saveregs_and_ycache(); - if (!Yap_gc(((PredEntry *)SREG)->ArityOfPE, ENV, NEXTOP(PREG, sbpp))) { + if (!Yap_gc(((PredEntry *)SREG)->ArityOfPE, ENV, NEXTOP(PREG, Osbpp))) { Yap_Error(OUT_OF_STACK_ERROR,TermNil,Yap_ErrorMessage); } setregs_and_ycache(); @@ -13462,14 +13462,14 @@ Yap_absmi(int inp) } ENDBOp(); - BOp(p_execute, sbmp); + BOp(p_execute, Osbmp); { PredEntry *pen; - Term mod = PREG->u.sbmp.mod; + Term mod = PREG->u.Osbmp.mod; CACHE_Y_AS_ENV(YREG); /* Try to preserve the environment */ - ENV_YREG = (CELL *) (((char *) YREG) + PREG->u.sbmp.s); + ENV_YREG = (CELL *) (((char *) YREG) + PREG->u.Osbmp.s); #ifdef FROZEN_STACKS { choiceptr top_b = PROTECT_FROZEN_B(B); @@ -13525,7 +13525,7 @@ Yap_absmi(int inp) } else { goto execute_metacall; } - ENV_YREG[E_CP] = (CELL)NEXTOP(PREG,sbmp); + ENV_YREG[E_CP] = (CELL)NEXTOP(PREG,Osbmp); ENV_YREG[E_CB] = (CELL)B; ENV_YREG[E_E] = (CELL)ENV; #ifdef DEPTH_LIMIT @@ -13587,7 +13587,7 @@ Yap_absmi(int inp) #ifndef NO_CHECKING check_stack(NoStackPExecute, H); #endif - CPREG = NEXTOP(PREG, sbmp); + CPREG = NEXTOP(PREG, Osbmp); ALWAYS_LOOKAHEAD(pen->OpcodeOfPred); PREG = pen->CodeOfPred; /* for profiler */ @@ -13641,7 +13641,7 @@ Yap_absmi(int inp) goto creep_pe; } saveregs_and_ycache(); - if (!Yap_gc(((PredEntry *)SREG)->ArityOfPE, ENV, NEXTOP(PREG, sbmp))) { + if (!Yap_gc(((PredEntry *)SREG)->ArityOfPE, ENV, NEXTOP(PREG, Osbmp))) { Yap_Error(OUT_OF_STACK_ERROR,TermNil,Yap_ErrorMessage); } setregs_and_ycache(); @@ -13651,10 +13651,10 @@ Yap_absmi(int inp) ENDBOp(); creep_pe: /* do creep in call */ - CPREG = NEXTOP(PREG, sbmp); + CPREG = NEXTOP(PREG, Osbmp); goto creep; - BOp(p_execute_tail, sbpp); + BOp(p_execute_tail, Osbpp); { PredEntry *pen; Term mod; @@ -13727,7 +13727,7 @@ Yap_absmi(int inp) ENV = ENV_YREG; ENV_YREG -= EnvSizeInCells+3; d0 = SREG[1]; - CPREG = NEXTOP(COMMA_CODE,sbpp); + CPREG = NEXTOP(COMMA_CODE,Osbpp); execute_comma_comma2: /* create an to execute the call */ deref_head(d0, execute_comma_comma2_unk); @@ -13953,7 +13953,7 @@ Yap_absmi(int inp) } UNLOCK(SignalLock); saveregs(); - if (!Yap_gc(((PredEntry *)SREG)->ArityOfPE, ENV, NEXTOP(PREG, sbpp))) { + if (!Yap_gc(((PredEntry *)SREG)->ArityOfPE, ENV, NEXTOP(PREG, Osbpp))) { Yap_Error(OUT_OF_STACK_ERROR,TermNil,Yap_ErrorMessage); } setregs(); diff --git a/C/agc.c b/C/agc.c index 7763ad468..a61fdbb39 100644 --- a/C/agc.c +++ b/C/agc.c @@ -115,6 +115,8 @@ AtomAdjust(Atom a) #define CharP(X) ((char *)(X)) +#define OrArgAdjust(P) +#define TabEntryAdjust(P) #define IntegerAdjust(D) (D) #define AddrAdjust(P) (P) #define MFileAdjust(P) (P) diff --git a/C/amasm.c b/C/amasm.c index 45d16d51b..f3c5be297 100644 --- a/C/amasm.c +++ b/C/amasm.c @@ -1296,22 +1296,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.sbpp.s = emit_count(-Signed(RealEnvSize) - CELLSIZE + code_p->u.Osbpp.s = emit_count(-Signed(RealEnvSize) - CELLSIZE * (cip->cpc->rnd2)); if (RepPredProp(fe)->FunctorOfPred != FunctorExecuteInMod) { - code_p->u.sbpp.p = RepPredProp(fe); + code_p->u.Osbpp.p = RepPredProp(fe); } else { - code_p->u.sbmp.mod = cip->cpc->rnd4; + code_p->u.Osbmp.mod = cip->cpc->rnd4; } - code_p->u.sbpp.p0 = clinfo->CurrentPred; + code_p->u.Osbpp.p0 = clinfo->CurrentPred; if (cip->cpc->rnd2) { - code_p->u.sbpp.bmap = emit_bmlabel(cip->cpc->arnds[1], cip); + code_p->u.Osbpp.bmap = emit_bmlabel(cip->cpc->arnds[1], cip); } else { /* there is no bitmap as there are no variables in the environment */ - code_p->u.sbpp.bmap = NULL; + code_p->u.Osbpp.bmap = NULL; } } - GONEXT(sbpp); + GONEXT(Osbpp); } return code_p; } @@ -1331,17 +1331,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.sbpp.s = emit_count(-Signed(RealEnvSize) - CELLSIZE * + code_p->u.Osbpp.s = emit_count(-Signed(RealEnvSize) - CELLSIZE * cip->cpc->rnd2); - code_p->u.sbpp.p = RepPredProp(fe); - code_p->u.sbpp.p0 = clinfo->CurrentPred; + code_p->u.Osbpp.p = RepPredProp(fe); + code_p->u.Osbpp.p0 = clinfo->CurrentPred; if (cip->cpc->rnd2) - code_p->u.sbpp.bmap = emit_bmlabel(cip->cpc->arnds[1], cip); + code_p->u.Osbpp.bmap = emit_bmlabel(cip->cpc->arnds[1], cip); else /* there is no bitmap as there are no variables in the environment */ - code_p->u.sbpp.bmap = NULL; + code_p->u.Osbpp.bmap = NULL; } - GONEXT(sbpp); + GONEXT(Osbpp); } else if (opcode == _execute || opcode == _dexecute) { @@ -1382,17 +1382,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.sbpp.s = emit_count(-Signed(RealEnvSize) - CELLSIZE * + code_p->u.Osbpp.s = emit_count(-Signed(RealEnvSize) - CELLSIZE * cip->cpc->rnd2); - code_p->u.sbpp.p = pe; - code_p->u.sbpp.p0 = clinfo->CurrentPred; + code_p->u.Osbpp.p = pe; + code_p->u.Osbpp.p0 = clinfo->CurrentPred; if (cip->cpc->rnd2) - code_p->u.sbpp.bmap = emit_bmlabel(cip->cpc->rnd1, cip); + code_p->u.Osbpp.bmap = emit_bmlabel(cip->cpc->rnd1, cip); else /* there is no bitmap as there are no variables in the environment */ - code_p->u.sbpp.bmap = NULL; + code_p->u.Osbpp.bmap = NULL; } - GONEXT(sbpp); + GONEXT(Osbpp); return code_p; } @@ -1828,7 +1828,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,aLl); + UInt size = (UInt)NEXTOP((yamop *)NULL,OtaLl); if ((newcp = (yamop *)Yap_AllocCodeSpace(size)) == NULL) { /* OOOPS, got in trouble, must do a longjmp and recover space */ save_machine_regs(); @@ -1845,15 +1845,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.aLl.n = cip->try_instructions; + newcp->u.OtaLl.n = cip->try_instructions; cip->try_instructions = newcp; } else { - newcp->u.aLl.n = *cip->current_try_lab; + newcp->u.OtaLl.n = *cip->current_try_lab; *cip->current_try_lab = newcp; } if (opcode == _try_clause) { newcp->opc = emit_op(_try_logical); - newcp->u.aLl.s = emit_count(opr); + newcp->u.OtaLl.s = emit_count(opr); } else if (opcode == _retry) { if (ap->PredFlags & CountPredFlag) newcp->opc = emit_op(_count_retry_logical); @@ -1861,7 +1861,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.aLl.s = emit_count(opr); + newcp->u.OtaLl.s = emit_count(opr); } else { if (ap->PredFlags & CountPredFlag) newcp->opc = emit_op(_count_trust_logical); @@ -1869,11 +1869,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.ILl.block = (LogUpdIndex *)(cip->code_addr); + newcp->u.OtILl.block = (LogUpdIndex *)(cip->code_addr); *cip->current_trust_lab = newcp; } - newcp->u.aLl.d = ClauseCodeToLogUpdClause(emit_a(lab)); - cip->current_try_lab = &(newcp->u.aLl.n); + newcp->u.OtaLl.d = ClauseCodeToLogUpdClause(emit_a(lab)); + cip->current_try_lab = &(newcp->u.OtaLl.n); } return code_p; } @@ -1929,11 +1929,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.apl.d = emit_a(lab); - code_p->u.apl.s = emit_count(opr); - code_p->u.apl.p = ap; + code_p->u.Otapl.d = emit_a(lab); + code_p->u.Otapl.s = emit_count(opr); + code_p->u.Otapl.p = ap; #ifdef TABLING - code_p->u.apl.te = ap->TableOfPred; + code_p->u.Otapl.te = ap->TableOfPred; #endif #ifdef YAPOR INIT_YAMOP_LTT(code_p, nofalts); @@ -1943,7 +1943,7 @@ a_try(op_numbers opcode, CELL lab, CELL opr, int nofalts, int hascut, yamop *cod PUT_YAMOP_SEQ(code_p); #endif /* YAPOR */ } - GONEXT(apl); + GONEXT(Otapl); return code_p; } @@ -1956,9 +1956,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.sblp.s = emit_count(opr); - code_p->u.sblp.l = emit_a(lab); - code_p->u.sblp.p0 = cip->CurrentPred; + code_p->u.Osblp.s = emit_count(opr); + code_p->u.Osblp.l = emit_a(lab); + code_p->u.Osblp.p0 = cip->CurrentPred; #ifdef YAPOR INIT_YAMOP_LTT(code_p, nofalts); if (hascut) @@ -1966,13 +1966,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.sblp.bmap = emit_bmlabel(cip->cpc->arnds[1], cip); + code_p->u.Osblp.bmap = emit_bmlabel(cip->cpc->arnds[1], cip); } #else - code_p->u.sblp.bmap = emit_bmlabel(cip->cpc->arnds[1], cip); + code_p->u.Osblp.bmap = emit_bmlabel(cip->cpc->arnds[1], cip); #endif /* YAPOR */ } - GONEXT(sblp); + GONEXT(Osblp); return code_p; } @@ -2858,7 +2858,7 @@ do_pass(int pass_no, yamop **entry_codep, int assembling, int *clause_has_blobsp *entry_codep = code_p; if (tabled) { #if TABLING - code_p = a_try(_table_try_single, (CELL)NEXTOP(code_p,apl), IPredArity, code_p, pass_no, cip); + code_p = a_try(_table_try_single, (CELL)NEXTOP(code_p,Otapl), IPredArity, code_p, pass_no, cip); #endif } if (dynamic) { @@ -3597,7 +3597,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),apl),sbpp),e); + (CELL)NEXTOP(NEXTOP(NEXTOP((yamop *)(((DynamicClause *)NULL)->ClCode),Otapl ),Osbpp),e); } if ((CELL)code_p > size) size = (CELL)code_p; @@ -3670,28 +3670,28 @@ Yap_InitComma(void) { yamop *code_p = COMMA_CODE; code_p->opc = opcode(_call); - code_p->u.sbpp.s = emit_count(-Signed(RealEnvSize) - sizeof(CELL) * 3); - code_p->u.sbpp.p = - code_p->u.sbpp.p0 = + code_p->u.Osbpp.s = emit_count(-Signed(RealEnvSize) - sizeof(CELL) * 3); + code_p->u.Osbpp.p = + code_p->u.Osbpp.p0 = RepPredProp(PredPropByFunc(FunctorComma,0)); - code_p->u.sbpp.bmap = NULL; - GONEXT(sbpp); + code_p->u.Osbpp.bmap = NULL; + GONEXT(Osbpp); 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.sbpp.s = emit_count(-Signed(RealEnvSize)); - code_p->u.sbpp.p = - code_p->u.sbpp.p0 = + code_p->u.Osbpp.s = emit_count(-Signed(RealEnvSize)); + code_p->u.Osbpp.p = + code_p->u.Osbpp.p0 = RepPredProp(Yap_GetPredPropByFunc(fp,0)); - code_p->u.sbpp.bmap = NULL; - GONEXT(sbpp); + code_p->u.Osbpp.bmap = NULL; + GONEXT(Osbpp); code_p->opc = emit_op(_call); - code_p->u.sbpp.s = emit_count(-Signed(RealEnvSize)); - code_p->u.sbpp.p = - code_p->u.sbpp.p0 = + code_p->u.Osbpp.s = emit_count(-Signed(RealEnvSize)); + code_p->u.Osbpp.p = + code_p->u.Osbpp.p0 = PredMetaCall; - code_p->u.sbpp.bmap = NULL; - GONEXT(sbpp); + code_p->u.Osbpp.bmap = NULL; + GONEXT(Osbpp); code_p->opc = emit_op(_deallocate); code_p->u.p.p = PredMetaCall; GONEXT(p); @@ -3708,11 +3708,11 @@ Yap_InitComma(void) GONEXT(e); } code_p->opc = opcode(_p_execute_tail); - 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 = + code_p->u.Osbpp.s = emit_count(-Signed(RealEnvSize)-3*sizeof(CELL)); + code_p->u.Osbpp.bmap = NULL; + code_p->u.Osbpp.p = + code_p->u.Osbpp.p0 = RepPredProp(PredPropByFunc(FunctorComma,0)); - GONEXT(sbpp); + GONEXT(Osbpp); } } diff --git a/C/c_interface.c b/C/c_interface.c index 22e841691..885197e30 100644 --- a/C/c_interface.c +++ b/C/c_interface.c @@ -515,8 +515,8 @@ dogc(void) { UInt arity; - if (P && PREVOP(P,sbpp)->opc == Yap_opcode(_call_usercpred)) { - arity = PREVOP(P,sbpp)->u.sbpp.p->ArityOfPE; + if (P && PREVOP(P,Osbpp)->opc == Yap_opcode(_call_usercpred)) { + arity = PREVOP(P,Osbpp)->u.Osbpp.p->ArityOfPE; } else { arity = 0; } @@ -531,8 +531,8 @@ doexpand(UInt sz) { UInt arity; - if (P && PREVOP(P,sbpp)->opc == Yap_opcode(_call_usercpred)) { - arity = PREVOP(P,sbpp)->u.sbpp.p->ArityOfPE; + if (P && PREVOP(P,Osbpp)->opc == Yap_opcode(_call_usercpred)) { + arity = PREVOP(P,Osbpp)->u.Osbpp.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.apFs.extra)); + ptr = (void *)(((CELL *)(Yap_REGS.CUT_C_TOP))-(((yamop *)Yap_REGS.CUT_C_TOP->try_userc_cut_yamop)->u.OtapFs.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.apFs.s); + ptr = (void *)((CELL *)(B+1)+P->u.OtapFs.s); B->cp_h = H; RECOVER_H(); diff --git a/C/cdmgr.c b/C/cdmgr.c index a5f2bc3cb..8fbb8db72 100644 --- a/C/cdmgr.c +++ b/C/cdmgr.c @@ -549,7 +549,7 @@ PredForChoicePt(yamop *p_code) { break; case _retry_me: case _trust_me: - return p_code->u.apl.p; + return p_code->u.Otapl.p; case _try_logical: case _retry_logical: case _trust_logical: @@ -557,7 +557,7 @@ PredForChoicePt(yamop *p_code) { case _count_trust_logical: case _profiled_retry_logical: case _profiled_trust_logical: - return p_code->u.aLl.d->ClPred; + return p_code->u.OtaLl.d->ClPred; #ifdef TABLING case _trie_retry_null: case _trie_trust_null: @@ -586,17 +586,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.sblp.l) { + if (p_code == p_code->u.Osblp.l) { /* repeat */ Atom at = Yap_LookupAtom("repeat "); return RepPredProp(PredPropByAtom(at, PROLOG_MODULE)); } else { - return p_code->u.sblp.p0; + return p_code->u.Osblp.p0; } break; case _or_last: #ifdef YAPOR - return p_code->u.sblp.p0; + return p_code->u.Osblp.p0; #else return p_code->u.p.p; #endif /* YAPOR */ @@ -609,7 +609,7 @@ PredForChoicePt(yamop *p_code) { p_code = NEXTOP(p_code,l); break; default: - return p_code->u.apl.p; + return p_code->u.Otapl.p; } } return NULL; @@ -708,6 +708,8 @@ get_pred(Term t, Term tmod, char *pname) ******************************************************************/ +#define OrArgAdjust(P) +#define TabEntryAdjust(P) #define DoubleInCodeAdjust(D) #define IntegerInCodeAdjust(D) #define IntegerAdjust(D) (D) @@ -1113,8 +1115,8 @@ cleanup_dangling_indices(yamop *ipc, yamop *beg, yamop *end, yamop *suspend_code break; case _retry: case _trust: - decrease_ref_counter(ipc->u.apl.d, beg, end, suspend_code); - ipc = NEXTOP(ipc,apl); + decrease_ref_counter(ipc->u.Otapl.d, beg, end, suspend_code); + ipc = NEXTOP(ipc,Otapl); break; case _try_clause: case _try_me: @@ -1122,7 +1124,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,apl); + ipc = NEXTOP(ipc,Otapl); break; case _try_logical: case _retry_logical: @@ -1130,9 +1132,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.aLl.d->ClCode, beg, end, suspend_code); - ipc = ipc->u.aLl.n; - Yap_LUIndexSpace_CP -= (UInt)NEXTOP((yamop *)NULL,aLl); + decrease_ref_counter(ipc->u.OtaLl.d->ClCode, beg, end, suspend_code); + ipc = ipc->u.OtaLl.n; + Yap_LUIndexSpace_CP -= (UInt)NEXTOP((yamop *)NULL,OtaLl); Yap_FreeCodeSpace((ADDR)oipc); #ifdef DEBUG Yap_DirtyCps--; @@ -1147,8 +1149,8 @@ cleanup_dangling_indices(yamop *ipc, yamop *beg, yamop *end, yamop *suspend_code Yap_DirtyCps--; Yap_FreedCps++; #endif - decrease_ref_counter(ipc->u.ILl.d->ClCode, beg, end, suspend_code); - Yap_LUIndexSpace_CP -= (UInt)NEXTOP((yamop *)NULL,ILl); + decrease_ref_counter(ipc->u.OtILl.d->ClCode, beg, end, suspend_code); + Yap_LUIndexSpace_CP -= (UInt)NEXTOP((yamop *)NULL,OtILl); Yap_FreeCodeSpace((ADDR)ipc); return; case _enter_lu_pred: @@ -1666,12 +1668,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,apl),e),l)); + (DynamicClause *) Yap_AllocCodeSpace((Int)NEXTOP(NEXTOP(NEXTOP(ncp,Otapl),e),l)); if (cl == NIL) { Yap_Error(OUT_OF_HEAP_ERROR,TermNil,"Heap crashed against Stacks"); return; } - Yap_ClauseSpace += (Int)NEXTOP(NEXTOP(NEXTOP(ncp,apl),e),l); + Yap_ClauseSpace += (Int)NEXTOP(NEXTOP(NEXTOP(ncp,Otapl),e),l); /* skip the first entry, this contains the back link and will always be empty for this entry */ ncp = (yamop *)(((CELL *)ncp)+1); @@ -1687,9 +1689,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.apl.s = p->ArityOfPE; - ncp->u.apl.p = p; - ncp->u.apl.d = cp; + ncp->u.Otapl.s = p->ArityOfPE; + ncp->u.Otapl.p = p; + ncp->u.Otapl.d = cp; /* This is the point we enter the code */ p->cs.p_code.TrueCodeOfPred = p->CodeOfPred = ncp; p->cs.p_code.NOfClauses = 1; @@ -1708,9 +1710,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.apl.s = p->ArityOfPE; - cp->u.apl.p = p; - cp->u.apl.d = ncp; + cp->u.Otapl.s = p->ArityOfPE; + cp->u.Otapl.p = p; + cp->u.Otapl.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 @@ -1718,7 +1720,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,apl); + ncp = NEXTOP(ncp,Otapl); /* 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); @@ -1770,7 +1772,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.apl.d = q; + p->cs.p_code.LastClause->u.Otapl.d = q; } /* p is already locked */ @@ -1786,22 +1788,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.apl.d = p->cs.p_code.FirstClause; - q->u.apl.s = p->ArityOfPE; - q->u.apl.p = p; + q->u.Otapl.d = p->cs.p_code.FirstClause; + q->u.Otapl.s = p->ArityOfPE; + q->u.Otapl.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.apl.s = p->ArityOfPE; - cp->u.apl.p = p; + cp->u.Otapl.s = p->ArityOfPE; + cp->u.Otapl.p = p; p->cs.p_code.FirstClause = cp; q = p->CodeOfPred; - q->u.apl.d = cp; - q->u.apl.s = p->ArityOfPE; - q->u.apl.p = p; + q->u.Otapl.d = cp; + q->u.Otapl.s = p->ArityOfPE; + q->u.Otapl.p = p; } @@ -1859,7 +1861,7 @@ assertz_dynam_clause(PredEntry *p, yamop *cp) q = p->cs.p_code.LastClause; LOCK(ClauseCodeToDynamicClause(q)->ClLock); - q->u.apl.d = cp; + q->u.Otapl.d = cp; p->cs.p_code.LastClause = cp; /* also, keep backpointers for the days we'll delete all the clause */ cl->ClPrevious = q; @@ -1872,9 +1874,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.apl.d = p->CodeOfPred; - q->u.apl.s = p->ArityOfPE; - q->u.apl.p = p; + q->u.Otapl.d = p->CodeOfPred; + q->u.Otapl.s = p->ArityOfPE; + q->u.Otapl.p = p; p->cs.p_code.NOfClauses++; } @@ -3231,16 +3233,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.apl.d); + b_ptr->cp_ap = cur_log_upd_clause(pe, b_ptr->cp_ap->u.Otapl.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.apl.d); + b_ptr->cp_ap = cur_clause(pe, b_ptr->cp_ap->u.Otapl.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.apl.d); + b_ptr->cp_ap = cur_clause(pe, b_ptr->cp_ap->u.Otapl.d); } } } @@ -3826,19 +3828,19 @@ ClauseInfoForCode(yamop *codeptr, CODEADDR *startp, CODEADDR *endp) { case _table_answer_resolution: case _table_completion: #endif /* TABLING */ - pc = NEXTOP(pc, apl); + pc = NEXTOP(pc, Otapl); break; case _try_logical: case _retry_logical: case _count_retry_logical: case _profiled_retry_logical: - pc = pc->u.aLl.n; + pc = pc->u.OtaLl.n; break; case _trust_logical: case _count_trust_logical: case _profiled_trust_logical: { - LogUpdIndex *cl = pc->u.ILl.block; + LogUpdIndex *cl = pc->u.OtILl.block; pp = cl->ClPred; *startp = (CODEADDR)cl; *endp = (CODEADDR)cl+cl->ClSize; @@ -4041,7 +4043,7 @@ ClauseInfoForCode(yamop *codeptr, CODEADDR *startp, CODEADDR *endp) { case _p_cut_by_y: pc = NEXTOP(pc,yl); break; - /* instructions type sbpp or sbmp */ + /* instructions type Osbpp or Osbmp */ case _p_execute_tail: case _p_execute: case _p_execute2: @@ -4056,21 +4058,21 @@ ClauseInfoForCode(yamop *codeptr, CODEADDR *startp, CODEADDR *endp) { case _or_last: #endif clause_code = TRUE; - pp = pc->u.sbpp.p; - pc = NEXTOP(pc,sbpp); + pp = pc->u.Osbpp.p; + pc = NEXTOP(pc,Osbpp); break; - /* instructions type sbpp, but for disjunctions */ + /* instructions type Osbpp, but for disjunctions */ case _either: case _or_else: clause_code = TRUE; - pp = pc->u.sblp.p0; - pc = NEXTOP(pc,sblp); + pp = pc->u.Osblp.p0; + pc = NEXTOP(pc,Osblp); break; case _call_cpred: case _call_usercpred: clause_code = TRUE; - pp = pc->u.sbpp.p0; - pc = NEXTOP(pc,sbpp); + pp = pc->u.Osbpp.p0; + pc = NEXTOP(pc,Osbpp); break; /* instructions type xx */ case _get_x_var: @@ -4278,14 +4280,14 @@ ClauseInfoForCode(yamop *codeptr, CODEADDR *startp, CODEADDR *endp) { pp = pc->u.sdlp.p; pc = NEXTOP(pc,sdlp); break; - /* instructions type apFs */ + /* instructions type OtapFs */ case _try_c: case _try_userc: case _retry_c: case _retry_userc: clause_code = TRUE; - pp = pc->u.apFs.p; - pc = NEXTOP(pc,apFs); + pp = pc->u.OtapFs.p; + pc = NEXTOP(pc,OtapFs); break; #ifdef CUT_C case _cut_c: @@ -4938,7 +4940,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,apl), cp_ptr); + cl = Yap_FollowIndexingCode(pe, i_code, Terms, NEXTOP(PredLogUpdClause->CodeOfPred,Otapl), cp_ptr); th = Terms[0]; tb = Terms[1]; tr = Terms[2]; @@ -5079,7 +5081,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,apl), cp_ptr); + cl = Yap_FollowIndexingCode(pe, i_code, Terms, NEXTOP(PredLogUpdClauseErase->CodeOfPred,Otapl), cp_ptr); th = Terms[0]; tb = Terms[1]; tr = Terms[2]; @@ -5223,7 +5225,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,apl), cp_ptr); + cl = Yap_FollowIndexingCode(pe, i_code, Terms, NEXTOP(PredLogUpdClause0->CodeOfPred,Otapl), cp_ptr); th = Terms[0]; tb = Terms[1]; /* don't do this!! I might have stored a choice-point and changed ASP @@ -5372,9 +5374,9 @@ void /* $hidden_predicate(P) */ Yap_UpdateTimestamps(PredEntry *ap) { choiceptr bptr = B; - yamop *cl0 = NEXTOP(PredLogUpdClause0->CodeOfPred,apl); - yamop *cl = NEXTOP(PredLogUpdClause->CodeOfPred,apl); - yamop *cle = NEXTOP(PredLogUpdClauseErase->CodeOfPred,apl); + yamop *cl0 = NEXTOP(PredLogUpdClause0->CodeOfPred,Otapl); + yamop *cl = NEXTOP(PredLogUpdClause->CodeOfPred,Otapl); + yamop *cle = NEXTOP(PredLogUpdClauseErase->CodeOfPred,Otapl); UInt ar = ap->ArityOfPE; UInt *arp, *top, *base; LogUpdClause *lcl; @@ -5398,7 +5400,7 @@ Yap_UpdateTimestamps(PredEntry *ap) case _trust_logical: case _count_trust_logical: case _profiled_trust_logical: - if (bptr->cp_ap->u.aLl.d->ClPred == ap) { + if (bptr->cp_ap->u.OtaLl.d->ClPred == ap) { UInt ts = IntegerOfTerm(bptr->cp_args[ar]); if (ts != arp[0]) { if (arp-H < 1024) { @@ -5462,7 +5464,7 @@ Yap_UpdateTimestamps(PredEntry *ap) case _trust_logical: case _count_trust_logical: case _profiled_trust_logical: - if (bptr->cp_ap->u.aLl.d->ClPred == ap) { + if (bptr->cp_ap->u.OtaLl.d->ClPred == ap) { UInt ts = IntegerOfTerm(bptr->cp_args[ar]); while (ts != arp[0]) arp--; @@ -5504,7 +5506,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,apl), cp_ptr); + cl = (StaticClause *)Yap_FollowIndexingCode(pe, i_code, Terms, NEXTOP(PredStaticClause->CodeOfPred,Otapl), cp_ptr); UNLOCK(pe->PELock); th = Terms[0]; tb = Terms[1]; @@ -6026,7 +6028,7 @@ p_env_info(void) env_b = MkIntegerTerm((Int)(LCL0-(CELL *)env[E_CB])); env_cp = (yamop *)env[E_CP]; - pe = PREVOP(env_cp,sbpp)->u.sbpp.p0; + pe = PREVOP(env_cp,Osbpp)->u.Osbpp.p0; taddr = MkIntegerTerm((Int)env); return Yap_unify(ARG3,MkIntegerTerm((Int)env_cp)) && Yap_unify(ARG2, taddr) && @@ -6039,7 +6041,7 @@ p_cpc_info(void) PredEntry *pe; yamop *ipc = (yamop *)IntegerOfTerm(Deref(ARG1)); - pe = PREVOP(ipc,sbpp)->u.sbpp.p0; + pe = PREVOP(ipc,Osbpp)->u.Osbpp.p0; return UnifyPredInfo(pe, 2) && Yap_unify(ARG5,MkIntegerTerm(ClauseId(ipc,pe))); } @@ -6119,12 +6121,12 @@ p_choicepoint_info(void) case _count_trust_logical: case _profiled_retry_logical: case _profiled_trust_logical: - ncl = ipc->u.aLl.d->ClCode; - pe = ipc->u.aLl.d->ClPred; + ncl = ipc->u.OtaLl.d->ClCode; + pe = ipc->u.OtaLl.d->ClPred; t = BuildActivePred(pe, cptr->cp_args); break; case _or_else: - pe = ipc->u.sblp.p0; + pe = ipc->u.Osblp.p0; ncl = ipc; t = Yap_MkNewApplTerm(FunctorOr, 2); break; @@ -6140,7 +6142,7 @@ p_choicepoint_info(void) t = TermNil; ipc = NEXTOP(ipc,l); if (!ncl) - ncl = ipc->u.apl.d; + ncl = ipc->u.Otapl.d; go_on = TRUE; break; case _jump: @@ -6151,15 +6153,15 @@ p_choicepoint_info(void) break; case _retry_c: case _retry_userc: - ncl = NEXTOP(ipc,apFs); - pe = ipc->u.apFs.p; + ncl = NEXTOP(ipc,OtapFs); + pe = ipc->u.OtapFs.p; t = BuildActivePred(pe, cptr->cp_args); break; case _retry_profiled: case _count_retry: pe = NULL; t = TermNil; - ncl = ipc->u.apl.d; + ncl = ipc->u.Otapl.d; ipc = NEXTOP(ipc,p); go_on = TRUE; break; @@ -6174,8 +6176,8 @@ p_choicepoint_info(void) case _retry: case _trust: if (!ncl) - ncl = ipc->u.apl.d; - pe = ipc->u.apl.p; + ncl = ipc->u.Otapl.d; + pe = ipc->u.Otapl.p; t = BuildActivePred(pe, cptr->cp_args); break; case _Nstop: diff --git a/C/dbase.c b/C/dbase.c index 681652042..5483ee6af 100644 --- a/C/dbase.c +++ b/C/dbase.c @@ -3700,12 +3700,12 @@ index_sz(LogUpdIndex *x) endop = Yap_opcode(_trust_logical); start = start->u.Ills.l1; do { - sz += (UInt)NEXTOP((yamop*)NULL,aLl); + sz += (UInt)NEXTOP((yamop*)NULL,OtaLl); op1 = start->opc; count++; - if (start->u.aLl.d->ClFlags & ErasedMask) + if (start->u.OtaLl.d->ClFlags & ErasedMask) dead++; - start = start->u.aLl.n; + start = start->u.OtaLl.n; } while (op1 != endop); } x = x->ChildIndex; @@ -3991,7 +3991,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,sbpp)))->u.sbpp.bmap); + DBRef ref = (DBRef)(((yamop *)((CODEADDR)P-(CELL)NEXTOP((yamop *)NULL,Osbpp)))->u.Osbpp.bmap); yamop *newp = find_next_clause(ref); if (newp == NULL) { @@ -4000,7 +4000,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,apl); + P = NEXTOP(newp,Otapl); /* and return like if nothing had happened. */ return TRUE; } @@ -4147,20 +4147,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,apl)->u.sbpp.bmap; + ref = (DBRef) NEXTOP(clau->ClCode,Otapl)->u.Osbpp.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.apl.d = find_next_clause((DBRef)(NEXTOP(P,apl)->u.sbpp.bmap)); - if (np->u.apl.d == NULL) + np->u.Otapl.d = find_next_clause((DBRef)(NEXTOP(P,Otapl)->u.Osbpp.bmap)); + if (np->u.Otapl.d == NULL) P = (yamop *)FAILCODE; else { /* with same arity as before */ - np->u.apl.s = P->u.apl.s; - np->u.apl.p = P->u.apl.p; + np->u.Otapl.s = P->u.Otapl.s; + np->u.Otapl.p = P->u.Otapl.p; /* go ahead and try this code */ P = np; } @@ -4210,7 +4210,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.apl.d = code_p->u.apl.d; + prev_code_p->u.Otapl.d = code_p->u.Otapl.d; /* are we the last? */ if (p->cs.p_code.LastClause == cl) p->cs.p_code.LastClause = prev_code_p; @@ -4219,7 +4219,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.apl.d; + p->cs.p_code.FirstClause = code_p->u.Otapl.d; p->cs.p_code.FirstClause->opc = Yap_opcode(_try_me); } @@ -4234,8 +4234,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.apl.d = p->cs.p_code.FirstClause; - p->cs.p_code.TrueCodeOfPred = NEXTOP(code_p, apl); + code_p->u.Otapl.d = p->cs.p_code.FirstClause; + p->cs.p_code.TrueCodeOfPred = NEXTOP(code_p, Otapl); if (p->PredFlags & SpiedPredFlag) { p->OpcodeOfPred = Yap_opcode(_spy_pred); p->CodeOfPred = (yamop *)(&(p->OpcodeOfPred)); @@ -5447,9 +5447,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,apFs); + RETRY_C_RECORDED_K_CODE = NEXTOP(PredRecordedWithKey->cs.p_code.FirstClause,OtapFs); 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,apFs); + RETRY_C_RECORDEDP_CODE = NEXTOP(RepPredProp(PredPropByFunc(Yap_MkFunctor(Yap_LookupAtom("$recordedp"), 3),0))->cs.p_code.FirstClause,OtapFs); 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 df08d2526..0a7a1b1bf 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.sbpp.p->cs.f_code); + printf("Aqui está um call_cpred(%p) \n",y->u.Osbpp.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,sbpp)->opc); + op_numbers oop = Yap_op_from_opcode(PREVOP(P,Osbpp)->opc); if (oop == _call_cpred || oop == _call_usercpred) { /* doing C-code */ - current_p = PREVOP(P,sbpp)->u.sbpp.p->CodeOfPred; + current_p = PREVOP(P,Osbpp)->u.Osbpp.p->CodeOfPred; } else { current_p = P; } diff --git a/C/heapgc.c b/C/heapgc.c index 4c50c6b1c..5de3b61cb 100644 --- a/C/heapgc.c +++ b/C/heapgc.c @@ -1861,10 +1861,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,apl), - *lu_cl = NEXTOP(PredLogUpdClause->CodeOfPred,apl), - *lu_cle = NEXTOP(PredLogUpdClauseErase->CodeOfPred,apl), - *su_cl = NEXTOP(PredStaticClause->CodeOfPred,apl); + yamop *lu_cl0 = NEXTOP(PredLogUpdClause0->CodeOfPred,Otapl), + *lu_cl = NEXTOP(PredLogUpdClause->CodeOfPred,Otapl), + *lu_cle = NEXTOP(PredLogUpdClauseErase->CodeOfPred,Otapl), + *su_cl = NEXTOP(PredStaticClause->CodeOfPred,Otapl); #ifdef TABLING dep_fr_ptr depfr = LOCAL_top_dep_fr; #endif /* TABLING */ @@ -1933,8 +1933,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), - -gc_B->cp_cp->u.sblp.s / ((OPREG)sizeof(CELL)), - gc_B->cp_cp->u.sblp.bmap + -gc_B->cp_cp->u.Osblp.s / ((OPREG)sizeof(CELL)), + gc_B->cp_cp->u.Osblp.bmap ); } else { /* choicepoint with arguments */ @@ -1982,7 +1982,7 @@ mark_choicepoints(register choiceptr gc_B, tr_fr_ptr saved_TR, int very_verbose) } B = old_b; } - nargs = rtp->u.apFs.s+rtp->u.apFs.extra; + nargs = rtp->u.OtapFs.s+rtp->u.OtapFs.extra; break; case _jump: rtp = rtp->u.l.l; @@ -2019,7 +2019,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.apl.s; + nargs = rtp->u.Otapl.s; while (nargs--) { mark_external_reference(vars_ptr); vars_ptr++; @@ -2135,20 +2135,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.aLl.n; + yamop *end = rtp->u.OtaLl.n; while (end->opc != trust_lu) - end = end->u.aLl.n; - mark_ref_in_use((DBRef)end->u.ILl.block); + end = end->u.OtaLl.n; + mark_ref_in_use((DBRef)end->u.OtILl.block); } /* mark timestamp */ - nargs = rtp->u.aLl.s+1; + nargs = rtp->u.OtaLl.s+1; break; case _trust_logical: case _count_trust_logical: case _profiled_trust_logical: /* mark timestamp */ - mark_ref_in_use((DBRef)rtp->u.ILl.block); - nargs = rtp->u.ILl.d->ClPred->ArityOfPE+1; + mark_ref_in_use((DBRef)rtp->u.OtILl.block); + nargs = rtp->u.OtILl.d->ClPred->ArityOfPE+1; break; #ifdef DEBUG case _retry_me: @@ -2159,14 +2159,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.apl.s; + nargs = rtp->u.Otapl.s; break; default: fprintf(Yap_stderr, "OOps in GC: Unexpected opcode: %d\n", opnum); nargs = 0; #else default: - nargs = rtp->u.apl.s; + nargs = rtp->u.Otapl.s; #endif } @@ -2180,8 +2180,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.aLl.n; - mark_ref_in_use((DBRef)pt->u.ILl.block); + pt = pt->u.OtaLl.n; + mark_ref_in_use((DBRef)pt->u.OtILl.block); } } /* for each saved register */ @@ -2791,8 +2791,8 @@ sweep_choicepoints(choiceptr gc_B) case _or_last: sweep_environments((CELL_PTR)(gc_B->cp_a1), - -gc_B->cp_cp->u.sblp.s / ((OPREG)sizeof(CELL)), - gc_B->cp_cp->u.sblp.bmap + -gc_B->cp_cp->u.Osblp.s / ((OPREG)sizeof(CELL)), + gc_B->cp_cp->u.Osblp.bmap ); break; case _retry_profiled: @@ -2835,7 +2835,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.apl.s; + nargs = rtp->u.Otapl.s; while(nargs--) { CELL cp_cell = *vars_ptr; if (MARKED_PTR(vars_ptr)) { @@ -2981,12 +2981,12 @@ sweep_choicepoints(choiceptr gc_B) case _count_retry_logical: case _profiled_retry_logical: /* sweep timestamp */ - sweep_b(gc_B, rtp->u.aLl.s+1); + sweep_b(gc_B, rtp->u.OtaLl.s+1); break; case _trust_logical: case _count_trust_logical: case _profiled_trust_logical: - sweep_b(gc_B, rtp->u.ILl.d->ClPred->ArityOfPE+1); + sweep_b(gc_B, rtp->u.OtILl.d->ClPred->ArityOfPE+1); break; case _retry2: sweep_b(gc_B, 2); @@ -3003,8 +3003,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.apFs.s; - saved_reg < &(gc_B->cp_a1)+rtp->u.apFs.s+rtp->u.apFs.extra; + for (saved_reg = &(gc_B->cp_a1)+rtp->u.OtapFs.s; + saved_reg < &(gc_B->cp_a1)+rtp->u.OtapFs.s+rtp->u.OtapFs.extra; saved_reg++) { CELL cp_cell = *saved_reg; if (MARKED_PTR(saved_reg)) { @@ -3017,7 +3017,7 @@ sweep_choicepoints(choiceptr gc_B) } /* continue to clean environments and arguments */ default: - sweep_b(gc_B,rtp->u.apl.s); + sweep_b(gc_B,rtp->u.Otapl.s); } /* link to prev choicepoint */ diff --git a/C/index.c b/C/index.c index 3b56d1cf4..2a5768a7b 100644 --- a/C/index.c +++ b/C/index.c @@ -936,7 +936,7 @@ has_cut(yamop *pc) case _table_answer_resolution: case _table_completion: #endif /* TABLING */ - pc = NEXTOP(pc,apl); + pc = NEXTOP(pc,Otapl); break; /* instructions type Ills */ case _enter_lu_pred: @@ -1319,17 +1319,17 @@ has_cut(yamop *pc) case _try_userc: pc = NEXTOP(pc,lds); break; - /* instructions type aLl,ILl */ + /* instructions type OtaLl,OtILl */ case _try_logical: case _retry_logical: case _count_retry_logical: case _profiled_retry_logical: - pc = pc->u.aLl.n; + pc = pc->u.OtaLl.n; break; case _trust_logical: case _count_trust_logical: case _profiled_trust_logical: - pc = pc->u.ILl.n; + pc = pc->u.OtILl.n; break; case _retry_c: case _retry_userc: @@ -2455,7 +2455,7 @@ add_info(ClauseDef *clause, UInt regno) #endif /* YAPOR */ #ifdef TABLING case _table_try_single: - cl = NEXTOP(cl,apl); + cl = NEXTOP(cl,Otapl); break; case _table_load_answer: case _table_try_answer: @@ -3438,7 +3438,7 @@ emit_trust(ClauseDef *cl, struct intermediates *cint, UInt nxtlbl, int clauses) yamop *clcode = cl->Code; if (ap->PredFlags & TabledPredFlag) - clcode = NEXTOP(clcode,apl); + clcode = NEXTOP(clcode,Otapl); if (!(ap->PredFlags & LogUpdatePredFlag)) { /* this should not be generated for logical update predicates!! */ if (ap->PredFlags & ProfiledPredFlag) { @@ -3463,7 +3463,7 @@ emit_retry(ClauseDef *cl, struct intermediates *cint, int clauses) yamop *clcode = cl->Code; if (ap->PredFlags & TabledPredFlag) - clcode = NEXTOP(clcode,apl); + clcode = NEXTOP(clcode,Otapl); if (!(ap->PredFlags & LogUpdatePredFlag)) { /* this should not be generated for logical update predicates!! */ if (ap->PredFlags & ProfiledPredFlag) { @@ -3516,7 +3516,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,apl); + clcode = NEXTOP(cl->Code,Otapl); } else { clcode = cl->CurrentCode; } @@ -3851,7 +3851,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,apl); + return (UInt)NEXTOP(min->CurrentCode,Otapl); } } #endif /* TABLING */ @@ -5299,23 +5299,23 @@ expand_index(struct intermediates *cint) { case _retry: /* this clause had no indexing */ if (ap->PredFlags & LogUpdatePredFlag) { - first = ClauseCodeToLogUpdClause(ipc->u.apl.d)->ClNext->ClCode; + first = ClauseCodeToLogUpdClause(ipc->u.Otapl.d)->ClNext->ClCode; } else if (ap->PredFlags & MegaClausePredFlag) { MegaClause *mcl = ClauseCodeToMegaClause(ap->cs.p_code.FirstClause); - first = (yamop *)((char *)ipc->u.apl.d)+mcl->ClItemSize; + first = (yamop *)((char *)ipc->u.Otapl.d)+mcl->ClItemSize; } else { - first = ClauseCodeToStaticClause(ipc->u.apl.d)->ClNext->ClCode; + first = ClauseCodeToStaticClause(ipc->u.Otapl.d)->ClNext->ClCode; } isfirstcl = FALSE; - ipc = NEXTOP(ipc,apl); + ipc = NEXTOP(ipc,Otapl); break; #if TABLING case _table_try: case _table_retry: /* this clause had no indexing */ - first = ClauseCodeToStaticClause(PREVOP(ipc->u.apl.d,apl))->ClNext->ClCode; + first = ClauseCodeToStaticClause(PREVOP(ipc->u.Otapl.d,Otapl))->ClNext->ClCode; isfirstcl = FALSE; - ipc = NEXTOP(ipc,apl); + ipc = NEXTOP(ipc,Otapl); break; #endif /* TABLING */ case _try_clause2: @@ -5329,7 +5329,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.apl.d)+mcl->ClItemSize; + first = (yamop *)((char *)ipc->u.Otapl.d)+mcl->ClItemSize; } else { first = ClauseCodeToStaticClause(ipc->u.l.l)->ClNext->ClCode; } @@ -5348,8 +5348,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.apl.d; - ipc = NEXTOP(ipc,apl); + alt = ipc->u.Otapl.d; + ipc = NEXTOP(ipc,Otapl); /* start of a group, reset stack */ sp = stack; stack[0].pos = 0; @@ -5361,7 +5361,7 @@ expand_index(struct intermediates *cint) { case _table_trust_me: #endif /* TABLING */ /* we will commit to this group for sure */ - ipc = NEXTOP(ipc,apl); + ipc = NEXTOP(ipc,Otapl); alt = NULL; /* start of a group, reset stack */ sp = stack; @@ -5378,12 +5378,12 @@ expand_index(struct intermediates *cint) { case _retry_logical: case _count_retry_logical: case _profiled_retry_logical: - ipc = ipc->u.aLl.n; + ipc = ipc->u.OtaLl.n; break; case _trust_logical: case _count_trust_logical: case _profiled_trust_logical: - ipc = ipc->u.ILl.n; + ipc = ipc->u.OtILl.n; break; case _enter_lu_pred: /* no useful info */ @@ -5626,7 +5626,7 @@ expand_index(struct intermediates *cint) { ipc = NULL; } else { /* backtrack */ - first = alt->u.apl.d; + first = alt->u.Otapl.d; ipc = alt; alt = NULL; } @@ -5660,15 +5660,15 @@ expand_index(struct intermediates *cint) { if (op >= _retry2 && op <= _retry4) { last = alt->u.l.l; } else { - last = alt->u.apl.d; + last = alt->u.Otapl.d; } } else { op_numbers op = Yap_op_from_opcode(alt->opc); if (op == _retry || op == _trust) { - last = alt->u.apl.d; + last = alt->u.Otapl.d; #ifdef TABLING } else if (op == _table_retry || op == _table_trust) { - last = PREVOP(alt->u.apl.d,apl); + last = PREVOP(alt->u.Otapl.d,Otapl); #endif /* TABLING */ } else if (op >= _retry2 && op <= _retry4) { last = alt->u.l.l; @@ -6338,10 +6338,10 @@ kill_block(path_stack_entry *sp, PredEntry *ap) static LogUpdClause * find_last_clause(yamop *start) { - while (start->u.aLl.d->ClFlags & ErasedMask) - start = start->u.aLl.n; + while (start->u.OtaLl.d->ClFlags & ErasedMask) + start = start->u.OtaLl.n; /* this should be the available clause */ - return start->u.aLl.d; + return start->u.OtaLl.d; } static void @@ -6350,31 +6350,31 @@ remove_clause_from_index(yamop *header, LogUpdClause *cl) yamop **prevp = &(header->u.Ills.l1); yamop *curp = header->u.Ills.l1; - if (curp->u.aLl.d == cl) { - yamop *newp = curp->u.aLl.n; + if (curp->u.OtaLl.d == cl) { + yamop *newp = curp->u.OtaLl.n; newp->opc = curp->opc; *prevp = newp; } else { yamop *ocurp = NULL, *ocurp0 = curp; - while (curp->u.aLl.d != cl) { + while (curp->u.OtaLl.d != cl) { ocurp = curp; - curp = curp->u.aLl.n; + curp = curp->u.OtaLl.n; } /* in case we were the last */ if (curp == header->u.Ills.l2) header->u.Ills.l2 = ocurp; if (ocurp != ocurp0) ocurp->opc = curp->opc; - ocurp->u.ILl.n = curp->u.aLl.n; - ocurp->u.ILl.block = curp->u.ILl.block; + ocurp->u.OtILl.n = curp->u.OtaLl.n; + ocurp->u.OtILl.block = curp->u.OtILl.block; } #ifdef DEBUG Yap_DirtyCps--; Yap_FreedCps++; #endif clean_ref_to_clause(cl); - Yap_LUIndexSpace_CP -= (UInt)NEXTOP((yamop*)NULL,ILl); + Yap_LUIndexSpace_CP -= (UInt)NEXTOP((yamop*)NULL,OtILl); Yap_FreeCodeSpace((ADDR)curp); } @@ -6386,13 +6386,13 @@ remove_dirty_clauses_from_index(yamop *header) OPCODE endop = Yap_opcode(_trust_logical); yamop **prevp= &(header->u.Ills.l1), *curp = header->u.Ills.l1; OPCODE startopc = curp->opc; - PredEntry *ap = curp->u.aLl.d->ClPred; + PredEntry *ap = curp->u.OtaLl.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.aLl.d)->ClFlags & ErasedMask) { + while ((cl = curp->u.OtaLl.d)->ClFlags & ErasedMask) { yamop *ocurp = curp; #ifdef DEBUG @@ -6400,7 +6400,7 @@ remove_dirty_clauses_from_index(yamop *header) Yap_FreedCps++; #endif clean_ref_to_clause(cl); - curp = curp->u.aLl.n; + curp = curp->u.OtaLl.n; Yap_FreeCodeSpace((ADDR)ocurp); } *prevp = curp; @@ -6408,9 +6408,9 @@ remove_dirty_clauses_from_index(yamop *header) if (curp->opc == endop) return; previouscurp = curp; - curp = curp->u.aLl.n; + curp = curp->u.OtaLl.n; while (TRUE) { - if ((cl = curp->u.aLl.d)->ClFlags & ErasedMask) { + if ((cl = curp->u.OtaLl.d)->ClFlags & ErasedMask) { yamop *ocurp = curp; #ifdef DEBUG @@ -6420,24 +6420,24 @@ remove_dirty_clauses_from_index(yamop *header) clean_ref_to_clause(cl); if (curp->opc == endop) { previouscurp->opc = endop; - previouscurp->u.ILl.block = curp->u.ILl.block; - previouscurp->u.ILl.n = NULL; + previouscurp->u.OtILl.block = curp->u.OtILl.block; + previouscurp->u.OtILl.n = NULL; header->u.Ills.l2 = previouscurp; - Yap_LUIndexSpace_CP -= (UInt)NEXTOP((yamop*)NULL,ILl); + Yap_LUIndexSpace_CP -= (UInt)NEXTOP((yamop*)NULL,OtILl); Yap_FreeCodeSpace((ADDR)curp); return; } - previouscurp->u.aLl.n = curp->u.aLl.n; - curp = curp->u.aLl.n; - Yap_LUIndexSpace_CP -= (UInt)NEXTOP((yamop*)NULL,aLl); + previouscurp->u.OtaLl.n = curp->u.OtaLl.n; + curp = curp->u.OtaLl.n; + Yap_LUIndexSpace_CP -= (UInt)NEXTOP((yamop*)NULL,OtaLl); Yap_FreeCodeSpace((ADDR)ocurp); } else { previouscurp = curp; if (curp->opc == endop) { - curp->u.ILl.n = NULL; + curp->u.OtILl.n = NULL; return; } - curp = curp->u.aLl.n; + curp = curp->u.OtaLl.n; } } } @@ -6551,7 +6551,7 @@ static_clause(yamop *ipc, PredEntry *ap, int trust) if (ap->PredFlags & MegaClausePredFlag) return (StaticClause *)ipc; if (ap->PredFlags & TabledPredFlag) - ipc = PREVOP(ipc,apl); + ipc = PREVOP(ipc,Otapl); p = (CELL *)ipc; if (trust) { return ClauseCodeToStaticClause(p); @@ -6769,7 +6769,7 @@ static yamop * add_try(PredEntry *ap, ClauseDef *cls, yamop *next, struct intermediates *cint) { yamop *newcp; - UInt size = (UInt)NEXTOP((yamop *)NULL,aLl); + UInt size = (UInt)NEXTOP((yamop *)NULL,OtaLl); LogUpdClause *lcl = ClauseCodeToLogUpdClause(cls->Code); if ((newcp = (yamop *)Yap_AllocCodeSpace(size)) == NULL) { @@ -6783,9 +6783,9 @@ add_try(PredEntry *ap, ClauseDef *cls, yamop *next, struct intermediates *cint) Yap_LiveCps++; #endif newcp->opc = Yap_opcode(_try_logical); - newcp->u.aLl.s = ap->ArityOfPE; - newcp->u.aLl.n = next; - newcp->u.aLl.d = lcl; + newcp->u.OtaLl.s = ap->ArityOfPE; + newcp->u.OtaLl.n = next; + newcp->u.OtaLl.d = lcl; lcl->ClRefCount++; return newcp; } @@ -6794,7 +6794,7 @@ static yamop * add_trust(LogUpdIndex *icl, ClauseDef *cls, struct intermediates *cint) { yamop *newcp; - UInt size = (UInt)NEXTOP((yamop *)NULL,ILl); + UInt size = (UInt)NEXTOP((yamop *)NULL,OtILl); LogUpdClause *lcl = ClauseCodeToLogUpdClause(cls->Code); PredEntry *ap = lcl->ClPred; @@ -6814,9 +6814,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.ILl.block = icl; - newcp->u.ILl.n = NULL; - newcp->u.ILl.d = lcl; + newcp->u.OtILl.block = icl; + newcp->u.OtILl.n = NULL; + newcp->u.OtILl.d = lcl; lcl->ClRefCount++; return newcp; } @@ -6870,8 +6870,8 @@ 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.aLl.n = end; - old->u.aLl.s = ap->ArityOfPE; + old->u.OtaLl.n = end; + old->u.OtaLl.s = ap->ArityOfPE; ipc->u.Ills.l2 = end; } ipc = pop_path(&sp, cls, ap); @@ -6885,7 +6885,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,apl); + ipc = NEXTOP(ipc,Otapl); } break; case _try_clause2: @@ -6904,7 +6904,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,apl); + ipc = NEXTOP(ipc,Otapl); break; case _retry2: case _retry3: @@ -6916,26 +6916,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.apl.d; + ipc = ipc->u.Otapl.d; break; case _try_me: if (first) { - ipc = NEXTOP(ipc,apl); - alt = ipc->u.apl.d; + ipc = NEXTOP(ipc,Otapl); + alt = ipc->u.Otapl.d; } else { - ipc = ipc->u.apl.d; + ipc = ipc->u.Otapl.d; group1 = FALSE; } break; case _retry_profiled: case _count_retry: - ipc = NEXTOP(ipc,apl); + ipc = NEXTOP(ipc,Otapl); break; case _profiled_trust_me: case _trust_me: case _count_trust_me: group1 = FALSE; - ipc = NEXTOP(ipc,apl); + ipc = NEXTOP(ipc,Otapl); break; case _trust: sp = expandz_block(sp, ap, cls, group1, alt, cint); @@ -7436,12 +7436,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.apl.d,lt)) { + if (IN_BETWEEN(bg,ipc->u.Otapl.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,apl); + ipc = NEXTOP(ipc,Otapl); } break; case _try_clause2: @@ -7462,7 +7462,7 @@ remove_from_index(PredEntry *ap, path_stack_entry *sp, ClauseDef *cls, yamop *bg } break; case _trust: - if (IN_BETWEEN(bg,ipc->u.apl.d,lt)) { + if (IN_BETWEEN(bg,ipc->u.Otapl.d,lt)) { sp = kill_clause(ipc, bg, lt, sp, ap); } ipc = pop_path(&sp, cls, ap); @@ -7479,13 +7479,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.apl.d), cls, cint); - ipc = NEXTOP(ipc,apl); + sp = push_path(sp, &(ipc->u.Otapl.d), cls, cint); + ipc = NEXTOP(ipc,Otapl); break; case _profiled_trust_me: case _trust_me: case _count_trust_me: - ipc = NEXTOP(ipc,apl); + ipc = NEXTOP(ipc,Otapl); break; case _jump: sp = cross_block(sp, &ipc->u.l.l, ap); @@ -7952,16 +7952,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,apl), ap, ap_pc, cp_pc); + store_clause_choice_point(Terms[0], Terms[1], Terms[2], NEXTOP(ipc,Otapl), ap, ap_pc, cp_pc); else { B = b0; b0 = NULL; - update_clause_choice_point(NEXTOP(ipc,apl), ap_pc); + update_clause_choice_point(NEXTOP(ipc,Otapl), ap_pc); } if (lu_pred) - return lu_clause(ipc->u.apl.d, ap); + return lu_clause(ipc->u.Otapl.d, ap); else - return (LogUpdClause *)static_clause(ipc->u.apl.d, ap, unbounded); + return (LogUpdClause *)static_clause(ipc->u.Otapl.d, ap, unbounded); case _try_clause2: case _try_clause3: case _try_clause4: @@ -7981,13 +7981,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.apl.d, ap, ap_pc, cp_pc); + store_clause_choice_point(Terms[0], Terms[1], Terms[2], ipc->u.Otapl.d, ap, ap_pc, cp_pc); else { B = b0; b0 = NULL; - update_clause_choice_point(ipc->u.apl.d, ap_pc); + update_clause_choice_point(ipc->u.Otapl.d, ap_pc); } - ipc = NEXTOP(ipc,apl); + ipc = NEXTOP(ipc,Otapl); break; case _retry_profiled: case _count_retry: @@ -7997,11 +7997,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,apl),ap_pc); + update_clause_choice_point(NEXTOP(ipc,Otapl),ap_pc); if (lu_pred) - return lu_clause(ipc->u.apl.d, ap); + return lu_clause(ipc->u.Otapl.d, ap); else - return (LogUpdClause *)static_clause(ipc->u.apl.d, ap, TRUE); + return (LogUpdClause *)static_clause(ipc->u.Otapl.d, ap, TRUE); case _retry2: case _retry3: case _retry4: @@ -8011,8 +8011,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.apl.d,ap_pc); - ipc = NEXTOP(ipc,apl); + update_clause_choice_point(ipc->u.Otapl.d,ap_pc); + ipc = NEXTOP(ipc,Otapl); break; case _trust: #if TABLING @@ -8038,9 +8038,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.apl.d, ap); + return lu_clause(ipc->u.Otapl.d, ap); else - return (LogUpdClause *)static_clause(ipc->u.apl.d, ap, TRUE); + return (LogUpdClause *)static_clause(ipc->u.Otapl.d, ap, TRUE); case _profiled_trust_me: case _trust_me: case _count_trust_me: @@ -8066,7 +8066,7 @@ Yap_FollowIndexingCode(PredEntry *ap, yamop *ipc, Term Terms[3], yamop *ap_pc, y #else B = B->cp_b; #endif /* YAPOR */ - ipc = NEXTOP(ipc,apl); + ipc = NEXTOP(ipc,Otapl); break; case _enter_lu_pred: { @@ -8101,48 +8101,48 @@ Yap_FollowIndexingCode(PredEntry *ap, yamop *ipc, Term Terms[3], yamop *ap_pc, y break; case _try_logical: if (b0 == NULL) - store_clause_choice_point(Terms[0], Terms[1], Terms[2], ipc->u.aLl.n, ap, ap_pc, cp_pc); + store_clause_choice_point(Terms[0], Terms[1], Terms[2], ipc->u.OtaLl.n, ap, ap_pc, cp_pc); else { B = b0; b0 = NULL; - update_clause_choice_point(ipc->u.aLl.n, ap_pc); + update_clause_choice_point(ipc->u.OtaLl.n, ap_pc); } { UInt timestamp = IntegerOfTerm(((CELL *)(B+1))[5]); - if (!VALID_TIMESTAMP(timestamp, ipc->u.aLl.d)) { + if (!VALID_TIMESTAMP(timestamp, ipc->u.OtaLl.d)) { /* jump to next instruction */ - ipc = ipc->u.aLl.n; + ipc = ipc->u.OtaLl.n; break; } } - return ipc->u.aLl.d; + return ipc->u.OtaLl.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.aLl.d)) { + if (!VALID_TIMESTAMP(timestamp, ipc->u.OtaLl.d)) { /* jump to next instruction */ - ipc = ipc->u.aLl.n; + ipc = ipc->u.OtaLl.n; break; } } - update_clause_choice_point(ipc->u.ILl.n,ap_pc); - return ipc->u.ILl.d; + update_clause_choice_point(ipc->u.OtILl.n,ap_pc); + return ipc->u.OtILl.d; case _trust_logical: case _count_trust_logical: case _profiled_trust_logical: { UInt timestamp = ((CELL *)(B+1))[5]; - LogUpdIndex *cl = ipc->u.ILl.block; + LogUpdIndex *cl = ipc->u.OtILl.block; LogUpdClause *newpc; - if (!VALID_TIMESTAMP(timestamp, ipc->u.ILl.d)) { + if (!VALID_TIMESTAMP(timestamp, ipc->u.OtILl.d)) { /* jump to next instruction */ newpc = NULL; } else { - newpc = ipc->u.ILl.d; + newpc = ipc->u.OtILl.d; } #if defined(YAPOR) || defined(THREADS) B->cp_tr--; @@ -8168,7 +8168,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.ILl.d; + LogUpdClause *lcl = ipc->u.OtILl.d; /* make sure we don't erase the clause we are jumping to */ if (lcl->ClRefCount == 1 && !(lcl->ClFlags & (DirtyMask|InUseMask))) { lcl->ClFlags |= InUseMask; @@ -8522,26 +8522,26 @@ Yap_NthClause(PredEntry *ap, Int ncls) case _try_clause: case _retry: if (ncls == 1) - return to_clause(ipc->u.apl.d, ap); + return to_clause(ipc->u.Otapl.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,apl),p),p)); + ipc = (yamop *)((char *)ipc+ncls*(UInt)NEXTOP(NEXTOP(NEXTOP((yamop *)NULL,Otapl),p),p)); } else { - ipc = (yamop *)((char *)ipc+ncls*(UInt)NEXTOP(NEXTOP((yamop *)NULL,apl),p)); + ipc = (yamop *)((char *)ipc+ncls*(UInt)NEXTOP(NEXTOP((yamop *)NULL,Otapl),p)); } } else if (ap->PredFlags & CountPredFlag) { - ipc = (yamop *)((char *)ipc+ncls*(UInt)NEXTOP(NEXTOP((yamop *)NULL,apl),p)); + ipc = (yamop *)((char *)ipc+ncls*(UInt)NEXTOP(NEXTOP((yamop *)NULL,Otapl),p)); } else { - ipc = (yamop *)((char *)ipc+ncls*(UInt)NEXTOP((yamop *)NULL,apl)); + ipc = (yamop *)((char *)ipc+ncls*(UInt)NEXTOP((yamop *)NULL,Otapl)); } - return to_clause(ipc->u.apl.d, ap); + return to_clause(ipc->u.Otapl.d, ap); } else { ncls--; } - ipc = NEXTOP(ipc,apl); + ipc = NEXTOP(ipc,Otapl); break; case _try_clause2: case _try_clause3: @@ -8579,32 +8579,32 @@ Yap_NthClause(PredEntry *ap, Int ncls) break; case _try_me: case _retry_me: - alt = ipc->u.apl.d; - ipc = NEXTOP(ipc,apl); + alt = ipc->u.Otapl.d; + ipc = NEXTOP(ipc,Otapl); break; case _profiled_trust_me: case _trust_me: case _count_trust_me: alt = NULL; - ipc = NEXTOP(ipc,apl); + ipc = NEXTOP(ipc,Otapl); break; case _try_logical: case _retry_logical: case _count_retry_logical: case _profiled_retry_logical: - if (VALID_TIMESTAMP(ap->TimeStampOfPred, ipc->u.aLl.d)) { + if (VALID_TIMESTAMP(ap->TimeStampOfPred, ipc->u.OtaLl.d)) { if (ncls == 1) - return ipc->u.aLl.d; + return ipc->u.OtaLl.d; ncls--; } - ipc = ipc->u.aLl.n; + ipc = ipc->u.OtaLl.n; break; case _trust_logical: case _count_trust_logical: case _profiled_trust_logical: - if (VALID_TIMESTAMP(ap->TimeStampOfPred, ipc->u.ILl.d)) { + if (VALID_TIMESTAMP(ap->TimeStampOfPred, ipc->u.OtILl.d)) { if (ncls == 1) - return ipc->u.ILl.d; + return ipc->u.OtILl.d; } return NULL; case _enter_lu_pred: diff --git a/C/init.c b/C/init.c index 94ad867cc..69af39f3c 100644 --- a/C/init.c +++ b/C/init.c @@ -505,9 +505,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,sbpp),p),l); + sz = (CELL)NEXTOP(NEXTOP(NEXTOP(p_code,Osbpp),p),l); } else { - sz = (CELL)NEXTOP(NEXTOP(NEXTOP(NEXTOP(NEXTOP(p_code,e),sbpp),p),p),l); + sz = (CELL)NEXTOP(NEXTOP(NEXTOP(NEXTOP(NEXTOP(p_code,e),Osbpp),p),p),l); } cl = (StaticClause *)Yap_AllocCodeSpace(sz); if (!cl) { @@ -536,12 +536,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.sbpp.bmap = NULL; - p_code->u.sbpp.s = -Signed(RealEnvSize); - p_code->u.sbpp.p = - p_code->u.sbpp.p0 = + p_code->u.Osbpp.bmap = NULL; + p_code->u.Osbpp.s = -Signed(RealEnvSize); + p_code->u.Osbpp.p = + p_code->u.Osbpp.p0 = pe; - p_code = NEXTOP(p_code,sbpp); + p_code = NEXTOP(p_code,Osbpp); if (!(flags & SafePredFlag)) { p_code->opc = Yap_opcode(_deallocate); p_code->u.p.p = pe; @@ -627,26 +627,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),sbpp),p),l)); + cl = (StaticClause *)Yap_AllocCodeSpace((CELL)NEXTOP(NEXTOP(NEXTOP(((yamop *)p_code),Osbpp),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),sbpp),p),l); + Yap_ClauseSpace += (CELL)NEXTOP(NEXTOP(NEXTOP(((yamop *)p_code),Osbpp),p),l); } else { cl = ClauseCodeToStaticClause(pe->CodeOfPred); } cl->ClFlags = StaticMask; cl->ClNext = NULL; - cl->ClSize = (CELL)NEXTOP(NEXTOP(NEXTOP(((yamop *)p_code),sbpp),e),e); + cl->ClSize = (CELL)NEXTOP(NEXTOP(NEXTOP(((yamop *)p_code),Osbpp),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.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->u.Osbpp.bmap = NULL; + p_code->u.Osbpp.s = -Signed(RealEnvSize); + p_code->u.Osbpp.p = p_code->u.Osbpp.p0 = pe; + p_code = NEXTOP(p_code,Osbpp); p_code->opc = Yap_opcode(_procceed); p_code->u.p.p = pe; p_code = NEXTOP(p_code,p); @@ -683,8 +683,8 @@ CleanBack(PredEntry *pe, CPredicate Start, CPredicate Cont) INIT_YAMOP_LTT(code, 2); PUT_YAMOP_SEQ(code); #endif /* YAPOR */ - code->u.apFs.f = Start; - code = NEXTOP(code,apFs); + code->u.OtapFs.f = Start; + code = NEXTOP(code,OtapFs); if (pe->PredFlags & UserCPredFlag) code->opc = Yap_opcode(_retry_userc); else @@ -693,14 +693,14 @@ CleanBack(PredEntry *pe, CPredicate Start, CPredicate Cont) INIT_YAMOP_LTT(code, 1); PUT_YAMOP_SEQ(code); #endif /* YAPOR */ - code->u.apFs.f = Cont; + code->u.OtapFs.f = Cont; #ifdef CUT_C - code = NEXTOP(code,apFs); + code = NEXTOP(code,OtapFs); if (pe->PredFlags & UserCPredFlag) code->opc = Yap_opcode(_cut_c); else code->opc = Yap_opcode(_cut_userc); - code->u.apFs.f = Cut; + code->u.OtapFs.f = Cut; #endif } @@ -760,9 +760,9 @@ Yap_InitCPredBack(char *Name, unsigned long int Arity, #endif /* YAPOR */ #ifdef CUT_C - cl = (StaticClause *)Yap_AllocCodeSpace((CELL)NEXTOP(NEXTOP(NEXTOP(NEXTOP(code,apFs),apFs),apFs),l)); + cl = (StaticClause *)Yap_AllocCodeSpace((CELL)NEXTOP(NEXTOP(NEXTOP(NEXTOP(code,OtapFs),OtapFs),OtapFs),l)); #else - cl = (StaticClause *)Yap_AllocCodeSpace((CELL)NEXTOP(NEXTOP(NEXTOP(code,apFs),apFs),l)); + cl = (StaticClause *)Yap_AllocCodeSpace((CELL)NEXTOP(NEXTOP(NEXTOP(code,OtapFs),OtapFs),l)); #endif if (cl == NULL) { @@ -772,13 +772,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,apFs),apFs),apFs),l); + Yap_ClauseSpace += (CELL)NEXTOP(NEXTOP(NEXTOP(NEXTOP(code,OtapFs),OtapFs),OtapFs),l); cl->ClSize = - (CELL)NEXTOP(NEXTOP(NEXTOP(NEXTOP(code,apFs),apFs),apFs),e); + (CELL)NEXTOP(NEXTOP(NEXTOP(NEXTOP(code,OtapFs),OtapFs),OtapFs),e); #else - Yap_ClauseSpace += (CELL)NEXTOP(NEXTOP(NEXTOP(code,apFs),apFs),l); + Yap_ClauseSpace += (CELL)NEXTOP(NEXTOP(NEXTOP(code,OtapFs),OtapFs),l); cl->ClSize = - (CELL)NEXTOP(NEXTOP(NEXTOP(code,apFs),apFs),e); + (CELL)NEXTOP(NEXTOP(NEXTOP(code,OtapFs),OtapFs),e); #endif cl->usc.ClPred = pe; @@ -789,38 +789,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.apFs.f = Start; - code->u.apFs.p = pe; - code->u.apFs.s = Arity; - code->u.apFs.extra = Extra; + code->u.OtapFs.f = Start; + code->u.OtapFs.p = pe; + code->u.OtapFs.s = Arity; + code->u.OtapFs.extra = Extra; #ifdef YAPOR INIT_YAMOP_LTT(code, 2); PUT_YAMOP_SEQ(code); #endif /* YAPOR */ - code = NEXTOP(code,apFs); + code = NEXTOP(code,OtapFs); if (flags & UserCPredFlag) code->opc = Yap_opcode(_retry_userc); else code->opc = Yap_opcode(_retry_c); - code->u.apFs.f = Cont; - code->u.apFs.p = pe; - code->u.apFs.s = Arity; - code->u.apFs.extra = Extra; + code->u.OtapFs.f = Cont; + code->u.OtapFs.p = pe; + code->u.OtapFs.s = Arity; + code->u.OtapFs.extra = Extra; #ifdef YAPOR INIT_YAMOP_LTT(code, 1); PUT_YAMOP_SEQ(code); #endif /* YAPOR */ - code = NEXTOP(code,apFs); + code = NEXTOP(code,OtapFs); #ifdef CUT_C if (flags & UserCPredFlag) code->opc = Yap_opcode(_cut_userc); else code->opc = Yap_opcode(_cut_c); - code->u.apFs.f = Cut; - code->u.apFs.p = pe; - code->u.apFs.s = Arity; - code->u.apFs.extra = Extra; - code = NEXTOP(code,apFs); + code->u.OtapFs.f = Cut; + code->u.OtapFs.p = pe; + code->u.OtapFs.s = Arity; + code->u.OtapFs.extra = Extra; + code = NEXTOP(code,OtapFs); #endif /* CUT_C */ code->opc = Yap_opcode(_Ystop); code->u.l.l = cl->ClCode; @@ -961,8 +961,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.apl.s = 0; - Yap_heap_regs->rtrycode.u.apl.d = NIL; + Yap_heap_regs->rtrycode.u.Otapl.s = 0; + Yap_heap_regs->rtrycode.u.Otapl.d = NIL; #ifdef YAPOR INIT_YAMOP_LTT(&(Yap_heap_regs->rtrycode), 1); #endif /* YAPOR */ @@ -1312,8 +1312,8 @@ InitCodes(void) modp->PredFlags |= MetaPredFlag; } #ifdef YAPOR - 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)); + Yap_heap_regs->getwork_code.u.Otapl.p = RepPredProp(PredPropByAtom(Yap_FullLookupAtom("$getwork"), PROLOG_MODULE)); + Yap_heap_regs->getwork_seq_code.u.Otapl.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 afe562a04..eea39adf3 100644 --- a/H/YapOpcodes.h +++ b/H/YapOpcodes.h @@ -4,33 +4,33 @@ OPCODE(Ystop ,l), OPCODE(Nstop ,e), - OPCODE(try_me ,apl), - OPCODE(retry_me ,apl), - OPCODE(trust_me ,apl), + OPCODE(try_me ,Otapl), + OPCODE(retry_me ,Otapl), + OPCODE(trust_me ,Otapl), 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(profiled_retry_me ,Otapl), + OPCODE(profiled_trust_me ,Otapl), + OPCODE(profiled_retry_logical ,OtaLl), + OPCODE(profiled_trust_logical ,OtILl), OPCODE(count_call ,p), OPCODE(count_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(count_retry_me ,Otapl), + OPCODE(count_trust_me ,Otapl), + OPCODE(count_retry_logical ,OtaLl), + OPCODE(count_trust_logical ,OtILl), OPCODE(lock_lu ,p), OPCODE(unlock_lu ,e), OPCODE(alloc_for_logical_pred ,L), OPCODE(copy_idb_term ,e), OPCODE(unify_idb_term ,e), - OPCODE(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(spy_or_trymark ,Otapl), + OPCODE(try_and_mark ,Otapl), + OPCODE(count_retry_and_mark ,Otapl), + OPCODE(profiled_retry_and_mark ,Otapl), + OPCODE(retry_and_mark ,Otapl), OPCODE(trust_fail ,e), OPCODE(op_fail ,e), OPCODE(cut ,e), @@ -42,8 +42,8 @@ OPCODE(commit_b_y ,yp), OPCODE(execute ,pp), OPCODE(dexecute ,pp), - OPCODE(fcall ,sbpp), - OPCODE(call ,sbpp), + OPCODE(fcall ,Osbpp), + OPCODE(call ,Osbpp), OPCODE(procceed ,p), OPCODE(allocate ,e), OPCODE(deallocate ,p), @@ -175,23 +175,23 @@ OPCODE(jump ,l), OPCODE(move_back ,l), OPCODE(skip ,l), - OPCODE(either ,sblp), - OPCODE(or_else ,sblp), + OPCODE(either ,Osblp), + OPCODE(or_else ,Osblp), OPCODE(pop_n ,s), OPCODE(pop ,e), - OPCODE(call_cpred ,sbpp), + OPCODE(call_cpred ,Osbpp), OPCODE(execute_cpred ,pp), - OPCODE(call_usercpred ,sbpp), + OPCODE(call_usercpred ,Osbpp), OPCODE(call_c_wfail ,sdlp), - OPCODE(try_c ,apFs), - OPCODE(retry_c ,apFs), + OPCODE(try_c ,OtapFs), + OPCODE(retry_c ,OtapFs), #ifdef CUT_C - OPCODE(cut_c ,apFs), + OPCODE(cut_c ,OtapFs), #endif - OPCODE(try_userc ,apFs), - OPCODE(retry_userc ,apFs), + OPCODE(try_userc ,OtapFs), + OPCODE(retry_userc ,OtapFs), #ifdef CUT_C - OPCODE(cut_userc ,apFs), + OPCODE(cut_userc ,OtapFs), #endif OPCODE(lock_pred ,e), OPCODE(index_pred ,e), @@ -202,20 +202,20 @@ OPCODE(expand_clauses ,sssllp), OPCODE(undef_p ,e), OPCODE(spy_pred ,e), - OPCODE(try_clause ,apl), + OPCODE(try_clause ,Otapl), OPCODE(try_clause2 ,l), OPCODE(try_clause3 ,l), OPCODE(try_clause4 ,l), - OPCODE(retry ,apl), + OPCODE(retry ,Otapl), OPCODE(retry2 ,l), OPCODE(retry3 ,l), OPCODE(retry4 ,l), - OPCODE(trust ,apl), + OPCODE(trust ,Otapl), OPCODE(try_in ,l), OPCODE(enter_lu_pred ,Ills), - OPCODE(try_logical ,aLl), - OPCODE(retry_logical ,aLl), - OPCODE(trust_logical ,ILl), + OPCODE(try_logical ,OtaLl), + OPCODE(retry_logical ,OtaLl), + OPCODE(trust_logical ,OtILl), OPCODE(switch_on_type ,llll), OPCODE(switch_list_nl ,ollll), OPCODE(switch_on_arg_type ,xllll), @@ -313,31 +313,31 @@ 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), + OPCODE(p_execute2 ,Osbpp), + OPCODE(p_execute ,Osbmp), + OPCODE(p_execute_tail ,Osbpp), #ifdef YAPOR OPCODE(getwork_first_time ,e), - OPCODE(getwork ,apl), - OPCODE(getwork_seq ,apl), - OPCODE(sync ,apl), + OPCODE(getwork ,Otapl), + OPCODE(getwork_seq ,Otapl), + OPCODE(sync ,Otapl), #endif #ifdef TABLING #ifdef TABLING_INNER_CUTS OPCODE(clause_with_cut ,e), #endif - 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_load_answer ,Otapl), + OPCODE(table_try_answer ,Otapl), + OPCODE(table_try_single ,Otapl), + OPCODE(table_try_me ,Otapl), + OPCODE(table_try ,Otapl), + OPCODE(table_retry_me ,Otapl), + OPCODE(table_retry ,Otapl), + OPCODE(table_trust_me ,Otapl), + OPCODE(table_trust ,Otapl), OPCODE(table_new_answer ,s), - OPCODE(table_answer_resolution ,apl), - OPCODE(table_completion ,apl), + OPCODE(table_answer_resolution ,Otapl), + OPCODE(table_completion ,Otapl), OPCODE(trie_do_null ,e), OPCODE(trie_try_null ,e), OPCODE(trie_retry_null ,e), diff --git a/H/amidefs.h b/H/amidefs.h index fd8e1d5e9..3e934518e 100644 --- a/H/amidefs.h +++ b/H/amidefs.h @@ -176,8 +176,10 @@ typedef enum { m: module, Term n: number, Integer o: opcode, OPCODE + O: OR-parallel information, used by YAPOR, unsigned int p: predicate, struct pred_entry * s: small integer, COUNT + t: pointer to table entry, used by yaptab, struct table_entry * x: wam register, wamreg y: environment slot @@ -185,7 +187,7 @@ typedef enum { /* This declaration is going to be parsed by a Prolog program, so: comments are welcome, but they should take a whole line, every field declaration should also take a single line, - please check the Prolog program if you come up with a compilcated C-type that does not start by unsigned or struct. + please check the Prolog program if you come up with a complicated C-type that does not start by unsigned or struct. */ typedef struct yami { OPCODE opc; @@ -278,7 +280,7 @@ typedef struct yami { struct pred_entry *p; struct yami *d; CELL next; - } apl; + } Otapl; /* 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. */ @@ -297,7 +299,7 @@ typedef struct yami { struct logic_upd_clause *d; struct yami *n; CELL next; - } aLl; + } OtaLl; struct { #ifdef YAPOR unsigned int or_arg; @@ -311,7 +313,7 @@ typedef struct yami { struct logic_upd_clause *d; struct yami *n; CELL next; - } ILl; + } OtILl; struct { #ifdef YAPOR unsigned int or_arg; @@ -325,7 +327,7 @@ typedef struct yami { CPredicate f; COUNT extra; CELL next; - } apFs; + } OtapFs; struct { struct yami *l1; struct yami *l2; @@ -476,6 +478,7 @@ typedef struct yami { } 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 */ + /* last, Osblp is known to the buildops script */ struct { #ifdef YAPOR unsigned int or_arg; @@ -485,7 +488,7 @@ typedef struct yami { struct yami *l; struct pred_entry *p0; CELL next; - } sblp; + } Osblp; struct { #ifdef YAPOR unsigned int or_arg; @@ -495,7 +498,7 @@ typedef struct yami { struct pred_entry *p; struct pred_entry *p0; CELL next; - } sbpp; + } Osbpp; struct { #ifdef YAPOR unsigned int or_arg; @@ -505,7 +508,7 @@ typedef struct yami { Term mod; struct pred_entry *p0; CELL next; - } sbmp; + } Osbmp; struct { /* size of table */ COUNT s; @@ -793,19 +796,19 @@ CELL *ENV_Parent(CELL *env) static inline UInt ENV_Size(yamop *cp) { - return (((yamop *)((CODEADDR)(cp) - (CELL)NEXTOP((yamop *)NULL,sbpp)))->u.sbpp.s); + return (((yamop *)((CODEADDR)(cp) - (CELL)NEXTOP((yamop *)NULL,Osbpp)))->u.Osbpp.s); } static inline struct pred_entry *ENV_ToP(yamop *cp) { - return (((yamop *)((CODEADDR)(cp) - (CELL)NEXTOP((yamop *)NULL,sbpp)))->u.sbpp.p); + return (((yamop *)((CODEADDR)(cp) - (CELL)NEXTOP((yamop *)NULL,Osbpp)))->u.Osbpp.p); } static inline OPCODE ENV_ToOp(yamop *cp) { - return (((yamop *)((CODEADDR)(cp) - (CELL)NEXTOP((yamop *)NULL,sbpp)))->opc); + return (((yamop *)((CODEADDR)(cp) - (CELL)NEXTOP((yamop *)NULL,Osbpp)))->opc); } static inline @@ -817,13 +820,13 @@ UInt EnvSize(yamop *cp) static inline CELL *EnvBMap(yamop *p) { - return (((yamop *)((CODEADDR)(p) - (CELL)NEXTOP((yamop *)NULL,sbpp)))->u.sbpp.bmap); + return (((yamop *)((CODEADDR)(p) - (CELL)NEXTOP((yamop *)NULL,Osbpp)))->u.Osbpp.bmap); } static inline struct pred_entry *EnvPreg(yamop *p) { - return (((yamop *)((CODEADDR)(p) - (CELL)NEXTOP((yamop *)NULL,sbpp)))->u.sbpp.p0); + return (((yamop *)((CODEADDR)(p) - (CELL)NEXTOP((yamop *)NULL,Osbpp)))->u.Osbpp.p0); } /* access to instructions */ diff --git a/H/clause.h b/H/clause.h index 5c83699ec..f0aaa51a6 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.apl.d) +#define NextDynamicClause(X) (((yamop *)X)->u.Otapl.d) #define PredFirstClause 0 #define PredMiddleClause 1 diff --git a/H/rclause.h b/H/rclause.h index 82d72fc52..40ee4aab5 100644 --- a/H/rclause.h +++ b/H/rclause.h @@ -13,15 +13,6 @@ restore_opcodes(yamop *pc) fprintf(stderr, "%s ", Yap_op_names[op]); #endif switch (op) { - /* instructions type ILl */ - case _count_trust_logical: - case _profiled_trust_logical: - case _trust_logical: - pc->u.ILl.block = PtoLUIndexAdjust(pc->u.ILl.block); - pc->u.ILl.d = PtoLUClauseAdjust(pc->u.ILl.d); - pc->u.ILl.n = PtoOpAdjust(pc->u.ILl.n); - pc = NEXTOP(pc,ILl); - break; /* instructions type Ills */ case _enter_lu_pred: pc->u.Ills.I = PtoLUIndexAdjust(pc->u.Ills.I); @@ -35,17 +26,63 @@ restore_opcodes(yamop *pc) pc->u.L.ClBase = PtoLUClauseAdjust(pc->u.L.ClBase); pc = NEXTOP(pc,L); break; - /* instructions type aLl */ + /* instructions type Osblp */ + case _either: + case _or_else: + OrArgAdjust(pc->u.Osblp.or_arg); + pc->u.Osblp.s = ConstantAdjust(pc->u.Osblp.s); + pc->u.Osblp.bmap = CellPtoHeapAdjust(pc->u.Osblp.bmap); + pc->u.Osblp.l = PtoOpAdjust(pc->u.Osblp.l); + pc->u.Osblp.p0 = PtoPredAdjust(pc->u.Osblp.p0); + pc = NEXTOP(pc,Osblp); + break; + /* instructions type Osbmp */ + case _p_execute: + OrArgAdjust(pc->u.Osbmp.or_arg); + pc->u.Osbmp.s = ConstantAdjust(pc->u.Osbmp.s); + pc->u.Osbmp.bmap = CellPtoHeapAdjust(pc->u.Osbmp.bmap); + pc->u.Osbmp.mod = ModuleAdjust(pc->u.Osbmp.mod); + pc->u.Osbmp.p0 = PtoPredAdjust(pc->u.Osbmp.p0); + pc = NEXTOP(pc,Osbmp); + break; + /* instructions type Osbpp */ + case _call: + case _call_cpred: + case _call_usercpred: + case _fcall: + case _p_execute2: + case _p_execute_tail: + OrArgAdjust(pc->u.Osbpp.or_arg); + pc->u.Osbpp.s = ConstantAdjust(pc->u.Osbpp.s); + pc->u.Osbpp.bmap = CellPtoHeapAdjust(pc->u.Osbpp.bmap); + pc->u.Osbpp.p = PtoPredAdjust(pc->u.Osbpp.p); + pc->u.Osbpp.p0 = PtoPredAdjust(pc->u.Osbpp.p0); + pc = NEXTOP(pc,Osbpp); + break; + /* instructions type OtILl */ + case _count_trust_logical: + case _profiled_trust_logical: + case _trust_logical: + OrArgAdjust(pc->u.OtILl.or_arg); + TabEntryAdjust(pc->u.OtILl.te); + pc->u.OtILl.block = PtoLUIndexAdjust(pc->u.OtILl.block); + pc->u.OtILl.d = PtoLUClauseAdjust(pc->u.OtILl.d); + pc->u.OtILl.n = PtoOpAdjust(pc->u.OtILl.n); + pc = NEXTOP(pc,OtILl); + break; + /* instructions type OtaLl */ case _count_retry_logical: case _profiled_retry_logical: case _retry_logical: case _try_logical: - pc->u.aLl.s = ArityAdjust(pc->u.aLl.s); - pc->u.aLl.d = PtoLUClauseAdjust(pc->u.aLl.d); - pc->u.aLl.n = PtoOpAdjust(pc->u.aLl.n); - pc = NEXTOP(pc,aLl); + OrArgAdjust(pc->u.OtaLl.or_arg); + TabEntryAdjust(pc->u.OtaLl.te); + pc->u.OtaLl.s = ArityAdjust(pc->u.OtaLl.s); + pc->u.OtaLl.d = PtoLUClauseAdjust(pc->u.OtaLl.d); + pc->u.OtaLl.n = PtoOpAdjust(pc->u.OtaLl.n); + pc = NEXTOP(pc,OtaLl); break; - /* instructions type apFs */ + /* instructions type OtapFs */ #ifdef CUT_C case _cut_c: #endif @@ -56,13 +93,15 @@ restore_opcodes(yamop *pc) case _retry_userc: case _try_c: case _try_userc: - pc->u.apFs.s = ArityAdjust(pc->u.apFs.s); - pc->u.apFs.p = PtoPredAdjust(pc->u.apFs.p); - pc->u.apFs.f = ExternalFunctionAdjust(pc->u.apFs.f); - pc->u.apFs.extra = ConstantAdjust(pc->u.apFs.extra); - pc = NEXTOP(pc,apFs); + OrArgAdjust(pc->u.OtapFs.or_arg); + TabEntryAdjust(pc->u.OtapFs.te); + pc->u.OtapFs.s = ArityAdjust(pc->u.OtapFs.s); + pc->u.OtapFs.p = PtoPredAdjust(pc->u.OtapFs.p); + pc->u.OtapFs.f = ExternalFunctionAdjust(pc->u.OtapFs.f); + pc->u.OtapFs.extra = ConstantAdjust(pc->u.OtapFs.extra); + pc = NEXTOP(pc,OtapFs); break; - /* instructions type apl */ + /* instructions type Otapl */ case _count_retry_and_mark: case _count_retry_me: case _count_trust_me: @@ -78,10 +117,12 @@ restore_opcodes(yamop *pc) case _try_and_mark: case _try_clause: case _try_me: - pc->u.apl.s = ArityAdjust(pc->u.apl.s); - pc->u.apl.p = PtoPredAdjust(pc->u.apl.p); - pc->u.apl.d = PtoOpAdjust(pc->u.apl.d); - pc = NEXTOP(pc,apl); + OrArgAdjust(pc->u.Otapl.or_arg); + TabEntryAdjust(pc->u.Otapl.te); + pc->u.Otapl.s = ArityAdjust(pc->u.Otapl.s); + pc->u.Otapl.p = PtoPredAdjust(pc->u.Otapl.p); + pc->u.Otapl.d = PtoOpAdjust(pc->u.Otapl.d); + pc = NEXTOP(pc,Otapl); break; /* instructions type c */ case _write_atom: @@ -402,36 +443,6 @@ restore_opcodes(yamop *pc) pc->u.s.s = ConstantAdjust(pc->u.s.s); pc = NEXTOP(pc,s); break; - /* instructions type sblp */ - case _either: - case _or_else: - pc->u.sblp.s = ConstantAdjust(pc->u.sblp.s); - pc->u.sblp.bmap = CellPtoHeapAdjust(pc->u.sblp.bmap); - 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 sbmp */ - case _p_execute: - pc->u.sbmp.s = ConstantAdjust(pc->u.sbmp.s); - pc->u.sbmp.bmap = CellPtoHeapAdjust(pc->u.sbmp.bmap); - pc->u.sbmp.mod = ModuleAdjust(pc->u.sbmp.mod); - pc->u.sbmp.p0 = PtoPredAdjust(pc->u.sbmp.p0); - pc = NEXTOP(pc,sbmp); - break; - /* instructions type sbpp */ - case _call: - case _call_cpred: - case _call_usercpred: - case _fcall: - case _p_execute2: - case _p_execute_tail: - pc->u.sbpp.s = ConstantAdjust(pc->u.sbpp.s); - pc->u.sbpp.bmap = CellPtoHeapAdjust(pc->u.sbpp.bmap); - pc->u.sbpp.p = PtoPredAdjust(pc->u.sbpp.p); - pc->u.sbpp.p0 = PtoPredAdjust(pc->u.sbpp.p0); - pc = NEXTOP(pc,sbpp); - break; /* instructions type sc */ case _write_n_atoms: pc->u.sc.s = ConstantAdjust(pc->u.sc.s); @@ -715,14 +726,16 @@ restore_opcodes(yamop *pc) pc = NEXTOP(pc,yyx); break; #ifdef YAPOR - /* instructions type apl */ + /* instructions type Otapl */ case _getwork: case _getwork_seq: case _sync: - pc->u.apl.s = ArityAdjust(pc->u.apl.s); - pc->u.apl.p = PtoPredAdjust(pc->u.apl.p); - pc->u.apl.d = PtoOpAdjust(pc->u.apl.d); - pc = NEXTOP(pc,apl); + OrArgAdjust(pc->u.Otapl.or_arg); + TabEntryAdjust(pc->u.Otapl.te); + pc->u.Otapl.s = ArityAdjust(pc->u.Otapl.s); + pc->u.Otapl.p = PtoPredAdjust(pc->u.Otapl.p); + pc->u.Otapl.d = PtoOpAdjust(pc->u.Otapl.d); + pc = NEXTOP(pc,Otapl); break; /* instructions type e */ case _getwork_first_time: @@ -731,7 +744,7 @@ restore_opcodes(yamop *pc) break; #endif #ifdef TABLING - /* instructions type apl */ + /* instructions type Otapl */ case _table_answer_resolution: case _table_completion: case _table_load_answer: @@ -743,10 +756,12 @@ restore_opcodes(yamop *pc) case _table_try_answer: case _table_try_me: case _table_try_single: - pc->u.apl.s = ArityAdjust(pc->u.apl.s); - pc->u.apl.p = PtoPredAdjust(pc->u.apl.p); - pc->u.apl.d = PtoOpAdjust(pc->u.apl.d); - pc = NEXTOP(pc,apl); + OrArgAdjust(pc->u.Otapl.or_arg); + TabEntryAdjust(pc->u.Otapl.te); + pc->u.Otapl.s = ArityAdjust(pc->u.Otapl.s); + pc->u.Otapl.p = PtoPredAdjust(pc->u.Otapl.p); + pc->u.Otapl.d = PtoOpAdjust(pc->u.Otapl.d); + pc = NEXTOP(pc,Otapl); break; /* instructions type e */ #ifdef TABLING_INNER_CUTS @@ -760,27 +775,7 @@ restore_opcodes(yamop *pc) pc->u.s.s = ConstantAdjust(pc->u.s.s); pc = NEXTOP(pc,s); break; - /* instructions type apl */ - case _table_answer_resolution: - case _table_completion: - case _table_load_answer: - case _table_retry: - case _table_retry_me: - case _table_trust: - case _table_trust_me: - case _table_try: - case _table_try_answer: - case _table_try_me: - case _table_try_single: - pc->u.apl.s = ArityAdjust(pc->u.apl.s); - pc->u.apl.p = PtoPredAdjust(pc->u.apl.p); - pc->u.apl.d = PtoOpAdjust(pc->u.apl.d); - pc = NEXTOP(pc,apl); - break; /* instructions type e */ -#ifdef TABLING_INNER_CUTS - case _clause_with_cut: -#endif case _trie_do_atom: case _trie_do_extension: case _trie_do_float: @@ -820,20 +815,16 @@ restore_opcodes(yamop *pc) if (op == _Nstop || op == _copy_idb_term || op == _unify_idb_term) return; pc = NEXTOP(pc,e); break; - /* instructions type s */ - case _table_new_answer: - pc->u.s.s = ConstantAdjust(pc->u.s.s); - pc = NEXTOP(pc,s); - break; #endif /* this instruction is hardwired */ case _or_last: #ifdef YAPOR - pc->u.sblp.s = ConstantAdjust(pc->u.sblp.s); - pc->u.sblp.bmap = CellPtoHeapAdjust(pc->u.sblp.bmap); - pc->u.sblp.l = PtoOpAdjust(pc->u.sblp.l); - pc->u.sblp.p0 = PtoPredAdjust(pc->u.sblp.p0); - pc = NEXTOP(pc,sblp); + OrArgAdjust(pc->u.Osblp.or_arg); + pc->u.Osblp.s = ConstantAdjust(pc->u.Osblp.s); + pc->u.Osblp.bmap = CellPtoHeapAdjust(pc->u.Osblp.bmap); + pc->u.Osblp.l = PtoOpAdjust(pc->u.Osblp.l); + pc->u.Osblp.p0 = PtoPredAdjust(pc->u.Osblp.p0); + pc = NEXTOP(pc,Osblp); break; #else pc->u.p.p = PtoPredAdjust(pc->u.p.p); diff --git a/H/rheap.h b/H/rheap.h index deab29360..bb050d36d 100644 --- a/H/rheap.h +++ b/H/rheap.h @@ -659,9 +659,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.apl.d != NIL) - ((yamop *)(&Yap_heap_regs->rtrycode))->u.apl.d = - PtoOpAdjust(((yamop *)(&Yap_heap_regs->rtrycode))->u.apl.d); + if (((yamop *)(&Yap_heap_regs->rtrycode))->u.Otapl.d != NIL) + ((yamop *)(&Yap_heap_regs->rtrycode))->u.Otapl.d = + PtoOpAdjust(((yamop *)(&Yap_heap_regs->rtrycode))->u.Otapl.d); { int arity; arity = Yap_heap_regs->clausecode->arity; diff --git a/H/sshift.h b/H/sshift.h index 88ea93bf7..d47ece7fe 100644 --- a/H/sshift.h +++ b/H/sshift.h @@ -38,7 +38,8 @@ IsHeapP (CELL * ptr) #endif } - +#define OrArgAdjust(P) +#define TabEntryAdjust(P) /* Adjusting cells and pointers to cells */ @@ -847,3 +848,4 @@ IsGlobal (CELL reg) void STD_PROTO (Yap_AdjustStacksAndTrail, (void)); void STD_PROTO (Yap_AdjustRegs, (int)); + diff --git a/OPTYap/or.insts.i b/OPTYap/or.insts.i index 78fb85105..85693a158 100644 --- a/OPTYap/or.insts.i +++ b/OPTYap/or.insts.i @@ -41,7 +41,7 @@ - PBOp(getwork,apl) + PBOp(getwork,Otapl) #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,apl) + PBOp(getwork_seq,Otapl) 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,apl) + PBOp(sync,Otapl) CUT_wait_leftmost(); - PREG = NEXTOP(PREG, apl); + PREG = NEXTOP(PREG, Otapl); PREFETCH_OP(PREG); GONext(); ENDPBOp(); diff --git a/OPTYap/or.macros.h b/OPTYap/or.macros.h index ddf4d90f8..78705052e 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.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 YAMOP_OR_ARG(INST) ((INST)->u.Otapl.or_arg) +#define YAMOP_LTT(INST) (((INST)->u.Otapl.or_arg) & YAMOP_LTT_BITS) +#define YAMOP_SEQ(INST) (((INST)->u.Otapl.or_arg) & YAMOP_SEQ_FLAG) +#define YAMOP_CUT(INST) (((INST)->u.Otapl.or_arg) & YAMOP_CUT_FLAG) +#define YAMOP_FLAGS(INST) (((INST)->u.Otapl.or_arg) & YAMOP_FLAGS_BITS) -#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 INIT_YAMOP_LTT(INST, LTT) (INST)->u.Otapl.or_arg = LTT +#define PUT_YAMOP_LTT(INST, LTT) (INST)->u.Otapl.or_arg = YAMOP_FLAGS(INST) | (LTT) +#define PUT_YAMOP_SEQ(INST) (INST)->u.Otapl.or_arg |= YAMOP_SEQ_FLAG +#define PUT_YAMOP_CUT(INST) (INST)->u.Otapl.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 9cfb8de90..ed281aac0 100644 --- a/OPTYap/tab.insts.i +++ b/OPTYap/tab.insts.i @@ -272,7 +272,7 @@ - PBOp(table_load_answer, apl) + PBOp(table_load_answer, Otapl) CELL *subs_ptr; ans_node_ptr ans_node; @@ -299,7 +299,7 @@ - PBOp(table_try_answer, apl) + PBOp(table_try_answer, Otapl) #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,apl); - PREG = PREG->u.apl.d; + code_ap = NEXTOP(PREG,Otapl); + PREG = PREG->u.Otapl.d; } else if (PREG->opc == Yap_opcode(_table_try_single)) { /* table_try_single */ code_ap = COMPLETION; - PREG = PREG->u.apl.d; + PREG = PREG->u.Otapl.d; } else { /* table_try_me */ - code_ap = PREG->u.apl.d; - PREG = NEXTOP(PREG,apl); + code_ap = PREG->u.Otapl.d; + PREG = NEXTOP(PREG,Otapl); } PREFETCH_OP(PREG); restore_generator_node(SgFr_arity(sg_fr), code_ap); @@ -350,7 +350,7 @@ GONext(); } #else - PREG = PREG->u.apl.d; + PREG = PREG->u.Otapl.d; PREFETCH_OP(PREG); GONext(); #endif /* INCOMPLETE_TABLING */ @@ -358,12 +358,12 @@ - PBOp(table_try_single, apl) + PBOp(table_try_single, Otapl) tab_ent_ptr tab_ent; sg_fr_ptr sg_fr; check_trail(TR); - tab_ent = PREG->u.apl.te; + tab_ent = PREG->u.Otapl.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.apl.s, COMPLETION); - PREG = PREG->u.apl.d; /* should work also with PREG = NEXTOP(PREG,apl); */ + store_generator_node(tab_ent, sg_fr, PREG->u.Otapl.s, COMPLETION); + PREG = PREG->u.Otapl.d; /* should work also with PREG = NEXTOP(PREG,Otapl); */ 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.apl.s, TRY_ANSWER); + store_generator_node(tab_ent, sg_fr, PREG->u.Otapl.s, TRY_ANSWER); PREG = (yamop *) CPREG; PREFETCH_OP(PREG); load_answer_trie(ans_node, subs_ptr); @@ -467,12 +467,12 @@ - PBOp(table_try_me, apl) + PBOp(table_try_me, Otapl) tab_ent_ptr tab_ent; sg_fr_ptr sg_fr; check_trail(TR); - tab_ent = PREG->u.apl.te; + tab_ent = PREG->u.Otapl.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.apl.s, PREG->u.apl.d); - PREG = NEXTOP(PREG, apl); + store_generator_node(tab_ent, sg_fr, PREG->u.Otapl.s, PREG->u.Otapl.d); + PREG = NEXTOP(PREG, Otapl); 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.apl.s, TRY_ANSWER); + store_generator_node(tab_ent, sg_fr, PREG->u.Otapl.s, TRY_ANSWER); PREG = (yamop *) CPREG; PREFETCH_OP(PREG); load_answer_trie(ans_node, subs_ptr); @@ -576,12 +576,12 @@ - PBOp(table_try, apl) + PBOp(table_try, Otapl) tab_ent_ptr tab_ent; sg_fr_ptr sg_fr; check_trail(TR); - tab_ent = PREG->u.apl.te; + tab_ent = PREG->u.Otapl.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.apl.s, NEXTOP(PREG,apl)); - PREG = PREG->u.apl.d; + store_generator_node(tab_ent, sg_fr, PREG->u.Otapl.s, NEXTOP(PREG,Otapl)); + PREG = PREG->u.Otapl.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.apl.s, TRY_ANSWER); + store_generator_node(tab_ent, sg_fr, PREG->u.Otapl.s, TRY_ANSWER); PREG = (yamop *) CPREG; PREFETCH_OP(PREG); load_answer_trie(ans_node, subs_ptr); @@ -685,49 +685,49 @@ - Op(table_retry_me, apl) - restore_generator_node(PREG->u.apl.s, PREG->u.apl.d); + Op(table_retry_me, Otapl) + restore_generator_node(PREG->u.Otapl.s, PREG->u.Otapl.d); YENV = (CELL *) PROTECT_FROZEN_B(B); set_cut(YENV, B->cp_b); SET_BB(NORM_CP(YENV)); allocate_environment(); - PREG = NEXTOP(PREG,apl); + PREG = NEXTOP(PREG,Otapl); GONext(); ENDOp(); - Op(table_retry, apl) - restore_generator_node(PREG->u.apl.s, NEXTOP(PREG,apl)); + Op(table_retry, Otapl) + restore_generator_node(PREG->u.Otapl.s, NEXTOP(PREG,Otapl)); YENV = (CELL *) PROTECT_FROZEN_B(B); set_cut(YENV, B->cp_b); SET_BB(NORM_CP(YENV)); allocate_environment(); - PREG = PREG->u.apl.d; + PREG = PREG->u.Otapl.d; GONext(); ENDOp(); - Op(table_trust_me, apl) - restore_generator_node(PREG->u.apl.s, COMPLETION); + Op(table_trust_me, Otapl) + restore_generator_node(PREG->u.Otapl.s, COMPLETION); YENV = (CELL *) PROTECT_FROZEN_B(B); set_cut(YENV, B->cp_b); SET_BB(NORM_CP(YENV)); allocate_environment(); - PREG = NEXTOP(PREG,apl); + PREG = NEXTOP(PREG,Otapl); GONext(); ENDOp(); - Op(table_trust, apl) - restore_generator_node(PREG->u.apl.s, COMPLETION); + Op(table_trust, Otapl) + restore_generator_node(PREG->u.Otapl.s, COMPLETION); YENV = (CELL *) PROTECT_FROZEN_B(B); set_cut(YENV, B->cp_b); SET_BB(NORM_CP(YENV)); allocate_environment(); - PREG = PREG->u.apl.d; + PREG = PREG->u.Otapl.d; GONext(); ENDOp(); @@ -973,7 +973,7 @@ - BOp(table_answer_resolution, apl) + BOp(table_answer_resolution, Otapl) #ifdef YAPOR if (SCH_top_shared_cp(B)) { UNLOCK_OR_FRAME(LOCAL_top_or_fr); @@ -1259,7 +1259,7 @@ - BOp(table_completion, apl) + BOp(table_completion, Otapl) #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 2625280d4..ab20bef62 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.apl.or_arg */ + int or_arg; /* u.Otapl.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.apl.te) -#define SgFr_arity(X) (((X)->code_of_subgoal)->u.apl.s) +#define SgFr_tab_ent(X) (((X)->code_of_subgoal)->u.Otapl.te) +#define SgFr_arity(X) (((X)->code_of_subgoal)->u.Otapl.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 d8fd31932..c03d839df 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.apl.s; - tab_ent = preg->u.apl.te; + arity = preg->u.Otapl.s; + tab_ent = preg->u.Otapl.te; count_vars = 0; stack_vars = *Yaddr; stack_terms_limit = (CELL *)TR; diff --git a/configure.in b/configure.in index 1b34296c4..328f90016 100644 --- a/configure.in +++ b/configure.in @@ -69,6 +69,9 @@ AC_ARG_ENABLE(use-malloc, AC_ARG_ENABLE(condor, [ --enable-condor allow Yap to be used from condor ], use_condor="$enableval", use_condor=no) +AC_ARG_ENABLE(chr, + [ --enable-chr install chr library ], + use_chr="$enableval", use_chr=yes) AC_ARG_ENABLE(april, [ --enable-april compile Yap to support April ILP system], diff --git a/misc/buildops b/misc/buildops index 60cbf9927..ab8a4f583 100644 --- a/misc/buildops +++ b/misc/buildops @@ -32,8 +32,8 @@ main :- file('OPTYap/or.insts.i',W,C), end_ifdef(W,C), start_ifdef("TABLING",W,C), - retractall(op(_,_)), file('OPTYap/tab.insts.i',W,C), + retractall(op(_,_)), file('OPTYap/tab.tries.insts.i',W,C), end_ifdef(W,C), footer(W), @@ -139,20 +139,25 @@ special_formats(_,_). dump_fields(_,[],"e",_). dump_fields(_,[],[],_). -dump_fields(C,[I-"none"|Info],[O|Ops],T) :- !, +dump_fields(C,[I-_|Info],[O|Ops],T) :- !, dump_field(C,I,O,T), dump_fields(C,Info,Ops,T). dump_fields(C,[_|Info],Ops,T) :- dump_fields(C,Info,Ops,T). dump_field(C,I,O,T) :- - O \= 0'd, - O \= 0'i, !, - get_op(O,A), - format(C,' pc->u.~s.~s = ~sAdjust(pc->u.~s.~s);~n',[T,I,A,T,I]). -dump_field(C,I,O,T) :- + rewritable_field(O), !, get_op(O,A), format(C,' ~sAdjust(pc->u.~s.~s);~n',[A,T,I]). +dump_field(C,I,O,T) :- + get_op(O,A), + format(C,' pc->u.~s.~s = ~sAdjust(pc->u.~s.~s);~n',[T,I,A,T,I]). + +rewritable_field(0'd). +rewritable_field(0'i). +rewritable_field(0'O). +rewritable_field(0't). + get_op(0'a,"Arity"). get_op(0'b,"CellPtoHeap"). @@ -167,8 +172,10 @@ get_op(0'L,"PtoLUClause"). get_op(0'm,"Module"). get_op(0'n,"Integer"). get_op(0'o,"Opcode"). +get_op(0'O,"OrArg"). get_op(0'p,"PtoPred"). get_op(0's,"Constant"). +get_op(0't,"TabEntry"). get_op(0'x,"X"). get_op(0'y,"Y"). % ' @@ -194,7 +201,7 @@ footer_rclause(W) :- format(W,' /* this instruction is hardwired */~n',[]), dump_ops(W,["or_last"]), format(W,'#ifdef YAPOR~n',[]), - output_typeinfo(W,"sblp"), + output_typeinfo(W,"Osblp"), format(W,'#else~n',[]), output_typeinfo(W,"p"), format(W,'#endif~n',[]),