small fixes to avoid using global reg.
This commit is contained in:
parent
bab27a5761
commit
36d20477fb
@ -902,9 +902,9 @@ Yap_absmi(int inp)
|
||||
#ifdef YAPOR
|
||||
SCH_set_load(B_YREG);
|
||||
#endif /* YAPOR */
|
||||
PREG = NEXTOP(PREG, Otapl);
|
||||
SET_BB(B_YREG);
|
||||
ENDCACHE_Y();
|
||||
PREG = NEXTOP(PREG, Otapl);
|
||||
GONext();
|
||||
ENDOp();
|
||||
|
||||
@ -2023,7 +2023,7 @@ Yap_absmi(int inp)
|
||||
#endif /* LOW_LEVEL_TRACER */
|
||||
#ifdef FROZEN_STACKS
|
||||
#ifdef YAPOR_SBA
|
||||
if (pt0 < TR_FZ || pt0 > (tr_fr_ptr)LOCAL_TrailTop)
|
||||
if (pt0 < TR_FZ || pt0 > CurrentTrailTop)
|
||||
#else
|
||||
if (pt0 < TR_FZ)
|
||||
#endif /* YAPOR_SBA */
|
||||
@ -2073,7 +2073,7 @@ Yap_absmi(int inp)
|
||||
#ifdef YAPOR_SBA
|
||||
(ADDR) pt1 >= HeapTop
|
||||
#else
|
||||
IN_BETWEEN(LOCAL_TrailBase, pt1, LOCAL_TrailTop)
|
||||
IN_BETWEEN(LOCAL_TrailBase, pt1, CurrentTrailTop)
|
||||
#endif /* YAPOR_SBA */
|
||||
)
|
||||
{
|
||||
|
1
C/exec.c
1
C/exec.c
@ -1630,6 +1630,7 @@ Yap_InitYaamRegs(void)
|
||||
H = H0 = ((CELL *) LOCAL_GlobalBase)+ Yap_AttsSize/sizeof(CELL);
|
||||
RESET_VARIABLE(H0-1);
|
||||
LCL0 = ASP = (CELL *) LOCAL_LocalBase;
|
||||
CurrentTrailTop = (tr_fr_ptr)LOCAL_TrailTop;
|
||||
/* notice that an initial choice-point and environment
|
||||
*must* be created since for the garbage collector to work */
|
||||
B = NULL;
|
||||
|
2
C/grow.c
2
C/grow.c
@ -125,6 +125,7 @@ SetHeapRegs(int copying_threads USES_REGS)
|
||||
/* Adjust stack addresses */
|
||||
LOCAL_TrailBase = TrailAddrAdjust(LOCAL_TrailBase);
|
||||
LOCAL_TrailTop = TrailAddrAdjust(LOCAL_TrailTop);
|
||||
CurrentTrailTop = (tr_fr_ptr)LOCAL_TrailTop;
|
||||
if (LOCAL_GDiff) {
|
||||
/* make sure we are not just expanding the delay stack */
|
||||
LOCAL_GlobalBase = BaseAddrAdjust(LOCAL_GlobalBase);
|
||||
@ -1850,6 +1851,7 @@ Yap_CopyThreadStacks(int worker_q, int worker_p, int incremental)
|
||||
LOCAL_LocalBase = REMOTE_LocalBase(worker_p);
|
||||
LOCAL_TrailBase = REMOTE_TrailBase(worker_p);
|
||||
LOCAL_TrailTop = REMOTE_TrailTop(worker_p);
|
||||
CurrentTrailTop = (tr_fr_ptr)LOCAL_TrailTop;
|
||||
size = REMOTE_ThreadHandle(worker_q).stack_address-REMOTE_ThreadHandle(worker_p).stack_address;
|
||||
LOCAL_TrDiff = LOCAL_LDiff = LOCAL_GDiff = LOCAL_GDiff0 = LOCAL_DelayDiff = LOCAL_BaseDiff = size;
|
||||
LOCAL_XDiff = LOCAL_HDiff = 0;
|
||||
|
2
H/Regs.h
2
H/Regs.h
@ -113,6 +113,7 @@ typedef struct regstore_t
|
||||
CELL *ENV_; /* 1 current environment */
|
||||
CELL *ASP_; /* 8 top of local stack */
|
||||
CELL *LCL0_; /* 3 local stack base */
|
||||
tr_fr_ptr CurrentTrailTop_; /* 10 Auxiliary stack top */
|
||||
ADDR AuxBase_; /* 9 Auxiliary base pointer */
|
||||
CELL *AuxSp_; /* 9 Auxiliary stack pointer */
|
||||
ADDR AuxTop_; /* 10 Auxiliary stack top */
|
||||
@ -630,6 +631,7 @@ EXTERN inline void restore_B(void) {
|
||||
#define AuxBase Yap_REGS.AuxBase_
|
||||
#define AuxSp Yap_REGS.AuxSp_
|
||||
#define AuxTop Yap_REGS.AuxTop_
|
||||
#define CurrentTrailTop Yap_REGS.CurrentTrailTop_
|
||||
#define EX Yap_REGS.EX_
|
||||
#define DEPTH Yap_REGS.DEPTH_
|
||||
#if defined(YAPOR_SBA) || defined(TABLING)
|
||||
|
@ -682,10 +682,10 @@ Macros to check the limits of stacks
|
||||
|
||||
#else
|
||||
|
||||
#define check_trail(x) if (Unsigned(LOCAL_TrailTop) - Unsigned(x) < MinTrailGap) \
|
||||
#define check_trail(x) if (Unsigned(CurrentTrailTop) - Unsigned(x) < MinTrailGap) \
|
||||
goto notrailleft
|
||||
|
||||
#define check_trail_in_indexing(x) if (Unsigned(LOCAL_TrailTop) - Unsigned(x) < MinTrailGap) \
|
||||
#define check_trail_in_indexing(x) if (Unsigned(CurrentTrailTop) - Unsigned(x) < MinTrailGap) \
|
||||
goto notrailleft_from_index
|
||||
|
||||
#endif
|
||||
@ -733,7 +733,7 @@ Macros to check the limits of stacks
|
||||
while ( pt0 > XREGS ); \
|
||||
ENDP(pt0)
|
||||
|
||||
#if LOW_LEVEL_TRACER
|
||||
#if LOW_LEVEL_TRACER && 0
|
||||
#define COUNT_CPS() LOCAL_total_choicepoints++
|
||||
#else
|
||||
#define COUNT_CPS()
|
||||
|
Reference in New Issue
Block a user