Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3
This commit is contained in:
@@ -407,63 +407,63 @@ For implementation details and more information, please check term_t_slots in th
|
||||
/// @brief report the current position of the slots, assuming that they occupy the top of the stack.
|
||||
///
|
||||
///
|
||||
X_API Int YAP_CurrentSlot(void);
|
||||
X_API handle_t YAP_CurrentSlot(void);
|
||||
|
||||
/// @brief allocate n empty new slots
|
||||
///
|
||||
/// Return a handle to the system's default slot.
|
||||
X_API Int YAP_NewSlots(int NumberOfSlots);
|
||||
X_API handle_t YAP_NewSlots(int NumberOfSlots);
|
||||
|
||||
/// @brief allocate n empty new slots
|
||||
///
|
||||
/// Allocate _NumberOfSlots_ from the stack and return an handle to the
|
||||
/// last one. The other handle can be obtained by decrementing the handle.
|
||||
X_API Int YAP_InitSlot(YAP_Term t);
|
||||
X_API handle_t YAP_InitSlot(YAP_Term t);
|
||||
|
||||
/// @brief read from a slot.
|
||||
///
|
||||
///
|
||||
X_API YAP_Term YAP_GetFromSlot(YAP_Int slot);
|
||||
X_API YAP_Term YAP_GetFromSlot(YAP_handle_t slot);
|
||||
|
||||
/// @brief get the memory address of a slot
|
||||
///
|
||||
/// Return the address of slot _slot_: please use with care.
|
||||
X_API YAP_Term *YAP_AddressFromSlot(YAP_Int);
|
||||
X_API YAP_Term *YAP_AddressFromSlot(YAP_handle_t);
|
||||
|
||||
/// @brief get the memory address of the term actually stored in a slot
|
||||
///
|
||||
///
|
||||
X_API YAP_Term *YAP_AddressOfTermInSlot(YAP_Int);
|
||||
X_API YAP_Term *YAP_AddressOfTermInSlot(YAP_handle_t);
|
||||
|
||||
/// @brief store term in a slot
|
||||
///
|
||||
///
|
||||
X_API void YAP_PutInSlot(YAP_Int slot, YAP_Term t);
|
||||
X_API void YAP_PutInSlot(YAP_handle_t slot, YAP_Term t);
|
||||
|
||||
/// @brief Succeeds if it recovers the space allocated for $n$ contiguous slots starting at topSlot.
|
||||
///
|
||||
/// Set the contents of slot _slot_ to _t_.
|
||||
X_API int YAP_RecoverSlots(int, YAP_Int topSlot);
|
||||
X_API int YAP_RecoverSlots(int, YAP_handle_t topSlot);
|
||||
|
||||
/// @brief copies the first new n YAAM registers to slots
|
||||
///
|
||||
/// Store the current first _HowMany_ arguments in new slots.
|
||||
X_API YAP_Int YAP_ArgsToSlots(int HowMany);
|
||||
X_API YAP_handle_t YAP_ArgsToSlots(int HowMany);
|
||||
|
||||
/// @brief copies n slots such that sl is copied to the last abstract ,achine register.
|
||||
///
|
||||
/// Set the first _HowMany_ arguments to the _HowMany_ slots
|
||||
// starting at _slot_.
|
||||
X_API void YAP_SlotsToArgs(int HowMany, YAP_Int slot);
|
||||
X_API void YAP_SlotsToArgs(int HowMany, YAP_handle_t slot);
|
||||
|
||||
/// @}
|
||||
|
||||
static UInt
|
||||
static arity_t
|
||||
current_arity(void)
|
||||
{
|
||||
CACHE_REGS
|
||||
if (P && PREVOP(P,Osbpp)->opc == Yap_opcode(_call_usercpred)) {
|
||||
return PREVOP(P,Osbpp)->u.Osbpp.p->ArityOfPE;
|
||||
return PREVOP(P,Osbpp)->y_u.Osbpp.p->ArityOfPE;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
@@ -476,7 +476,7 @@ doexpand(UInt sz)
|
||||
UInt arity;
|
||||
|
||||
if (P && PREVOP(P,Osbpp)->opc == Yap_opcode(_call_usercpred)) {
|
||||
arity = PREVOP(P,Osbpp)->u.Osbpp.p->ArityOfPE;
|
||||
arity = PREVOP(P,Osbpp)->y_u.Osbpp.p->ArityOfPE;
|
||||
} else {
|
||||
arity = 0;
|
||||
}
|
||||
@@ -1068,7 +1068,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.OtapFs.extra));
|
||||
ptr = (void *)(((CELL *)(Yap_REGS.CUT_C_TOP))-(((yamop *)Yap_REGS.CUT_C_TOP->try_userc_cut_yamop)->y_u.OtapFs.extra));
|
||||
|
||||
RECOVER_B();
|
||||
return(ptr);
|
||||
@@ -1083,7 +1083,7 @@ YAP_ExtraSpace(void)
|
||||
BACKUP_H();
|
||||
|
||||
/* find a pointer to extra space allocable */
|
||||
ptr = (void *)((CELL *)(B+1)+P->u.OtapFs.s);
|
||||
ptr = (void *)((CELL *)(B+1)+P->y_u.OtapFs.s);
|
||||
B->cp_h = HR;
|
||||
|
||||
RECOVER_H();
|
||||
@@ -2294,15 +2294,20 @@ YAP_EnterGoal(PredEntry *pe, Term *ptr, YAP_dogoalinfo *dgi)
|
||||
dgi->cp = CP;
|
||||
dgi->CurSlot = LOCAL_CurSlot;
|
||||
// ensure our current ENV receives current P.
|
||||
|
||||
Yap_PrepGoal(pe->ArityOfPE, ptr, B PASS_REGS);
|
||||
P = pe->CodeOfPred;
|
||||
dgi->b = LCL0-(CELL*)B;
|
||||
{ CACHE_REGS __android_log_print(ANDROID_LOG_ERROR, __FUNCTION__, "EMUL IN Yap_regp=%p LCL0=(%p) %x", &Yap_REGS, LCL0, LCL0[-15]) ; }
|
||||
out = run_emulator(dgi PASS_REGS);
|
||||
//{ CACHE_REGS __android_log_print(ANDROID_LOG_ERROR, __FUNCTION__, "EMUL DONE Yap_regp=%p LCL0=(%p) %x", &Yap_REGS, LCL0, LCL0[-15]) ; }
|
||||
RECOVER_MACHINE_REGS();
|
||||
if (out) {
|
||||
LOCAL_CurSlot = dgi->CurSlot; // ignore any slots created within the called goal
|
||||
Yap_StartSlots( PASS_REGS1 );
|
||||
} else {
|
||||
LOCAL_CurSlot = dgi->CurSlot; // ignore any slots created within the called goal
|
||||
}
|
||||
{ CACHE_REGS __android_log_print(ANDROID_LOG_ERROR, __FUNCTION__, "EMUL DONE %d", out) ; }
|
||||
return out;
|
||||
}
|
||||
|
||||
@@ -2986,6 +2991,7 @@ YAP_Init(YAP_init_args *yap_init)
|
||||
if (initialised)
|
||||
return YAP_BOOT_DONE_BEFOREHAND;
|
||||
initialised = TRUE;
|
||||
__android_log_print(ANDROID_LOG_INFO, "c_interface.c", "entered init %p", yap_init);
|
||||
|
||||
Yap_InitPageSize(); /* init memory page size, required by later functions */
|
||||
#if defined(YAPOR_COPY) || defined(YAPOR_COW) || defined(YAPOR_SBA)
|
||||
@@ -3065,6 +3071,7 @@ YAP_Init(YAP_init_args *yap_init)
|
||||
if (restore_result == FAIL_RESTORE) {
|
||||
yap_init->ErrorNo = LOCAL_Error_TYPE;
|
||||
yap_init->ErrorCause = LOCAL_ErrorMessage;
|
||||
__android_log_print(ANDROID_LOG_INFO, __FILE__, "restore failed, %s ", LOCAL_ErrorMessage);
|
||||
/* shouldn't RECOVER_MACHINE_REGS(); be here ??? */
|
||||
return YAP_BOOT_ERROR;
|
||||
}
|
||||
@@ -3101,6 +3108,7 @@ YAP_Init(YAP_init_args *yap_init)
|
||||
#endif /* YAPOR */
|
||||
RECOVER_MACHINE_REGS();
|
||||
}
|
||||
__android_log_print(ANDROID_LOG_INFO, __FILE__, "after loading startup %p", yap_init);
|
||||
/* make sure we do this after restore */
|
||||
if (yap_init->MaxStackSize) {
|
||||
GLOBAL_AllowLocalExpansion = FALSE;
|
||||
@@ -3117,7 +3125,7 @@ YAP_Init(YAP_init_args *yap_init)
|
||||
} else {
|
||||
GLOBAL_AllowTrailExpansion = TRUE;
|
||||
}
|
||||
if (yap_init->YapPrologRCFile) {
|
||||
if (yap_init->YapPrologRCFile) {
|
||||
Yap_PutValue(AtomConsultOnBoot, MkAtomTerm(Yap_LookupAtom(yap_init->YapPrologRCFile)));
|
||||
/*
|
||||
This must be done again after restore, as yap_flags
|
||||
@@ -3125,6 +3133,7 @@ YAP_Init(YAP_init_args *yap_init)
|
||||
*/
|
||||
yap_flags[HALT_AFTER_CONSULT_FLAG] = yap_init->HaltAfterConsult;
|
||||
}
|
||||
__android_log_print(ANDROID_LOG_INFO, __FILE__, "after loading startup %s",yap_init->YapPrologRCFile);
|
||||
if (yap_init->YapPrologTopLevelGoal) {
|
||||
Yap_PutValue(AtomTopLevelGoal, MkAtomTerm(Yap_LookupAtom(yap_init->YapPrologTopLevelGoal)));
|
||||
}
|
||||
@@ -3137,6 +3146,7 @@ YAP_Init(YAP_init_args *yap_init)
|
||||
if (yap_init->QuietMode) {
|
||||
yap_flags[QUIET_MODE_FLAG] = TRUE;
|
||||
}
|
||||
__android_log_print(ANDROID_LOG_INFO, __FILE__, "after setting startup ");
|
||||
if (BOOT_FROM_SAVED_STATE && !do_bootstrap) {
|
||||
if (restore_result == FAIL_RESTORE) {
|
||||
yap_init->ErrorNo = LOCAL_Error_TYPE;
|
||||
@@ -3152,9 +3162,11 @@ YAP_Init(YAP_init_args *yap_init)
|
||||
if (restore_result == DO_ONLY_CODE) {
|
||||
/* first, initialise the saved state */
|
||||
Term t_goal = MkAtomTerm(AtomInitProlog);
|
||||
YAP_RunGoalOnce(t_goal);
|
||||
__android_log_print(ANDROID_LOG_INFO, __FILE__, "restore init goal ");
|
||||
YAP_RunGoalOnce(t_goal);
|
||||
Yap_InitYaamRegs( 0 );
|
||||
return YAP_BOOT_FROM_SAVED_CODE;
|
||||
__android_log_print(ANDROID_LOG_INFO, __FILE__, "restore done, loaded startup ");
|
||||
return YAP_BOOT_FROM_SAVED_CODE;
|
||||
} else {
|
||||
return YAP_BOOT_FROM_SAVED_STACKS;
|
||||
}
|
||||
@@ -3566,7 +3578,7 @@ X_API char *
|
||||
YAP_cwd(void)
|
||||
{
|
||||
CACHE_REGS
|
||||
char *buf;
|
||||
char *buf = NULL;
|
||||
int len;
|
||||
if (!Yap_getcwd(LOCAL_FileNameBuf, YAP_FILENAME_MAX))
|
||||
return FALSE;
|
||||
@@ -3880,11 +3892,11 @@ YAP_Erase(void *handle)
|
||||
return 1;
|
||||
}
|
||||
|
||||
X_API Int
|
||||
X_API handle_t
|
||||
YAP_ArgsToSlots(int n)
|
||||
{
|
||||
CACHE_REGS
|
||||
Int slot = Yap_NewSlots(n PASS_REGS);
|
||||
handle_t slot = Yap_NewSlots(n PASS_REGS);
|
||||
CELL *ptr0 = LCL0+slot, *ptr1=&ARG1;
|
||||
while (n--) {
|
||||
*ptr0++ = *ptr1++;
|
||||
@@ -3893,7 +3905,7 @@ YAP_ArgsToSlots(int n)
|
||||
}
|
||||
|
||||
X_API void
|
||||
YAP_SlotsToArgs(int n, Int slot)
|
||||
YAP_SlotsToArgs(int n, handle_t slot)
|
||||
{
|
||||
CACHE_REGS
|
||||
CELL *ptr0 = LCL0+slot, *ptr1=&ARG1;
|
||||
@@ -3935,8 +3947,8 @@ YAP_SetYAPFlag(yap_flag_t flag, int val)
|
||||
}
|
||||
|
||||
|
||||
/* Int YAP_VarSlotToNumber(Int) */
|
||||
Int YAP_VarSlotToNumber(Int s) {
|
||||
/* handle_t YAP_VarSlotToNumber(handle_t) */
|
||||
handle_t YAP_VarSlotToNumber(handle_t s) {
|
||||
CACHE_REGS
|
||||
Term *t = (CELL *)Deref(Yap_GetFromSlot(s PASS_REGS));
|
||||
if (t < HR)
|
||||
@@ -3950,7 +3962,7 @@ Term YAP_ModuleUser(void) {
|
||||
}
|
||||
|
||||
/* int YAP_PredicateHasClauses() */
|
||||
Int YAP_NumberOfClausesForPredicate(PredEntry *pe) {
|
||||
handle_t YAP_NumberOfClausesForPredicate(PredEntry *pe) {
|
||||
return pe->cs.p_code.NOfClauses;
|
||||
}
|
||||
|
||||
|
248
C/cdmgr.c
248
C/cdmgr.c
@@ -537,14 +537,14 @@ PredForChoicePt(yamop *p_code) {
|
||||
case _Nstop:
|
||||
return NULL;
|
||||
case _jump:
|
||||
p_code = p_code->u.l.l;
|
||||
p_code = p_code->y_u.l.l;
|
||||
break;
|
||||
case _retry_me:
|
||||
case _trust_me:
|
||||
return p_code->u.Otapl.p;
|
||||
return p_code->y_u.Otapl.p;
|
||||
case _retry_exo:
|
||||
case _retry_all_exo:
|
||||
return p_code->u.lp.p;
|
||||
return p_code->y_u.lp.p;
|
||||
case _try_logical:
|
||||
case _retry_logical:
|
||||
case _trust_logical:
|
||||
@@ -552,7 +552,7 @@ PredForChoicePt(yamop *p_code) {
|
||||
case _count_trust_logical:
|
||||
case _profiled_retry_logical:
|
||||
case _profiled_trust_logical:
|
||||
return p_code->u.OtaLl.d->ClPred;
|
||||
return p_code->y_u.OtaLl.d->ClPred;
|
||||
#ifdef TABLING
|
||||
case _trie_trust_var:
|
||||
case _trie_retry_var:
|
||||
@@ -596,19 +596,19 @@ PredForChoicePt(yamop *p_code) {
|
||||
/* compile error --> return ENV_ToP(gc_B->cp_cp); */
|
||||
#endif /* TABLING */
|
||||
case _or_else:
|
||||
if (p_code == p_code->u.Osblp.l) {
|
||||
if (p_code == p_code->y_u.Osblp.l) {
|
||||
/* repeat */
|
||||
Atom at = AtomRepeatSpace;
|
||||
return RepPredProp(PredPropByAtom(at, PROLOG_MODULE));
|
||||
} else {
|
||||
return p_code->u.Osblp.p0;
|
||||
return p_code->y_u.Osblp.p0;
|
||||
}
|
||||
break;
|
||||
case _or_last:
|
||||
#ifdef YAPOR
|
||||
return p_code->u.Osblp.p0;
|
||||
return p_code->y_u.Osblp.p0;
|
||||
#else
|
||||
return p_code->u.p.p;
|
||||
return p_code->y_u.p.p;
|
||||
#endif /* YAPOR */
|
||||
break;
|
||||
case _count_retry_me:
|
||||
@@ -619,7 +619,7 @@ PredForChoicePt(yamop *p_code) {
|
||||
p_code = NEXTOP(p_code,l);
|
||||
break;
|
||||
default:
|
||||
return p_code->u.Otapl.p;
|
||||
return p_code->y_u.Otapl.p;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
@@ -1040,7 +1040,7 @@ Yap_IPred(PredEntry *p, UInt NSlots, yamop *next_pc)
|
||||
IPred(p, NSlots, next_pc);
|
||||
}
|
||||
|
||||
#define GONEXT(TYPE) code_p = ((yamop *)(&(code_p->u.TYPE.next)))
|
||||
#define GONEXT(TYPE) code_p = ((yamop *)(&(code_p->y_u.TYPE.next)))
|
||||
|
||||
static void
|
||||
RemoveMainIndex(PredEntry *ap)
|
||||
@@ -1097,29 +1097,29 @@ static yamop *
|
||||
release_wcls(yamop *cop, OPCODE ecs)
|
||||
{
|
||||
if (cop->opc == ecs) {
|
||||
cop->u.sssllp.s3--;
|
||||
if (!cop->u.sssllp.s3) {
|
||||
UInt sz = (UInt)NEXTOP((yamop *)NULL,sssllp)+cop->u.sssllp.s1*sizeof(yamop *);
|
||||
cop->y_u.sssllp.s3--;
|
||||
if (!cop->y_u.sssllp.s3) {
|
||||
UInt sz = (UInt)NEXTOP((yamop *)NULL,sssllp)+cop->y_u.sssllp.s1*sizeof(yamop *);
|
||||
LOCK(ExpandClausesListLock);
|
||||
#ifdef DEBUG
|
||||
Yap_expand_clauses_sz -= sz;
|
||||
Yap_ExpandClauses--;
|
||||
#endif
|
||||
if (cop->u.sssllp.p->PredFlags & LogUpdatePredFlag) {
|
||||
if (cop->y_u.sssllp.p->PredFlags & LogUpdatePredFlag) {
|
||||
Yap_LUIndexSpace_EXT -= sz;
|
||||
} else {
|
||||
Yap_IndexSpace_EXT -= sz;
|
||||
}
|
||||
if (ExpandClausesFirst == cop)
|
||||
ExpandClausesFirst = cop->u.sssllp.snext;
|
||||
ExpandClausesFirst = cop->y_u.sssllp.snext;
|
||||
if (ExpandClausesLast == cop) {
|
||||
ExpandClausesLast = cop->u.sssllp.sprev;
|
||||
ExpandClausesLast = cop->y_u.sssllp.sprev;
|
||||
}
|
||||
if (cop->u.sssllp.sprev) {
|
||||
cop->u.sssllp.sprev->u.sssllp.snext = cop->u.sssllp.snext;
|
||||
if (cop->y_u.sssllp.sprev) {
|
||||
cop->y_u.sssllp.sprev->y_u.sssllp.snext = cop->y_u.sssllp.snext;
|
||||
}
|
||||
if (cop->u.sssllp.snext) {
|
||||
cop->u.sssllp.snext->u.sssllp.sprev = cop->u.sssllp.sprev;
|
||||
if (cop->y_u.sssllp.snext) {
|
||||
cop->y_u.sssllp.snext->y_u.sssllp.sprev = cop->y_u.sssllp.sprev;
|
||||
}
|
||||
UNLOCK(ExpandClausesListLock);
|
||||
Yap_InformOfRemoval(cop);
|
||||
@@ -1163,12 +1163,12 @@ cleanup_dangling_indices(yamop *ipc, yamop *beg, yamop *end, yamop *suspend_code
|
||||
case _retry2:
|
||||
case _retry3:
|
||||
case _retry4:
|
||||
decrease_ref_counter(ipc->u.l.l, beg, end, suspend_code);
|
||||
decrease_ref_counter(ipc->y_u.l.l, beg, end, suspend_code);
|
||||
ipc = NEXTOP(ipc,l);
|
||||
break;
|
||||
case _retry:
|
||||
case _trust:
|
||||
decrease_ref_counter(ipc->u.Otapl.d, beg, end, suspend_code);
|
||||
decrease_ref_counter(ipc->y_u.Otapl.d, beg, end, suspend_code);
|
||||
ipc = NEXTOP(ipc,Otapl);
|
||||
break;
|
||||
case _try_clause:
|
||||
@@ -1185,8 +1185,8 @@ cleanup_dangling_indices(yamop *ipc, yamop *beg, yamop *end, yamop *suspend_code
|
||||
case _profiled_retry_logical:
|
||||
{
|
||||
yamop *oipc = ipc;
|
||||
decrease_ref_counter(ipc->u.OtaLl.d->ClCode, beg, end, suspend_code);
|
||||
ipc = ipc->u.OtaLl.n;
|
||||
decrease_ref_counter(ipc->y_u.OtaLl.d->ClCode, beg, end, suspend_code);
|
||||
ipc = ipc->y_u.OtaLl.n;
|
||||
Yap_LUIndexSpace_CP -= (UInt)NEXTOP((yamop *)NULL,OtaLl);
|
||||
Yap_FreeCodeSpace((ADDR)oipc);
|
||||
#ifdef DEBUG
|
||||
@@ -1202,35 +1202,35 @@ cleanup_dangling_indices(yamop *ipc, yamop *beg, yamop *end, yamop *suspend_code
|
||||
Yap_DirtyCps--;
|
||||
Yap_FreedCps++;
|
||||
#endif
|
||||
decrease_ref_counter(ipc->u.OtILl.d->ClCode, beg, end, suspend_code);
|
||||
decrease_ref_counter(ipc->y_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:
|
||||
{
|
||||
yamop *oipc = ipc;
|
||||
if (ipc->u.Illss.I->ClFlags & InUseMask || ipc->u.Illss.I->ClRefCount)
|
||||
if (ipc->y_u.Illss.I->ClFlags & InUseMask || ipc->y_u.Illss.I->ClRefCount)
|
||||
return;
|
||||
#ifdef DEBUG
|
||||
Yap_DirtyCps+=ipc->u.Illss.s;
|
||||
Yap_LiveCps-=ipc->u.Illss.s;
|
||||
Yap_DirtyCps+=ipc->y_u.Illss.s;
|
||||
Yap_LiveCps-=ipc->y_u.Illss.s;
|
||||
#endif
|
||||
ipc = ipc->u.Illss.l1;
|
||||
ipc = ipc->y_u.Illss.l1;
|
||||
/* in case we visit again */
|
||||
oipc->u.Illss.l1 = FAILCODE;
|
||||
oipc->u.Illss.s = 0;
|
||||
oipc->u.Illss.e = 0;
|
||||
oipc->y_u.Illss.l1 = FAILCODE;
|
||||
oipc->y_u.Illss.s = 0;
|
||||
oipc->y_u.Illss.e = 0;
|
||||
}
|
||||
break;
|
||||
case _try_in:
|
||||
case _jump:
|
||||
case _jump_if_var:
|
||||
ipc->u.l.l = release_wcls(ipc->u.l.l, ecs);
|
||||
ipc->y_u.l.l = release_wcls(ipc->y_u.l.l, ecs);
|
||||
ipc = NEXTOP(ipc,l);
|
||||
break;
|
||||
/* instructions type xl */
|
||||
case _jump_if_nonvar:
|
||||
ipc->u.xll.l1 = release_wcls(ipc->u.xll.l1, ecs);
|
||||
ipc->y_u.xll.l1 = release_wcls(ipc->y_u.xll.l1, ecs);
|
||||
ipc = NEXTOP(ipc,xll);
|
||||
break;
|
||||
/* instructions type p */
|
||||
@@ -1239,31 +1239,31 @@ cleanup_dangling_indices(yamop *ipc, yamop *beg, yamop *end, yamop *suspend_code
|
||||
break;
|
||||
/* instructions type e */
|
||||
case _switch_on_type:
|
||||
ipc->u.llll.l1 = release_wcls(ipc->u.llll.l1, ecs);
|
||||
ipc->u.llll.l2 = release_wcls(ipc->u.llll.l2, ecs);
|
||||
ipc->u.llll.l3 = release_wcls(ipc->u.llll.l3, ecs);
|
||||
ipc->u.llll.l4 = release_wcls(ipc->u.llll.l4, ecs);
|
||||
ipc->y_u.llll.l1 = release_wcls(ipc->y_u.llll.l1, ecs);
|
||||
ipc->y_u.llll.l2 = release_wcls(ipc->y_u.llll.l2, ecs);
|
||||
ipc->y_u.llll.l3 = release_wcls(ipc->y_u.llll.l3, ecs);
|
||||
ipc->y_u.llll.l4 = release_wcls(ipc->y_u.llll.l4, ecs);
|
||||
ipc = NEXTOP(ipc,llll);
|
||||
break;
|
||||
case _switch_list_nl:
|
||||
ipc->u.ollll.l1 = release_wcls(ipc->u.ollll.l1, ecs);
|
||||
ipc->u.ollll.l2 = release_wcls(ipc->u.ollll.l2, ecs);
|
||||
ipc->u.ollll.l3 = release_wcls(ipc->u.ollll.l3, ecs);
|
||||
ipc->u.ollll.l4 = release_wcls(ipc->u.ollll.l4, ecs);
|
||||
ipc->y_u.ollll.l1 = release_wcls(ipc->y_u.ollll.l1, ecs);
|
||||
ipc->y_u.ollll.l2 = release_wcls(ipc->y_u.ollll.l2, ecs);
|
||||
ipc->y_u.ollll.l3 = release_wcls(ipc->y_u.ollll.l3, ecs);
|
||||
ipc->y_u.ollll.l4 = release_wcls(ipc->y_u.ollll.l4, ecs);
|
||||
ipc = NEXTOP(ipc,ollll);
|
||||
break;
|
||||
case _switch_on_arg_type:
|
||||
ipc->u.xllll.l1 = release_wcls(ipc->u.xllll.l1, ecs);
|
||||
ipc->u.xllll.l2 = release_wcls(ipc->u.xllll.l2, ecs);
|
||||
ipc->u.xllll.l3 = release_wcls(ipc->u.xllll.l3, ecs);
|
||||
ipc->u.xllll.l4 = release_wcls(ipc->u.xllll.l4, ecs);
|
||||
ipc->y_u.xllll.l1 = release_wcls(ipc->y_u.xllll.l1, ecs);
|
||||
ipc->y_u.xllll.l2 = release_wcls(ipc->y_u.xllll.l2, ecs);
|
||||
ipc->y_u.xllll.l3 = release_wcls(ipc->y_u.xllll.l3, ecs);
|
||||
ipc->y_u.xllll.l4 = release_wcls(ipc->y_u.xllll.l4, ecs);
|
||||
ipc = NEXTOP(ipc,xllll);
|
||||
break;
|
||||
case _switch_on_sub_arg_type:
|
||||
ipc->u.sllll.l1 = release_wcls(ipc->u.sllll.l1, ecs);
|
||||
ipc->u.sllll.l2 = release_wcls(ipc->u.sllll.l2, ecs);
|
||||
ipc->u.sllll.l3 = release_wcls(ipc->u.sllll.l3, ecs);
|
||||
ipc->u.sllll.l4 = release_wcls(ipc->u.sllll.l4, ecs);
|
||||
ipc->y_u.sllll.l1 = release_wcls(ipc->y_u.sllll.l1, ecs);
|
||||
ipc->y_u.sllll.l2 = release_wcls(ipc->y_u.sllll.l2, ecs);
|
||||
ipc->y_u.sllll.l3 = release_wcls(ipc->y_u.sllll.l3, ecs);
|
||||
ipc->y_u.sllll.l4 = release_wcls(ipc->y_u.sllll.l4, ecs);
|
||||
ipc = NEXTOP(ipc,sllll);
|
||||
break;
|
||||
case _if_not_then:
|
||||
@@ -1276,7 +1276,7 @@ cleanup_dangling_indices(yamop *ipc, yamop *beg, yamop *end, yamop *suspend_code
|
||||
case _if_cons:
|
||||
case _go_on_cons:
|
||||
/* make sure we don't leave dangling references to memory that is going to be removed */
|
||||
ipc->u.sssl.l = NULL;
|
||||
ipc->y_u.sssl.l = NULL;
|
||||
ipc = NEXTOP(ipc,sssl);
|
||||
break;
|
||||
case _op_fail:
|
||||
@@ -1755,9 +1755,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.Otapl.s = p->ArityOfPE;
|
||||
ncp->u.Otapl.p = p;
|
||||
ncp->u.Otapl.d = cp;
|
||||
ncp->y_u.Otapl.s = p->ArityOfPE;
|
||||
ncp->y_u.Otapl.p = p;
|
||||
ncp->y_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;
|
||||
@@ -1777,9 +1777,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.Otapl.s = p->ArityOfPE;
|
||||
cp->u.Otapl.p = p;
|
||||
cp->u.Otapl.d = ncp;
|
||||
cp->y_u.Otapl.s = p->ArityOfPE;
|
||||
cp->y_u.Otapl.p = p;
|
||||
cp->y_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
|
||||
@@ -1796,7 +1796,7 @@ add_first_dynamic(PredEntry *p, yamop *cp, int spy_flag)
|
||||
/* and close the code */
|
||||
ncp = NEXTOP(ncp,e);
|
||||
ncp->opc = Yap_opcode(_Ystop);
|
||||
ncp->u.l.l = cl->ClCode;
|
||||
ncp->y_u.l.l = cl->ClCode;
|
||||
}
|
||||
|
||||
/* p is already locked */
|
||||
@@ -1840,7 +1840,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.Otapl.d = q;
|
||||
p->cs.p_code.LastClause->y_u.Otapl.d = q;
|
||||
}
|
||||
|
||||
/* p is already locked */
|
||||
@@ -1856,22 +1856,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.Otapl.d = p->cs.p_code.FirstClause;
|
||||
q->u.Otapl.s = p->ArityOfPE;
|
||||
q->u.Otapl.p = p;
|
||||
q->y_u.Otapl.d = p->cs.p_code.FirstClause;
|
||||
q->y_u.Otapl.s = p->ArityOfPE;
|
||||
q->y_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.Otapl.s = p->ArityOfPE;
|
||||
cp->u.Otapl.p = p;
|
||||
cp->y_u.Otapl.s = p->ArityOfPE;
|
||||
cp->y_u.Otapl.p = p;
|
||||
p->cs.p_code.FirstClause = cp;
|
||||
q = p->CodeOfPred;
|
||||
q->u.Otapl.d = cp;
|
||||
q->u.Otapl.s = p->ArityOfPE;
|
||||
q->u.Otapl.p = p;
|
||||
q->y_u.Otapl.d = cp;
|
||||
q->y_u.Otapl.s = p->ArityOfPE;
|
||||
q->y_u.Otapl.p = p;
|
||||
|
||||
}
|
||||
|
||||
@@ -1931,7 +1931,7 @@ assertz_dynam_clause(PredEntry *p, yamop *cp)
|
||||
|
||||
q = p->cs.p_code.LastClause;
|
||||
LOCK(ClauseCodeToDynamicClause(q)->ClLock);
|
||||
q->u.Otapl.d = cp;
|
||||
q->y_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;
|
||||
@@ -1944,9 +1944,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.Otapl.d = p->CodeOfPred;
|
||||
q->u.Otapl.s = p->ArityOfPE;
|
||||
q->u.Otapl.p = p;
|
||||
q->y_u.Otapl.d = p->CodeOfPred;
|
||||
q->y_u.Otapl.s = p->ArityOfPE;
|
||||
q->y_u.Otapl.p = p;
|
||||
p->cs.p_code.NOfClauses++;
|
||||
}
|
||||
|
||||
@@ -3553,16 +3553,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.Otapl.d);
|
||||
b_ptr->cp_ap = cur_log_upd_clause(pe, b_ptr->cp_ap->y_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.Otapl.d);
|
||||
b_ptr->cp_ap = cur_clause(pe, b_ptr->cp_ap->y_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.Otapl.d);
|
||||
b_ptr->cp_ap = cur_clause(pe, b_ptr->cp_ap->y_u.Otapl.d);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4151,7 +4151,7 @@ found_idb_clause(yamop *pc, CODEADDR *startp, CODEADDR *endp)
|
||||
static PredEntry *
|
||||
found_expand_index(yamop *pc, CODEADDR *startp, CODEADDR *endp, yamop *codeptr USES_REGS)
|
||||
{
|
||||
PredEntry *pp = codeptr->u.sssllp.p;
|
||||
PredEntry *pp = codeptr->y_u.sssllp.p;
|
||||
if (pc == codeptr) {
|
||||
*startp = (CODEADDR)codeptr;
|
||||
*endp = (CODEADDR)NEXTOP(codeptr,sssllp);
|
||||
@@ -4199,30 +4199,30 @@ found_ystop(yamop *pc, int clause_code, CODEADDR *startp, CODEADDR *endp, PredEn
|
||||
}
|
||||
if (!pp) {
|
||||
/* must be an index */
|
||||
PredEntry **pep = (PredEntry **)pc->u.l.l;
|
||||
PredEntry **pep = (PredEntry **)pc->y_u.l.l;
|
||||
pp = pep[-1];
|
||||
}
|
||||
if (pp->PredFlags & LogUpdatePredFlag) {
|
||||
if (clause_code) {
|
||||
LogUpdClause *cl = ClauseCodeToLogUpdClause(pc->u.l.l);
|
||||
LogUpdClause *cl = ClauseCodeToLogUpdClause(pc->y_u.l.l);
|
||||
*startp = (CODEADDR)cl;
|
||||
*endp = (CODEADDR)cl+cl->ClSize;
|
||||
} else {
|
||||
LogUpdIndex *cl = ClauseCodeToLogUpdIndex(pc->u.l.l);
|
||||
LogUpdIndex *cl = ClauseCodeToLogUpdIndex(pc->y_u.l.l);
|
||||
*startp = (CODEADDR)cl;
|
||||
*endp = (CODEADDR)cl+cl->ClSize;
|
||||
}
|
||||
} else if (pp->PredFlags & DynamicPredFlag) {
|
||||
DynamicClause *cl = ClauseCodeToDynamicClause(pc->u.l.l);
|
||||
DynamicClause *cl = ClauseCodeToDynamicClause(pc->y_u.l.l);
|
||||
*startp = (CODEADDR)cl;
|
||||
*endp = (CODEADDR)cl+cl->ClSize;
|
||||
} else {
|
||||
if (clause_code) {
|
||||
StaticClause *cl = ClauseCodeToStaticClause(pc->u.l.l);
|
||||
StaticClause *cl = ClauseCodeToStaticClause(pc->y_u.l.l);
|
||||
*startp = (CODEADDR)cl;
|
||||
*endp = (CODEADDR)cl+cl->ClSize;
|
||||
} else {
|
||||
StaticIndex *cl = ClauseCodeToStaticIndex(pc->u.l.l);
|
||||
StaticIndex *cl = ClauseCodeToStaticIndex(pc->y_u.l.l);
|
||||
*startp = (CODEADDR)cl;
|
||||
*endp = (CODEADDR)cl+cl->ClSize;
|
||||
}
|
||||
@@ -5150,7 +5150,7 @@ Yap_UpdateTimestamps(PredEntry *ap)
|
||||
case _trust_logical:
|
||||
case _count_trust_logical:
|
||||
case _profiled_trust_logical:
|
||||
if (bptr->cp_ap->u.OtaLl.d->ClPred == ap) {
|
||||
if (bptr->cp_ap->y_u.OtaLl.d->ClPred == ap) {
|
||||
UInt ts = IntegerOfTerm(bptr->cp_args[ar]);
|
||||
if (ts != arp[0]) {
|
||||
if (arp-HR < 1024) {
|
||||
@@ -5214,7 +5214,7 @@ Yap_UpdateTimestamps(PredEntry *ap)
|
||||
case _trust_logical:
|
||||
case _count_trust_logical:
|
||||
case _profiled_trust_logical:
|
||||
if (bptr->cp_ap->u.OtaLl.d->ClPred == ap) {
|
||||
if (bptr->cp_ap->y_u.OtaLl.d->ClPred == ap) {
|
||||
UInt ts = IntegerOfTerm(bptr->cp_args[ar]);
|
||||
while (ts != arp[0])
|
||||
arp--;
|
||||
@@ -5579,9 +5579,9 @@ index_ssz(StaticIndex *x, PredEntry *pe)
|
||||
}
|
||||
/* expand clause blocks */
|
||||
while (ep) {
|
||||
if (ep->u.sssllp.p == pe)
|
||||
sz += (UInt)NEXTOP((yamop *)NULL,sssllp)+ep->u.sssllp.s1*sizeof(yamop *);
|
||||
ep = ep->u.sssllp.snext;
|
||||
if (ep->y_u.sssllp.p == pe)
|
||||
sz += (UInt)NEXTOP((yamop *)NULL,sssllp)+ep->y_u.sssllp.s1*sizeof(yamop *);
|
||||
ep = ep->y_u.sssllp.snext;
|
||||
}
|
||||
/* main indexing tree */
|
||||
sz += tree_index_ssz(x);
|
||||
@@ -5787,7 +5787,7 @@ p_env_info( USES_REGS1 )
|
||||
env_b = MkIntegerTerm((Int)(LCL0-(CELL *)env[E_CB]));
|
||||
env_cp = (yamop *)env[E_CP];
|
||||
|
||||
/* pe = PREVOP(env_cp,Osbpp)->u.Osbpp.p0; */
|
||||
/* pe = PREVOP(env_cp,Osbpp)->y_u.Osbpp.p0; */
|
||||
taddr = MkIntegerTerm((Int)env);
|
||||
return Yap_unify(ARG3,MkIntegerTerm((Int)env_cp)) &&
|
||||
Yap_unify(ARG2, taddr) &&
|
||||
@@ -5800,7 +5800,7 @@ p_cpc_info( USES_REGS1 )
|
||||
PredEntry *pe;
|
||||
yamop *ipc = (yamop *)IntegerOfTerm(Deref(ARG1));
|
||||
|
||||
pe = PREVOP(ipc,Osbpp)->u.Osbpp.p0;
|
||||
pe = PREVOP(ipc,Osbpp)->y_u.Osbpp.p0;
|
||||
return UnifyPredInfo(pe, 2 PASS_REGS) &&
|
||||
Yap_unify(ARG5,MkIntegerTerm(ClauseId(ipc,pe)));
|
||||
}
|
||||
@@ -5903,21 +5903,21 @@ p_choicepoint_info( USES_REGS1 )
|
||||
case _count_trust_logical:
|
||||
case _profiled_retry_logical:
|
||||
case _profiled_trust_logical:
|
||||
ncl = ipc->u.OtaLl.d->ClCode;
|
||||
pe = ipc->u.OtaLl.d->ClPred;
|
||||
ncl = ipc->y_u.OtaLl.d->ClCode;
|
||||
pe = ipc->y_u.OtaLl.d->ClPred;
|
||||
t = BuildActivePred(pe, cptr->cp_args);
|
||||
break;
|
||||
case _or_else:
|
||||
pe = ipc->u.Osblp.p0;
|
||||
pe = ipc->y_u.Osblp.p0;
|
||||
ncl = ipc;
|
||||
t = Yap_MkNewApplTerm(FunctorOr, 2);
|
||||
break;
|
||||
|
||||
case _or_last:
|
||||
#ifdef YAPOR
|
||||
pe = ipc->u.Osblp.p0;
|
||||
pe = ipc->y_u.Osblp.p0;
|
||||
#else
|
||||
pe = ipc->u.p.p;
|
||||
pe = ipc->y_u.p.p;
|
||||
#endif
|
||||
ncl = ipc;
|
||||
t = Yap_MkNewApplTerm(FunctorOr, 2);
|
||||
@@ -5929,26 +5929,26 @@ p_choicepoint_info( USES_REGS1 )
|
||||
t = TermNil;
|
||||
ipc = NEXTOP(ipc,l);
|
||||
if (!ncl)
|
||||
ncl = ipc->u.Otapl.d;
|
||||
ncl = ipc->y_u.Otapl.d;
|
||||
go_on = TRUE;
|
||||
break;
|
||||
case _jump:
|
||||
pe = NULL;
|
||||
t = TermNil;
|
||||
ipc = ipc->u.l.l;
|
||||
ipc = ipc->y_u.l.l;
|
||||
go_on = TRUE;
|
||||
break;
|
||||
case _retry_c:
|
||||
case _retry_userc:
|
||||
ncl = NEXTOP(ipc,OtapFs);
|
||||
pe = ipc->u.OtapFs.p;
|
||||
pe = ipc->y_u.OtapFs.p;
|
||||
t = BuildActivePred(pe, cptr->cp_args);
|
||||
break;
|
||||
case _retry_profiled:
|
||||
case _count_retry:
|
||||
pe = NULL;
|
||||
t = TermNil;
|
||||
ncl = ipc->u.Otapl.d;
|
||||
ncl = ipc->y_u.Otapl.d;
|
||||
ipc = NEXTOP(ipc,p);
|
||||
go_on = TRUE;
|
||||
break;
|
||||
@@ -5963,14 +5963,14 @@ p_choicepoint_info( USES_REGS1 )
|
||||
case _retry:
|
||||
case _trust:
|
||||
if (!ncl)
|
||||
ncl = ipc->u.Otapl.d;
|
||||
pe = ipc->u.Otapl.p;
|
||||
ncl = ipc->y_u.Otapl.d;
|
||||
pe = ipc->y_u.Otapl.p;
|
||||
t = BuildActivePred(pe, cptr->cp_args);
|
||||
break;
|
||||
case _retry_exo:
|
||||
case _retry_all_exo:
|
||||
ncl = NULL;
|
||||
pe = ipc->u.lp.p;
|
||||
pe = ipc->y_u.lp.p;
|
||||
t = BuildActivePred(pe, cptr->cp_args);
|
||||
break;
|
||||
case _Nstop:
|
||||
@@ -6031,61 +6031,61 @@ store_dbcl_size(yamop *pc, UInt arity, Term t0, PredEntry *pe)
|
||||
case 2:
|
||||
pc->opc = Yap_opcode(_get_2atoms);
|
||||
DerefAndCheck(t, tp[0]);
|
||||
pc->u.cc.c1 = t;
|
||||
pc->y_u.cc.c1 = t;
|
||||
DerefAndCheck(t, tp[1]);
|
||||
pc->u.cc.c2 = t;
|
||||
pc->y_u.cc.c2 = t;
|
||||
pc = NEXTOP(pc,cc);
|
||||
break;
|
||||
case 3:
|
||||
pc->opc = Yap_opcode(_get_3atoms);
|
||||
DerefAndCheck(t, tp[0]);
|
||||
pc->u.ccc.c1 = t;
|
||||
pc->y_u.ccc.c1 = t;
|
||||
DerefAndCheck(t, tp[1]);
|
||||
pc->u.ccc.c2 = t;
|
||||
pc->y_u.ccc.c2 = t;
|
||||
DerefAndCheck(t, tp[2]);
|
||||
pc->u.ccc.c3 = t;
|
||||
pc->y_u.ccc.c3 = t;
|
||||
pc = NEXTOP(pc,ccc);
|
||||
break;
|
||||
case 4:
|
||||
pc->opc = Yap_opcode(_get_4atoms);
|
||||
DerefAndCheck(t, tp[0]);
|
||||
pc->u.cccc.c1 = t;
|
||||
pc->y_u.cccc.c1 = t;
|
||||
DerefAndCheck(t, tp[1]);
|
||||
pc->u.cccc.c2 = t;
|
||||
pc->y_u.cccc.c2 = t;
|
||||
DerefAndCheck(t, tp[2]);
|
||||
pc->u.cccc.c3 = t;
|
||||
pc->y_u.cccc.c3 = t;
|
||||
DerefAndCheck(t, tp[3]);
|
||||
pc->u.cccc.c4 = t;
|
||||
pc->y_u.cccc.c4 = t;
|
||||
pc = NEXTOP(pc,cccc);
|
||||
break;
|
||||
case 5:
|
||||
pc->opc = Yap_opcode(_get_5atoms);
|
||||
DerefAndCheck(t, tp[0]);
|
||||
pc->u.ccccc.c1 = t;
|
||||
pc->y_u.ccccc.c1 = t;
|
||||
DerefAndCheck(t, tp[1]);
|
||||
pc->u.ccccc.c2 = t;
|
||||
pc->y_u.ccccc.c2 = t;
|
||||
DerefAndCheck(t, tp[2]);
|
||||
pc->u.ccccc.c3 = t;
|
||||
pc->y_u.ccccc.c3 = t;
|
||||
DerefAndCheck(t, tp[3]);
|
||||
pc->u.ccccc.c4 = t;
|
||||
pc->y_u.ccccc.c4 = t;
|
||||
DerefAndCheck(t, tp[4]);
|
||||
pc->u.ccccc.c5 = t;
|
||||
pc->y_u.ccccc.c5 = t;
|
||||
pc = NEXTOP(pc,ccccc);
|
||||
break;
|
||||
case 6:
|
||||
pc->opc = Yap_opcode(_get_6atoms);
|
||||
DerefAndCheck(t, tp[0]);
|
||||
pc->u.cccccc.c1 = t;
|
||||
pc->y_u.cccccc.c1 = t;
|
||||
DerefAndCheck(t, tp[1]);
|
||||
pc->u.cccccc.c2 = t;
|
||||
pc->y_u.cccccc.c2 = t;
|
||||
DerefAndCheck(t, tp[2]);
|
||||
pc->u.cccccc.c3 = t;
|
||||
pc->y_u.cccccc.c3 = t;
|
||||
DerefAndCheck(t, tp[3]);
|
||||
pc->u.cccccc.c4 = t;
|
||||
pc->y_u.cccccc.c4 = t;
|
||||
DerefAndCheck(t, tp[4]);
|
||||
pc->u.cccccc.c5 = t;
|
||||
pc->y_u.cccccc.c5 = t;
|
||||
DerefAndCheck(t, tp[5]);
|
||||
pc->u.cccccc.c6 = t;
|
||||
pc->y_u.cccccc.c6 = t;
|
||||
pc = NEXTOP(pc,cccccc);
|
||||
break;
|
||||
default:
|
||||
@@ -6094,12 +6094,12 @@ store_dbcl_size(yamop *pc, UInt arity, Term t0, PredEntry *pe)
|
||||
for (i = 0; i< arity; i++) {
|
||||
pc->opc = Yap_opcode(_get_atom);
|
||||
#if PRECOMPUTE_REGADDRESS
|
||||
pc->u.xc.x = (CELL) (XREGS + (i+1));
|
||||
pc->y_u.xc.x = (CELL) (XREGS + (i+1));
|
||||
#else
|
||||
pc->u.xc.x = i+1;
|
||||
pc->y_u.xc.x = i+1;
|
||||
#endif
|
||||
DerefAndCheck(t, tp[0]);
|
||||
pc->u.xc.c = t;
|
||||
pc->y_u.xc.c = t;
|
||||
tp++;
|
||||
pc = NEXTOP(pc,xc);
|
||||
}
|
||||
@@ -6107,7 +6107,7 @@ store_dbcl_size(yamop *pc, UInt arity, Term t0, PredEntry *pe)
|
||||
break;
|
||||
}
|
||||
pc->opc = Yap_opcode(_procceed);
|
||||
pc->u.p.p = pe;
|
||||
pc->y_u.p.p = pe;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@@ -75,22 +75,22 @@ Yap_ClauseListExtend(clause_list_t cl, void * clause, void *pred)
|
||||
fclause = ptr[-1];
|
||||
code_p = (yamop *)(ptr-1);
|
||||
code_p->opc = Yap_opcode(_try_clause);
|
||||
code_p->u.Otapl.d = fclause;
|
||||
code_p->u.Otapl.s = ap->ArityOfPE;
|
||||
code_p->u.Otapl.p = ap;
|
||||
code_p->y_u.Otapl.d = fclause;
|
||||
code_p->y_u.Otapl.s = ap->ArityOfPE;
|
||||
code_p->y_u.Otapl.p = ap;
|
||||
#ifdef TABLING
|
||||
code_p->u.Otapl.te = ap->TableOfPred;
|
||||
code_p->y_u.Otapl.te = ap->TableOfPred;
|
||||
#endif
|
||||
#ifdef YAPOR
|
||||
INIT_YAMOP_LTT(code_p, 0);
|
||||
#endif /* YAPOR */
|
||||
code_p = NEXTOP(code_p,Otapl);
|
||||
code_p->opc = Yap_opcode(_trust);
|
||||
code_p->u.Otapl.d = clause;
|
||||
code_p->u.Otapl.s = ap->ArityOfPE;
|
||||
code_p->u.Otapl.p = ap;
|
||||
code_p->y_u.Otapl.d = clause;
|
||||
code_p->y_u.Otapl.s = ap->ArityOfPE;
|
||||
code_p->y_u.Otapl.p = ap;
|
||||
#ifdef TABLING
|
||||
code_p->u.Otapl.te = ap->TableOfPred;
|
||||
code_p->y_u.Otapl.te = ap->TableOfPred;
|
||||
#endif
|
||||
#ifdef YAPOR
|
||||
INIT_YAMOP_LTT(code_p, 0);
|
||||
@@ -100,11 +100,11 @@ Yap_ClauseListExtend(clause_list_t cl, void * clause, void *pred)
|
||||
|
||||
if (!(code_p = (yamop *)extend_blob(cl->start,((CELL)NEXTOP((yamop *)NULL,Otapl))/sizeof(CELL) PASS_REGS))) return FALSE;
|
||||
code_p->opc = Yap_opcode(_trust);
|
||||
code_p->u.Otapl.d = clause;
|
||||
code_p->u.Otapl.s = ap->ArityOfPE;
|
||||
code_p->u.Otapl.p = ap;
|
||||
code_p->y_u.Otapl.d = clause;
|
||||
code_p->y_u.Otapl.s = ap->ArityOfPE;
|
||||
code_p->y_u.Otapl.p = ap;
|
||||
#ifdef TABLING
|
||||
code_p->u.Otapl.te = ap->TableOfPred;
|
||||
code_p->y_u.Otapl.te = ap->TableOfPred;
|
||||
#endif
|
||||
#ifdef YAPOR
|
||||
INIT_YAMOP_LTT(code_p, 0);
|
||||
|
32
C/dbase.c
32
C/dbase.c
@@ -3614,14 +3614,14 @@ index_sz(LogUpdIndex *x)
|
||||
endop = Yap_opcode(_profiled_trust_logical);
|
||||
else
|
||||
endop = Yap_opcode(_trust_logical);
|
||||
start = start->u.Illss.l1;
|
||||
if (start->u.Illss.s) do {
|
||||
start = start->y_u.Illss.l1;
|
||||
if (start->y_u.Illss.s) do {
|
||||
sz += (UInt)NEXTOP((yamop*)NULL,OtaLl);
|
||||
op1 = start->opc;
|
||||
count++;
|
||||
if (start->u.OtaLl.d->ClFlags & ErasedMask)
|
||||
if (start->y_u.OtaLl.d->ClFlags & ErasedMask)
|
||||
dead++;
|
||||
start = start->u.OtaLl.n;
|
||||
start = start->y_u.OtaLl.n;
|
||||
} while (op1 != endop);
|
||||
}
|
||||
x = x->ChildIndex;
|
||||
@@ -3656,9 +3656,9 @@ lu_statistics(PredEntry *pe USES_REGS)
|
||||
/* expand clause blocks */
|
||||
yamop *ep = ExpandClausesFirst;
|
||||
while (ep) {
|
||||
if (ep->u.sssllp.p == pe)
|
||||
isz += (UInt)NEXTOP((yamop *)NULL,sssllp)+ep->u.sssllp.s1*sizeof(yamop *);
|
||||
ep = ep->u.sssllp.snext;
|
||||
if (ep->y_u.sssllp.p == pe)
|
||||
isz += (UInt)NEXTOP((yamop *)NULL,sssllp)+ep->y_u.sssllp.s1*sizeof(yamop *);
|
||||
ep = ep->y_u.sssllp.snext;
|
||||
}
|
||||
isz += index_sz(ClauseCodeToLogUpdIndex(pe->cs.p_code.TrueCodeOfPred));
|
||||
}
|
||||
@@ -3915,7 +3915,7 @@ find_next_clause(DBRef ref0 USES_REGS)
|
||||
static Int
|
||||
p_jump_to_next_dynamic_clause( USES_REGS1 )
|
||||
{
|
||||
DBRef ref = (DBRef)(((yamop *)((CODEADDR)P-(CELL)NEXTOP((yamop *)NULL,Osbpp)))->u.Osbpp.bmap);
|
||||
DBRef ref = (DBRef)(((yamop *)((CODEADDR)P-(CELL)NEXTOP((yamop *)NULL,Osbpp)))->y_u.Osbpp.bmap);
|
||||
yamop *newp = find_next_clause(ref PASS_REGS);
|
||||
|
||||
if (newp == NULL) {
|
||||
@@ -4070,20 +4070,20 @@ MyEraseClause(DynamicClause *clau USES_REGS)
|
||||
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,Otapl)->u.Osbpp.bmap;
|
||||
ref = (DBRef) NEXTOP(clau->ClCode,Otapl)->y_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.Otapl.d = find_next_clause((DBRef)(NEXTOP(P,Otapl)->u.Osbpp.bmap) PASS_REGS);
|
||||
if (np->u.Otapl.d == NULL)
|
||||
np->y_u.Otapl.d = find_next_clause((DBRef)(NEXTOP(P,Otapl)->y_u.Osbpp.bmap) PASS_REGS);
|
||||
if (np->y_u.Otapl.d == NULL)
|
||||
P = (yamop *)FAILCODE;
|
||||
else {
|
||||
/* with same arity as before */
|
||||
np->u.Otapl.s = P->u.Otapl.s;
|
||||
np->u.Otapl.p = P->u.Otapl.p;
|
||||
np->y_u.Otapl.s = P->y_u.Otapl.s;
|
||||
np->y_u.Otapl.p = P->y_u.Otapl.p;
|
||||
/* go ahead and try this code */
|
||||
P = np;
|
||||
}
|
||||
@@ -4134,7 +4134,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.Otapl.d = code_p->u.Otapl.d;
|
||||
prev_code_p->y_u.Otapl.d = code_p->y_u.Otapl.d;
|
||||
/* are we the last? */
|
||||
if (p->cs.p_code.LastClause == cl)
|
||||
p->cs.p_code.LastClause = prev_code_p;
|
||||
@@ -4143,7 +4143,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.Otapl.d;
|
||||
p->cs.p_code.FirstClause = code_p->y_u.Otapl.d;
|
||||
p->cs.p_code.FirstClause->opc =
|
||||
Yap_opcode(_try_me);
|
||||
}
|
||||
@@ -4158,7 +4158,7 @@ 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.Otapl.d = p->cs.p_code.FirstClause;
|
||||
code_p->y_u.Otapl.d = p->cs.p_code.FirstClause;
|
||||
p->cs.p_code.TrueCodeOfPred = NEXTOP(code_p, Otapl);
|
||||
if (p->PredFlags & (SpiedPredFlag|CountPredFlag|ProfiledPredFlag)) {
|
||||
p->OpcodeOfPred = Yap_opcode(_spy_pred);
|
||||
|
6
C/exec.c
6
C/exec.c
@@ -1587,9 +1587,9 @@ static int is_cleanup_cp(choiceptr cp_b)
|
||||
if (cp_b->cp_ap->opc != ORLAST_OPCODE)
|
||||
return FALSE;
|
||||
#ifdef YAPOR
|
||||
pe = cp_b->cp_ap->u.Osblp.p0;
|
||||
pe = cp_b->cp_ap->y_u.Osblp.p0;
|
||||
#else
|
||||
pe = cp_b->cp_ap->u.p.p;
|
||||
pe = cp_b->cp_ap->y_u.p.p;
|
||||
#endif /* YAPOR */
|
||||
/*
|
||||
it has to be a cleanup and it has to be a completed goal,
|
||||
@@ -1902,7 +1902,7 @@ Yap_dogc( int extra_args, Term *tp USES_REGS )
|
||||
int i;
|
||||
|
||||
if (P && PREVOP(P,Osbpp)->opc == Yap_opcode(_call_usercpred)) {
|
||||
arity = PREVOP(P,Osbpp)->u.Osbpp.p->ArityOfPE;
|
||||
arity = PREVOP(P,Osbpp)->y_u.Osbpp.p->ArityOfPE;
|
||||
nextpc = P;
|
||||
} else {
|
||||
arity = 0;
|
||||
|
16
C/exo.c
16
C/exo.c
@@ -467,30 +467,30 @@ add_index(struct index_t **ip, UInt bmap, PredEntry *ap, UInt count)
|
||||
ptr->opc = Yap_opcode(_try_exo);
|
||||
else
|
||||
ptr->opc = Yap_opcode(_try_all_exo);
|
||||
ptr->u.lp.l = (yamop *)i;
|
||||
ptr->u.lp.p = ap;
|
||||
ptr->y_u.lp.l = (yamop *)i;
|
||||
ptr->y_u.lp.p = ap;
|
||||
ptr = NEXTOP(ptr, lp);
|
||||
if (count)
|
||||
ptr->opc = Yap_opcode(_retry_exo);
|
||||
else
|
||||
ptr->opc = Yap_opcode(_retry_all_exo);
|
||||
ptr->u.lp.p = ap;
|
||||
ptr->u.lp.l = (yamop *)i;
|
||||
ptr->y_u.lp.p = ap;
|
||||
ptr->y_u.lp.l = (yamop *)i;
|
||||
ptr = NEXTOP(ptr, lp);
|
||||
for (j = 0; j < i->arity; j++) {
|
||||
ptr->opc = Yap_opcode(_get_atom_exo);
|
||||
#if PRECOMPUTE_REGADDRESS
|
||||
ptr->u.x.x = (CELL) (XREGS + (j+1));
|
||||
ptr->y_u.x.x = (CELL) (XREGS + (j+1));
|
||||
#else
|
||||
ptr->u.x.x = j+1;
|
||||
ptr->y_u.x.x = j+1;
|
||||
#endif
|
||||
ptr = NEXTOP(ptr, x);
|
||||
}
|
||||
ptr->opc = Yap_opcode(_procceed);
|
||||
ptr->u.p.p = ap;
|
||||
ptr->y_u.p.p = ap;
|
||||
ptr = NEXTOP(ptr, p);
|
||||
ptr->opc = Yap_opcode(_Ystop);
|
||||
ptr->u.l.l = i->code;
|
||||
ptr->y_u.l.l = i->code;
|
||||
Yap_inform_profiler_of_clause((char *)(i->code), (char *)NEXTOP(ptr,l), ap, GPROF_INDEX);
|
||||
if (ap->PredFlags & UDIPredFlag) {
|
||||
Yap_new_udi_clause( ap, NULL, (Term)ip);
|
||||
|
@@ -934,10 +934,10 @@ prof_alrm(int signo, siginfo_t *si, void *scv)
|
||||
|
||||
if (oop == _call_cpred || oop == _call_usercpred) {
|
||||
/* doing C-code */
|
||||
current_p = PREVOP(P,Osbpp)->u.Osbpp.p->CodeOfPred;
|
||||
current_p = PREVOP(P,Osbpp)->y_u.Osbpp.p->CodeOfPred;
|
||||
} else if ((oop = Yap_op_from_opcode(P->opc)) == _execute_cpred) {
|
||||
/* doing C-code */
|
||||
current_p = P->u.pp.p->CodeOfPred;
|
||||
current_p = P->y_u.pp.p->CodeOfPred;
|
||||
} else {
|
||||
current_p = P;
|
||||
}
|
||||
|
24
C/grow.c
24
C/grow.c
@@ -1419,13 +1419,18 @@ Yap_locked_growheap(int fix_code, size_t in_size, void *cip)
|
||||
int res;
|
||||
int blob_overflow = (NOfBlobs > NOfBlobsMax);
|
||||
|
||||
#if (THREADS) || YAPOR
|
||||
res = FALSE;
|
||||
if (NOfAtoms > 2*AtomHashTableSize || blob_overflow) {
|
||||
Yap_undo_signal( YAP_CDOVF_SIGNAL );
|
||||
return TRUE;
|
||||
LOCK(GLOBAL_ThreadHandlesLock);
|
||||
// make sure that we cannot have more than a thread life
|
||||
if (Yap_NOfThreads() > 1) {
|
||||
UNLOCK(GLOBAL_ThreadHandlesLock);
|
||||
res = FALSE;
|
||||
if (NOfAtoms > 2*AtomHashTableSize || blob_overflow) {
|
||||
Yap_undo_signal( YAP_CDOVF_SIGNAL );
|
||||
UNLOCK(LOCAL_SignalLock);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
#else
|
||||
// don't release the MTHREAD lock in case we're running from the C-interface.
|
||||
if (NOfAtoms > 2*AtomHashTableSize || blob_overflow) {
|
||||
UInt n = NOfAtoms;
|
||||
if (GLOBAL_AGcThreshold)
|
||||
@@ -1438,11 +1443,14 @@ Yap_locked_growheap(int fix_code, size_t in_size, void *cip)
|
||||
res = growatomtable( PASS_REGS1 );
|
||||
} else {
|
||||
Yap_undo_signal( YAP_CDOVF_SIGNAL );
|
||||
UNLOCK(GLOBAL_ThreadHandlesLock);
|
||||
return TRUE;
|
||||
}
|
||||
LeaveGrowMode(GrowHeapMode);
|
||||
if (res)
|
||||
if (res) {
|
||||
UNLOCK(GLOBAL_ThreadHandlesLock);
|
||||
return res;
|
||||
}
|
||||
}
|
||||
#if USE_SYSTEM_MALLOC
|
||||
P = Yap_Error(OUT_OF_HEAP_ERROR,TermNil,"malloc failed");
|
||||
@@ -1451,7 +1459,7 @@ Yap_locked_growheap(int fix_code, size_t in_size, void *cip)
|
||||
res=do_growheap(fix_code, in_size, (struct intermediates *)cip, NULL, NULL, NULL PASS_REGS);
|
||||
#endif
|
||||
LeaveGrowMode(GrowHeapMode);
|
||||
#endif
|
||||
UNLOCK(GLOBAL_ThreadHandlesLock);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
93
C/heapgc.c
93
C/heapgc.c
@@ -169,11 +169,13 @@ PUSH_POINTER(CELL *v USES_REGS) {
|
||||
*LOCAL_iptop++ = v;
|
||||
}
|
||||
|
||||
#ifdef EASY_SHUNTING
|
||||
inline static void
|
||||
POP_POINTER( USES_REGS1 ) {
|
||||
if (LOCAL_iptop >= (CELL_PTR *)ASP) return;
|
||||
--LOCAL_iptop;
|
||||
}
|
||||
#endif
|
||||
|
||||
inline static void
|
||||
POPSWAP_POINTER(CELL_PTR *vp, CELL_PTR v USES_REGS) {
|
||||
@@ -451,7 +453,7 @@ push_registers(Int num_regs, yamop *nextop USES_REGS)
|
||||
/* push any live registers we might have hanging around */
|
||||
if (nextop->opc == Yap_opcode(_move_back) ||
|
||||
nextop->opc == Yap_opcode(_skip)) {
|
||||
CELL *lab = (CELL *)(nextop->u.l.l);
|
||||
CELL *lab = (CELL *)(nextop->y_u.l.l);
|
||||
CELL max = lab[0];
|
||||
Int curr = lab[1];
|
||||
lab += 2;
|
||||
@@ -547,7 +549,7 @@ pop_registers(Int num_regs, yamop *nextop USES_REGS)
|
||||
/* pop any live registers we might have hanging around */
|
||||
if (nextop->opc == Yap_opcode(_move_back) ||
|
||||
nextop->opc == Yap_opcode(_skip)) {
|
||||
CELL *lab = (CELL *)(nextop->u.l.l);
|
||||
CELL *lab = (CELL *)(nextop->y_u.l.l);
|
||||
CELL max = lab[0];
|
||||
Int curr = lab[1];
|
||||
lab += 2;
|
||||
@@ -1524,21 +1526,6 @@ mark_external_reference(CELL *ptr USES_REGS) {
|
||||
}
|
||||
}
|
||||
|
||||
static void inline
|
||||
mark_external_reference2(CELL *ptr USES_REGS) {
|
||||
CELL *next = GET_NEXT(*ptr);
|
||||
|
||||
if (ONHEAP(next)) {
|
||||
#ifdef HYBRID_SCHEME
|
||||
CELL_PTR *old = LOCAL_iptop;
|
||||
#endif
|
||||
mark_variable(ptr PASS_REGS);
|
||||
POPSWAP_POINTER(old, ptr PASS_REGS);
|
||||
} else {
|
||||
mark_code(ptr,next PASS_REGS);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* mark all heap objects accessible from the trail (which includes the active
|
||||
* general purpose registers)
|
||||
@@ -2055,8 +2042,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.Osblp.s / ((OPREG)sizeof(CELL)),
|
||||
gc_B->cp_cp->u.Osblp.bmap
|
||||
-gc_B->cp_cp->y_u.Osblp.s / ((OPREG)sizeof(CELL)),
|
||||
gc_B->cp_cp->y_u.Osblp.bmap
|
||||
PASS_REGS);
|
||||
} else {
|
||||
/* choicepoint with arguments */
|
||||
@@ -2107,10 +2094,10 @@ mark_choicepoints(register choiceptr gc_B, tr_fr_ptr saved_TR, int very_verbose
|
||||
}
|
||||
B = old_b;
|
||||
}
|
||||
nargs = rtp->u.OtapFs.s+rtp->u.OtapFs.extra;
|
||||
nargs = rtp->y_u.OtapFs.s+rtp->y_u.OtapFs.extra;
|
||||
break;
|
||||
case _jump:
|
||||
rtp = rtp->u.l.l;
|
||||
rtp = rtp->y_u.l.l;
|
||||
op = rtp->opc;
|
||||
opnum = Yap_op_from_opcode(op);
|
||||
goto restart_cp;
|
||||
@@ -2144,7 +2131,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.Otapl.s;
|
||||
nargs = rtp->y_u.Otapl.s;
|
||||
while (nargs--) {
|
||||
mark_external_reference(vars_ptr PASS_REGS);
|
||||
vars_ptr++;
|
||||
@@ -2307,15 +2294,15 @@ 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.OtaLl.n;
|
||||
yamop *end = rtp->y_u.OtaLl.n;
|
||||
while (end->opc != trust_lu &&
|
||||
end->opc != count_trust_lu &&
|
||||
end->opc != profiled_trust_lu )
|
||||
end = end->u.OtaLl.n;
|
||||
mark_ref_in_use((DBRef)end->u.OtILl.block PASS_REGS);
|
||||
end = end->y_u.OtaLl.n;
|
||||
mark_ref_in_use((DBRef)end->y_u.OtILl.block PASS_REGS);
|
||||
}
|
||||
/* mark timestamp */
|
||||
nargs = rtp->u.OtaLl.s+1;
|
||||
nargs = rtp->y_u.OtaLl.s+1;
|
||||
break;
|
||||
case _count_retry_logical:
|
||||
{
|
||||
@@ -2324,13 +2311,13 @@ 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.OtaLl.n;
|
||||
yamop *end = rtp->y_u.OtaLl.n;
|
||||
while (Yap_op_from_opcode(end->opc) != _count_trust_logical)
|
||||
end = end->u.OtaLl.n;
|
||||
mark_ref_in_use((DBRef)end->u.OtILl.block PASS_REGS);
|
||||
end = end->y_u.OtaLl.n;
|
||||
mark_ref_in_use((DBRef)end->y_u.OtILl.block PASS_REGS);
|
||||
}
|
||||
/* mark timestamp */
|
||||
nargs = rtp->u.OtaLl.s+1;
|
||||
nargs = rtp->y_u.OtaLl.s+1;
|
||||
break;
|
||||
case _profiled_retry_logical:
|
||||
{
|
||||
@@ -2339,28 +2326,28 @@ 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.OtaLl.n;
|
||||
yamop *end = rtp->y_u.OtaLl.n;
|
||||
while (Yap_op_from_opcode(end->opc) != _profiled_trust_logical)
|
||||
end = end->u.OtaLl.n;
|
||||
mark_ref_in_use((DBRef)end->u.OtILl.block PASS_REGS);
|
||||
end = end->y_u.OtaLl.n;
|
||||
mark_ref_in_use((DBRef)end->y_u.OtILl.block PASS_REGS);
|
||||
}
|
||||
/* mark timestamp */
|
||||
nargs = rtp->u.OtaLl.s+1;
|
||||
nargs = rtp->y_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.OtILl.block PASS_REGS);
|
||||
nargs = rtp->u.OtILl.d->ClPred->ArityOfPE+1;
|
||||
mark_ref_in_use((DBRef)rtp->y_u.OtILl.block PASS_REGS);
|
||||
nargs = rtp->y_u.OtILl.d->ClPred->ArityOfPE+1;
|
||||
break;
|
||||
case _retry_exo:
|
||||
case _retry_exo_udi:
|
||||
case _retry_all_exo:
|
||||
nargs = rtp->u.lp.p->ArityOfPE;
|
||||
nargs = rtp->y_u.lp.p->ArityOfPE;
|
||||
break;
|
||||
case _retry_udi:
|
||||
nargs = rtp->u.p.p->ArityOfPE;
|
||||
nargs = rtp->y_u.p.p->ArityOfPE;
|
||||
break;
|
||||
#ifdef DEBUG
|
||||
case _retry_me:
|
||||
@@ -2375,14 +2362,14 @@ mark_choicepoints(register choiceptr gc_B, tr_fr_ptr saved_TR, int very_verbose
|
||||
fprintf(stderr,"OOPS in GC: gc not supported in this case!!!\n");
|
||||
exit(1);
|
||||
}
|
||||
nargs = rtp->u.Otapl.s;
|
||||
nargs = rtp->y_u.Otapl.s;
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr, "OOPS in GC: Unexpected opcode: %d\n", opnum);
|
||||
nargs = 0;
|
||||
#else
|
||||
default:
|
||||
nargs = rtp->u.Otapl.s;
|
||||
nargs = rtp->y_u.Otapl.s;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -2399,8 +2386,8 @@ mark_choicepoints(register choiceptr gc_B, tr_fr_ptr saved_TR, int very_verbose
|
||||
pt->opc != count_trust_lu &&
|
||||
pt->opc != profiled_trust_lu
|
||||
)
|
||||
pt = pt->u.OtaLl.n;
|
||||
mark_ref_in_use((DBRef)pt->u.OtILl.block PASS_REGS);
|
||||
pt = pt->y_u.OtaLl.n;
|
||||
mark_ref_in_use((DBRef)pt->y_u.OtILl.block PASS_REGS);
|
||||
}
|
||||
}
|
||||
/* for each saved register */
|
||||
@@ -3050,8 +3037,8 @@ sweep_choicepoints(choiceptr gc_B USES_REGS)
|
||||
case _or_last:
|
||||
|
||||
sweep_environments((CELL_PTR)(gc_B->cp_a1),
|
||||
-gc_B->cp_cp->u.Osblp.s / ((OPREG)sizeof(CELL)),
|
||||
gc_B->cp_cp->u.Osblp.bmap
|
||||
-gc_B->cp_cp->y_u.Osblp.s / ((OPREG)sizeof(CELL)),
|
||||
gc_B->cp_cp->y_u.Osblp.bmap
|
||||
PASS_REGS);
|
||||
break;
|
||||
case _retry_profiled:
|
||||
@@ -3061,7 +3048,7 @@ sweep_choicepoints(choiceptr gc_B USES_REGS)
|
||||
opnum = Yap_op_from_opcode(op);
|
||||
goto restart_cp;
|
||||
case _jump:
|
||||
rtp = rtp->u.l.l;
|
||||
rtp = rtp->y_u.l.l;
|
||||
op = rtp->opc;
|
||||
opnum = Yap_op_from_opcode(op);
|
||||
goto restart_cp;
|
||||
@@ -3094,7 +3081,7 @@ sweep_choicepoints(choiceptr gc_B USES_REGS)
|
||||
CELL *vars_ptr, vars;
|
||||
sweep_environments(gc_B->cp_env, EnvSize(gc_B->cp_cp), EnvBMap(gc_B->cp_cp) PASS_REGS);
|
||||
vars_ptr = (CELL *)(GEN_CP(gc_B) + 1);
|
||||
nargs = rtp->u.Otapl.s;
|
||||
nargs = rtp->y_u.Otapl.s;
|
||||
while(nargs--) {
|
||||
CELL cp_cell = *vars_ptr;
|
||||
if (MARKED_PTR(vars_ptr)) {
|
||||
@@ -3288,12 +3275,12 @@ sweep_choicepoints(choiceptr gc_B USES_REGS)
|
||||
case _count_retry_logical:
|
||||
case _profiled_retry_logical:
|
||||
/* sweep timestamp */
|
||||
sweep_b(gc_B, rtp->u.OtaLl.s+1 PASS_REGS);
|
||||
sweep_b(gc_B, rtp->y_u.OtaLl.s+1 PASS_REGS);
|
||||
break;
|
||||
case _trust_logical:
|
||||
case _count_trust_logical:
|
||||
case _profiled_trust_logical:
|
||||
sweep_b(gc_B, rtp->u.OtILl.d->ClPred->ArityOfPE+1 PASS_REGS);
|
||||
sweep_b(gc_B, rtp->y_u.OtILl.d->ClPred->ArityOfPE+1 PASS_REGS);
|
||||
break;
|
||||
case _retry2:
|
||||
sweep_b(gc_B, 2 PASS_REGS);
|
||||
@@ -3305,12 +3292,12 @@ sweep_choicepoints(choiceptr gc_B USES_REGS)
|
||||
sweep_b(gc_B, 4 PASS_REGS);
|
||||
break;
|
||||
case _retry_udi:
|
||||
sweep_b(gc_B, rtp->u.p.p->ArityOfPE PASS_REGS);
|
||||
sweep_b(gc_B, rtp->y_u.p.p->ArityOfPE PASS_REGS);
|
||||
break;
|
||||
case _retry_exo:
|
||||
case _retry_exo_udi:
|
||||
case _retry_all_exo:
|
||||
sweep_b(gc_B, rtp->u.lp.p->ArityOfPE PASS_REGS);
|
||||
sweep_b(gc_B, rtp->y_u.lp.p->ArityOfPE PASS_REGS);
|
||||
break;
|
||||
case _retry_c:
|
||||
case _retry_userc:
|
||||
@@ -3318,8 +3305,8 @@ sweep_choicepoints(choiceptr gc_B USES_REGS)
|
||||
register CELL_PTR saved_reg;
|
||||
|
||||
/* for each extra saved register */
|
||||
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;
|
||||
for (saved_reg = &(gc_B->cp_a1)+rtp->y_u.OtapFs.s;
|
||||
saved_reg < &(gc_B->cp_a1)+rtp->y_u.OtapFs.s+rtp->y_u.OtapFs.extra;
|
||||
saved_reg++) {
|
||||
CELL cp_cell = *saved_reg;
|
||||
if (MARKED_PTR(saved_reg)) {
|
||||
@@ -3332,7 +3319,7 @@ sweep_choicepoints(choiceptr gc_B USES_REGS)
|
||||
}
|
||||
/* continue to clean environments and arguments */
|
||||
default:
|
||||
sweep_b(gc_B,rtp->u.Otapl.s PASS_REGS);
|
||||
sweep_b(gc_B,rtp->y_u.Otapl.s PASS_REGS);
|
||||
}
|
||||
|
||||
/* link to prev choicepoint */
|
||||
|
96
C/init.c
96
C/init.c
@@ -483,22 +483,22 @@ Yap_InitCPred(const char *Name, UInt Arity, CPredicate code, UInt flags)
|
||||
p_code->opc = Yap_opcode(_call_usercpred);
|
||||
else
|
||||
p_code->opc = Yap_opcode(_call_cpred);
|
||||
p_code->u.Osbpp.bmap = NULL;
|
||||
p_code->u.Osbpp.s = -Signed(RealEnvSize);
|
||||
p_code->u.Osbpp.p =
|
||||
p_code->u.Osbpp.p0 =
|
||||
p_code->y_u.Osbpp.bmap = NULL;
|
||||
p_code->y_u.Osbpp.s = -Signed(RealEnvSize);
|
||||
p_code->y_u.Osbpp.p =
|
||||
p_code->y_u.Osbpp.p0 =
|
||||
pe;
|
||||
p_code = NEXTOP(p_code,Osbpp);
|
||||
if (!(flags & SafePredFlag)) {
|
||||
p_code->opc = Yap_opcode(_deallocate);
|
||||
p_code->u.p.p = pe;
|
||||
p_code->y_u.p.p = pe;
|
||||
p_code = NEXTOP(p_code,p);
|
||||
}
|
||||
p_code->opc = Yap_opcode(_procceed);
|
||||
p_code->u.p.p = pe;
|
||||
p_code->y_u.p.p = pe;
|
||||
p_code = NEXTOP(p_code,p);
|
||||
p_code->opc = Yap_opcode(_Ystop);
|
||||
p_code->u.l.l = cl->ClCode;
|
||||
p_code->y_u.l.l = cl->ClCode;
|
||||
pe->OpcodeOfPred = pe->CodeOfPred->opc;
|
||||
}
|
||||
|
||||
@@ -567,17 +567,17 @@ Yap_InitCmpPred(const char *Name, UInt Arity, CmpPredicate cmp_code, UInt flags)
|
||||
pe->cs.d_code = cmp_code;
|
||||
pe->ModuleOfPred = CurrentModule;
|
||||
p_code->opc = pe->OpcodeOfPred = Yap_opcode(_call_bfunc_xx);
|
||||
p_code->u.plxxs.p = pe;
|
||||
p_code->u.plxxs.f = FAILCODE;
|
||||
p_code->u.plxxs.x1 = Yap_emit_x(1);
|
||||
p_code->u.plxxs.x2 = Yap_emit_x(2);
|
||||
p_code->u.plxxs.flags = Yap_compile_cmp_flags(pe);
|
||||
p_code->y_u.plxxs.p = pe;
|
||||
p_code->y_u.plxxs.f = FAILCODE;
|
||||
p_code->y_u.plxxs.x1 = Yap_emit_x(1);
|
||||
p_code->y_u.plxxs.x2 = Yap_emit_x(2);
|
||||
p_code->y_u.plxxs.flags = Yap_compile_cmp_flags(pe);
|
||||
p_code = NEXTOP(p_code,plxxs);
|
||||
p_code->opc = Yap_opcode(_procceed);
|
||||
p_code->u.p.p = pe;
|
||||
p_code->y_u.p.p = pe;
|
||||
p_code = NEXTOP(p_code,p);
|
||||
p_code->opc = Yap_opcode(_Ystop);
|
||||
p_code->u.l.l = cl->ClCode;
|
||||
p_code->y_u.l.l = cl->ClCode;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -655,20 +655,20 @@ Yap_InitAsmPred(const char *Name, UInt Arity, int code, CPredicate def, UInt fl
|
||||
p_code = NEXTOP(p_code,e);
|
||||
}
|
||||
p_code->opc = Yap_opcode(_call_cpred);
|
||||
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->y_u.Osbpp.bmap = NULL;
|
||||
p_code->y_u.Osbpp.s = -Signed(RealEnvSize);
|
||||
p_code->y_u.Osbpp.p = p_code->y_u.Osbpp.p0 = pe;
|
||||
p_code = NEXTOP(p_code,Osbpp);
|
||||
if (!(flags & SafePredFlag)) {
|
||||
p_code->opc = Yap_opcode(_deallocate);
|
||||
p_code->u.p.p = pe;
|
||||
p_code->y_u.p.p = pe;
|
||||
p_code = NEXTOP(p_code,p);
|
||||
}
|
||||
p_code->opc = Yap_opcode(_procceed);
|
||||
p_code->u.p.p = pe;
|
||||
p_code->y_u.p.p = pe;
|
||||
p_code = NEXTOP(p_code,p);
|
||||
p_code->opc = Yap_opcode(_Ystop);
|
||||
p_code->u.l.l = cl->ClCode;
|
||||
p_code->y_u.l.l = cl->ClCode;
|
||||
pe->OpcodeOfPred = pe->CodeOfPred->opc;
|
||||
} else {
|
||||
pe->OpcodeOfPred = Yap_opcode(_undef_p);
|
||||
@@ -689,7 +689,7 @@ CleanBack(PredEntry *pe, CPredicate Start, CPredicate Cont, CPredicate Cut)
|
||||
return;
|
||||
}
|
||||
code = (yamop *)(pe->cs.p_code.FirstClause);
|
||||
code->u.OtapFs.p = pe;
|
||||
code->y_u.OtapFs.p = pe;
|
||||
if (pe->PredFlags & UserCPredFlag)
|
||||
code->opc = Yap_opcode(_try_userc);
|
||||
else
|
||||
@@ -698,7 +698,7 @@ CleanBack(PredEntry *pe, CPredicate Start, CPredicate Cont, CPredicate Cut)
|
||||
INIT_YAMOP_LTT(code, 2);
|
||||
PUT_YAMOP_SEQ(code);
|
||||
#endif /* YAPOR */
|
||||
code->u.OtapFs.f = Start;
|
||||
code->y_u.OtapFs.f = Start;
|
||||
code = NEXTOP(code,OtapFs);
|
||||
if (pe->PredFlags & UserCPredFlag)
|
||||
code->opc = Yap_opcode(_retry_userc);
|
||||
@@ -708,14 +708,14 @@ CleanBack(PredEntry *pe, CPredicate Start, CPredicate Cont, CPredicate Cut)
|
||||
INIT_YAMOP_LTT(code, 1);
|
||||
PUT_YAMOP_SEQ(code);
|
||||
#endif /* YAPOR */
|
||||
code->u.OtapFs.f = Cont;
|
||||
code->y_u.OtapFs.f = Cont;
|
||||
code = NEXTOP(code,OtapFs);
|
||||
if (pe->PredFlags & UserCPredFlag)
|
||||
code->opc = Yap_opcode(_cut_c);
|
||||
else
|
||||
code->opc = Yap_opcode(_cut_userc);
|
||||
code->u.OtapFs.p = pe;
|
||||
code->u.OtapFs.f = Cut;
|
||||
code->y_u.OtapFs.p = pe;
|
||||
code->y_u.OtapFs.f = Cut;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -805,10 +805,10 @@ Yap_InitCPredBack_(const char *Name, UInt Arity,
|
||||
pe->OpcodeOfPred = code->opc = Yap_opcode(_try_userc);
|
||||
else
|
||||
pe->OpcodeOfPred = code->opc = Yap_opcode(_try_c);
|
||||
code->u.OtapFs.f = Start;
|
||||
code->u.OtapFs.p = pe;
|
||||
code->u.OtapFs.s = Arity;
|
||||
code->u.OtapFs.extra = Extra;
|
||||
code->y_u.OtapFs.f = Start;
|
||||
code->y_u.OtapFs.p = pe;
|
||||
code->y_u.OtapFs.s = Arity;
|
||||
code->y_u.OtapFs.extra = Extra;
|
||||
#ifdef YAPOR
|
||||
INIT_YAMOP_LTT(code, 2);
|
||||
PUT_YAMOP_SEQ(code);
|
||||
@@ -818,10 +818,10 @@ Yap_InitCPredBack_(const char *Name, UInt Arity,
|
||||
code->opc = Yap_opcode(_retry_userc);
|
||||
else
|
||||
code->opc = Yap_opcode(_retry_c);
|
||||
code->u.OtapFs.f = Cont;
|
||||
code->u.OtapFs.p = pe;
|
||||
code->u.OtapFs.s = Arity;
|
||||
code->u.OtapFs.extra = Extra;
|
||||
code->y_u.OtapFs.f = Cont;
|
||||
code->y_u.OtapFs.p = pe;
|
||||
code->y_u.OtapFs.s = Arity;
|
||||
code->y_u.OtapFs.extra = Extra;
|
||||
#ifdef YAPOR
|
||||
INIT_YAMOP_LTT(code, 1);
|
||||
PUT_YAMOP_SEQ(code);
|
||||
@@ -831,13 +831,13 @@ Yap_InitCPredBack_(const char *Name, UInt Arity,
|
||||
code->opc = Yap_opcode(_cut_userc);
|
||||
else
|
||||
code->opc = Yap_opcode(_cut_c);
|
||||
code->u.OtapFs.f = Cut;
|
||||
code->u.OtapFs.p = pe;
|
||||
code->u.OtapFs.s = Arity;
|
||||
code->u.OtapFs.extra = Extra;
|
||||
code->y_u.OtapFs.f = Cut;
|
||||
code->y_u.OtapFs.p = pe;
|
||||
code->y_u.OtapFs.s = Arity;
|
||||
code->y_u.OtapFs.extra = Extra;
|
||||
code = NEXTOP(code,OtapFs);
|
||||
code->opc = Yap_opcode(_Ystop);
|
||||
code->u.l.l = cl->ClCode;
|
||||
code->y_u.l.l = cl->ClCode;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -898,10 +898,10 @@ InitEnvInst(yamop start[2], yamop **instp, op_numbers opc, PredEntry *pred)
|
||||
|
||||
/* make it look like the instruction is preceeded by a call instruction */
|
||||
ipc->opc = Yap_opcode(_call);
|
||||
ipc->u.Osbpp.s = -Signed(RealEnvSize);
|
||||
ipc->u.Osbpp.bmap = NULL;
|
||||
ipc->u.Osbpp.p = pred;
|
||||
ipc->u.Osbpp.p0 = pred;
|
||||
ipc->y_u.Osbpp.s = -Signed(RealEnvSize);
|
||||
ipc->y_u.Osbpp.bmap = NULL;
|
||||
ipc->y_u.Osbpp.p = pred;
|
||||
ipc->y_u.Osbpp.p0 = pred;
|
||||
ipc = NEXTOP(ipc, Osbpp);
|
||||
ipc->opc = Yap_opcode(opc);
|
||||
*instp = ipc;
|
||||
@@ -914,14 +914,14 @@ InitOtaplInst(yamop start[1], OPCODE opc, PredEntry *pe)
|
||||
|
||||
/* this is a place holder, it should not really be used */
|
||||
ipc->opc = Yap_opcode(opc);
|
||||
ipc->u.Otapl.s = 0;
|
||||
ipc->u.Otapl.p = pe;
|
||||
ipc->u.Otapl.d = NULL;
|
||||
ipc->y_u.Otapl.s = 0;
|
||||
ipc->y_u.Otapl.p = pe;
|
||||
ipc->y_u.Otapl.d = NULL;
|
||||
#ifdef YAPOR
|
||||
INIT_YAMOP_LTT(ipc, 1);
|
||||
#endif /* YAPOR */
|
||||
#ifdef TABLING
|
||||
ipc->u.Otapl.te = NULL;
|
||||
ipc->y_u.Otapl.te = NULL;
|
||||
#endif /* TABLING */
|
||||
}
|
||||
|
||||
@@ -1182,8 +1182,8 @@ InitCodes(void)
|
||||
modp->PredFlags |= MetaPredFlag;
|
||||
}
|
||||
#ifdef YAPOR
|
||||
Yap_heap_regs->getwork_code->u.Otapl.p = RepPredProp(PredPropByAtom(AtomGetwork, PROLOG_MODULE));
|
||||
Yap_heap_regs->getwork_seq_code->u.Otapl.p = RepPredProp(PredPropByAtom(AtomGetworkSeq, PROLOG_MODULE));
|
||||
Yap_heap_regs->getwork_code->y_u.Otapl.p = RepPredProp(PredPropByAtom(AtomGetwork, PROLOG_MODULE));
|
||||
Yap_heap_regs->getwork_seq_code->y_u.Otapl.p = RepPredProp(PredPropByAtom(AtomGetworkSeq, PROLOG_MODULE));
|
||||
#endif /* YAPOR */
|
||||
|
||||
}
|
||||
|
@@ -484,7 +484,7 @@ Yap_read_term(term_t t0, IOSTREAM *inp_stream, struct read_data_t *rd)
|
||||
{
|
||||
CACHE_REGS
|
||||
TokEntry *tokstart;
|
||||
Term t, v;
|
||||
Term t;
|
||||
Term OCurrentModule = CurrentModule, tmod, tpos;
|
||||
int store_comments = rd->comments;
|
||||
|
||||
@@ -614,6 +614,7 @@ Yap_read_term(term_t t0, IOSTREAM *inp_stream, struct read_data_t *rd)
|
||||
if (store_comments && !Yap_unify(LOCAL_Comments, Yap_GetFromSlot( rd->comments PASS_REGS)))
|
||||
return FALSE;
|
||||
if (rd->varnames) {
|
||||
Term v;
|
||||
while (TRUE) {
|
||||
CELL *old_H = HR;
|
||||
|
||||
@@ -638,6 +639,7 @@ Yap_read_term(term_t t0, IOSTREAM *inp_stream, struct read_data_t *rd)
|
||||
}
|
||||
|
||||
if (rd->variables) {
|
||||
Term v;
|
||||
while (TRUE) {
|
||||
CELL *old_H = HR;
|
||||
|
||||
@@ -661,6 +663,7 @@ Yap_read_term(term_t t0, IOSTREAM *inp_stream, struct read_data_t *rd)
|
||||
return FALSE;
|
||||
}
|
||||
if (rd->singles) {
|
||||
Term v;
|
||||
while (TRUE) {
|
||||
CELL *old_H = HR;
|
||||
|
||||
@@ -955,8 +958,6 @@ p_write_string( USES_REGS1 )
|
||||
int encoding;
|
||||
char buf[256];
|
||||
|
||||
if ((s = Yap_TermToString( in, NULL, 0, &length, &encoding, 0)))
|
||||
fprintf(stderr,"%ld %s\n",length, s);
|
||||
if ((s = Yap_TermToString( in, buf, 256, &length, &encoding, 0)))
|
||||
fprintf(stderr,"%ld %s\n",length, s);
|
||||
return TRUE;
|
||||
|
48
C/pl-yap.c
48
C/pl-yap.c
@@ -8,17 +8,11 @@
|
||||
#include "Yatom.h"
|
||||
#include "pl-incl.h"
|
||||
#include "YapText.h"
|
||||
#include "yapio.h"
|
||||
#if HAVE_MATH_H
|
||||
#include <math.h>
|
||||
#endif
|
||||
|
||||
#define Quote_illegal_f 1
|
||||
#define Ignore_ops_f 2
|
||||
#define Handle_vars_f 4
|
||||
#define Use_portray_f 8
|
||||
#define To_heap_f 16
|
||||
#define Unfold_cyclics_f 32
|
||||
|
||||
#ifdef HAVE_LIMITS_H
|
||||
#include <limits.h>
|
||||
#endif
|
||||
@@ -649,7 +643,7 @@ numberVars(term_t t, nv_options *opts, int n ARG_LD) {
|
||||
* PROMOTION *
|
||||
*******************************/
|
||||
|
||||
static int
|
||||
int
|
||||
check_float(double f)
|
||||
{
|
||||
#ifdef HAVE_FPCLASSIFY
|
||||
@@ -856,8 +850,6 @@ PL_get_chars(term_t t, char **s, unsigned flags)
|
||||
{ return PL_get_nchars(t, NULL, s, flags);
|
||||
}
|
||||
|
||||
char *Yap_TermToString(Term t, char *s, size_t sz, size_t *length, int *encoding, int flags);
|
||||
|
||||
char *
|
||||
Yap_TermToString(Term t, char *s, size_t sz, size_t *length, int *encoding, int flags)
|
||||
{
|
||||
@@ -921,6 +913,42 @@ Yap_TermToString(Term t, char *s, size_t sz, size_t *length, int *encoding, int
|
||||
return NULL;
|
||||
}
|
||||
|
||||
char *
|
||||
Yap_HandleToString(term_t l, size_t sz, size_t *length, int *encoding, int flags)
|
||||
{
|
||||
CACHE_REGS
|
||||
|
||||
char *r, buf[4096];
|
||||
|
||||
int64_t size;
|
||||
IOSTREAM *fd;
|
||||
|
||||
r = buf;
|
||||
fd = Sopenmem(&r, &sz, "w");
|
||||
fd->encoding = ENC_UTF8;
|
||||
{ CACHE_REGS __android_log_print(ANDROID_LOG_ERROR, __FUNCTION__, "I %d LCL0+%s=(%p) %p", l, buf, LCL0, &LCL0 ); }
|
||||
if ( PL_write_term(fd, l, 1200, flags) &&
|
||||
Sputcode(EOS, fd) >= 0 &&
|
||||
Sflush(fd) >= 0 )
|
||||
{
|
||||
{ CACHE_REGS __android_log_print(ANDROID_LOG_ERROR, __FUNCTION__, "I LCL0+%s=(%p) %p", buf, LCL0, &LCL0 ); }
|
||||
size = Stell64(fd);
|
||||
*length = size-1;
|
||||
char *bf = malloc(*length+1);
|
||||
if (!bf)
|
||||
return NULL;
|
||||
strncpy(bf,buf,*length+1);
|
||||
Sclose(fd);
|
||||
r = bf;
|
||||
return r;
|
||||
}
|
||||
/* failed */
|
||||
if ( r != buf ) {
|
||||
Sfree(r);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
X_API int
|
||||
PL_ttymode(IOSTREAM *s)
|
||||
|
3
C/qlyr.c
3
C/qlyr.c
@@ -16,8 +16,8 @@
|
||||
* *
|
||||
*************************************************************************/
|
||||
|
||||
#include <SWI-Stream.h>
|
||||
#include "absmi.h"
|
||||
#include <SWI-Stream.h>
|
||||
#include "Foreign.h"
|
||||
#include "alloc.h"
|
||||
#include "yapio.h"
|
||||
@@ -1082,6 +1082,7 @@ Yap_Restore(char *s, char *lib_dir)
|
||||
IOSTREAM *stream = Yap_OpenRestore(s, lib_dir);
|
||||
if (!stream)
|
||||
return -1;
|
||||
__android_log_print(ANDROID_LOG_INFO, "qlyr.c", "loading startup %p", stream);
|
||||
GLOBAL_RestoreFile = s;
|
||||
read_module(stream);
|
||||
Sclose( stream );
|
||||
|
2
C/qlyw.c
2
C/qlyw.c
@@ -16,8 +16,8 @@
|
||||
* *
|
||||
*************************************************************************/
|
||||
|
||||
#include <SWI-Stream.h>
|
||||
#include "absmi.h"
|
||||
#include <SWI-Stream.h>
|
||||
#include "Foreign.h"
|
||||
#include "alloc.h"
|
||||
#include "yapio.h"
|
||||
|
33
C/save.c
33
C/save.c
@@ -19,6 +19,7 @@ static char SccsId[] = "@(#)save.c 1.3 3/15/90";
|
||||
#endif
|
||||
|
||||
#include "config.h"
|
||||
#include "absmi.h"
|
||||
#include "SWI-Stream.h"
|
||||
#if _MSC_VER || defined(__MINGW32__)
|
||||
#if HAVE_WINSOCK2_H
|
||||
@@ -27,7 +28,6 @@ static char SccsId[] = "@(#)save.c 1.3 3/15/90";
|
||||
#include <windows.h>
|
||||
#include <psapi.h>
|
||||
#endif
|
||||
#include "absmi.h"
|
||||
#include "alloc.h"
|
||||
#if USE_DL_MALLOC
|
||||
#include "dlmalloc.h"
|
||||
@@ -247,6 +247,22 @@ open_file(char *my_file, int flag)
|
||||
{
|
||||
int splfild;
|
||||
|
||||
#if __ANDROID__
|
||||
if (strstr(my_file, "/assets/") == my_file) {
|
||||
if (flag == O_RDONLY) {
|
||||
extern AAssetManager *assetManager;
|
||||
my_file += strlen("/assets/");
|
||||
__android_log_print(ANDROID_LOG_ERROR, "save.c", "open_file %p %s", assetManager, my_file);
|
||||
AAsset* asset = AAssetManager_open(assetManager, my_file, AASSET_MODE_UNKNOWN);
|
||||
if (!asset)
|
||||
return -1;
|
||||
__android_log_print(ANDROID_LOG_ERROR, "save.c", "open_file %p", asset);
|
||||
AAsset_close( asset );
|
||||
return 0; // usually the file will be compressed, so there is no point in actually trying to open it.
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
#ifdef M_WILLIAMS
|
||||
if (flag & O_CREAT)
|
||||
splfild = creat(my_file, flag);
|
||||
@@ -1453,6 +1469,11 @@ OpenRestore(char *inpf, char *YapLibDir, CELL *Astate, CELL *ATrail, CELL *AStac
|
||||
int mode = FAIL_RESTORE;
|
||||
char save_buffer[YAP_FILENAME_MAX+1];
|
||||
|
||||
#if __ANDROID__
|
||||
if (!inpf)
|
||||
inpf = YAPSTARTUP;
|
||||
#endif
|
||||
__android_log_print(ANDROID_LOG_ERROR, "save.c", "saved state %s", inpf);
|
||||
save_buffer[0] = '\0';
|
||||
// LOCAL_ErrorMessage = NULL;
|
||||
if (inpf == NULL) {
|
||||
@@ -1473,10 +1494,13 @@ OpenRestore(char *inpf, char *YapLibDir, CELL *Astate, CELL *ATrail, CELL *AStac
|
||||
strncat(LOCAL_FileNameBuf, "/", YAP_FILENAME_MAX-1);
|
||||
strncat(LOCAL_FileNameBuf, inpf, YAP_FILENAME_MAX-1);
|
||||
} else {
|
||||
strncat(LOCAL_FileNameBuf, inpf, YAP_FILENAME_MAX-1);
|
||||
strncpy(LOCAL_FileNameBuf, inpf, YAP_FILENAME_MAX-1);
|
||||
}
|
||||
if (inpf != NULL && !((splfild = open_file(inpf, O_RDONLY)) < 0)) {
|
||||
if (inpf != NULL &&
|
||||
!((splfild = open_file(inpf, O_RDONLY)) < 0))
|
||||
{
|
||||
if ((mode = try_open(inpf,Astate,ATrail,AStack,AHeap,save_buffer,streamp)) != FAIL_RESTORE) {
|
||||
__android_log_print(ANDROID_LOG_ERROR, "save.c", "saved state %p", *streamp);
|
||||
return mode;
|
||||
}
|
||||
}
|
||||
@@ -1517,7 +1541,7 @@ OpenRestore(char *inpf, char *YapLibDir, CELL *Astate, CELL *ATrail, CELL *AStac
|
||||
}
|
||||
#if _MSC_VER || defined(__MINGW32__)
|
||||
if ((inpf = Yap_RegistryGetString("startup"))) {
|
||||
if (!((splfild = open_file(inpf, O_RDONLY)) < 0)) {
|
||||
if (!((splfild = Sopen_file(inpf, "r")) < 0)) {
|
||||
if ((mode = try_open(inpf,Astate,ATrail,AStack,AHeap,save_buffer,streamp)) != FAIL_RESTORE) {
|
||||
return mode;
|
||||
}
|
||||
@@ -1582,6 +1606,7 @@ Yap_OpenRestore(char *inpf, char *YapLibDir)
|
||||
IOSTREAM *stream = NULL;
|
||||
|
||||
OpenRestore(inpf, YapLibDir, NULL, NULL, NULL, NULL, &stream);
|
||||
__android_log_print(ANDROID_LOG_ERROR, "save.c", "saved state %p", stream);
|
||||
return stream;
|
||||
}
|
||||
|
||||
|
31
C/sysbits.c
31
C/sysbits.c
@@ -1805,32 +1805,9 @@ Yap_volume_header(char *file)
|
||||
}
|
||||
|
||||
|
||||
int Yap_getcwd(const char *buf, int len)
|
||||
char * Yap_getcwd(const char *cwd, size_t cwdlen)
|
||||
{
|
||||
CACHE_REGS
|
||||
#if __simplescalar__
|
||||
/* does not implement getcwd */
|
||||
strncpy(Yap_buf,GLOBAL_pwd,len);
|
||||
#elif HAVE_GETCWD
|
||||
if (getcwd ((char *)buf, len) == NULL) {
|
||||
#if HAVE_STRERROR
|
||||
Yap_Error(OPERATING_SYSTEM_ERROR, ARG1, "%s in getcwd/1", strerror(errno));
|
||||
#else
|
||||
Yap_Error(OPERATING_SYSTEM_ERROR, ARG1, "error %d in getcwd/1", errno);
|
||||
#endif
|
||||
return FALSE;
|
||||
}
|
||||
#else
|
||||
if (getwd (buf) == NULL) {
|
||||
#if HAVE_STRERROR
|
||||
Yap_Error(OPERATING_SYSTEM_ERROR, ARG1, "%s in getcwd/1", strerror(errno));
|
||||
#else
|
||||
Yap_Error(OPERATING_SYSTEM_ERROR, ARG1, "in getcwd/1");
|
||||
#endif
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
return TRUE;
|
||||
return PL_cwd(cwd, cwdlen);
|
||||
}
|
||||
|
||||
/******
|
||||
@@ -2743,7 +2720,11 @@ p_yap_paths( USES_REGS1 ) {
|
||||
out3 = MkAtomTerm(Yap_LookupAtom(DESTDIR "/" YAP_BINDIR));
|
||||
} else {
|
||||
out1 = MkAtomTerm(Yap_LookupAtom(YAP_LIBDIR));
|
||||
#if __ANDROID__
|
||||
out2 = MkAtomTerm(Yap_LookupAtom("/assets/share"));
|
||||
#else
|
||||
out2 = MkAtomTerm(Yap_LookupAtom(YAP_SHAREDIR));
|
||||
#endif
|
||||
out3 = MkAtomTerm(Yap_LookupAtom(YAP_BINDIR));
|
||||
}
|
||||
return(Yap_unify(out1,ARG1) &&
|
||||
|
21
C/threads.c
21
C/threads.c
@@ -90,6 +90,12 @@ Yap_ThreadID( void )
|
||||
return -1;
|
||||
}
|
||||
|
||||
int
|
||||
Yap_NOfThreads(void) {
|
||||
// GLOBAL_ThreadHandlesLock is held
|
||||
return GLOBAL_NOfThreads;
|
||||
}
|
||||
|
||||
static int
|
||||
allocate_new_tid(void)
|
||||
{
|
||||
@@ -694,11 +700,15 @@ p_thread_set_concurrency( USES_REGS1 )
|
||||
Yap_Error(TYPE_ERROR_INTEGER,tnew,"thread_set_concurrency/2");
|
||||
return(FALSE);
|
||||
}
|
||||
#if HAVE_PTHREAD_GETCONCURRENCY
|
||||
cur = MkIntegerTerm(pthread_getconcurrency());
|
||||
if (pthread_setconcurrency(newc) != 0) {
|
||||
return FALSE;
|
||||
}
|
||||
return Yap_unify(ARG1, MkIntegerTerm(cur));
|
||||
#else
|
||||
return FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
static Int
|
||||
@@ -1090,6 +1100,17 @@ void Yap_InitThreadPreds(void)
|
||||
|
||||
#else
|
||||
|
||||
int
|
||||
Yap_NOfThreads(void) {
|
||||
// GLOBAL_ThreadHandlesLock is held
|
||||
#ifdef YAPOR
|
||||
return 2;
|
||||
#else
|
||||
return 1;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
static Int
|
||||
p_no_threads(void)
|
||||
{ /* '$thread_signal'(+P) */
|
||||
|
@@ -146,7 +146,7 @@ low_level_trace(yap_low_level_port port, PredEntry *pred, CELL *args)
|
||||
// if (!worker_id) return;
|
||||
LOCK(Yap_heap_regs->low_level_trace_lock);
|
||||
sc = Yap_heap_regs;
|
||||
if (vsc_count == 161862) jmp_deb(1);
|
||||
//if (vsc_count == 161862) jmp_deb(1);
|
||||
// Sfprintf(stderr,"B=%p ", B);
|
||||
#ifdef THREADS
|
||||
LOCAL_ThreadHandle.thread_inst_count++;
|
||||
|
@@ -1618,6 +1618,40 @@ p_term_variables( USES_REGS1 ) /* variables in term t */
|
||||
return Yap_unify(ARG2,out);
|
||||
}
|
||||
|
||||
/**
|
||||
* Exports a nil-terminated list with all the variables in a term.
|
||||
* @param[in] the term
|
||||
* @param[in] the arity of the calling predicate (required for exact garbage collection).
|
||||
*/
|
||||
Term
|
||||
Yap_TermVariables( Term t, UInt arity USES_REGS ) /* variables in term t */
|
||||
{
|
||||
Term out;
|
||||
|
||||
do {
|
||||
t = Deref(t);
|
||||
if (IsVarTerm(t)) {
|
||||
return MkPairTerm(t, TermNil);
|
||||
} else if (IsPrimitiveTerm(t)) {
|
||||
return TermNil;
|
||||
} else if (IsPairTerm(t)) {
|
||||
out = vars_in_complex_term(RepPair(t)-1,
|
||||
RepPair(t)+1, TermNil PASS_REGS);
|
||||
}
|
||||
else {
|
||||
Functor f = FunctorOfTerm(t);
|
||||
out = vars_in_complex_term(RepAppl(t),
|
||||
RepAppl(t)+
|
||||
ArityOfFunctor(f), TermNil PASS_REGS);
|
||||
}
|
||||
if (out == 0L) {
|
||||
if (!expand_vts( arity PASS_REGS ))
|
||||
return FALSE;
|
||||
}
|
||||
} while (out == 0L);
|
||||
return out;
|
||||
}
|
||||
|
||||
static Term attvars_in_complex_term(register CELL *pt0, register CELL *pt0_end, Term inp USES_REGS)
|
||||
{
|
||||
|
||||
|
38
C/write.c
38
C/write.c
@@ -317,7 +317,7 @@ wrputf(Float f, struct write_globs *wglb) /* writes a float */
|
||||
size_t l1 = strlen((const char *)decimalpoint+1);
|
||||
#else
|
||||
const unsigned char *decimalpoint = ".";
|
||||
l1 = 0;
|
||||
size_t l1 = 0;
|
||||
#endif
|
||||
|
||||
if (lastw == symbol || lastw == alphanum) {
|
||||
@@ -574,11 +574,12 @@ putAtom(Atom atom, int Quote_illegal, struct write_globs *wglb)
|
||||
wtype atom_or_symbol;
|
||||
wrf stream = wglb->stream;
|
||||
|
||||
{ CACHE_REGS __android_log_print(ANDROID_LOG_ERROR, __FUNCTION__, "AA LCL0=(%p) %p", LCL0, &LCL0 ); }
|
||||
if (IsBlob(atom)) {
|
||||
wrputblob(RepAtom(atom),Quote_illegal,wglb);
|
||||
return;
|
||||
}
|
||||
if (IsWideAtom(atom)) {
|
||||
if (IsWideAtom(atom) ) {
|
||||
wchar_t *ws = RepAtom(atom)->WStrOfAE;
|
||||
|
||||
if (Quote_illegal) {
|
||||
@@ -593,7 +594,11 @@ putAtom(Atom atom, int Quote_illegal, struct write_globs *wglb)
|
||||
}
|
||||
return;
|
||||
}
|
||||
{ CACHE_REGS __android_log_print(ANDROID_LOG_ERROR, __FUNCTION__, "AB LCL0=(%p) %p", LCL0, &LCL0 ); }
|
||||
{ CACHE_REGS __android_log_print(ANDROID_LOG_ERROR, __FUNCTION__, "AB LCL0=(%p) %p", LCL0, RepAtom(atom)->StrOfAE ); }
|
||||
{ CACHE_REGS __android_log_print(ANDROID_LOG_ERROR, __FUNCTION__, "AB LCL0=(%p) %c", LCL0, RepAtom(atom)->StrOfAE[0]); }
|
||||
s = (unsigned char *)RepAtom(atom)->StrOfAE;
|
||||
{ CACHE_REGS __android_log_print(ANDROID_LOG_ERROR, __FUNCTION__, "AC %s LCL0=(%p) %p", s, LCL0, &LCL0 ); }
|
||||
/* #define CRYPT_FOR_STEVE 1*/
|
||||
#ifdef CRYPT_FOR_STEVE
|
||||
if (Yap_GetValue(AtomCryptAtoms) != TermNil && Yap_GetAProp(atom, OpProperty) == NIL) {
|
||||
@@ -886,14 +891,19 @@ writeTerm(Term t, int p, int depth, int rinfixarg, struct write_globs *wglb, str
|
||||
if (EX)
|
||||
return;
|
||||
t = Deref(t);
|
||||
{ CACHE_REGS __android_log_print(ANDROID_LOG_ERROR, __FUNCTION__, "I %d LCL0=(%p) %p", t, LCL0, &LCL0 ); }
|
||||
if (IsVarTerm(t)) {
|
||||
{ CACHE_REGS __android_log_print(ANDROID_LOG_ERROR, __FUNCTION__, "V %d LCL0=(%p) %p", t, LCL0, &LCL0 ); }
|
||||
write_var((CELL *)t, wglb, &nrwt);
|
||||
} else if (IsIntTerm(t)) {
|
||||
{ CACHE_REGS __android_log_print(ANDROID_LOG_ERROR, __FUNCTION__, "I %d LCL0=(%p) %p", t, LCL0, &LCL0 ); }
|
||||
|
||||
wrputn((Int) IntOfTerm(t),wglb);
|
||||
} else if (IsAtomTerm(t)) {
|
||||
{ CACHE_REGS __android_log_print(ANDROID_LOG_ERROR, __FUNCTION__, "A %d LCL0=(%p) %p", t, LCL0, &LCL0 ); }
|
||||
putAtom(AtomOfTerm(t), wglb->Quote_illegal, wglb);
|
||||
} else if (IsPairTerm(t)) {
|
||||
if (wglb->Ignore_ops) {
|
||||
if (wglb->Ignore_ops) {
|
||||
wrputs("'.'(",wglb->stream);
|
||||
lastw = separator;
|
||||
writeTerm(from_pointer(RepPair(t), &nrwt, wglb), 999, depth + 1, FALSE, wglb, &nrwt);
|
||||
@@ -909,29 +919,33 @@ writeTerm(Term t, int p, int depth, int rinfixarg, struct write_globs *wglb, str
|
||||
struct DB_TERM *old_EX = NULL;
|
||||
Int sl = 0;
|
||||
|
||||
targs[0] = t;
|
||||
targs[0] = t;
|
||||
Yap_PutValue(AtomPortray, MkAtomTerm(AtomNil));
|
||||
if (EX) old_EX = EX;
|
||||
sl = Yap_InitSlot(t PASS_REGS);
|
||||
Yap_execute_goal(Yap_MkApplTerm(FunctorPortray, 1, targs), 0, 1);
|
||||
Yap_execute_goal(Yap_MkApplTerm(FunctorPortray, 1, targs), 0, 1);
|
||||
t = Yap_GetFromSlot(sl PASS_REGS);
|
||||
Yap_RecoverSlots(1, sl PASS_REGS);
|
||||
if (old_EX != NULL) EX = old_EX;
|
||||
if (Yap_GetValue(AtomPortray) == MkAtomTerm(AtomTrue))
|
||||
if (Yap_GetValue(AtomPortray) == MkAtomTerm(AtomTrue))
|
||||
return;
|
||||
}
|
||||
if (yap_flags[WRITE_QUOTED_STRING_FLAG] && IsCodesTerm(t)) {
|
||||
putString(t, wglb);
|
||||
} else {
|
||||
{ CACHE_REGS __android_log_print(ANDROID_LOG_ERROR, __FUNCTION__, "I %d LCL0=(%p) %p", t, LCL0, &LCL0 ); }
|
||||
wrputc('[', wglb->stream);
|
||||
lastw = separator;
|
||||
/* we assume t was already saved in the stack */
|
||||
write_list(t, 0, depth, wglb, rwt);
|
||||
{ CACHE_REGS __android_log_print(ANDROID_LOG_ERROR, __FUNCTION__, "II %d LCL0=(%p) %p", t, LCL0, &LCL0 ); }
|
||||
write_list(t, 0, depth, wglb, rwt);
|
||||
wrputc(']', wglb->stream);
|
||||
lastw = separator;
|
||||
{ CACHE_REGS __android_log_print(ANDROID_LOG_ERROR, __FUNCTION__, "III II%d LCL0=(%p) %p", t, LCL0, &LCL0 ); }
|
||||
lastw = separator;
|
||||
}
|
||||
} else { /* compound term */
|
||||
Functor functor = FunctorOfTerm(t);
|
||||
{ CACHE_REGS __android_log_print(ANDROID_LOG_ERROR, __FUNCTION__, "I %d LCL0=(%p) %p", t, LCL0, &LCL0 ); }
|
||||
Functor functor = FunctorOfTerm(t);
|
||||
int Arity;
|
||||
Atom atom;
|
||||
int op, lp, rp;
|
||||
@@ -1087,7 +1101,8 @@ writeTerm(Term t, int p, int depth, int rinfixarg, struct write_globs *wglb, str
|
||||
} else if (!wglb->Ignore_ops &&
|
||||
Arity == 2 && Yap_IsInfixOp(atom, &op, &lp,
|
||||
&rp) ) {
|
||||
Term tleft = ArgOfTerm(1, t);
|
||||
{ CACHE_REGS __android_log_print(ANDROID_LOG_ERROR, __FUNCTION__, "II %d LCL0=(%p) %p", t, LCL0, &LCL0 ); }
|
||||
Term tleft = ArgOfTerm(1, t);
|
||||
Term tright = ArgOfTerm(2, t);
|
||||
int bracket_left =
|
||||
!IsVarTerm(tleft) && IsAtomTerm(tleft) &&
|
||||
@@ -1104,7 +1119,9 @@ writeTerm(Term t, int p, int depth, int rinfixarg, struct write_globs *wglb, str
|
||||
if (bracket_left) {
|
||||
wropen_bracket(wglb, TRUE);
|
||||
}
|
||||
{ CACHE_REGS __android_log_print(ANDROID_LOG_ERROR, __FUNCTION__, "III %d LCL0=(%p) %p", t, LCL0, &LCL0 ); }
|
||||
writeTerm(from_pointer(RepAppl(t)+1, &nrwt, wglb), lp, depth + 1, rinfixarg, wglb, &nrwt);
|
||||
{ CACHE_REGS __android_log_print(ANDROID_LOG_ERROR, __FUNCTION__, "IV %d LCL0=(%p) %p", t, LCL0, &LCL0 ); }
|
||||
t = AbsAppl(restore_from_write(&nrwt, wglb)-1);
|
||||
if (bracket_left) {
|
||||
wrclose_bracket(wglb, TRUE);
|
||||
@@ -1239,6 +1256,7 @@ Yap_plwrite(Term t, void *mywrite, int max_depth, int flags, int priority)
|
||||
wglb.Ignore_ops = flags & Ignore_ops_f;
|
||||
wglb.Write_strings = flags & BackQuote_String_f;
|
||||
/* protect slots for portray */
|
||||
{ CACHE_REGS __android_log_print(ANDROID_LOG_ERROR, __FUNCTION__, "I %d LCL0=(%p) %p", t, LCL0, &LCL0 ); }
|
||||
writeTerm(from_pointer(&t, &rwt, &wglb), priority, 1, FALSE, &wglb, &rwt);
|
||||
restore_from_write(&rwt, &wglb);
|
||||
}
|
||||
|
Reference in New Issue
Block a user