fix restore and small VISTA thingies
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2177 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
5b6e8e742b
commit
c23cce1cc1
1
C/agc.c
1
C/agc.c
@ -120,6 +120,7 @@ AtomAdjust(Atom a)
|
||||
#define AtomEntryAdjust(P) (P)
|
||||
#define GlobalEntryAdjust(P) (P)
|
||||
#define BlobTermAdjust(P) (P)
|
||||
#define CodeComposedTermAdjust(P) (P)
|
||||
#define CellPtoHeapAdjust(P) (P)
|
||||
#define CellPtoHeapCellAdjust(P) (P)
|
||||
#define CellPtoTRAdjust(P) (P)
|
||||
|
@ -673,7 +673,7 @@ p_fdiv(Term t1, Term t2 E_ARGS)
|
||||
}
|
||||
|
||||
#if USE_GMP
|
||||
#if !HAVE_MPZ_XOR
|
||||
#if !defined(HAVE_MPZ_XOR)
|
||||
static void
|
||||
mpz_xor(MP_INT *new, MP_INT *r1, MP_INT *r2)
|
||||
{
|
||||
|
@ -11,8 +11,11 @@
|
||||
* File: cdmgr.c *
|
||||
* comments: Code manager *
|
||||
* *
|
||||
* Last rev: $Date: 2008-03-31 22:56:21 $,$Author: vsc $ *
|
||||
* Last rev: $Date: 2008-04-01 08:42:45 $,$Author: vsc $ *
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.224 2008/03/31 22:56:21 vsc
|
||||
* more fixes
|
||||
*
|
||||
* Revision 1.223 2008/03/25 16:45:53 vsc
|
||||
* make or-parallelism compile again
|
||||
*
|
||||
@ -693,6 +696,7 @@ get_pred(Term t, Term tmod, char *pname)
|
||||
#define CellPtoHeapAdjust(X) (X)
|
||||
#define FuncAdjust(X) (X)
|
||||
#define CodeAddrAdjust(X) (X)
|
||||
#define CodeComposedTermAdjust(X) (X)
|
||||
#define rehash(A,B,C)
|
||||
static Term BlobTermAdjust(Term t)
|
||||
{
|
||||
|
60
C/save.c
60
C/save.c
@ -1298,13 +1298,17 @@ RestoreHashPreds(void)
|
||||
np[i] = NULL;
|
||||
}
|
||||
for (i = 0; i < PredHashTableSize; i++) {
|
||||
PredEntry *p = PredHash[i];
|
||||
PredEntry *p = oldp[i];
|
||||
|
||||
p = PredEntryAdjust(p);
|
||||
if (p)
|
||||
p = PredEntryAdjust(p);
|
||||
while (p) {
|
||||
Prop nextp = p->NextOfPE = PropAdjust(p->NextOfPE);
|
||||
Prop nextp;
|
||||
UInt hsh;
|
||||
|
||||
if (p->NextOfPE)
|
||||
p->NextOfPE = PropAdjust(p->NextOfPE);
|
||||
nextp = p->NextOfPE;
|
||||
CleanCode(p);
|
||||
hsh = PRED_HASH(p->FunctorOfPred, p->ModuleOfPred, new_size);
|
||||
p->NextOfPE = AbsPredProp(np[hsh]);
|
||||
@ -1660,37 +1664,37 @@ UnmarkTrEntries(void)
|
||||
B->cp_ap = NOCODE;
|
||||
Entries = (CELL *)Yap_TrailBase;
|
||||
while ((entry = *Entries++) != (CELL)NULL) {
|
||||
if (IsVarTerm(entry)) {
|
||||
RESET_VARIABLE((CELL *)entry);
|
||||
} else if (IsPairTerm(entry)) {
|
||||
CELL *ent = CellPtoHeapAdjust(RepPair(entry));
|
||||
register CELL flags;
|
||||
if (!IsVarTerm(entry)) {
|
||||
if(IsPairTerm(entry)) {
|
||||
CELL *ent = CellPtoHeapAdjust(RepPair(entry));
|
||||
register CELL flags;
|
||||
|
||||
flags = *ent;
|
||||
ResetFlag(InUseMask, flags);
|
||||
*ent = flags;
|
||||
if (FlagOn((DirtyMask|ErasedMask), flags)) {
|
||||
if (FlagOn(DBClMask, flags)) {
|
||||
Yap_ErDBE(DBStructFlagsToDBStruct(ent));
|
||||
} else {
|
||||
if (flags & LogUpdMask) {
|
||||
if (flags & IndexMask) {
|
||||
if (FlagOn(ErasedMask, flags))
|
||||
Yap_ErLogUpdIndex(ClauseFlagsToLogUpdIndex(ent));
|
||||
else
|
||||
Yap_CleanUpIndex(ClauseFlagsToLogUpdIndex(ent));
|
||||
} else {
|
||||
Yap_ErLogUpdCl(ClauseFlagsToLogUpdClause(ent));
|
||||
}
|
||||
flags = *ent;
|
||||
ResetFlag(InUseMask, flags);
|
||||
*ent = flags;
|
||||
if (FlagOn((DirtyMask|ErasedMask), flags)) {
|
||||
if (FlagOn(DBClMask, flags)) {
|
||||
Yap_ErDBE(DBStructFlagsToDBStruct(ent));
|
||||
} else {
|
||||
Yap_ErCl(ClauseFlagsToDynamicClause(ent));
|
||||
if (flags & LogUpdMask) {
|
||||
if (flags & IndexMask) {
|
||||
if (FlagOn(ErasedMask, flags))
|
||||
Yap_ErLogUpdIndex(ClauseFlagsToLogUpdIndex(ent));
|
||||
else
|
||||
Yap_CleanUpIndex(ClauseFlagsToLogUpdIndex(ent));
|
||||
} else {
|
||||
Yap_ErLogUpdCl(ClauseFlagsToLogUpdClause(ent));
|
||||
}
|
||||
} else {
|
||||
Yap_ErCl(ClauseFlagsToDynamicClause(ent));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifdef MULTI_ASSIGNMENT_VARIABLES
|
||||
} else /* if (IsApplTerm(d1)) */ {
|
||||
Entries += 2;
|
||||
} else /* if (IsApplTerm(d1)) */ {
|
||||
Entries += 2;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
B = NULL;
|
||||
|
37
H/rclause.h
37
H/rclause.h
@ -12,8 +12,11 @@
|
||||
* File: rclause.h *
|
||||
* comments: walk through a clause *
|
||||
* *
|
||||
* Last rev: $Date: 2008-03-25 22:03:14 $,$Author: vsc $ *
|
||||
* Last rev: $Date: 2008-04-01 08:42:46 $,$Author: vsc $ *
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.24 2008/03/25 22:03:14 vsc
|
||||
* fix some icc warnings
|
||||
*
|
||||
* Revision 1.23 2008/01/28 18:12:36 vsc
|
||||
* fix small bug in restore opcode
|
||||
*
|
||||
@ -489,9 +492,7 @@ restore_opcodes(yamop *pc)
|
||||
break;
|
||||
/* instructions type xc */
|
||||
case _get_atom:
|
||||
case _put_atom:
|
||||
case _get_bigint:
|
||||
case _get_dbterm:
|
||||
pc->u.xc.x = XAdjust(pc->u.xc.x);
|
||||
{
|
||||
Term t = pc->u.xc.c;
|
||||
@ -502,6 +503,24 @@ restore_opcodes(yamop *pc)
|
||||
}
|
||||
pc = NEXTOP(pc,xc);
|
||||
break;
|
||||
case _put_atom:
|
||||
pc->u.xc.x = XAdjust(pc->u.xc.x);
|
||||
{
|
||||
Term t = pc->u.xc.c;
|
||||
if (IsAtomTerm(t))
|
||||
pc->u.xc.c = AtomTermAdjust(t);
|
||||
else if (IsApplTerm(t))
|
||||
pc->u.xc.c = BlobTermAdjust(t);
|
||||
else if (IsPairTerm(t))
|
||||
pc->u.xc.c = CodeComposedTermAdjust(t);
|
||||
}
|
||||
pc = NEXTOP(pc,xc);
|
||||
break;
|
||||
case _get_dbterm:
|
||||
pc->u.xc.x = XAdjust(pc->u.xc.x);
|
||||
pc->u.xc.c = CodeComposedTermAdjust(pc->u.xc.c);
|
||||
pc = NEXTOP(pc,xc);
|
||||
break;
|
||||
case _get_2atoms:
|
||||
{
|
||||
Term t = pc->u.cc.c1;
|
||||
@ -765,14 +784,18 @@ restore_opcodes(yamop *pc)
|
||||
pc = NEXTOP(pc,oi);
|
||||
break;
|
||||
/* instructions type oc */
|
||||
case _unify_dbterm:
|
||||
case _unify_l_dbterm:
|
||||
pc->u.oc.opcw = Yap_opcode(Yap_op_from_opcode(pc->u.oc.opcw));
|
||||
pc->u.oc.c = CodeComposedTermAdjust(pc->u.oc.c);
|
||||
pc = NEXTOP(pc,oc);
|
||||
break;
|
||||
case _unify_atom_write:
|
||||
case _unify_atom:
|
||||
case _unify_l_atom_write:
|
||||
case _unify_l_atom:
|
||||
case _unify_bigint:
|
||||
case _unify_l_bigint:
|
||||
case _unify_dbterm:
|
||||
case _unify_l_dbterm:
|
||||
pc->u.oc.opcw = Yap_opcode(Yap_op_from_opcode(pc->u.oc.opcw));
|
||||
{
|
||||
Term t = pc->u.oc.c;
|
||||
@ -830,6 +853,8 @@ restore_opcodes(yamop *pc)
|
||||
pc->u.c.c = AtomTermAdjust(t);
|
||||
else if (IsApplTerm(t))
|
||||
pc->u.c.c = BlobTermAdjust(t);
|
||||
else if (IsPairTerm(t))
|
||||
pc->u.c.c = CodeComposedTermAdjust(t);
|
||||
}
|
||||
pc = NEXTOP(pc,c);
|
||||
break;
|
||||
@ -934,7 +959,7 @@ restore_opcodes(yamop *pc)
|
||||
for (j = 0; j < i; j++) {
|
||||
Functor oldfunc = (Functor)(oldcode[0]);
|
||||
CODEADDR oldjmp = (CODEADDR)(oldcode[1]);
|
||||
if (oldfunc != NULL) {
|
||||
if (oldfunc) {
|
||||
oldcode[0] = (CELL)FuncAdjust(oldfunc);
|
||||
}
|
||||
oldcode[1] = (CELL)CodeAddrAdjust(oldjmp);
|
||||
|
54
H/rheap.h
54
H/rheap.h
@ -11,8 +11,11 @@
|
||||
* File: rheap.h *
|
||||
* comments: walk through heap code *
|
||||
* *
|
||||
* Last rev: $Date: 2008-03-25 22:03:14 $,$Author: vsc $ *
|
||||
* Last rev: $Date: 2008-04-01 08:42:46 $,$Author: vsc $ *
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.87 2008/03/25 22:03:14 vsc
|
||||
* fix some icc warnings
|
||||
*
|
||||
* Revision 1.86 2008/03/25 16:45:53 vsc
|
||||
* make or-parallelism compile again
|
||||
*
|
||||
@ -273,7 +276,8 @@ RestoreDBTerm(DBTerm *dbr, int attachments)
|
||||
dbr->ag.attachments = AdjustDBTerm(dbr->ag.attachments, dbr->Contents);
|
||||
#endif
|
||||
} else {
|
||||
dbr->ag.NextDBT = DBTermAdjust(dbr->ag.NextDBT);
|
||||
if (dbr->ag.NextDBT)
|
||||
dbr->ag.NextDBT = DBTermAdjust(dbr->ag.NextDBT);
|
||||
}
|
||||
if (dbr->DBRefs != NULL) {
|
||||
DBRef *cp;
|
||||
@ -368,9 +372,13 @@ static void
|
||||
RestoreDBTermEntry(struct dbterm_list *dbl) {
|
||||
DBTerm *dbt;
|
||||
|
||||
dbt = dbl->dbterms = DBTermAdjust(dbl->dbterms);
|
||||
if (dbl->dbterms)
|
||||
dbt = dbl->dbterms = DBTermAdjust(dbl->dbterms);
|
||||
else
|
||||
return;
|
||||
dbl->clause_code = PtoOpAdjust(dbl->clause_code);
|
||||
dbl->next_dbl = PtoDBTLAdjust(dbl->next_dbl);
|
||||
if (dbl->next_dbl)
|
||||
dbl->next_dbl = PtoDBTLAdjust(dbl->next_dbl);
|
||||
dbl->p = PredEntryAdjust(dbl->p);
|
||||
while (dbt) {
|
||||
RestoreDBTerm(dbt, FALSE);
|
||||
@ -378,35 +386,6 @@ RestoreDBTermEntry(struct dbterm_list *dbl) {
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
restore_switch(CELL *start, CELL *end, int is_func)
|
||||
{
|
||||
CELL *pt = start;
|
||||
if (is_func) {
|
||||
while (pt < end) {
|
||||
yamop **x = (yamop **)(pt+1);
|
||||
Functor *fp = (Functor *)pt;
|
||||
|
||||
*fp = FuncAdjust(*fp);
|
||||
*x = PtoOpAdjust(*x);
|
||||
pt += 2;
|
||||
}
|
||||
} else {
|
||||
while (pt < end) {
|
||||
Term *tp = (Term *)pt;
|
||||
Term t = *tp;
|
||||
yamop **x = (yamop **)(pt+1);
|
||||
|
||||
if (IsAtomTerm(t))
|
||||
*tp = AtomTermAdjust(t);
|
||||
else if (IsApplTerm(t) && *(Functor *)DBRefAdjust(DBRefOfTerm(t)) == FunctorDBRef)
|
||||
*tp = AbsAppl((CELL *)DBRefAdjust(DBRefOfTerm(t)));
|
||||
*x = PtoOpAdjust(*x);
|
||||
pt += 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
CleanLUIndex(LogUpdIndex *idx)
|
||||
{
|
||||
@ -425,9 +404,7 @@ CleanLUIndex(LogUpdIndex *idx)
|
||||
idx->ChildIndex = LUIndexAdjust(idx->ChildIndex);
|
||||
CleanLUIndex(idx->ChildIndex);
|
||||
}
|
||||
if (idx->ClFlags & SwitchTableMask) {
|
||||
restore_switch((CELL *)idx->ClCode, (CELL *)((char *)idx+idx->ClSize), ((idx->ClFlags & FuncSwitchMask) == FuncSwitchMask));
|
||||
} else {
|
||||
if (!(idx->ClFlags & SwitchTableMask)) {
|
||||
restore_opcodes(idx->ClCode);
|
||||
}
|
||||
}
|
||||
@ -444,9 +421,7 @@ CleanSIndex(StaticIndex *idx)
|
||||
idx->ChildIndex = SIndexAdjust(idx->ChildIndex);
|
||||
CleanSIndex(idx->ChildIndex);
|
||||
}
|
||||
if (idx->ClFlags & SwitchTableMask) {
|
||||
restore_switch((CELL *)idx->ClCode, (CELL *)((char *)idx+idx->ClSize), ((idx->ClFlags & FuncSwitchMask) == FuncSwitchMask));
|
||||
} else {
|
||||
if (!(idx->ClFlags & SwitchTableMask)) {
|
||||
restore_opcodes(idx->ClCode);
|
||||
}
|
||||
}
|
||||
@ -790,6 +765,7 @@ restore_codes(void)
|
||||
Yap_heap_regs->terms_module = AtomTermAdjust(Yap_heap_regs->terms_module);
|
||||
Yap_heap_regs->system_module = AtomTermAdjust(Yap_heap_regs->system_module);
|
||||
Yap_heap_regs->readutil_module = AtomTermAdjust(Yap_heap_regs->readutil_module);
|
||||
Yap_heap_regs->hacks_module = AtomTermAdjust(Yap_heap_regs->hacks_module);
|
||||
Yap_heap_regs->globals_module = AtomTermAdjust(Yap_heap_regs->globals_module);
|
||||
Yap_heap_regs->arg_module = AtomTermAdjust(Yap_heap_regs->arg_module);
|
||||
Yap_heap_regs->swi_module = AtomTermAdjust(Yap_heap_regs->swi_module);
|
||||
|
17
H/sshift.h
17
H/sshift.h
@ -340,6 +340,15 @@ BlobTermAdjust (Term t)
|
||||
}
|
||||
|
||||
|
||||
inline EXTERN Term CodeComposedTermAdjust (Term);
|
||||
|
||||
inline EXTERN Term
|
||||
CodeComposedTermAdjust (Term t)
|
||||
{
|
||||
return (Term) ((t - HDiff));
|
||||
}
|
||||
|
||||
|
||||
#else
|
||||
|
||||
inline EXTERN Term BlobTermAdjust (Term);
|
||||
@ -350,6 +359,14 @@ BlobTermAdjust (Term t)
|
||||
return (Term) ((t + HDiff));
|
||||
}
|
||||
|
||||
inline EXTERN Term CodeComposedTermAdjust (Term);
|
||||
|
||||
inline EXTERN Term
|
||||
CodeComposedTermAdjust (Term t)
|
||||
{
|
||||
return (Term) ((t + HDiff));
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -253,11 +253,11 @@ AC_ARG_WITH(max-workers,
|
||||
|
||||
if test "$tabling" = yes -o "$orparallelism" = yes -o "$threads" = yes
|
||||
then
|
||||
AC_DEFINE(MinHeapSpace, (400*SIZEOF_INT_P))
|
||||
AC_DEFINE(MinHeapSpace, (600*SIZEOF_INT_P))
|
||||
AC_DEFINE(MinStackSpace,(300*SIZEOF_INT_P))
|
||||
AC_DEFINE(MinTrailSpace,( 48*SIZEOF_INT_P))
|
||||
else
|
||||
AC_DEFINE(MinHeapSpace, (200*SIZEOF_INT_P))
|
||||
AC_DEFINE(MinHeapSpace, (300*SIZEOF_INT_P))
|
||||
AC_DEFINE(MinStackSpace,(200*SIZEOF_INT_P))
|
||||
AC_DEFINE(MinTrailSpace,( 32*SIZEOF_INT_P))
|
||||
fi
|
||||
|
Reference in New Issue
Block a user