diff --git a/C/absmi.c b/C/absmi.c index 73433b9f7..e7235e58f 100644 --- a/C/absmi.c +++ b/C/absmi.c @@ -557,11 +557,13 @@ static inline Term rbig(MP_INT *big) static PredEntry * creep_allowed(PredEntry *p, PredEntry *p0) { + if (!p0) + return NULL; if (p0 == PredMetaCall) return p0; if (!p0->ModuleOfPred && - (!p->ModuleOfPred - || + (!p || + !p->ModuleOfPred || p->PredFlags & StandardPredFlag)) return NULL; return p; @@ -2693,6 +2695,7 @@ Yap_absmi(int inp) Yap_op_from_opcode(PREG->opc) != Yap_opcode(_cut_e)) { GONext(); } + PP = PREG->u.p.p; ASP = YREG+E_CB; /* cut_e */ if (SREG <= ASP) { @@ -2732,8 +2735,8 @@ Yap_absmi(int inp) } if (!(ActiveSignals & YAP_CREEP_SIGNAL)) { SREG = (CELL *)RepPredProp(Yap_GetPredPropByFunc(Yap_MkFunctor(AtomRestoreRegs,2),0)); - XREGS[0] = YREG[PREG->u.y.y]; - PREG = NEXTOP(PREG,y); + XREGS[0] = YREG[PREG->u.yp.y]; + PREG = NEXTOP(PREG,yp); goto creep_either; } /* don't do debugging and friends here */ @@ -2763,8 +2766,8 @@ Yap_absmi(int inp) #endif /* DEPTH_LIMIT */ ENDCACHE_Y_AS_ENV(); } - XREGS[0] = XREG(PREG->u.x.x); - PREG = NEXTOP(PREG,x); + XREGS[0] = XREG(PREG->u.xp.x); + PREG = NEXTOP(PREG,xp); goto creep_either; } /* don't do debugging and friends here */ @@ -3106,9 +3109,9 @@ Yap_absmi(int inp) GONext(); ENDOp(); - Op(deallocate, e); + Op(deallocate, p); CACHE_Y_AS_ENV(YREG); - PREG = NEXTOP(PREG, e); + PREG = NEXTOP(PREG, p); /* other instructions do depend on S being set by deallocate :-( */ SREG = YREG; diff --git a/C/amasm.c b/C/amasm.c index 4f720ca92..7c45c7bb9 100644 --- a/C/amasm.c +++ b/C/amasm.c @@ -517,6 +517,17 @@ a_e(op_numbers opcode, yamop *code_p, int pass_no) return code_p; } +inline static yamop * +a_p0(op_numbers opcode, yamop *code_p, int pass_no, PredEntry *p0) +{ + if (pass_no) { + code_p->opc = emit_op(opcode); + code_p->u.p.p = p0; + } + GONEXT(p); + return code_p; +} + inline static yamop * a_ue(op_numbers opcode, op_numbers opcodew, yamop *code_p, int pass_no) { @@ -2155,7 +2166,7 @@ a_deallocate(clause_info *clinfo, yamop *code_p, int pass_no, struct intermediat cip->cpc = cip->cpc->nextInst; code_p = a_p(_dexecute, clinfo, code_p, pass_no, cip); } else - code_p = a_e(_deallocate, code_p, pass_no); + code_p = a_p0(_deallocate, code_p, pass_no, cip->CurrentPred); clinfo->dealloc_found = TRUE; } return code_p; @@ -3682,7 +3693,8 @@ Yap_InitComma(void) code_p->u.sbpp.bmap = NULL; GONEXT(sbpp); code_p->opc = emit_op(_deallocate); - GONEXT(e); + code_p->u.p.p = PredMetaCall; + GONEXT(p); code_p->opc = emit_op(_procceed); code_p->u.p.p = PredMetaCall; GONEXT(p); diff --git a/C/cdmgr.c b/C/cdmgr.c index 1a5c8ab51..0582fcd78 100644 --- a/C/cdmgr.c +++ b/C/cdmgr.c @@ -3919,11 +3919,13 @@ ClauseInfoForCode(yamop *codeptr, CODEADDR *startp, CODEADDR *endp) { *endp = (CODEADDR)cl+cl->ClSize; return cl->ClPred; } + case _deallocate: + pc = NEXTOP(pc,p); + break; case _cut: case _cut_t: case _cut_e: case _allocate: - case _deallocate: case _write_void: case _write_list: case _write_l_list: diff --git a/C/index.c b/C/index.c index 823c3e04e..2202b6d4e 100644 --- a/C/index.c +++ b/C/index.c @@ -980,7 +980,6 @@ has_cut(yamop *pc) case _trust_fail: case _op_fail: case _allocate: - case _deallocate: case _write_void: case _write_list: case _write_l_list: @@ -1298,7 +1297,8 @@ has_cut(yamop *pc) pc = NEXTOP(pc,c); break; /* instructions type p */ - case _procceed: + case _deallocate: + case _procceed: pc = NEXTOP(pc,p); break; /* instructions type sc */ @@ -1479,8 +1479,10 @@ add_info(ClauseDef *clause, UInt regno) case _cut_e: clause->Tag = (CELL)NULL; return; - case _allocate: case _deallocate: + cl = NEXTOP(cl,p); + break; + case _allocate: case _write_void: case _write_list: case _write_l_list: diff --git a/C/init.c b/C/init.c index 6d1ec9719..cca200073 100644 --- a/C/init.c +++ b/C/init.c @@ -507,7 +507,7 @@ Yap_InitCPred(char *Name, unsigned long int Arity, CPredicate code, int flags) if (flags & SafePredFlag) { sz = (CELL)NEXTOP(NEXTOP(NEXTOP(p_code,sbpp),p),l); } else { - sz = (CELL)NEXTOP(NEXTOP(NEXTOP(NEXTOP(NEXTOP(p_code,e),sbpp),e),p),l); + sz = (CELL)NEXTOP(NEXTOP(NEXTOP(NEXTOP(NEXTOP(p_code,e),sbpp),p),p),l); } cl = (StaticClause *)Yap_AllocCodeSpace(sz); if (!cl) { @@ -544,7 +544,8 @@ Yap_InitCPred(char *Name, unsigned long int Arity, CPredicate code, int flags) p_code = NEXTOP(p_code,sbpp); if (!(flags & SafePredFlag)) { p_code->opc = Yap_opcode(_deallocate); - p_code = NEXTOP(p_code,e); + p_code->u.p.p = pe; + p_code = NEXTOP(p_code,p); } p_code->opc = Yap_opcode(_procceed); p_code->u.p.p = pe; diff --git a/C/tracer.c b/C/tracer.c index a0496a460..3caf9af9d 100644 --- a/C/tracer.c +++ b/C/tracer.c @@ -164,6 +164,10 @@ 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 < 2473000LL) + return; + if (vsc_count == 2473801LL) + jmp_deb(1); #ifdef THREADS Yap_heap_regs->thread_handle[worker_id].thread_inst_count++; #endif diff --git a/H/YapOpcodes.h b/H/YapOpcodes.h index 10debba61..92954736e 100644 --- a/H/YapOpcodes.h +++ b/H/YapOpcodes.h @@ -46,7 +46,7 @@ OPCODE(call ,sbpp), OPCODE(procceed ,p), OPCODE(allocate ,e), - OPCODE(deallocate ,e), + OPCODE(deallocate ,p), #ifdef BEAM OPCODE(retry_eam ,e), #endif diff --git a/H/rclause.h b/H/rclause.h index 0407093a1..c64cd707e 100644 --- a/H/rclause.h +++ b/H/rclause.h @@ -149,7 +149,6 @@ restore_opcodes(yamop *pc) case _cut: case _cut_e: case _cut_t: - case _deallocate: case _enter_a_profiling: case _expand_index: case _index_blob: @@ -353,6 +352,7 @@ restore_opcodes(yamop *pc) /* instructions type p */ case _count_call: case _count_retry: + case _deallocate: case _enter_profiling: case _lock_lu: case _procceed: diff --git a/LGPL/chr b/LGPL/chr index ef9e506ca..293457c65 160000 --- a/LGPL/chr +++ b/LGPL/chr @@ -1 +1 @@ -Subproject commit ef9e506ca3befa9589b683ddd7e482411c00b759 +Subproject commit 293457c65497bf63027c24cf954e6b4965f70df3 diff --git a/library/Makefile.in b/library/Makefile.in index 7f40ae662..e661b0713 100644 --- a/library/Makefile.in +++ b/library/Makefile.in @@ -79,9 +79,14 @@ MYDDAS_PROGRAMS= $(srcdir)/MYDDAS/myddas.ypp \ $(srcdir)/MYDDAS/myddas_util_predicates.ypp \ $(srcdir)/MYDDAS/myddas_prolog2sql_optimizer.ypp +DIALECT_PROGRAMS= $(srcdir)/../shlib/dialect/hprolog.pl + + install: $(PROGRAMS) install_myddas mkdir -p $(DESTDIR)$(SHAREDIR)/Yap + mkdir -p $(DESTDIR)$(SHAREDIR)/Yap/dialect for p in $(PROGRAMS); do $(INSTALL_DATA) $$p $(DESTDIR)$(SHAREDIR)/Yap; done + for p in $(DIALECT_PROGRAMS); do $(INSTALL_DATA) $$p $(DESTDIR)$(SHAREDIR)/Yap/dialect; done install_myddas: $(MYDDAS_PROGRAMS) count=`echo "$(YAP_EXTRAS)" | grep MYDDAS | wc -l`; \ diff --git a/shlib b/shlib index 548ceefdb..9ca7abd12 160000 --- a/shlib +++ b/shlib @@ -1 +1 @@ -Subproject commit 548ceefdbbeb2bdc8bcc2abbc49a8cf5a557c238 +Subproject commit 9ca7abd128989d971a265c856bea3e1770812664