replace cut_c by trail entries

This commit is contained in:
Vitor Santos Costa 2017-07-30 21:53:07 +01:00
parent 3d191957db
commit dac6dc7c22
35 changed files with 4509 additions and 4587 deletions

View File

@ -340,8 +340,8 @@ mark_global_cell(CELL *pt)
Int sz = 3 + Int sz = 3 +
(sizeof(MP_INT)+ (sizeof(MP_INT)+
(((MP_INT *)(pt+2))->_mp_alloc*sizeof(mp_limb_t)))/sizeof(CELL); (((MP_INT *)(pt+2))->_mp_alloc*sizeof(mp_limb_t)))/sizeof(CELL);
Opaque_CallOnGCMark f; YAP_Opaque_CallOnGCMark f;
Opaque_CallOnGCRelocate f2; YAP_Opaque_CallOnGCRelocate f2;
Term t = AbsAppl(pt); Term t = AbsAppl(pt);
if ( (f = Yap_blob_gc_mark_handler(t)) ) { if ( (f = Yap_blob_gc_mark_handler(t)) ) {

View File

@ -1,21 +1,21 @@
/************************************************************************* /*************************************************************************
* * * *
* YAP Prolog * * YAP Prolog *
* * * *
* Yap Prolog was developed at NCCUP - Universidade do Porto * * Yap Prolog was developed at NCCUP - Universidade do Porto *
* * * *
* Copyright L.Damas, V.S.Costa and Universidade do Porto 1985-1997 * * Copyright L.Damas, V.S.Costa and Universidade do Porto 1985-1997 *
* * * *
************************************************************************** **************************************************************************
* * * *
* File: arith1.c * * File: arith1.c *
* Last rev: * * Last rev: *
* mods: * * mods: *
* comments: bignum support through gmp * * comments: bignum support through gmp *
* * * *
*************************************************************************/ *************************************************************************/
#ifdef SCCS #ifdef SCCS
static char SccsId[] = "%W% %G%"; static char SccsId[] = "%W% %G%";
#endif #endif
#include "Yap.h" #include "Yap.h"
@ -33,12 +33,10 @@ static char SccsId[] = "%W% %G%";
#include "YapEval.h" #include "YapEval.h"
#include "alloc.h" #include "alloc.h"
Term Term Yap_MkBigIntTerm(MP_INT *big) {
Yap_MkBigIntTerm(MP_INT *big)
{
CACHE_REGS CACHE_REGS
Int nlimbs; Int nlimbs;
MP_INT *dst = (MP_INT *)(HR+2); MP_INT *dst = (MP_INT *)(HR + 2);
CELL *ret = HR; CELL *ret = HR;
Int bytes; Int bytes;
@ -50,38 +48,33 @@ Yap_MkBigIntTerm(MP_INT *big)
// nlimbs = ALIGN_YAPTYPE(bytes,CELL)/CellSize; // nlimbs = ALIGN_YAPTYPE(bytes,CELL)/CellSize;
// this works, but it shouldn't need to do this... // this works, but it shouldn't need to do this...
nlimbs = big->_mp_alloc; nlimbs = big->_mp_alloc;
bytes = nlimbs*sizeof(CELL); bytes = nlimbs * sizeof(CELL);
if (nlimbs > (ASP-ret)-1024) { if (nlimbs > (ASP - ret) - 1024) {
return TermNil; return TermNil;
} }
HR[0] = (CELL)FunctorBigInt; HR[0] = (CELL)FunctorBigInt;
HR[1] = BIG_INT; HR[1] = BIG_INT;
dst->_mp_size = big->_mp_size; dst->_mp_size = big->_mp_size;
dst->_mp_alloc = nlimbs*(CellSize/sizeof(mp_limb_t)); dst->_mp_alloc = nlimbs * (CellSize / sizeof(mp_limb_t));
memmove((void *)(dst+1), (const void *)(big->_mp_d), bytes); memmove((void *)(dst + 1), (const void *)(big->_mp_d), bytes);
HR = (CELL *)(dst+1)+nlimbs; HR = (CELL *)(dst + 1) + nlimbs;
HR[0] = EndSpecials; HR[0] = EndSpecials;
HR++; HR++;
return AbsAppl(ret); return AbsAppl(ret);
} }
MP_INT *Yap_BigIntOfTerm(Term t) {
MP_INT *new = (MP_INT *)(RepAppl(t) + 2);
MP_INT * new->_mp_d = (mp_limb_t *)(new + 1);
Yap_BigIntOfTerm(Term t) return (new);
{
MP_INT *new = (MP_INT *)(RepAppl(t)+2);
new->_mp_d = (mp_limb_t *)(new+1);
return(new);
} }
Term Term Yap_MkBigRatTerm(MP_RAT *big) {
Yap_MkBigRatTerm(MP_RAT *big)
{
CACHE_REGS CACHE_REGS
Int nlimbs; Int nlimbs;
MP_INT *dst = (MP_INT *)(HR+2); MP_INT *dst = (MP_INT *)(HR + 2);
MP_INT *num = mpq_numref(big); MP_INT *num = mpq_numref(big);
MP_INT *den = mpq_denref(big); MP_INT *den = mpq_denref(big);
MP_RAT *rat; MP_RAT *rat;
@ -89,84 +82,76 @@ Yap_MkBigRatTerm(MP_RAT *big)
if (mpz_cmp_si(den, 1) == 0) if (mpz_cmp_si(den, 1) == 0)
return Yap_MkBigIntTerm(num); return Yap_MkBigIntTerm(num);
if ((num->_mp_alloc+den->_mp_alloc)*(sizeof(mp_limb_t)/CellSize) > (ASP-ret)-1024) { if ((num->_mp_alloc + den->_mp_alloc) * (sizeof(mp_limb_t) / CellSize) >
(ASP - ret) - 1024) {
return TermNil; return TermNil;
} }
HR[0] = (CELL)FunctorBigInt; HR[0] = (CELL)FunctorBigInt;
HR[1] = BIG_RATIONAL; HR[1] = BIG_RATIONAL;
dst->_mp_size = 0; dst->_mp_size = 0;
rat = (MP_RAT *)(dst+1); rat = (MP_RAT *)(dst + 1);
rat->_mp_num._mp_size = num->_mp_size; rat->_mp_num._mp_size = num->_mp_size;
rat->_mp_num._mp_alloc = num->_mp_alloc; rat->_mp_num._mp_alloc = num->_mp_alloc;
nlimbs = (num->_mp_alloc)*(sizeof(mp_limb_t)/CellSize); nlimbs = (num->_mp_alloc) * (sizeof(mp_limb_t) / CellSize);
memmove((void *)(rat+1), (const void *)(num->_mp_d), nlimbs*CellSize); memmove((void *)(rat + 1), (const void *)(num->_mp_d), nlimbs * CellSize);
rat->_mp_den._mp_size = den->_mp_size; rat->_mp_den._mp_size = den->_mp_size;
rat->_mp_den._mp_alloc = den->_mp_alloc; rat->_mp_den._mp_alloc = den->_mp_alloc;
HR = (CELL *)(rat+1)+nlimbs; HR = (CELL *)(rat + 1) + nlimbs;
nlimbs = (den->_mp_alloc)*(sizeof(mp_limb_t)/CellSize); nlimbs = (den->_mp_alloc) * (sizeof(mp_limb_t) / CellSize);
memmove((void *)(HR), (const void *)(den->_mp_d), nlimbs*CellSize); memmove((void *)(HR), (const void *)(den->_mp_d), nlimbs * CellSize);
HR += nlimbs; HR += nlimbs;
dst->_mp_alloc = (HR-(CELL *)(dst+1)); dst->_mp_alloc = (HR - (CELL *)(dst + 1));
HR[0] = EndSpecials; HR[0] = EndSpecials;
HR++; HR++;
return AbsAppl(ret); return AbsAppl(ret);
} }
MP_RAT * MP_RAT *Yap_BigRatOfTerm(Term t) {
Yap_BigRatOfTerm(Term t) MP_RAT *new = (MP_RAT *)(RepAppl(t) + 2 + sizeof(MP_INT) / sizeof(CELL));
{
MP_RAT *new = (MP_RAT *)(RepAppl(t)+2+sizeof(MP_INT)/sizeof(CELL));
mp_limb_t *nt; mp_limb_t *nt;
nt = new->_mp_num._mp_d = (mp_limb_t *)(new+1); nt = new->_mp_num._mp_d = (mp_limb_t *)(new + 1);
nt += new->_mp_num._mp_alloc; nt += new->_mp_num._mp_alloc;
new->_mp_den._mp_d = nt; new->_mp_den._mp_d = nt;
return new; return new;
} }
Term Term Yap_RatTermToApplTerm(Term t) {
Yap_RatTermToApplTerm(Term t)
{
Term ts[2]; Term ts[2];
MP_RAT *rat = Yap_BigRatOfTerm(t); MP_RAT *rat = Yap_BigRatOfTerm(t);
ts[0] = Yap_MkBigIntTerm(mpq_numref(rat)); ts[0] = Yap_MkBigIntTerm(mpq_numref(rat));
ts[1] = Yap_MkBigIntTerm(mpq_denref(rat)); ts[1] = Yap_MkBigIntTerm(mpq_denref(rat));
return Yap_MkApplTerm(FunctorRDiv,2,ts); return Yap_MkApplTerm(FunctorRDiv, 2, ts);
} }
#endif #endif
Term Term Yap_AllocExternalDataInStack(CELL tag, size_t bytes, CELL **pt) {
Yap_AllocExternalDataInStack(CELL tag, size_t bytes)
{
CACHE_REGS CACHE_REGS
Int nlimbs; Int nlimbs;
MP_INT *dst = (MP_INT *)(HR+2); MP_INT *dst = (MP_INT *)(HR + 2);
CELL *ret = HR; CELL *ret = HR;
nlimbs = ALIGN_BY_TYPE(bytes,CELL)/CellSize; nlimbs = ALIGN_BY_TYPE(bytes, CELL) / CellSize;
if (nlimbs > (ASP-ret)-1024) { if (nlimbs > (ASP - ret) - 1024) {
return TermNil; return TermNil;
} }
HR[0] = (CELL)FunctorBigInt; HR[0] = (CELL)FunctorBigInt;
HR[1] = tag; HR[1] = tag;
dst->_mp_size = 0; dst->_mp_size = 0;
dst->_mp_alloc = nlimbs; dst->_mp_alloc = nlimbs;
HR = (CELL *)(dst+1)+nlimbs; HR = (CELL *)(dst + 1) + nlimbs;
HR[0] = EndSpecials; HR[0] = EndSpecials;
HR++; HR++;
if (tag != EXTERNAL_BLOB) { *pt = (CELL *)(dst + 1);
TrailTerm(TR) = AbsPair(ret);
TR++;
}
return AbsAppl(ret); return AbsAppl(ret);
} }
int Yap_CleanOpaqueVariable(CELL *pt) int Yap_CleanOpaqueVariable(CELL d) {
{
CELL blob_info, blob_tag; CELL blob_info, blob_tag;
MP_INT *blobp; MP_INT *blobp;
CELL *pt = RepAppl(HeadOfTerm(d));
#ifdef DEBUG #ifdef DEBUG
/* sanity checking */ /* sanity checking */
if (pt[0] != (CELL)FunctorBigInt) { if (pt[0] != (CELL)FunctorBigInt) {
@ -175,23 +160,20 @@ int Yap_CleanOpaqueVariable(CELL *pt)
} }
#endif #endif
blob_tag = pt[1]; blob_tag = pt[1];
if (blob_tag < USER_BLOB_START || if (blob_tag < USER_BLOB_START || blob_tag >= USER_BLOB_END) {
blob_tag >= USER_BLOB_END) { Yap_Error(SYSTEM_ERROR_INTERNAL, AbsAppl(pt),
Yap_Error(SYSTEM_ERROR_INTERNAL, AbsAppl(pt), "clean opaque: bad blob with tag " UInt_FORMAT ,blob_tag); "clean opaque: bad blob with tag " UInt_FORMAT, blob_tag);
return FALSE; return FALSE;
} }
blob_info = blob_tag - USER_BLOB_START; blob_info = blob_tag - USER_BLOB_START;
if (!GLOBAL_OpaqueHandlers) if (!GLOBAL_OpaqueHandlers)
return FALSE; return FALSE;
blobp = (MP_INT *)(pt+2);
if (!GLOBAL_OpaqueHandlers[blob_info].fail_handler) if (!GLOBAL_OpaqueHandlers[blob_info].fail_handler)
return TRUE; return true;
return (GLOBAL_OpaqueHandlers[blob_info].fail_handler)((void *)(blobp+1)); return (GLOBAL_OpaqueHandlers[blob_info].fail_handler)(d);
} }
Opaque_CallOnWrite YAP_Opaque_CallOnWrite Yap_blob_write_handler(Term t) {
Yap_blob_write_handler(Term t)
{
CELL blob_info, blob_tag; CELL blob_info, blob_tag;
CELL *pt = RepAppl(t); CELL *pt = RepAppl(t);
@ -203,9 +185,9 @@ Yap_blob_write_handler(Term t)
} }
#endif #endif
blob_tag = pt[1]; blob_tag = pt[1];
if (blob_tag < USER_BLOB_START || if (blob_tag < USER_BLOB_START || blob_tag >= USER_BLOB_END) {
blob_tag >= USER_BLOB_END) { Yap_Error(SYSTEM_ERROR_INTERNAL, AbsAppl(pt),
Yap_Error(SYSTEM_ERROR_INTERNAL, AbsAppl(pt), "clean opaque: bad blob with tag " UInt_FORMAT ,blob_tag); "clean opaque: bad blob with tag " UInt_FORMAT, blob_tag);
return FALSE; return FALSE;
} }
blob_info = blob_tag - USER_BLOB_START; blob_info = blob_tag - USER_BLOB_START;
@ -215,9 +197,7 @@ Yap_blob_write_handler(Term t)
return GLOBAL_OpaqueHandlers[blob_info].write_handler; return GLOBAL_OpaqueHandlers[blob_info].write_handler;
} }
Opaque_CallOnGCMark YAP_Opaque_CallOnGCMark Yap_blob_gc_mark_handler(Term t) {
Yap_blob_gc_mark_handler(Term t)
{
CELL blob_info, blob_tag; CELL blob_info, blob_tag;
CELL *pt = RepAppl(t); CELL *pt = RepAppl(t);
@ -229,19 +209,16 @@ Yap_blob_gc_mark_handler(Term t)
} }
#endif #endif
blob_tag = pt[1]; blob_tag = pt[1];
if (blob_tag < USER_BLOB_START || if (blob_tag < USER_BLOB_START || blob_tag >= USER_BLOB_END) {
blob_tag >= USER_BLOB_END) {
return NULL; return NULL;
} }
blob_info = blob_tag - USER_BLOB_START; blob_info = blob_tag - USER_BLOB_START;
if (!GLOBAL_OpaqueHandlers) if (!GLOBAL_OpaqueHandlers)
return NULL; return NULL;
return GLOBAL_OpaqueHandlers[blob_info].gc_mark_handler; return GLOBAL_OpaqueHandlers[blob_info].mark_handler;
} }
Opaque_CallOnGCRelocate YAP_Opaque_CallOnGCRelocate Yap_blob_gc_relocate_handler(Term t) {
Yap_blob_gc_relocate_handler(Term t)
{
CELL blob_info, blob_tag; CELL blob_info, blob_tag;
CELL *pt = RepAppl(t); CELL *pt = RepAppl(t);
@ -253,19 +230,18 @@ Yap_blob_gc_relocate_handler(Term t)
} }
#endif #endif
blob_tag = pt[1]; blob_tag = pt[1];
if (blob_tag < USER_BLOB_START || if (blob_tag < USER_BLOB_START || blob_tag >= USER_BLOB_END) {
blob_tag >= USER_BLOB_END) { Yap_Error(SYSTEM_ERROR_INTERNAL, AbsAppl(pt),
Yap_Error(SYSTEM_ERROR_INTERNAL, AbsAppl(pt), "clean opaque: bad blob with tag " UInt_FORMAT ,blob_tag); "clean opaque: bad blob with tag " UInt_FORMAT, blob_tag);
return FALSE; return FALSE;
} }
blob_info = blob_tag - USER_BLOB_START; blob_info = blob_tag - USER_BLOB_START;
if (!GLOBAL_OpaqueHandlers) if (!GLOBAL_OpaqueHandlers)
return NULL; return NULL;
return GLOBAL_OpaqueHandlers[blob_info].gc_relocate_handler; return GLOBAL_OpaqueHandlers[blob_info].relocate_handler;
} }
extern Int Yap_blob_tag(Term t) extern Int Yap_blob_tag(Term t) {
{
CELL *pt = RepAppl(t); CELL *pt = RepAppl(t);
#ifdef DEBUG #ifdef DEBUG
@ -278,9 +254,7 @@ extern Int Yap_blob_tag(Term t)
return pt[1]; return pt[1];
} }
void * void *Yap_blob_info(Term t) {
Yap_blob_info(Term t)
{
MP_INT *blobp; MP_INT *blobp;
CELL *pt = RepAppl(t); CELL *pt = RepAppl(t);
@ -293,88 +267,83 @@ Yap_blob_info(Term t)
#endif #endif
if (!GLOBAL_OpaqueHandlers) if (!GLOBAL_OpaqueHandlers)
return FALSE; return FALSE;
blobp = (MP_INT *)(pt+2); blobp = (MP_INT *)(pt + 2);
return (void *)(blobp+1); return (void *)(blobp + 1);
} }
Term Term Yap_MkULLIntTerm(YAP_ULONG_LONG n) {
Yap_MkULLIntTerm(YAP_ULONG_LONG n)
{
#if __GNUC__ && USE_GMP #if __GNUC__ && USE_GMP
mpz_t new; mpz_t new;
char tmp[256]; char tmp[256];
Term t; Term t;
#ifdef _WIN32 #ifdef _WIN32
snprintf(tmp,256,"%I64u",n); snprintf(tmp, 256, "%I64u", n);
#elif HAVE_SNPRINTF #elif HAVE_SNPRINTF
snprintf(tmp,256,"%llu",n); snprintf(tmp, 256, "%llu", n);
#else #else
sprintf(tmp,"%llu",n); sprintf(tmp, "%llu", n);
#endif #endif
/* try to scan it as a bignum */ /* try to scan it as a bignum */
mpz_init_set_str (new, tmp, 10); mpz_init_set_str(new, tmp, 10);
if (mpz_fits_slong_p(new)) { if (mpz_fits_slong_p(new)) {
CACHE_REGS
return MkIntegerTerm(mpz_get_si(new));
}
t = Yap_MkBigIntTerm(new);
mpz_clear(new);
return t;
#else
CACHE_REGS CACHE_REGS
return MkIntegerTerm(n); return MkIntegerTerm(mpz_get_si(new));
}
t = Yap_MkBigIntTerm(new);
mpz_clear(new);
return t;
#else
CACHE_REGS
return MkIntegerTerm(n);
#endif #endif
} }
CELL * CELL *Yap_HeapStoreOpaqueTerm(Term t) {
Yap_HeapStoreOpaqueTerm(Term t)
{
CELL *ptr = RepAppl(t); CELL *ptr = RepAppl(t);
size_t sz; size_t sz;
void *new; void *new;
if (ptr[0] == (CELL)FunctorBigInt) { if (ptr[0] == (CELL)FunctorBigInt) {
sz = sizeof(MP_INT)+2*CellSize+ sz = sizeof(MP_INT) + 2 * CellSize +
((MP_INT *)(ptr+2))->_mp_alloc*sizeof(mp_limb_t); ((MP_INT *)(ptr + 2))->_mp_alloc * sizeof(mp_limb_t);
} else { /* string */ } else { /* string */
sz = sizeof(CELL)*(2+ptr[1]); sz = sizeof(CELL) * (2 + ptr[1]);
} }
new = Yap_AllocCodeSpace(sz); new = Yap_AllocCodeSpace(sz);
if (!new) { if (!new) {
Yap_Error(RESOURCE_ERROR_HEAP, TermNil, "subgoal_search_loop: no space for %s", StringOfTerm(t) ); Yap_Error(RESOURCE_ERROR_HEAP, TermNil,
"subgoal_search_loop: no space for %s", StringOfTerm(t));
} else { } else {
if (ptr[0] == (CELL)FunctorBigInt) { if (ptr[0] == (CELL)FunctorBigInt) {
MP_INT *new = (MP_INT *)(RepAppl(t)+2); MP_INT *new = (MP_INT *)(RepAppl(t) + 2);
new->_mp_d = (mp_limb_t *)(new+1); new->_mp_d = (mp_limb_t *)(new + 1);
} }
memmove(new, ptr, sz); memmove(new, ptr, sz);
} }
return new; return new;
} }
size_t Yap_OpaqueTermToString(Term t, char *str, size_t max) {
size_t
Yap_OpaqueTermToString(Term t, char *str, size_t max)
{
size_t str_index = 0; size_t str_index = 0;
CELL * li = RepAppl(t); CELL *li = RepAppl(t);
unsigned char *ptr = (unsigned char *)StringOfTerm(AbsAppl(li)); unsigned char *ptr = (unsigned char *)StringOfTerm(AbsAppl(li));
if (li[0] == (CELL)FunctorString) { if (li[0] == (CELL)FunctorString) {
str_index += sprintf(& str[str_index], "\""); str_index += sprintf(&str[str_index], "\"");
do { do {
utf8proc_int32_t chr; utf8proc_int32_t chr;
ptr += get_utf8(ptr, -1, &chr); ptr += get_utf8(ptr, -1, &chr);
if (chr == '\0') break; if (chr == '\0')
str_index += sprintf(str+str_index, "%C", chr); break;
str_index += sprintf(str + str_index, "%C", chr);
} while (TRUE); } while (TRUE);
str_index += sprintf(str+str_index, "\""); str_index += sprintf(str + str_index, "\"");
} else { } else {
CELL big_tag = li[1]; CELL big_tag = li[1];
if (big_tag == ARRAY_INT || big_tag == ARRAY_FLOAT) { if (big_tag == ARRAY_INT || big_tag == ARRAY_FLOAT) {
str_index += sprintf(& str[str_index], "{...}"); str_index += sprintf(&str[str_index], "{...}");
#ifdef USE_GMP #ifdef USE_GMP
} else if (big_tag == BIG_INT) { } else if (big_tag == BIG_INT) {
MP_INT *big = Yap_BigIntOfTerm(AbsAppl(li)); MP_INT *big = Yap_BigIntOfTerm(AbsAppl(li));
@ -398,52 +367,35 @@ Yap_OpaqueTermToString(Term t, char *str, size_t max)
return; return;
} }
} */ } */
str_index += sprintf(& str[str_index], "0"); str_index += sprintf(&str[str_index], "0");
} }
return str_index; return str_index;
} }
static Int static Int p_is_bignum(USES_REGS1) {
p_is_bignum( USES_REGS1 )
{
#ifdef USE_GMP #ifdef USE_GMP
Term t = Deref(ARG1); Term t = Deref(ARG1);
return( return (IsNonVarTerm(t) && IsApplTerm(t) &&
IsNonVarTerm(t) && FunctorOfTerm(t) == FunctorBigInt && RepAppl(t)[1] == BIG_INT);
IsApplTerm(t) &&
FunctorOfTerm(t) == FunctorBigInt &&
RepAppl(t)[1] == BIG_INT
);
#else #else
return FALSE; return FALSE;
#endif #endif
} }
static Int static Int p_is_string(USES_REGS1) {
p_is_string( USES_REGS1 )
{
Term t = Deref(ARG1); Term t = Deref(ARG1);
return( return (IsNonVarTerm(t) && IsApplTerm(t) &&
IsNonVarTerm(t) && FunctorOfTerm(t) == FunctorString);
IsApplTerm(t) &&
FunctorOfTerm(t) == FunctorString
);
} }
static Int static Int p_nb_set_bit(USES_REGS1) {
p_nb_set_bit( USES_REGS1 )
{
#ifdef USE_GMP #ifdef USE_GMP
Term t = Deref(ARG1); Term t = Deref(ARG1);
Term ti = Deref(ARG2); Term ti = Deref(ARG2);
Int i; Int i;
if (!( if (!(IsNonVarTerm(t) && IsApplTerm(t) && FunctorOfTerm(t) == FunctorBigInt &&
IsNonVarTerm(t) && RepAppl(t)[1] == BIG_INT))
IsApplTerm(t) &&
FunctorOfTerm(t) == FunctorBigInt &&
RepAppl(t)[1] == BIG_INT
))
return FALSE; return FALSE;
if (!IsIntegerTerm(ti)) { if (!IsIntegerTerm(ti)) {
return FALSE; return FALSE;
@ -462,9 +414,7 @@ p_nb_set_bit( USES_REGS1 )
#endif #endif
} }
static Int static Int p_has_bignums(USES_REGS1) {
p_has_bignums( USES_REGS1 )
{
#ifdef USE_GMP #ifdef USE_GMP
return TRUE; return TRUE;
#else #else
@ -472,9 +422,7 @@ p_has_bignums( USES_REGS1 )
#endif #endif
} }
static Int static Int p_is_opaque(USES_REGS1) {
p_is_opaque( USES_REGS1 )
{
Term t = Deref(ARG1); Term t = Deref(ARG1);
if (IsVarTerm(t)) if (IsVarTerm(t))
return FALSE; return FALSE;
@ -485,14 +433,12 @@ p_is_opaque( USES_REGS1 )
if (f != FunctorBigInt) if (f != FunctorBigInt)
return FALSE; return FALSE;
pt = RepAppl(t); pt = RepAppl(t);
return ( pt[1] != BIG_RATIONAL || pt[1] != BIG_INT ); return (pt[1] != BIG_RATIONAL || pt[1] != BIG_INT);
} }
return FALSE; return FALSE;
} }
static Int static Int p_is_rational(USES_REGS1) {
p_is_rational( USES_REGS1 )
{
Term t = Deref(ARG1); Term t = Deref(ARG1);
if (IsVarTerm(t)) if (IsVarTerm(t))
return FALSE; return FALSE;
@ -507,14 +453,12 @@ p_is_rational( USES_REGS1 )
if (f != FunctorBigInt) if (f != FunctorBigInt)
return FALSE; return FALSE;
pt = RepAppl(t); pt = RepAppl(t);
return ( pt[1] == BIG_RATIONAL || pt[1] == BIG_INT ); return (pt[1] == BIG_RATIONAL || pt[1] == BIG_INT);
} }
return FALSE; return FALSE;
} }
static Int static Int p_rational(USES_REGS1) {
p_rational( USES_REGS1 )
{
#ifdef USE_GMP #ifdef USE_GMP
Term t = Deref(ARG1); Term t = Deref(ARG1);
Functor f; Functor f;
@ -534,37 +478,32 @@ p_rational( USES_REGS1 )
return FALSE; return FALSE;
rat = Yap_BigRatOfTerm(t); rat = Yap_BigRatOfTerm(t);
while ((t1 = Yap_MkBigIntTerm(mpq_numref(rat))) == TermNil || while ((t1 = Yap_MkBigIntTerm(mpq_numref(rat))) == TermNil ||
(t2 = Yap_MkBigIntTerm(mpq_denref(rat))) == TermNil) { (t2 = Yap_MkBigIntTerm(mpq_denref(rat))) == TermNil) {
UInt size = UInt size = (mpq_numref(rat)->_mp_alloc) * (sizeof(mp_limb_t) / CellSize) +
(mpq_numref(rat)->_mp_alloc)*(sizeof(mp_limb_t)/CellSize) + (mpq_denref(rat)->_mp_alloc) * (sizeof(mp_limb_t) / CellSize);
(mpq_denref(rat)->_mp_alloc)*(sizeof(mp_limb_t)/CellSize);
if (!Yap_gcl(size, 3, ENV, P)) { if (!Yap_gcl(size, 3, ENV, P)) {
Yap_Error(RESOURCE_ERROR_STACK, t, LOCAL_ErrorMessage); Yap_Error(RESOURCE_ERROR_STACK, t, LOCAL_ErrorMessage);
return FALSE; return FALSE;
} }
} }
return return Yap_unify(ARG2, t1) && Yap_unify(ARG3, t2);
Yap_unify(ARG2, t1) &&
Yap_unify(ARG3, t2);
#else #else
return FALSE; return FALSE;
#endif #endif
} }
void void Yap_InitBigNums(void) {
Yap_InitBigNums(void)
{
Yap_InitCPred("$has_bignums", 0, p_has_bignums, SafePredFlag); Yap_InitCPred("$has_bignums", 0, p_has_bignums, SafePredFlag);
Yap_InitCPred("$bignum", 1, p_is_bignum, SafePredFlag); Yap_InitCPred("$bignum", 1, p_is_bignum, SafePredFlag);
Yap_InitCPred("rational", 3, p_rational, 0); Yap_InitCPred("rational", 3, p_rational, 0);
Yap_InitCPred("rational", 1, p_is_rational, SafePredFlag); Yap_InitCPred("rational", 1, p_is_rational, SafePredFlag);
/** @pred rational( _T_) /** @pred rational( _T_)
Checks whether `T` is a rational number. Checks whether `T` is a rational number.
*/ */
Yap_InitCPred("string", 1, p_is_string, SafePredFlag); Yap_InitCPred("string", 1, p_is_string, SafePredFlag);
Yap_InitCPred("opaque", 1, p_is_opaque, SafePredFlag); Yap_InitCPred("opaque", 1, p_is_opaque, SafePredFlag);
Yap_InitCPred("nb_set_bit", 2, p_nb_set_bit, SafePredFlag); Yap_InitCPred("nb_set_bit", 2, p_nb_set_bit, SafePredFlag);

View File

@ -1865,7 +1865,8 @@ X_API Int YAP_RunGoal(Term t) {
} }
X_API Term YAP_AllocExternalDataInStack(size_t bytes) { X_API Term YAP_AllocExternalDataInStack(size_t bytes) {
Term t = Yap_AllocExternalDataInStack(EXTERNAL_BLOB, bytes); CELL *pt;
Term t = Yap_AllocExternalDataInStack(EXTERNAL_BLOB, bytes, &pt);
if (t == TermNil) if (t == TermNil)
return 0L; return 0L;
return t; return t;
@ -1883,7 +1884,7 @@ X_API YAP_opaque_tag_t YAP_NewOpaqueType(struct YAP_opaque_handler_struct *f) {
int i; int i;
if (!GLOBAL_OpaqueHandlers) { if (!GLOBAL_OpaqueHandlers) {
GLOBAL_OpaqueHandlers = GLOBAL_OpaqueHandlers =
malloc(sizeof(opaque_handler_t) * (USER_BLOB_END - USER_BLOB_START)); malloc(sizeof(YAP_opaque_handler_t) * (USER_BLOB_END - USER_BLOB_START));
if (!GLOBAL_OpaqueHandlers) { if (!GLOBAL_OpaqueHandlers) {
/* no room */ /* no room */
return -1; return -1;
@ -1893,14 +1894,28 @@ X_API YAP_opaque_tag_t YAP_NewOpaqueType(struct YAP_opaque_handler_struct *f) {
return -1; return -1;
} }
i = GLOBAL_OpaqueHandlersCount++; i = GLOBAL_OpaqueHandlersCount++;
memcpy(GLOBAL_OpaqueHandlers + i, f, sizeof(opaque_handler_t)); memcpy(GLOBAL_OpaqueHandlers + i, f, sizeof(YAP_opaque_handler_t));
return i + USER_BLOB_START; return i + USER_BLOB_START;
} }
X_API Term YAP_NewOpaqueObject(YAP_opaque_tag_t tag, size_t bytes) { X_API Term YAP_NewOpaqueObject(YAP_opaque_tag_t blob_tag, size_t bytes) {
Term t = Yap_AllocExternalDataInStack((CELL) tag, bytes); CELL *pt;
Term t = Yap_AllocExternalDataInStack((CELL) blob_tag, bytes, &pt);
if (t == TermNil) if (t == TermNil)
return 0L; return 0L;
blob_tag = pt[1];
if (blob_tag < USER_BLOB_START ||
blob_tag >= USER_BLOB_END) {
Yap_Error(SYSTEM_ERROR_INTERNAL, AbsAppl(pt), "clean opaque: bad blob with tag " UInt_FORMAT ,blob_tag);
return FALSE;
}
YAP_opaque_tag_t blob_info = blob_tag - USER_BLOB_START;
if (GLOBAL_OpaqueHandlers[blob_info].cut_handler ||
GLOBAL_OpaqueHandlers[blob_info].fail_handler ) {
*HR++ = t;
*HR++ = TermNil;
TrailTerm(TR) = AbsPair(HR-2);
}
return t; return t;
} }

574
C/exec.c
View File

@ -22,7 +22,6 @@ static char SccsId[] = "@(#)cdmgr.c 1.1 05/02/98";
#include "attvar.h" #include "attvar.h"
#include "cut_c.h" #include "cut_c.h"
#include "yapio.h" #include "yapio.h"
#include "yapio.h"
static bool CallPredicate(PredEntry *, choiceptr, yamop *CACHE_TYPE); static bool CallPredicate(PredEntry *, choiceptr, yamop *CACHE_TYPE);
// must hold thread worker comm lock at call. // must hold thread worker comm lock at call.
@ -48,7 +47,7 @@ static choiceptr cp_from_integer(Term cpt USES_REGS) {
*/ */
Term Yap_cp_as_integer(choiceptr cp) { Term Yap_cp_as_integer(choiceptr cp) {
CACHE_REGS CACHE_REGS
return cp_as_integer(cp PASS_REGS); return cp_as_integer(cp PASS_REGS);
} }
/** /**
@ -128,7 +127,7 @@ inline static bool CallMetaCall(Term t, Term mod USES_REGS) {
*/ */
Term Yap_ExecuteCallMetaCall(Term g, Term mod) { Term Yap_ExecuteCallMetaCall(Term g, Term mod) {
CACHE_REGS CACHE_REGS
Term ts[4]; Term ts[4];
ts[0] = g; ts[0] = g;
ts[1] = cp_as_integer(B PASS_REGS); /* p_current_choice_point */ ts[1] = cp_as_integer(B PASS_REGS); /* p_current_choice_point */
ts[2] = g; ts[2] = g;
@ -141,8 +140,8 @@ Term Yap_ExecuteCallMetaCall(Term g, Term mod) {
Term Yap_PredicateIndicator(Term t, Term mod) { Term Yap_PredicateIndicator(Term t, Term mod) {
CACHE_REGS CACHE_REGS
// generate predicate indicator in this case // generate predicate indicator in this case
Term ti[2]; Term ti[2];
t = Yap_YapStripModule(t, &mod); t = Yap_YapStripModule(t, &mod);
if (IsApplTerm(t) && !IsExtensionFunctor(FunctorOfTerm(t))) { if (IsApplTerm(t) && !IsExtensionFunctor(FunctorOfTerm(t))) {
ti[0] = MkAtomTerm(NameOfFunctor(FunctorOfTerm(t))); ti[0] = MkAtomTerm(NameOfFunctor(FunctorOfTerm(t)));
@ -215,7 +214,7 @@ static Int save_env_b(USES_REGS1) {
static PredEntry *new_pred(Term t, Term tmod, char *pname) { static PredEntry *new_pred(Term t, Term tmod, char *pname) {
Term t0 = t; Term t0 = t;
restart: restart:
if (IsVarTerm(t)) { if (IsVarTerm(t)) {
Yap_Error(INSTANTIATION_ERROR, t0, pname); Yap_Error(INSTANTIATION_ERROR, t0, pname);
return NULL; return NULL;
@ -315,7 +314,7 @@ inline static bool do_execute(Term t, Term mod USES_REGS) {
/* I cannot use the standard macro here because /* I cannot use the standard macro here because
otherwise I would dereference the argument and otherwise I would dereference the argument and
might skip a svar */ might skip a svar */
if (pen->PredFlags & (MetaPredFlag|UndefPredFlag)) { if (pen->PredFlags & (MetaPredFlag | UndefPredFlag)) {
return CallMetaCall(t, mod PASS_REGS); return CallMetaCall(t, mod PASS_REGS);
} }
pt = RepAppl(t) + 1; pt = RepAppl(t) + 1;
@ -393,7 +392,7 @@ inline static bool do_execute_n(Term t, Term mod, unsigned int n USES_REGS) {
int j = -n; int j = -n;
Term t0 = t; Term t0 = t;
restart_exec: restart_exec:
if (IsVarTerm(t)) { if (IsVarTerm(t)) {
return CallError(INSTANTIATION_ERROR, t0, mod PASS_REGS); return CallError(INSTANTIATION_ERROR, t0, mod PASS_REGS);
} else if (IsAtomTerm(t)) { } else if (IsAtomTerm(t)) {
@ -432,8 +431,8 @@ inline static bool do_execute_n(Term t, Term mod, unsigned int n USES_REGS) {
} }
if (Yap_has_a_signal() && !LOCAL_InterruptsDisabled) { if (Yap_has_a_signal() && !LOCAL_InterruptsDisabled) {
return EnterCreepMode( return EnterCreepMode(
copy_execn_to_heap(f, pt, n, arity, CurrentModule PASS_REGS), copy_execn_to_heap(f, pt, n, arity, CurrentModule PASS_REGS),
mod PASS_REGS); mod PASS_REGS);
} }
if (arity > MaxTemps) { if (arity > MaxTemps) {
return CallError(TYPE_ERROR_CALLABLE, t, mod PASS_REGS); return CallError(TYPE_ERROR_CALLABLE, t, mod PASS_REGS);
@ -441,7 +440,7 @@ inline static bool do_execute_n(Term t, Term mod, unsigned int n USES_REGS) {
pen = RepPredProp(PredPropByFunc(f, mod)); pen = RepPredProp(PredPropByFunc(f, mod));
/* You thought we would be over by now */ /* You thought we would be over by now */
/* but no meta calls require special preprocessing */ /* but no meta calls require special preprocessing */
if (pen->PredFlags & (MetaPredFlag|UndefPredFlag)) { if (pen->PredFlags & (MetaPredFlag | UndefPredFlag)) {
Term t = copy_execn_to_heap(f, pt, n, arity, mod PASS_REGS); Term t = copy_execn_to_heap(f, pt, n, arity, mod PASS_REGS);
return (CallMetaCall(t, mod PASS_REGS)); return (CallMetaCall(t, mod PASS_REGS));
} }
@ -650,7 +649,7 @@ static Int execute_clause(USES_REGS1) { /* '$execute_clause'(Goal) */
yamop *code; yamop *code;
Term clt = Deref(ARG3); Term clt = Deref(ARG3);
restart_exec: restart_exec:
if (IsVarTerm(t)) { if (IsVarTerm(t)) {
Yap_Error(INSTANTIATION_ERROR, ARG3, "call/1"); Yap_Error(INSTANTIATION_ERROR, ARG3, "call/1");
return FALSE; return FALSE;
@ -712,26 +711,6 @@ static Int execute_in_mod(USES_REGS1) { /* '$execute'(Goal) */
return do_execute(Deref(ARG1), Deref(ARG2) PASS_REGS); return do_execute(Deref(ARG1), Deref(ARG2) PASS_REGS);
} }
typedef enum {
CALLED_FROM_CALL = 0x1,
CALLED_FROM_ANSWER = 0x2,
CALLED_FROM_EXIT = 0x4,
CALLED_FROM_RETRY = 0x8,
CALLED_FROM_FAIL = 0x18,
CALLED_FROM_CUT = 0x20,
CALLED_FROM_EXCEPTION = 0x40,
CALLED_FROM_THROW = 0x80
} execution_port;
INLINE_ONLY inline bool called_from_forward(execution_port port) {
return port & (CALLED_FROM_EXIT | CALLED_FROM_CALL | CALLED_FROM_ANSWER |
CALLED_FROM_CUT | CALLED_FROM_THROW);
}
INLINE_ONLY inline bool called_from_backward(execution_port port) {
return port & (CALLED_FROM_RETRY | CALLED_FROM_FAIL | CALLED_FROM_EXCEPTION);
}
/** /**
* remove choice points created since a call to top-goal. * remove choice points created since a call to top-goal.
* *
@ -762,6 +741,7 @@ static void prune_inner_computation(choiceptr parent) {
CP = oCP; CP = oCP;
ENV = LCL0 - oENV; ENV = LCL0 - oENV;
} }
/** /**
* restore abstract machine state * restore abstract machine state
* after completing a computation. * after completing a computation.
@ -789,160 +769,95 @@ static void complete_inner_computation(choiceptr old_B) {
ENV = myB->cp_env; ENV = myB->cp_env;
} }
static inline Term *GetTermAddress(CELL a) { static Int Yap_ignore(Term t USES_REGS) {
Term *b = NULL; yamop *oP = P, *oCP = CP;
restart: Int oENV = LCL0 - ENV;
if (!IsVarTerm(a)) { Int oYENV = LCL0 - YENV;
return (b); Int oB = LCL0 - (CELL *)B;
} else if (a == (CELL)b) { bool rc = Yap_RunTopGoal(t, false);
return (b);
} else {
b = (CELL *)a;
a = *b;
goto restart;
}
}
/** if (Yap_RaiseException()) {
* call a cleanup routine taking care with the status variable. P = oP;
*/ CP = oCP;
static bool call_cleanup(Term t3, Term t4, Term cleanup, ENV = LCL0 - oENV;
choiceptr B0 USES_REGS) { YENV = LCL0 - oYENV;
CELL *pt = GetTermAddress(t3); B = (choiceptr)(LCL0-oB);
DBTerm *ball = Yap_RefToException();
if (pt == NULL)
return false; return false;
*pt = cleanup; }
bool out = Yap_RunTopGoal(t4, true);
if (out) { if (!rc) {
prune_inner_computation(B0); complete_inner_computation((choiceptr)(LCL0 - oB));
// We'll pass it through
} else { } else {
complete_inner_computation(B0); prune_inner_computation((choiceptr)(LCL0 - oB));
} }
pt = GetTermAddress(t3); P = oP;
if (ball) CP = oCP;
Yap_CopyException(ball); ENV = LCL0 - oENV;
if (pt == NULL) { YENV = LCL0 - oYENV;
return false; B = (choiceptr)(LCL0 - oB);
}
RESET_VARIABLE(pt);
return true; return true;
} }
/** extern void *Yap_blob_info(Term t);
* What to do when we exit a protected call
* @method exit_set_call
* @param exec_result result of call (0 or 1)
* @param b0 original choicepointer (pointed to by root)
* @param t3 state
* @param b0 user goal to call on port.
*
* @param USES_REGS [description]
* @return [description]
*/
static bool exit_set_call(execution_port exec_result, choiceptr B0, yamop *oCP,
Term t3, Term t4 USES_REGS) {
Term rc;
switch (exec_result) {
// we failed
// Exception: we'll pass it through
case CALLED_FROM_EXCEPTION:
// internal exception
{
Term ball = Yap_PeekException();
Term signal = Yap_MkApplTerm(FunctorException, 1, &ball);
rc = signal;
B = B0;
}
break;
case CALLED_FROM_THROW:
// internal exception
{
Term ball = Yap_PeekException();
Term signal = Yap_MkApplTerm(FunctorException, 1, &ball);
rc = signal;
B = B0;
}
break;
case CALLED_FROM_RETRY:
// external exception
rc = TermRetry;
// internal failure
return true;
break;
case CALLED_FROM_FAIL:
B = B0;
rc = TermFail;
break;
case CALLED_FROM_EXIT:
// deterministic exit
rc = TermExit;
if (B->cp_b == B0) {
CP = B->cp_cp;
ENV = B->cp_env;
ASP = (CELL *)B;
B = B0;
}
break;
case CALLED_FROM_CUT:
if (B->cp_b == B0) {
CP = B->cp_cp;
ENV = B->cp_env;
ASP = (CELL *)B;
B = B0;
}
rc = TermCut;
break;
case CALLED_FROM_CALL:
// cut exit
rc = TermCall;
break;
case CALLED_FROM_ANSWER:
// cut exit
rc = TermAnswer;
// non deterministic
choiceptr saved_b = B;
CELL *pt = ASP;
CUT_C_PUSH(
NEXTOP(NEXTOP(PredProtectStack->cs.p_code.FirstClause, OtapFs), OtapFs),
pt); // this is where things get complicated, we need to
// protect the stack and be able to backtrack
pt -= 4;
pt[3] = t4;
pt[2] = t3;
pt[1] = MkAddressTerm(oCP);
pt[0] = MkIntegerTerm(LCL0 - (CELL *)B0);
B = (choiceptr)pt;
B--;
B->cp_h = HR;
B->cp_tr = TR;
B->cp_cp = oCP;
B->cp_ap = NEXTOP(PredProtectStack->cs.p_code.FirstClause, OtapFs);
B->cp_env = ENV;
B->cp_b = saved_b;
#ifdef DEPTH_LIMIT
B->cp_depth = saved_b->cp_depth;
#endif /* DEPTH_LIMIT */
YENV = ASP = (CELL *)B;
YENV[E_CB] = (CELL)B;
HB = HR;
return true;
}
call_cleanup(t3, t4, rc, B PASS_REGS);
static bool set_watch(Int Bv, Term task) {
CELL *pt;
Term t = Yap_AllocExternalDataInStack((CELL)setup_call_catcher_cleanup_tag,
sizeof(Int), &pt);
if (t == TermNil)
return false;
*pt = Bv;
*HR++ = t;
*HR++ = task;
TrailTerm(TR) = AbsPair(HR - 2);
TR++;
return true; return true;
} }
static Int protect_stack_from_cut(USES_REGS1) { static bool watch_cut(Term ext USES_REGS) {
// called after backtracking.. // called after backtracking..
/* reinitialize the engine */ //
/* the first real choice-point will also have AP=FAIL */ Term task = TailOfTerm(ext);
/* always have an empty slots for people to use */ Term box = ArgOfTerm(1, task);
YENV = ASP = (CELL *)B; Term port = ArgOfTerm(2, task);
call_cleanup(B->cp_a3, B->cp_a4, (P == FAILCODE ? TermException : TermCut), Term cleanup = ArgOfTerm(3, task);
B PASS_REGS); Term cleaned = ArgOfTerm(6, task);
bool first = Deref(ArgOfTerm(5, task)) == MkIntTerm(0);
bool done = first && !IsVarTerm(Deref(ArgOfTerm(4, task)));
bool previous = !IsVarTerm(Deref(ArgOfTerm(6, task)));
if (done || previous)
return true;
while (B->cp_ap->opc == FAIL_OPCODE)
B = B->cp_b;
if (Yap_HasException()) {
Term e = Yap_GetException();
Term t;
if (first) {
t = Yap_MkApplTerm(FunctorException, 1, &e);
} else {
t = Yap_MkApplTerm(FunctorExternalException, 1, &e);
}
if (!Yap_unify(port, t))
return false;
} else {
if (!Yap_unify(port, TermCut))
return false;
}
if (IsVarTerm(cleaned) && box != TermTrue)
{
*VarOfTerm(cleaned) = Deref(port);
}
else
{
return true;
}
Yap_ignore(cleanup);
if (Yap_RaiseException())
return false;
return true; return true;
} }
@ -953,57 +868,68 @@ static Int protect_stack_from_cut(USES_REGS1) {
* @method protect_stack_from_restore * @method protect_stack_from_restore
* @param USES_REGS1 [env for threaded execution] * @param USES_REGS1 [env for threaded execution]
* @return c * @return c
[next answer] */
*/ static bool watch_retry(Term d0 USES_REGS) {
static Int protect_stack_from_retry(USES_REGS1) {
// called after backtracking.. // called after backtracking..
// //
yamop *oP = P; CELL d = ((CELL *)Yap_blob_info(HeadOfTerm(d0)))[0];
Int oENV = LCL0 - ENV;
yamop *oCP = (yamop *)AddressOfTerm(B->cp_a2);
Term t3 = B->cp_a3;
Term t4 = B->cp_a4;
Int b0 = IntegerOfTerm(ARG1);
choiceptr B0 = (choiceptr)(LCL0 - b0);
cut_c_pop(); choiceptr B0 = (choiceptr)(LCL0 - d);
Term task = TailOfTerm(d0);
Term box = ArgOfTerm(1, task);
Term cleanup = ArgOfTerm(3, task);
Term port = ArgOfTerm(2, task);
Term cleaned = ArgOfTerm(6, task);
bool first = Deref(ArgOfTerm(5, task)) == MkIntTerm(0);
bool done = first && !IsVarTerm(Deref(ArgOfTerm(4, task)));
bool previous = !IsVarTerm(Deref(ArgOfTerm(6, task)));
bool ex = false;
if (done || previous)
return true;
// call_cleanup(t3, t4, TermRetry, B0 USES_REGS); while (B->cp_ap->opc == FAIL_OPCODE)
// binding to t3 should be undone B = B->cp_b;
// by next backtrack. if (Yap_HasException())
/* first, destroy the current choice-point, {
*/ Term e = Yap_GetException();
B = B->cp_b; Term t;
// B should lead to CP with _ystop,,
P = FAILCODE; ex = true;
bool res = Yap_exec_absmi(false, CurrentModule); if (first)
/* reinitialize the engine */ {
/* the first real choice-point will also have AP=FAIL */ t = Yap_MkApplTerm(FunctorException, 1, &e);
/* always have an empty slots for people to use */ }
// ensure that we have slots where we need the
execution_port p;
if (res) {
if (Yap_HasException()) {
p = CALLED_FROM_THROW;
} else if (B->cp_b >= B0) {
p = CALLED_FROM_EXIT;
} else
p = CALLED_FROM_ANSWER;
} else {
if (Yap_HasException())
p = CALLED_FROM_EXCEPTION;
else else
p = CALLED_FROM_FAIL; {
t = Yap_MkApplTerm(FunctorExternalException, 1, &e);
}
if (!Yap_unify(port, t))
return false;
} }
Int rc = exit_set_call(p, B0, oCP, t3, t4 PASS_REGS); else if(B < B0)
if (rc) { {
CP = oCP; if (box != TermTrue) {
P = oP; return true;
ENV = LCL0 - oENV; }
} if (!Yap_unify(port, TermRetry)) {
if (Yap_RaiseException())
return false; return false;
return res; }
} else if (first) {
if (!Yap_unify(port, TermFail))
return false;
} else {
return true;
}
if (IsVarTerm(cleaned) && box != TermTrue) {
*VarOfTerm(cleaned) = Deref(port);
} else {
return true;
}
Yap_ignore(cleanup);
if (!ex && Yap_RaiseException())
return false;
return true;
} }
/** /**
@ -1014,24 +940,14 @@ static Int protect_stack_from_retry(USES_REGS1) {
* @param USES_REGS1 [env for threaded execution] * @param USES_REGS1 [env for threaded execution]
* @return [always succeed] * @return [always succeed]
*/ */
static Int protect_stack(USES_REGS1) {
// just create the choice-point;
return true;
}
static Int setup_call_catcher_cleanup(USES_REGS1) { static Int setup_call_catcher_cleanup(USES_REGS1) {
Term Setup = Deref(ARG1); Term Setup = Deref(ARG1);
Int oENV = LCL0 - ENV;
choiceptr B0 = B; choiceptr B0 = B;
Term t3, t4; yamop *oP = P, *oCP = CP;
yhandle_t hl = Yap_StartSlots(); Int oENV = LCL0 - ENV;
yhandle_t h2 = Yap_InitHandle(ARG2); Int oYENV = LCL0 - YENV;
yhandle_t h3 = Yap_InitHandle(t3 = Deref(ARG3));
yhandle_t h4 = Yap_InitHandle(ARG4);
yamop *oCP = CP, *oP = P;
bool rc; bool rc;
execution_port port;
Yap_DisableInterrupts(worker_id); Yap_DisableInterrupts(worker_id);
rc = Yap_RunTopGoal(Setup, false); rc = Yap_RunTopGoal(Setup, false);
@ -1048,51 +964,67 @@ static Int setup_call_catcher_cleanup(USES_REGS1) {
} else { } else {
prune_inner_computation(B0); prune_inner_computation(B0);
} }
// at this point starts actual goal execution.... P = oP;
rc = Yap_RunTopGoal(Yap_GetFromSlot(h2), false); CP = oCP;
complete_inner_computation(B); ENV = LCL0 - oENV;
t4 = Yap_GetFromSlot(h4); YENV = LCL0 - oYENV;
t3 = Yap_GetFromSlot(h3); return rc;
// make sure that t3 point to our nice cell. }
Yap_CloseSlots(hl);
if (rc) { static Int tag_cleanup(USES_REGS1)
// ignore empty choice {
Int iB = LCL0 - (CELL *)B;
set_watch(iB, Deref(ARG2));
return Yap_unify(ARG1, MkIntegerTerm(iB));
}
static Int cleanup_on_exit(USES_REGS1)
{
choiceptr B0 = (choiceptr)(LCL0 - IntegerOfTerm(Deref(ARG1)));
Term task = Deref(ARG2);
Term box = ArgOfTerm(1, task);
Term cleanup = ArgOfTerm(3, task);
Term catcher = ArgOfTerm(2, task);
Term tag = ArgOfTerm(4, task);
Term cleaned = ArgOfTerm(6, task);
while (B->cp_ap->opc == FAIL_OPCODE) while (B->cp_ap->opc == FAIL_OPCODE)
B = B->cp_b; B = B->cp_b;
if (Yap_HasException()) { if (B < B0)
port = CALLED_FROM_THROW; {
} else if (B->cp_b < B0) { // non-deterministic
port = CALLED_FROM_ANSWER; set_watch(LCL0 - (CELL *)B, task);
} else { if (box == TermTrue)
port = CALLED_FROM_EXIT; {
if (!Yap_unify(catcher, TermAnswer))
return false;
B->cp_tr++;
Yap_ignore(cleanup);
B->cp_tr--;
}
return true;
}
if (!Yap_unify(catcher, TermExit))
return false;
if (IsVarTerm(tag))
*VarOfTerm(tag) = TermTrue;
if (IsVarTerm(cleaned) && box != TermTrue)
{
*VarOfTerm(cleaned) = TermExit;
} }
} else {
if (Yap_HasException())
port = CALLED_FROM_EXCEPTION;
else else
port = CALLED_FROM_FAIL; {
} return true;
// store the correct CP, ENV can be recovered from last env. }
bool e = exit_set_call(port, B0, oCP, t3, t4 PASS_REGS); Yap_ignore(cleanup);
// ensure we have same P return true;
// also, we cannot trust recovered ENV and CP
if (e) {
P = oP;
CP = oCP;
ENV = LCL0 - oENV;
}
if (Yap_RaiseException()) {
return false;
}
return rc;
} }
static bool complete_ge(bool out, Term omod, yhandle_t sl, bool creeping) { static bool complete_ge(bool out, Term omod, yhandle_t sl, bool creeping) {
CACHE_REGS CACHE_REGS
if (creeping) { if (creeping) {
Yap_signal(YAP_CREEP_SIGNAL); Yap_signal(YAP_CREEP_SIGNAL);
} }
CurrentModule = omod; CurrentModule = omod;
Yap_CloseSlots(sl); Yap_CloseSlots(sl);
if (out) { if (out) {
@ -1122,7 +1054,7 @@ static Int _user_expand_goal(USES_REGS1) {
ARG1 = Yap_MkApplTerm(FunctorModule, 2, mg_args); ARG1 = Yap_MkApplTerm(FunctorModule, 2, mg_args);
ARG2 = Yap_GetFromSlot(h2); ARG2 = Yap_GetFromSlot(h2);
if ((pe = RepPredProp( if ((pe = RepPredProp(
Yap_GetPredPropByFunc(FunctorGoalExpansion2, SYSTEM_MODULE))) && Yap_GetPredPropByFunc(FunctorGoalExpansion2, SYSTEM_MODULE))) &&
pe->OpcodeOfPred != FAIL_OPCODE && pe->OpcodeOfPred != UNDEF_OPCODE && pe->OpcodeOfPred != FAIL_OPCODE && pe->OpcodeOfPred != UNDEF_OPCODE &&
Yap_execute_pred(pe, NULL, false PASS_REGS)) { Yap_execute_pred(pe, NULL, false PASS_REGS)) {
return complete_ge(true, omod, sl, creeping); return complete_ge(true, omod, sl, creeping);
@ -1132,7 +1064,7 @@ static Int _user_expand_goal(USES_REGS1) {
ARG3 = Yap_GetFromSlot(h2); ARG3 = Yap_GetFromSlot(h2);
/* user:goal_expansion(A,CurMod,B) */ /* user:goal_expansion(A,CurMod,B) */
if ((pe = RepPredProp( if ((pe = RepPredProp(
Yap_GetPredPropByFunc(FunctorGoalExpansion, USER_MODULE))) && Yap_GetPredPropByFunc(FunctorGoalExpansion, USER_MODULE))) &&
pe->OpcodeOfPred != FAIL_OPCODE && pe->OpcodeOfPred != UNDEF_OPCODE && pe->OpcodeOfPred != FAIL_OPCODE && pe->OpcodeOfPred != UNDEF_OPCODE &&
Yap_execute_pred(pe, NULL PASS_REGS, false)) { Yap_execute_pred(pe, NULL PASS_REGS, false)) {
return complete_ge(true, omod, sl, creeping); return complete_ge(true, omod, sl, creeping);
@ -1144,7 +1076,7 @@ static Int _user_expand_goal(USES_REGS1) {
/* user:goal_expansion(A,B) */ /* user:goal_expansion(A,B) */
if (cmod != USER_MODULE && /* we have tried this before */ if (cmod != USER_MODULE && /* we have tried this before */
(pe = RepPredProp( (pe = RepPredProp(
Yap_GetPredPropByFunc(FunctorGoalExpansion2, USER_MODULE))) && Yap_GetPredPropByFunc(FunctorGoalExpansion2, USER_MODULE))) &&
pe->OpcodeOfPred != FAIL_OPCODE && pe->OpcodeOfPred != UNDEF_OPCODE && pe->OpcodeOfPred != FAIL_OPCODE && pe->OpcodeOfPred != UNDEF_OPCODE &&
Yap_execute_pred(pe, NULL PASS_REGS, false)) { Yap_execute_pred(pe, NULL PASS_REGS, false)) {
return complete_ge(true, omod, sl, creeping); return complete_ge(true, omod, sl, creeping);
@ -1164,7 +1096,7 @@ static Int do_term_expansion(USES_REGS1) {
ARG1 = g; ARG1 = g;
if ((pe = RepPredProp( if ((pe = RepPredProp(
Yap_GetPredPropByFunc(FunctorTermExpansion, USER_MODULE))) && Yap_GetPredPropByFunc(FunctorTermExpansion, USER_MODULE))) &&
pe->OpcodeOfPred != FAIL_OPCODE && pe->OpcodeOfPred != UNDEF_OPCODE && pe->OpcodeOfPred != FAIL_OPCODE && pe->OpcodeOfPred != UNDEF_OPCODE &&
Yap_execute_pred(pe, NULL, false PASS_REGS)) { Yap_execute_pred(pe, NULL, false PASS_REGS)) {
return complete_ge(true, omod, sl, creeping); return complete_ge(true, omod, sl, creeping);
@ -1183,7 +1115,7 @@ static Int do_term_expansion(USES_REGS1) {
ARG1 = Yap_MkApplTerm(FunctorModule, 2, mg_args); ARG1 = Yap_MkApplTerm(FunctorModule, 2, mg_args);
ARG2 = Yap_GetFromSlot(h2); ARG2 = Yap_GetFromSlot(h2);
if ((pe = RepPredProp( if ((pe = RepPredProp(
Yap_GetPredPropByFunc(FunctorTermExpansion, SYSTEM_MODULE))) && Yap_GetPredPropByFunc(FunctorTermExpansion, SYSTEM_MODULE))) &&
pe->OpcodeOfPred != FAIL_OPCODE && pe->OpcodeOfPred != UNDEF_OPCODE && pe->OpcodeOfPred != FAIL_OPCODE && pe->OpcodeOfPred != UNDEF_OPCODE &&
Yap_execute_pred(pe, NULL, false PASS_REGS)) { Yap_execute_pred(pe, NULL, false PASS_REGS)) {
return complete_ge(true, omod, sl, creeping); return complete_ge(true, omod, sl, creeping);
@ -1201,7 +1133,7 @@ static Int execute0(USES_REGS1) { /* '$execute0'(Goal,Mod) */
return EnterCreepMode(t, mod PASS_REGS); return EnterCreepMode(t, mod PASS_REGS);
} }
t = Yap_YapStripModule(t, &mod); t = Yap_YapStripModule(t, &mod);
restart_exec: restart_exec:
if (IsVarTerm(t)) { if (IsVarTerm(t)) {
Yap_Error(INSTANTIATION_ERROR, ARG3, "call/1"); Yap_Error(INSTANTIATION_ERROR, ARG3, "call/1");
return false; return false;
@ -1451,7 +1383,7 @@ static bool exec_absmi(bool top, yap_reset_t reset_mode USES_REGS) {
/* reset the registers so that we don't have trash in abstract /* reset the registers so that we don't have trash in abstract
* machine */ * machine */
Yap_set_fpu_exceptions( Yap_set_fpu_exceptions(
getAtomicGlobalPrologFlag(ARITHMETIC_EXCEPTIONS_FLAG)); getAtomicGlobalPrologFlag(ARITHMETIC_EXCEPTIONS_FLAG));
P = (yamop *)FAILCODE; P = (yamop *)FAILCODE;
LOCAL_PrologMode = UserMode; LOCAL_PrologMode = UserMode;
} break; } break;
@ -1465,28 +1397,28 @@ static bool exec_absmi(bool top, yap_reset_t reset_mode USES_REGS) {
/* can be called from anywhere, must reset registers, /* can be called from anywhere, must reset registers,
*/ */
while (B) { while (B) {
Yap_JumpToEnv(TermDAbort); Yap_JumpToEnv(TermDAbort);
} }
LOCAL_PrologMode &= ~AbortMode; LOCAL_PrologMode &= ~AbortMode;
P = (yamop *)FAILCODE; P = (yamop *)FAILCODE;
if (LOCAL_CBorder) if (LOCAL_CBorder)
LOCAL_CBorder = OldBorder; LOCAL_CBorder = OldBorder;
LOCAL_RestartEnv = sighold; LOCAL_RestartEnv = sighold;
return false; return false;
break; break;
case 5: case 5:
// going up, unless there is no up to go to. or someone // going up, unless there is no up to go to. or someone
// but we should inform the caller on what happened. // but we should inform the caller on what happened.
if (B && B->cp_b && B->cp_b <= (choiceptr)(LCL0-LOCAL_CBorder)) { if (B && B->cp_b && B->cp_b <= (choiceptr)(LCL0 - LOCAL_CBorder)) {
break; break;
} }
LOCAL_RestartEnv = sighold; LOCAL_RestartEnv = sighold;
LOCAL_PrologMode = UserMode; LOCAL_PrologMode = UserMode;
LOCAL_CBorder = OldBorder; LOCAL_CBorder = OldBorder;
return false; return false;
default: default:
/* do nothing */ /* do nothing */
LOCAL_PrologMode = UserMode; LOCAL_PrologMode = UserMode;
} }
} else { } else {
LOCAL_PrologMode = UserMode; LOCAL_PrologMode = UserMode;
@ -1570,7 +1502,7 @@ static bool do_goal(yamop *CodeAdr, int arity, CELL *pt, bool top USES_REGS) {
bool Yap_exec_absmi(bool top, yap_reset_t has_reset) { bool Yap_exec_absmi(bool top, yap_reset_t has_reset) {
CACHE_REGS CACHE_REGS
return exec_absmi(top, has_reset PASS_REGS); return exec_absmi(top, has_reset PASS_REGS);
} }
/** /**
@ -1599,7 +1531,7 @@ void Yap_fail_all(choiceptr bb USES_REGS) {
DEPTH = B->cp_depth; DEPTH = B->cp_depth;
#endif /* DEPTH_LIMIT */ #endif /* DEPTH_LIMIT */
YENV = ENV = B->cp_env; YENV = ENV = B->cp_env;
/* recover local stack */ /* recover local stack */
#ifdef DEPTH_LIMIT #ifdef DEPTH_LIMIT
DEPTH = ENV[E_DEPTH]; DEPTH = ENV[E_DEPTH];
#endif #endif
@ -1711,7 +1643,7 @@ bool Yap_execute_pred(PredEntry *ppe, CELL *pt, bool pass_ex USES_REGS) {
bool Yap_execute_goal(Term t, int nargs, Term mod, bool pass_ex) { bool Yap_execute_goal(Term t, int nargs, Term mod, bool pass_ex) {
CACHE_REGS CACHE_REGS
Prop pe; Prop pe;
PredEntry *ppe; PredEntry *ppe;
CELL *pt; CELL *pt;
/* preserve the current restart environment */ /* preserve the current restart environment */
@ -1748,7 +1680,7 @@ bool Yap_execute_goal(Term t, int nargs, Term mod, bool pass_ex) {
void Yap_trust_last(void) { void Yap_trust_last(void) {
CACHE_REGS CACHE_REGS
ASP = B->cp_env; ASP = B->cp_env;
CP = B->cp_cp; CP = B->cp_cp;
HR = B->cp_h; HR = B->cp_h;
#ifdef DEPTH_LIMIT #ifdef DEPTH_LIMIT
@ -1766,7 +1698,7 @@ void Yap_trust_last(void) {
Term Yap_RunTopGoal(Term t, bool handle_errors) { Term Yap_RunTopGoal(Term t, bool handle_errors) {
CACHE_REGS CACHE_REGS
yamop *CodeAdr; yamop *CodeAdr;
Prop pe; Prop pe;
PredEntry *ppe; PredEntry *ppe;
CELL *pt; CELL *pt;
@ -1812,7 +1744,7 @@ Term Yap_RunTopGoal(Term t, bool handle_errors) {
HR[1] = MkAtomTerm(Yap_LookupAtom("top")); HR[1] = MkAtomTerm(Yap_LookupAtom("top"));
arity = 2; arity = 2;
HR += 2; HR += 2;
} else if (ppe->PredFlags & (MetaPredFlag|UndefPredFlag)) { } else if (ppe->PredFlags & (MetaPredFlag | UndefPredFlag)) {
// we're in a meta-call, rake care about modules // we're in a meta-call, rake care about modules
// //
Term ts[2]; Term ts[2];
@ -1989,7 +1921,7 @@ static Int cut_up_to_next_disjunction(USES_REGS1) {
bool Yap_Reset(yap_reset_t mode) { bool Yap_Reset(yap_reset_t mode) {
CACHE_REGS CACHE_REGS
int res = TRUE; int res = TRUE;
Yap_ResetException(worker_id); Yap_ResetException(worker_id);
/* first, backtrack to the root */ /* first, backtrack to the root */
@ -2038,11 +1970,8 @@ static Int JumpToEnv() {
/* find the first choicepoint that may be a catch */ /* find the first choicepoint that may be a catch */
// DBTerm *dbt = Yap_RefToException(); // DBTerm *dbt = Yap_RefToException();
while (handler && Yap_PredForChoicePt(handler, NULL) != PredDollarCatch) { while (handler && Yap_PredForChoicePt(handler, NULL) != PredDollarCatch) {
//printf("--handler=%p, max=%p\n", handler, LCL0-LOCAL_CBorder); // printf("--handler=%p, max=%p\n", handler, LCL0-LOCAL_CBorder);
while (POP_CHOICE_POINT(handler)) { if (handler == (choiceptr)(LCL0 - LOCAL_CBorder)) {
POP_FAIL_EXECUTE(handler);
}
if (handler == (choiceptr)(LCL0-LOCAL_CBorder)) {
break; break;
} }
/* we are already doing a catch */ /* we are already doing a catch */
@ -2058,6 +1987,7 @@ static Int JumpToEnv() {
} }
POP_FAIL(handler); POP_FAIL(handler);
B = handler; B = handler;
// Yap_CopyException(ref); // Yap_CopyException(ref);
if (Yap_PredForChoicePt(B, NULL) == PredDollarCatch) { if (Yap_PredForChoicePt(B, NULL) == PredDollarCatch) {
/* can recover Heap thanks to copy term :-( */ /* can recover Heap thanks to copy term :-( */
@ -2077,10 +2007,9 @@ static Int JumpToEnv() {
} else if (IsVarTerm(t)) { } else if (IsVarTerm(t)) {
t = Yap_MkApplTerm(FunctorGVar, 1, &t); t = Yap_MkApplTerm(FunctorGVar, 1, &t);
} }
B->cp_h = HR;
HB = HR;
Yap_unify(t, B->cp_a2); Yap_unify(t, B->cp_a2);
B->cp_tr = TR; B->cp_h = HR;
TR--;
} }
P = FAILCODE; P = FAILCODE;
return true; return true;
@ -2088,7 +2017,7 @@ static Int JumpToEnv() {
bool Yap_JumpToEnv(Term t) { bool Yap_JumpToEnv(Term t) {
CACHE_REGS CACHE_REGS
LOCAL_BallTerm = Yap_StoreTermInDB(t, 0); LOCAL_BallTerm = Yap_StoreTermInDB(t, 0);
if (!LOCAL_BallTerm) if (!LOCAL_BallTerm)
return false; return false;
if (LOCAL_PrologMode & TopGoalMode) if (LOCAL_PrologMode & TopGoalMode)
@ -2138,27 +2067,27 @@ static Int generate_pred_info(USES_REGS1) {
void Yap_InitYaamRegs(int myworker_id) { void Yap_InitYaamRegs(int myworker_id) {
Term h0var; Term h0var;
// getchar(); // getchar();
#if PUSH_REGS #if PUSH_REGS
/* Guarantee that after a longjmp we go back to the original abstract /* Guarantee that after a longjmp we go back to the original abstract
machine registers */ machine registers */
#ifdef THREADS #ifdef THREADS
if (myworker_id) { if (myworker_id) {
REGSTORE *rs = REMOTE_ThreadHandle(myworker_id).default_yaam_regs; REGSTORE *rs = REMOTE_ThreadHandle(myworker_id).default_yaam_regs;
pthread_setspecific(Yap_yaamregs_key, (const void *)rs); pthread_setspecific(Yap_yaamregs_key, (const void *)rs);
REMOTE_ThreadHandle(myworker_id).current_yaam_regs = rs; REMOTE_ThreadHandle(myworker_id).current_yaam_regs = rs;
} }
/* may be run by worker_id on behalf on myworker_id */ /* may be run by worker_id on behalf on myworker_id */
#else #else
Yap_regp = &Yap_standard_regs; Yap_regp = &Yap_standard_regs;
#endif #endif
#endif /* PUSH_REGS */ #endif /* PUSH_REGS */
CACHE_REGS CACHE_REGS
Yap_ResetException(worker_id); Yap_ResetException(worker_id);
Yap_PutValue(AtomBreak, MkIntTerm(0)); Yap_PutValue(AtomBreak, MkIntTerm(0));
TR = (tr_fr_ptr)REMOTE_TrailBase(myworker_id); TR = (tr_fr_ptr)REMOTE_TrailBase(myworker_id);
HR = H0 = ((CELL *)REMOTE_GlobalBase(myworker_id)) + HR = H0 = ((CELL *)REMOTE_GlobalBase(myworker_id)) +
1; // +1: hack to ensure the gc does not try to mark mistakenly 1; // +1: hack to ensure the gc does not try to mark mistakenly
LCL0 = ASP = (CELL *)REMOTE_LocalBase(myworker_id); LCL0 = ASP = (CELL *)REMOTE_LocalBase(myworker_id);
CurrentTrailTop = (tr_fr_ptr)(REMOTE_TrailTop(myworker_id) - MinTrailGap); CurrentTrailTop = (tr_fr_ptr)(REMOTE_TrailTop(myworker_id) - MinTrailGap);
/* notice that an initial choice-point and environment /* notice that an initial choice-point and environment
@ -2182,12 +2111,12 @@ void Yap_InitYaamRegs(int myworker_id) {
#ifdef YAPOR_SBA #ifdef YAPOR_SBA
BSEG = BSEG =
#endif /* YAPOR_SBA */ #endif /* YAPOR_SBA */
BBREG = B_FZ = (choiceptr)REMOTE_LocalBase(myworker_id); BBREG = B_FZ = (choiceptr)REMOTE_LocalBase(myworker_id);
TR = TR_FZ = (tr_fr_ptr)REMOTE_TrailBase(myworker_id); TR = TR_FZ = (tr_fr_ptr)REMOTE_TrailBase(myworker_id);
#endif /* FROZEN_STACKS */ #endif /* FROZEN_STACKS */
CalculateStackGap(PASS_REGS1); CalculateStackGap(PASS_REGS1);
/* the first real choice-point will also have AP=FAIL */ /* the first real choice-point will also have AP=FAIL */
/* always have an empty slots for people to use */ /* always have an empty slots for people to use */
#if defined(YAPOR) || defined(THREADS) #if defined(YAPOR) || defined(THREADS)
LOCAL = REMOTE(myworker_id); LOCAL = REMOTE(myworker_id);
worker_id = myworker_id; worker_id = myworker_id;
@ -2202,7 +2131,7 @@ void Yap_InitYaamRegs(int myworker_id) {
REMOTE_GcGeneration(myworker_id) = Yap_NewTimedVar(h0var); REMOTE_GcGeneration(myworker_id) = Yap_NewTimedVar(h0var);
REMOTE_GcCurrentPhase(myworker_id) = 0L; REMOTE_GcCurrentPhase(myworker_id) = 0L;
REMOTE_GcPhase(myworker_id) = REMOTE_GcPhase(myworker_id) =
Yap_NewTimedVar(MkIntTerm(REMOTE_GcCurrentPhase(myworker_id))); Yap_NewTimedVar(MkIntTerm(REMOTE_GcCurrentPhase(myworker_id)));
#if defined(YAPOR) || defined(THREADS) #if defined(YAPOR) || defined(THREADS)
PP = NULL; PP = NULL;
PREG_ADDR = NULL; PREG_ADDR = NULL;
@ -2215,7 +2144,7 @@ void Yap_InitYaamRegs(int myworker_id) {
#ifdef YAPOR_SBA #ifdef YAPOR_SBA
BSEG = BSEG =
#endif /* YAPOR_SBA */ #endif /* YAPOR_SBA */
BBREG = B_FZ = (choiceptr)REMOTE_LocalBase(myworker_id); BBREG = B_FZ = (choiceptr)REMOTE_LocalBase(myworker_id);
TR = TR_FZ = (tr_fr_ptr)REMOTE_TrailBase(myworker_id); TR = TR_FZ = (tr_fr_ptr)REMOTE_TrailBase(myworker_id);
#endif /* FROZEN_STACKS */ #endif /* FROZEN_STACKS */
CalculateStackGap(PASS_REGS1); CalculateStackGap(PASS_REGS1);
@ -2228,7 +2157,7 @@ void Yap_InitYaamRegs(int myworker_id) {
Term Yap_GetException(void) { Term Yap_GetException(void) {
CACHE_REGS CACHE_REGS
Term t = 0; Term t = 0;
if (LOCAL_BallTerm) { if (LOCAL_BallTerm) {
t = Yap_PopTermFromDB(LOCAL_BallTerm); t = Yap_PopTermFromDB(LOCAL_BallTerm);
@ -2247,8 +2176,8 @@ bool Yap_RaiseException(void) {
bool Yap_PutException(Term t) { bool Yap_PutException(Term t) {
CACHE_REGS CACHE_REGS
if ((LOCAL_BallTerm = Yap_StoreTermInDB(t, 0)) != NULL) if ((LOCAL_BallTerm = Yap_StoreTermInDB(t, 0)) != NULL)
return true; return true;
return false; return false;
} }
@ -2296,7 +2225,13 @@ int Yap_dogc(int extra_args, Term *tp USES_REGS) {
void Yap_InitExecFs(void) { void Yap_InitExecFs(void) {
CACHE_REGS CACHE_REGS
Term cm = CurrentModule; YAP_opaque_handler_t catcher_ops;
memset(&catcher_ops, 0, sizeof(catcher_ops));
catcher_ops.cut_handler = watch_cut;
catcher_ops.fail_handler = watch_retry;
setup_call_catcher_cleanup_tag = YAP_NewOpaqueType(&catcher_ops);
Term cm = CurrentModule;
Yap_InitComma(); Yap_InitComma();
Yap_InitCPred("$execute", 1, execute, 0); Yap_InitCPred("$execute", 1, execute, 0);
Yap_InitCPred("$execute", 2, execute2, 0); Yap_InitCPred("$execute", 2, execute2, 0);
@ -2350,7 +2285,8 @@ void Yap_InitExecFs(void) {
Yap_InitCPred("_user_expand_goal", 2, _user_expand_goal, 0); Yap_InitCPred("_user_expand_goal", 2, _user_expand_goal, 0);
Yap_InitCPred("$do_term_expansion", 2, do_term_expansion, 0); Yap_InitCPred("$do_term_expansion", 2, do_term_expansion, 0);
Yap_InitCPred("$get_exception", 1, get_exception, 0); Yap_InitCPred("$get_exception", 1, get_exception, 0);
Yap_InitCPred("setup_call_catcher_cleanup", 4, setup_call_catcher_cleanup, 0); Yap_InitCPred("$setup_call_catcher_cleanup", 1, setup_call_catcher_cleanup,
Yap_InitCPredBackCut("$protect_stack", 4, 0, protect_stack, 0);
protect_stack_from_retry, protect_stack_from_cut, 0); Yap_InitCPred("$cleanup_on_exit", 2, cleanup_on_exit, 0);
Yap_InitCPred("$tag_cleanup", 2, tag_cleanup, 0);
} }

View File

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

View File

@ -586,8 +586,8 @@ AdjustGlobal(Int sz, bool thread_copying USES_REGS)
(sizeof(MP_INT)+ (sizeof(MP_INT)+
(((MP_INT *)(pt+2))->_mp_alloc*sizeof(mp_limb_t)))/CellSize; (((MP_INT *)(pt+2))->_mp_alloc*sizeof(mp_limb_t)))/CellSize;
//printf("sz *%ld* at @%ld@\n", sz, pt-H0); //printf("sz *%ld* at @%ld@\n", sz, pt-H0);
Opaque_CallOnGCMark f; YAP_Opaque_CallOnGCMark f;
Opaque_CallOnGCRelocate f2; YAP_Opaque_CallOnGCRelocate f2;
Term t = AbsAppl(pt); Term t = AbsAppl(pt);
if ( (f = Yap_blob_gc_mark_handler(t)) ) { if ( (f = Yap_blob_gc_mark_handler(t)) ) {

File diff suppressed because it is too large Load Diff

View File

@ -1155,8 +1155,9 @@ bool Yap_find_prolog_culprit(USES_REGS1) {
while (curCP != YESCODE) { while (curCP != YESCODE) {
curENV = (CELL *)(curENV[E_E]); curENV = (CELL *)(curENV[E_E]);
if (curENV < ASP || curENV >= LCL0) if (curENV < ASP || curENV >= LCL0) {
break; break;
}
pe = EnvPreg(curCP); pe = EnvPreg(curCP);
if (pe==NULL) { if (pe==NULL) {
pe = PredMetaCall; pe = PredMetaCall;

View File

@ -271,7 +271,7 @@ static void writebig(Term t, int p, int depth, int rinfixarg,
return; return;
#endif #endif
} else if (big_tag >= USER_BLOB_START && big_tag < USER_BLOB_END) { } else if (big_tag >= USER_BLOB_START && big_tag < USER_BLOB_END) {
Opaque_CallOnWrite f; YAP_Opaque_CallOnWrite f;
CELL blob_info; CELL blob_info;
blob_info = big_tag - USER_BLOB_START; blob_info = big_tag - USER_BLOB_START;

View File

@ -20,7 +20,7 @@ A AltNot N "not"
A Answer N "answer" A Answer N "answer"
A Any N "any" A Any N "any"
A Append N "append" A Append N "append"
A Arg N "arg" A Arg N "arg"
A Array F "$array" A Array F "$array"
A ArrayAccess F "$array_arg" A ArrayAccess F "$array_arg"
A ArrayOverflow N "array_overflow" A ArrayOverflow N "array_overflow"
@ -134,6 +134,7 @@ A Eq N "="
A Error N "error" A Error N "error"
A Exception N "exception" A Exception N "exception"
A Extensions N "extensions" A Extensions N "extensions"
A ExternalException N "external_exception"
A Evaluable N "evaluable" A Evaluable N "evaluable"
A EvaluationError N "evaluation_error" A EvaluationError N "evaluation_error"
A Executable N "executable" A Executable N "executable"
@ -510,6 +511,7 @@ F ExecuteInMod ExecuteInMod 2
F ExecuteWithin ExecuteWithin 1 F ExecuteWithin ExecuteWithin 1
F ExistenceError ExistenceError 2 F ExistenceError ExistenceError 2
F ExoClause ExoClause 2 F ExoClause ExoClause 2
F ExternalException ExternalException 1
F Functor Functor 3 F Functor Functor 3
F GAtom Atom 1 F GAtom Atom 1
F GAtomic Atomic 1 F GAtomic Atomic 1

View File

@ -116,7 +116,7 @@ char Executable[YAP_FILENAME_MAX] void
#endif #endif
int OpaqueHandlersCount =0 int OpaqueHandlersCount =0
struct opaque_handler_struct* OpaqueHandlers =NULL struct YAP_opaque_handler_struct* OpaqueHandlers =NULL
#if __simplescalar__ #if __simplescalar__
char pwd[YAP_FILENAME_MAX] void char pwd[YAP_FILENAME_MAX] void

View File

@ -307,6 +307,9 @@ int NUM_OF_ATTS =1 void
UInt Yap_AttsSize void void UInt Yap_AttsSize void void
#endif #endif
/** opaque terms used to wake up on cut of call catcher meta-goal */
UInt setup_call_catcher_cleanup_tag void void
/* Operators */ /* Operators */
struct operator_entry *OpList =NULL OpListAdjust struct operator_entry *OpList =NULL OpListAdjust

View File

@ -96,6 +96,7 @@ typedef enum {
ARRAY_FLOAT = 0x22, ARRAY_FLOAT = 0x22,
CLAUSE_LIST = 0x40, CLAUSE_LIST = 0x40,
EXTERNAL_BLOB = 0x100, /* generic data */ EXTERNAL_BLOB = 0x100, /* generic data */
GOAL_CUT_POINT = 0x200,
USER_BLOB_START = 0x1000, /* user defined blob */ USER_BLOB_START = 0x1000, /* user defined blob */
USER_BLOB_END = 0x1100 /* end of user defined blob */ USER_BLOB_END = 0x1100 /* end of user defined blob */
} big_blob_type; } big_blob_type;

View File

@ -31,24 +31,6 @@ typedef int (*SWI_FlushFunction)(void *);
typedef int (*SWI_PLGetStreamFunction)(void *); typedef int (*SWI_PLGetStreamFunction)(void *);
typedef int (*SWI_PLGetStreamPositionFunction)(void *); typedef int (*SWI_PLGetStreamPositionFunction)(void *);
typedef int (*Opaque_CallOnFail)(void *);
typedef int (*Opaque_CallOnWrite)(FILE *, int, void *, int);
typedef Int (*Opaque_CallOnGCMark)(int, void *, Term *, Int);
typedef int (*Opaque_CallOnGCRelocate)(int, void *, Term *, Int);
typedef struct opaque_handler_struct {
Opaque_CallOnFail fail_handler;
Opaque_CallOnWrite write_handler;
Opaque_CallOnGCMark gc_mark_handler;
Opaque_CallOnGCRelocate gc_relocate_handler;
} opaque_handler_t;
extern Opaque_CallOnWrite Yap_blob_write_handler_from_slot(Int slot);
extern Opaque_CallOnGCMark Yap_blob_gc_mark_handler(Term t);
extern Opaque_CallOnGCRelocate Yap_blob_gc_relocate_handler(Term t);
extern Int Yap_blob_tag_from_slot(Int slot);
extern void *Yap_blob_info_from_slot(Int slot);
#ifndef INT_KEYS_DEFAULT_SIZE #ifndef INT_KEYS_DEFAULT_SIZE
#define INT_KEYS_DEFAULT_SIZE 256 #define INT_KEYS_DEFAULT_SIZE 256
#endif #endif

View File

@ -107,10 +107,11 @@ extern int Yap_IsStringTerm(Term);
extern int Yap_IsWideStringTerm(Term); extern int Yap_IsWideStringTerm(Term);
extern Term Yap_RatTermToApplTerm(Term); extern Term Yap_RatTermToApplTerm(Term);
extern void Yap_InitBigNums(void); extern void Yap_InitBigNums(void);
extern Term Yap_AllocExternalDataInStack(CELL, size_t); extern Term Yap_AllocExternalDataInStack(CELL, size_t, CELL **);
extern int Yap_CleanOpaqueVariable(CELL *); extern int Yap_CleanOpaqueVariable(Term t);
extern CELL *Yap_HeapStoreOpaqueTerm(Term t); extern CELL *Yap_HeapStoreOpaqueTerm(Term t);
extern size_t Yap_OpaqueTermToString(Term t, char *str, size_t max); extern size_t Yap_OpaqueTermToString(Term t, char *str, size_t max);
extern Int Yap_blob_tag(Term t);
/* c_interface.c */ /* c_interface.c */
#ifndef YAP_CPP_INTERFACE #ifndef YAP_CPP_INTERFACE
@ -500,6 +501,9 @@ extern void Yap_init_optyap_preds(void);
// struct PL_local_data *Yap_InitThreadIO(int wid); // struct PL_local_data *Yap_InitThreadIO(int wid);
extern void Yap_flush(void); extern void Yap_flush(void);
extern X_API YAP_opaque_tag_t
YAP_NewOpaqueType(struct YAP_opaque_handler_struct *f);
/* pl-yap.c */ /* pl-yap.c */
extern Int Yap_source_line_no(void); extern Int Yap_source_line_no(void);
extern Atom Yap_source_file_name(void); extern Atom Yap_source_file_name(void);

View File

@ -21,48 +21,13 @@ struct cut_c_str {
#define CBACK_CUT_ARG(Offset) B->cp_args[(Offset)-1] #define CBACK_CUT_ARG(Offset) B->cp_args[(Offset)-1]
#define CUT_C_PUSH(YAMOP, S_YREG) \ #define CUT_C_PUSH(YAMOP, S_YREG)
{ \
if ((YAMOP)->y_u.OtapFs.f) { \
S_YREG = S_YREG - CUT_C_STR_SIZE; \
cut_c_str_ptr new_top = (cut_c_str_ptr)S_YREG; \
new_top->try_userc_cut_yamop = YAMOP; \
cut_c_push(new_top); \
} \
}
#define POP_CHOICE_POINT(cp) \ #define POP_CHOICE_POINT(cp) false
(((CELL *)Yap_REGS.CUT_C_TOP != (CELL *)LOCAL_LocalBase) && \ #define POP_EXECUTE()
((CELL *)(cp) > (CELL *)Yap_REGS.CUT_C_TOP))
#define POP_EXECUTE() \ #define POP_FAIL(handler)
cut_c_str_ptr TOP = Yap_REGS.CUT_C_TOP; \ #define POP_FAIL_EXECUTE(handler)
CPredicate func = \
(CPredicate)((yamop *)TOP->try_userc_cut_yamop)->y_u.OtapFs.f; \
PredEntry *pred = \
(PredEntry *)((yamop *)TOP->try_userc_cut_yamop)->y_u.OtapFs.p; \
YAP_ExecuteOnCut(pred, func, TOP); \
cut_c_pop();
#define POP_FAIL(handler) \
if (handler) { yamop *oap = handler->cp_ap; \
handler->cp_ap = NOCODE; \
P = (yamop *)FAILCODE; \
choiceptr olB = B; B = handler; \
HR = handler->cp_h; \
/* DBTerm *ref = Yap_RefToException(); */ \
Yap_exec_absmi(true, false); \
B = olB; handler->cp_ap = oap; }
#define POP_FAIL_EXECUTE(handler) \
POP_FAIL(handler); \
cut_c_str_ptr TOP = Yap_REGS.CUT_C_TOP; \
CPredicate func = \
(CPredicate)((yamop *)TOP->try_userc_cut_yamop)->y_u.OtapFs.f; \
PredEntry *pred = \
(PredEntry *)((yamop *)TOP->try_userc_cut_yamop)->y_u.OtapFs.p; \
YAP_ExecuteOnCut(pred, func, TOP); \
cut_c_pop();
/*Initializes CUT_C_TOP*/ /*Initializes CUT_C_TOP*/
void cut_c_initialize(int wid); void cut_c_initialize(int wid);

View File

@ -1,144 +1,144 @@
/* This file, dglobals.h, was generated automatically by "yap -L misc/buildlocalglobal" /* This file, dglobals.h, was generated automatically by "yap -L misc/buildlocalglobal"
please do not update, update H/GLOBALS instead */ please do not update, update H/GLOBALS instead */
#define GLOBAL_Initialised Yap_global->Initialised_ #define GLOBAL_Initialised Yap_global->Initialised_
#define GLOBAL_InitialisedFromPL Yap_global->InitialisedFromPL_ #define GLOBAL_InitialisedFromPL Yap_global->InitialisedFromPL_
#define GLOBAL_PL_Argc Yap_global->PL_Argc_ #define GLOBAL_PL_Argc Yap_global->PL_Argc_
#define GLOBAL_PL_Argv Yap_global->PL_Argv_ #define GLOBAL_PL_Argv Yap_global->PL_Argv_
#define GLOBAL_FAST_BOOT_FLAG Yap_global->FAST_BOOT_FLAG_ #define GLOBAL_FAST_BOOT_FLAG Yap_global->FAST_BOOT_FLAG_
#define GLOBAL_HaltHooks Yap_global->HaltHooks_ #define GLOBAL_HaltHooks Yap_global->HaltHooks_
#define GLOBAL_JIT_finalizer Yap_global->JIT_finalizer_ #define GLOBAL_JIT_finalizer Yap_global->JIT_finalizer_
#define GLOBAL_AllowLocalExpansion Yap_global->AllowLocalExpansion_ #define GLOBAL_AllowLocalExpansion Yap_global->AllowLocalExpansion_
#define GLOBAL_AllowGlobalExpansion Yap_global->AllowGlobalExpansion_ #define GLOBAL_AllowGlobalExpansion Yap_global->AllowGlobalExpansion_
#define GLOBAL_AllowTrailExpansion Yap_global->AllowTrailExpansion_ #define GLOBAL_AllowTrailExpansion Yap_global->AllowTrailExpansion_
#define GLOBAL_SizeOfOverflow Yap_global->SizeOfOverflow_ #define GLOBAL_SizeOfOverflow Yap_global->SizeOfOverflow_
#define GLOBAL_AGcThreshold Yap_global->AGcThreshold_ #define GLOBAL_AGcThreshold Yap_global->AGcThreshold_
#define GLOBAL_AGCHook Yap_global->AGCHook_ #define GLOBAL_AGCHook Yap_global->AGCHook_
#if THREADS #if THREADS
#define GLOBAL_NOfThreads Yap_global->NOfThreads_ #define GLOBAL_NOfThreads Yap_global->NOfThreads_
#define GLOBAL_NOfThreadsCreated Yap_global->NOfThreadsCreated_ #define GLOBAL_NOfThreadsCreated Yap_global->NOfThreadsCreated_
#define GLOBAL_ThreadsTotalTime Yap_global->ThreadsTotalTime_ #define GLOBAL_ThreadsTotalTime Yap_global->ThreadsTotalTime_
#define GLOBAL_ThreadHandlesLock Yap_global->ThreadHandlesLock_ #define GLOBAL_ThreadHandlesLock Yap_global->ThreadHandlesLock_
#endif #endif
#if defined(YAPOR) || defined(THREADS) #if defined(YAPOR) || defined(THREADS)
#define GLOBAL_BGL Yap_global->BGL_ #define GLOBAL_BGL Yap_global->BGL_
#endif #endif
#if defined(YAPOR) || defined(TABLING) #if defined(YAPOR) || defined(TABLING)
#define GLOBAL_optyap_data Yap_global->optyap_data_ #define GLOBAL_optyap_data Yap_global->optyap_data_
#endif /* YAPOR || TABLING */ #endif /* YAPOR || TABLING */
#define GLOBAL_PrologShouldHandleInterrupts Yap_global->PrologShouldHandleInterrupts_ #define GLOBAL_PrologShouldHandleInterrupts Yap_global->PrologShouldHandleInterrupts_
#if defined(THREADS) #if defined(THREADS)
#define GLOBAL_master_thread Yap_global->master_thread_ #define GLOBAL_master_thread Yap_global->master_thread_
#define GLOBAL_named_mboxes Yap_global->named_mboxes_ #define GLOBAL_named_mboxes Yap_global->named_mboxes_
#define GLOBAL_mboxq_lock Yap_global->mboxq_lock_ #define GLOBAL_mboxq_lock Yap_global->mboxq_lock_
#define GLOBAL_mbox_count Yap_global->mbox_count_ #define GLOBAL_mbox_count Yap_global->mbox_count_
#define GLOBAL_WithMutex Yap_global->WithMutex_ #define GLOBAL_WithMutex Yap_global->WithMutex_
#endif /* THREADS */ #endif /* THREADS */
#define GLOBAL_Stream Yap_global->Stream_ #define GLOBAL_Stream Yap_global->Stream_
#if defined(THREADS)||defined(YAPOR) #if defined(THREADS)||defined(YAPOR)
#define GLOBAL_StreamDescLock Yap_global->StreamDescLock_ #define GLOBAL_StreamDescLock Yap_global->StreamDescLock_
#endif #endif
#define GLOBAL_argv Yap_global->argv_ #define GLOBAL_argv Yap_global->argv_
#define GLOBAL_argc Yap_global->argc_ #define GLOBAL_argc Yap_global->argc_
#ifdef COROUTINING #ifdef COROUTINING
#define GLOBAL_attas Yap_global->attas_ #define GLOBAL_attas Yap_global->attas_
#endif #endif
#define GLOBAL_agc_calls Yap_global->agc_calls_ #define GLOBAL_agc_calls Yap_global->agc_calls_
#define GLOBAL_agc_collected Yap_global->agc_collected_ #define GLOBAL_agc_collected Yap_global->agc_collected_
#define GLOBAL_tot_agc_time Yap_global->tot_agc_time_ #define GLOBAL_tot_agc_time Yap_global->tot_agc_time_
#define GLOBAL_tot_agc_recovered Yap_global->tot_agc_recovered_ #define GLOBAL_tot_agc_recovered Yap_global->tot_agc_recovered_
#if HAVE_MMAP #if HAVE_MMAP
#define GLOBAL_mmap_arrays Yap_global->mmap_arrays_ #define GLOBAL_mmap_arrays Yap_global->mmap_arrays_
#endif #endif
#ifdef DEBUG #ifdef DEBUG
#define GLOBAL_Option Yap_global->Option_ #define GLOBAL_Option Yap_global->Option_
#define GLOBAL_logfile Yap_global->logfile_ #define GLOBAL_logfile Yap_global->logfile_
#endif #endif
#if defined(COFF) || defined(A_OUT) #if defined(COFF) || defined(A_OUT)
#define GLOBAL_Executable Yap_global->Executable_ #define GLOBAL_Executable Yap_global->Executable_
#endif #endif
#define GLOBAL_OpaqueHandlersCount Yap_global->OpaqueHandlersCount_ #define GLOBAL_OpaqueHandlersCount Yap_global->OpaqueHandlersCount_
#define GLOBAL_OpaqueHandlers Yap_global->OpaqueHandlers_ #define GLOBAL_OpaqueHandlers Yap_global->OpaqueHandlers_
#if __simplescalar__ #if __simplescalar__
#define GLOBAL_pwd Yap_global->pwd_ #define GLOBAL_pwd Yap_global->pwd_
#endif #endif
#define GLOBAL_RestoreFile Yap_global->RestoreFile_ #define GLOBAL_RestoreFile Yap_global->RestoreFile_
#define GLOBAL_ProfCalls Yap_global->ProfCalls_ #define GLOBAL_ProfCalls Yap_global->ProfCalls_
#define GLOBAL_ProfGCs Yap_global->ProfGCs_ #define GLOBAL_ProfGCs Yap_global->ProfGCs_
#define GLOBAL_ProfHGrows Yap_global->ProfHGrows_ #define GLOBAL_ProfHGrows Yap_global->ProfHGrows_
#define GLOBAL_ProfSGrows Yap_global->ProfSGrows_ #define GLOBAL_ProfSGrows Yap_global->ProfSGrows_
#define GLOBAL_ProfMallocs Yap_global->ProfMallocs_ #define GLOBAL_ProfMallocs Yap_global->ProfMallocs_
#define GLOBAL_ProfIndexing Yap_global->ProfIndexing_ #define GLOBAL_ProfIndexing Yap_global->ProfIndexing_
#define GLOBAL_ProfOn Yap_global->ProfOn_ #define GLOBAL_ProfOn Yap_global->ProfOn_
#define GLOBAL_ProfOns Yap_global->ProfOns_ #define GLOBAL_ProfOns Yap_global->ProfOns_
#define GLOBAL_ProfilerRoot Yap_global->ProfilerRoot_ #define GLOBAL_ProfilerRoot Yap_global->ProfilerRoot_
#define GLOBAL_ProfilerNil Yap_global->ProfilerNil_ #define GLOBAL_ProfilerNil Yap_global->ProfilerNil_
#define GLOBAL_DIRNAME Yap_global->DIRNAME_ #define GLOBAL_DIRNAME Yap_global->DIRNAME_
#if LOW_PROF #if LOW_PROF
#define GLOBAL_ProfilerOn Yap_global->ProfilerOn_ #define GLOBAL_ProfilerOn Yap_global->ProfilerOn_
#define GLOBAL_FProf Yap_global->FProf_ #define GLOBAL_FProf Yap_global->FProf_
#define GLOBAL_FPreds Yap_global->FPreds_ #define GLOBAL_FPreds Yap_global->FPreds_
#endif /* LOW_PROF */ #endif /* LOW_PROF */
#if THREADS #if THREADS
#define GLOBAL_FreeMutexes Yap_global->FreeMutexes_ #define GLOBAL_FreeMutexes Yap_global->FreeMutexes_
#define GLOBAL_mutex_backbone Yap_global->mutex_backbone_ #define GLOBAL_mutex_backbone Yap_global->mutex_backbone_
#define GLOBAL_MUT_ACCESS Yap_global->MUT_ACCESS_ #define GLOBAL_MUT_ACCESS Yap_global->MUT_ACCESS_
#endif #endif
#define GLOBAL_Home Yap_global->Home_ #define GLOBAL_Home Yap_global->Home_
#define GLOBAL_CharConversionTable Yap_global->CharConversionTable_ #define GLOBAL_CharConversionTable Yap_global->CharConversionTable_
#define GLOBAL_CharConversionTable2 Yap_global->CharConversionTable2_ #define GLOBAL_CharConversionTable2 Yap_global->CharConversionTable2_
#define GLOBAL_MaxPriority Yap_global->MaxPriority_ #define GLOBAL_MaxPriority Yap_global->MaxPriority_
#define GLOBAL_FileAliases Yap_global->FileAliases_ #define GLOBAL_FileAliases Yap_global->FileAliases_
#define GLOBAL_NOfFileAliases Yap_global->NOfFileAliases_ #define GLOBAL_NOfFileAliases Yap_global->NOfFileAliases_
#define GLOBAL_SzOfFileAliases Yap_global->SzOfFileAliases_ #define GLOBAL_SzOfFileAliases Yap_global->SzOfFileAliases_
#define GLOBAL_VFS Yap_global->VFS_ #define GLOBAL_VFS Yap_global->VFS_

View File

@ -1,291 +1,293 @@
/* This file, dhstruct.h, was generated automatically by "yap -L misc/buildlocalglobal" /* This file, dhstruct.h, was generated automatically by "yap -L misc/buildlocalglobal"
please do not update, update H/HEAPFIELDS instead */ please do not update, update H/HEAPFIELDS instead */
#if USE_DL_MALLOC #if USE_DL_MALLOC
#if defined(YAPOR) || defined(THREADS) #if defined(YAPOR) || defined(THREADS)
#define DLMallocLock Yap_heap_regs->DLMallocLock_ #define DLMallocLock Yap_heap_regs->DLMallocLock_
#endif #endif
#endif #endif
#if USE_DL_MALLOC || (USE_SYSTEM_MALLOC && HAVE_MALLINFO) #if USE_DL_MALLOC || (USE_SYSTEM_MALLOC && HAVE_MALLINFO)
#ifndef HeapUsed #ifndef HeapUsed
#define HeapUsed Yap_givemallinfo() #define HeapUsed Yap_givemallinfo()
#endif #endif
#define NotHeapUsed Yap_heap_regs->NotHeapUsed_ #define NotHeapUsed Yap_heap_regs->NotHeapUsed_
#else #else
#define HeapUsed Yap_heap_regs->HeapUsed_ #define HeapUsed Yap_heap_regs->HeapUsed_
#endif #endif
#define HeapMax Yap_heap_regs->HeapMax_ #define HeapMax Yap_heap_regs->HeapMax_
#define HeapTop Yap_heap_regs->HeapTop_ #define HeapTop Yap_heap_regs->HeapTop_
#define HeapLim Yap_heap_regs->HeapLim_ #define HeapLim Yap_heap_regs->HeapLim_
#define FreeBlocks Yap_heap_regs->FreeBlocks_ #define FreeBlocks Yap_heap_regs->FreeBlocks_
#if defined(YAPOR) || defined(THREADS) #if defined(YAPOR) || defined(THREADS)
#define FreeBlocksLock Yap_heap_regs->FreeBlocksLock_ #define FreeBlocksLock Yap_heap_regs->FreeBlocksLock_
#define HeapUsedLock Yap_heap_regs->HeapUsedLock_ #define HeapUsedLock Yap_heap_regs->HeapUsedLock_
#define HeapTopLock Yap_heap_regs->HeapTopLock_ #define HeapTopLock Yap_heap_regs->HeapTopLock_
#define HeapTopOwner Yap_heap_regs->HeapTopOwner_ #define HeapTopOwner Yap_heap_regs->HeapTopOwner_
#endif #endif
#define MaxStack Yap_heap_regs->MaxStack_ #define MaxStack Yap_heap_regs->MaxStack_
#define MaxTrail Yap_heap_regs->MaxTrail_ #define MaxTrail Yap_heap_regs->MaxTrail_
#if USE_THREADED_CODE #if USE_THREADED_CODE
#define OP_RTABLE Yap_heap_regs->OP_RTABLE_ #define OP_RTABLE Yap_heap_regs->OP_RTABLE_
#endif #endif
#define EXECUTE_CPRED_OP_CODE Yap_heap_regs->EXECUTE_CPRED_OP_CODE_ #define EXECUTE_CPRED_OP_CODE Yap_heap_regs->EXECUTE_CPRED_OP_CODE_
#define EXPAND_OP_CODE Yap_heap_regs->EXPAND_OP_CODE_ #define EXPAND_OP_CODE Yap_heap_regs->EXPAND_OP_CODE_
#define FAIL_OPCODE Yap_heap_regs->FAIL_OPCODE_ #define FAIL_OPCODE Yap_heap_regs->FAIL_OPCODE_
#define INDEX_OPCODE Yap_heap_regs->INDEX_OPCODE_ #define INDEX_OPCODE Yap_heap_regs->INDEX_OPCODE_
#define LOCKPRED_OPCODE Yap_heap_regs->LOCKPRED_OPCODE_ #define LOCKPRED_OPCODE Yap_heap_regs->LOCKPRED_OPCODE_
#define ORLAST_OPCODE Yap_heap_regs->ORLAST_OPCODE_ #define ORLAST_OPCODE Yap_heap_regs->ORLAST_OPCODE_
#define UNDEF_OPCODE Yap_heap_regs->UNDEF_OPCODE_ #define UNDEF_OPCODE Yap_heap_regs->UNDEF_OPCODE_
#define RETRY_USERC_OPCODE Yap_heap_regs->RETRY_USERC_OPCODE_ #define RETRY_USERC_OPCODE Yap_heap_regs->RETRY_USERC_OPCODE_
#define EXECUTE_CPRED_OPCODE Yap_heap_regs->EXECUTE_CPRED_OPCODE_ #define EXECUTE_CPRED_OPCODE Yap_heap_regs->EXECUTE_CPRED_OPCODE_
#define NOfAtoms Yap_heap_regs->NOfAtoms_ #define NOfAtoms Yap_heap_regs->NOfAtoms_
#define AtomHashTableSize Yap_heap_regs->AtomHashTableSize_ #define AtomHashTableSize Yap_heap_regs->AtomHashTableSize_
#define WideAtomHashTableSize Yap_heap_regs->WideAtomHashTableSize_ #define WideAtomHashTableSize Yap_heap_regs->WideAtomHashTableSize_
#define NOfWideAtoms Yap_heap_regs->NOfWideAtoms_ #define NOfWideAtoms Yap_heap_regs->NOfWideAtoms_
#define INVISIBLECHAIN Yap_heap_regs->INVISIBLECHAIN_ #define INVISIBLECHAIN Yap_heap_regs->INVISIBLECHAIN_
#define WideHashChain Yap_heap_regs->WideHashChain_ #define WideHashChain Yap_heap_regs->WideHashChain_
#define HashChain Yap_heap_regs->HashChain_ #define HashChain Yap_heap_regs->HashChain_
#ifdef EUROTRA #ifdef EUROTRA
#define TermDollarU Yap_heap_regs->TermDollarU_ #define TermDollarU Yap_heap_regs->TermDollarU_
#endif #endif
#define USER_MODULE Yap_heap_regs->USER_MODULE_ #define USER_MODULE Yap_heap_regs->USER_MODULE_
#define IDB_MODULE Yap_heap_regs->IDB_MODULE_ #define IDB_MODULE Yap_heap_regs->IDB_MODULE_
#define ATTRIBUTES_MODULE Yap_heap_regs->ATTRIBUTES_MODULE_ #define ATTRIBUTES_MODULE Yap_heap_regs->ATTRIBUTES_MODULE_
#define CHARSIO_MODULE Yap_heap_regs->CHARSIO_MODULE_ #define CHARSIO_MODULE Yap_heap_regs->CHARSIO_MODULE_
#define CHTYPE_MODULE Yap_heap_regs->CHTYPE_MODULE_ #define CHTYPE_MODULE Yap_heap_regs->CHTYPE_MODULE_
#define TERMS_MODULE Yap_heap_regs->TERMS_MODULE_ #define TERMS_MODULE Yap_heap_regs->TERMS_MODULE_
#define SYSTEM_MODULE Yap_heap_regs->SYSTEM_MODULE_ #define SYSTEM_MODULE Yap_heap_regs->SYSTEM_MODULE_
#define READUTIL_MODULE Yap_heap_regs->READUTIL_MODULE_ #define READUTIL_MODULE Yap_heap_regs->READUTIL_MODULE_
#define HACKS_MODULE Yap_heap_regs->HACKS_MODULE_ #define HACKS_MODULE Yap_heap_regs->HACKS_MODULE_
#define ARG_MODULE Yap_heap_regs->ARG_MODULE_ #define ARG_MODULE Yap_heap_regs->ARG_MODULE_
#define GLOBALS_MODULE Yap_heap_regs->GLOBALS_MODULE_ #define GLOBALS_MODULE Yap_heap_regs->GLOBALS_MODULE_
#define SWI_MODULE Yap_heap_regs->SWI_MODULE_ #define SWI_MODULE Yap_heap_regs->SWI_MODULE_
#define DBLOAD_MODULE Yap_heap_regs->DBLOAD_MODULE_ #define DBLOAD_MODULE Yap_heap_regs->DBLOAD_MODULE_
#define RANGE_MODULE Yap_heap_regs->RANGE_MODULE_ #define RANGE_MODULE Yap_heap_regs->RANGE_MODULE_
#define ERROR_MODULE Yap_heap_regs->ERROR_MODULE_ #define ERROR_MODULE Yap_heap_regs->ERROR_MODULE_
#define CurrentModules Yap_heap_regs->CurrentModules_ #define CurrentModules Yap_heap_regs->CurrentModules_
#define HIDDEN_PREDICATES Yap_heap_regs->HIDDEN_PREDICATES_ #define HIDDEN_PREDICATES Yap_heap_regs->HIDDEN_PREDICATES_
#define GLOBAL_Flags Yap_heap_regs->GLOBAL_Flags_ #define GLOBAL_Flags Yap_heap_regs->GLOBAL_Flags_
#define GLOBAL_flagCount Yap_heap_regs->GLOBAL_flagCount_ #define GLOBAL_flagCount Yap_heap_regs->GLOBAL_flagCount_
#define Yap_ExecutionMode Yap_heap_regs->Yap_ExecutionMode_ #define Yap_ExecutionMode Yap_heap_regs->Yap_ExecutionMode_
#define PredsInHashTable Yap_heap_regs->PredsInHashTable_ #define PredsInHashTable Yap_heap_regs->PredsInHashTable_
#define PredHashTableSize Yap_heap_regs->PredHashTableSize_ #define PredHashTableSize Yap_heap_regs->PredHashTableSize_
#define PredHash Yap_heap_regs->PredHash_ #define PredHash Yap_heap_regs->PredHash_
#if defined(YAPOR) || defined(THREADS) #if defined(YAPOR) || defined(THREADS)
#define PredHashRWLock Yap_heap_regs->PredHashRWLock_ #define PredHashRWLock Yap_heap_regs->PredHashRWLock_
#endif #endif
#define CreepCode Yap_heap_regs->CreepCode_ #define CreepCode Yap_heap_regs->CreepCode_
#define UndefCode Yap_heap_regs->UndefCode_ #define UndefCode Yap_heap_regs->UndefCode_
#define SpyCode Yap_heap_regs->SpyCode_ #define SpyCode Yap_heap_regs->SpyCode_
#define PredFail Yap_heap_regs->PredFail_ #define PredFail Yap_heap_regs->PredFail_
#define PredTrue Yap_heap_regs->PredTrue_ #define PredTrue Yap_heap_regs->PredTrue_
#ifdef COROUTINING #ifdef COROUTINING
#define WakeUpCode Yap_heap_regs->WakeUpCode_ #define WakeUpCode Yap_heap_regs->WakeUpCode_
#endif #endif
#define PredDollarCatch Yap_heap_regs->PredDollarCatch_ #define PredDollarCatch Yap_heap_regs->PredDollarCatch_
#ifdef YAPOR #ifdef YAPOR
#define PredGetwork Yap_heap_regs->PredGetwork_ #define PredGetwork Yap_heap_regs->PredGetwork_
#endif /* YAPOR */ #endif /* YAPOR */
#define PredGoalExpansion Yap_heap_regs->PredGoalExpansion_ #define PredGoalExpansion Yap_heap_regs->PredGoalExpansion_
#define PredHandleThrow Yap_heap_regs->PredHandleThrow_ #define PredHandleThrow Yap_heap_regs->PredHandleThrow_
#define PredIs Yap_heap_regs->PredIs_ #define PredIs Yap_heap_regs->PredIs_
#define PredLogUpdClause Yap_heap_regs->PredLogUpdClause_ #define PredLogUpdClause Yap_heap_regs->PredLogUpdClause_
#define PredLogUpdClauseErase Yap_heap_regs->PredLogUpdClauseErase_ #define PredLogUpdClauseErase Yap_heap_regs->PredLogUpdClauseErase_
#define PredLogUpdClause0 Yap_heap_regs->PredLogUpdClause0_ #define PredLogUpdClause0 Yap_heap_regs->PredLogUpdClause0_
#define PredMetaCall Yap_heap_regs->PredMetaCall_ #define PredMetaCall Yap_heap_regs->PredMetaCall_
#define PredProtectStack Yap_heap_regs->PredProtectStack_ #define PredProtectStack Yap_heap_regs->PredProtectStack_
#define PredRecordedWithKey Yap_heap_regs->PredRecordedWithKey_ #define PredRecordedWithKey Yap_heap_regs->PredRecordedWithKey_
#define PredRestoreRegs Yap_heap_regs->PredRestoreRegs_ #define PredRestoreRegs Yap_heap_regs->PredRestoreRegs_
#define PredSafeCallCleanup Yap_heap_regs->PredSafeCallCleanup_ #define PredSafeCallCleanup Yap_heap_regs->PredSafeCallCleanup_
#define PredStaticClause Yap_heap_regs->PredStaticClause_ #define PredStaticClause Yap_heap_regs->PredStaticClause_
#define PredThrow Yap_heap_regs->PredThrow_ #define PredThrow Yap_heap_regs->PredThrow_
#define PredTraceMetaCall Yap_heap_regs->PredTraceMetaCall_ #define PredTraceMetaCall Yap_heap_regs->PredTraceMetaCall_
#define PredCommentHook Yap_heap_regs->PredCommentHook_ #define PredCommentHook Yap_heap_regs->PredCommentHook_
#define PredProcedure Yap_heap_regs->PredProcedure_ #define PredProcedure Yap_heap_regs->PredProcedure_
#define PredUndefinedQuery Yap_heap_regs->PredUndefinedQuery_ #define PredUndefinedQuery Yap_heap_regs->PredUndefinedQuery_
#ifdef LOW_LEVEL_TRACER #ifdef LOW_LEVEL_TRACER
#define Yap_do_low_level_trace Yap_heap_regs->Yap_do_low_level_trace_ #define Yap_do_low_level_trace Yap_heap_regs->Yap_do_low_level_trace_
#if defined(YAPOR) || defined(THREADS) #if defined(YAPOR) || defined(THREADS)
#define Yap_low_level_trace_lock Yap_heap_regs->Yap_low_level_trace_lock_ #define Yap_low_level_trace_lock Yap_heap_regs->Yap_low_level_trace_lock_
#endif #endif
#endif #endif
#define Yap_ClauseSpace Yap_heap_regs->Yap_ClauseSpace_ #define Yap_ClauseSpace Yap_heap_regs->Yap_ClauseSpace_
#define Yap_IndexSpace_Tree Yap_heap_regs->Yap_IndexSpace_Tree_ #define Yap_IndexSpace_Tree Yap_heap_regs->Yap_IndexSpace_Tree_
#define Yap_IndexSpace_EXT Yap_heap_regs->Yap_IndexSpace_EXT_ #define Yap_IndexSpace_EXT Yap_heap_regs->Yap_IndexSpace_EXT_
#define Yap_IndexSpace_SW Yap_heap_regs->Yap_IndexSpace_SW_ #define Yap_IndexSpace_SW Yap_heap_regs->Yap_IndexSpace_SW_
#define Yap_LUClauseSpace Yap_heap_regs->Yap_LUClauseSpace_ #define Yap_LUClauseSpace Yap_heap_regs->Yap_LUClauseSpace_
#define Yap_LUIndexSpace_Tree Yap_heap_regs->Yap_LUIndexSpace_Tree_ #define Yap_LUIndexSpace_Tree Yap_heap_regs->Yap_LUIndexSpace_Tree_
#define Yap_LUIndexSpace_CP Yap_heap_regs->Yap_LUIndexSpace_CP_ #define Yap_LUIndexSpace_CP Yap_heap_regs->Yap_LUIndexSpace_CP_
#define Yap_LUIndexSpace_EXT Yap_heap_regs->Yap_LUIndexSpace_EXT_ #define Yap_LUIndexSpace_EXT Yap_heap_regs->Yap_LUIndexSpace_EXT_
#define Yap_LUIndexSpace_SW Yap_heap_regs->Yap_LUIndexSpace_SW_ #define Yap_LUIndexSpace_SW Yap_heap_regs->Yap_LUIndexSpace_SW_
#define COMMA_CODE Yap_heap_regs->COMMA_CODE_ #define COMMA_CODE Yap_heap_regs->COMMA_CODE_
#define DUMMYCODE Yap_heap_regs->DUMMYCODE_ #define DUMMYCODE Yap_heap_regs->DUMMYCODE_
#define FAILCODE Yap_heap_regs->FAILCODE_ #define FAILCODE Yap_heap_regs->FAILCODE_
#define NOCODE Yap_heap_regs->NOCODE_ #define NOCODE Yap_heap_regs->NOCODE_
#define ENV_FOR_TRUSTFAIL Yap_heap_regs->ENV_FOR_TRUSTFAIL_ #define ENV_FOR_TRUSTFAIL Yap_heap_regs->ENV_FOR_TRUSTFAIL_
#define TRUSTFAILCODE Yap_heap_regs->TRUSTFAILCODE_ #define TRUSTFAILCODE Yap_heap_regs->TRUSTFAILCODE_
#define ENV_FOR_YESCODE Yap_heap_regs->ENV_FOR_YESCODE_ #define ENV_FOR_YESCODE Yap_heap_regs->ENV_FOR_YESCODE_
#define YESCODE Yap_heap_regs->YESCODE_ #define YESCODE Yap_heap_regs->YESCODE_
#define RTRYCODE Yap_heap_regs->RTRYCODE_ #define RTRYCODE Yap_heap_regs->RTRYCODE_
#ifdef BEAM #ifdef BEAM
#define BEAM_RETRY_CODE Yap_heap_regs->BEAM_RETRY_CODE_ #define BEAM_RETRY_CODE Yap_heap_regs->BEAM_RETRY_CODE_
#endif /* BEAM */ #endif /* BEAM */
#ifdef YAPOR #ifdef YAPOR
#define GETWORK Yap_heap_regs->GETWORK_ #define GETWORK Yap_heap_regs->GETWORK_
#define GETWORK_SEQ Yap_heap_regs->GETWORK_SEQ_ #define GETWORK_SEQ Yap_heap_regs->GETWORK_SEQ_
#define GETWORK_FIRST_TIME Yap_heap_regs->GETWORK_FIRST_TIME_ #define GETWORK_FIRST_TIME Yap_heap_regs->GETWORK_FIRST_TIME_
#endif /* YAPOR */ #endif /* YAPOR */
#ifdef TABLING #ifdef TABLING
#define LOAD_ANSWER Yap_heap_regs->LOAD_ANSWER_ #define LOAD_ANSWER Yap_heap_regs->LOAD_ANSWER_
#define TRY_ANSWER Yap_heap_regs->TRY_ANSWER_ #define TRY_ANSWER Yap_heap_regs->TRY_ANSWER_
#define ANSWER_RESOLUTION Yap_heap_regs->ANSWER_RESOLUTION_ #define ANSWER_RESOLUTION Yap_heap_regs->ANSWER_RESOLUTION_
#define COMPLETION Yap_heap_regs->COMPLETION_ #define COMPLETION Yap_heap_regs->COMPLETION_
#ifdef THREADS_CONSUMER_SHARING #ifdef THREADS_CONSUMER_SHARING
#define ANSWER_RESOLUTION_COMPLETION Yap_heap_regs->ANSWER_RESOLUTION_COMPLETION_ #define ANSWER_RESOLUTION_COMPLETION Yap_heap_regs->ANSWER_RESOLUTION_COMPLETION_
#endif /* THREADS_CONSUMER_SHARING */ #endif /* THREADS_CONSUMER_SHARING */
#endif /* TABLING */ #endif /* TABLING */
#define P_before_spy Yap_heap_regs->P_before_spy_ #define P_before_spy Yap_heap_regs->P_before_spy_
#define RETRY_C_RECORDEDP_CODE Yap_heap_regs->RETRY_C_RECORDEDP_CODE_ #define RETRY_C_RECORDEDP_CODE Yap_heap_regs->RETRY_C_RECORDEDP_CODE_
#define RETRY_C_RECORDED_K_CODE Yap_heap_regs->RETRY_C_RECORDED_K_CODE_ #define RETRY_C_RECORDED_K_CODE Yap_heap_regs->RETRY_C_RECORDED_K_CODE_
#define PROFILING Yap_heap_regs->PROFILING_ #define PROFILING Yap_heap_regs->PROFILING_
#define CALL_COUNTING Yap_heap_regs->CALL_COUNTING_ #define CALL_COUNTING Yap_heap_regs->CALL_COUNTING_
#define optimizer_on Yap_heap_regs->optimizer_on_ #define optimizer_on Yap_heap_regs->optimizer_on_
#define compile_mode Yap_heap_regs->compile_mode_ #define compile_mode Yap_heap_regs->compile_mode_
#define profiling Yap_heap_regs->profiling_ #define profiling Yap_heap_regs->profiling_
#define call_counting Yap_heap_regs->call_counting_ #define call_counting Yap_heap_regs->call_counting_
#define compile_arrays Yap_heap_regs->compile_arrays_ #define compile_arrays Yap_heap_regs->compile_arrays_
#if defined(YAPOR) || defined(THREADS) #if defined(YAPOR) || defined(THREADS)
#define DBTermsListLock Yap_heap_regs->DBTermsListLock_ #define DBTermsListLock Yap_heap_regs->DBTermsListLock_
#endif #endif
#define DBTermsList Yap_heap_regs->DBTermsList_ #define DBTermsList Yap_heap_regs->DBTermsList_
#define ExpandClausesFirst Yap_heap_regs->ExpandClausesFirst_ #define ExpandClausesFirst Yap_heap_regs->ExpandClausesFirst_
#define ExpandClausesLast Yap_heap_regs->ExpandClausesLast_ #define ExpandClausesLast Yap_heap_regs->ExpandClausesLast_
#define Yap_ExpandClauses Yap_heap_regs->Yap_ExpandClauses_ #define Yap_ExpandClauses Yap_heap_regs->Yap_ExpandClauses_
#if defined(YAPOR) || defined(THREADS) #if defined(YAPOR) || defined(THREADS)
#define ExpandClausesListLock Yap_heap_regs->ExpandClausesListLock_ #define ExpandClausesListLock Yap_heap_regs->ExpandClausesListLock_
#define OpListLock Yap_heap_regs->OpListLock_ #define OpListLock Yap_heap_regs->OpListLock_
#endif #endif
#ifdef DEBUG #ifdef DEBUG
#define Yap_NewCps Yap_heap_regs->Yap_NewCps_ #define Yap_NewCps Yap_heap_regs->Yap_NewCps_
#define Yap_LiveCps Yap_heap_regs->Yap_LiveCps_ #define Yap_LiveCps Yap_heap_regs->Yap_LiveCps_
#define Yap_DirtyCps Yap_heap_regs->Yap_DirtyCps_ #define Yap_DirtyCps Yap_heap_regs->Yap_DirtyCps_
#define Yap_FreedCps Yap_heap_regs->Yap_FreedCps_ #define Yap_FreedCps Yap_heap_regs->Yap_FreedCps_
#endif #endif
#define Yap_expand_clauses_sz Yap_heap_regs->Yap_expand_clauses_sz_ #define Yap_expand_clauses_sz Yap_heap_regs->Yap_expand_clauses_sz_
#define UdiControlBlocks Yap_heap_regs->UdiControlBlocks_ #define UdiControlBlocks Yap_heap_regs->UdiControlBlocks_
#define STATIC_PREDICATES_MARKED Yap_heap_regs->STATIC_PREDICATES_MARKED_ #define STATIC_PREDICATES_MARKED Yap_heap_regs->STATIC_PREDICATES_MARKED_
#define INT_KEYS Yap_heap_regs->INT_KEYS_ #define INT_KEYS Yap_heap_regs->INT_KEYS_
#define INT_LU_KEYS Yap_heap_regs->INT_LU_KEYS_ #define INT_LU_KEYS Yap_heap_regs->INT_LU_KEYS_
#define INT_BB_KEYS Yap_heap_regs->INT_BB_KEYS_ #define INT_BB_KEYS Yap_heap_regs->INT_BB_KEYS_
#define INT_KEYS_SIZE Yap_heap_regs->INT_KEYS_SIZE_ #define INT_KEYS_SIZE Yap_heap_regs->INT_KEYS_SIZE_
#define INT_KEYS_TIMESTAMP Yap_heap_regs->INT_KEYS_TIMESTAMP_ #define INT_KEYS_TIMESTAMP Yap_heap_regs->INT_KEYS_TIMESTAMP_
#define INT_BB_KEYS_SIZE Yap_heap_regs->INT_BB_KEYS_SIZE_ #define INT_BB_KEYS_SIZE Yap_heap_regs->INT_BB_KEYS_SIZE_
#define UPDATE_MODE Yap_heap_regs->UPDATE_MODE_ #define UPDATE_MODE Yap_heap_regs->UPDATE_MODE_
#define DBErasedMarker Yap_heap_regs->DBErasedMarker_ #define DBErasedMarker Yap_heap_regs->DBErasedMarker_
#define LogDBErasedMarker Yap_heap_regs->LogDBErasedMarker_ #define LogDBErasedMarker Yap_heap_regs->LogDBErasedMarker_
#define DeadStaticClauses Yap_heap_regs->DeadStaticClauses_ #define DeadStaticClauses Yap_heap_regs->DeadStaticClauses_
#define DeadMegaClauses Yap_heap_regs->DeadMegaClauses_ #define DeadMegaClauses Yap_heap_regs->DeadMegaClauses_
#define DeadStaticIndices Yap_heap_regs->DeadStaticIndices_ #define DeadStaticIndices Yap_heap_regs->DeadStaticIndices_
#define DBErasedList Yap_heap_regs->DBErasedList_ #define DBErasedList Yap_heap_regs->DBErasedList_
#define DBErasedIList Yap_heap_regs->DBErasedIList_ #define DBErasedIList Yap_heap_regs->DBErasedIList_
#if defined(YAPOR) || defined(THREADS) #if defined(YAPOR) || defined(THREADS)
#define DeadStaticClausesLock Yap_heap_regs->DeadStaticClausesLock_ #define DeadStaticClausesLock Yap_heap_regs->DeadStaticClausesLock_
#define DeadMegaClausesLock Yap_heap_regs->DeadMegaClausesLock_ #define DeadMegaClausesLock Yap_heap_regs->DeadMegaClausesLock_
#define DeadStaticIndicesLock Yap_heap_regs->DeadStaticIndicesLock_ #define DeadStaticIndicesLock Yap_heap_regs->DeadStaticIndicesLock_
#endif #endif
#ifdef COROUTINING #ifdef COROUTINING
#define NUM_OF_ATTS Yap_heap_regs->NUM_OF_ATTS_ #define NUM_OF_ATTS Yap_heap_regs->NUM_OF_ATTS_
#define Yap_AttsSize Yap_heap_regs->Yap_AttsSize_ #define Yap_AttsSize Yap_heap_regs->Yap_AttsSize_
#endif #endif
#define OpList Yap_heap_regs->OpList_ #define setup_call_catcher_cleanup_tag Yap_heap_regs->setup_call_catcher_cleanup_tag_
#define ForeignCodeLoaded Yap_heap_regs->ForeignCodeLoaded_ #define OpList Yap_heap_regs->OpList_
#define ForeignCodeBase Yap_heap_regs->ForeignCodeBase_
#define ForeignCodeTop Yap_heap_regs->ForeignCodeTop_ #define ForeignCodeLoaded Yap_heap_regs->ForeignCodeLoaded_
#define ForeignCodeMax Yap_heap_regs->ForeignCodeMax_ #define ForeignCodeBase Yap_heap_regs->ForeignCodeBase_
#define ForeignCodeTop Yap_heap_regs->ForeignCodeTop_
#define Yap_Records Yap_heap_regs->Yap_Records_ #define ForeignCodeMax Yap_heap_regs->ForeignCodeMax_
#define EmptyWakeups Yap_heap_regs->EmptyWakeups_
#define MaxEmptyWakeups Yap_heap_regs->MaxEmptyWakeups_ #define Yap_Records Yap_heap_regs->Yap_Records_
#define EmptyWakeups Yap_heap_regs->EmptyWakeups_
#define BlobTypes Yap_heap_regs->BlobTypes_ #define MaxEmptyWakeups Yap_heap_regs->MaxEmptyWakeups_
#define Blobs Yap_heap_regs->Blobs_
#define NOfBlobs Yap_heap_regs->NOfBlobs_ #define BlobTypes Yap_heap_regs->BlobTypes_
#define NOfBlobsMax Yap_heap_regs->NOfBlobsMax_ #define Blobs Yap_heap_regs->Blobs_
#if defined(YAPOR) || defined(THREADS) #define NOfBlobs Yap_heap_regs->NOfBlobs_
#define Blobs_Lock Yap_heap_regs->Blobs_Lock_ #define NOfBlobsMax Yap_heap_regs->NOfBlobsMax_
#endif #if defined(YAPOR) || defined(THREADS)
#define Blobs_Lock Yap_heap_regs->Blobs_Lock_
#endif

View File

@ -1,478 +1,478 @@
/* This file, dlocals.h, was generated automatically by "yap -L misc/buildlocalglobal" /* This file, dlocals.h, was generated automatically by "yap -L misc/buildlocalglobal"
please do not update, update H/LOCALS instead */ please do not update, update H/LOCALS instead */
#define LOCAL_c_input_stream LOCAL->c_input_stream_ #define LOCAL_c_input_stream LOCAL->c_input_stream_
#define REMOTE_c_input_stream(wid) REMOTE(wid)->c_input_stream_ #define REMOTE_c_input_stream(wid) REMOTE(wid)->c_input_stream_
#define LOCAL_c_output_stream LOCAL->c_output_stream_ #define LOCAL_c_output_stream LOCAL->c_output_stream_
#define REMOTE_c_output_stream(wid) REMOTE(wid)->c_output_stream_ #define REMOTE_c_output_stream(wid) REMOTE(wid)->c_output_stream_
#define LOCAL_c_error_stream LOCAL->c_error_stream_ #define LOCAL_c_error_stream LOCAL->c_error_stream_
#define REMOTE_c_error_stream(wid) REMOTE(wid)->c_error_stream_ #define REMOTE_c_error_stream(wid) REMOTE(wid)->c_error_stream_
#define LOCAL_sockets_io LOCAL->sockets_io_ #define LOCAL_sockets_io LOCAL->sockets_io_
#define REMOTE_sockets_io(wid) REMOTE(wid)->sockets_io_ #define REMOTE_sockets_io(wid) REMOTE(wid)->sockets_io_
#define LOCAL_within_print_message LOCAL->within_print_message_ #define LOCAL_within_print_message LOCAL->within_print_message_
#define REMOTE_within_print_message(wid) REMOTE(wid)->within_print_message_ #define REMOTE_within_print_message(wid) REMOTE(wid)->within_print_message_
#define LOCAL_newline LOCAL->newline_ #define LOCAL_newline LOCAL->newline_
#define REMOTE_newline(wid) REMOTE(wid)->newline_ #define REMOTE_newline(wid) REMOTE(wid)->newline_
#define LOCAL_AtPrompt LOCAL->AtPrompt_ #define LOCAL_AtPrompt LOCAL->AtPrompt_
#define REMOTE_AtPrompt(wid) REMOTE(wid)->AtPrompt_ #define REMOTE_AtPrompt(wid) REMOTE(wid)->AtPrompt_
#define LOCAL_Prompt LOCAL->Prompt_ #define LOCAL_Prompt LOCAL->Prompt_
#define REMOTE_Prompt(wid) REMOTE(wid)->Prompt_ #define REMOTE_Prompt(wid) REMOTE(wid)->Prompt_
#define LOCAL_encoding LOCAL->encoding_ #define LOCAL_encoding LOCAL->encoding_
#define REMOTE_encoding(wid) REMOTE(wid)->encoding_ #define REMOTE_encoding(wid) REMOTE(wid)->encoding_
#define LOCAL_quasi_quotations LOCAL->quasi_quotations_ #define LOCAL_quasi_quotations LOCAL->quasi_quotations_
#define REMOTE_quasi_quotations(wid) REMOTE(wid)->quasi_quotations_ #define REMOTE_quasi_quotations(wid) REMOTE(wid)->quasi_quotations_
#define LOCAL_default_priority LOCAL->default_priority_ #define LOCAL_default_priority LOCAL->default_priority_
#define REMOTE_default_priority(wid) REMOTE(wid)->default_priority_ #define REMOTE_default_priority(wid) REMOTE(wid)->default_priority_
#define LOCAL_eot_before_eof LOCAL->eot_before_eof_ #define LOCAL_eot_before_eof LOCAL->eot_before_eof_
#define REMOTE_eot_before_eof(wid) REMOTE(wid)->eot_before_eof_ #define REMOTE_eot_before_eof(wid) REMOTE(wid)->eot_before_eof_
#define LOCAL_max_depth LOCAL->max_depth_ #define LOCAL_max_depth LOCAL->max_depth_
#define REMOTE_max_depth(wid) REMOTE(wid)->max_depth_ #define REMOTE_max_depth(wid) REMOTE(wid)->max_depth_
#define LOCAL_max_list LOCAL->max_list_ #define LOCAL_max_list LOCAL->max_list_
#define REMOTE_max_list(wid) REMOTE(wid)->max_list_ #define REMOTE_max_list(wid) REMOTE(wid)->max_list_
#define LOCAL_max_write_args LOCAL->max_write_args_ #define LOCAL_max_write_args LOCAL->max_write_args_
#define REMOTE_max_write_args(wid) REMOTE(wid)->max_write_args_ #define REMOTE_max_write_args(wid) REMOTE(wid)->max_write_args_
#define LOCAL_OldASP LOCAL->OldASP_ #define LOCAL_OldASP LOCAL->OldASP_
#define REMOTE_OldASP(wid) REMOTE(wid)->OldASP_ #define REMOTE_OldASP(wid) REMOTE(wid)->OldASP_
#define LOCAL_OldLCL0 LOCAL->OldLCL0_ #define LOCAL_OldLCL0 LOCAL->OldLCL0_
#define REMOTE_OldLCL0(wid) REMOTE(wid)->OldLCL0_ #define REMOTE_OldLCL0(wid) REMOTE(wid)->OldLCL0_
#define LOCAL_OldTR LOCAL->OldTR_ #define LOCAL_OldTR LOCAL->OldTR_
#define REMOTE_OldTR(wid) REMOTE(wid)->OldTR_ #define REMOTE_OldTR(wid) REMOTE(wid)->OldTR_
#define LOCAL_OldGlobalBase LOCAL->OldGlobalBase_ #define LOCAL_OldGlobalBase LOCAL->OldGlobalBase_
#define REMOTE_OldGlobalBase(wid) REMOTE(wid)->OldGlobalBase_ #define REMOTE_OldGlobalBase(wid) REMOTE(wid)->OldGlobalBase_
#define LOCAL_OldH LOCAL->OldH_ #define LOCAL_OldH LOCAL->OldH_
#define REMOTE_OldH(wid) REMOTE(wid)->OldH_ #define REMOTE_OldH(wid) REMOTE(wid)->OldH_
#define LOCAL_OldH0 LOCAL->OldH0_ #define LOCAL_OldH0 LOCAL->OldH0_
#define REMOTE_OldH0(wid) REMOTE(wid)->OldH0_ #define REMOTE_OldH0(wid) REMOTE(wid)->OldH0_
#define LOCAL_OldTrailBase LOCAL->OldTrailBase_ #define LOCAL_OldTrailBase LOCAL->OldTrailBase_
#define REMOTE_OldTrailBase(wid) REMOTE(wid)->OldTrailBase_ #define REMOTE_OldTrailBase(wid) REMOTE(wid)->OldTrailBase_
#define LOCAL_OldTrailTop LOCAL->OldTrailTop_ #define LOCAL_OldTrailTop LOCAL->OldTrailTop_
#define REMOTE_OldTrailTop(wid) REMOTE(wid)->OldTrailTop_ #define REMOTE_OldTrailTop(wid) REMOTE(wid)->OldTrailTop_
#define LOCAL_OldHeapBase LOCAL->OldHeapBase_ #define LOCAL_OldHeapBase LOCAL->OldHeapBase_
#define REMOTE_OldHeapBase(wid) REMOTE(wid)->OldHeapBase_ #define REMOTE_OldHeapBase(wid) REMOTE(wid)->OldHeapBase_
#define LOCAL_OldHeapTop LOCAL->OldHeapTop_ #define LOCAL_OldHeapTop LOCAL->OldHeapTop_
#define REMOTE_OldHeapTop(wid) REMOTE(wid)->OldHeapTop_ #define REMOTE_OldHeapTop(wid) REMOTE(wid)->OldHeapTop_
#define LOCAL_ClDiff LOCAL->ClDiff_ #define LOCAL_ClDiff LOCAL->ClDiff_
#define REMOTE_ClDiff(wid) REMOTE(wid)->ClDiff_ #define REMOTE_ClDiff(wid) REMOTE(wid)->ClDiff_
#define LOCAL_GDiff LOCAL->GDiff_ #define LOCAL_GDiff LOCAL->GDiff_
#define REMOTE_GDiff(wid) REMOTE(wid)->GDiff_ #define REMOTE_GDiff(wid) REMOTE(wid)->GDiff_
#define LOCAL_HDiff LOCAL->HDiff_ #define LOCAL_HDiff LOCAL->HDiff_
#define REMOTE_HDiff(wid) REMOTE(wid)->HDiff_ #define REMOTE_HDiff(wid) REMOTE(wid)->HDiff_
#define LOCAL_GDiff0 LOCAL->GDiff0_ #define LOCAL_GDiff0 LOCAL->GDiff0_
#define REMOTE_GDiff0(wid) REMOTE(wid)->GDiff0_ #define REMOTE_GDiff0(wid) REMOTE(wid)->GDiff0_
#define LOCAL_GSplit LOCAL->GSplit_ #define LOCAL_GSplit LOCAL->GSplit_
#define REMOTE_GSplit(wid) REMOTE(wid)->GSplit_ #define REMOTE_GSplit(wid) REMOTE(wid)->GSplit_
#define LOCAL_LDiff LOCAL->LDiff_ #define LOCAL_LDiff LOCAL->LDiff_
#define REMOTE_LDiff(wid) REMOTE(wid)->LDiff_ #define REMOTE_LDiff(wid) REMOTE(wid)->LDiff_
#define LOCAL_TrDiff LOCAL->TrDiff_ #define LOCAL_TrDiff LOCAL->TrDiff_
#define REMOTE_TrDiff(wid) REMOTE(wid)->TrDiff_ #define REMOTE_TrDiff(wid) REMOTE(wid)->TrDiff_
#define LOCAL_XDiff LOCAL->XDiff_ #define LOCAL_XDiff LOCAL->XDiff_
#define REMOTE_XDiff(wid) REMOTE(wid)->XDiff_ #define REMOTE_XDiff(wid) REMOTE(wid)->XDiff_
#define LOCAL_DelayDiff LOCAL->DelayDiff_ #define LOCAL_DelayDiff LOCAL->DelayDiff_
#define REMOTE_DelayDiff(wid) REMOTE(wid)->DelayDiff_ #define REMOTE_DelayDiff(wid) REMOTE(wid)->DelayDiff_
#define LOCAL_BaseDiff LOCAL->BaseDiff_ #define LOCAL_BaseDiff LOCAL->BaseDiff_
#define REMOTE_BaseDiff(wid) REMOTE(wid)->BaseDiff_ #define REMOTE_BaseDiff(wid) REMOTE(wid)->BaseDiff_
#define LOCAL_ReductionsCounter LOCAL->ReductionsCounter_ #define LOCAL_ReductionsCounter LOCAL->ReductionsCounter_
#define REMOTE_ReductionsCounter(wid) REMOTE(wid)->ReductionsCounter_ #define REMOTE_ReductionsCounter(wid) REMOTE(wid)->ReductionsCounter_
#define LOCAL_PredEntriesCounter LOCAL->PredEntriesCounter_ #define LOCAL_PredEntriesCounter LOCAL->PredEntriesCounter_
#define REMOTE_PredEntriesCounter(wid) REMOTE(wid)->PredEntriesCounter_ #define REMOTE_PredEntriesCounter(wid) REMOTE(wid)->PredEntriesCounter_
#define LOCAL_RetriesCounter LOCAL->RetriesCounter_ #define LOCAL_RetriesCounter LOCAL->RetriesCounter_
#define REMOTE_RetriesCounter(wid) REMOTE(wid)->RetriesCounter_ #define REMOTE_RetriesCounter(wid) REMOTE(wid)->RetriesCounter_
#define LOCAL_ReductionsCounterOn LOCAL->ReductionsCounterOn_ #define LOCAL_ReductionsCounterOn LOCAL->ReductionsCounterOn_
#define REMOTE_ReductionsCounterOn(wid) REMOTE(wid)->ReductionsCounterOn_ #define REMOTE_ReductionsCounterOn(wid) REMOTE(wid)->ReductionsCounterOn_
#define LOCAL_PredEntriesCounterOn LOCAL->PredEntriesCounterOn_ #define LOCAL_PredEntriesCounterOn LOCAL->PredEntriesCounterOn_
#define REMOTE_PredEntriesCounterOn(wid) REMOTE(wid)->PredEntriesCounterOn_ #define REMOTE_PredEntriesCounterOn(wid) REMOTE(wid)->PredEntriesCounterOn_
#define LOCAL_RetriesCounterOn LOCAL->RetriesCounterOn_ #define LOCAL_RetriesCounterOn LOCAL->RetriesCounterOn_
#define REMOTE_RetriesCounterOn(wid) REMOTE(wid)->RetriesCounterOn_ #define REMOTE_RetriesCounterOn(wid) REMOTE(wid)->RetriesCounterOn_
#define LOCAL_ConsultSp LOCAL->ConsultSp_ #define LOCAL_ConsultSp LOCAL->ConsultSp_
#define REMOTE_ConsultSp(wid) REMOTE(wid)->ConsultSp_ #define REMOTE_ConsultSp(wid) REMOTE(wid)->ConsultSp_
#define LOCAL_ConsultCapacity LOCAL->ConsultCapacity_ #define LOCAL_ConsultCapacity LOCAL->ConsultCapacity_
#define REMOTE_ConsultCapacity(wid) REMOTE(wid)->ConsultCapacity_ #define REMOTE_ConsultCapacity(wid) REMOTE(wid)->ConsultCapacity_
#define LOCAL_ConsultBase LOCAL->ConsultBase_ #define LOCAL_ConsultBase LOCAL->ConsultBase_
#define REMOTE_ConsultBase(wid) REMOTE(wid)->ConsultBase_ #define REMOTE_ConsultBase(wid) REMOTE(wid)->ConsultBase_
#define LOCAL_ConsultLow LOCAL->ConsultLow_ #define LOCAL_ConsultLow LOCAL->ConsultLow_
#define REMOTE_ConsultLow(wid) REMOTE(wid)->ConsultLow_ #define REMOTE_ConsultLow(wid) REMOTE(wid)->ConsultLow_
#define LOCAL_VarNames LOCAL->VarNames_ #define LOCAL_VarNames LOCAL->VarNames_
#define REMOTE_VarNames(wid) REMOTE(wid)->VarNames_ #define REMOTE_VarNames(wid) REMOTE(wid)->VarNames_
#define LOCAL_SourceFileName LOCAL->SourceFileName_ #define LOCAL_SourceFileName LOCAL->SourceFileName_
#define REMOTE_SourceFileName(wid) REMOTE(wid)->SourceFileName_ #define REMOTE_SourceFileName(wid) REMOTE(wid)->SourceFileName_
#define LOCAL_SourceFileLineno LOCAL->SourceFileLineno_ #define LOCAL_SourceFileLineno LOCAL->SourceFileLineno_
#define REMOTE_SourceFileLineno(wid) REMOTE(wid)->SourceFileLineno_ #define REMOTE_SourceFileLineno(wid) REMOTE(wid)->SourceFileLineno_
#define LOCAL_GlobalArena LOCAL->GlobalArena_ #define LOCAL_GlobalArena LOCAL->GlobalArena_
#define REMOTE_GlobalArena(wid) REMOTE(wid)->GlobalArena_ #define REMOTE_GlobalArena(wid) REMOTE(wid)->GlobalArena_
#define LOCAL_GlobalArenaOverflows LOCAL->GlobalArenaOverflows_ #define LOCAL_GlobalArenaOverflows LOCAL->GlobalArenaOverflows_
#define REMOTE_GlobalArenaOverflows(wid) REMOTE(wid)->GlobalArenaOverflows_ #define REMOTE_GlobalArenaOverflows(wid) REMOTE(wid)->GlobalArenaOverflows_
#define LOCAL_ArenaOverflows LOCAL->ArenaOverflows_ #define LOCAL_ArenaOverflows LOCAL->ArenaOverflows_
#define REMOTE_ArenaOverflows(wid) REMOTE(wid)->ArenaOverflows_ #define REMOTE_ArenaOverflows(wid) REMOTE(wid)->ArenaOverflows_
#define LOCAL_DepthArenas LOCAL->DepthArenas_ #define LOCAL_DepthArenas LOCAL->DepthArenas_
#define REMOTE_DepthArenas(wid) REMOTE(wid)->DepthArenas_ #define REMOTE_DepthArenas(wid) REMOTE(wid)->DepthArenas_
#define LOCAL_LastAssertedPred LOCAL->LastAssertedPred_ #define LOCAL_LastAssertedPred LOCAL->LastAssertedPred_
#define REMOTE_LastAssertedPred(wid) REMOTE(wid)->LastAssertedPred_ #define REMOTE_LastAssertedPred(wid) REMOTE(wid)->LastAssertedPred_
#define LOCAL_TmpPred LOCAL->TmpPred_ #define LOCAL_TmpPred LOCAL->TmpPred_
#define REMOTE_TmpPred(wid) REMOTE(wid)->TmpPred_ #define REMOTE_TmpPred(wid) REMOTE(wid)->TmpPred_
#define LOCAL_ScannerStack LOCAL->ScannerStack_ #define LOCAL_ScannerStack LOCAL->ScannerStack_
#define REMOTE_ScannerStack(wid) REMOTE(wid)->ScannerStack_ #define REMOTE_ScannerStack(wid) REMOTE(wid)->ScannerStack_
#define LOCAL_ScannerExtraBlocks LOCAL->ScannerExtraBlocks_ #define LOCAL_ScannerExtraBlocks LOCAL->ScannerExtraBlocks_
#define REMOTE_ScannerExtraBlocks(wid) REMOTE(wid)->ScannerExtraBlocks_ #define REMOTE_ScannerExtraBlocks(wid) REMOTE(wid)->ScannerExtraBlocks_
#define LOCAL_CBorder LOCAL->CBorder_ #define LOCAL_CBorder LOCAL->CBorder_
#define REMOTE_CBorder(wid) REMOTE(wid)->CBorder_ #define REMOTE_CBorder(wid) REMOTE(wid)->CBorder_
#define LOCAL_MaxActiveSignals LOCAL->MaxActiveSignals_ #define LOCAL_MaxActiveSignals LOCAL->MaxActiveSignals_
#define REMOTE_MaxActiveSignals(wid) REMOTE(wid)->MaxActiveSignals_ #define REMOTE_MaxActiveSignals(wid) REMOTE(wid)->MaxActiveSignals_
#define LOCAL_Signals LOCAL->Signals_ #define LOCAL_Signals LOCAL->Signals_
#define REMOTE_Signals(wid) REMOTE(wid)->Signals_ #define REMOTE_Signals(wid) REMOTE(wid)->Signals_
#define LOCAL_IPredArity LOCAL->IPredArity_ #define LOCAL_IPredArity LOCAL->IPredArity_
#define REMOTE_IPredArity(wid) REMOTE(wid)->IPredArity_ #define REMOTE_IPredArity(wid) REMOTE(wid)->IPredArity_
#define LOCAL_ProfEnd LOCAL->ProfEnd_ #define LOCAL_ProfEnd LOCAL->ProfEnd_
#define REMOTE_ProfEnd(wid) REMOTE(wid)->ProfEnd_ #define REMOTE_ProfEnd(wid) REMOTE(wid)->ProfEnd_
#define LOCAL_DoingUndefp LOCAL->DoingUndefp_ #define LOCAL_DoingUndefp LOCAL->DoingUndefp_
#define REMOTE_DoingUndefp(wid) REMOTE(wid)->DoingUndefp_ #define REMOTE_DoingUndefp(wid) REMOTE(wid)->DoingUndefp_
#define LOCAL_StartCharCount LOCAL->StartCharCount_ #define LOCAL_StartCharCount LOCAL->StartCharCount_
#define REMOTE_StartCharCount(wid) REMOTE(wid)->StartCharCount_ #define REMOTE_StartCharCount(wid) REMOTE(wid)->StartCharCount_
#define LOCAL_StartLineCount LOCAL->StartLineCount_ #define LOCAL_StartLineCount LOCAL->StartLineCount_
#define REMOTE_StartLineCount(wid) REMOTE(wid)->StartLineCount_ #define REMOTE_StartLineCount(wid) REMOTE(wid)->StartLineCount_
#define LOCAL_StartLinePos LOCAL->StartLinePos_ #define LOCAL_StartLinePos LOCAL->StartLinePos_
#define REMOTE_StartLinePos(wid) REMOTE(wid)->StartLinePos_ #define REMOTE_StartLinePos(wid) REMOTE(wid)->StartLinePos_
#define LOCAL_ScratchPad LOCAL->ScratchPad_ #define LOCAL_ScratchPad LOCAL->ScratchPad_
#define REMOTE_ScratchPad(wid) REMOTE(wid)->ScratchPad_ #define REMOTE_ScratchPad(wid) REMOTE(wid)->ScratchPad_
#ifdef COROUTINING #ifdef COROUTINING
#define LOCAL_WokenGoals LOCAL->WokenGoals_ #define LOCAL_WokenGoals LOCAL->WokenGoals_
#define REMOTE_WokenGoals(wid) REMOTE(wid)->WokenGoals_ #define REMOTE_WokenGoals(wid) REMOTE(wid)->WokenGoals_
#define LOCAL_AttsMutableList LOCAL->AttsMutableList_ #define LOCAL_AttsMutableList LOCAL->AttsMutableList_
#define REMOTE_AttsMutableList(wid) REMOTE(wid)->AttsMutableList_ #define REMOTE_AttsMutableList(wid) REMOTE(wid)->AttsMutableList_
#endif #endif
#define LOCAL_GcGeneration LOCAL->GcGeneration_ #define LOCAL_GcGeneration LOCAL->GcGeneration_
#define REMOTE_GcGeneration(wid) REMOTE(wid)->GcGeneration_ #define REMOTE_GcGeneration(wid) REMOTE(wid)->GcGeneration_
#define LOCAL_GcPhase LOCAL->GcPhase_ #define LOCAL_GcPhase LOCAL->GcPhase_
#define REMOTE_GcPhase(wid) REMOTE(wid)->GcPhase_ #define REMOTE_GcPhase(wid) REMOTE(wid)->GcPhase_
#define LOCAL_GcCurrentPhase LOCAL->GcCurrentPhase_ #define LOCAL_GcCurrentPhase LOCAL->GcCurrentPhase_
#define REMOTE_GcCurrentPhase(wid) REMOTE(wid)->GcCurrentPhase_ #define REMOTE_GcCurrentPhase(wid) REMOTE(wid)->GcCurrentPhase_
#define LOCAL_GcCalls LOCAL->GcCalls_ #define LOCAL_GcCalls LOCAL->GcCalls_
#define REMOTE_GcCalls(wid) REMOTE(wid)->GcCalls_ #define REMOTE_GcCalls(wid) REMOTE(wid)->GcCalls_
#define LOCAL_TotGcTime LOCAL->TotGcTime_ #define LOCAL_TotGcTime LOCAL->TotGcTime_
#define REMOTE_TotGcTime(wid) REMOTE(wid)->TotGcTime_ #define REMOTE_TotGcTime(wid) REMOTE(wid)->TotGcTime_
#define LOCAL_TotGcRecovered LOCAL->TotGcRecovered_ #define LOCAL_TotGcRecovered LOCAL->TotGcRecovered_
#define REMOTE_TotGcRecovered(wid) REMOTE(wid)->TotGcRecovered_ #define REMOTE_TotGcRecovered(wid) REMOTE(wid)->TotGcRecovered_
#define LOCAL_LastGcTime LOCAL->LastGcTime_ #define LOCAL_LastGcTime LOCAL->LastGcTime_
#define REMOTE_LastGcTime(wid) REMOTE(wid)->LastGcTime_ #define REMOTE_LastGcTime(wid) REMOTE(wid)->LastGcTime_
#define LOCAL_LastSSTime LOCAL->LastSSTime_ #define LOCAL_LastSSTime LOCAL->LastSSTime_
#define REMOTE_LastSSTime(wid) REMOTE(wid)->LastSSTime_ #define REMOTE_LastSSTime(wid) REMOTE(wid)->LastSSTime_
#define LOCAL_OpenArray LOCAL->OpenArray_ #define LOCAL_OpenArray LOCAL->OpenArray_
#define REMOTE_OpenArray(wid) REMOTE(wid)->OpenArray_ #define REMOTE_OpenArray(wid) REMOTE(wid)->OpenArray_
#define LOCAL_total_marked LOCAL->total_marked_ #define LOCAL_total_marked LOCAL->total_marked_
#define REMOTE_total_marked(wid) REMOTE(wid)->total_marked_ #define REMOTE_total_marked(wid) REMOTE(wid)->total_marked_
#define LOCAL_total_oldies LOCAL->total_oldies_ #define LOCAL_total_oldies LOCAL->total_oldies_
#define REMOTE_total_oldies(wid) REMOTE(wid)->total_oldies_ #define REMOTE_total_oldies(wid) REMOTE(wid)->total_oldies_
#define LOCAL_current_B LOCAL->current_B_ #define LOCAL_current_B LOCAL->current_B_
#define REMOTE_current_B(wid) REMOTE(wid)->current_B_ #define REMOTE_current_B(wid) REMOTE(wid)->current_B_
#define LOCAL_prev_HB LOCAL->prev_HB_ #define LOCAL_prev_HB LOCAL->prev_HB_
#define REMOTE_prev_HB(wid) REMOTE(wid)->prev_HB_ #define REMOTE_prev_HB(wid) REMOTE(wid)->prev_HB_
#define LOCAL_HGEN LOCAL->HGEN_ #define LOCAL_HGEN LOCAL->HGEN_
#define REMOTE_HGEN(wid) REMOTE(wid)->HGEN_ #define REMOTE_HGEN(wid) REMOTE(wid)->HGEN_
#define LOCAL_iptop LOCAL->iptop_ #define LOCAL_iptop LOCAL->iptop_
#define REMOTE_iptop(wid) REMOTE(wid)->iptop_ #define REMOTE_iptop(wid) REMOTE(wid)->iptop_
#if defined(GC_NO_TAGS) #if defined(GC_NO_TAGS)
#define LOCAL_bp LOCAL->bp_ #define LOCAL_bp LOCAL->bp_
#define REMOTE_bp(wid) REMOTE(wid)->bp_ #define REMOTE_bp(wid) REMOTE(wid)->bp_
#endif #endif
#define LOCAL_sTR LOCAL->sTR_ #define LOCAL_sTR LOCAL->sTR_
#define REMOTE_sTR(wid) REMOTE(wid)->sTR_ #define REMOTE_sTR(wid) REMOTE(wid)->sTR_
#define LOCAL_sTR0 LOCAL->sTR0_ #define LOCAL_sTR0 LOCAL->sTR0_
#define REMOTE_sTR0(wid) REMOTE(wid)->sTR0_ #define REMOTE_sTR0(wid) REMOTE(wid)->sTR0_
#define LOCAL_new_TR LOCAL->new_TR_ #define LOCAL_new_TR LOCAL->new_TR_
#define REMOTE_new_TR(wid) REMOTE(wid)->new_TR_ #define REMOTE_new_TR(wid) REMOTE(wid)->new_TR_
#define LOCAL_cont_top0 LOCAL->cont_top0_ #define LOCAL_cont_top0 LOCAL->cont_top0_
#define REMOTE_cont_top0(wid) REMOTE(wid)->cont_top0_ #define REMOTE_cont_top0(wid) REMOTE(wid)->cont_top0_
#define LOCAL_cont_top LOCAL->cont_top_ #define LOCAL_cont_top LOCAL->cont_top_
#define REMOTE_cont_top(wid) REMOTE(wid)->cont_top_ #define REMOTE_cont_top(wid) REMOTE(wid)->cont_top_
#define LOCAL_discard_trail_entries LOCAL->discard_trail_entries_ #define LOCAL_discard_trail_entries LOCAL->discard_trail_entries_
#define REMOTE_discard_trail_entries(wid) REMOTE(wid)->discard_trail_entries_ #define REMOTE_discard_trail_entries(wid) REMOTE(wid)->discard_trail_entries_
#define LOCAL_gc_ma_hash_table LOCAL->gc_ma_hash_table_ #define LOCAL_gc_ma_hash_table LOCAL->gc_ma_hash_table_
#define REMOTE_gc_ma_hash_table(wid) REMOTE(wid)->gc_ma_hash_table_ #define REMOTE_gc_ma_hash_table(wid) REMOTE(wid)->gc_ma_hash_table_
#define LOCAL_gc_ma_h_top LOCAL->gc_ma_h_top_ #define LOCAL_gc_ma_h_top LOCAL->gc_ma_h_top_
#define REMOTE_gc_ma_h_top(wid) REMOTE(wid)->gc_ma_h_top_ #define REMOTE_gc_ma_h_top(wid) REMOTE(wid)->gc_ma_h_top_
#define LOCAL_gc_ma_h_list LOCAL->gc_ma_h_list_ #define LOCAL_gc_ma_h_list LOCAL->gc_ma_h_list_
#define REMOTE_gc_ma_h_list(wid) REMOTE(wid)->gc_ma_h_list_ #define REMOTE_gc_ma_h_list(wid) REMOTE(wid)->gc_ma_h_list_
#define LOCAL_gc_timestamp LOCAL->gc_timestamp_ #define LOCAL_gc_timestamp LOCAL->gc_timestamp_
#define REMOTE_gc_timestamp(wid) REMOTE(wid)->gc_timestamp_ #define REMOTE_gc_timestamp(wid) REMOTE(wid)->gc_timestamp_
#define LOCAL_db_vec LOCAL->db_vec_ #define LOCAL_db_vec LOCAL->db_vec_
#define REMOTE_db_vec(wid) REMOTE(wid)->db_vec_ #define REMOTE_db_vec(wid) REMOTE(wid)->db_vec_
#define LOCAL_db_vec0 LOCAL->db_vec0_ #define LOCAL_db_vec0 LOCAL->db_vec0_
#define REMOTE_db_vec0(wid) REMOTE(wid)->db_vec0_ #define REMOTE_db_vec0(wid) REMOTE(wid)->db_vec0_
#define LOCAL_db_root LOCAL->db_root_ #define LOCAL_db_root LOCAL->db_root_
#define REMOTE_db_root(wid) REMOTE(wid)->db_root_ #define REMOTE_db_root(wid) REMOTE(wid)->db_root_
#define LOCAL_db_nil LOCAL->db_nil_ #define LOCAL_db_nil LOCAL->db_nil_
#define REMOTE_db_nil(wid) REMOTE(wid)->db_nil_ #define REMOTE_db_nil(wid) REMOTE(wid)->db_nil_
#define LOCAL_gc_restore LOCAL->gc_restore_ #define LOCAL_gc_restore LOCAL->gc_restore_
#define REMOTE_gc_restore(wid) REMOTE(wid)->gc_restore_ #define REMOTE_gc_restore(wid) REMOTE(wid)->gc_restore_
#define LOCAL_extra_gc_cells LOCAL->extra_gc_cells_ #define LOCAL_extra_gc_cells LOCAL->extra_gc_cells_
#define REMOTE_extra_gc_cells(wid) REMOTE(wid)->extra_gc_cells_ #define REMOTE_extra_gc_cells(wid) REMOTE(wid)->extra_gc_cells_
#define LOCAL_extra_gc_cells_base LOCAL->extra_gc_cells_base_ #define LOCAL_extra_gc_cells_base LOCAL->extra_gc_cells_base_
#define REMOTE_extra_gc_cells_base(wid) REMOTE(wid)->extra_gc_cells_base_ #define REMOTE_extra_gc_cells_base(wid) REMOTE(wid)->extra_gc_cells_base_
#define LOCAL_extra_gc_cells_top LOCAL->extra_gc_cells_top_ #define LOCAL_extra_gc_cells_top LOCAL->extra_gc_cells_top_
#define REMOTE_extra_gc_cells_top(wid) REMOTE(wid)->extra_gc_cells_top_ #define REMOTE_extra_gc_cells_top(wid) REMOTE(wid)->extra_gc_cells_top_
#define LOCAL_extra_gc_cells_size LOCAL->extra_gc_cells_size_ #define LOCAL_extra_gc_cells_size LOCAL->extra_gc_cells_size_
#define REMOTE_extra_gc_cells_size(wid) REMOTE(wid)->extra_gc_cells_size_ #define REMOTE_extra_gc_cells_size(wid) REMOTE(wid)->extra_gc_cells_size_
#define LOCAL_DynamicArrays LOCAL->DynamicArrays_ #define LOCAL_DynamicArrays LOCAL->DynamicArrays_
#define REMOTE_DynamicArrays(wid) REMOTE(wid)->DynamicArrays_ #define REMOTE_DynamicArrays(wid) REMOTE(wid)->DynamicArrays_
#define LOCAL_StaticArrays LOCAL->StaticArrays_ #define LOCAL_StaticArrays LOCAL->StaticArrays_
#define REMOTE_StaticArrays(wid) REMOTE(wid)->StaticArrays_ #define REMOTE_StaticArrays(wid) REMOTE(wid)->StaticArrays_
#define LOCAL_GlobalVariables LOCAL->GlobalVariables_ #define LOCAL_GlobalVariables LOCAL->GlobalVariables_
#define REMOTE_GlobalVariables(wid) REMOTE(wid)->GlobalVariables_ #define REMOTE_GlobalVariables(wid) REMOTE(wid)->GlobalVariables_
#define LOCAL_AllowRestart LOCAL->AllowRestart_ #define LOCAL_AllowRestart LOCAL->AllowRestart_
#define REMOTE_AllowRestart(wid) REMOTE(wid)->AllowRestart_ #define REMOTE_AllowRestart(wid) REMOTE(wid)->AllowRestart_
#define LOCAL_CMemFirstBlock LOCAL->CMemFirstBlock_ #define LOCAL_CMemFirstBlock LOCAL->CMemFirstBlock_
#define REMOTE_CMemFirstBlock(wid) REMOTE(wid)->CMemFirstBlock_ #define REMOTE_CMemFirstBlock(wid) REMOTE(wid)->CMemFirstBlock_
#define LOCAL_CMemFirstBlockSz LOCAL->CMemFirstBlockSz_ #define LOCAL_CMemFirstBlockSz LOCAL->CMemFirstBlockSz_
#define REMOTE_CMemFirstBlockSz(wid) REMOTE(wid)->CMemFirstBlockSz_ #define REMOTE_CMemFirstBlockSz(wid) REMOTE(wid)->CMemFirstBlockSz_
#define LOCAL_nperm LOCAL->nperm_ #define LOCAL_nperm LOCAL->nperm_
#define REMOTE_nperm(wid) REMOTE(wid)->nperm_ #define REMOTE_nperm(wid) REMOTE(wid)->nperm_
#define LOCAL_jMP LOCAL->jMP_ #define LOCAL_jMP LOCAL->jMP_
#define REMOTE_jMP(wid) REMOTE(wid)->jMP_ #define REMOTE_jMP(wid) REMOTE(wid)->jMP_
#define LOCAL_LabelFirstArray LOCAL->LabelFirstArray_ #define LOCAL_LabelFirstArray LOCAL->LabelFirstArray_
#define REMOTE_LabelFirstArray(wid) REMOTE(wid)->LabelFirstArray_ #define REMOTE_LabelFirstArray(wid) REMOTE(wid)->LabelFirstArray_
#define LOCAL_LabelFirstArraySz LOCAL->LabelFirstArraySz_ #define LOCAL_LabelFirstArraySz LOCAL->LabelFirstArraySz_
#define REMOTE_LabelFirstArraySz(wid) REMOTE(wid)->LabelFirstArraySz_ #define REMOTE_LabelFirstArraySz(wid) REMOTE(wid)->LabelFirstArraySz_
#ifdef THREADS #ifdef THREADS
#define LOCAL_ThreadHandle LOCAL->ThreadHandle_ #define LOCAL_ThreadHandle LOCAL->ThreadHandle_
#define REMOTE_ThreadHandle(wid) REMOTE(wid)->ThreadHandle_ #define REMOTE_ThreadHandle(wid) REMOTE(wid)->ThreadHandle_
#endif /* THREADS */ #endif /* THREADS */
#if defined(YAPOR) || defined(TABLING) #if defined(YAPOR) || defined(TABLING)
#define LOCAL_optyap_data LOCAL->optyap_data_ #define LOCAL_optyap_data LOCAL->optyap_data_
#define REMOTE_optyap_data(wid) REMOTE(wid)->optyap_data_ #define REMOTE_optyap_data(wid) REMOTE(wid)->optyap_data_
#define LOCAL_TabMode LOCAL->TabMode_ #define LOCAL_TabMode LOCAL->TabMode_
#define REMOTE_TabMode(wid) REMOTE(wid)->TabMode_ #define REMOTE_TabMode(wid) REMOTE(wid)->TabMode_
#endif /* YAPOR || TABLING */ #endif /* YAPOR || TABLING */
#define LOCAL_InterruptsDisabled LOCAL->InterruptsDisabled_ #define LOCAL_InterruptsDisabled LOCAL->InterruptsDisabled_
#define REMOTE_InterruptsDisabled(wid) REMOTE(wid)->InterruptsDisabled_ #define REMOTE_InterruptsDisabled(wid) REMOTE(wid)->InterruptsDisabled_
#define LOCAL_execution LOCAL->execution_ #define LOCAL_execution LOCAL->execution_
#define REMOTE_execution(wid) REMOTE(wid)->execution_ #define REMOTE_execution(wid) REMOTE(wid)->execution_
#if LOW_LEVEL_TRACER #if LOW_LEVEL_TRACER
#define LOCAL_total_choicepoints LOCAL->total_choicepoints_ #define LOCAL_total_choicepoints LOCAL->total_choicepoints_
#define REMOTE_total_choicepoints(wid) REMOTE(wid)->total_choicepoints_ #define REMOTE_total_choicepoints(wid) REMOTE(wid)->total_choicepoints_
#endif #endif
#define LOCAL_consult_level LOCAL->consult_level_ #define LOCAL_consult_level LOCAL->consult_level_
#define REMOTE_consult_level(wid) REMOTE(wid)->consult_level_ #define REMOTE_consult_level(wid) REMOTE(wid)->consult_level_
#define LOCAL_LocalBase LOCAL->LocalBase_ #define LOCAL_LocalBase LOCAL->LocalBase_
#define REMOTE_LocalBase(wid) REMOTE(wid)->LocalBase_ #define REMOTE_LocalBase(wid) REMOTE(wid)->LocalBase_
#define LOCAL_GlobalBase LOCAL->GlobalBase_ #define LOCAL_GlobalBase LOCAL->GlobalBase_
#define REMOTE_GlobalBase(wid) REMOTE(wid)->GlobalBase_ #define REMOTE_GlobalBase(wid) REMOTE(wid)->GlobalBase_
#define LOCAL_TrailBase LOCAL->TrailBase_ #define LOCAL_TrailBase LOCAL->TrailBase_
#define REMOTE_TrailBase(wid) REMOTE(wid)->TrailBase_ #define REMOTE_TrailBase(wid) REMOTE(wid)->TrailBase_
#define LOCAL_TrailTop LOCAL->TrailTop_ #define LOCAL_TrailTop LOCAL->TrailTop_
#define REMOTE_TrailTop(wid) REMOTE(wid)->TrailTop_ #define REMOTE_TrailTop(wid) REMOTE(wid)->TrailTop_
#define LOCAL_ActiveError LOCAL->ActiveError_ #define LOCAL_ActiveError LOCAL->ActiveError_
#define REMOTE_ActiveError(wid) REMOTE(wid)->ActiveError_ #define REMOTE_ActiveError(wid) REMOTE(wid)->ActiveError_
#define LOCAL_IOBotch LOCAL->IOBotch_ #define LOCAL_IOBotch LOCAL->IOBotch_
#define REMOTE_IOBotch(wid) REMOTE(wid)->IOBotch_ #define REMOTE_IOBotch(wid) REMOTE(wid)->IOBotch_
#define LOCAL_tokptr LOCAL->tokptr_ #define LOCAL_tokptr LOCAL->tokptr_
#define REMOTE_tokptr(wid) REMOTE(wid)->tokptr_ #define REMOTE_tokptr(wid) REMOTE(wid)->tokptr_
#define LOCAL_toktide LOCAL->toktide_ #define LOCAL_toktide LOCAL->toktide_
#define REMOTE_toktide(wid) REMOTE(wid)->toktide_ #define REMOTE_toktide(wid) REMOTE(wid)->toktide_
#define LOCAL_VarTable LOCAL->VarTable_ #define LOCAL_VarTable LOCAL->VarTable_
#define REMOTE_VarTable(wid) REMOTE(wid)->VarTable_ #define REMOTE_VarTable(wid) REMOTE(wid)->VarTable_
#define LOCAL_AnonVarTable LOCAL->AnonVarTable_ #define LOCAL_AnonVarTable LOCAL->AnonVarTable_
#define REMOTE_AnonVarTable(wid) REMOTE(wid)->AnonVarTable_ #define REMOTE_AnonVarTable(wid) REMOTE(wid)->AnonVarTable_
#define LOCAL_Comments LOCAL->Comments_ #define LOCAL_Comments LOCAL->Comments_
#define REMOTE_Comments(wid) REMOTE(wid)->Comments_ #define REMOTE_Comments(wid) REMOTE(wid)->Comments_
#define LOCAL_CommentsTail LOCAL->CommentsTail_ #define LOCAL_CommentsTail LOCAL->CommentsTail_
#define REMOTE_CommentsTail(wid) REMOTE(wid)->CommentsTail_ #define REMOTE_CommentsTail(wid) REMOTE(wid)->CommentsTail_
#define LOCAL_CommentsNextChar LOCAL->CommentsNextChar_ #define LOCAL_CommentsNextChar LOCAL->CommentsNextChar_
#define REMOTE_CommentsNextChar(wid) REMOTE(wid)->CommentsNextChar_ #define REMOTE_CommentsNextChar(wid) REMOTE(wid)->CommentsNextChar_
#define LOCAL_CommentsBuff LOCAL->CommentsBuff_ #define LOCAL_CommentsBuff LOCAL->CommentsBuff_
#define REMOTE_CommentsBuff(wid) REMOTE(wid)->CommentsBuff_ #define REMOTE_CommentsBuff(wid) REMOTE(wid)->CommentsBuff_
#define LOCAL_CommentsBuffPos LOCAL->CommentsBuffPos_ #define LOCAL_CommentsBuffPos LOCAL->CommentsBuffPos_
#define REMOTE_CommentsBuffPos(wid) REMOTE(wid)->CommentsBuffPos_ #define REMOTE_CommentsBuffPos(wid) REMOTE(wid)->CommentsBuffPos_
#define LOCAL_CommentsBuffLim LOCAL->CommentsBuffLim_ #define LOCAL_CommentsBuffLim LOCAL->CommentsBuffLim_
#define REMOTE_CommentsBuffLim(wid) REMOTE(wid)->CommentsBuffLim_ #define REMOTE_CommentsBuffLim(wid) REMOTE(wid)->CommentsBuffLim_
#define LOCAL_RestartEnv LOCAL->RestartEnv_ #define LOCAL_RestartEnv LOCAL->RestartEnv_
#define REMOTE_RestartEnv(wid) REMOTE(wid)->RestartEnv_ #define REMOTE_RestartEnv(wid) REMOTE(wid)->RestartEnv_
#define LOCAL_FileNameBuf LOCAL->FileNameBuf_ #define LOCAL_FileNameBuf LOCAL->FileNameBuf_
#define REMOTE_FileNameBuf(wid) REMOTE(wid)->FileNameBuf_ #define REMOTE_FileNameBuf(wid) REMOTE(wid)->FileNameBuf_
#define LOCAL_FileNameBuf2 LOCAL->FileNameBuf2_ #define LOCAL_FileNameBuf2 LOCAL->FileNameBuf2_
#define REMOTE_FileNameBuf2(wid) REMOTE(wid)->FileNameBuf2_ #define REMOTE_FileNameBuf2(wid) REMOTE(wid)->FileNameBuf2_
#define LOCAL_TextBuffer LOCAL->TextBuffer_ #define LOCAL_TextBuffer LOCAL->TextBuffer_
#define REMOTE_TextBuffer(wid) REMOTE(wid)->TextBuffer_ #define REMOTE_TextBuffer(wid) REMOTE(wid)->TextBuffer_
#define LOCAL_BreakLevel LOCAL->BreakLevel_ #define LOCAL_BreakLevel LOCAL->BreakLevel_
#define REMOTE_BreakLevel(wid) REMOTE(wid)->BreakLevel_ #define REMOTE_BreakLevel(wid) REMOTE(wid)->BreakLevel_
#define LOCAL_PrologMode LOCAL->PrologMode_ #define LOCAL_PrologMode LOCAL->PrologMode_
#define REMOTE_PrologMode(wid) REMOTE(wid)->PrologMode_ #define REMOTE_PrologMode(wid) REMOTE(wid)->PrologMode_
#define LOCAL_CritLocks LOCAL->CritLocks_ #define LOCAL_CritLocks LOCAL->CritLocks_
#define REMOTE_CritLocks(wid) REMOTE(wid)->CritLocks_ #define REMOTE_CritLocks(wid) REMOTE(wid)->CritLocks_
#define LOCAL_Flags LOCAL->Flags_ #define LOCAL_Flags LOCAL->Flags_
#define REMOTE_Flags(wid) REMOTE(wid)->Flags_ #define REMOTE_Flags(wid) REMOTE(wid)->Flags_
#define LOCAL_flagCount LOCAL->flagCount_ #define LOCAL_flagCount LOCAL->flagCount_
#define REMOTE_flagCount(wid) REMOTE(wid)->flagCount_ #define REMOTE_flagCount(wid) REMOTE(wid)->flagCount_
#ifdef ANALYST #ifdef ANALYST
#define LOCAL_opcount LOCAL->opcount_ #define LOCAL_opcount LOCAL->opcount_
#define REMOTE_opcount(wid) REMOTE(wid)->opcount_ #define REMOTE_opcount(wid) REMOTE(wid)->opcount_
#define LOCAL_2opcount LOCAL->2opcount_ #define LOCAL_2opcount LOCAL->2opcount_
#define REMOTE_2opcount(wid) REMOTE(wid)->2opcount_ #define REMOTE_2opcount(wid) REMOTE(wid)->2opcount_
#endif /* ANALYST */ #endif /* ANALYST */
#define LOCAL_s_dbg LOCAL->s_dbg_ #define LOCAL_s_dbg LOCAL->s_dbg_
#define REMOTE_s_dbg(wid) REMOTE(wid)->s_dbg_ #define REMOTE_s_dbg(wid) REMOTE(wid)->s_dbg_
#define LOCAL_mathtt LOCAL->mathtt_ #define LOCAL_mathtt LOCAL->mathtt_
#define REMOTE_mathtt(wid) REMOTE(wid)->mathtt_ #define REMOTE_mathtt(wid) REMOTE(wid)->mathtt_
#define LOCAL_mathstring LOCAL->mathstring_ #define LOCAL_mathstring LOCAL->mathstring_
#define REMOTE_mathstring(wid) REMOTE(wid)->mathstring_ #define REMOTE_mathstring(wid) REMOTE(wid)->mathstring_
#define LOCAL_heap_overflows LOCAL->heap_overflows_ #define LOCAL_heap_overflows LOCAL->heap_overflows_
#define REMOTE_heap_overflows(wid) REMOTE(wid)->heap_overflows_ #define REMOTE_heap_overflows(wid) REMOTE(wid)->heap_overflows_
#define LOCAL_total_heap_overflow_time LOCAL->total_heap_overflow_time_ #define LOCAL_total_heap_overflow_time LOCAL->total_heap_overflow_time_
#define REMOTE_total_heap_overflow_time(wid) REMOTE(wid)->total_heap_overflow_time_ #define REMOTE_total_heap_overflow_time(wid) REMOTE(wid)->total_heap_overflow_time_
#define LOCAL_stack_overflows LOCAL->stack_overflows_ #define LOCAL_stack_overflows LOCAL->stack_overflows_
#define REMOTE_stack_overflows(wid) REMOTE(wid)->stack_overflows_ #define REMOTE_stack_overflows(wid) REMOTE(wid)->stack_overflows_
#define LOCAL_total_stack_overflow_time LOCAL->total_stack_overflow_time_ #define LOCAL_total_stack_overflow_time LOCAL->total_stack_overflow_time_
#define REMOTE_total_stack_overflow_time(wid) REMOTE(wid)->total_stack_overflow_time_ #define REMOTE_total_stack_overflow_time(wid) REMOTE(wid)->total_stack_overflow_time_
#define LOCAL_delay_overflows LOCAL->delay_overflows_ #define LOCAL_delay_overflows LOCAL->delay_overflows_
#define REMOTE_delay_overflows(wid) REMOTE(wid)->delay_overflows_ #define REMOTE_delay_overflows(wid) REMOTE(wid)->delay_overflows_
#define LOCAL_total_delay_overflow_time LOCAL->total_delay_overflow_time_ #define LOCAL_total_delay_overflow_time LOCAL->total_delay_overflow_time_
#define REMOTE_total_delay_overflow_time(wid) REMOTE(wid)->total_delay_overflow_time_ #define REMOTE_total_delay_overflow_time(wid) REMOTE(wid)->total_delay_overflow_time_
#define LOCAL_trail_overflows LOCAL->trail_overflows_ #define LOCAL_trail_overflows LOCAL->trail_overflows_
#define REMOTE_trail_overflows(wid) REMOTE(wid)->trail_overflows_ #define REMOTE_trail_overflows(wid) REMOTE(wid)->trail_overflows_
#define LOCAL_total_trail_overflow_time LOCAL->total_trail_overflow_time_ #define LOCAL_total_trail_overflow_time LOCAL->total_trail_overflow_time_
#define REMOTE_total_trail_overflow_time(wid) REMOTE(wid)->total_trail_overflow_time_ #define REMOTE_total_trail_overflow_time(wid) REMOTE(wid)->total_trail_overflow_time_
#define LOCAL_atom_table_overflows LOCAL->atom_table_overflows_ #define LOCAL_atom_table_overflows LOCAL->atom_table_overflows_
#define REMOTE_atom_table_overflows(wid) REMOTE(wid)->atom_table_overflows_ #define REMOTE_atom_table_overflows(wid) REMOTE(wid)->atom_table_overflows_
#define LOCAL_total_atom_table_overflow_time LOCAL->total_atom_table_overflow_time_ #define LOCAL_total_atom_table_overflow_time LOCAL->total_atom_table_overflow_time_
#define REMOTE_total_atom_table_overflow_time(wid) REMOTE(wid)->total_atom_table_overflow_time_ #define REMOTE_total_atom_table_overflow_time(wid) REMOTE(wid)->total_atom_table_overflow_time_
#ifdef LOAD_DYLD #ifdef LOAD_DYLD
#define LOCAL_dl_errno LOCAL->dl_errno_ #define LOCAL_dl_errno LOCAL->dl_errno_
#define REMOTE_dl_errno(wid) REMOTE(wid)->dl_errno_ #define REMOTE_dl_errno(wid) REMOTE(wid)->dl_errno_
#endif #endif
#ifdef LOW_LEVEL_TRACER #ifdef LOW_LEVEL_TRACER
#define LOCAL_do_trace_primitives LOCAL->do_trace_primitives_ #define LOCAL_do_trace_primitives LOCAL->do_trace_primitives_
#define REMOTE_do_trace_primitives(wid) REMOTE(wid)->do_trace_primitives_ #define REMOTE_do_trace_primitives(wid) REMOTE(wid)->do_trace_primitives_
#endif #endif
#define LOCAL_ExportAtomHashChain LOCAL->ExportAtomHashChain_ #define LOCAL_ExportAtomHashChain LOCAL->ExportAtomHashChain_
#define REMOTE_ExportAtomHashChain(wid) REMOTE(wid)->ExportAtomHashChain_ #define REMOTE_ExportAtomHashChain(wid) REMOTE(wid)->ExportAtomHashChain_
#define LOCAL_ExportAtomHashTableSize LOCAL->ExportAtomHashTableSize_ #define LOCAL_ExportAtomHashTableSize LOCAL->ExportAtomHashTableSize_
#define REMOTE_ExportAtomHashTableSize(wid) REMOTE(wid)->ExportAtomHashTableSize_ #define REMOTE_ExportAtomHashTableSize(wid) REMOTE(wid)->ExportAtomHashTableSize_
#define LOCAL_ExportAtomHashTableNum LOCAL->ExportAtomHashTableNum_ #define LOCAL_ExportAtomHashTableNum LOCAL->ExportAtomHashTableNum_
#define REMOTE_ExportAtomHashTableNum(wid) REMOTE(wid)->ExportAtomHashTableNum_ #define REMOTE_ExportAtomHashTableNum(wid) REMOTE(wid)->ExportAtomHashTableNum_
#define LOCAL_ExportFunctorHashChain LOCAL->ExportFunctorHashChain_ #define LOCAL_ExportFunctorHashChain LOCAL->ExportFunctorHashChain_
#define REMOTE_ExportFunctorHashChain(wid) REMOTE(wid)->ExportFunctorHashChain_ #define REMOTE_ExportFunctorHashChain(wid) REMOTE(wid)->ExportFunctorHashChain_
#define LOCAL_ExportFunctorHashTableSize LOCAL->ExportFunctorHashTableSize_ #define LOCAL_ExportFunctorHashTableSize LOCAL->ExportFunctorHashTableSize_
#define REMOTE_ExportFunctorHashTableSize(wid) REMOTE(wid)->ExportFunctorHashTableSize_ #define REMOTE_ExportFunctorHashTableSize(wid) REMOTE(wid)->ExportFunctorHashTableSize_
#define LOCAL_ExportFunctorHashTableNum LOCAL->ExportFunctorHashTableNum_ #define LOCAL_ExportFunctorHashTableNum LOCAL->ExportFunctorHashTableNum_
#define REMOTE_ExportFunctorHashTableNum(wid) REMOTE(wid)->ExportFunctorHashTableNum_ #define REMOTE_ExportFunctorHashTableNum(wid) REMOTE(wid)->ExportFunctorHashTableNum_
#define LOCAL_ExportPredEntryHashChain LOCAL->ExportPredEntryHashChain_ #define LOCAL_ExportPredEntryHashChain LOCAL->ExportPredEntryHashChain_
#define REMOTE_ExportPredEntryHashChain(wid) REMOTE(wid)->ExportPredEntryHashChain_ #define REMOTE_ExportPredEntryHashChain(wid) REMOTE(wid)->ExportPredEntryHashChain_
#define LOCAL_ExportPredEntryHashTableSize LOCAL->ExportPredEntryHashTableSize_ #define LOCAL_ExportPredEntryHashTableSize LOCAL->ExportPredEntryHashTableSize_
#define REMOTE_ExportPredEntryHashTableSize(wid) REMOTE(wid)->ExportPredEntryHashTableSize_ #define REMOTE_ExportPredEntryHashTableSize(wid) REMOTE(wid)->ExportPredEntryHashTableSize_
#define LOCAL_ExportPredEntryHashTableNum LOCAL->ExportPredEntryHashTableNum_ #define LOCAL_ExportPredEntryHashTableNum LOCAL->ExportPredEntryHashTableNum_
#define REMOTE_ExportPredEntryHashTableNum(wid) REMOTE(wid)->ExportPredEntryHashTableNum_ #define REMOTE_ExportPredEntryHashTableNum(wid) REMOTE(wid)->ExportPredEntryHashTableNum_
#define LOCAL_ExportDBRefHashChain LOCAL->ExportDBRefHashChain_ #define LOCAL_ExportDBRefHashChain LOCAL->ExportDBRefHashChain_
#define REMOTE_ExportDBRefHashChain(wid) REMOTE(wid)->ExportDBRefHashChain_ #define REMOTE_ExportDBRefHashChain(wid) REMOTE(wid)->ExportDBRefHashChain_
#define LOCAL_ExportDBRefHashTableSize LOCAL->ExportDBRefHashTableSize_ #define LOCAL_ExportDBRefHashTableSize LOCAL->ExportDBRefHashTableSize_
#define REMOTE_ExportDBRefHashTableSize(wid) REMOTE(wid)->ExportDBRefHashTableSize_ #define REMOTE_ExportDBRefHashTableSize(wid) REMOTE(wid)->ExportDBRefHashTableSize_
#define LOCAL_ExportDBRefHashTableNum LOCAL->ExportDBRefHashTableNum_ #define LOCAL_ExportDBRefHashTableNum LOCAL->ExportDBRefHashTableNum_
#define REMOTE_ExportDBRefHashTableNum(wid) REMOTE(wid)->ExportDBRefHashTableNum_ #define REMOTE_ExportDBRefHashTableNum(wid) REMOTE(wid)->ExportDBRefHashTableNum_
#define LOCAL_ImportAtomHashChain LOCAL->ImportAtomHashChain_ #define LOCAL_ImportAtomHashChain LOCAL->ImportAtomHashChain_
#define REMOTE_ImportAtomHashChain(wid) REMOTE(wid)->ImportAtomHashChain_ #define REMOTE_ImportAtomHashChain(wid) REMOTE(wid)->ImportAtomHashChain_
#define LOCAL_ImportAtomHashTableSize LOCAL->ImportAtomHashTableSize_ #define LOCAL_ImportAtomHashTableSize LOCAL->ImportAtomHashTableSize_
#define REMOTE_ImportAtomHashTableSize(wid) REMOTE(wid)->ImportAtomHashTableSize_ #define REMOTE_ImportAtomHashTableSize(wid) REMOTE(wid)->ImportAtomHashTableSize_
#define LOCAL_ImportAtomHashTableNum LOCAL->ImportAtomHashTableNum_ #define LOCAL_ImportAtomHashTableNum LOCAL->ImportAtomHashTableNum_
#define REMOTE_ImportAtomHashTableNum(wid) REMOTE(wid)->ImportAtomHashTableNum_ #define REMOTE_ImportAtomHashTableNum(wid) REMOTE(wid)->ImportAtomHashTableNum_
#define LOCAL_ImportFunctorHashChain LOCAL->ImportFunctorHashChain_ #define LOCAL_ImportFunctorHashChain LOCAL->ImportFunctorHashChain_
#define REMOTE_ImportFunctorHashChain(wid) REMOTE(wid)->ImportFunctorHashChain_ #define REMOTE_ImportFunctorHashChain(wid) REMOTE(wid)->ImportFunctorHashChain_
#define LOCAL_ImportFunctorHashTableSize LOCAL->ImportFunctorHashTableSize_ #define LOCAL_ImportFunctorHashTableSize LOCAL->ImportFunctorHashTableSize_
#define REMOTE_ImportFunctorHashTableSize(wid) REMOTE(wid)->ImportFunctorHashTableSize_ #define REMOTE_ImportFunctorHashTableSize(wid) REMOTE(wid)->ImportFunctorHashTableSize_
#define LOCAL_ImportFunctorHashTableNum LOCAL->ImportFunctorHashTableNum_ #define LOCAL_ImportFunctorHashTableNum LOCAL->ImportFunctorHashTableNum_
#define REMOTE_ImportFunctorHashTableNum(wid) REMOTE(wid)->ImportFunctorHashTableNum_ #define REMOTE_ImportFunctorHashTableNum(wid) REMOTE(wid)->ImportFunctorHashTableNum_
#define LOCAL_ImportOPCODEHashChain LOCAL->ImportOPCODEHashChain_ #define LOCAL_ImportOPCODEHashChain LOCAL->ImportOPCODEHashChain_
#define REMOTE_ImportOPCODEHashChain(wid) REMOTE(wid)->ImportOPCODEHashChain_ #define REMOTE_ImportOPCODEHashChain(wid) REMOTE(wid)->ImportOPCODEHashChain_
#define LOCAL_ImportOPCODEHashTableSize LOCAL->ImportOPCODEHashTableSize_ #define LOCAL_ImportOPCODEHashTableSize LOCAL->ImportOPCODEHashTableSize_
#define REMOTE_ImportOPCODEHashTableSize(wid) REMOTE(wid)->ImportOPCODEHashTableSize_ #define REMOTE_ImportOPCODEHashTableSize(wid) REMOTE(wid)->ImportOPCODEHashTableSize_
#define LOCAL_ImportPredEntryHashChain LOCAL->ImportPredEntryHashChain_ #define LOCAL_ImportPredEntryHashChain LOCAL->ImportPredEntryHashChain_
#define REMOTE_ImportPredEntryHashChain(wid) REMOTE(wid)->ImportPredEntryHashChain_ #define REMOTE_ImportPredEntryHashChain(wid) REMOTE(wid)->ImportPredEntryHashChain_
#define LOCAL_ImportPredEntryHashTableSize LOCAL->ImportPredEntryHashTableSize_ #define LOCAL_ImportPredEntryHashTableSize LOCAL->ImportPredEntryHashTableSize_
#define REMOTE_ImportPredEntryHashTableSize(wid) REMOTE(wid)->ImportPredEntryHashTableSize_ #define REMOTE_ImportPredEntryHashTableSize(wid) REMOTE(wid)->ImportPredEntryHashTableSize_
#define LOCAL_ImportPredEntryHashTableNum LOCAL->ImportPredEntryHashTableNum_ #define LOCAL_ImportPredEntryHashTableNum LOCAL->ImportPredEntryHashTableNum_
#define REMOTE_ImportPredEntryHashTableNum(wid) REMOTE(wid)->ImportPredEntryHashTableNum_ #define REMOTE_ImportPredEntryHashTableNum(wid) REMOTE(wid)->ImportPredEntryHashTableNum_
#define LOCAL_ImportDBRefHashChain LOCAL->ImportDBRefHashChain_ #define LOCAL_ImportDBRefHashChain LOCAL->ImportDBRefHashChain_
#define REMOTE_ImportDBRefHashChain(wid) REMOTE(wid)->ImportDBRefHashChain_ #define REMOTE_ImportDBRefHashChain(wid) REMOTE(wid)->ImportDBRefHashChain_
#define LOCAL_ImportDBRefHashTableSize LOCAL->ImportDBRefHashTableSize_ #define LOCAL_ImportDBRefHashTableSize LOCAL->ImportDBRefHashTableSize_
#define REMOTE_ImportDBRefHashTableSize(wid) REMOTE(wid)->ImportDBRefHashTableSize_ #define REMOTE_ImportDBRefHashTableSize(wid) REMOTE(wid)->ImportDBRefHashTableSize_
#define LOCAL_ImportDBRefHashTableNum LOCAL->ImportDBRefHashTableNum_ #define LOCAL_ImportDBRefHashTableNum LOCAL->ImportDBRefHashTableNum_
#define REMOTE_ImportDBRefHashTableNum(wid) REMOTE(wid)->ImportDBRefHashTableNum_ #define REMOTE_ImportDBRefHashTableNum(wid) REMOTE(wid)->ImportDBRefHashTableNum_
#define LOCAL_ImportFAILCODE LOCAL->ImportFAILCODE_ #define LOCAL_ImportFAILCODE LOCAL->ImportFAILCODE_
#define REMOTE_ImportFAILCODE(wid) REMOTE(wid)->ImportFAILCODE_ #define REMOTE_ImportFAILCODE(wid) REMOTE(wid)->ImportFAILCODE_
#define LOCAL_ibnds LOCAL->ibnds_ #define LOCAL_ibnds LOCAL->ibnds_
#define REMOTE_ibnds(wid) REMOTE(wid)->ibnds_ #define REMOTE_ibnds(wid) REMOTE(wid)->ibnds_
#define LOCAL_exo_it LOCAL->exo_it_ #define LOCAL_exo_it LOCAL->exo_it_
#define REMOTE_exo_it(wid) REMOTE(wid)->exo_it_ #define REMOTE_exo_it(wid) REMOTE(wid)->exo_it_
#define LOCAL_exo_base LOCAL->exo_base_ #define LOCAL_exo_base LOCAL->exo_base_
#define REMOTE_exo_base(wid) REMOTE(wid)->exo_base_ #define REMOTE_exo_base(wid) REMOTE(wid)->exo_base_
#define LOCAL_exo_arity LOCAL->exo_arity_ #define LOCAL_exo_arity LOCAL->exo_arity_
#define REMOTE_exo_arity(wid) REMOTE(wid)->exo_arity_ #define REMOTE_exo_arity(wid) REMOTE(wid)->exo_arity_
#define LOCAL_exo_arg LOCAL->exo_arg_ #define LOCAL_exo_arg LOCAL->exo_arg_
#define REMOTE_exo_arg(wid) REMOTE(wid)->exo_arg_ #define REMOTE_exo_arg(wid) REMOTE(wid)->exo_arg_
#define LOCAL_search_atoms LOCAL->search_atoms_ #define LOCAL_search_atoms LOCAL->search_atoms_
#define REMOTE_search_atoms(wid) REMOTE(wid)->search_atoms_ #define REMOTE_search_atoms(wid) REMOTE(wid)->search_atoms_
#define LOCAL_SearchPreds LOCAL->SearchPreds_ #define LOCAL_SearchPreds LOCAL->SearchPreds_
#define REMOTE_SearchPreds(wid) REMOTE(wid)->SearchPreds_ #define REMOTE_SearchPreds(wid) REMOTE(wid)->SearchPreds_
#define LOCAL_CurSlot LOCAL->CurSlot_ #define LOCAL_CurSlot LOCAL->CurSlot_
#define REMOTE_CurSlot(wid) REMOTE(wid)->CurSlot_ #define REMOTE_CurSlot(wid) REMOTE(wid)->CurSlot_
#define LOCAL_FrozenHandles LOCAL->FrozenHandles_ #define LOCAL_FrozenHandles LOCAL->FrozenHandles_
#define REMOTE_FrozenHandles(wid) REMOTE(wid)->FrozenHandles_ #define REMOTE_FrozenHandles(wid) REMOTE(wid)->FrozenHandles_
#define LOCAL_NSlots LOCAL->NSlots_ #define LOCAL_NSlots LOCAL->NSlots_
#define REMOTE_NSlots(wid) REMOTE(wid)->NSlots_ #define REMOTE_NSlots(wid) REMOTE(wid)->NSlots_
#define LOCAL_SlotBase LOCAL->SlotBase_ #define LOCAL_SlotBase LOCAL->SlotBase_
#define REMOTE_SlotBase(wid) REMOTE(wid)->SlotBase_ #define REMOTE_SlotBase(wid) REMOTE(wid)->SlotBase_
#define LOCAL_Mutexes LOCAL->Mutexes_ #define LOCAL_Mutexes LOCAL->Mutexes_
#define REMOTE_Mutexes(wid) REMOTE(wid)->Mutexes_ #define REMOTE_Mutexes(wid) REMOTE(wid)->Mutexes_
#define LOCAL_SourceModule LOCAL->SourceModule_ #define LOCAL_SourceModule LOCAL->SourceModule_
#define REMOTE_SourceModule(wid) REMOTE(wid)->SourceModule_ #define REMOTE_SourceModule(wid) REMOTE(wid)->SourceModule_
#define LOCAL_Including LOCAL->Including_ #define LOCAL_Including LOCAL->Including_
#define REMOTE_Including(wid) REMOTE(wid)->Including_ #define REMOTE_Including(wid) REMOTE(wid)->Including_
#define LOCAL_MAX_SIZE LOCAL->MAX_SIZE_ #define LOCAL_MAX_SIZE LOCAL->MAX_SIZE_
#define REMOTE_MAX_SIZE(wid) REMOTE(wid)->MAX_SIZE_ #define REMOTE_MAX_SIZE(wid) REMOTE(wid)->MAX_SIZE_
#define LOCAL_LastWTime LOCAL->LastWTime_ #define LOCAL_LastWTime LOCAL->LastWTime_
#define REMOTE_LastWTime(wid) REMOTE(wid)->LastWTime_ #define REMOTE_LastWTime(wid) REMOTE(wid)->LastWTime_
#define LOCAL_shared LOCAL->shared_ #define LOCAL_shared LOCAL->shared_
#define REMOTE_shared(wid) REMOTE(wid)->shared_ #define REMOTE_shared(wid) REMOTE(wid)->shared_

View File

@ -1,144 +1,144 @@
/* This file, hglobals.h, was generated automatically by "yap -L misc/buildlocalglobal" /* This file, hglobals.h, was generated automatically by "yap -L misc/buildlocalglobal"
please do not update, update H/GLOBALS instead */ please do not update, update H/GLOBALS instead */
// //
// File defining fields in the Yap_GLOBAL global structure // File defining fields in the Yap_GLOBAL global structure
// //
// these fields used to spread all over the place, because they must be used in 3 ways: // these fields used to spread all over the place, because they must be used in 3 ways:
// - they must be defined somewhere // - they must be defined somewhere
// - they have an #ifdef to get a shorter name // - they have an #ifdef to get a shorter name
// - they must be initialised somewhere // - they must be initialised somewhere
// - they may be of interest to restore // - they may be of interest to restore
// //
// The defs include 3+ components: // The defs include 3+ components:
// Type // Type
// name in structured / global name // name in structured / global name
// init code (optional) // init code (optional)
// restore code (optional) // restore code (optional)
// //
// Stuff that must be shared by all threads or workers // Stuff that must be shared by all threads or workers
// initialization: tell whether the system has been initialised and by whom. // initialization: tell whether the system has been initialised and by whom.
EXTERNAL int GLOBAL_Initialised; EXTERNAL int GLOBAL_Initialised;
EXTERNAL int GLOBAL_InitialisedFromPL; EXTERNAL int GLOBAL_InitialisedFromPL;
EXTERNAL int GLOBAL_PL_Argc; EXTERNAL int GLOBAL_PL_Argc;
EXTERNAL char** GLOBAL_PL_Argv; EXTERNAL char** GLOBAL_PL_Argv;
EXTERNAL bool GLOBAL_FAST_BOOT_FLAG; EXTERNAL bool GLOBAL_FAST_BOOT_FLAG;
// halt hooks // halt hooks
EXTERNAL struct halt_hook* GLOBAL_HaltHooks; EXTERNAL struct halt_hook* GLOBAL_HaltHooks;
EXTERNAL fptr_t GLOBAL_JIT_finalizer; EXTERNAL fptr_t GLOBAL_JIT_finalizer;
// stack overflow expansion/gc control // stack overflow expansion/gc control
EXTERNAL int GLOBAL_AllowLocalExpansion; EXTERNAL int GLOBAL_AllowLocalExpansion;
EXTERNAL int GLOBAL_AllowGlobalExpansion; EXTERNAL int GLOBAL_AllowGlobalExpansion;
EXTERNAL int GLOBAL_AllowTrailExpansion; EXTERNAL int GLOBAL_AllowTrailExpansion;
EXTERNAL UInt GLOBAL_SizeOfOverflow; EXTERNAL UInt GLOBAL_SizeOfOverflow;
// amount of space recovered in all garbage collections // amount of space recovered in all garbage collections
EXTERNAL UInt GLOBAL_AGcThreshold; EXTERNAL UInt GLOBAL_AGcThreshold;
EXTERNAL Agc_hook GLOBAL_AGCHook; EXTERNAL Agc_hook GLOBAL_AGCHook;
/* multi-thread support */ /* multi-thread support */
#if THREADS #if THREADS
/* number of threads and processes in system */ /* number of threads and processes in system */
EXTERNAL UInt GLOBAL_NOfThreads; EXTERNAL UInt GLOBAL_NOfThreads;
/* number of threads created since start */ /* number of threads created since start */
EXTERNAL UInt GLOBAL_NOfThreadsCreated; EXTERNAL UInt GLOBAL_NOfThreadsCreated;
/* total run time for dead threads */ /* total run time for dead threads */
EXTERNAL UInt GLOBAL_ThreadsTotalTime; EXTERNAL UInt GLOBAL_ThreadsTotalTime;
// Threads Array // Threads Array
EXTERNAL lockvar GLOBAL_ThreadHandlesLock; EXTERNAL lockvar GLOBAL_ThreadHandlesLock;
#endif #endif
#if defined(YAPOR) || defined(THREADS) #if defined(YAPOR) || defined(THREADS)
// protect long critical regions // protect long critical regions
EXTERNAL lockvar GLOBAL_BGL; EXTERNAL lockvar GLOBAL_BGL;
#endif #endif
#if defined(YAPOR) || defined(TABLING) #if defined(YAPOR) || defined(TABLING)
EXTERNAL struct global_optyap_data GLOBAL_optyap_data; EXTERNAL struct global_optyap_data GLOBAL_optyap_data;
#endif /* YAPOR || TABLING */ #endif /* YAPOR || TABLING */
// whether Yap is responsible for signal handling // whether Yap is responsible for signal handling
EXTERNAL int GLOBAL_PrologShouldHandleInterrupts; EXTERNAL int GLOBAL_PrologShouldHandleInterrupts;
/* This is the guy who actually started the system, and who has the correct registers */ /* This is the guy who actually started the system, and who has the correct registers */
#if defined(THREADS) #if defined(THREADS)
EXTERNAL pthread_t GLOBAL_master_thread; EXTERNAL pthread_t GLOBAL_master_thread;
EXTERNAL struct thread_mbox* GLOBAL_named_mboxes; EXTERNAL struct thread_mbox* GLOBAL_named_mboxes;
EXTERNAL lockvar GLOBAL_mboxq_lock; EXTERNAL lockvar GLOBAL_mboxq_lock;
EXTERNAL UInt GLOBAL_mbox_count; EXTERNAL UInt GLOBAL_mbox_count;
EXTERNAL struct swi_mutex* GLOBAL_WithMutex; EXTERNAL struct swi_mutex* GLOBAL_WithMutex;
#endif /* THREADS */ #endif /* THREADS */
// streams // streams
EXTERNAL struct stream_desc* GLOBAL_Stream; EXTERNAL struct stream_desc* GLOBAL_Stream;
#if defined(THREADS)||defined(YAPOR) #if defined(THREADS)||defined(YAPOR)
EXTERNAL lockvar GLOBAL_StreamDescLock; EXTERNAL lockvar GLOBAL_StreamDescLock;
#endif #endif
// access to yap initial arguments // access to yap initial arguments
EXTERNAL char** GLOBAL_argv; EXTERNAL char** GLOBAL_argv;
EXTERNAL int GLOBAL_argc; EXTERNAL int GLOBAL_argc;
// extensions to Terms // extensions to Terms
#ifdef COROUTINING #ifdef COROUTINING
/* array with the ops for your favourite extensions */ /* array with the ops for your favourite extensions */
EXTERNAL ext_op GLOBAL_attas[attvars_ext+1]; EXTERNAL ext_op GLOBAL_attas[attvars_ext+1];
#endif #endif
// agc.c // agc.c
EXTERNAL int GLOBAL_agc_calls; EXTERNAL int GLOBAL_agc_calls;
EXTERNAL YAP_ULONG_LONG GLOBAL_agc_collected; EXTERNAL YAP_ULONG_LONG GLOBAL_agc_collected;
/* total time spent in GC */ /* total time spent in GC */
EXTERNAL Int GLOBAL_tot_agc_time; EXTERNAL Int GLOBAL_tot_agc_time;
/* number of heap objects in all garbage collections */ /* number of heap objects in all garbage collections */
EXTERNAL Int GLOBAL_tot_agc_recovered; EXTERNAL Int GLOBAL_tot_agc_recovered;
//arrays.c //arrays.c
#if HAVE_MMAP #if HAVE_MMAP
EXTERNAL struct MMAP_ARRAY_BLOCK* GLOBAL_mmap_arrays; EXTERNAL struct MMAP_ARRAY_BLOCK* GLOBAL_mmap_arrays;
#endif #endif
#ifdef DEBUG #ifdef DEBUG
//computils.c //computils.c
EXTERNAL char GLOBAL_Option[20]; EXTERNAL char GLOBAL_Option[20];
EXTERNAL YP_FILE* GLOBAL_logfile; EXTERNAL YP_FILE* GLOBAL_logfile;
//init.c //init.c
//int output_msg =FALSE //int output_msg =FALSE
#endif #endif
#if defined(COFF) || defined(A_OUT) #if defined(COFF) || defined(A_OUT)
// loada_coff.c && load_aout.c // loada_coff.c && load_aout.c
EXTERNAL char GLOBAL_Executable[YAP_FILENAME_MAX]; EXTERNAL char GLOBAL_Executable[YAP_FILENAME_MAX];
#endif #endif
EXTERNAL int GLOBAL_OpaqueHandlersCount; EXTERNAL int GLOBAL_OpaqueHandlersCount;
EXTERNAL struct opaque_handler_struct* GLOBAL_OpaqueHandlers; EXTERNAL struct YAP_opaque_handler_struct* GLOBAL_OpaqueHandlers;
#if __simplescalar__ #if __simplescalar__
EXTERNAL char GLOBAL_pwd[YAP_FILENAME_MAX]; EXTERNAL char GLOBAL_pwd[YAP_FILENAME_MAX];
#endif #endif
//udi.c //udi.c
//struct udi_control_block RtreeCmd void //struct udi_control_block RtreeCmd void
EXTERNAL const char* GLOBAL_RestoreFile; EXTERNAL const char* GLOBAL_RestoreFile;
//gprof.c //gprof.c
EXTERNAL Int GLOBAL_ProfCalls; EXTERNAL Int GLOBAL_ProfCalls;
EXTERNAL Int GLOBAL_ProfGCs; EXTERNAL Int GLOBAL_ProfGCs;
EXTERNAL Int GLOBAL_ProfHGrows; EXTERNAL Int GLOBAL_ProfHGrows;
EXTERNAL Int GLOBAL_ProfSGrows; EXTERNAL Int GLOBAL_ProfSGrows;
EXTERNAL Int GLOBAL_ProfMallocs; EXTERNAL Int GLOBAL_ProfMallocs;
EXTERNAL Int GLOBAL_ProfIndexing; EXTERNAL Int GLOBAL_ProfIndexing;
EXTERNAL Int GLOBAL_ProfOn; EXTERNAL Int GLOBAL_ProfOn;
EXTERNAL Int GLOBAL_ProfOns; EXTERNAL Int GLOBAL_ProfOns;
EXTERNAL struct RB_red_blk_node* GLOBAL_ProfilerRoot; EXTERNAL struct RB_red_blk_node* GLOBAL_ProfilerRoot;
EXTERNAL struct RB_red_blk_node* GLOBAL_ProfilerNil; EXTERNAL struct RB_red_blk_node* GLOBAL_ProfilerNil;
EXTERNAL char* GLOBAL_DIRNAME; EXTERNAL char* GLOBAL_DIRNAME;
#if LOW_PROF #if LOW_PROF
EXTERNAL int GLOBAL_ProfilerOn; EXTERNAL int GLOBAL_ProfilerOn;
EXTERNAL FILE* GLOBAL_FProf; EXTERNAL FILE* GLOBAL_FProf;
EXTERNAL FILE* GLOBAL_FPreds; EXTERNAL FILE* GLOBAL_FPreds;
#endif /* LOW_PROF */ #endif /* LOW_PROF */
// Mutexes // Mutexes
#if THREADS #if THREADS
EXTERNAL struct swi_mutex* GLOBAL_FreeMutexes; EXTERNAL struct swi_mutex* GLOBAL_FreeMutexes;
EXTERNAL struct swi_mutex* GLOBAL_mutex_backbone; EXTERNAL struct swi_mutex* GLOBAL_mutex_backbone;
EXTERNAL lockvar GLOBAL_MUT_ACCESS; EXTERNAL lockvar GLOBAL_MUT_ACCESS;
#endif #endif
EXTERNAL char* GLOBAL_Home; EXTERNAL char* GLOBAL_Home;
/* ISO char conversion: I will make no comments */ /* ISO char conversion: I will make no comments */
EXTERNAL char* GLOBAL_CharConversionTable; EXTERNAL char* GLOBAL_CharConversionTable;
EXTERNAL char* GLOBAL_CharConversionTable2; EXTERNAL char* GLOBAL_CharConversionTable2;
/* max priority */ /* max priority */
EXTERNAL int GLOBAL_MaxPriority; EXTERNAL int GLOBAL_MaxPriority;
/// alias table access /// alias table access
EXTERNAL struct AliasDescS* GLOBAL_FileAliases; EXTERNAL struct AliasDescS* GLOBAL_FileAliases;
EXTERNAL int GLOBAL_NOfFileAliases; EXTERNAL int GLOBAL_NOfFileAliases;
EXTERNAL int GLOBAL_SzOfFileAliases; EXTERNAL int GLOBAL_SzOfFileAliases;
EXTERNAL struct vfs* GLOBAL_VFS; EXTERNAL struct vfs* GLOBAL_VFS;

View File

@ -1,295 +1,297 @@
/* This file, d0hstruct.h, was generated automatically by "yap -L misc/buildlocalglobal" /* This file, d0hstruct.h, was generated automatically by "yap -L misc/buildlocalglobal"
please do not update, update H/HEAPFIELDS instead */ please do not update, update H/HEAPFIELDS instead */
// //
// File defining fields in the Yap_heap_codes global structure // File defining fields in the Yap_heap_codes global structure
// //
// these fields used to spread all over the place, because they must be used in 4 ways: // these fields used to spread all over the place, because they must be used in 4 ways:
// - they must be defined somewhere // - they must be defined somewhere
// - they have an #ifdef to get a shorter name // - they have an #ifdef to get a shorter name
// - they must be initialised somewhere // - they must be initialised somewhere
// - they must be restorable and collectable (from the atom gc). // - they must be restorable and collectable (from the atom gc).
// //
// //
// The defs include 4+ components: // The defs include 4+ components:
// Type // Type
// name in structured // name in structured
// global name // global name
// init code and restore code (optional) // init code and restore code (optional)
// //
// //
// //
// MkAT (MkAtomTerm) cvts from a predefined atom to a term // MkAT (MkAtomTerm) cvts from a predefined atom to a term
// MkPred constructs a pred_entry // MkPred constructs a pred_entry
// MkOp gets an opcode // MkOp gets an opcode
// void does nothing // void does nothing
// =VALUE inits as VALUE // =VALUE inits as VALUE
// Init... sets up call to InitFunc // Init... sets up call to InitFunc
// Restore... sets up call to RestoreFunc // Restore... sets up call to RestoreFunc
// //
/* memory management */ /* memory management */
EXTERNAL UInt Yap_HoleSize; EXTERNAL UInt Yap_HoleSize;
#if USE_DL_MALLOC #if USE_DL_MALLOC
EXTERNAL struct malloc_state *Yap_av; EXTERNAL struct malloc_state *Yap_av;
EXTERNAL struct memory_hole Yap_MemoryHoles[MAX_DLMALLOC_HOLES]; EXTERNAL struct memory_hole Yap_MemoryHoles[MAX_DLMALLOC_HOLES];
EXTERNAL UInt Yap_NOfMemoryHoles; EXTERNAL UInt Yap_NOfMemoryHoles;
#if defined(YAPOR) || defined(THREADS) #if defined(YAPOR) || defined(THREADS)
EXTERNAL lockvar DLMallocLock; EXTERNAL lockvar DLMallocLock;
#endif #endif
#endif #endif
#if USE_DL_MALLOC || (USE_SYSTEM_MALLOC && HAVE_MALLINFO) #if USE_DL_MALLOC || (USE_SYSTEM_MALLOC && HAVE_MALLINFO)
#ifndef HeapUsed #ifndef HeapUsed
#define HeapUsed Yap_givemallinfo() #define HeapUsed Yap_givemallinfo()
#endif #endif
EXTERNAL Int NotHeapUsed; EXTERNAL Int NotHeapUsed;
#else #else
EXTERNAL Int HeapUsed; EXTERNAL Int HeapUsed;
#endif #endif
EXTERNAL Int HeapMax; EXTERNAL Int HeapMax;
EXTERNAL ADDR HeapTop; EXTERNAL ADDR HeapTop;
EXTERNAL ADDR HeapLim; EXTERNAL ADDR HeapLim;
EXTERNAL struct FREEB *FreeBlocks; EXTERNAL struct FREEB *FreeBlocks;
#if defined(YAPOR) || defined(THREADS) #if defined(YAPOR) || defined(THREADS)
EXTERNAL lockvar FreeBlocksLock; EXTERNAL lockvar FreeBlocksLock;
EXTERNAL lockvar HeapUsedLock; EXTERNAL lockvar HeapUsedLock;
EXTERNAL lockvar HeapTopLock; EXTERNAL lockvar HeapTopLock;
EXTERNAL int HeapTopOwner; EXTERNAL int HeapTopOwner;
#endif #endif
EXTERNAL UInt MaxStack; EXTERNAL UInt MaxStack;
EXTERNAL UInt MaxTrail; EXTERNAL UInt MaxTrail;
/* execution info */ /* execution info */
/* OPCODE REVERSE TABLE, needed to recover op tables */ /* OPCODE REVERSE TABLE, needed to recover op tables */
#if USE_THREADED_CODE #if USE_THREADED_CODE
EXTERNAL op_entry *OP_RTABLE; EXTERNAL op_entry *OP_RTABLE;
#endif #endif
/* popular opcodes */ /* popular opcodes */
EXTERNAL OPCODE EXECUTE_CPRED_OP_CODE; EXTERNAL OPCODE EXECUTE_CPRED_OP_CODE;
EXTERNAL OPCODE EXPAND_OP_CODE; EXTERNAL OPCODE EXPAND_OP_CODE;
EXTERNAL OPCODE FAIL_OPCODE; EXTERNAL OPCODE FAIL_OPCODE;
EXTERNAL OPCODE INDEX_OPCODE; EXTERNAL OPCODE INDEX_OPCODE;
EXTERNAL OPCODE LOCKPRED_OPCODE; EXTERNAL OPCODE LOCKPRED_OPCODE;
EXTERNAL OPCODE ORLAST_OPCODE; EXTERNAL OPCODE ORLAST_OPCODE;
EXTERNAL OPCODE UNDEF_OPCODE; EXTERNAL OPCODE UNDEF_OPCODE;
EXTERNAL OPCODE RETRY_USERC_OPCODE; EXTERNAL OPCODE RETRY_USERC_OPCODE;
EXTERNAL OPCODE EXECUTE_CPRED_OPCODE; EXTERNAL OPCODE EXECUTE_CPRED_OPCODE;
/* atom tables */ /* atom tables */
EXTERNAL UInt NOfAtoms; EXTERNAL UInt NOfAtoms;
EXTERNAL UInt AtomHashTableSize; EXTERNAL UInt AtomHashTableSize;
EXTERNAL UInt WideAtomHashTableSize; EXTERNAL UInt WideAtomHashTableSize;
EXTERNAL UInt NOfWideAtoms; EXTERNAL UInt NOfWideAtoms;
EXTERNAL AtomHashEntry INVISIBLECHAIN; EXTERNAL AtomHashEntry INVISIBLECHAIN;
EXTERNAL AtomHashEntry *WideHashChain; EXTERNAL AtomHashEntry *WideHashChain;
EXTERNAL AtomHashEntry *HashChain; EXTERNAL AtomHashEntry *HashChain;
/* use atom defs here */ /* use atom defs here */
#include "tatoms.h" #include "tatoms.h"
#ifdef EUROTRA #ifdef EUROTRA
EXTERNAL Term TermDollarU; EXTERNAL Term TermDollarU;
#endif #endif
//modules //modules
EXTERNAL Term USER_MODULE; EXTERNAL Term USER_MODULE;
EXTERNAL Term IDB_MODULE; EXTERNAL Term IDB_MODULE;
EXTERNAL Term ATTRIBUTES_MODULE; EXTERNAL Term ATTRIBUTES_MODULE;
EXTERNAL Term CHARSIO_MODULE; EXTERNAL Term CHARSIO_MODULE;
EXTERNAL Term CHTYPE_MODULE; EXTERNAL Term CHTYPE_MODULE;
EXTERNAL Term TERMS_MODULE; EXTERNAL Term TERMS_MODULE;
EXTERNAL Term SYSTEM_MODULE; EXTERNAL Term SYSTEM_MODULE;
EXTERNAL Term READUTIL_MODULE; EXTERNAL Term READUTIL_MODULE;
EXTERNAL Term HACKS_MODULE; EXTERNAL Term HACKS_MODULE;
EXTERNAL Term ARG_MODULE; EXTERNAL Term ARG_MODULE;
EXTERNAL Term GLOBALS_MODULE; EXTERNAL Term GLOBALS_MODULE;
EXTERNAL Term SWI_MODULE; EXTERNAL Term SWI_MODULE;
EXTERNAL Term DBLOAD_MODULE; EXTERNAL Term DBLOAD_MODULE;
EXTERNAL Term RANGE_MODULE; EXTERNAL Term RANGE_MODULE;
EXTERNAL Term ERROR_MODULE; EXTERNAL Term ERROR_MODULE;
// //
// Module list // Module list
// //
EXTERNAL struct mod_entry *CurrentModules; EXTERNAL struct mod_entry *CurrentModules;
// make sure we have the modules set at this point. // make sure we have the modules set at this point.
// don't actually want to define a field // don't actually want to define a field
// hidden predicates // hidden predicates
EXTERNAL Prop HIDDEN_PREDICATES; EXTERNAL Prop HIDDEN_PREDICATES;
// make sure we have the streams set at this point. // make sure we have the streams set at this point.
// don't actually want to define a field // don't actually want to define a field
EXTERNAL union flagTerm* GLOBAL_Flags; EXTERNAL union flagTerm* GLOBAL_Flags;
EXTERNAL UInt GLOBAL_flagCount; EXTERNAL UInt GLOBAL_flagCount;
/* Anderson's JIT */ /* Anderson's JIT */
EXTERNAL yap_exec_mode Yap_ExecutionMode; EXTERNAL yap_exec_mode Yap_ExecutionMode;
/* The Predicate Hash Table: fast access to predicates. */ /* The Predicate Hash Table: fast access to predicates. */
EXTERNAL UInt PredsInHashTable; EXTERNAL UInt PredsInHashTable;
EXTERNAL uint64_t PredHashTableSize; EXTERNAL uint64_t PredHashTableSize;
EXTERNAL struct pred_entry **PredHash; EXTERNAL struct pred_entry **PredHash;
#if defined(YAPOR) || defined(THREADS) #if defined(YAPOR) || defined(THREADS)
EXTERNAL rwlock_t PredHashRWLock; EXTERNAL rwlock_t PredHashRWLock;
#endif #endif
/* Well-Known Predicates */ /* Well-Known Predicates */
EXTERNAL struct pred_entry *CreepCode; EXTERNAL struct pred_entry *CreepCode;
EXTERNAL struct pred_entry *UndefCode; EXTERNAL struct pred_entry *UndefCode;
EXTERNAL struct pred_entry *SpyCode; EXTERNAL struct pred_entry *SpyCode;
EXTERNAL struct pred_entry *PredFail; EXTERNAL struct pred_entry *PredFail;
EXTERNAL struct pred_entry *PredTrue; EXTERNAL struct pred_entry *PredTrue;
#ifdef COROUTINING #ifdef COROUTINING
EXTERNAL struct pred_entry *WakeUpCode; EXTERNAL struct pred_entry *WakeUpCode;
#endif #endif
EXTERNAL struct pred_entry *PredDollarCatch; EXTERNAL struct pred_entry *PredDollarCatch;
#ifdef YAPOR #ifdef YAPOR
EXTERNAL struct pred_entry *PredGetwork; EXTERNAL struct pred_entry *PredGetwork;
#endif /* YAPOR */ #endif /* YAPOR */
EXTERNAL struct pred_entry *PredGoalExpansion; EXTERNAL struct pred_entry *PredGoalExpansion;
EXTERNAL struct pred_entry *PredHandleThrow; EXTERNAL struct pred_entry *PredHandleThrow;
EXTERNAL struct pred_entry *PredIs; EXTERNAL struct pred_entry *PredIs;
EXTERNAL struct pred_entry *PredLogUpdClause; EXTERNAL struct pred_entry *PredLogUpdClause;
EXTERNAL struct pred_entry *PredLogUpdClauseErase; EXTERNAL struct pred_entry *PredLogUpdClauseErase;
EXTERNAL struct pred_entry *PredLogUpdClause0; EXTERNAL struct pred_entry *PredLogUpdClause0;
EXTERNAL struct pred_entry *PredMetaCall; EXTERNAL struct pred_entry *PredMetaCall;
EXTERNAL struct pred_entry *PredProtectStack; EXTERNAL struct pred_entry *PredProtectStack;
EXTERNAL struct pred_entry *PredRecordedWithKey; EXTERNAL struct pred_entry *PredRecordedWithKey;
EXTERNAL struct pred_entry *PredRestoreRegs; EXTERNAL struct pred_entry *PredRestoreRegs;
EXTERNAL struct pred_entry *PredSafeCallCleanup; EXTERNAL struct pred_entry *PredSafeCallCleanup;
EXTERNAL struct pred_entry *PredStaticClause; EXTERNAL struct pred_entry *PredStaticClause;
EXTERNAL struct pred_entry *PredThrow; EXTERNAL struct pred_entry *PredThrow;
EXTERNAL struct pred_entry *PredTraceMetaCall; EXTERNAL struct pred_entry *PredTraceMetaCall;
EXTERNAL struct pred_entry *PredCommentHook; EXTERNAL struct pred_entry *PredCommentHook;
EXTERNAL struct pred_entry *PredProcedure; EXTERNAL struct pred_entry *PredProcedure;
EXTERNAL struct pred_entry *PredUndefinedQuery; EXTERNAL struct pred_entry *PredUndefinedQuery;
/* low-level tracer */ /* low-level tracer */
#ifdef LOW_LEVEL_TRACER #ifdef LOW_LEVEL_TRACER
EXTERNAL int Yap_do_low_level_trace; EXTERNAL int Yap_do_low_level_trace;
#if defined(YAPOR) || defined(THREADS) #if defined(YAPOR) || defined(THREADS)
EXTERNAL lockvar Yap_low_level_trace_lock; EXTERNAL lockvar Yap_low_level_trace_lock;
#endif #endif
#endif #endif
/* code management info */ /* code management info */
EXTERNAL UInt Yap_ClauseSpace; EXTERNAL UInt Yap_ClauseSpace;
EXTERNAL UInt Yap_IndexSpace_Tree; EXTERNAL UInt Yap_IndexSpace_Tree;
EXTERNAL UInt Yap_IndexSpace_EXT; EXTERNAL UInt Yap_IndexSpace_EXT;
EXTERNAL UInt Yap_IndexSpace_SW; EXTERNAL UInt Yap_IndexSpace_SW;
EXTERNAL UInt Yap_LUClauseSpace; EXTERNAL UInt Yap_LUClauseSpace;
EXTERNAL UInt Yap_LUIndexSpace_Tree; EXTERNAL UInt Yap_LUIndexSpace_Tree;
EXTERNAL UInt Yap_LUIndexSpace_CP; EXTERNAL UInt Yap_LUIndexSpace_CP;
EXTERNAL UInt Yap_LUIndexSpace_EXT; EXTERNAL UInt Yap_LUIndexSpace_EXT;
EXTERNAL UInt Yap_LUIndexSpace_SW; EXTERNAL UInt Yap_LUIndexSpace_SW;
/* static code: may be shared by many predicate or may be used for meta-execution */ /* static code: may be shared by many predicate or may be used for meta-execution */
EXTERNAL yamop COMMA_CODE[5]; EXTERNAL yamop COMMA_CODE[5];
EXTERNAL yamop DUMMYCODE[1]; EXTERNAL yamop DUMMYCODE[1];
EXTERNAL yamop FAILCODE[1]; EXTERNAL yamop FAILCODE[1];
EXTERNAL yamop NOCODE[1]; EXTERNAL yamop NOCODE[1];
EXTERNAL yamop ENV_FOR_TRUSTFAIL[2]; EXTERNAL yamop ENV_FOR_TRUSTFAIL[2];
EXTERNAL yamop *TRUSTFAILCODE; EXTERNAL yamop *TRUSTFAILCODE;
EXTERNAL yamop ENV_FOR_YESCODE[2]; EXTERNAL yamop ENV_FOR_YESCODE[2];
EXTERNAL yamop *YESCODE; EXTERNAL yamop *YESCODE;
EXTERNAL yamop RTRYCODE[1]; EXTERNAL yamop RTRYCODE[1];
#ifdef BEAM #ifdef BEAM
EXTERNAL yamop BEAM_RETRY_CODE[1]; EXTERNAL yamop BEAM_RETRY_CODE[1];
#endif /* BEAM */ #endif /* BEAM */
#ifdef YAPOR #ifdef YAPOR
EXTERNAL yamop GETWORK[1]; EXTERNAL yamop GETWORK[1];
EXTERNAL yamop GETWORK_SEQ[1]; EXTERNAL yamop GETWORK_SEQ[1];
EXTERNAL yamop GETWORK_FIRST_TIME[1]; EXTERNAL yamop GETWORK_FIRST_TIME[1];
#endif /* YAPOR */ #endif /* YAPOR */
#ifdef TABLING #ifdef TABLING
EXTERNAL yamop LOAD_ANSWER[1]; EXTERNAL yamop LOAD_ANSWER[1];
EXTERNAL yamop TRY_ANSWER[1]; EXTERNAL yamop TRY_ANSWER[1];
EXTERNAL yamop ANSWER_RESOLUTION[1]; EXTERNAL yamop ANSWER_RESOLUTION[1];
EXTERNAL yamop COMPLETION[1]; EXTERNAL yamop COMPLETION[1];
#ifdef THREADS_CONSUMER_SHARING #ifdef THREADS_CONSUMER_SHARING
EXTERNAL yamop ANSWER_RESOLUTION_COMPLETION[1]; EXTERNAL yamop ANSWER_RESOLUTION_COMPLETION[1];
#endif /* THREADS_CONSUMER_SHARING */ #endif /* THREADS_CONSUMER_SHARING */
#endif /* TABLING */ #endif /* TABLING */
/* */ /* */
/* PREG just before we enter $spy. We use that to find out the clause which */ /* PREG just before we enter $spy. We use that to find out the clause which */
/* was calling the debugged goal. */ /* was calling the debugged goal. */
/* */ /* */
EXTERNAL yamop *P_before_spy; EXTERNAL yamop *P_before_spy;
/* support recorded_k */ /* support recorded_k */
EXTERNAL yamop *RETRY_C_RECORDEDP_CODE; EXTERNAL yamop *RETRY_C_RECORDEDP_CODE;
EXTERNAL yamop *RETRY_C_RECORDED_K_CODE; EXTERNAL yamop *RETRY_C_RECORDED_K_CODE;
/* compiler flags */ /* compiler flags */
EXTERNAL int PROFILING; EXTERNAL int PROFILING;
EXTERNAL int CALL_COUNTING; EXTERNAL int CALL_COUNTING;
EXTERNAL int optimizer_on; EXTERNAL int optimizer_on;
EXTERNAL int compile_mode; EXTERNAL int compile_mode;
EXTERNAL int profiling; EXTERNAL int profiling;
EXTERNAL int call_counting; EXTERNAL int call_counting;
/********* whether we should try to compile array references ******************/ /********* whether we should try to compile array references ******************/
EXTERNAL int compile_arrays; EXTERNAL int compile_arrays;
/* DBTerms: pre-compiled ground terms */ /* DBTerms: pre-compiled ground terms */
#if defined(YAPOR) || defined(THREADS) #if defined(YAPOR) || defined(THREADS)
EXTERNAL lockvar DBTermsListLock; EXTERNAL lockvar DBTermsListLock;
#endif #endif
EXTERNAL struct dbterm_list *DBTermsList; EXTERNAL struct dbterm_list *DBTermsList;
/* JITI support */ /* JITI support */
EXTERNAL yamop *ExpandClausesFirst; EXTERNAL yamop *ExpandClausesFirst;
EXTERNAL yamop *ExpandClausesLast; EXTERNAL yamop *ExpandClausesLast;
EXTERNAL UInt Yap_ExpandClauses; EXTERNAL UInt Yap_ExpandClauses;
#if defined(YAPOR) || defined(THREADS) #if defined(YAPOR) || defined(THREADS)
EXTERNAL lockvar ExpandClausesListLock; EXTERNAL lockvar ExpandClausesListLock;
EXTERNAL lockvar OpListLock; EXTERNAL lockvar OpListLock;
#endif #endif
/* instrumentation */ /* instrumentation */
#ifdef DEBUG #ifdef DEBUG
EXTERNAL UInt Yap_NewCps; EXTERNAL UInt Yap_NewCps;
EXTERNAL UInt Yap_LiveCps; EXTERNAL UInt Yap_LiveCps;
EXTERNAL UInt Yap_DirtyCps; EXTERNAL UInt Yap_DirtyCps;
EXTERNAL UInt Yap_FreedCps; EXTERNAL UInt Yap_FreedCps;
#endif #endif
EXTERNAL UInt Yap_expand_clauses_sz; EXTERNAL UInt Yap_expand_clauses_sz;
/* UDI support */ /* UDI support */
EXTERNAL struct udi_info *UdiControlBlocks; EXTERNAL struct udi_info *UdiControlBlocks;
/* data-base statistics */ /* data-base statistics */
/* system boots in compile mode */ /* system boots in compile mode */
EXTERNAL Int STATIC_PREDICATES_MARKED; EXTERNAL Int STATIC_PREDICATES_MARKED;
/* Internal Database */ /* Internal Database */
EXTERNAL Prop *INT_KEYS; EXTERNAL Prop *INT_KEYS;
EXTERNAL Prop *INT_LU_KEYS; EXTERNAL Prop *INT_LU_KEYS;
EXTERNAL Prop *INT_BB_KEYS; EXTERNAL Prop *INT_BB_KEYS;
/* Internal Database Statistics */ /* Internal Database Statistics */
EXTERNAL UInt INT_KEYS_SIZE; EXTERNAL UInt INT_KEYS_SIZE;
EXTERNAL UInt INT_KEYS_TIMESTAMP; EXTERNAL UInt INT_KEYS_TIMESTAMP;
EXTERNAL UInt INT_BB_KEYS_SIZE; EXTERNAL UInt INT_BB_KEYS_SIZE;
/* Internal Data-Base Control */ /* Internal Data-Base Control */
EXTERNAL int UPDATE_MODE; EXTERNAL int UPDATE_MODE;
/* nasty IDB stuff */ /* nasty IDB stuff */
EXTERNAL struct DB_STRUCT *DBErasedMarker; EXTERNAL struct DB_STRUCT *DBErasedMarker;
EXTERNAL struct logic_upd_clause *LogDBErasedMarker; EXTERNAL struct logic_upd_clause *LogDBErasedMarker;
/* Dead clauses and IDB entries */ /* Dead clauses and IDB entries */
EXTERNAL struct static_clause *DeadStaticClauses; EXTERNAL struct static_clause *DeadStaticClauses;
EXTERNAL struct static_mega_clause *DeadMegaClauses; EXTERNAL struct static_mega_clause *DeadMegaClauses;
EXTERNAL struct static_index *DeadStaticIndices; EXTERNAL struct static_index *DeadStaticIndices;
EXTERNAL struct logic_upd_clause *DBErasedList; EXTERNAL struct logic_upd_clause *DBErasedList;
EXTERNAL struct logic_upd_index *DBErasedIList; EXTERNAL struct logic_upd_index *DBErasedIList;
#if defined(YAPOR) || defined(THREADS) #if defined(YAPOR) || defined(THREADS)
EXTERNAL lockvar DeadStaticClausesLock; EXTERNAL lockvar DeadStaticClausesLock;
EXTERNAL lockvar DeadMegaClausesLock; EXTERNAL lockvar DeadMegaClausesLock;
EXTERNAL lockvar DeadStaticIndicesLock; EXTERNAL lockvar DeadStaticIndicesLock;
#endif #endif
#ifdef COROUTINING #ifdef COROUTINING
/* number of attribute modules */ /* number of attribute modules */
EXTERNAL int NUM_OF_ATTS; EXTERNAL int NUM_OF_ATTS;
/* initialised by memory allocator */ /* initialised by memory allocator */
EXTERNAL UInt Yap_AttsSize; EXTERNAL UInt Yap_AttsSize;
#endif #endif
/* Operators */ /** opaque terms used to wake up on cut of call catcher meta-goal */
EXTERNAL struct operator_entry *OpList; EXTERNAL UInt setup_call_catcher_cleanup_tag;
/* foreign code loaded */ /* Operators */
EXTERNAL struct ForeignLoadItem *ForeignCodeLoaded; EXTERNAL struct operator_entry *OpList;
EXTERNAL ADDR ForeignCodeBase; /* foreign code loaded */
EXTERNAL ADDR ForeignCodeTop; EXTERNAL struct ForeignLoadItem *ForeignCodeLoaded;
EXTERNAL ADDR ForeignCodeMax; EXTERNAL ADDR ForeignCodeBase;
/* recorded terms */ EXTERNAL ADDR ForeignCodeTop;
EXTERNAL struct record_list *Yap_Records; EXTERNAL ADDR ForeignCodeMax;
EXTERNAL Atom EmptyWakeups[MAX_EMPTY_WAKEUPS]; /* recorded terms */
EXTERNAL int MaxEmptyWakeups; EXTERNAL struct record_list *Yap_Records;
/* SWI blobs */ EXTERNAL Atom EmptyWakeups[MAX_EMPTY_WAKEUPS];
EXTERNAL struct YAP_blob_t *BlobTypes; EXTERNAL int MaxEmptyWakeups;
EXTERNAL struct AtomEntryStruct *Blobs; /* SWI blobs */
EXTERNAL UInt NOfBlobs; EXTERNAL struct YAP_blob_t *BlobTypes;
EXTERNAL UInt NOfBlobsMax; EXTERNAL struct AtomEntryStruct *Blobs;
#if defined(YAPOR) || defined(THREADS) EXTERNAL UInt NOfBlobs;
EXTERNAL lockvar Blobs_Lock; EXTERNAL UInt NOfBlobsMax;
#endif #if defined(YAPOR) || defined(THREADS)
EXTERNAL lockvar Blobs_Lock;
#endif

View File

@ -1,144 +1,144 @@
/* This file, hglobals.h, was generated automatically by "yap -L misc/buildlocalglobal" /* This file, hglobals.h, was generated automatically by "yap -L misc/buildlocalglobal"
please do not update, update H/GLOBALS instead */ please do not update, update H/GLOBALS instead */
// //
// File defining fields in the Yap_GLOBAL global structure // File defining fields in the Yap_GLOBAL global structure
// //
// these fields used to spread all over the place, because they must be used in 3 ways: // these fields used to spread all over the place, because they must be used in 3 ways:
// - they must be defined somewhere // - they must be defined somewhere
// - they have an #ifdef to get a shorter name // - they have an #ifdef to get a shorter name
// - they must be initialised somewhere // - they must be initialised somewhere
// - they may be of interest to restore // - they may be of interest to restore
// //
// The defs include 3+ components: // The defs include 3+ components:
// Type // Type
// name in structured / global name // name in structured / global name
// init code (optional) // init code (optional)
// restore code (optional) // restore code (optional)
// //
// Stuff that must be shared by all threads or workers // Stuff that must be shared by all threads or workers
typedef struct global_data { typedef struct global_data {
// initialization: tell whether the system has been initialised and by whom. // initialization: tell whether the system has been initialised and by whom.
int Initialised_; int Initialised_;
int InitialisedFromPL_; int InitialisedFromPL_;
int PL_Argc_; int PL_Argc_;
char** PL_Argv_; char** PL_Argv_;
bool FAST_BOOT_FLAG_; bool FAST_BOOT_FLAG_;
// halt hooks // halt hooks
struct halt_hook* HaltHooks_; struct halt_hook* HaltHooks_;
fptr_t JIT_finalizer_; fptr_t JIT_finalizer_;
// stack overflow expansion/gc control // stack overflow expansion/gc control
int AllowLocalExpansion_; int AllowLocalExpansion_;
int AllowGlobalExpansion_; int AllowGlobalExpansion_;
int AllowTrailExpansion_; int AllowTrailExpansion_;
UInt SizeOfOverflow_; UInt SizeOfOverflow_;
// amount of space recovered in all garbage collections // amount of space recovered in all garbage collections
UInt AGcThreshold_; UInt AGcThreshold_;
Agc_hook AGCHook_; Agc_hook AGCHook_;
/* multi-thread support */ /* multi-thread support */
#if THREADS #if THREADS
/* number of threads and processes in system */ /* number of threads and processes in system */
UInt NOfThreads_; UInt NOfThreads_;
/* number of threads created since start */ /* number of threads created since start */
UInt NOfThreadsCreated_; UInt NOfThreadsCreated_;
/* total run time for dead threads */ /* total run time for dead threads */
UInt ThreadsTotalTime_; UInt ThreadsTotalTime_;
// Threads Array // Threads Array
lockvar ThreadHandlesLock_; lockvar ThreadHandlesLock_;
#endif #endif
#if defined(YAPOR) || defined(THREADS) #if defined(YAPOR) || defined(THREADS)
// protect long critical regions // protect long critical regions
lockvar BGL_; lockvar BGL_;
#endif #endif
#if defined(YAPOR) || defined(TABLING) #if defined(YAPOR) || defined(TABLING)
struct global_optyap_data optyap_data_; struct global_optyap_data optyap_data_;
#endif /* YAPOR || TABLING */ #endif /* YAPOR || TABLING */
// whether Yap is responsible for signal handling // whether Yap is responsible for signal handling
int PrologShouldHandleInterrupts_; int PrologShouldHandleInterrupts_;
/* This is the guy who actually started the system, and who has the correct registers */ /* This is the guy who actually started the system, and who has the correct registers */
#if defined(THREADS) #if defined(THREADS)
pthread_t master_thread_; pthread_t master_thread_;
struct thread_mbox* named_mboxes_; struct thread_mbox* named_mboxes_;
lockvar mboxq_lock_; lockvar mboxq_lock_;
UInt mbox_count_; UInt mbox_count_;
struct swi_mutex* WithMutex_; struct swi_mutex* WithMutex_;
#endif /* THREADS */ #endif /* THREADS */
// streams // streams
struct stream_desc* Stream_; struct stream_desc* Stream_;
#if defined(THREADS)||defined(YAPOR) #if defined(THREADS)||defined(YAPOR)
lockvar StreamDescLock_; lockvar StreamDescLock_;
#endif #endif
// access to yap initial arguments // access to yap initial arguments
char** argv_; char** argv_;
int argc_; int argc_;
// extensions to Terms // extensions to Terms
#ifdef COROUTINING #ifdef COROUTINING
/* array with the ops for your favourite extensions */ /* array with the ops for your favourite extensions */
ext_op attas_[attvars_ext+1]; ext_op attas_[attvars_ext+1];
#endif #endif
// agc.c // agc.c
int agc_calls_; int agc_calls_;
YAP_ULONG_LONG agc_collected_; YAP_ULONG_LONG agc_collected_;
/* total time spent in GC */ /* total time spent in GC */
Int tot_agc_time_; Int tot_agc_time_;
/* number of heap objects in all garbage collections */ /* number of heap objects in all garbage collections */
Int tot_agc_recovered_; Int tot_agc_recovered_;
//arrays.c //arrays.c
#if HAVE_MMAP #if HAVE_MMAP
struct MMAP_ARRAY_BLOCK* mmap_arrays_; struct MMAP_ARRAY_BLOCK* mmap_arrays_;
#endif #endif
#ifdef DEBUG #ifdef DEBUG
//computils.c //computils.c
char Option_[20]; char Option_[20];
YP_FILE* logfile_; YP_FILE* logfile_;
//init.c //init.c
//int output_msg =FALSE //int output_msg =FALSE
#endif #endif
#if defined(COFF) || defined(A_OUT) #if defined(COFF) || defined(A_OUT)
// loada_coff.c && load_aout.c // loada_coff.c && load_aout.c
char Executable_[YAP_FILENAME_MAX]; char Executable_[YAP_FILENAME_MAX];
#endif #endif
int OpaqueHandlersCount_; int OpaqueHandlersCount_;
struct opaque_handler_struct* OpaqueHandlers_; struct YAP_opaque_handler_struct* OpaqueHandlers_;
#if __simplescalar__ #if __simplescalar__
char pwd_[YAP_FILENAME_MAX]; char pwd_[YAP_FILENAME_MAX];
#endif #endif
//udi.c //udi.c
//struct udi_control_block RtreeCmd void //struct udi_control_block RtreeCmd void
const char* RestoreFile_; const char* RestoreFile_;
//gprof.c //gprof.c
Int ProfCalls_; Int ProfCalls_;
Int ProfGCs_; Int ProfGCs_;
Int ProfHGrows_; Int ProfHGrows_;
Int ProfSGrows_; Int ProfSGrows_;
Int ProfMallocs_; Int ProfMallocs_;
Int ProfIndexing_; Int ProfIndexing_;
Int ProfOn_; Int ProfOn_;
Int ProfOns_; Int ProfOns_;
struct RB_red_blk_node* ProfilerRoot_; struct RB_red_blk_node* ProfilerRoot_;
struct RB_red_blk_node* ProfilerNil_; struct RB_red_blk_node* ProfilerNil_;
char* DIRNAME_; char* DIRNAME_;
#if LOW_PROF #if LOW_PROF
int ProfilerOn_; int ProfilerOn_;
FILE* FProf_; FILE* FProf_;
FILE* FPreds_; FILE* FPreds_;
#endif /* LOW_PROF */ #endif /* LOW_PROF */
// Mutexes // Mutexes
#if THREADS #if THREADS
struct swi_mutex* FreeMutexes_; struct swi_mutex* FreeMutexes_;
struct swi_mutex* mutex_backbone_; struct swi_mutex* mutex_backbone_;
lockvar MUT_ACCESS_; lockvar MUT_ACCESS_;
#endif #endif
char* Home_; char* Home_;
/* ISO char conversion: I will make no comments */ /* ISO char conversion: I will make no comments */
char* CharConversionTable_; char* CharConversionTable_;
char* CharConversionTable2_; char* CharConversionTable2_;
/* max priority */ /* max priority */
int MaxPriority_; int MaxPriority_;
/// alias table access /// alias table access
struct AliasDescS* FileAliases_; struct AliasDescS* FileAliases_;
int NOfFileAliases_; int NOfFileAliases_;
int SzOfFileAliases_; int SzOfFileAliases_;
struct vfs* VFS_; struct vfs* VFS_;
} w_shared; } w_shared;

View File

@ -1,272 +1,272 @@
/* This file, hlocals.h, was generated automatically by "yap -L misc/buildlocalglobal" /* This file, hlocals.h, was generated automatically by "yap -L misc/buildlocalglobal"
please do not update, update H/LOCALS instead */ please do not update, update H/LOCALS instead */
// Stuff that must be considered local to a thread or worker // Stuff that must be considered local to a thread or worker
typedef struct worker_local { typedef struct worker_local {
// Streams // Streams
int c_input_stream_; int c_input_stream_;
int c_output_stream_; int c_output_stream_;
int c_error_stream_; int c_error_stream_;
bool sockets_io_; bool sockets_io_;
bool within_print_message_; bool within_print_message_;
// //
// Used by the prompts to check if they are after a newline, and then a // Used by the prompts to check if they are after a newline, and then a
// prompt should be output, or if we are in the middle of a line. // prompt should be output, or if we are in the middle of a line.
// //
bool newline_; bool newline_;
Atom AtPrompt_; Atom AtPrompt_;
char Prompt_[MAX_PROMPT+1]; char Prompt_[MAX_PROMPT+1];
encoding_t encoding_; encoding_t encoding_;
bool quasi_quotations_; bool quasi_quotations_;
UInt default_priority_; UInt default_priority_;
bool eot_before_eof_; bool eot_before_eof_;
UInt max_depth_; UInt max_depth_;
UInt max_list_; UInt max_list_;
UInt max_write_args_; UInt max_write_args_;
// Restore info // Restore info
CELL* OldASP_; CELL* OldASP_;
CELL* OldLCL0_; CELL* OldLCL0_;
tr_fr_ptr OldTR_; tr_fr_ptr OldTR_;
CELL* OldGlobalBase_; CELL* OldGlobalBase_;
CELL* OldH_; CELL* OldH_;
CELL* OldH0_; CELL* OldH0_;
ADDR OldTrailBase_; ADDR OldTrailBase_;
ADDR OldTrailTop_; ADDR OldTrailTop_;
ADDR OldHeapBase_; ADDR OldHeapBase_;
ADDR OldHeapTop_; ADDR OldHeapTop_;
Int ClDiff_; Int ClDiff_;
Int GDiff_; Int GDiff_;
Int HDiff_; Int HDiff_;
Int GDiff0_; Int GDiff0_;
CELL* GSplit_; CELL* GSplit_;
Int LDiff_; Int LDiff_;
Int TrDiff_; Int TrDiff_;
Int XDiff_; Int XDiff_;
Int DelayDiff_; Int DelayDiff_;
Int BaseDiff_; Int BaseDiff_;
// Reduction counters // Reduction counters
YAP_ULONG_LONG ReductionsCounter_; YAP_ULONG_LONG ReductionsCounter_;
YAP_ULONG_LONG PredEntriesCounter_; YAP_ULONG_LONG PredEntriesCounter_;
YAP_ULONG_LONG RetriesCounter_; YAP_ULONG_LONG RetriesCounter_;
int ReductionsCounterOn_; int ReductionsCounterOn_;
int PredEntriesCounterOn_; int PredEntriesCounterOn_;
int RetriesCounterOn_; int RetriesCounterOn_;
// support for consulting files // support for consulting files
/* current consult stack */ /* current consult stack */
union CONSULT_OBJ* ConsultSp_; union CONSULT_OBJ* ConsultSp_;
/* current maximum number of cells in consult stack */ /* current maximum number of cells in consult stack */
UInt ConsultCapacity_; UInt ConsultCapacity_;
/* top of consult stack */ /* top of consult stack */
union CONSULT_OBJ* ConsultBase_; union CONSULT_OBJ* ConsultBase_;
/* low-water mark for consult */ /* low-water mark for consult */
union CONSULT_OBJ* ConsultLow_; union CONSULT_OBJ* ConsultLow_;
Term VarNames_; Term VarNames_;
Atom SourceFileName_; Atom SourceFileName_;
UInt SourceFileLineno_; UInt SourceFileLineno_;
//global variables //global variables
Term GlobalArena_; Term GlobalArena_;
UInt GlobalArenaOverflows_; UInt GlobalArenaOverflows_;
Int ArenaOverflows_; Int ArenaOverflows_;
Int DepthArenas_; Int DepthArenas_;
struct pred_entry* LastAssertedPred_; struct pred_entry* LastAssertedPred_;
struct pred_entry* TmpPred_; struct pred_entry* TmpPred_;
char* ScannerStack_; char* ScannerStack_;
struct scanner_extra_alloc* ScannerExtraBlocks_; struct scanner_extra_alloc* ScannerExtraBlocks_;
/// worker control information /// worker control information
/// stack limit after which the stack is managed by C-code. /// stack limit after which the stack is managed by C-code.
Int CBorder_; Int CBorder_;
/// max number of signals (uint64_t) /// max number of signals (uint64_t)
UInt MaxActiveSignals_; UInt MaxActiveSignals_;
/// actual life signals /// actual life signals
uint64_t Signals_; uint64_t Signals_;
/// indexing help data? /// indexing help data?
UInt IPredArity_; UInt IPredArity_;
yamop* ProfEnd_; yamop* ProfEnd_;
int DoingUndefp_; int DoingUndefp_;
Int StartCharCount_; Int StartCharCount_;
Int StartLineCount_; Int StartLineCount_;
Int StartLinePos_; Int StartLinePos_;
scratch_block ScratchPad_; scratch_block ScratchPad_;
#ifdef COROUTINING #ifdef COROUTINING
Term WokenGoals_; Term WokenGoals_;
Term AttsMutableList_; Term AttsMutableList_;
#endif #endif
// gc_stuff // gc_stuff
Term GcGeneration_; Term GcGeneration_;
Term GcPhase_; Term GcPhase_;
UInt GcCurrentPhase_; UInt GcCurrentPhase_;
UInt GcCalls_; UInt GcCalls_;
Int TotGcTime_; Int TotGcTime_;
YAP_ULONG_LONG TotGcRecovered_; YAP_ULONG_LONG TotGcRecovered_;
Int LastGcTime_; Int LastGcTime_;
Int LastSSTime_; Int LastSSTime_;
CELL* OpenArray_; CELL* OpenArray_;
/* in a single gc */ /* in a single gc */
Int total_marked_; Int total_marked_;
Int total_oldies_; Int total_oldies_;
struct choicept* current_B_; struct choicept* current_B_;
CELL* prev_HB_; CELL* prev_HB_;
CELL* HGEN_; CELL* HGEN_;
CELL** iptop_; CELL** iptop_;
#if defined(GC_NO_TAGS) #if defined(GC_NO_TAGS)
char* bp_; char* bp_;
#endif #endif
tr_fr_ptr sTR_; tr_fr_ptr sTR_;
tr_fr_ptr sTR0_; tr_fr_ptr sTR0_;
tr_fr_ptr new_TR_; tr_fr_ptr new_TR_;
struct gc_mark_continuation* cont_top0_; struct gc_mark_continuation* cont_top0_;
struct gc_mark_continuation* cont_top_; struct gc_mark_continuation* cont_top_;
int discard_trail_entries_; int discard_trail_entries_;
gc_ma_hash_entry gc_ma_hash_table_[GC_MAVARS_HASH_SIZE]; gc_ma_hash_entry gc_ma_hash_table_[GC_MAVARS_HASH_SIZE];
gc_ma_hash_entry* gc_ma_h_top_; gc_ma_hash_entry* gc_ma_h_top_;
gc_ma_hash_entry* gc_ma_h_list_; gc_ma_hash_entry* gc_ma_h_list_;
UInt gc_timestamp_; UInt gc_timestamp_;
ADDR db_vec_; ADDR db_vec_;
ADDR db_vec0_; ADDR db_vec0_;
struct RB_red_blk_node* db_root_; struct RB_red_blk_node* db_root_;
struct RB_red_blk_node* db_nil_; struct RB_red_blk_node* db_nil_;
sigjmp_buf* gc_restore_; sigjmp_buf* gc_restore_;
CELL* extra_gc_cells_; CELL* extra_gc_cells_;
CELL* extra_gc_cells_base_; CELL* extra_gc_cells_base_;
CELL* extra_gc_cells_top_; CELL* extra_gc_cells_top_;
UInt extra_gc_cells_size_; UInt extra_gc_cells_size_;
struct array_entry* DynamicArrays_; struct array_entry* DynamicArrays_;
struct static_array_entry* StaticArrays_; struct static_array_entry* StaticArrays_;
struct global_entry* GlobalVariables_; struct global_entry* GlobalVariables_;
int AllowRestart_; int AllowRestart_;
// Thread Local Area for Fast Storage of Intermediate Compiled Code // Thread Local Area for Fast Storage of Intermediate Compiled Code
struct mem_blk* CMemFirstBlock_; struct mem_blk* CMemFirstBlock_;
UInt CMemFirstBlockSz_; UInt CMemFirstBlockSz_;
// Variable used by the compiler to store number of permanent vars in a clause // Variable used by the compiler to store number of permanent vars in a clause
int nperm_; int nperm_;
int jMP_; int jMP_;
// Thread Local Area for Labels // Thread Local Area for Labels
Int* LabelFirstArray_; Int* LabelFirstArray_;
UInt LabelFirstArraySz_; UInt LabelFirstArraySz_;
// Thread Local Area for SWI-Prolog emulation routines. // Thread Local Area for SWI-Prolog emulation routines.
// struct PL_local_data* PL_local_data_p =Yap_InitThreadIO(wid) // struct PL_local_data* PL_local_data_p =Yap_InitThreadIO(wid)
#ifdef THREADS #ifdef THREADS
struct thandle ThreadHandle_; struct thandle ThreadHandle_;
#endif /* THREADS */ #endif /* THREADS */
#if defined(YAPOR) || defined(TABLING) #if defined(YAPOR) || defined(TABLING)
struct local_optyap_data optyap_data_; struct local_optyap_data optyap_data_;
UInt TabMode_; UInt TabMode_;
#endif /* YAPOR || TABLING */ #endif /* YAPOR || TABLING */
int InterruptsDisabled_; int InterruptsDisabled_;
struct open_query_struct* execution_; struct open_query_struct* execution_;
#if LOW_LEVEL_TRACER #if LOW_LEVEL_TRACER
Int total_choicepoints_; Int total_choicepoints_;
#endif #endif
int consult_level_; int consult_level_;
// Variables related to memory allocation // Variables related to memory allocation
ADDR LocalBase_; ADDR LocalBase_;
ADDR GlobalBase_; ADDR GlobalBase_;
ADDR TrailBase_; ADDR TrailBase_;
ADDR TrailTop_; ADDR TrailTop_;
/* error handling info, designed to be easy to pass to the foreign world */ /* error handling info, designed to be easy to pass to the foreign world */
yap_error_descriptor_t* ActiveError_; yap_error_descriptor_t* ActiveError_;
/// pointer to an exception term, from throw /// pointer to an exception term, from throw
jmp_buf* IOBotch_; jmp_buf* IOBotch_;
TokEntry* tokptr_; TokEntry* tokptr_;
TokEntry* toktide_; TokEntry* toktide_;
VarEntry* VarTable_; VarEntry* VarTable_;
VarEntry* AnonVarTable_; VarEntry* AnonVarTable_;
Term Comments_; Term Comments_;
CELL* CommentsTail_; CELL* CommentsTail_;
CELL* CommentsNextChar_; CELL* CommentsNextChar_;
wchar_t* CommentsBuff_; wchar_t* CommentsBuff_;
size_t CommentsBuffPos_; size_t CommentsBuffPos_;
size_t CommentsBuffLim_; size_t CommentsBuffLim_;
sigjmp_buf* RestartEnv_; sigjmp_buf* RestartEnv_;
char FileNameBuf_[YAP_FILENAME_MAX+1]; char FileNameBuf_[YAP_FILENAME_MAX+1];
char FileNameBuf2_[YAP_FILENAME_MAX+1]; char FileNameBuf2_[YAP_FILENAME_MAX+1];
struct TextBuffer_manager* TextBuffer_; struct TextBuffer_manager* TextBuffer_;
// Prolog State // Prolog State
UInt BreakLevel_; UInt BreakLevel_;
Int PrologMode_; Int PrologMode_;
int CritLocks_; int CritLocks_;
// Prolog execution and state flags // Prolog execution and state flags
union flagTerm* Flags_; union flagTerm* Flags_;
UInt flagCount_; UInt flagCount_;
//analyst.c //analyst.c
/* used to find out how many instructions of each kind are executed */ /* used to find out how many instructions of each kind are executed */
#ifdef ANALYST #ifdef ANALYST
YAP_ULONG_LONG opcount_[_std_top+1]; YAP_ULONG_LONG opcount_[_std_top+1];
YAP_ULONG_LONG 2opcount[_std_top+1][_std_top+1]_; YAP_ULONG_LONG 2opcount[_std_top+1][_std_top+1]_;
#endif /* ANALYST */ #endif /* ANALYST */
//dbase.c //dbase.c
struct db_globs* s_dbg_; struct db_globs* s_dbg_;
//eval.c //eval.c
Term mathtt_; Term mathtt_;
char* mathstring_; char* mathstring_;
//grow.c //grow.c
int heap_overflows_; int heap_overflows_;
Int total_heap_overflow_time_; Int total_heap_overflow_time_;
int stack_overflows_; int stack_overflows_;
Int total_stack_overflow_time_; Int total_stack_overflow_time_;
int delay_overflows_; int delay_overflows_;
Int total_delay_overflow_time_; Int total_delay_overflow_time_;
int trail_overflows_; int trail_overflows_;
Int total_trail_overflow_time_; Int total_trail_overflow_time_;
int atom_table_overflows_; int atom_table_overflows_;
Int total_atom_table_overflow_time_; Int total_atom_table_overflow_time_;
//load_dyld //load_dyld
#ifdef LOAD_DYLD #ifdef LOAD_DYLD
int dl_errno_; int dl_errno_;
#endif #endif
//tracer.c //tracer.c
#ifdef LOW_LEVEL_TRACER #ifdef LOW_LEVEL_TRACER
int do_trace_primitives_; int do_trace_primitives_;
#endif #endif
//quick loader //quick loader
struct export_atom_hash_entry_struct *ExportAtomHashChain_; struct export_atom_hash_entry_struct *ExportAtomHashChain_;
UInt ExportAtomHashTableSize_; UInt ExportAtomHashTableSize_;
UInt ExportAtomHashTableNum_; UInt ExportAtomHashTableNum_;
struct export_functor_hash_entry_struct *ExportFunctorHashChain_; struct export_functor_hash_entry_struct *ExportFunctorHashChain_;
UInt ExportFunctorHashTableSize_; UInt ExportFunctorHashTableSize_;
UInt ExportFunctorHashTableNum_; UInt ExportFunctorHashTableNum_;
struct export_pred_entry_hash_entry_struct *ExportPredEntryHashChain_; struct export_pred_entry_hash_entry_struct *ExportPredEntryHashChain_;
UInt ExportPredEntryHashTableSize_; UInt ExportPredEntryHashTableSize_;
UInt ExportPredEntryHashTableNum_; UInt ExportPredEntryHashTableNum_;
struct export_dbref_hash_entry_struct *ExportDBRefHashChain_; struct export_dbref_hash_entry_struct *ExportDBRefHashChain_;
UInt ExportDBRefHashTableSize_; UInt ExportDBRefHashTableSize_;
UInt ExportDBRefHashTableNum_; UInt ExportDBRefHashTableNum_;
struct import_atom_hash_entry_struct **ImportAtomHashChain_; struct import_atom_hash_entry_struct **ImportAtomHashChain_;
UInt ImportAtomHashTableSize_; UInt ImportAtomHashTableSize_;
UInt ImportAtomHashTableNum_; UInt ImportAtomHashTableNum_;
struct import_functor_hash_entry_struct **ImportFunctorHashChain_; struct import_functor_hash_entry_struct **ImportFunctorHashChain_;
UInt ImportFunctorHashTableSize_; UInt ImportFunctorHashTableSize_;
UInt ImportFunctorHashTableNum_; UInt ImportFunctorHashTableNum_;
struct import_opcode_hash_entry_struct **ImportOPCODEHashChain_; struct import_opcode_hash_entry_struct **ImportOPCODEHashChain_;
UInt ImportOPCODEHashTableSize_; UInt ImportOPCODEHashTableSize_;
struct import_pred_entry_hash_entry_struct **ImportPredEntryHashChain_; struct import_pred_entry_hash_entry_struct **ImportPredEntryHashChain_;
UInt ImportPredEntryHashTableSize_; UInt ImportPredEntryHashTableSize_;
UInt ImportPredEntryHashTableNum_; UInt ImportPredEntryHashTableNum_;
struct import_dbref_hash_entry_struct **ImportDBRefHashChain_; struct import_dbref_hash_entry_struct **ImportDBRefHashChain_;
UInt ImportDBRefHashTableSize_; UInt ImportDBRefHashTableSize_;
UInt ImportDBRefHashTableNum_; UInt ImportDBRefHashTableNum_;
yamop *ImportFAILCODE_; yamop *ImportFAILCODE_;
// exo indexing // exo indexing
UInt ibnds_[256]; UInt ibnds_[256];
struct index_t* exo_it_; struct index_t* exo_it_;
CELL* exo_base_; CELL* exo_base_;
UInt exo_arity_; UInt exo_arity_;
UInt exo_arg_; UInt exo_arg_;
// atom completion // atom completion
struct scan_atoms* search_atoms_; struct scan_atoms* search_atoms_;
struct pred_entry* SearchPreds_; struct pred_entry* SearchPreds_;
/// Slots Status /// Slots Status
yhandle_t CurSlot_; yhandle_t CurSlot_;
yhandle_t FrozenHandles_; yhandle_t FrozenHandles_;
yhandle_t NSlots_; yhandle_t NSlots_;
CELL* SlotBase_; CELL* SlotBase_;
// Mutexes // Mutexes
struct swi_mutex* Mutexes_; struct swi_mutex* Mutexes_;
Term SourceModule_; Term SourceModule_;
Term Including_; Term Including_;
size_t MAX_SIZE_; size_t MAX_SIZE_;
/* last call to walltime. */ /* last call to walltime. */
uint64_t LastWTime_; uint64_t LastWTime_;
void* shared_; void* shared_;
} w_local; } w_local;

View File

@ -1,295 +1,297 @@
/* This file, hstruct.h, was generated automatically by "yap -L misc/buildlocalglobal" /* This file, hstruct.h, was generated automatically by "yap -L misc/buildlocalglobal"
please do not update, update H/HEAPFIELDS instead */ please do not update, update H/HEAPFIELDS instead */
// //
// File defining fields in the Yap_heap_codes global structure // File defining fields in the Yap_heap_codes global structure
// //
// these fields used to spread all over the place, because they must be used in 4 ways: // these fields used to spread all over the place, because they must be used in 4 ways:
// - they must be defined somewhere // - they must be defined somewhere
// - they have an #ifdef to get a shorter name // - they have an #ifdef to get a shorter name
// - they must be initialised somewhere // - they must be initialised somewhere
// - they must be restorable and collectable (from the atom gc). // - they must be restorable and collectable (from the atom gc).
// //
// //
// The defs include 4+ components: // The defs include 4+ components:
// Type // Type
// name in structured // name in structured
// global name // global name
// init code and restore code (optional) // init code and restore code (optional)
// //
// //
// //
// MkAT (MkAtomTerm) cvts from a predefined atom to a term // MkAT (MkAtomTerm) cvts from a predefined atom to a term
// MkPred constructs a pred_entry // MkPred constructs a pred_entry
// MkOp gets an opcode // MkOp gets an opcode
// void does nothing // void does nothing
// =VALUE inits as VALUE // =VALUE inits as VALUE
// Init... sets up call to InitFunc // Init... sets up call to InitFunc
// Restore... sets up call to RestoreFunc // Restore... sets up call to RestoreFunc
// //
/* memory management */ /* memory management */
UInt Yap_HoleSize_; UInt Yap_HoleSize_;
#if USE_DL_MALLOC #if USE_DL_MALLOC
struct malloc_state *Yap_av_; struct malloc_state *Yap_av_;
struct memory_hole Yap_MemoryHoles[MAX_DLMALLOC_HOLES]_; struct memory_hole Yap_MemoryHoles[MAX_DLMALLOC_HOLES]_;
UInt Yap_NOfMemoryHoles_; UInt Yap_NOfMemoryHoles_;
#if defined(YAPOR) || defined(THREADS) #if defined(YAPOR) || defined(THREADS)
lockvar DLMallocLock_; lockvar DLMallocLock_;
#endif #endif
#endif #endif
#if USE_DL_MALLOC || (USE_SYSTEM_MALLOC && HAVE_MALLINFO) #if USE_DL_MALLOC || (USE_SYSTEM_MALLOC && HAVE_MALLINFO)
#ifndef HeapUsed #ifndef HeapUsed
#define HeapUsed Yap_givemallinfo() #define HeapUsed Yap_givemallinfo()
#endif #endif
Int NotHeapUsed_; Int NotHeapUsed_;
#else #else
Int HeapUsed_; Int HeapUsed_;
#endif #endif
Int HeapMax_; Int HeapMax_;
ADDR HeapTop_; ADDR HeapTop_;
ADDR HeapLim_; ADDR HeapLim_;
struct FREEB *FreeBlocks_; struct FREEB *FreeBlocks_;
#if defined(YAPOR) || defined(THREADS) #if defined(YAPOR) || defined(THREADS)
lockvar FreeBlocksLock_; lockvar FreeBlocksLock_;
lockvar HeapUsedLock_; lockvar HeapUsedLock_;
lockvar HeapTopLock_; lockvar HeapTopLock_;
int HeapTopOwner_; int HeapTopOwner_;
#endif #endif
UInt MaxStack_; UInt MaxStack_;
UInt MaxTrail_; UInt MaxTrail_;
/* execution info */ /* execution info */
/* OPCODE REVERSE TABLE, needed to recover op tables */ /* OPCODE REVERSE TABLE, needed to recover op tables */
#if USE_THREADED_CODE #if USE_THREADED_CODE
op_entry *OP_RTABLE_; op_entry *OP_RTABLE_;
#endif #endif
/* popular opcodes */ /* popular opcodes */
OPCODE EXECUTE_CPRED_OP_CODE_; OPCODE EXECUTE_CPRED_OP_CODE_;
OPCODE EXPAND_OP_CODE_; OPCODE EXPAND_OP_CODE_;
OPCODE FAIL_OPCODE_; OPCODE FAIL_OPCODE_;
OPCODE INDEX_OPCODE_; OPCODE INDEX_OPCODE_;
OPCODE LOCKPRED_OPCODE_; OPCODE LOCKPRED_OPCODE_;
OPCODE ORLAST_OPCODE_; OPCODE ORLAST_OPCODE_;
OPCODE UNDEF_OPCODE_; OPCODE UNDEF_OPCODE_;
OPCODE RETRY_USERC_OPCODE_; OPCODE RETRY_USERC_OPCODE_;
OPCODE EXECUTE_CPRED_OPCODE_; OPCODE EXECUTE_CPRED_OPCODE_;
/* atom tables */ /* atom tables */
UInt NOfAtoms_; UInt NOfAtoms_;
UInt AtomHashTableSize_; UInt AtomHashTableSize_;
UInt WideAtomHashTableSize_; UInt WideAtomHashTableSize_;
UInt NOfWideAtoms_; UInt NOfWideAtoms_;
AtomHashEntry INVISIBLECHAIN_; AtomHashEntry INVISIBLECHAIN_;
AtomHashEntry *WideHashChain_; AtomHashEntry *WideHashChain_;
AtomHashEntry *HashChain_; AtomHashEntry *HashChain_;
/* use atom defs here */ /* use atom defs here */
#include "tatoms.h" #include "tatoms.h"
#ifdef EUROTRA #ifdef EUROTRA
Term TermDollarU_; Term TermDollarU_;
#endif #endif
//modules //modules
Term USER_MODULE_; Term USER_MODULE_;
Term IDB_MODULE_; Term IDB_MODULE_;
Term ATTRIBUTES_MODULE_; Term ATTRIBUTES_MODULE_;
Term CHARSIO_MODULE_; Term CHARSIO_MODULE_;
Term CHTYPE_MODULE_; Term CHTYPE_MODULE_;
Term TERMS_MODULE_; Term TERMS_MODULE_;
Term SYSTEM_MODULE_; Term SYSTEM_MODULE_;
Term READUTIL_MODULE_; Term READUTIL_MODULE_;
Term HACKS_MODULE_; Term HACKS_MODULE_;
Term ARG_MODULE_; Term ARG_MODULE_;
Term GLOBALS_MODULE_; Term GLOBALS_MODULE_;
Term SWI_MODULE_; Term SWI_MODULE_;
Term DBLOAD_MODULE_; Term DBLOAD_MODULE_;
Term RANGE_MODULE_; Term RANGE_MODULE_;
Term ERROR_MODULE_; Term ERROR_MODULE_;
// //
// Module list // Module list
// //
struct mod_entry *CurrentModules_; struct mod_entry *CurrentModules_;
// make sure we have the modules set at this point. // make sure we have the modules set at this point.
// don't actually want to define a field // don't actually want to define a field
// hidden predicates // hidden predicates
Prop HIDDEN_PREDICATES_; Prop HIDDEN_PREDICATES_;
// make sure we have the streams set at this point. // make sure we have the streams set at this point.
// don't actually want to define a field // don't actually want to define a field
union flagTerm* GLOBAL_Flags_; union flagTerm* GLOBAL_Flags_;
UInt GLOBAL_flagCount_; UInt GLOBAL_flagCount_;
/* Anderson's JIT */ /* Anderson's JIT */
yap_exec_mode Yap_ExecutionMode_; yap_exec_mode Yap_ExecutionMode_;
/* The Predicate Hash Table: fast access to predicates. */ /* The Predicate Hash Table: fast access to predicates. */
UInt PredsInHashTable_; UInt PredsInHashTable_;
uint64_t PredHashTableSize_; uint64_t PredHashTableSize_;
struct pred_entry **PredHash_; struct pred_entry **PredHash_;
#if defined(YAPOR) || defined(THREADS) #if defined(YAPOR) || defined(THREADS)
rwlock_t PredHashRWLock_; rwlock_t PredHashRWLock_;
#endif #endif
/* Well-Known Predicates */ /* Well-Known Predicates */
struct pred_entry *CreepCode_; struct pred_entry *CreepCode_;
struct pred_entry *UndefCode_; struct pred_entry *UndefCode_;
struct pred_entry *SpyCode_; struct pred_entry *SpyCode_;
struct pred_entry *PredFail_; struct pred_entry *PredFail_;
struct pred_entry *PredTrue_; struct pred_entry *PredTrue_;
#ifdef COROUTINING #ifdef COROUTINING
struct pred_entry *WakeUpCode_; struct pred_entry *WakeUpCode_;
#endif #endif
struct pred_entry *PredDollarCatch_; struct pred_entry *PredDollarCatch_;
#ifdef YAPOR #ifdef YAPOR
struct pred_entry *PredGetwork_; struct pred_entry *PredGetwork_;
#endif /* YAPOR */ #endif /* YAPOR */
struct pred_entry *PredGoalExpansion_; struct pred_entry *PredGoalExpansion_;
struct pred_entry *PredHandleThrow_; struct pred_entry *PredHandleThrow_;
struct pred_entry *PredIs_; struct pred_entry *PredIs_;
struct pred_entry *PredLogUpdClause_; struct pred_entry *PredLogUpdClause_;
struct pred_entry *PredLogUpdClauseErase_; struct pred_entry *PredLogUpdClauseErase_;
struct pred_entry *PredLogUpdClause0_; struct pred_entry *PredLogUpdClause0_;
struct pred_entry *PredMetaCall_; struct pred_entry *PredMetaCall_;
struct pred_entry *PredProtectStack_; struct pred_entry *PredProtectStack_;
struct pred_entry *PredRecordedWithKey_; struct pred_entry *PredRecordedWithKey_;
struct pred_entry *PredRestoreRegs_; struct pred_entry *PredRestoreRegs_;
struct pred_entry *PredSafeCallCleanup_; struct pred_entry *PredSafeCallCleanup_;
struct pred_entry *PredStaticClause_; struct pred_entry *PredStaticClause_;
struct pred_entry *PredThrow_; struct pred_entry *PredThrow_;
struct pred_entry *PredTraceMetaCall_; struct pred_entry *PredTraceMetaCall_;
struct pred_entry *PredCommentHook_; struct pred_entry *PredCommentHook_;
struct pred_entry *PredProcedure_; struct pred_entry *PredProcedure_;
struct pred_entry *PredUndefinedQuery_; struct pred_entry *PredUndefinedQuery_;
/* low-level tracer */ /* low-level tracer */
#ifdef LOW_LEVEL_TRACER #ifdef LOW_LEVEL_TRACER
int Yap_do_low_level_trace_; int Yap_do_low_level_trace_;
#if defined(YAPOR) || defined(THREADS) #if defined(YAPOR) || defined(THREADS)
lockvar Yap_low_level_trace_lock_; lockvar Yap_low_level_trace_lock_;
#endif #endif
#endif #endif
/* code management info */ /* code management info */
UInt Yap_ClauseSpace_; UInt Yap_ClauseSpace_;
UInt Yap_IndexSpace_Tree_; UInt Yap_IndexSpace_Tree_;
UInt Yap_IndexSpace_EXT_; UInt Yap_IndexSpace_EXT_;
UInt Yap_IndexSpace_SW_; UInt Yap_IndexSpace_SW_;
UInt Yap_LUClauseSpace_; UInt Yap_LUClauseSpace_;
UInt Yap_LUIndexSpace_Tree_; UInt Yap_LUIndexSpace_Tree_;
UInt Yap_LUIndexSpace_CP_; UInt Yap_LUIndexSpace_CP_;
UInt Yap_LUIndexSpace_EXT_; UInt Yap_LUIndexSpace_EXT_;
UInt Yap_LUIndexSpace_SW_; UInt Yap_LUIndexSpace_SW_;
/* static code: may be shared by many predicate or may be used for meta-execution */ /* static code: may be shared by many predicate or may be used for meta-execution */
yamop COMMA_CODE_[5]; yamop COMMA_CODE_[5];
yamop DUMMYCODE_[1]; yamop DUMMYCODE_[1];
yamop FAILCODE_[1]; yamop FAILCODE_[1];
yamop NOCODE_[1]; yamop NOCODE_[1];
yamop ENV_FOR_TRUSTFAIL_[2]; yamop ENV_FOR_TRUSTFAIL_[2];
yamop *TRUSTFAILCODE_; yamop *TRUSTFAILCODE_;
yamop ENV_FOR_YESCODE_[2]; yamop ENV_FOR_YESCODE_[2];
yamop *YESCODE_; yamop *YESCODE_;
yamop RTRYCODE_[1]; yamop RTRYCODE_[1];
#ifdef BEAM #ifdef BEAM
yamop BEAM_RETRY_CODE_[1]; yamop BEAM_RETRY_CODE_[1];
#endif /* BEAM */ #endif /* BEAM */
#ifdef YAPOR #ifdef YAPOR
yamop GETWORK_[1]; yamop GETWORK_[1];
yamop GETWORK_SEQ_[1]; yamop GETWORK_SEQ_[1];
yamop GETWORK_FIRST_TIME_[1]; yamop GETWORK_FIRST_TIME_[1];
#endif /* YAPOR */ #endif /* YAPOR */
#ifdef TABLING #ifdef TABLING
yamop LOAD_ANSWER_[1]; yamop LOAD_ANSWER_[1];
yamop TRY_ANSWER_[1]; yamop TRY_ANSWER_[1];
yamop ANSWER_RESOLUTION_[1]; yamop ANSWER_RESOLUTION_[1];
yamop COMPLETION_[1]; yamop COMPLETION_[1];
#ifdef THREADS_CONSUMER_SHARING #ifdef THREADS_CONSUMER_SHARING
yamop ANSWER_RESOLUTION_COMPLETION_[1]; yamop ANSWER_RESOLUTION_COMPLETION_[1];
#endif /* THREADS_CONSUMER_SHARING */ #endif /* THREADS_CONSUMER_SHARING */
#endif /* TABLING */ #endif /* TABLING */
/* */ /* */
/* PREG just before we enter $spy. We use that to find out the clause which */ /* PREG just before we enter $spy. We use that to find out the clause which */
/* was calling the debugged goal. */ /* was calling the debugged goal. */
/* */ /* */
yamop *P_before_spy_; yamop *P_before_spy_;
/* support recorded_k */ /* support recorded_k */
yamop *RETRY_C_RECORDEDP_CODE_; yamop *RETRY_C_RECORDEDP_CODE_;
yamop *RETRY_C_RECORDED_K_CODE_; yamop *RETRY_C_RECORDED_K_CODE_;
/* compiler flags */ /* compiler flags */
int PROFILING_; int PROFILING_;
int CALL_COUNTING_; int CALL_COUNTING_;
int optimizer_on_; int optimizer_on_;
int compile_mode_; int compile_mode_;
int profiling_; int profiling_;
int call_counting_; int call_counting_;
/********* whether we should try to compile array references ******************/ /********* whether we should try to compile array references ******************/
int compile_arrays_; int compile_arrays_;
/* DBTerms: pre-compiled ground terms */ /* DBTerms: pre-compiled ground terms */
#if defined(YAPOR) || defined(THREADS) #if defined(YAPOR) || defined(THREADS)
lockvar DBTermsListLock_; lockvar DBTermsListLock_;
#endif #endif
struct dbterm_list *DBTermsList_; struct dbterm_list *DBTermsList_;
/* JITI support */ /* JITI support */
yamop *ExpandClausesFirst_; yamop *ExpandClausesFirst_;
yamop *ExpandClausesLast_; yamop *ExpandClausesLast_;
UInt Yap_ExpandClauses_; UInt Yap_ExpandClauses_;
#if defined(YAPOR) || defined(THREADS) #if defined(YAPOR) || defined(THREADS)
lockvar ExpandClausesListLock_; lockvar ExpandClausesListLock_;
lockvar OpListLock_; lockvar OpListLock_;
#endif #endif
/* instrumentation */ /* instrumentation */
#ifdef DEBUG #ifdef DEBUG
UInt Yap_NewCps_; UInt Yap_NewCps_;
UInt Yap_LiveCps_; UInt Yap_LiveCps_;
UInt Yap_DirtyCps_; UInt Yap_DirtyCps_;
UInt Yap_FreedCps_; UInt Yap_FreedCps_;
#endif #endif
UInt Yap_expand_clauses_sz_; UInt Yap_expand_clauses_sz_;
/* UDI support */ /* UDI support */
struct udi_info *UdiControlBlocks_; struct udi_info *UdiControlBlocks_;
/* data-base statistics */ /* data-base statistics */
/* system boots in compile mode */ /* system boots in compile mode */
Int STATIC_PREDICATES_MARKED_; Int STATIC_PREDICATES_MARKED_;
/* Internal Database */ /* Internal Database */
Prop *INT_KEYS_; Prop *INT_KEYS_;
Prop *INT_LU_KEYS_; Prop *INT_LU_KEYS_;
Prop *INT_BB_KEYS_; Prop *INT_BB_KEYS_;
/* Internal Database Statistics */ /* Internal Database Statistics */
UInt INT_KEYS_SIZE_; UInt INT_KEYS_SIZE_;
UInt INT_KEYS_TIMESTAMP_; UInt INT_KEYS_TIMESTAMP_;
UInt INT_BB_KEYS_SIZE_; UInt INT_BB_KEYS_SIZE_;
/* Internal Data-Base Control */ /* Internal Data-Base Control */
int UPDATE_MODE_; int UPDATE_MODE_;
/* nasty IDB stuff */ /* nasty IDB stuff */
struct DB_STRUCT *DBErasedMarker_; struct DB_STRUCT *DBErasedMarker_;
struct logic_upd_clause *LogDBErasedMarker_; struct logic_upd_clause *LogDBErasedMarker_;
/* Dead clauses and IDB entries */ /* Dead clauses and IDB entries */
struct static_clause *DeadStaticClauses_; struct static_clause *DeadStaticClauses_;
struct static_mega_clause *DeadMegaClauses_; struct static_mega_clause *DeadMegaClauses_;
struct static_index *DeadStaticIndices_; struct static_index *DeadStaticIndices_;
struct logic_upd_clause *DBErasedList_; struct logic_upd_clause *DBErasedList_;
struct logic_upd_index *DBErasedIList_; struct logic_upd_index *DBErasedIList_;
#if defined(YAPOR) || defined(THREADS) #if defined(YAPOR) || defined(THREADS)
lockvar DeadStaticClausesLock_; lockvar DeadStaticClausesLock_;
lockvar DeadMegaClausesLock_; lockvar DeadMegaClausesLock_;
lockvar DeadStaticIndicesLock_; lockvar DeadStaticIndicesLock_;
#endif #endif
#ifdef COROUTINING #ifdef COROUTINING
/* number of attribute modules */ /* number of attribute modules */
int NUM_OF_ATTS_; int NUM_OF_ATTS_;
/* initialised by memory allocator */ /* initialised by memory allocator */
UInt Yap_AttsSize_; UInt Yap_AttsSize_;
#endif #endif
/* Operators */ /** opaque terms used to wake up on cut of call catcher meta-goal */
struct operator_entry *OpList_; UInt setup_call_catcher_cleanup_tag_;
/* foreign code loaded */ /* Operators */
struct ForeignLoadItem *ForeignCodeLoaded_; struct operator_entry *OpList_;
ADDR ForeignCodeBase_; /* foreign code loaded */
ADDR ForeignCodeTop_; struct ForeignLoadItem *ForeignCodeLoaded_;
ADDR ForeignCodeMax_; ADDR ForeignCodeBase_;
/* recorded terms */ ADDR ForeignCodeTop_;
struct record_list *Yap_Records_; ADDR ForeignCodeMax_;
Atom EmptyWakeups_[MAX_EMPTY_WAKEUPS]; /* recorded terms */
int MaxEmptyWakeups_; struct record_list *Yap_Records_;
/* SWI blobs */ Atom EmptyWakeups_[MAX_EMPTY_WAKEUPS];
struct YAP_blob_t *BlobTypes_; int MaxEmptyWakeups_;
struct AtomEntryStruct *Blobs_; /* SWI blobs */
UInt NOfBlobs_; struct YAP_blob_t *BlobTypes_;
UInt NOfBlobsMax_; struct AtomEntryStruct *Blobs_;
#if defined(YAPOR) || defined(THREADS) UInt NOfBlobs_;
lockvar Blobs_Lock_; UInt NOfBlobsMax_;
#endif #if defined(YAPOR) || defined(THREADS)
lockvar Blobs_Lock_;
#endif

View File

@ -129,6 +129,7 @@
AtomError = Yap_LookupAtom("error"); TermError = MkAtomTerm(AtomError); AtomError = Yap_LookupAtom("error"); TermError = MkAtomTerm(AtomError);
AtomException = Yap_LookupAtom("exception"); TermException = MkAtomTerm(AtomException); AtomException = Yap_LookupAtom("exception"); TermException = MkAtomTerm(AtomException);
AtomExtensions = Yap_LookupAtom("extensions"); TermExtensions = MkAtomTerm(AtomExtensions); AtomExtensions = Yap_LookupAtom("extensions"); TermExtensions = MkAtomTerm(AtomExtensions);
AtomExternalException = Yap_LookupAtom("external_exception"); TermExternalException = MkAtomTerm(AtomExternalException);
AtomEvaluable = Yap_LookupAtom("evaluable"); TermEvaluable = MkAtomTerm(AtomEvaluable); AtomEvaluable = Yap_LookupAtom("evaluable"); TermEvaluable = MkAtomTerm(AtomEvaluable);
AtomEvaluationError = Yap_LookupAtom("evaluation_error"); TermEvaluationError = MkAtomTerm(AtomEvaluationError); AtomEvaluationError = Yap_LookupAtom("evaluation_error"); TermEvaluationError = MkAtomTerm(AtomEvaluationError);
AtomExecutable = Yap_LookupAtom("executable"); TermExecutable = MkAtomTerm(AtomExecutable); AtomExecutable = Yap_LookupAtom("executable"); TermExecutable = MkAtomTerm(AtomExecutable);
@ -505,6 +506,7 @@
FunctorExecuteWithin = Yap_MkFunctor(AtomExecuteWithin,1); FunctorExecuteWithin = Yap_MkFunctor(AtomExecuteWithin,1);
FunctorExistenceError = Yap_MkFunctor(AtomExistenceError,2); FunctorExistenceError = Yap_MkFunctor(AtomExistenceError,2);
FunctorExoClause = Yap_MkFunctor(AtomExoClause,2); FunctorExoClause = Yap_MkFunctor(AtomExoClause,2);
FunctorExternalException = Yap_MkFunctor(AtomExternalException,1);
FunctorFunctor = Yap_MkFunctor(AtomFunctor,3); FunctorFunctor = Yap_MkFunctor(AtomFunctor,3);
FunctorGAtom = Yap_MkFunctor(AtomAtom,1); FunctorGAtom = Yap_MkFunctor(AtomAtom,1);
FunctorGAtomic = Yap_MkFunctor(AtomAtomic,1); FunctorGAtomic = Yap_MkFunctor(AtomAtomic,1);

View File

@ -1,144 +1,144 @@
/* This file, iglobals.h, was generated automatically by "yap -L misc/buildlocalglobal" /* This file, iglobals.h, was generated automatically by "yap -L misc/buildlocalglobal"
please do not update, update H/GLOBALS instead */ please do not update, update H/GLOBALS instead */
static void InitGlobal(void) { static void InitGlobal(void) {
GLOBAL_Initialised = FALSE; GLOBAL_Initialised = FALSE;
GLOBAL_InitialisedFromPL = FALSE; GLOBAL_InitialisedFromPL = FALSE;
GLOBAL_PL_Argc = 0; GLOBAL_PL_Argc = 0;
GLOBAL_PL_Argv = NULL; GLOBAL_PL_Argv = NULL;
GLOBAL_FAST_BOOT_FLAG = false; GLOBAL_FAST_BOOT_FLAG = false;
GLOBAL_HaltHooks = NULL; GLOBAL_HaltHooks = NULL;
GLOBAL_JIT_finalizer = NULL; GLOBAL_JIT_finalizer = NULL;
GLOBAL_AllowLocalExpansion = TRUE; GLOBAL_AllowLocalExpansion = TRUE;
GLOBAL_AllowGlobalExpansion = TRUE; GLOBAL_AllowGlobalExpansion = TRUE;
GLOBAL_AllowTrailExpansion = TRUE; GLOBAL_AllowTrailExpansion = TRUE;
GLOBAL_SizeOfOverflow = 0; GLOBAL_SizeOfOverflow = 0;
GLOBAL_AGcThreshold = 10000; GLOBAL_AGcThreshold = 10000;
GLOBAL_AGCHook = NULL; GLOBAL_AGCHook = NULL;
#if THREADS #if THREADS
GLOBAL_NOfThreads = 1; GLOBAL_NOfThreads = 1;
GLOBAL_NOfThreadsCreated = 1; GLOBAL_NOfThreadsCreated = 1;
GLOBAL_ThreadsTotalTime = 0L; GLOBAL_ThreadsTotalTime = 0L;
INIT_LOCK(GLOBAL_ThreadHandlesLock); INIT_LOCK(GLOBAL_ThreadHandlesLock);
#endif #endif
#if defined(YAPOR) || defined(THREADS) #if defined(YAPOR) || defined(THREADS)
INIT_LOCK(GLOBAL_BGL); INIT_LOCK(GLOBAL_BGL);
#endif #endif
#if defined(YAPOR) || defined(TABLING) #if defined(YAPOR) || defined(TABLING)
#endif /* YAPOR || TABLING */ #endif /* YAPOR || TABLING */
#if defined(THREADS) #if defined(THREADS)
GLOBAL_named_mboxes = NULL; GLOBAL_named_mboxes = NULL;
INIT_LOCK(GLOBAL_mboxq_lock); INIT_LOCK(GLOBAL_mboxq_lock);
GLOBAL_mbox_count = 0; GLOBAL_mbox_count = 0;
#endif /* THREADS */ #endif /* THREADS */
#if defined(THREADS)||defined(YAPOR) #if defined(THREADS)||defined(YAPOR)
INIT_LOCK(GLOBAL_StreamDescLock); INIT_LOCK(GLOBAL_StreamDescLock);
#endif #endif
#ifdef COROUTINING #ifdef COROUTINING
#endif #endif
GLOBAL_tot_agc_time = 0; GLOBAL_tot_agc_time = 0;
GLOBAL_tot_agc_recovered = 0; GLOBAL_tot_agc_recovered = 0;
#if HAVE_MMAP #if HAVE_MMAP
GLOBAL_mmap_arrays = NULL; GLOBAL_mmap_arrays = NULL;
#endif #endif
#ifdef DEBUG #ifdef DEBUG
#endif #endif
#if defined(COFF) || defined(A_OUT) #if defined(COFF) || defined(A_OUT)
#endif #endif
GLOBAL_OpaqueHandlersCount = 0; GLOBAL_OpaqueHandlersCount = 0;
GLOBAL_OpaqueHandlers = NULL; GLOBAL_OpaqueHandlers = NULL;
#if __simplescalar__ #if __simplescalar__
#endif #endif
GLOBAL_DIRNAME = NULL; GLOBAL_DIRNAME = NULL;
#if LOW_PROF #if LOW_PROF
GLOBAL_ProfilerOn = FALSE; GLOBAL_ProfilerOn = FALSE;
GLOBAL_FProf = NULL; GLOBAL_FProf = NULL;
GLOBAL_FPreds = NULL; GLOBAL_FPreds = NULL;
#endif /* LOW_PROF */ #endif /* LOW_PROF */
#if THREADS #if THREADS
GLOBAL_FreeMutexes = NULL; GLOBAL_FreeMutexes = NULL;
GLOBAL_mutex_backbone = NULL; GLOBAL_mutex_backbone = NULL;
INIT_LOCK(GLOBAL_MUT_ACCESS); INIT_LOCK(GLOBAL_MUT_ACCESS);
#endif #endif
GLOBAL_Home = NULL; GLOBAL_Home = NULL;
GLOBAL_CharConversionTable = NULL; GLOBAL_CharConversionTable = NULL;
GLOBAL_CharConversionTable2 = NULL; GLOBAL_CharConversionTable2 = NULL;
GLOBAL_MaxPriority = 1200; GLOBAL_MaxPriority = 1200;
GLOBAL_FileAliases = Yap_InitStandardAliases(); GLOBAL_FileAliases = Yap_InitStandardAliases();
GLOBAL_VFS = Yap_InitAssetManager(); GLOBAL_VFS = Yap_InitAssetManager();
} }

View File

@ -1,291 +1,293 @@
/* This file, ihstruct.h, was generated automatically by "yap -L misc/buildlocalglobal" /* This file, ihstruct.h, was generated automatically by "yap -L misc/buildlocalglobal"
please do not update, update H/HEAPFIELDS instead */ please do not update, update H/HEAPFIELDS instead */
#if USE_DL_MALLOC #if USE_DL_MALLOC
#if defined(YAPOR) || defined(THREADS) #if defined(YAPOR) || defined(THREADS)
INIT_LOCK(DLMallocLock); INIT_LOCK(DLMallocLock);
#endif #endif
#endif #endif
#if USE_DL_MALLOC || (USE_SYSTEM_MALLOC && HAVE_MALLINFO) #if USE_DL_MALLOC || (USE_SYSTEM_MALLOC && HAVE_MALLINFO)
#ifndef HeapUsed #ifndef HeapUsed
#define HeapUsed Yap_givemallinfo() #define HeapUsed Yap_givemallinfo()
#endif #endif
#else #else
#endif #endif
#if defined(YAPOR) || defined(THREADS) #if defined(YAPOR) || defined(THREADS)
INIT_LOCK(FreeBlocksLock); INIT_LOCK(FreeBlocksLock);
INIT_LOCK(HeapUsedLock); INIT_LOCK(HeapUsedLock);
INIT_LOCK(HeapTopLock); INIT_LOCK(HeapTopLock);
HeapTopOwner = -1; HeapTopOwner = -1;
#endif #endif
MaxStack = 0; MaxStack = 0;
MaxTrail = 0; MaxTrail = 0;
#if USE_THREADED_CODE #if USE_THREADED_CODE
#endif #endif
EXECUTE_CPRED_OP_CODE = Yap_opcode(_execute_cpred); EXECUTE_CPRED_OP_CODE = Yap_opcode(_execute_cpred);
EXPAND_OP_CODE = Yap_opcode(_expand_index); EXPAND_OP_CODE = Yap_opcode(_expand_index);
FAIL_OPCODE = Yap_opcode(_op_fail); FAIL_OPCODE = Yap_opcode(_op_fail);
INDEX_OPCODE = Yap_opcode(_index_pred); INDEX_OPCODE = Yap_opcode(_index_pred);
LOCKPRED_OPCODE = Yap_opcode(_lock_pred); LOCKPRED_OPCODE = Yap_opcode(_lock_pred);
ORLAST_OPCODE = Yap_opcode(_or_last); ORLAST_OPCODE = Yap_opcode(_or_last);
UNDEF_OPCODE = Yap_opcode(_undef_p); UNDEF_OPCODE = Yap_opcode(_undef_p);
RETRY_USERC_OPCODE = Yap_opcode(_retry_userc); RETRY_USERC_OPCODE = Yap_opcode(_retry_userc);
EXECUTE_CPRED_OPCODE = Yap_opcode(_execute_cpred); EXECUTE_CPRED_OPCODE = Yap_opcode(_execute_cpred);
InitInvisibleAtoms(); InitInvisibleAtoms();
InitWideAtoms(); InitWideAtoms();
InitAtoms(); InitAtoms();
#include "iatoms.h" #include "iatoms.h"
#ifdef EUROTRA #ifdef EUROTRA
TermDollarU = MkAtomTerm(AtomDollarU); TermDollarU = MkAtomTerm(AtomDollarU);
#endif #endif
USER_MODULE = MkAtomTerm(AtomUser); USER_MODULE = MkAtomTerm(AtomUser);
IDB_MODULE = MkAtomTerm(AtomIDB); IDB_MODULE = MkAtomTerm(AtomIDB);
ATTRIBUTES_MODULE = MkAtomTerm(AtomAttributes); ATTRIBUTES_MODULE = MkAtomTerm(AtomAttributes);
CHARSIO_MODULE = MkAtomTerm(AtomCharsio); CHARSIO_MODULE = MkAtomTerm(AtomCharsio);
CHTYPE_MODULE = MkAtomTerm(AtomChType); CHTYPE_MODULE = MkAtomTerm(AtomChType);
TERMS_MODULE = MkAtomTerm(AtomTerms); TERMS_MODULE = MkAtomTerm(AtomTerms);
SYSTEM_MODULE = MkAtomTerm(AtomSystem); SYSTEM_MODULE = MkAtomTerm(AtomSystem);
READUTIL_MODULE = MkAtomTerm(AtomReadutil); READUTIL_MODULE = MkAtomTerm(AtomReadutil);
HACKS_MODULE = MkAtomTerm(AtomYapHacks); HACKS_MODULE = MkAtomTerm(AtomYapHacks);
ARG_MODULE = MkAtomTerm(AtomArg); ARG_MODULE = MkAtomTerm(AtomArg);
GLOBALS_MODULE = MkAtomTerm(AtomNb); GLOBALS_MODULE = MkAtomTerm(AtomNb);
SWI_MODULE = MkAtomTerm(AtomSwi); SWI_MODULE = MkAtomTerm(AtomSwi);
DBLOAD_MODULE = MkAtomTerm(AtomDBLoad); DBLOAD_MODULE = MkAtomTerm(AtomDBLoad);
RANGE_MODULE = MkAtomTerm(AtomRange); RANGE_MODULE = MkAtomTerm(AtomRange);
ERROR_MODULE = MkAtomTerm(AtomError); ERROR_MODULE = MkAtomTerm(AtomError);
CurrentModules = NULL; CurrentModules = NULL;
Yap_InitModules(); Yap_InitModules();
HIDDEN_PREDICATES = NULL; HIDDEN_PREDICATES = NULL;
Yap_InitPlIO(yapi); Yap_InitPlIO(yapi);
GLOBAL_Flags = 0; GLOBAL_Flags = 0;
Yap_InitFlags(true); Yap_InitFlags(true);
Yap_ExecutionMode = INTERPRETED; Yap_ExecutionMode = INTERPRETED;
PredsInHashTable = 0; PredsInHashTable = 0;
PredHashTableSize = 0; PredHashTableSize = 0;
InitPredHash(); InitPredHash();
#if defined(YAPOR) || defined(THREADS) #if defined(YAPOR) || defined(THREADS)
#endif #endif
CreepCode = RepPredProp(PredPropByFunc(Yap_MkFunctor(AtomCreep,1),PROLOG_MODULE)); CreepCode = RepPredProp(PredPropByFunc(Yap_MkFunctor(AtomCreep,1),PROLOG_MODULE));
UndefCode = RepPredProp(PredPropByFunc(Yap_MkFunctor(AtomUndefp0,2),PROLOG_MODULE)); UndefCode = RepPredProp(PredPropByFunc(Yap_MkFunctor(AtomUndefp0,2),PROLOG_MODULE));
SpyCode = RepPredProp(PredPropByFunc(Yap_MkFunctor(AtomSpy,1),PROLOG_MODULE)); SpyCode = RepPredProp(PredPropByFunc(Yap_MkFunctor(AtomSpy,1),PROLOG_MODULE));
PredFail = RepPredProp(PredPropByAtom(AtomFail,PROLOG_MODULE)); PredFail = RepPredProp(PredPropByAtom(AtomFail,PROLOG_MODULE));
PredTrue = RepPredProp(PredPropByAtom(AtomTrue,PROLOG_MODULE)); PredTrue = RepPredProp(PredPropByAtom(AtomTrue,PROLOG_MODULE));
#ifdef COROUTINING #ifdef COROUTINING
WakeUpCode = RepPredProp(PredPropByFunc(Yap_MkFunctor(AtomWakeUpGoal,2),PROLOG_MODULE)); WakeUpCode = RepPredProp(PredPropByFunc(Yap_MkFunctor(AtomWakeUpGoal,2),PROLOG_MODULE));
#endif #endif
PredDollarCatch = RepPredProp(PredPropByFunc(FunctorCatch,PROLOG_MODULE)); PredDollarCatch = RepPredProp(PredPropByFunc(FunctorCatch,PROLOG_MODULE));
#ifdef YAPOR #ifdef YAPOR
PredGetwork = RepPredProp(PredPropByAtom(AtomGetwork,PROLOG_MODULE)); PredGetwork = RepPredProp(PredPropByAtom(AtomGetwork,PROLOG_MODULE));
#endif /* YAPOR */ #endif /* YAPOR */
PredGoalExpansion = RepPredProp(PredPropByFunc(FunctorGoalExpansion,USER_MODULE)); PredGoalExpansion = RepPredProp(PredPropByFunc(FunctorGoalExpansion,USER_MODULE));
PredHandleThrow = RepPredProp(PredPropByFunc(FunctorHandleThrow,PROLOG_MODULE)); PredHandleThrow = RepPredProp(PredPropByFunc(FunctorHandleThrow,PROLOG_MODULE));
PredIs = RepPredProp(PredPropByFunc(FunctorIs,PROLOG_MODULE)); PredIs = RepPredProp(PredPropByFunc(FunctorIs,PROLOG_MODULE));
PredLogUpdClause = RepPredProp(PredPropByFunc(FunctorDoLogUpdClause,PROLOG_MODULE)); PredLogUpdClause = RepPredProp(PredPropByFunc(FunctorDoLogUpdClause,PROLOG_MODULE));
PredLogUpdClauseErase = RepPredProp(PredPropByFunc(FunctorDoLogUpdClauseErase,PROLOG_MODULE)); PredLogUpdClauseErase = RepPredProp(PredPropByFunc(FunctorDoLogUpdClauseErase,PROLOG_MODULE));
PredLogUpdClause0 = RepPredProp(PredPropByFunc(FunctorDoLogUpdClause,PROLOG_MODULE)); PredLogUpdClause0 = RepPredProp(PredPropByFunc(FunctorDoLogUpdClause,PROLOG_MODULE));
PredMetaCall = RepPredProp(PredPropByFunc(FunctorMetaCall,PROLOG_MODULE)); PredMetaCall = RepPredProp(PredPropByFunc(FunctorMetaCall,PROLOG_MODULE));
PredProtectStack = RepPredProp(PredPropByFunc(FunctorProtectStack,PROLOG_MODULE)); PredProtectStack = RepPredProp(PredPropByFunc(FunctorProtectStack,PROLOG_MODULE));
PredRecordedWithKey = RepPredProp(PredPropByFunc(FunctorRecordedWithKey,PROLOG_MODULE)); PredRecordedWithKey = RepPredProp(PredPropByFunc(FunctorRecordedWithKey,PROLOG_MODULE));
PredRestoreRegs = RepPredProp(PredPropByFunc(FunctorRestoreRegs,PROLOG_MODULE)); PredRestoreRegs = RepPredProp(PredPropByFunc(FunctorRestoreRegs,PROLOG_MODULE));
PredSafeCallCleanup = RepPredProp(PredPropByFunc(FunctorSafeCallCleanup,PROLOG_MODULE)); PredSafeCallCleanup = RepPredProp(PredPropByFunc(FunctorSafeCallCleanup,PROLOG_MODULE));
PredStaticClause = RepPredProp(PredPropByFunc(FunctorDoStaticClause,PROLOG_MODULE)); PredStaticClause = RepPredProp(PredPropByFunc(FunctorDoStaticClause,PROLOG_MODULE));
PredThrow = RepPredProp(PredPropByFunc(FunctorThrow,PROLOG_MODULE)); PredThrow = RepPredProp(PredPropByFunc(FunctorThrow,PROLOG_MODULE));
PredTraceMetaCall = RepPredProp(PredPropByFunc(FunctorTraceMetaCall,PROLOG_MODULE)); PredTraceMetaCall = RepPredProp(PredPropByFunc(FunctorTraceMetaCall,PROLOG_MODULE));
PredCommentHook = RepPredProp(PredPropByFunc(FunctorCommentHook,PROLOG_MODULE)); PredCommentHook = RepPredProp(PredPropByFunc(FunctorCommentHook,PROLOG_MODULE));
PredProcedure = Yap_MkLogPred(RepPredProp(PredPropByFunc(FunctorProcedure,PROLOG_MODULE))); PredProcedure = Yap_MkLogPred(RepPredProp(PredPropByFunc(FunctorProcedure,PROLOG_MODULE)));
PredUndefinedQuery = RepPredProp(PredPropByFunc(FunctorUndefinedQuery,PROLOG_MODULE)); PredUndefinedQuery = RepPredProp(PredPropByFunc(FunctorUndefinedQuery,PROLOG_MODULE));
#ifdef LOW_LEVEL_TRACER #ifdef LOW_LEVEL_TRACER
Yap_do_low_level_trace = FALSE; Yap_do_low_level_trace = FALSE;
#if defined(YAPOR) || defined(THREADS) #if defined(YAPOR) || defined(THREADS)
INIT_LOCK(Yap_low_level_trace_lock); INIT_LOCK(Yap_low_level_trace_lock);
#endif #endif
#endif #endif
Yap_ClauseSpace = 0; Yap_ClauseSpace = 0;
Yap_IndexSpace_Tree = 0; Yap_IndexSpace_Tree = 0;
Yap_IndexSpace_EXT = 0; Yap_IndexSpace_EXT = 0;
Yap_IndexSpace_SW = 0; Yap_IndexSpace_SW = 0;
Yap_LUClauseSpace = 0; Yap_LUClauseSpace = 0;
Yap_LUIndexSpace_Tree = 0; Yap_LUIndexSpace_Tree = 0;
Yap_LUIndexSpace_CP = 0; Yap_LUIndexSpace_CP = 0;
Yap_LUIndexSpace_EXT = 0; Yap_LUIndexSpace_EXT = 0;
Yap_LUIndexSpace_SW = 0; Yap_LUIndexSpace_SW = 0;
DUMMYCODE->opc = Yap_opcode(_op_fail); DUMMYCODE->opc = Yap_opcode(_op_fail);
FAILCODE->opc = Yap_opcode(_op_fail); FAILCODE->opc = Yap_opcode(_op_fail);
NOCODE->opc = Yap_opcode(_Nstop); NOCODE->opc = Yap_opcode(_Nstop);
InitEnvInst(ENV_FOR_TRUSTFAIL,&TRUSTFAILCODE,_trust_fail,PredFail); InitEnvInst(ENV_FOR_TRUSTFAIL,&TRUSTFAILCODE,_trust_fail,PredFail);
InitEnvInst(ENV_FOR_YESCODE,&YESCODE,_Ystop,PredFail); InitEnvInst(ENV_FOR_YESCODE,&YESCODE,_Ystop,PredFail);
InitOtaplInst(RTRYCODE,_retry_and_mark,PredFail); InitOtaplInst(RTRYCODE,_retry_and_mark,PredFail);
#ifdef BEAM #ifdef BEAM
BEAM_RETRY_CODE->opc = Yap_opcode(_beam_retry_code); BEAM_RETRY_CODE->opc = Yap_opcode(_beam_retry_code);
#endif /* BEAM */ #endif /* BEAM */
#ifdef YAPOR #ifdef YAPOR
InitOtaplInst(GETWORK,_getwork,PredGetwork); InitOtaplInst(GETWORK,_getwork,PredGetwork);
InitOtaplInst(GETWORK_SEQ,_getwork_seq,PredGetworkSeq); InitOtaplInst(GETWORK_SEQ,_getwork_seq,PredGetworkSeq);
GETWORK_FIRST_TIME->opc = Yap_opcode(_getwork_first_time); GETWORK_FIRST_TIME->opc = Yap_opcode(_getwork_first_time);
#endif /* YAPOR */ #endif /* YAPOR */
#ifdef TABLING #ifdef TABLING
InitOtaplInst(LOAD_ANSWER,_table_load_answer,PredFail); InitOtaplInst(LOAD_ANSWER,_table_load_answer,PredFail);
InitOtaplInst(TRY_ANSWER,_table_try_answer,PredFail); InitOtaplInst(TRY_ANSWER,_table_try_answer,PredFail);
InitOtaplInst(ANSWER_RESOLUTION,_table_answer_resolution,PredFail); InitOtaplInst(ANSWER_RESOLUTION,_table_answer_resolution,PredFail);
InitOtaplInst(COMPLETION,_table_completion,PredFail); InitOtaplInst(COMPLETION,_table_completion,PredFail);
#ifdef THREADS_CONSUMER_SHARING #ifdef THREADS_CONSUMER_SHARING
InitOtaplInst(ANSWER_RESOLUTION_COMPLETION,_table_answer_resolution_completion,PredFail); InitOtaplInst(ANSWER_RESOLUTION_COMPLETION,_table_answer_resolution_completion,PredFail);
#endif /* THREADS_CONSUMER_SHARING */ #endif /* THREADS_CONSUMER_SHARING */
#endif /* TABLING */ #endif /* TABLING */
P_before_spy = NULL; P_before_spy = NULL;
RETRY_C_RECORDEDP_CODE = NULL; RETRY_C_RECORDEDP_CODE = NULL;
RETRY_C_RECORDED_K_CODE = NULL; RETRY_C_RECORDED_K_CODE = NULL;
PROFILING = FALSE; PROFILING = FALSE;
CALL_COUNTING = FALSE; CALL_COUNTING = FALSE;
optimizer_on = TRUE; optimizer_on = TRUE;
compile_mode = 0; compile_mode = 0;
profiling = FALSE; profiling = FALSE;
call_counting = FALSE; call_counting = FALSE;
compile_arrays = FALSE; compile_arrays = FALSE;
#if defined(YAPOR) || defined(THREADS) #if defined(YAPOR) || defined(THREADS)
INIT_LOCK(DBTermsListLock); INIT_LOCK(DBTermsListLock);
#endif #endif
DBTermsList = NULL; DBTermsList = NULL;
ExpandClausesFirst = NULL; ExpandClausesFirst = NULL;
ExpandClausesLast = NULL; ExpandClausesLast = NULL;
Yap_ExpandClauses = 0; Yap_ExpandClauses = 0;
#if defined(YAPOR) || defined(THREADS) #if defined(YAPOR) || defined(THREADS)
INIT_LOCK(ExpandClausesListLock); INIT_LOCK(ExpandClausesListLock);
INIT_LOCK(OpListLock); INIT_LOCK(OpListLock);
#endif #endif
#ifdef DEBUG #ifdef DEBUG
Yap_NewCps = 0L; Yap_NewCps = 0L;
Yap_LiveCps = 0L; Yap_LiveCps = 0L;
Yap_DirtyCps = 0L; Yap_DirtyCps = 0L;
Yap_FreedCps = 0L; Yap_FreedCps = 0L;
#endif #endif
Yap_expand_clauses_sz = 0L; Yap_expand_clauses_sz = 0L;
UdiControlBlocks = NULL; UdiControlBlocks = NULL;
STATIC_PREDICATES_MARKED = FALSE; STATIC_PREDICATES_MARKED = FALSE;
INT_KEYS = NULL; INT_KEYS = NULL;
INT_LU_KEYS = NULL; INT_LU_KEYS = NULL;
INT_BB_KEYS = NULL; INT_BB_KEYS = NULL;
INT_KEYS_SIZE = INT_KEYS_DEFAULT_SIZE; INT_KEYS_SIZE = INT_KEYS_DEFAULT_SIZE;
INT_KEYS_TIMESTAMP = 0L; INT_KEYS_TIMESTAMP = 0L;
INT_BB_KEYS_SIZE = INT_KEYS_DEFAULT_SIZE; INT_BB_KEYS_SIZE = INT_KEYS_DEFAULT_SIZE;
UPDATE_MODE = UPDATE_MODE_LOGICAL; UPDATE_MODE = UPDATE_MODE_LOGICAL;
InitDBErasedMarker(); InitDBErasedMarker();
InitLogDBErasedMarker(); InitLogDBErasedMarker();
DeadStaticClauses = NULL; DeadStaticClauses = NULL;
DeadMegaClauses = NULL; DeadMegaClauses = NULL;
DeadStaticIndices = NULL; DeadStaticIndices = NULL;
DBErasedList = NULL; DBErasedList = NULL;
DBErasedIList = NULL; DBErasedIList = NULL;
#if defined(YAPOR) || defined(THREADS) #if defined(YAPOR) || defined(THREADS)
INIT_LOCK(DeadStaticClausesLock); INIT_LOCK(DeadStaticClausesLock);
INIT_LOCK(DeadMegaClausesLock); INIT_LOCK(DeadMegaClausesLock);
INIT_LOCK(DeadStaticIndicesLock); INIT_LOCK(DeadStaticIndicesLock);
#endif #endif
#ifdef COROUTINING #ifdef COROUTINING
NUM_OF_ATTS = 1; NUM_OF_ATTS = 1;
#endif #endif
OpList = NULL;
ForeignCodeLoaded = NULL; OpList = NULL;
ForeignCodeBase = NULL;
ForeignCodeTop = NULL; ForeignCodeLoaded = NULL;
ForeignCodeMax = NULL; ForeignCodeBase = NULL;
ForeignCodeTop = NULL;
Yap_Records = NULL; ForeignCodeMax = NULL;
InitEmptyWakeups();
MaxEmptyWakeups = 0; Yap_Records = NULL;
InitEmptyWakeups();
BlobTypes = NULL; MaxEmptyWakeups = 0;
Blobs = NULL;
NOfBlobs = 0; BlobTypes = NULL;
NOfBlobsMax = 256; Blobs = NULL;
#if defined(YAPOR) || defined(THREADS) NOfBlobs = 0;
INIT_LOCK(Blobs_Lock); NOfBlobsMax = 256;
#endif #if defined(YAPOR) || defined(THREADS)
INIT_LOCK(Blobs_Lock);
#endif

View File

@ -1,272 +1,272 @@
/* This file, ilocals.h, was generated automatically by "yap -L misc/buildlocalglobal" /* This file, ilocals.h, was generated automatically by "yap -L misc/buildlocalglobal"
please do not update, update H/LOCALS instead */ please do not update, update H/LOCALS instead */
static void InitWorker(int wid) { static void InitWorker(int wid) {
REMOTE_c_input_stream(wid) = 0; REMOTE_c_input_stream(wid) = 0;
REMOTE_c_output_stream(wid) = 1; REMOTE_c_output_stream(wid) = 1;
REMOTE_c_error_stream(wid) = 2; REMOTE_c_error_stream(wid) = 2;
REMOTE_sockets_io(wid) = false; REMOTE_sockets_io(wid) = false;
REMOTE_within_print_message(wid) = false; REMOTE_within_print_message(wid) = false;
REMOTE_newline(wid) = true; REMOTE_newline(wid) = true;
REMOTE_AtPrompt(wid) = AtomNil; REMOTE_AtPrompt(wid) = AtomNil;
REMOTE_encoding(wid) = Yap_DefaultEncoding(); REMOTE_encoding(wid) = Yap_DefaultEncoding();
REMOTE_quasi_quotations(wid) = false; REMOTE_quasi_quotations(wid) = false;
REMOTE_default_priority(wid) = 1200; REMOTE_default_priority(wid) = 1200;
REMOTE_eot_before_eof(wid) = false; REMOTE_eot_before_eof(wid) = false;
REMOTE_max_depth(wid) = 0; REMOTE_max_depth(wid) = 0;
REMOTE_max_list(wid) = 0; REMOTE_max_list(wid) = 0;
REMOTE_max_write_args(wid) = 0; REMOTE_max_write_args(wid) = 0;
REMOTE_OldASP(wid) = NULL; REMOTE_OldASP(wid) = NULL;
REMOTE_OldLCL0(wid) = NULL; REMOTE_OldLCL0(wid) = NULL;
REMOTE_OldTR(wid) = NULL; REMOTE_OldTR(wid) = NULL;
REMOTE_OldGlobalBase(wid) = NULL; REMOTE_OldGlobalBase(wid) = NULL;
REMOTE_OldH(wid) = NULL; REMOTE_OldH(wid) = NULL;
REMOTE_OldH0(wid) = NULL; REMOTE_OldH0(wid) = NULL;
REMOTE_OldTrailBase(wid) = NULL; REMOTE_OldTrailBase(wid) = NULL;
REMOTE_OldTrailTop(wid) = NULL; REMOTE_OldTrailTop(wid) = NULL;
REMOTE_OldHeapBase(wid) = NULL; REMOTE_OldHeapBase(wid) = NULL;
REMOTE_OldHeapTop(wid) = NULL; REMOTE_OldHeapTop(wid) = NULL;
REMOTE_ClDiff(wid) = 0L; REMOTE_ClDiff(wid) = 0L;
REMOTE_GDiff(wid) = 0L; REMOTE_GDiff(wid) = 0L;
REMOTE_HDiff(wid) = 0L; REMOTE_HDiff(wid) = 0L;
REMOTE_GDiff0(wid) = 0L; REMOTE_GDiff0(wid) = 0L;
REMOTE_GSplit(wid) = NULL; REMOTE_GSplit(wid) = NULL;
REMOTE_LDiff(wid) = 0L; REMOTE_LDiff(wid) = 0L;
REMOTE_TrDiff(wid) = 0L; REMOTE_TrDiff(wid) = 0L;
REMOTE_XDiff(wid) = 0L; REMOTE_XDiff(wid) = 0L;
REMOTE_DelayDiff(wid) = 0L; REMOTE_DelayDiff(wid) = 0L;
REMOTE_BaseDiff(wid) = 0L; REMOTE_BaseDiff(wid) = 0L;
REMOTE_ReductionsCounter(wid) = 0L; REMOTE_ReductionsCounter(wid) = 0L;
REMOTE_PredEntriesCounter(wid) = 0L; REMOTE_PredEntriesCounter(wid) = 0L;
REMOTE_RetriesCounter(wid) = 0L; REMOTE_RetriesCounter(wid) = 0L;
REMOTE_ReductionsCounterOn(wid) = 0L; REMOTE_ReductionsCounterOn(wid) = 0L;
REMOTE_PredEntriesCounterOn(wid) = 0L; REMOTE_PredEntriesCounterOn(wid) = 0L;
REMOTE_RetriesCounterOn(wid) = 0L; REMOTE_RetriesCounterOn(wid) = 0L;
REMOTE_ConsultSp(wid) = NULL; REMOTE_ConsultSp(wid) = NULL;
REMOTE_ConsultBase(wid) = NULL; REMOTE_ConsultBase(wid) = NULL;
REMOTE_ConsultLow(wid) = NULL; REMOTE_ConsultLow(wid) = NULL;
REMOTE_VarNames(wid) = ((Term)0); REMOTE_VarNames(wid) = ((Term)0);
REMOTE_SourceFileName(wid) = NULL; REMOTE_SourceFileName(wid) = NULL;
REMOTE_SourceFileLineno(wid) = 0; REMOTE_SourceFileLineno(wid) = 0;
REMOTE_GlobalArena(wid) = 0L; REMOTE_GlobalArena(wid) = 0L;
REMOTE_GlobalArenaOverflows(wid) = 0L; REMOTE_GlobalArenaOverflows(wid) = 0L;
REMOTE_ArenaOverflows(wid) = 0L; REMOTE_ArenaOverflows(wid) = 0L;
REMOTE_DepthArenas(wid) = 0; REMOTE_DepthArenas(wid) = 0;
REMOTE_LastAssertedPred(wid) = NULL; REMOTE_LastAssertedPred(wid) = NULL;
REMOTE_TmpPred(wid) = NULL; REMOTE_TmpPred(wid) = NULL;
REMOTE_ScannerStack(wid) = NULL; REMOTE_ScannerStack(wid) = NULL;
REMOTE_ScannerExtraBlocks(wid) = NULL; REMOTE_ScannerExtraBlocks(wid) = NULL;
REMOTE_CBorder(wid) = 0; REMOTE_CBorder(wid) = 0;
REMOTE_MaxActiveSignals(wid) = 64L; REMOTE_MaxActiveSignals(wid) = 64L;
REMOTE_Signals(wid) = 0L; REMOTE_Signals(wid) = 0L;
REMOTE_IPredArity(wid) = 0L; REMOTE_IPredArity(wid) = 0L;
REMOTE_ProfEnd(wid) = NULL; REMOTE_ProfEnd(wid) = NULL;
REMOTE_DoingUndefp(wid) = FALSE; REMOTE_DoingUndefp(wid) = FALSE;
REMOTE_StartCharCount(wid) = 0L; REMOTE_StartCharCount(wid) = 0L;
REMOTE_StartLineCount(wid) = 0L; REMOTE_StartLineCount(wid) = 0L;
REMOTE_StartLinePos(wid) = 0L; REMOTE_StartLinePos(wid) = 0L;
InitScratchPad(wid); InitScratchPad(wid);
#ifdef COROUTINING #ifdef COROUTINING
REMOTE_WokenGoals(wid) = 0L; REMOTE_WokenGoals(wid) = 0L;
REMOTE_AttsMutableList(wid) = 0L; REMOTE_AttsMutableList(wid) = 0L;
#endif #endif
REMOTE_GcGeneration(wid) = 0L; REMOTE_GcGeneration(wid) = 0L;
REMOTE_GcPhase(wid) = 0L; REMOTE_GcPhase(wid) = 0L;
REMOTE_GcCurrentPhase(wid) = 0L; REMOTE_GcCurrentPhase(wid) = 0L;
REMOTE_GcCalls(wid) = 0L; REMOTE_GcCalls(wid) = 0L;
REMOTE_TotGcTime(wid) = 0L; REMOTE_TotGcTime(wid) = 0L;
REMOTE_TotGcRecovered(wid) = 0L; REMOTE_TotGcRecovered(wid) = 0L;
REMOTE_LastGcTime(wid) = 0L; REMOTE_LastGcTime(wid) = 0L;
REMOTE_LastSSTime(wid) = 0L; REMOTE_LastSSTime(wid) = 0L;
REMOTE_OpenArray(wid) = NULL; REMOTE_OpenArray(wid) = NULL;
REMOTE_total_marked(wid) = 0L; REMOTE_total_marked(wid) = 0L;
REMOTE_total_oldies(wid) = 0L; REMOTE_total_oldies(wid) = 0L;
REMOTE_current_B(wid) = NULL; REMOTE_current_B(wid) = NULL;
REMOTE_prev_HB(wid) = NULL; REMOTE_prev_HB(wid) = NULL;
REMOTE_HGEN(wid) = NULL; REMOTE_HGEN(wid) = NULL;
REMOTE_iptop(wid) = NULL; REMOTE_iptop(wid) = NULL;
#if defined(GC_NO_TAGS) #if defined(GC_NO_TAGS)
REMOTE_bp(wid) = NULL; REMOTE_bp(wid) = NULL;
#endif #endif
REMOTE_sTR(wid) = NULL; REMOTE_sTR(wid) = NULL;
REMOTE_sTR0(wid) = NULL; REMOTE_sTR0(wid) = NULL;
REMOTE_new_TR(wid) = NULL; REMOTE_new_TR(wid) = NULL;
REMOTE_cont_top0(wid) = NULL; REMOTE_cont_top0(wid) = NULL;
REMOTE_cont_top(wid) = NULL; REMOTE_cont_top(wid) = NULL;
REMOTE_discard_trail_entries(wid) = 0; REMOTE_discard_trail_entries(wid) = 0;
REMOTE_gc_ma_h_top(wid) = NULL; REMOTE_gc_ma_h_top(wid) = NULL;
REMOTE_gc_ma_h_list(wid) = NULL; REMOTE_gc_ma_h_list(wid) = NULL;
REMOTE_gc_timestamp(wid) = 0L; REMOTE_gc_timestamp(wid) = 0L;
REMOTE_db_vec(wid) = NULL; REMOTE_db_vec(wid) = NULL;
REMOTE_db_vec0(wid) = NULL; REMOTE_db_vec0(wid) = NULL;
REMOTE_db_root(wid) = NULL; REMOTE_db_root(wid) = NULL;
REMOTE_db_nil(wid) = NULL; REMOTE_db_nil(wid) = NULL;
REMOTE_extra_gc_cells_size(wid) = 256; REMOTE_extra_gc_cells_size(wid) = 256;
REMOTE_DynamicArrays(wid) = NULL; REMOTE_DynamicArrays(wid) = NULL;
REMOTE_StaticArrays(wid) = NULL; REMOTE_StaticArrays(wid) = NULL;
REMOTE_GlobalVariables(wid) = NULL; REMOTE_GlobalVariables(wid) = NULL;
REMOTE_AllowRestart(wid) = FALSE; REMOTE_AllowRestart(wid) = FALSE;
REMOTE_CMemFirstBlock(wid) = NULL; REMOTE_CMemFirstBlock(wid) = NULL;
REMOTE_CMemFirstBlockSz(wid) = 0L; REMOTE_CMemFirstBlockSz(wid) = 0L;
REMOTE_nperm(wid) = 0; REMOTE_nperm(wid) = 0;
REMOTE_jMP(wid) = 0; REMOTE_jMP(wid) = 0;
REMOTE_LabelFirstArray(wid) = NULL; REMOTE_LabelFirstArray(wid) = NULL;
REMOTE_LabelFirstArraySz(wid) = 0L; REMOTE_LabelFirstArraySz(wid) = 0L;
#ifdef THREADS #ifdef THREADS
InitThreadHandle(wid); InitThreadHandle(wid);
#endif /* THREADS */ #endif /* THREADS */
#if defined(YAPOR) || defined(TABLING) #if defined(YAPOR) || defined(TABLING)
Yap_init_local_optyap_data(wid); Yap_init_local_optyap_data(wid);
REMOTE_TabMode(wid) = 0L; REMOTE_TabMode(wid) = 0L;
#endif /* YAPOR || TABLING */ #endif /* YAPOR || TABLING */
REMOTE_InterruptsDisabled(wid) = FALSE; REMOTE_InterruptsDisabled(wid) = FALSE;
REMOTE_execution(wid) = NULL; REMOTE_execution(wid) = NULL;
#if LOW_LEVEL_TRACER #if LOW_LEVEL_TRACER
REMOTE_total_choicepoints(wid) = 0; REMOTE_total_choicepoints(wid) = 0;
#endif #endif
REMOTE_consult_level(wid) = 0; REMOTE_consult_level(wid) = 0;
REMOTE_ActiveError(wid) = calloc(sizeof(yap_error_descriptor_t),1); REMOTE_ActiveError(wid) = calloc(sizeof(yap_error_descriptor_t),1);
REMOTE_TextBuffer(wid) = Yap_InitTextAllocator(); REMOTE_TextBuffer(wid) = Yap_InitTextAllocator();
REMOTE_BreakLevel(wid) = 0; REMOTE_BreakLevel(wid) = 0;
REMOTE_PrologMode(wid) = BootMode; REMOTE_PrologMode(wid) = BootMode;
REMOTE_CritLocks(wid) = 0; REMOTE_CritLocks(wid) = 0;
#ifdef ANALYST #ifdef ANALYST
#endif /* ANALYST */ #endif /* ANALYST */
REMOTE_mathstring(wid) = NULL; REMOTE_mathstring(wid) = NULL;
REMOTE_heap_overflows(wid) = 0; REMOTE_heap_overflows(wid) = 0;
REMOTE_total_heap_overflow_time(wid) = 0; REMOTE_total_heap_overflow_time(wid) = 0;
REMOTE_stack_overflows(wid) = 0; REMOTE_stack_overflows(wid) = 0;
REMOTE_total_stack_overflow_time(wid) = 0; REMOTE_total_stack_overflow_time(wid) = 0;
REMOTE_delay_overflows(wid) = 0; REMOTE_delay_overflows(wid) = 0;
REMOTE_total_delay_overflow_time(wid) = 0; REMOTE_total_delay_overflow_time(wid) = 0;
REMOTE_trail_overflows(wid) = 0; REMOTE_trail_overflows(wid) = 0;
REMOTE_total_trail_overflow_time(wid) = 0; REMOTE_total_trail_overflow_time(wid) = 0;
REMOTE_atom_table_overflows(wid) = 0; REMOTE_atom_table_overflows(wid) = 0;
REMOTE_total_atom_table_overflow_time(wid) = 0; REMOTE_total_atom_table_overflow_time(wid) = 0;
#ifdef LOAD_DYLD #ifdef LOAD_DYLD
REMOTE_dl_errno(wid) = 0; REMOTE_dl_errno(wid) = 0;
#endif #endif
#ifdef LOW_LEVEL_TRACER #ifdef LOW_LEVEL_TRACER
REMOTE_do_trace_primitives(wid) = TRUE; REMOTE_do_trace_primitives(wid) = TRUE;
#endif #endif
REMOTE_ExportAtomHashChain(wid) = NULL; REMOTE_ExportAtomHashChain(wid) = NULL;
REMOTE_ExportAtomHashTableSize(wid) = 0; REMOTE_ExportAtomHashTableSize(wid) = 0;
REMOTE_ExportAtomHashTableNum(wid) = 0; REMOTE_ExportAtomHashTableNum(wid) = 0;
REMOTE_ExportFunctorHashChain(wid) = NULL; REMOTE_ExportFunctorHashChain(wid) = NULL;
REMOTE_ExportFunctorHashTableSize(wid) = 0; REMOTE_ExportFunctorHashTableSize(wid) = 0;
REMOTE_ExportFunctorHashTableNum(wid) = 0; REMOTE_ExportFunctorHashTableNum(wid) = 0;
REMOTE_ExportPredEntryHashChain(wid) = NULL; REMOTE_ExportPredEntryHashChain(wid) = NULL;
REMOTE_ExportPredEntryHashTableSize(wid) = 0; REMOTE_ExportPredEntryHashTableSize(wid) = 0;
REMOTE_ExportPredEntryHashTableNum(wid) = 0; REMOTE_ExportPredEntryHashTableNum(wid) = 0;
REMOTE_ExportDBRefHashChain(wid) = NULL; REMOTE_ExportDBRefHashChain(wid) = NULL;
REMOTE_ExportDBRefHashTableSize(wid) = 0; REMOTE_ExportDBRefHashTableSize(wid) = 0;
REMOTE_ExportDBRefHashTableNum(wid) = 0; REMOTE_ExportDBRefHashTableNum(wid) = 0;
REMOTE_ImportAtomHashChain(wid) = NULL; REMOTE_ImportAtomHashChain(wid) = NULL;
REMOTE_ImportAtomHashTableSize(wid) = 0; REMOTE_ImportAtomHashTableSize(wid) = 0;
REMOTE_ImportAtomHashTableNum(wid) = 0; REMOTE_ImportAtomHashTableNum(wid) = 0;
REMOTE_ImportFunctorHashChain(wid) = NULL; REMOTE_ImportFunctorHashChain(wid) = NULL;
REMOTE_ImportFunctorHashTableSize(wid) = 0; REMOTE_ImportFunctorHashTableSize(wid) = 0;
REMOTE_ImportFunctorHashTableNum(wid) = 0; REMOTE_ImportFunctorHashTableNum(wid) = 0;
REMOTE_ImportOPCODEHashChain(wid) = NULL; REMOTE_ImportOPCODEHashChain(wid) = NULL;
REMOTE_ImportOPCODEHashTableSize(wid) = 0; REMOTE_ImportOPCODEHashTableSize(wid) = 0;
REMOTE_ImportPredEntryHashChain(wid) = NULL; REMOTE_ImportPredEntryHashChain(wid) = NULL;
REMOTE_ImportPredEntryHashTableSize(wid) = 0; REMOTE_ImportPredEntryHashTableSize(wid) = 0;
REMOTE_ImportPredEntryHashTableNum(wid) = 0; REMOTE_ImportPredEntryHashTableNum(wid) = 0;
REMOTE_ImportDBRefHashChain(wid) = NULL; REMOTE_ImportDBRefHashChain(wid) = NULL;
REMOTE_ImportDBRefHashTableSize(wid) = 0; REMOTE_ImportDBRefHashTableSize(wid) = 0;
REMOTE_ImportDBRefHashTableNum(wid) = 0; REMOTE_ImportDBRefHashTableNum(wid) = 0;
REMOTE_ImportFAILCODE(wid) = NULL; REMOTE_ImportFAILCODE(wid) = NULL;
REMOTE_exo_it(wid) = NULL; REMOTE_exo_it(wid) = NULL;
REMOTE_exo_base(wid) = NULL; REMOTE_exo_base(wid) = NULL;
REMOTE_exo_arity(wid) = 0; REMOTE_exo_arity(wid) = 0;
REMOTE_exo_arg(wid) = 0; REMOTE_exo_arg(wid) = 0;
REMOTE_CurSlot(wid) = 0; REMOTE_CurSlot(wid) = 0;
REMOTE_FrozenHandles(wid) = 0; REMOTE_FrozenHandles(wid) = 0;
REMOTE_NSlots(wid) = 0; REMOTE_NSlots(wid) = 0;
REMOTE_SlotBase(wid) = InitHandles(wid); REMOTE_SlotBase(wid) = InitHandles(wid);
REMOTE_Mutexes(wid) = NULL; REMOTE_Mutexes(wid) = NULL;
REMOTE_SourceModule(wid) = 0; REMOTE_SourceModule(wid) = 0;
REMOTE_Including(wid) = TermNil; REMOTE_Including(wid) = TermNil;
REMOTE_MAX_SIZE(wid) = 1024L; REMOTE_MAX_SIZE(wid) = 1024L;
REMOTE_LastWTime(wid) = 0; REMOTE_LastWTime(wid) = 0;
REMOTE_shared(wid) = NULL; REMOTE_shared(wid) = NULL;
} }

View File

@ -129,6 +129,7 @@
AtomError = AtomAdjust(AtomError); TermError = MkAtomTerm(AtomError); AtomError = AtomAdjust(AtomError); TermError = MkAtomTerm(AtomError);
AtomException = AtomAdjust(AtomException); TermException = MkAtomTerm(AtomException); AtomException = AtomAdjust(AtomException); TermException = MkAtomTerm(AtomException);
AtomExtensions = AtomAdjust(AtomExtensions); TermExtensions = MkAtomTerm(AtomExtensions); AtomExtensions = AtomAdjust(AtomExtensions); TermExtensions = MkAtomTerm(AtomExtensions);
AtomExternalException = AtomAdjust(AtomExternalException); TermExternalException = MkAtomTerm(AtomExternalException);
AtomEvaluable = AtomAdjust(AtomEvaluable); TermEvaluable = MkAtomTerm(AtomEvaluable); AtomEvaluable = AtomAdjust(AtomEvaluable); TermEvaluable = MkAtomTerm(AtomEvaluable);
AtomEvaluationError = AtomAdjust(AtomEvaluationError); TermEvaluationError = MkAtomTerm(AtomEvaluationError); AtomEvaluationError = AtomAdjust(AtomEvaluationError); TermEvaluationError = MkAtomTerm(AtomEvaluationError);
AtomExecutable = AtomAdjust(AtomExecutable); TermExecutable = MkAtomTerm(AtomExecutable); AtomExecutable = AtomAdjust(AtomExecutable); TermExecutable = MkAtomTerm(AtomExecutable);
@ -505,6 +506,7 @@
FunctorExecuteWithin = FuncAdjust(FunctorExecuteWithin); FunctorExecuteWithin = FuncAdjust(FunctorExecuteWithin);
FunctorExistenceError = FuncAdjust(FunctorExistenceError); FunctorExistenceError = FuncAdjust(FunctorExistenceError);
FunctorExoClause = FuncAdjust(FunctorExoClause); FunctorExoClause = FuncAdjust(FunctorExoClause);
FunctorExternalException = FuncAdjust(FunctorExternalException);
FunctorFunctor = FuncAdjust(FunctorFunctor); FunctorFunctor = FuncAdjust(FunctorFunctor);
FunctorGAtom = FuncAdjust(FunctorGAtom); FunctorGAtom = FuncAdjust(FunctorGAtom);
FunctorGAtomic = FuncAdjust(FunctorGAtomic); FunctorGAtomic = FuncAdjust(FunctorGAtomic);

View File

@ -1,291 +1,293 @@
/* This file, rhstruct.h, was generated automatically by "yap -L misc/buildlocalglobal" /* This file, rhstruct.h, was generated automatically by "yap -L misc/buildlocalglobal"
please do not update, update H/HEAPFIELDS instead */ please do not update, update H/HEAPFIELDS instead */
#if USE_DL_MALLOC #if USE_DL_MALLOC
#if defined(YAPOR) || defined(THREADS) #if defined(YAPOR) || defined(THREADS)
REINIT_LOCK(DLMallocLock); REINIT_LOCK(DLMallocLock);
#endif #endif
#endif #endif
#if USE_DL_MALLOC || (USE_SYSTEM_MALLOC && HAVE_MALLINFO) #if USE_DL_MALLOC || (USE_SYSTEM_MALLOC && HAVE_MALLINFO)
#ifndef HeapUsed #ifndef HeapUsed
#define HeapUsed Yap_givemallinfo() #define HeapUsed Yap_givemallinfo()
#endif #endif
#else #else
#endif #endif
#if defined(YAPOR) || defined(THREADS) #if defined(YAPOR) || defined(THREADS)
REINIT_LOCK(FreeBlocksLock); REINIT_LOCK(FreeBlocksLock);
REINIT_LOCK(HeapUsedLock); REINIT_LOCK(HeapUsedLock);
REINIT_LOCK(HeapTopLock); REINIT_LOCK(HeapTopLock);
#endif #endif
#if USE_THREADED_CODE #if USE_THREADED_CODE
OP_RTABLE = OpRTableAdjust(OP_RTABLE); OP_RTABLE = OpRTableAdjust(OP_RTABLE);
#endif #endif
EXECUTE_CPRED_OP_CODE = Yap_opcode(_execute_cpred); EXECUTE_CPRED_OP_CODE = Yap_opcode(_execute_cpred);
EXPAND_OP_CODE = Yap_opcode(_expand_index); EXPAND_OP_CODE = Yap_opcode(_expand_index);
FAIL_OPCODE = Yap_opcode(_op_fail); FAIL_OPCODE = Yap_opcode(_op_fail);
INDEX_OPCODE = Yap_opcode(_index_pred); INDEX_OPCODE = Yap_opcode(_index_pred);
LOCKPRED_OPCODE = Yap_opcode(_lock_pred); LOCKPRED_OPCODE = Yap_opcode(_lock_pred);
ORLAST_OPCODE = Yap_opcode(_or_last); ORLAST_OPCODE = Yap_opcode(_or_last);
UNDEF_OPCODE = Yap_opcode(_undef_p); UNDEF_OPCODE = Yap_opcode(_undef_p);
RETRY_USERC_OPCODE = Yap_opcode(_retry_userc); RETRY_USERC_OPCODE = Yap_opcode(_retry_userc);
EXECUTE_CPRED_OPCODE = Yap_opcode(_execute_cpred); EXECUTE_CPRED_OPCODE = Yap_opcode(_execute_cpred);
RestoreInvisibleAtoms(); RestoreInvisibleAtoms();
RestoreWideAtoms(); RestoreWideAtoms();
RestoreAtoms(); RestoreAtoms();
#include "ratoms.h" #include "ratoms.h"
#ifdef EUROTRA #ifdef EUROTRA
TermDollarU = AtomTermAdjust(TermDollarU); TermDollarU = AtomTermAdjust(TermDollarU);
#endif #endif
USER_MODULE = AtomTermAdjust(USER_MODULE); USER_MODULE = AtomTermAdjust(USER_MODULE);
IDB_MODULE = AtomTermAdjust(IDB_MODULE); IDB_MODULE = AtomTermAdjust(IDB_MODULE);
ATTRIBUTES_MODULE = AtomTermAdjust(ATTRIBUTES_MODULE); ATTRIBUTES_MODULE = AtomTermAdjust(ATTRIBUTES_MODULE);
CHARSIO_MODULE = AtomTermAdjust(CHARSIO_MODULE); CHARSIO_MODULE = AtomTermAdjust(CHARSIO_MODULE);
CHTYPE_MODULE = AtomTermAdjust(CHTYPE_MODULE); CHTYPE_MODULE = AtomTermAdjust(CHTYPE_MODULE);
TERMS_MODULE = AtomTermAdjust(TERMS_MODULE); TERMS_MODULE = AtomTermAdjust(TERMS_MODULE);
SYSTEM_MODULE = AtomTermAdjust(SYSTEM_MODULE); SYSTEM_MODULE = AtomTermAdjust(SYSTEM_MODULE);
READUTIL_MODULE = AtomTermAdjust(READUTIL_MODULE); READUTIL_MODULE = AtomTermAdjust(READUTIL_MODULE);
HACKS_MODULE = AtomTermAdjust(HACKS_MODULE); HACKS_MODULE = AtomTermAdjust(HACKS_MODULE);
ARG_MODULE = AtomTermAdjust(ARG_MODULE); ARG_MODULE = AtomTermAdjust(ARG_MODULE);
GLOBALS_MODULE = AtomTermAdjust(GLOBALS_MODULE); GLOBALS_MODULE = AtomTermAdjust(GLOBALS_MODULE);
SWI_MODULE = AtomTermAdjust(SWI_MODULE); SWI_MODULE = AtomTermAdjust(SWI_MODULE);
DBLOAD_MODULE = AtomTermAdjust(DBLOAD_MODULE); DBLOAD_MODULE = AtomTermAdjust(DBLOAD_MODULE);
RANGE_MODULE = AtomTermAdjust(RANGE_MODULE); RANGE_MODULE = AtomTermAdjust(RANGE_MODULE);
ERROR_MODULE = AtomTermAdjust(ERROR_MODULE); ERROR_MODULE = AtomTermAdjust(ERROR_MODULE);
CurrentModules = ModEntryPtrAdjust(CurrentModules); CurrentModules = ModEntryPtrAdjust(CurrentModules);
RestoreHiddenPredicates(); RestoreHiddenPredicates();
RestoreFlags(GLOBAL_flagCount); RestoreFlags(GLOBAL_flagCount);
RestorePredHash(); RestorePredHash();
#if defined(YAPOR) || defined(THREADS) #if defined(YAPOR) || defined(THREADS)
#endif #endif
CreepCode = PtoPredAdjust(CreepCode); CreepCode = PtoPredAdjust(CreepCode);
UndefCode = PtoPredAdjust(UndefCode); UndefCode = PtoPredAdjust(UndefCode);
SpyCode = PtoPredAdjust(SpyCode); SpyCode = PtoPredAdjust(SpyCode);
PredFail = PtoPredAdjust(PredFail); PredFail = PtoPredAdjust(PredFail);
PredTrue = PtoPredAdjust(PredTrue); PredTrue = PtoPredAdjust(PredTrue);
#ifdef COROUTINING #ifdef COROUTINING
WakeUpCode = PtoPredAdjust(WakeUpCode); WakeUpCode = PtoPredAdjust(WakeUpCode);
#endif #endif
PredDollarCatch = PtoPredAdjust(PredDollarCatch); PredDollarCatch = PtoPredAdjust(PredDollarCatch);
#ifdef YAPOR #ifdef YAPOR
PredGetwork = PtoPredAdjust(PredGetwork); PredGetwork = PtoPredAdjust(PredGetwork);
#endif /* YAPOR */ #endif /* YAPOR */
PredGoalExpansion = PtoPredAdjust(PredGoalExpansion); PredGoalExpansion = PtoPredAdjust(PredGoalExpansion);
PredHandleThrow = PtoPredAdjust(PredHandleThrow); PredHandleThrow = PtoPredAdjust(PredHandleThrow);
PredIs = PtoPredAdjust(PredIs); PredIs = PtoPredAdjust(PredIs);
PredLogUpdClause = PtoPredAdjust(PredLogUpdClause); PredLogUpdClause = PtoPredAdjust(PredLogUpdClause);
PredLogUpdClauseErase = PtoPredAdjust(PredLogUpdClauseErase); PredLogUpdClauseErase = PtoPredAdjust(PredLogUpdClauseErase);
PredLogUpdClause0 = PtoPredAdjust(PredLogUpdClause0); PredLogUpdClause0 = PtoPredAdjust(PredLogUpdClause0);
PredMetaCall = PtoPredAdjust(PredMetaCall); PredMetaCall = PtoPredAdjust(PredMetaCall);
PredProtectStack = PtoPredAdjust(PredProtectStack); PredProtectStack = PtoPredAdjust(PredProtectStack);
PredRecordedWithKey = PtoPredAdjust(PredRecordedWithKey); PredRecordedWithKey = PtoPredAdjust(PredRecordedWithKey);
PredRestoreRegs = PtoPredAdjust(PredRestoreRegs); PredRestoreRegs = PtoPredAdjust(PredRestoreRegs);
PredSafeCallCleanup = PtoPredAdjust(PredSafeCallCleanup); PredSafeCallCleanup = PtoPredAdjust(PredSafeCallCleanup);
PredStaticClause = PtoPredAdjust(PredStaticClause); PredStaticClause = PtoPredAdjust(PredStaticClause);
PredThrow = PtoPredAdjust(PredThrow); PredThrow = PtoPredAdjust(PredThrow);
PredTraceMetaCall = PtoPredAdjust(PredTraceMetaCall); PredTraceMetaCall = PtoPredAdjust(PredTraceMetaCall);
PredCommentHook = PtoPredAdjust(PredCommentHook); PredCommentHook = PtoPredAdjust(PredCommentHook);
PredProcedure = PtoPredAdjust(PredProcedure); PredProcedure = PtoPredAdjust(PredProcedure);
PredUndefinedQuery = PtoPredAdjust(PredUndefinedQuery); PredUndefinedQuery = PtoPredAdjust(PredUndefinedQuery);
#ifdef LOW_LEVEL_TRACER #ifdef LOW_LEVEL_TRACER
#if defined(YAPOR) || defined(THREADS) #if defined(YAPOR) || defined(THREADS)
REINIT_LOCK(Yap_low_level_trace_lock); REINIT_LOCK(Yap_low_level_trace_lock);
#endif #endif
#endif #endif
DUMMYCODE->opc = Yap_opcode(_op_fail); DUMMYCODE->opc = Yap_opcode(_op_fail);
FAILCODE->opc = Yap_opcode(_op_fail); FAILCODE->opc = Yap_opcode(_op_fail);
NOCODE->opc = Yap_opcode(_Nstop); NOCODE->opc = Yap_opcode(_Nstop);
RestoreEnvInst(ENV_FOR_TRUSTFAIL,&TRUSTFAILCODE,_trust_fail,PredFail); RestoreEnvInst(ENV_FOR_TRUSTFAIL,&TRUSTFAILCODE,_trust_fail,PredFail);
RestoreEnvInst(ENV_FOR_YESCODE,&YESCODE,_Ystop,PredFail); RestoreEnvInst(ENV_FOR_YESCODE,&YESCODE,_Ystop,PredFail);
RestoreOtaplInst(RTRYCODE,_retry_and_mark,PredFail); RestoreOtaplInst(RTRYCODE,_retry_and_mark,PredFail);
#ifdef BEAM #ifdef BEAM
BEAM_RETRY_CODE->opc = Yap_opcode(_beam_retry_code); BEAM_RETRY_CODE->opc = Yap_opcode(_beam_retry_code);
#endif /* BEAM */ #endif /* BEAM */
#ifdef YAPOR #ifdef YAPOR
RestoreOtaplInst(GETWORK,_getwork,PredGetwork); RestoreOtaplInst(GETWORK,_getwork,PredGetwork);
RestoreOtaplInst(GETWORK_SEQ,_getwork_seq,PredGetworkSeq); RestoreOtaplInst(GETWORK_SEQ,_getwork_seq,PredGetworkSeq);
GETWORK_FIRST_TIME->opc = Yap_opcode(_getwork_first_time); GETWORK_FIRST_TIME->opc = Yap_opcode(_getwork_first_time);
#endif /* YAPOR */ #endif /* YAPOR */
#ifdef TABLING #ifdef TABLING
RestoreOtaplInst(LOAD_ANSWER,_table_load_answer,PredFail); RestoreOtaplInst(LOAD_ANSWER,_table_load_answer,PredFail);
RestoreOtaplInst(TRY_ANSWER,_table_try_answer,PredFail); RestoreOtaplInst(TRY_ANSWER,_table_try_answer,PredFail);
RestoreOtaplInst(ANSWER_RESOLUTION,_table_answer_resolution,PredFail); RestoreOtaplInst(ANSWER_RESOLUTION,_table_answer_resolution,PredFail);
RestoreOtaplInst(COMPLETION,_table_completion,PredFail); RestoreOtaplInst(COMPLETION,_table_completion,PredFail);
#ifdef THREADS_CONSUMER_SHARING #ifdef THREADS_CONSUMER_SHARING
RestoreOtaplInst(ANSWER_RESOLUTION_COMPLETION,_table_answer_resolution_completion,PredFail); RestoreOtaplInst(ANSWER_RESOLUTION_COMPLETION,_table_answer_resolution_completion,PredFail);
#endif /* THREADS_CONSUMER_SHARING */ #endif /* THREADS_CONSUMER_SHARING */
#endif /* TABLING */ #endif /* TABLING */
P_before_spy = PtoOpAdjust(P_before_spy); P_before_spy = PtoOpAdjust(P_before_spy);
RETRY_C_RECORDEDP_CODE = PtoOpAdjust(RETRY_C_RECORDEDP_CODE); RETRY_C_RECORDEDP_CODE = PtoOpAdjust(RETRY_C_RECORDEDP_CODE);
RETRY_C_RECORDED_K_CODE = PtoOpAdjust(RETRY_C_RECORDED_K_CODE); RETRY_C_RECORDED_K_CODE = PtoOpAdjust(RETRY_C_RECORDED_K_CODE);
#if defined(YAPOR) || defined(THREADS) #if defined(YAPOR) || defined(THREADS)
REINIT_LOCK(DBTermsListLock); REINIT_LOCK(DBTermsListLock);
#endif #endif
RestoreDBTermsList(); RestoreDBTermsList();
RestoreExpandList(); RestoreExpandList();
#if defined(YAPOR) || defined(THREADS) #if defined(YAPOR) || defined(THREADS)
REINIT_LOCK(ExpandClausesListLock); REINIT_LOCK(ExpandClausesListLock);
REINIT_LOCK(OpListLock); REINIT_LOCK(OpListLock);
#endif #endif
#ifdef DEBUG #ifdef DEBUG
#endif #endif
RestoreUdiControlBlocks(); RestoreUdiControlBlocks();
RestoreIntKeys(); RestoreIntKeys();
RestoreIntLUKeys(); RestoreIntLUKeys();
RestoreIntBBKeys(); RestoreIntBBKeys();
RestoreDBErasedMarker(); RestoreDBErasedMarker();
RestoreLogDBErasedMarker(); RestoreLogDBErasedMarker();
RestoreDeadStaticClauses(); RestoreDeadStaticClauses();
RestoreDeadMegaClauses(); RestoreDeadMegaClauses();
RestoreDeadStaticIndices(); RestoreDeadStaticIndices();
RestoreDBErasedList(); RestoreDBErasedList();
RestoreDBErasedIList(); RestoreDBErasedIList();
#if defined(YAPOR) || defined(THREADS) #if defined(YAPOR) || defined(THREADS)
REINIT_LOCK(DeadStaticClausesLock); REINIT_LOCK(DeadStaticClausesLock);
REINIT_LOCK(DeadMegaClausesLock); REINIT_LOCK(DeadMegaClausesLock);
REINIT_LOCK(DeadStaticIndicesLock); REINIT_LOCK(DeadStaticIndicesLock);
#endif #endif
#ifdef COROUTINING #ifdef COROUTINING
#endif #endif
OpList = OpListAdjust(OpList);
RestoreForeignCode(); OpList = OpListAdjust(OpList);
RestoreForeignCode();
RestoreYapRecords();
RestoreEmptyWakeups();
RestoreYapRecords();
RestoreEmptyWakeups();
RestoreBlobTypes();
RestoreBlobs();
RestoreBlobTypes();
RestoreBlobs();
#if defined(YAPOR) || defined(THREADS)
REINIT_LOCK(Blobs_Lock);
#endif #if defined(YAPOR) || defined(THREADS)
REINIT_LOCK(Blobs_Lock);
#endif

View File

@ -1,272 +1,272 @@
/* This file, rlocals.h, was generated automatically by "yap -L misc/buildlocalglobal" /* This file, rlocals.h, was generated automatically by "yap -L misc/buildlocalglobal"
please do not update, update H/LOCALS instead */ please do not update, update H/LOCALS instead */
static void RestoreWorker(int wid USES_REGS) { static void RestoreWorker(int wid USES_REGS) {
REMOTE_GlobalArena(wid) = TermToGlobalOrAtomAdjust(REMOTE_GlobalArena(wid)); REMOTE_GlobalArena(wid) = TermToGlobalOrAtomAdjust(REMOTE_GlobalArena(wid));
#ifdef COROUTINING #ifdef COROUTINING
REMOTE_WokenGoals(wid) = TermToGlobalAdjust(REMOTE_WokenGoals(wid)); REMOTE_WokenGoals(wid) = TermToGlobalAdjust(REMOTE_WokenGoals(wid));
REMOTE_AttsMutableList(wid) = TermToGlobalAdjust(REMOTE_AttsMutableList(wid)); REMOTE_AttsMutableList(wid) = TermToGlobalAdjust(REMOTE_AttsMutableList(wid));
#endif #endif
REMOTE_GcGeneration(wid) = TermToGlobalAdjust(REMOTE_GcGeneration(wid)); REMOTE_GcGeneration(wid) = TermToGlobalAdjust(REMOTE_GcGeneration(wid));
REMOTE_GcPhase(wid) = TermToGlobalAdjust(REMOTE_GcPhase(wid)); REMOTE_GcPhase(wid) = TermToGlobalAdjust(REMOTE_GcPhase(wid));
#if defined(GC_NO_TAGS) #if defined(GC_NO_TAGS)
#endif #endif
REMOTE_DynamicArrays(wid) = PtoArrayEAdjust(REMOTE_DynamicArrays(wid)); REMOTE_DynamicArrays(wid) = PtoArrayEAdjust(REMOTE_DynamicArrays(wid));
REMOTE_StaticArrays(wid) = PtoArraySAdjust(REMOTE_StaticArrays(wid)); REMOTE_StaticArrays(wid) = PtoArraySAdjust(REMOTE_StaticArrays(wid));
REMOTE_GlobalVariables(wid) = PtoGlobalEAdjust(REMOTE_GlobalVariables(wid)); REMOTE_GlobalVariables(wid) = PtoGlobalEAdjust(REMOTE_GlobalVariables(wid));
#ifdef THREADS #ifdef THREADS
#endif /* THREADS */ #endif /* THREADS */
#if defined(YAPOR) || defined(TABLING) #if defined(YAPOR) || defined(TABLING)
#endif /* YAPOR || TABLING */ #endif /* YAPOR || TABLING */
#if LOW_LEVEL_TRACER #if LOW_LEVEL_TRACER
#endif #endif
#ifdef ANALYST #ifdef ANALYST
#endif /* ANALYST */ #endif /* ANALYST */
#ifdef LOAD_DYLD #ifdef LOAD_DYLD
#endif #endif
#ifdef LOW_LEVEL_TRACER #ifdef LOW_LEVEL_TRACER
#endif #endif
} }

View File

@ -129,6 +129,7 @@ X_API EXTERNAL Atom AtomEq; X_API EXTERNAL Term TermEq;
X_API EXTERNAL Atom AtomError; X_API EXTERNAL Term TermError; X_API EXTERNAL Atom AtomError; X_API EXTERNAL Term TermError;
X_API EXTERNAL Atom AtomException; X_API EXTERNAL Term TermException; X_API EXTERNAL Atom AtomException; X_API EXTERNAL Term TermException;
X_API EXTERNAL Atom AtomExtensions; X_API EXTERNAL Term TermExtensions; X_API EXTERNAL Atom AtomExtensions; X_API EXTERNAL Term TermExtensions;
X_API EXTERNAL Atom AtomExternalException; X_API EXTERNAL Term TermExternalException;
X_API EXTERNAL Atom AtomEvaluable; X_API EXTERNAL Term TermEvaluable; X_API EXTERNAL Atom AtomEvaluable; X_API EXTERNAL Term TermEvaluable;
X_API EXTERNAL Atom AtomEvaluationError; X_API EXTERNAL Term TermEvaluationError; X_API EXTERNAL Atom AtomEvaluationError; X_API EXTERNAL Term TermEvaluationError;
X_API EXTERNAL Atom AtomExecutable; X_API EXTERNAL Term TermExecutable; X_API EXTERNAL Atom AtomExecutable; X_API EXTERNAL Term TermExecutable;
@ -571,6 +572,8 @@ X_API EXTERNAL Functor FunctorExistenceError;
X_API EXTERNAL Functor FunctorExoClause; X_API EXTERNAL Functor FunctorExoClause;
X_API EXTERNAL Functor FunctorExternalException;
X_API EXTERNAL Functor FunctorFunctor; X_API EXTERNAL Functor FunctorFunctor;
X_API EXTERNAL Functor FunctorGAtom; X_API EXTERNAL Functor FunctorGAtom;

View File

@ -1,170 +1,180 @@
#ifdef FROZEN_STACKS #ifdef FROZEN_STACKS
{ {
tr_fr_ptr pt0, pt1, pbase; tr_fr_ptr pt0, pt1, pbase;
pbase = B->cp_tr; pbase = B->cp_tr;
pt0 = pt1 = TR - 1; pt0 = pt1 = TR - 1;
while (pt1 >= pbase) { while (pt1 >= pbase) {
BEGD(d1); BEGD(d1);
d1 = TrailTerm(pt1); d1 = TrailTerm(pt1);
if (IsVarTerm(d1)) { if (IsVarTerm(d1)) {
if (d1 < (CELL)HBREG || d1 > Unsigned(B->cp_b)) { if (d1 < (CELL)HBREG || d1 > Unsigned(B->cp_b)) {
TrailTerm(pt0) = d1; TrailTerm(pt0) = d1;
TrailVal(pt0) = TrailVal(pt1); TrailVal(pt0) = TrailVal(pt1);
pt0--; pt0--;
} }
pt1--; pt1--;
} else if (IsPairTerm(d1)) { } else if (IsPairTerm(d1)) {
CELL *pt = RepPair(d1); CELL *pt = RepPair(d1);
#ifdef LIMIT_TABLING #ifdef LIMIT_TABLING
if ((ADDR) pt == LOCAL_TrailBase) { if ((ADDR)pt == LOCAL_TrailBase) {
sg_fr_ptr sg_fr = (sg_fr_ptr) TrailVal(pt1); sg_fr_ptr sg_fr = (sg_fr_ptr)TrailVal(pt1);
SgFr_state(sg_fr)--; /* complete_in_use --> complete : compiled_in_use --> compiled */ SgFr_state(sg_fr)--; /* complete_in_use --> complete : compiled_in_use
insert_into_global_sg_fr_list(sg_fr); --> compiled */
} else insert_into_global_sg_fr_list(sg_fr);
} else
#endif /* LIMIT_TABLING */ #endif /* LIMIT_TABLING */
if (IN_BETWEEN(LOCAL_TrailBase, pt, LOCAL_TrailTop)) { if (IN_BETWEEN(LOCAL_TrailBase, pt, LOCAL_TrailTop)) {
/* skip, this is a problem because we lose information, /* skip, this is a problem because we lose information,
namely active references */ namely active references */
pt1 = (tr_fr_ptr)pt; pt1 = (tr_fr_ptr)pt;
} else if (IN_BETWEEN(H0,pt,HR) && IsAttVar(pt)) { } else if (IN_BETWEEN(H0, pt, HR) && IsApplTerm(HeadOfTerm(d1))) {
CELL val = Deref(*pt); Term t = HeadOfTerm(d1);
if (IsVarTerm(val)) { Functor f = FunctorOfTerm(t);
YapBind(pt, MkAtomTerm(AtomCut)); if (f == FunctorBigInt) {
Yap_WakeUp(pt); Int tag = Yap_blob_tag(t) - USER_BLOB_START;
} RESET_VARIABLE(&TrailTerm(pt1));
} else if ((*pt & (LogUpdMask|IndexMask)) == (LogUpdMask|IndexMask)) { GLOBAL_OpaqueHandlers[tag].cut_handler(d1);
LogUpdIndex *cl = ClauseFlagsToLogUpdIndex(pt); } else {
int erase; pt0--;
}
pt1--;
continue;
} else if ((*pt & (LogUpdMask | IndexMask)) == (LogUpdMask | IndexMask)) {
LogUpdIndex *cl = ClauseFlagsToLogUpdIndex(pt);
int erase;
#if defined(THREADS) || defined(YAPOR) #if defined(THREADS) || defined(YAPOR)
PredEntry *ap = cl->ClPred; PredEntry *ap = cl->ClPred;
#endif #endif
LOCK(ap->PELock);
DEC_CLREF_COUNT(cl);
cl->ClFlags &= ~InUseMask;
erase = (cl->ClFlags & (ErasedMask|DirtyMask)) && !(cl->ClRefCount);
if (erase) {
/* at this point, we are the only ones accessing the clause,
hence we don't need to have a lock it */
if (cl->ClFlags & ErasedMask)
Yap_ErLogUpdIndex(cl);
else
Yap_CleanUpIndex(cl);
}
UNLOCK(ap->PELock);
} else {
TrailTerm(pt0) = d1;
TrailVal(pt0) = TrailVal(pt1);
pt0--;
}
pt1--;
} else if (IsApplTerm(d1)) {
if (IN_BETWEEN(HBREG,RepAppl(d1),B->cp_b)) {
/* deterministic binding to multi-assignment variable */
pt1 -= 2;
} else {
TrailVal(pt0) = TrailVal(pt1);
TrailTerm(pt0) = d1;
TrailVal(pt0-1) = TrailVal(pt1-1);
TrailTerm(pt0-1) = TrailTerm(pt1-1);
pt0 -= 2;
pt1 -= 2;
}
} else {
TrailTerm(pt0) = d1;
TrailVal(pt0) = TrailVal(pt1);
pt0--;
pt1--;
}
ENDD(d1);
}
if (pt0 != pt1) {
int size;
pt0++;
size = TR - pt0;
memmove(pbase, pt0, size * sizeof(struct trail_frame));
TR = pbase + size;
}
}
#else
{
tr_fr_ptr pt1, pt0;
pt1 = pt0 = B->cp_tr;
while (pt1 != TR) {
BEGD(d1);
d1 = TrailTerm(pt1);
if (IsVarTerm(d1)) {
if (d1 < (CELL)HBREG || d1 > Unsigned(B->cp_b)) {
#ifdef FROZEN_STACKS
TrailVal(pt0) = TrailVal(pt1);
#endif /* FROZEN_STACKS */
TrailTerm(pt0) = d1;
pt0++;
}
pt1++;
} else if (IsApplTerm(d1)) {
if (IN_BETWEEN(HBREG,RepAppl(d1),B->cp_b)) {
#ifdef FROZEN_STACKS
pt1 += 2;
#else
pt1 += 3;
#endif
} else {
#ifdef FROZEN_STACKS
TrailVal(pt0) = TrailVal(pt1);
TrailTerm(pt0) = d1;
TrailVal(pt0+1) = TrailVal(pt1+1);
TrailTerm(pt0+1) = TrailTerm(pt1+1);
pt0 += 2;
pt1 += 2;
#else
TrailTerm(pt0+1) = TrailTerm(pt1+1);
TrailTerm(pt0) = TrailTerm(pt0+2) = d1;
pt0 += 3;
pt1 += 3;
#endif /* FROZEN_STACKS */
}
} else if (IsPairTerm(d1)) {
CELL *pt = RepPair(d1);
if (IN_BETWEEN(H0,pt,HR) && IsAttVar(pt)) {
CELL val = Deref(*pt);
if (IsVarTerm(val)) {
YapBind(VarOfTerm(val), MkAtomTerm(AtomCut));
Yap_WakeUp(pt);
}
} else if ((*pt & (LogUpdMask|IndexMask)) == (LogUpdMask|IndexMask)) {
LogUpdIndex *cl = ClauseFlagsToLogUpdIndex(pt);
#if defined(YAPOR) || defined(THREADS)
PredEntry *ap = cl->ClPred;
#endif
int erase;
LOCK(ap->PELock); LOCK(ap->PELock);
DEC_CLREF_COUNT(cl); DEC_CLREF_COUNT(cl);
cl->ClFlags &= ~InUseMask; cl->ClFlags &= ~InUseMask;
erase = (cl->ClFlags & (DirtyMask|ErasedMask)) && !(cl->ClRefCount); erase = (cl->ClFlags & (ErasedMask | DirtyMask)) && !(cl->ClRefCount);
if (erase) { if (erase) {
/* at this point, we are the only ones accessing the clause, /* at this point, we are the only ones accessing the clause,
hence we don't need to have a lock it */ hence we don't need to have a lock it */
if (cl->ClFlags & ErasedMask) if (cl->ClFlags & ErasedMask)
Yap_ErLogUpdIndex(cl); Yap_ErLogUpdIndex(cl);
else else
Yap_CleanUpIndex(cl); Yap_CleanUpIndex(cl);
} }
UNLOCK(ap->PELock); UNLOCK(ap->PELock);
} else {
TrailTerm(pt0) = d1;
pt0++;
}
pt1++;
} else { } else {
TrailTerm(pt0) = d1; TrailTerm(pt0) = d1;
pt0++; TrailVal(pt0) = TrailVal(pt1);
pt1++; pt0--;
} }
ENDD(d1); pt1--;
} else if (IsApplTerm(d1)) {
if (IN_BETWEEN(HBREG, RepAppl(d1), B->cp_b)) {
/* deterministic binding to multi-assignment variable */
pt1 -= 2;
} else {
TrailVal(pt0) = TrailVal(pt1);
TrailTerm(pt0) = d1;
TrailVal(pt0 - 1) = TrailVal(pt1 - 1);
TrailTerm(pt0 - 1) = TrailTerm(pt1 - 1);
pt0 -= 2;
pt1 -= 2;
}
} else {
TrailTerm(pt0) = d1;
TrailVal(pt0) = TrailVal(pt1);
pt0--;
pt1--;
}
ENDD(d1);
}
if (pt0 != pt1) {
int size;
pt0++;
size = TR - pt0;
memmove(pbase, pt0, size * sizeof(struct trail_frame));
TR = pbase + size;
}
}
#else
{
tr_fr_ptr pt1, pt0;
pt1 = pt0 = B->cp_tr;
while (pt1 != TR) {
BEGD(d1);
d1 = TrailTerm(pt1);
if (IsVarTerm(d1)) {
if (d1 < (CELL)HBREG || d1 > Unsigned(B->cp_b)) {
#ifdef FROZEN_STACKS
TrailVal(pt0) = TrailVal(pt1);
#endif /* FROZEN_STACKS */
TrailTerm(pt0) = d1;
pt0++;
}
pt1++;
} else if (IsApplTerm(d1)) {
if (IN_BETWEEN(HBREG, RepAppl(d1), B->cp_b)) {
#ifdef FROZEN_STACKS
pt1 += 2;
#else
pt1 += 3;
#endif
} else {
#ifdef FROZEN_STACKS
TrailVal(pt0) = TrailVal(pt1);
TrailTerm(pt0) = d1;
TrailVal(pt0 + 1) = TrailVal(pt1 + 1);
TrailTerm(pt0 + 1) = TrailTerm(pt1 + 1);
pt0 += 2;
pt1 += 2;
#else
TrailTerm(pt0 + 1) = TrailTerm(pt1 + 1);
TrailTerm(pt0) = TrailTerm(pt0 + 2) = d1;
pt0 += 3;
pt1 += 3;
#endif /* FROZEN_STACKS */
}
} else if (IsPairTerm(d1)) {
CELL *pt = RepPair(d1);
else if (IN_BETWEEN(H0, pt, HR) && IsApplTerm(HeadOfTerm(d1))) {
Term t = HeadOfTerm(d1);
Functor f = FunctorOfTerm(t);
if (f == FunctorBigInt) {
RESET_VARIABLE(&TrailTerm(pt1));
Int tag = Yap_blob_tag(t);
GLOBAL_OpaqueHandlers[tag].cut_handler(d1);
} else if ((*pt & (LogUpdMask | IndexMask)) ==
(LogUpdMask | IndexMask)) {
LogUpdIndex *cl = ClauseFlagsToLogUpdIndex(pt);
#if defined(YAPOR) || defined(THREADS)
PredEntry *ap = cl->ClPred;
#endif
int erase;
LOCK(ap->PELock);
DEC_CLREF_COUNT(cl);
cl->ClFlags &= ~InUseMask;
erase = (cl->ClFlags & (DirtyMask | ErasedMask)) && !(cl->ClRefCount);
if (erase) {
/* at this point, we are the only ones accessing the clause,
hence we don't need to have a lock it */
if (cl->ClFlags & ErasedMask)
Yap_ErLogUpdIndex(cl);
else
Yap_CleanUpIndex(cl);
}
UNLOCK(ap->PELock);
} else {
TrailTerm(pt0) = d1;
pt0++;
}
pt1++;
}
else {
TrailTerm(pt0) = d1;
pt0++;
pt1++;
}
ENDD(d1);
} }
TR = pt0; TR = pt0;
} }

View File

@ -854,8 +854,8 @@ number of steps.
format(user_error,'.~n', []). format(user_error,'.~n', []).
'$another' :- '$another' :-
'$clear_input'(user_input),
format(user_error,' ? ',[]), format(user_error,' ? ',[]),
'$clear_input'(user_input),
get_code(user_input,C), get_code(user_input,C),
'$do_another'(C). '$do_another'(C).
@ -1399,7 +1399,6 @@ Command = (H --> B) ->
'$enter_command'(Stream, Mod, Status) :- '$enter_command'(Stream, Mod, Status) :-
'$clear_input'(Stream),
prompt1(': '), prompt(_,' '), prompt1(': '), prompt(_,' '),
Options = [module(Mod), syntax_errors(dec10),variable_names(Vars), term_position(Pos)], Options = [module(Mod), syntax_errors(dec10),variable_names(Vars), term_position(Pos)],
( (

View File

@ -262,10 +262,12 @@ This is similar to call_cleanup/1 but with an additional
*/ */
call_cleanup(Goal, Cleanup) :- call_cleanup(Goal, Cleanup) :-
setup_call_catcher_cleanup(true, Goal, _Catcher, Cleanup). call_cleanup(Goal, _Catcher, Cleanup).
call_cleanup(Goal, Catcher, Cleanup) :- call_cleanup(Goal, Catcher, Cleanup) :-
setup_call_catcher_cleanup(true, Goal, Catcher, Cleanup). '$tag_cleanup'(CP0, cleanup( false, Catcher, Cleanup, Tag, 0, Done)),
call( Goal ),
'$cleanup_on_exit'(CP0, cleanup( false, Catcher, Cleanup, Tag, 1, Done )).
/** @pred setup_call_cleanup(: _Setup_,: _Goal_, : _CleanUpGoal_) /** @pred setup_call_cleanup(: _Setup_,: _Goal_, : _CleanUpGoal_)
@ -285,6 +287,11 @@ finally undone by _Cleanup_.
setup_call_cleanup(Setup,Goal, Cleanup) :- setup_call_cleanup(Setup,Goal, Cleanup) :-
setup_call_catcher_cleanup(Setup, Goal, _Catcher, Cleanup). setup_call_catcher_cleanup(Setup, Goal, _Catcher, Cleanup).
setup_call_catcher_cleanup(Setup, Goal, Catcher, Cleanup) :-
'$setup_call_catcher_cleanup'(Setup),
call_cleanup(Goal, Catcher, Cleanup).
/** @pred call_with_args(+ _Name_,...,? _Ai_,...) /** @pred call_with_args(+ _Name_,...,? _Ai_,...)