more qly fixes.
This commit is contained in:
parent
6df5d0a214
commit
ae05e95815
33
C/qlyr.c
33
C/qlyr.c
@ -324,7 +324,16 @@ TermToGlobalOrAtomAdjust(Term t)
|
|||||||
#define IntegerAdjust(D) (D)
|
#define IntegerAdjust(D) (D)
|
||||||
#define AddrAdjust(P) (P)
|
#define AddrAdjust(P) (P)
|
||||||
#define MFileAdjust(P) (P)
|
#define MFileAdjust(P) (P)
|
||||||
#define CodeVarAdjust(P) (P)
|
|
||||||
|
#define CodeVarAdjust(P) CodeVarAdjust__(P PASS_REGS)
|
||||||
|
static inline Term
|
||||||
|
CodeVarAdjust__ (Term var USES_REGS)
|
||||||
|
{
|
||||||
|
if (var == 0L)
|
||||||
|
return var;
|
||||||
|
return (Term)(CharP(var) + LOCAL_HDiff);
|
||||||
|
}
|
||||||
|
|
||||||
#define ConstantAdjust(P) (P)
|
#define ConstantAdjust(P) (P)
|
||||||
#define ArityAdjust(P) (P)
|
#define ArityAdjust(P) (P)
|
||||||
#define DoubleInCodeAdjust(P)
|
#define DoubleInCodeAdjust(P)
|
||||||
@ -373,6 +382,12 @@ BlobTermInCodeAdjust__ (Term t USES_REGS)
|
|||||||
return (Term) ((char *)(t) + LOCAL_HDiff);
|
return (Term) ((char *)(t) + LOCAL_HDiff);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#define DBTermAdjust(P) DBTermAdjust__(P PASS_REGS)
|
||||||
|
static inline DBTerm *
|
||||||
|
DBTermAdjust__ (DBTerm * dbtp USES_REGS)
|
||||||
|
{
|
||||||
|
return (DBTerm *) ((DBTerm *) (CharP (dbtp) + LOCAL_HDiff));
|
||||||
|
}
|
||||||
#define CellPtoHeapAdjust(P) (P)
|
#define CellPtoHeapAdjust(P) (P)
|
||||||
#define PtoAtomHashEntryAdjust(P) (P)
|
#define PtoAtomHashEntryAdjust(P) (P)
|
||||||
#define CellPtoHeapCellAdjust(P) (P)
|
#define CellPtoHeapCellAdjust(P) (P)
|
||||||
@ -384,7 +399,6 @@ BlobTermInCodeAdjust__ (Term t USES_REGS)
|
|||||||
#define GlobalAdjust(P) (P)
|
#define GlobalAdjust(P) (P)
|
||||||
#define DBRefAdjust(P) (P)
|
#define DBRefAdjust(P) (P)
|
||||||
#define DBRefPAdjust(P) (P)
|
#define DBRefPAdjust(P) (P)
|
||||||
#define DBTermAdjust(P) (P)
|
|
||||||
#define LUIndexAdjust(P) (P)
|
#define LUIndexAdjust(P) (P)
|
||||||
#define SIndexAdjust(P) (P)
|
#define SIndexAdjust(P) (P)
|
||||||
#define LocalAddrAdjust(P) (P)
|
#define LocalAddrAdjust(P) (P)
|
||||||
@ -398,7 +412,14 @@ BlobTermInCodeAdjust__ (Term t USES_REGS)
|
|||||||
#define PtoDelayAdjust(P) (P)
|
#define PtoDelayAdjust(P) (P)
|
||||||
#define PtoGloAdjust(P) (P)
|
#define PtoGloAdjust(P) (P)
|
||||||
#define PtoLocAdjust(P) (P)
|
#define PtoLocAdjust(P) (P)
|
||||||
#define PtoHeapCellAdjust(P) (P)
|
|
||||||
|
#define PtoHeapCellAdjust(P) PtoHeapCellAdjust__(P PASS_REGS)
|
||||||
|
static inline CELL *
|
||||||
|
PtoHeapCellAdjust__ (CELL * ptr USES_REGS)
|
||||||
|
{
|
||||||
|
return (CELL *) (((CELL *) (CharP (ptr) + LOCAL_HDiff)));
|
||||||
|
}
|
||||||
|
|
||||||
#define TermToGlobalAdjust(P) (P)
|
#define TermToGlobalAdjust(P) (P)
|
||||||
#define PtoOpAdjust(P) PtoOpAdjust__(P PASS_REGS)
|
#define PtoOpAdjust(P) PtoOpAdjust__(P PASS_REGS)
|
||||||
static inline yamop *PtoOpAdjust__(yamop *ptr USES_REGS) {
|
static inline yamop *PtoOpAdjust__(yamop *ptr USES_REGS) {
|
||||||
@ -570,7 +591,7 @@ read_clauses(IOSTREAM *stream, PredEntry *pp, UInt nclauses, UInt flags) {
|
|||||||
LogUpdClause *cl = (LogUpdClause *)Yap_AllocCodeSpace(size);
|
LogUpdClause *cl = (LogUpdClause *)Yap_AllocCodeSpace(size);
|
||||||
|
|
||||||
read_bytes(stream, cl, size);
|
read_bytes(stream, cl, size);
|
||||||
LOCAL_HDiff = (char *)cl-base;
|
LOCAL_HDiff = base-(char *)cl;
|
||||||
RestoreLUClause(cl, pp);
|
RestoreLUClause(cl, pp);
|
||||||
Yap_AssertzClause(pp, cl->ClCode);
|
Yap_AssertzClause(pp, cl->ClCode);
|
||||||
}
|
}
|
||||||
@ -620,7 +641,7 @@ read_clauses(IOSTREAM *stream, PredEntry *pp, UInt nclauses, UInt flags) {
|
|||||||
static void
|
static void
|
||||||
read_pred(IOSTREAM *stream, Term mod) {
|
read_pred(IOSTREAM *stream, Term mod) {
|
||||||
UInt arity = read_uint(stream);
|
UInt arity = read_uint(stream);
|
||||||
UInt nclauses, flags;
|
UInt nclauses, flags, fl1;
|
||||||
PredEntry *ap;
|
PredEntry *ap;
|
||||||
|
|
||||||
if (arity) {
|
if (arity) {
|
||||||
@ -641,6 +662,8 @@ read_pred(IOSTREAM *stream, Term mod) {
|
|||||||
flags = ap->PredFlags = read_uint(stream);
|
flags = ap->PredFlags = read_uint(stream);
|
||||||
nclauses = read_uint(stream);
|
nclauses = read_uint(stream);
|
||||||
ap->cs.p_code.NOfClauses = 0;
|
ap->cs.p_code.NOfClauses = 0;
|
||||||
|
fl1 = flags & (SourcePredFlag|DynamicPredFlag|LogUpdatePredFlag|CompiledPredFlag|MultiFileFlag|TabledPredFlag|MegaClausePredFlag|CountPredFlag|ProfiledPredFlag|ThreadLocalPredFlag);
|
||||||
|
ap->PredFlags |= fl1;
|
||||||
read_clauses(stream, ap, nclauses, flags);
|
read_clauses(stream, ap, nclauses, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user