updates to restore
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2234 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
257c3a2cbc
commit
f4173813ff
1
C/agc.c
1
C/agc.c
@ -116,6 +116,7 @@ AtomAdjust(Atom a)
|
|||||||
#define CharP(X) ((char *)(X))
|
#define CharP(X) ((char *)(X))
|
||||||
|
|
||||||
#define AddrAdjust(P) (P)
|
#define AddrAdjust(P) (P)
|
||||||
|
#define CodeVarAdjust(P) (P)
|
||||||
#define MFileAdjust(P) (P)
|
#define MFileAdjust(P) (P)
|
||||||
#define PredEntryAdjust(P) (P)
|
#define PredEntryAdjust(P) (P)
|
||||||
#define AtomEntryAdjust(P) (P)
|
#define AtomEntryAdjust(P) (P)
|
||||||
|
1
C/save.c
1
C/save.c
@ -1618,6 +1618,7 @@ RestoreHeap(OPCODE old_ops[])
|
|||||||
#endif
|
#endif
|
||||||
/* opcodes_moved has side-effects and should be tried first */
|
/* opcodes_moved has side-effects and should be tried first */
|
||||||
if (heap_moved) {
|
if (heap_moved) {
|
||||||
|
opcodes_moved = TRUE;
|
||||||
RestoreFreeSpace();
|
RestoreFreeSpace();
|
||||||
}
|
}
|
||||||
if (heap_moved || opcodes_moved) {
|
if (heap_moved || opcodes_moved) {
|
||||||
|
4
H/Yap.h
4
H/Yap.h
@ -10,7 +10,7 @@
|
|||||||
* File: Yap.h.m4 *
|
* File: Yap.h.m4 *
|
||||||
* mods: *
|
* mods: *
|
||||||
* comments: main header file for YAP *
|
* comments: main header file for YAP *
|
||||||
* version: $Id: Yap.h,v 1.33 2008-04-02 17:37:06 vsc Exp $ *
|
* version: $Id: Yap.h,v 1.34 2008-05-12 14:04:23 vsc Exp $ *
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
@ -243,7 +243,7 @@ extern char Yap_Option[20];
|
|||||||
#elif defined(__APPLE__) && !__LP64__
|
#elif defined(__APPLE__) && !__LP64__
|
||||||
#define MMAP_ADDR 0x20000000
|
#define MMAP_ADDR 0x20000000
|
||||||
#else
|
#else
|
||||||
#define MMAP_ADDR 0x08800000
|
#define MMAP_ADDR 0x08c00000
|
||||||
#endif
|
#endif
|
||||||
#elif __svr4__ || defined(__SVR4)
|
#elif __svr4__ || defined(__SVR4)
|
||||||
#define MMAP_ADDR 0x02000000
|
#define MMAP_ADDR 0x02000000
|
||||||
|
@ -12,8 +12,11 @@
|
|||||||
* File: rclause.h *
|
* File: rclause.h *
|
||||||
* comments: walk through a clause *
|
* comments: walk through a clause *
|
||||||
* *
|
* *
|
||||||
* Last rev: $Date: 2008-04-01 08:42:46 $,$Author: vsc $ *
|
* Last rev: $Date: 2008-05-12 14:04:23 $,$Author: vsc $ *
|
||||||
* $Log: not supported by cvs2svn $
|
* $Log: not supported by cvs2svn $
|
||||||
|
* Revision 1.25 2008/04/01 08:42:46 vsc
|
||||||
|
* fix restore and small VISTA thingies
|
||||||
|
*
|
||||||
* Revision 1.24 2008/03/25 22:03:14 vsc
|
* Revision 1.24 2008/03/25 22:03:14 vsc
|
||||||
* fix some icc warnings
|
* fix some icc warnings
|
||||||
*
|
*
|
||||||
@ -404,7 +407,6 @@ restore_opcodes(yamop *pc)
|
|||||||
case _p_execute_tail:
|
case _p_execute_tail:
|
||||||
case _p_execute:
|
case _p_execute:
|
||||||
case _p_execute2:
|
case _p_execute2:
|
||||||
pc->u.sla.sla_u.p = PtoPredAdjust(pc->u.sla.sla_u.p);
|
|
||||||
if (pc->u.sla.sla_u.mod != 0) {
|
if (pc->u.sla.sla_u.mod != 0) {
|
||||||
if (IsAtomTerm(pc->u.sla.sla_u.mod))
|
if (IsAtomTerm(pc->u.sla.sla_u.mod))
|
||||||
pc->u.sla.sla_u.mod = AtomTermAdjust(pc->u.sla.sla_u.mod);
|
pc->u.sla.sla_u.mod = AtomTermAdjust(pc->u.sla.sla_u.mod);
|
||||||
|
60
H/rheap.h
60
H/rheap.h
@ -11,8 +11,11 @@
|
|||||||
* File: rheap.h *
|
* File: rheap.h *
|
||||||
* comments: walk through heap code *
|
* comments: walk through heap code *
|
||||||
* *
|
* *
|
||||||
* Last rev: $Date: 2008-04-11 16:58:17 $,$Author: ricroc $ *
|
* Last rev: $Date: 2008-05-12 14:04:23 $,$Author: vsc $ *
|
||||||
* $Log: not supported by cvs2svn $
|
* $Log: not supported by cvs2svn $
|
||||||
|
* Revision 1.96 2008/04/11 16:58:17 ricroc
|
||||||
|
* yapor: seq_def initialization
|
||||||
|
*
|
||||||
* Revision 1.95 2008/04/06 12:06:48 vsc
|
* Revision 1.95 2008/04/06 12:06:48 vsc
|
||||||
* more small fixes
|
* more small fixes
|
||||||
*
|
*
|
||||||
@ -255,8 +258,10 @@ do_clean_susp_clauses(yamop *ipc) {
|
|||||||
static Term
|
static Term
|
||||||
AdjustDBTerm(Term trm, Term *p_base)
|
AdjustDBTerm(Term trm, Term *p_base)
|
||||||
{
|
{
|
||||||
if (IsAtomTerm(trm))
|
if (IsVarTerm(trm))
|
||||||
return AtomTermAdjust(trm);
|
return AtomTermAdjust(trm);
|
||||||
|
if (IsAtomTerm(trm))
|
||||||
|
return CodeVarAdjust(trm);
|
||||||
if (IsPairTerm(trm)) {
|
if (IsPairTerm(trm)) {
|
||||||
Term *p;
|
Term *p;
|
||||||
Term out;
|
Term out;
|
||||||
@ -424,7 +429,7 @@ RestoreDBTermEntry(struct dbterm_list *dbl) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
CleanLUIndex(LogUpdIndex *idx)
|
CleanLUIndex(LogUpdIndex *idx, int recurse)
|
||||||
{
|
{
|
||||||
INIT_LOCK(idx->ClLock);
|
INIT_LOCK(idx->ClLock);
|
||||||
idx->ClPred = PtoPredAdjust(idx->ClPred);
|
idx->ClPred = PtoPredAdjust(idx->ClPred);
|
||||||
@ -435,11 +440,13 @@ CleanLUIndex(LogUpdIndex *idx)
|
|||||||
}
|
}
|
||||||
if (idx->SiblingIndex) {
|
if (idx->SiblingIndex) {
|
||||||
idx->SiblingIndex = LUIndexAdjust(idx->SiblingIndex);
|
idx->SiblingIndex = LUIndexAdjust(idx->SiblingIndex);
|
||||||
CleanLUIndex(idx->SiblingIndex);
|
if (recurse)
|
||||||
|
CleanLUIndex(idx->SiblingIndex, TRUE);
|
||||||
}
|
}
|
||||||
if (idx->ChildIndex) {
|
if (idx->ChildIndex) {
|
||||||
idx->ChildIndex = LUIndexAdjust(idx->ChildIndex);
|
idx->ChildIndex = LUIndexAdjust(idx->ChildIndex);
|
||||||
CleanLUIndex(idx->ChildIndex);
|
if (recurse)
|
||||||
|
CleanLUIndex(idx->ChildIndex, TRUE);
|
||||||
}
|
}
|
||||||
if (!(idx->ClFlags & SwitchTableMask)) {
|
if (!(idx->ClFlags & SwitchTableMask)) {
|
||||||
restore_opcodes(idx->ClCode);
|
restore_opcodes(idx->ClCode);
|
||||||
@ -447,16 +454,18 @@ CleanLUIndex(LogUpdIndex *idx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
CleanSIndex(StaticIndex *idx)
|
CleanSIndex(StaticIndex *idx, int recurse)
|
||||||
{
|
{
|
||||||
idx->ClPred = PtoPredAdjust(idx->ClPred);
|
idx->ClPred = PtoPredAdjust(idx->ClPred);
|
||||||
if (idx->SiblingIndex) {
|
if (idx->SiblingIndex) {
|
||||||
idx->SiblingIndex = SIndexAdjust(idx->SiblingIndex);
|
idx->SiblingIndex = SIndexAdjust(idx->SiblingIndex);
|
||||||
CleanSIndex(idx->SiblingIndex);
|
if (recurse)
|
||||||
|
CleanSIndex(idx->SiblingIndex, TRUE);
|
||||||
}
|
}
|
||||||
if (idx->ChildIndex) {
|
if (idx->ChildIndex) {
|
||||||
idx->ChildIndex = SIndexAdjust(idx->ChildIndex);
|
idx->ChildIndex = SIndexAdjust(idx->ChildIndex);
|
||||||
CleanSIndex(idx->ChildIndex);
|
if (recurse)
|
||||||
|
CleanSIndex(idx->ChildIndex, TRUE);
|
||||||
}
|
}
|
||||||
if (!(idx->ClFlags & SwitchTableMask)) {
|
if (!(idx->ClFlags & SwitchTableMask)) {
|
||||||
restore_opcodes(idx->ClCode);
|
restore_opcodes(idx->ClCode);
|
||||||
@ -614,7 +623,7 @@ restore_codes(void)
|
|||||||
StaticIndex *si = (StaticIndex *)AddrAdjust((ADDR)(Yap_heap_regs->dead_static_indices));
|
StaticIndex *si = (StaticIndex *)AddrAdjust((ADDR)(Yap_heap_regs->dead_static_indices));
|
||||||
Yap_heap_regs->dead_static_indices = si;
|
Yap_heap_regs->dead_static_indices = si;
|
||||||
while (si) {
|
while (si) {
|
||||||
CleanSIndex(si);
|
CleanSIndex(si, FALSE);
|
||||||
si = si->SiblingIndex;
|
si = si->SiblingIndex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -666,6 +675,22 @@ restore_codes(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (Yap_heap_regs->db_erased_list) {
|
||||||
|
LogUpdClause *lcl = Yap_heap_regs->db_erased_list =
|
||||||
|
PtoLUCAdjust(Yap_heap_regs->db_erased_list);
|
||||||
|
while (lcl) {
|
||||||
|
RestoreLUClause(lcl, FALSE);
|
||||||
|
lcl = lcl->ClNext;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (Yap_heap_regs->db_erased_ilist) {
|
||||||
|
LogUpdIndex *icl = Yap_heap_regs->db_erased_ilist =
|
||||||
|
LUIndexAdjust(Yap_heap_regs->db_erased_ilist);
|
||||||
|
while (icl) {
|
||||||
|
CleanLUIndex(icl, FALSE);
|
||||||
|
icl = icl->SiblingIndex;
|
||||||
|
}
|
||||||
|
}
|
||||||
Yap_heap_regs->atom_abol = AtomAdjust(Yap_heap_regs->atom_abol);
|
Yap_heap_regs->atom_abol = AtomAdjust(Yap_heap_regs->atom_abol);
|
||||||
Yap_heap_regs->atom_append = AtomAdjust(Yap_heap_regs->atom_append);
|
Yap_heap_regs->atom_append = AtomAdjust(Yap_heap_regs->atom_append);
|
||||||
Yap_heap_regs->atom_array = AtomAdjust(Yap_heap_regs->atom_array);
|
Yap_heap_regs->atom_array = AtomAdjust(Yap_heap_regs->atom_array);
|
||||||
@ -851,16 +876,6 @@ restore_codes(void)
|
|||||||
PredEntryAdjust(Yap_heap_regs->pred_throw);
|
PredEntryAdjust(Yap_heap_regs->pred_throw);
|
||||||
Yap_heap_regs->pred_handle_throw =
|
Yap_heap_regs->pred_handle_throw =
|
||||||
PredEntryAdjust(Yap_heap_regs->pred_handle_throw);
|
PredEntryAdjust(Yap_heap_regs->pred_handle_throw);
|
||||||
#ifdef DEBUG
|
|
||||||
if (Yap_heap_regs->db_erased_list) {
|
|
||||||
Yap_heap_regs->db_erased_list =
|
|
||||||
PtoLUCAdjust(Yap_heap_regs->db_erased_list);
|
|
||||||
}
|
|
||||||
if (Yap_heap_regs->db_erased_ilist) {
|
|
||||||
Yap_heap_regs->db_erased_ilist =
|
|
||||||
LUIndexAdjust(Yap_heap_regs->db_erased_ilist);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
if (Yap_heap_regs->undef_code != NULL)
|
if (Yap_heap_regs->undef_code != NULL)
|
||||||
Yap_heap_regs->undef_code = (PredEntry *)PtoHeapCellAdjust((CELL *)(Yap_heap_regs->undef_code));
|
Yap_heap_regs->undef_code = (PredEntry *)PtoHeapCellAdjust((CELL *)(Yap_heap_regs->undef_code));
|
||||||
if (Yap_heap_regs->creep_code != NULL)
|
if (Yap_heap_regs->creep_code != NULL)
|
||||||
@ -1050,6 +1065,9 @@ RestoreBB(BlackBoardEntry *pp, int int_key)
|
|||||||
if (!int_key) {
|
if (!int_key) {
|
||||||
pp->KeyOfBB = AtomAdjust(pp->KeyOfBB);
|
pp->KeyOfBB = AtomAdjust(pp->KeyOfBB);
|
||||||
}
|
}
|
||||||
|
if (pp->ModuleOfBB) {
|
||||||
|
pp->ModuleOfBB = AtomTermAdjust(pp->ModuleOfBB);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -1262,9 +1280,9 @@ CleanCode(PredEntry *pp)
|
|||||||
fprintf(stderr, "Correcting indexed code\n");
|
fprintf(stderr, "Correcting indexed code\n");
|
||||||
#endif
|
#endif
|
||||||
if (flag & LogUpdatePredFlag) {
|
if (flag & LogUpdatePredFlag) {
|
||||||
CleanLUIndex(ClauseCodeToLogUpdIndex(pp->cs.p_code.TrueCodeOfPred));
|
CleanLUIndex(ClauseCodeToLogUpdIndex(pp->cs.p_code.TrueCodeOfPred), TRUE);
|
||||||
} else {
|
} else {
|
||||||
CleanSIndex(ClauseCodeToStaticIndex(pp->cs.p_code.TrueCodeOfPred));
|
CleanSIndex(ClauseCodeToStaticIndex(pp->cs.p_code.TrueCodeOfPred), TRUE);
|
||||||
}
|
}
|
||||||
} else if (flag & DynamicPredFlag) {
|
} else if (flag & DynamicPredFlag) {
|
||||||
#ifdef DEBUG_RESTORE2
|
#ifdef DEBUG_RESTORE2
|
||||||
|
@ -328,6 +328,14 @@ AtomTermAdjust (Term at)
|
|||||||
return at + HDiff;
|
return at + HDiff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline EXTERN Term CodeVarAdjust (Term);
|
||||||
|
|
||||||
|
inline EXTERN Term
|
||||||
|
CodeVarAdjust (Term var)
|
||||||
|
{
|
||||||
|
return var + HDiff;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#if TAGS_FAST_OPS
|
#if TAGS_FAST_OPS
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user