force wakeups before !
This commit is contained in:
parent
eb4e59652f
commit
d64af810da
88
C/absmi.c
88
C/absmi.c
@ -2214,7 +2214,13 @@ Yap_absmi(int inp)
|
||||
|
||||
/* cut */
|
||||
Op(cut, e);
|
||||
PREG = NEXTOP(PREG, e);
|
||||
#ifdef COROUTINING
|
||||
CACHE_Y_AS_ENV(YREG);
|
||||
check_stack(NoStackCut, H);
|
||||
ENDCACHE_Y_AS_ENV();
|
||||
do_cut:
|
||||
#endif
|
||||
PREG = NEXTOP(NEXTOP(NEXTOP(PREG, e),Osbpp),l);
|
||||
{
|
||||
choiceptr d0;
|
||||
/* assume cut is always in stack */
|
||||
@ -2254,7 +2260,13 @@ Yap_absmi(int inp)
|
||||
/* cut_t */
|
||||
/* cut_t does the same as cut */
|
||||
Op(cut_t, e);
|
||||
PREG = NEXTOP(PREG, e);
|
||||
#ifdef COROUTINING
|
||||
CACHE_Y_AS_ENV(YREG);
|
||||
check_stack(NoStackCutT, H);
|
||||
ENDCACHE_Y_AS_ENV();
|
||||
do_cut_t:
|
||||
#endif
|
||||
PREG = NEXTOP(NEXTOP(NEXTOP(PREG, e),Osbpp),l);
|
||||
{
|
||||
choiceptr d0;
|
||||
|
||||
@ -2309,7 +2321,13 @@ Yap_absmi(int inp)
|
||||
|
||||
/* cut_e */
|
||||
Op(cut_e, e);
|
||||
PREG = NEXTOP(PREG, e);
|
||||
#ifdef COROUTINING
|
||||
CACHE_Y_AS_ENV(YREG);
|
||||
check_stack(NoStackCutE, H);
|
||||
ENDCACHE_Y_AS_ENV();
|
||||
do_cut_e:
|
||||
#endif
|
||||
PREG = NEXTOP(NEXTOP(NEXTOP(PREG, e),Osbpp),l);
|
||||
{
|
||||
choiceptr d0;
|
||||
/* we assume dealloc leaves in S the previous env */
|
||||
@ -2742,6 +2760,66 @@ Yap_absmi(int inp)
|
||||
|
||||
#ifdef COROUTINING
|
||||
|
||||
/* This is easier: I know there is an environment so I cannot do allocate */
|
||||
NoStackCut:
|
||||
/* find something to fool S */
|
||||
if (!ActiveSignals || ActiveSignals & YAP_CDOVF_SIGNAL) {
|
||||
goto do_cut;
|
||||
}
|
||||
if (ActiveSignals & YAP_FAIL_SIGNAL) {
|
||||
ActiveSignals &= ~YAP_FAIL_SIGNAL;
|
||||
if (!ActiveSignals)
|
||||
CreepFlag = CalculateStackGap();
|
||||
FAIL();
|
||||
}
|
||||
if (!(ActiveSignals & YAP_CREEP_SIGNAL)) {
|
||||
SREG = (CELL *)PredRestoreRegs;
|
||||
XREGS[0] = MkIntegerTerm(LCL0-(CELL *)YREG[E_CB]);
|
||||
PREG = NEXTOP(PREG,e);
|
||||
goto creep_either;
|
||||
}
|
||||
/* don't do debugging and friends here */
|
||||
goto do_cut;
|
||||
|
||||
NoStackCutT:
|
||||
/* find something to fool S */
|
||||
if (!ActiveSignals || ActiveSignals & YAP_CDOVF_SIGNAL) {
|
||||
goto do_cut_t;
|
||||
}
|
||||
if (ActiveSignals & YAP_FAIL_SIGNAL) {
|
||||
ActiveSignals &= ~YAP_FAIL_SIGNAL;
|
||||
if (!ActiveSignals)
|
||||
CreepFlag = CalculateStackGap();
|
||||
FAIL();
|
||||
}
|
||||
if (!(ActiveSignals & YAP_CREEP_SIGNAL)) {
|
||||
SREG = (CELL *)PredRestoreRegs;
|
||||
XREGS[0] = MkIntegerTerm(LCL0-(CELL *)YREG[E_CB]);
|
||||
PREG = NEXTOP(PREG,e);
|
||||
goto creep_either;
|
||||
}
|
||||
/* don't do debugging and friends here */
|
||||
goto do_cut_t;
|
||||
|
||||
NoStackCutE:
|
||||
if (!ActiveSignals || ActiveSignals & YAP_CDOVF_SIGNAL) {
|
||||
goto do_cut_t;
|
||||
}
|
||||
if (ActiveSignals & YAP_FAIL_SIGNAL) {
|
||||
ActiveSignals &= ~YAP_FAIL_SIGNAL;
|
||||
if (!ActiveSignals)
|
||||
CreepFlag = CalculateStackGap();
|
||||
FAIL();
|
||||
}
|
||||
if (!(ActiveSignals & YAP_CREEP_SIGNAL)) {
|
||||
SREG = (CELL *)PredRestoreRegs;
|
||||
XREGS[0] = MkIntegerTerm(LCL0-(CELL *)SREG[E_CB]);
|
||||
PREG = NEXTOP(PREG,e);
|
||||
goto creep_either;
|
||||
}
|
||||
/* don't do debugging and friends here */
|
||||
goto do_cut_e;
|
||||
|
||||
/* This is easier: I know there is an environment so I cannot do allocate */
|
||||
NoStackCommitY:
|
||||
PP = PREG->u.yp.p0;
|
||||
@ -2756,7 +2834,7 @@ Yap_absmi(int inp)
|
||||
FAIL();
|
||||
}
|
||||
if (!(ActiveSignals & YAP_CREEP_SIGNAL)) {
|
||||
SREG = (CELL *)RepPredProp(Yap_GetPredPropByFunc(FunctorRestoreRegs,0));
|
||||
SREG = (CELL *)PredRestoreRegs;
|
||||
XREGS[0] = YREG[PREG->u.yp.y];
|
||||
PREG = NEXTOP(PREG,yp);
|
||||
goto creep_either;
|
||||
@ -2778,7 +2856,7 @@ Yap_absmi(int inp)
|
||||
FAIL();
|
||||
}
|
||||
if (!(ActiveSignals & YAP_CREEP_SIGNAL)) {
|
||||
SREG = (CELL *)RepPredProp(Yap_GetPredPropByFunc(FunctorRestoreRegs,0));
|
||||
SREG = (CELL *)PredRestoreRegs;
|
||||
#if USE_THREADED_CODE
|
||||
if (PREG->opc == (OPCODE)OpAddress[_fcall])
|
||||
#else
|
||||
|
@ -3397,8 +3397,7 @@ do_pass(int pass_no, yamop **entry_codep, int assembling, int *clause_has_blobsp
|
||||
code_p = a_cnp(_native_me, code_p, pass_no, cip);
|
||||
break;
|
||||
case cutexit_op:
|
||||
code_p = a_cut(&clinfo, code_p, pass_no, cip);
|
||||
if (cip->CurrentPred->PredFlags & LogUpdatePredFlag &&
|
||||
if (cip->CurrentPred->PredFlags & LogUpdatePredFlag &&
|
||||
(*clause_has_blobsp || *clause_has_dbtermp) &&
|
||||
!clinfo.alloc_found)
|
||||
code_p = a_cle(_alloc_for_logical_pred, code_p, pass_no, cip);
|
||||
@ -3409,7 +3408,7 @@ do_pass(int pass_no, yamop **entry_codep, int assembling, int *clause_has_blobsp
|
||||
!clinfo.alloc_found)
|
||||
code_p = a_e(_unlock_lu, code_p, pass_no);
|
||||
#endif
|
||||
code_p = a_pl(_procceed, cip->CurrentPred, code_p, pass_no);
|
||||
code_p = a_cut(&clinfo, code_p, pass_no, cip);
|
||||
break;
|
||||
case allocate_op:
|
||||
clinfo.alloc_found = 2;
|
||||
|
@ -1495,12 +1495,19 @@ c_goal(Term Goal, Term mod, compiler_struct *cglobs)
|
||||
PELOCK(42,cglobs->cint.CurrentPred);
|
||||
if (is_tabled(cglobs->cint.CurrentPred)) {
|
||||
Yap_emit_3ops(cut_op, Zero, Zero, Zero, &cglobs->cint);
|
||||
/* needs to adjust previous commits */
|
||||
Yap_emit(empty_call_op, Zero, Zero, &cglobs->cint);
|
||||
Yap_emit(restore_tmps_and_skip_op, Zero, Zero, &cglobs->cint);
|
||||
Yap_emit(table_new_answer_op, Zero, cglobs->cint.CurrentPred->ArityOfPE, &cglobs->cint);
|
||||
}
|
||||
else
|
||||
#endif /* TABLING */
|
||||
{
|
||||
Yap_emit_3ops(cutexit_op, Zero, Zero, Zero, &cglobs->cint);
|
||||
/* needs to adjust previous commits */
|
||||
Yap_emit(empty_call_op, Zero, Zero, &cglobs->cint);
|
||||
Yap_emit(restore_tmps_and_skip_op, Zero, Zero, &cglobs->cint);
|
||||
Yap_emit(procceed_op, Zero, Zero, &cglobs->cint);
|
||||
}
|
||||
#ifdef TABLING
|
||||
UNLOCK(cglobs->cint.CurrentPred->PELock);
|
||||
@ -1509,6 +1516,8 @@ c_goal(Term Goal, Term mod, compiler_struct *cglobs)
|
||||
else {
|
||||
Yap_emit_3ops(cut_op, Zero, Zero, Zero, &cglobs->cint);
|
||||
/* needs to adjust previous commits */
|
||||
Yap_emit(empty_call_op, Zero, Zero, &cglobs->cint);
|
||||
Yap_emit(restore_tmps_and_skip_op, Zero, Zero, &cglobs->cint);
|
||||
adjust_current_commits(cglobs);
|
||||
}
|
||||
return;
|
||||
|
@ -172,6 +172,8 @@ low_level_trace(yap_low_level_port port, PredEntry *pred, CELL *args)
|
||||
LOCK(Yap_heap_regs->low_level_trace_lock);
|
||||
sc = Yap_heap_regs;
|
||||
vsc_count++;
|
||||
if (vsc_count==29)
|
||||
jmp_deb(1);
|
||||
#ifdef THREADS
|
||||
MY_ThreadHandle.thread_inst_count++;
|
||||
#endif
|
||||
|
@ -133,6 +133,7 @@
|
||||
#define PredHandleThrow Yap_heap_regs->pred_handle_throw
|
||||
#define PredIs Yap_heap_regs->pred_is
|
||||
#define PredSafeCallCleanup Yap_heap_regs->pred_safe_call_cleanup
|
||||
#define PredRestoreRegs Yap_heap_regs->pred_restore_regs
|
||||
#ifdef YAPOR
|
||||
#define PredGetwork Yap_heap_regs->pred_getwork
|
||||
#define PredGetworkSeq Yap_heap_regs->pred_getwork_seq
|
||||
|
@ -133,6 +133,7 @@
|
||||
struct pred_entry *pred_handle_throw;
|
||||
struct pred_entry *pred_is;
|
||||
struct pred_entry *pred_safe_call_cleanup;
|
||||
struct pred_entry *pred_restore_regs;
|
||||
#ifdef YAPOR
|
||||
struct pred_entry *pred_getwork;
|
||||
struct pred_entry *pred_getwork_seq;
|
||||
|
@ -133,6 +133,7 @@
|
||||
Yap_heap_regs->pred_handle_throw = RepPredProp(PredPropByFunc(FunctorHandleThrow,PROLOG_MODULE));
|
||||
Yap_heap_regs->pred_is = RepPredProp(PredPropByFunc(FunctorIs,PROLOG_MODULE));
|
||||
Yap_heap_regs->pred_safe_call_cleanup = RepPredProp(PredPropByFunc(FunctorSafeCallCleanup,PROLOG_MODULE));
|
||||
Yap_heap_regs->pred_restore_regs = RepPredProp(PredPropByFunc(FunctorRestoreRegs,PROLOG_MODULE));
|
||||
#ifdef YAPOR
|
||||
Yap_heap_regs->pred_getwork = RepPredProp(PredPropByAtom(AtomGetwork,PROLOG_MODULE));
|
||||
Yap_heap_regs->pred_getwork_seq = RepPredProp(PredPropByAtom(AtomGetworkSeq,PROLOG_MODULE));
|
||||
|
@ -133,6 +133,7 @@
|
||||
Yap_heap_regs->pred_handle_throw = PtoPredAdjust(Yap_heap_regs->pred_handle_throw);
|
||||
Yap_heap_regs->pred_is = PtoPredAdjust(Yap_heap_regs->pred_is);
|
||||
Yap_heap_regs->pred_safe_call_cleanup = PtoPredAdjust(Yap_heap_regs->pred_safe_call_cleanup);
|
||||
Yap_heap_regs->pred_restore_regs = PtoPredAdjust(Yap_heap_regs->pred_restore_regs);
|
||||
#ifdef YAPOR
|
||||
Yap_heap_regs->pred_getwork = PtoPredAdjust(Yap_heap_regs->pred_getwork);
|
||||
Yap_heap_regs->pred_getwork_seq = PtoPredAdjust(Yap_heap_regs->pred_getwork_seq);
|
||||
|
@ -96,6 +96,7 @@ TEXI2DVI=texi2dvi
|
||||
TEXI2HTML=texi2html
|
||||
TEXI2PDF=texi2pdf
|
||||
YAPLIB=@YAPLIB@
|
||||
SONAMEFLAG=@SONAMEFLAG@
|
||||
|
||||
#4.1VPATH=@srcdir@:@srcdir@/OPTYap
|
||||
CWD=$(PWD)
|
||||
@ -539,7 +540,7 @@ libYap.a: $(LIB_OBJECTS)
|
||||
$(RANLIB) libYap.a
|
||||
|
||||
@DYNYAPLIB@: $(LIB_OBJECTS)
|
||||
@YAPLIB_LD@ -o @YAPLIB@ $(LIB_OBJECTS) $(LIBS) $(LDFLAGS)
|
||||
@YAPLIB_LD@ -o @YAPLIB@ $(LIB_OBJECTS) $(LIBS) $(LDFLAGS) $(SONAMEFLAG)
|
||||
|
||||
install: install_bin install_data
|
||||
|
||||
|
@ -141,6 +141,7 @@ struct pred_entry *pred_throw PredThrow MkPred FunctorThrow PROLOG_MODULE
|
||||
struct pred_entry *pred_handle_throw PredHandleThrow MkPred FunctorHandleThrow PROLOG_MODULE
|
||||
struct pred_entry *pred_is PredIs MkPred FunctorIs PROLOG_MODULE
|
||||
struct pred_entry *pred_safe_call_cleanup PredSafeCallCleanup MkPred FunctorSafeCallCleanup PROLOG_MODULE
|
||||
struct pred_entry *pred_restore_regs PredRestoreRegs MkPred FunctorRestoreRegs PROLOG_MODULE
|
||||
#ifdef YAPOR
|
||||
struct pred_entry *pred_getwork PredGetwork MkPred AtomGetwork 0 PROLOG_MODULE
|
||||
struct pred_entry *pred_getwork_seq PredGetworkSeq MkPred AtomGetworkSeq 0 PROLOG_MODULE
|
||||
|
Reference in New Issue
Block a user