diff --git a/C/absmi.c b/C/absmi.c index 807f55968..5033081ee 100644 --- a/C/absmi.c +++ b/C/absmi.c @@ -1544,7 +1544,7 @@ Yap_absmi(int inp) } #endif PREG = NEXTOP(PREG, L); - GONext(); + JMPNext(); ENDBOp(); /* copy database term */ @@ -1618,7 +1618,7 @@ Yap_absmi(int inp) #ifdef DEPTH_LIMIT DEPTH = YREG[E_DEPTH]; #endif - GONext(); + JMPNext(); ENDBOp(); @@ -1670,7 +1670,7 @@ Yap_absmi(int inp) #ifdef DEPTH_LIMIT DEPTH = YREG[E_DEPTH]; #endif - GONext(); + JMPNext(); ENDBOp(); @@ -2023,7 +2023,7 @@ Yap_absmi(int inp) #endif /* LOW_LEVEL_TRACER */ #ifdef FROZEN_STACKS #ifdef YAPOR_SBA - if (pt0 < TR_FZ || pt0 > CurrentTrailTop) + if (pt0 < TR_FZ || pt0 > CurrentTrailTop+MinTrailGap) #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, CurrentTrailTop) + IN_BETWEEN(LOCAL_TrailBase, pt1, CurrentTrailTop+MinTrailGap) #endif /* YAPOR_SBA */ ) { @@ -2646,7 +2646,7 @@ Yap_absmi(int inp) !(LOCAL_ActiveSignals & ~YAP_CREEP_SIGNAL)) || (PREG->opc != Yap_opcode(_procceed) && PREG->opc != Yap_opcode(_cut_e))) { - GONext(); + JMPNext(); } PP = PREVOP(PREG,p)->u.p.p; ASP = YREG+E_CB; @@ -7902,7 +7902,7 @@ Yap_absmi(int inp) } #endif } - GONext(); + JMPNext(); ENDBOp(); BOp(try_logical, OtaLl); @@ -8559,7 +8559,7 @@ Yap_absmi(int inp) } PREG = NEXTOP(PREG, aFlp); - GONext(); + JMPNext(); ENDBOp(); diff --git a/C/exec.c b/C/exec.c index 9c0b37695..8b4d3ddc5 100644 --- a/C/exec.c +++ b/C/exec.c @@ -1630,7 +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; + CurrentTrailTop = (tr_fr_ptr)(LOCAL_TrailTop-MinTrailGap); /* notice that an initial choice-point and environment *must* be created since for the garbage collector to work */ B = NULL; diff --git a/C/grow.c b/C/grow.c index 71ebb5c45..72642470c 100644 --- a/C/grow.c +++ b/C/grow.c @@ -125,7 +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; + CurrentTrailTop = (tr_fr_ptr)(LOCAL_TrailTop-MinTrailGap); if (LOCAL_GDiff) { /* make sure we are not just expanding the delay stack */ LOCAL_GlobalBase = BaseAddrAdjust(LOCAL_GlobalBase); @@ -1851,7 +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; + CurrentTrailTop = (tr_fr_ptr)(LOCAL_TrailTop-MinTrailGap); 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; diff --git a/H/Regs.h b/H/Regs.h index 849f01512..782cde3d3 100644 --- a/H/Regs.h +++ b/H/Regs.h @@ -37,7 +37,7 @@ #endif #ifdef __x86_64__ -#undef PUSH_REGS +#define PUSH_REGS 1 #undef PUSH_X #endif diff --git a/H/absmi.h b/H/absmi.h index 9ac2b4163..0bf239e22 100644 --- a/H/absmi.h +++ b/H/absmi.h @@ -96,13 +96,12 @@ register struct yami* P1REG asm ("bp"); /* can't use yamop before Yap.h */ #ifdef BP_FREE #undef BP_FREE #endif -#define SHADOW_REGS 1 #define SHADOW_S 1 //#define SHADOW_Y 1 #define S_IN_MEM 1 #define Y_IN_MEM 1 #define TR_IN_MEM 1 -#define USE_PREFETCH 1 +#define LIMITED_PREFETCH 1 #endif /* __x86_64__ */ #else /* other compilers */ @@ -361,7 +360,7 @@ restore_absmi_regs(REGSTORE * old_regs) #define DO_PREFETCH_W(TYPE) to_go = (void *)(NEXTOP(PREG,TYPE)->u.o.opcw) -#if LIMITED_PREFETCH +#if LIMITED_PREFETCH||USE_PREFETCH #define ALWAYS_START_PREFETCH(TYPE) \ { register void *to_go; DO_PREFETCH(TYPE) @@ -448,7 +447,7 @@ restore_absmi_regs(REGSTORE * old_regs) #define JMPNextW() \ JMP((void *)(PREG->u.o.opcw)) -#if USE_THREADED_CODE && LIMITED_PREFETCH +#if USE_THREADED_CODE && (LIMITED_PREFETCH || USE_PREFETCH) #define ALWAYS_GONext() JMP(to_go) @@ -682,10 +681,10 @@ Macros to check the limits of stacks #else -#define check_trail(x) if (Unsigned(CurrentTrailTop) - Unsigned(x) < MinTrailGap) \ +#define check_trail(x) if (Unsigned(CurrentTrailTop) > Unsigned(x)) \ goto notrailleft -#define check_trail_in_indexing(x) if (Unsigned(CurrentTrailTop) - Unsigned(x) < MinTrailGap) \ +#define check_trail_in_indexing(x) if (Unsigned(CurrentTrailTop) < Unsigned(x)) \ goto notrailleft_from_index #endif @@ -725,7 +724,7 @@ Macros to check the limits of stacks #define store_at_least_one_arg(arity) \ BEGP(pt0); \ pt0 = XREGS+(arity); \ - do { register CELL x = pt0[0]; \ + do { CELL x = pt0[0]; \ S_YREG = (S_YREG)-1; \ --pt0; \ (S_YREG)[0] = x; \