diff --git a/C/absmi.c b/C/absmi.c index 771f13699..20d28fa87 100644 --- a/C/absmi.c +++ b/C/absmi.c @@ -10,8 +10,11 @@ * * * File: absmi.c * * comments: Portable abstract machine interpreter * -* Last rev: $Date: 2006-11-28 00:46:28 $,$Author: vsc $ * +* Last rev: $Date: 2006-12-27 01:32:37 $,$Author: vsc $ * * $Log: not supported by cvs2svn $ +* Revision 1.214 2006/11/28 00:46:28 vsc +* fix bug in threaded implementation +* * Revision 1.213 2006/11/27 17:42:02 vsc * support for UNICODE, and other bug fixes. * @@ -13253,7 +13256,7 @@ Yap_absmi(int inp) /* create an to execute the call */ deref_head(d1, execute_comma_comma_unk); execute_comma_comma_nvar: - ENV_YREG[E_CB] = (CELL)pt0[E_CB]; + ENV_YREG[E_CB] = pt0[E_CB]; if (IsAtomTerm(d1)) { ENV_YREG[-EnvSizeInCells-2] = MkIntegerTerm((Int)PredPropByAtom(AtomOfTerm(d1),mod)); } else if (IsApplTerm(d1)) { @@ -13431,7 +13434,7 @@ Yap_absmi(int inp) /* for profiler */ save_pc(); ALWAYS_LOOKAHEAD(pen->OpcodeOfPred); - ENV_YREG[E_CB] = (CELL)B; + ENV_YREG[E_CB] = pt0[E_CB]; #ifdef LOW_LEVEL_TRACER if (Yap_do_low_level_trace) low_level_trace(enter_pred,pen,XREGS+1); diff --git a/C/amasm.c b/C/amasm.c index 614a9b3d7..2de8fb783 100644 --- a/C/amasm.c +++ b/C/amasm.c @@ -11,8 +11,11 @@ * File: amasm.c * * comments: abstract machine assembler * * * -* Last rev: $Date: 2006-12-13 16:10:14 $ * +* Last rev: $Date: 2006-12-27 01:32:37 $ * * $Log: not supported by cvs2svn $ +* Revision 1.93 2006/12/13 16:10:14 vsc +* several debugger and CLP(BN) improvements. +* * Revision 1.92 2006/11/15 00:13:36 vsc * fixes for indexing code. * @@ -440,6 +443,7 @@ a_lucl(op_numbers opcode, yamop *code_p, int pass_no, struct intermediates *cip, code_p->opc = emit_op(opcode); code_p->u.Ill.I = (LogUpdIndex *)cip->code_addr; cip->current_try_lab = &code_p->u.Ill.l1; + cip->current_trust_lab = &code_p->u.Ill.l2; code_p->u.Ill.s = cip->cpc->rnd3; #if defined(YAPOR) || defined(THREADS) code_p->u.Ill.p = cip->CurrentPred; @@ -1744,6 +1748,7 @@ a_try(op_numbers opcode, CELL lab, CELL opr, int nofalts, int hascut, yamop *cod else newcp->opc = emit_op(_trust_logical); newcp->u.lld.t.block = (LogUpdIndex *)(cip->code_addr); + *cip->current_trust_lab = newcp; } newcp->u.lld.d = ClauseCodeToLogUpdClause(emit_a(lab)); cip->current_try_lab = &(newcp->u.lld.n); diff --git a/C/cdmgr.c b/C/cdmgr.c index cd23ab83b..4e9c04ac5 100644 --- a/C/cdmgr.c +++ b/C/cdmgr.c @@ -11,8 +11,11 @@ * File: cdmgr.c * * comments: Code manager * * * -* Last rev: $Date: 2006-12-13 16:10:14 $,$Author: vsc $ * +* Last rev: $Date: 2006-12-27 01:32:37 $,$Author: vsc $ * * $Log: not supported by cvs2svn $ +* Revision 1.201 2006/12/13 16:10:14 vsc +* several debugger and CLP(BN) improvements. +* * Revision 1.200 2006/11/27 17:42:02 vsc * support for UNICODE, and other bug fixes. * @@ -646,7 +649,7 @@ Yap_BuildMegaClause(PredEntry *ap) nof_megaclauses++; #endif while (!(mcl = (MegaClause *)Yap_AllocCodeSpace(required))) { - if (!Yap_growheap(FALSE, sizeof(consult_obj)*ConsultCapacity, NULL)) { + if (!Yap_growheap(FALSE, required, NULL)) { /* just fail, the system will keep on going */ return; } diff --git a/C/exec.c b/C/exec.c index 10e12acbe..1104b7d9a 100644 --- a/C/exec.c +++ b/C/exec.c @@ -137,6 +137,25 @@ p_save_cp(void) return(TRUE); } +static Int +p_save_env_b(void) +{ + Term t = Deref(ARG1); + Term td; +#if SHADOW_HB + register CELL *HBREG = HB; +#endif + if (!IsVarTerm(t)) return(FALSE); + td = cp_as_integer((choiceptr)YENV[E_CB]); + BIND((CELL *)t,td,bind_save_cp); +#ifdef COROUTINING + DO_TRAIL(CellPtr(t), td); + if (CellPtr(t) < H0) Yap_WakeUp((CELL *)t); + bind_save_cp: +#endif + return(TRUE); +} + inline static Int do_execute(Term t, Term mod) { @@ -600,7 +619,8 @@ p_execute_nonstop(void) /* call may not define new system predicates!! */ if (RepPredProp(pe)->PredFlags & SpiedPredFlag) { return CallPredicate(RepPredProp(pe), B, RepPredProp(pe)->cs.p_code.TrueCodeOfPred); - } else if (RepPredProp(pe)->PredFlags & (AsmPredFlag|CPredFlag)) { + } else if ((RepPredProp(pe)->PredFlags & (AsmPredFlag|CPredFlag)) && + RepPredProp(pe)->OpcodeOfPred != Yap_opcode(_call_bfunc_xx)) { return RepPredProp(pe)->cs.f_code(); } else { return CallPredicate(RepPredProp(pe), B, RepPredProp(pe)->CodeOfPred); @@ -1854,6 +1874,7 @@ p_uncaught_throw(void) void Yap_InitExecFs(void) { + Term cm = CurrentModule; Yap_InitComma(); Yap_InitCPred("$execute", 1, p_execute, HiddenPredFlag); Yap_InitCPred("$execute", 2, p_execute2, HiddenPredFlag); @@ -1877,7 +1898,10 @@ Yap_InitExecFs(void) Yap_InitCPred("$execute0", 2, p_execute0, HiddenPredFlag); Yap_InitCPred("$execute_nonstop", 2, p_execute_nonstop, HiddenPredFlag); Yap_InitCPred("$execute_clause", 4, p_execute_clause, HiddenPredFlag); - Yap_InitCPred("$save_current_choice_point", 1, p_save_cp, HiddenPredFlag); + CurrentModule = HACKS_MODULE; + Yap_InitCPred("current_choice_point", 1, p_save_cp, HiddenPredFlag); + Yap_InitCPred("env_choice_point", 1, p_save_env_b, HiddenPredFlag); + CurrentModule = cm; Yap_InitCPred("$pred_goal_expansion_on", 0, p_pred_goal_expansion_on, SafePredFlag|HiddenPredFlag); Yap_InitCPred("$restore_regs", 1, p_restore_regs, SafePredFlag|HiddenPredFlag); Yap_InitCPred("$restore_regs", 2, p_restore_regs2, SafePredFlag|HiddenPredFlag); diff --git a/C/globals.c b/C/globals.c index 128cd90b3..b1039179f 100644 --- a/C/globals.c +++ b/C/globals.c @@ -269,10 +269,10 @@ static int GrowArena(Term arena, CELL *pt, UInt old_size, UInt size, UInt arity) { if (size == 0) { - if (old_size < 64*1024) { + if (old_size < 1024*1024) { size = old_size; } else { - size = 64*1024; + size = 1024*1024; } } if (size < 4096) { @@ -299,7 +299,6 @@ GrowArena(Term arena, CELL *pt, UInt old_size, UInt size, UInt arity) } else { XREGS[arity+1] = arena; if ((size=Yap_InsertInGlobal(pt, size*sizeof(CELL)))==0) { - Yap_Error(OUT_OF_STACK_ERROR, TermNil, Yap_ErrorMessage); return FALSE; } size = size/sizeof(CELL); @@ -573,12 +572,16 @@ copy_complex_term(register CELL *pt0, register CELL *pt0_end, CELL *ptf, CELL *H to_visit = bp[0]; HB = HLow; ptf++; + if ((ADDR)TR > Yap_TrailTop-128) + goto trail_overflow; Bind_and_Trail(ptd0, ptf[-1]); } } else { #endif /* first time we met this term */ RESET_VARIABLE(ptf); + if ((ADDR)TR > Yap_TrailTop-128) + goto trail_overflow; Bind_and_Trail(ptd0, (CELL)ptf); ptf++; #ifdef COROUTINING @@ -644,6 +647,7 @@ copy_complex_term(register CELL *pt0, register CELL *pt0_end, CELL *ptf, CELL *H reset_trail(TR0); return -2; + #if COROUTINING delay_overflow: /* oops, we're in trouble */ @@ -661,13 +665,30 @@ copy_complex_term(register CELL *pt0, register CELL *pt0_end, CELL *ptf, CELL *H } #endif reset_trail(TR0); - return -2; + return -3; #endif + trail_overflow: + /* oops, we're in trouble */ + H = HLow; + /* we've done it */ + /* restore our nice, friendly, term to its original state */ + HB = HB0; +#ifdef RATIONAL_TREES + while (to_visit > to_visit0) { + to_visit -= 4; + pt0 = to_visit[0]; + pt0_end = to_visit[1]; + ptf = to_visit[2]; + *pt0 = (CELL)to_visit[3]; + } +#endif + reset_trail(TR0); + return -4; } static Term -CopyTermToArena(Term t, Term arena, UInt arity, Term *newarena, Term *att_arenap) +CopyTermToArena(Term t, Term arena, UInt arity, Term *newarena, Term *att_arenap, Int min_grow) { UInt old_size = ArenaSz(arena); CELL *oldH = H; @@ -782,6 +803,10 @@ CopyTermToArena(Term t, Term arena, UInt arity, Term *newarena, Term *att_arenap } } else { H += 1+ArityOfFunctor(f); + if (H > ASP-128) { + res = -1; + goto error_handler; + } if ((res = copy_complex_term(ap, ap+ArityOfFunctor(f), HB0+1, HB0, att_arenap)) < 0) { goto error_handler; } @@ -808,13 +833,13 @@ CopyTermToArena(Term t, Term arena, UInt arity, Term *newarena, Term *att_arenap switch (res) { case -1: /* handle arena overflow */ - if (!GrowArena(arena, old_top, old_size, 0L, arity+4)) { + if (!GrowArena(arena, old_top, old_size, min_grow, arity+4)) { Yap_Error(OUT_OF_STACK_ERROR, TermNil, Yap_ErrorMessage); return 0L; } break; #if COROUTINING - case -2: + case -3: /* handle delay arena overflow */ old_size = DelayArenaSz(*att_arenap); if (!GrowDelayArena(att_arenap, old_size, 0L, arity+4)) { @@ -823,6 +848,13 @@ CopyTermToArena(Term t, Term arena, UInt arity, Term *newarena, Term *att_arenap } break; #endif + case -4: + /* handle trail overflow */ + if(!Yap_growtrail (sizeof(CELL) * 16 * 1024L, FALSE)) { + Yap_Error(OUT_OF_TRAIL_ERROR, TermNil, Yap_ErrorMessage); + return 0L; + } + break; default: /* temporary space overflow */ if (!Yap_ExpandPreAllocCodeSpace(0,NULL)) { Yap_Error(OUT_OF_AUXSPACE_ERROR, TermNil, Yap_ErrorMessage); @@ -919,7 +951,7 @@ p_nb_setval(void) return (FALSE); } ge = GetGlobalEntry(AtomOfTerm(t)); - to = CopyTermToArena(ARG2, GlobalArena, 2, &GlobalArena, &GlobalDelayArena); + to = CopyTermToArena(ARG2, GlobalArena, 2, &GlobalArena, &GlobalDelayArena, 0); if (to == 0L) return FALSE; WRITE_LOCK(ge->GRWLock); @@ -1181,7 +1213,7 @@ p_nb_queue_enqueue(void) arena = GetQueueArena(qd,"enqueue"); if (arena == 0L) return FALSE; - to = CopyTermToArena(ARG2, arena, 2, qd+QUEUE_ARENA, qd+QUEUE_DELAY_ARENA); + to = CopyTermToArena(ARG2, arena, 2, qd+QUEUE_ARENA, qd+QUEUE_DELAY_ARENA,ArenaPt(arena)-RepPair(qd[QUEUE_HEAD])); if (to == 0L) return FALSE; qd = GetQueue(ARG1,"enqueue"); @@ -1193,8 +1225,7 @@ p_nb_queue_enqueue(void) old_sz = ArenaSz(arena); qsize = IntegerOfTerm(qd[QUEUE_SIZE]); while (old_sz < 128) { - UInt gsiz = qsize*2; - + UInt gsiz = H-RepPair(qd[QUEUE_HEAD]); H = oldH; HB = oldHB; if (gsiz > 1024*1024) { @@ -1203,6 +1234,7 @@ p_nb_queue_enqueue(void) gsiz = 1024; } ARG3 = to; + fprintf(stderr,"growing %d cells\n",gsiz); if (!GrowArena(arena, ArenaLimit(arena), old_sz, gsiz, 3)) { Yap_Error(OUT_OF_STACK_ERROR, arena, Yap_ErrorMessage); return 0L; @@ -1511,9 +1543,9 @@ p_nb_heap_add_to_heap(void) arena = qd[HEAP_ARENA]; if (arena == 0L) return FALSE; - key = CopyTermToArena(ARG2, arena, 3, qd+HEAP_ARENA, qd+HEAP_DELAY_ARENA); + key = CopyTermToArena(ARG2, arena, 3, qd+HEAP_ARENA, qd+HEAP_DELAY_ARENA, 0); arena = qd[HEAP_ARENA]; - to = CopyTermToArena(ARG3, arena, 3, qd+HEAP_ARENA, qd+HEAP_DELAY_ARENA); + to = CopyTermToArena(ARG3, arena, 3, qd+HEAP_ARENA, qd+HEAP_DELAY_ARENA, 0); if (key == 0 || to == 0L) return FALSE; qd = GetHeap(ARG1,"add_to_heap"); @@ -1912,9 +1944,9 @@ p_nb_beam_add_to_beam(void) arena = qd[HEAP_ARENA]; if (arena == 0L) return FALSE; - key = CopyTermToArena(ARG2, qd[HEAP_ARENA], 3, qd+HEAP_ARENA, qd+HEAP_DELAY_ARENA); + key = CopyTermToArena(ARG2, qd[HEAP_ARENA], 3, qd+HEAP_ARENA, qd+HEAP_DELAY_ARENA, 0); arena = qd[HEAP_ARENA]; - to = CopyTermToArena(ARG3, arena, 3, qd+HEAP_ARENA, qd+HEAP_DELAY_ARENA); + to = CopyTermToArena(ARG3, arena, 3, qd+HEAP_ARENA, qd+HEAP_DELAY_ARENA, 0); if (key == 0 || to == 0L) return FALSE; qd = GetHeap(ARG1,"add_to_beam"); diff --git a/C/grow.c b/C/grow.c index 29661d1e7..4f9934816 100644 --- a/C/grow.c +++ b/C/grow.c @@ -662,7 +662,8 @@ static_growglobal(long size, CELL **ptr, CELL *hsplit) #else if (!do_grow) { TrDiff = DelayDiff = LDiff = 0; - GDiff = size; + /* don't grow more than what we asked for */ + GDiff = size-(size0-sz); } else if (minimal_request) { DelayDiff = size-size0; TrDiff = LDiff = GDiff = size; @@ -672,7 +673,7 @@ static_growglobal(long size, CELL **ptr, CELL *hsplit) } #endif if (hsplit) { - GDiff0 = GDiff-sz; + GDiff0 = GDiff-size0; GSplit = hsplit; } else { GDiff0 = DelayDiff; diff --git a/C/index.c b/C/index.c index 836380c0b..9cbbacb4e 100644 --- a/C/index.c +++ b/C/index.c @@ -11,8 +11,11 @@ * File: index.c * * comments: Indexing a Prolog predicate * * * -* Last rev: $Date: 2006-11-27 17:42:02 $,$Author: vsc $ * +* Last rev: $Date: 2006-12-27 01:32:37 $,$Author: vsc $ * * $Log: not supported by cvs2svn $ +* Revision 1.179 2006/11/27 17:42:02 vsc +* support for UNICODE, and other bug fixes. +* * Revision 1.178 2006/11/21 16:21:31 vsc * fix I/O mess * fix spy/reconsult mess @@ -6218,8 +6221,11 @@ find_last_clause(yamop *start) } static void -remove_clause_from_index(yamop **prevp, yamop *curp, LogUpdClause *cl) +remove_clause_from_index(yamop *header, LogUpdClause *cl) { + yamop **prevp = &(header->u.Ill.l1); + yamop *curp = header->u.Ill.l1; + if (curp->u.lld.d == cl) { yamop *newp = curp->u.lld.n; newp->opc = curp->opc; @@ -6232,6 +6238,8 @@ remove_clause_from_index(yamop **prevp, yamop *curp, LogUpdClause *cl) curp = curp->u.lld.n; } /* in case we were the last */ + if (curp == header->u.Ill.l2) + header->u.Ill.l2 = ocurp; if (ocurp != ocurp0) ocurp->opc = curp->opc; ocurp->u.lld.n = curp->u.lld.n; @@ -6247,12 +6255,13 @@ remove_clause_from_index(yamop **prevp, yamop *curp, LogUpdClause *cl) } static void -remove_dirty_clauses_from_index(yamop **prevp, yamop *curp) +remove_dirty_clauses_from_index(yamop *header) { LogUpdClause *cl; - OPCODE startopc = curp->opc; yamop *previouscurp; OPCODE endop = Yap_opcode(_trust_logical); + yamop **prevp= &(header->u.Ill.l1), *curp = header->u.Ill.l1; + OPCODE startopc = curp->opc; PredEntry *ap = curp->u.lld.d->ClPred; if (ap->PredFlags & CountPredFlag) @@ -6289,6 +6298,7 @@ remove_dirty_clauses_from_index(yamop **prevp, yamop *curp) previouscurp->opc = endop; previouscurp->u.lld.t.block = curp->u.lld.t.block; previouscurp->u.lld.n = NULL; + header->u.Ill.l2 = previouscurp; Yap_LUIndexSpace_CP -= (UInt)NEXTOP((yamop*)NULL,lld); Yap_FreeCodeSpace((ADDR)curp); return; @@ -6357,8 +6367,7 @@ kill_clause(yamop *ipc, yamop *bg, yamop *lt, path_stack_entry *sp0, PredEntry * !(blk->ClFlags & InUseMask) #endif ) { - remove_clause_from_index(&start->u.Ill.l1, - start->u.Ill.l1, + remove_clause_from_index(start, ClauseCodeToLogUpdClause(bg)); } else { blk->ClFlags |= DirtyMask; @@ -6675,34 +6684,13 @@ add_to_index(struct intermediates *cint, int first, path_stack_entry *sp, Clause switch(op) { case _try_logical: - if (first) { - /* ERROR */ - } else { - /* just go to next instruction */ - ipc = ipc->u.lld.n; - } - break; case _retry_logical: case _count_retry_logical: case _profiled_retry_logical: - ipc = ipc->u.lld.n; - break; case _trust_logical: case _count_trust_logical: case _profiled_trust_logical: - if (first) { - /* ERROR */ - } else { - if (ap->PredFlags & CountPredFlag) - ipc->opc = Yap_opcode(_count_trust_logical); - else if (ap->PredFlags & ProfiledPredFlag) - ipc->opc = Yap_opcode(_profiled_trust_logical); - else - ipc->opc = Yap_opcode(_retry_logical); - ipc->u.lld.n = add_trust(icl, cls, cint); - ipc->u.lld.t.s = ap->ArityOfPE; - } - ipc = pop_path(&sp, cls, ap); + /* ERROR */ break; case _enter_lu_pred: ipc->u.Ill.s++; @@ -6715,11 +6703,23 @@ add_to_index(struct intermediates *cint, int first, path_stack_entry *sp, Clause else ipc->u.Ill.l1->opc = Yap_opcode(_retry_logical); ipc->u.Ill.l1 = add_try(ap, cls, ipc->u.Ill.l1, cint); - ipc = pop_path(&sp, cls, ap); } else { /* just go to next instruction */ - ipc = ipc->u.Ill.l1; + yamop *end = add_trust(icl, cls, cint), + *old = ipc->u.Ill.l2; + + /* we used to have two clauses */ + if (ap->PredFlags & CountPredFlag) + old->opc = Yap_opcode(_count_retry_logical); + else if (ap->PredFlags & ProfiledPredFlag) + old->opc = Yap_opcode(_profiled_retry_logical); + else + old->opc = Yap_opcode(_retry_logical); + old->u.lld.n = end; + old->u.lld.t.s = ap->ArityOfPE; + ipc->u.Ill.l2 = end; } + ipc = pop_path(&sp, cls, ap); break; case _try_clause: /* I cannot expand a predicate that starts on a variable, @@ -8480,6 +8480,6 @@ Yap_CleanUpIndex(LogUpdIndex *blk) op = Yap_op_from_opcode(start->opc); } codep = start->u.Ill.l1; - remove_dirty_clauses_from_index(&start->u.Ill.l1, start->u.Ill.l1); + remove_dirty_clauses_from_index(start); } diff --git a/C/init.c b/C/init.c index b4dc689a1..6594d177a 100644 --- a/C/init.c +++ b/C/init.c @@ -882,6 +882,7 @@ InitCodes(void) Yap_heap_regs->terms_module = MkAtomTerm(Yap_LookupAtom("terms")); Yap_heap_regs->system_module = MkAtomTerm(Yap_LookupAtom("system")); Yap_heap_regs->readutil_module = MkAtomTerm(Yap_LookupAtom("readutil")); + Yap_heap_regs->hacks_module = MkAtomTerm(Yap_LookupAtom("yap_hacks")); Yap_heap_regs->globals_module = MkAtomTerm(Yap_LookupAtom("nb")); Yap_InitModules(); #ifdef BEAM diff --git a/C/inlines.c b/C/inlines.c index 299a6a818..18b4918ef 100755 --- a/C/inlines.c +++ b/C/inlines.c @@ -825,7 +825,6 @@ void Yap_InitInlines(void) { Yap_InitAsmPred("$$cut_by", 1, _cut_by, p_cut_by, SafePredFlag); - Yap_InitAsmPred("atom", 1, _atom, p_atom, SafePredFlag); Yap_InitAsmPred("atomic", 1, _atomic, p_atomic, SafePredFlag); Yap_InitAsmPred("integer", 1, _integer, p_integer, SafePredFlag); diff --git a/C/modules.c b/C/modules.c index a22495f2c..44272365b 100644 --- a/C/modules.c +++ b/C/modules.c @@ -184,7 +184,9 @@ Yap_InitModules(void) ModuleName[7] = READUTIL_MODULE; ModuleName[8] = + HACKS_MODULE; + ModuleName[9] = GLOBALS_MODULE; - NoOfModules = 9; + NoOfModules = 10; CurrentModule = PROLOG_MODULE; } diff --git a/C/tracer.c b/C/tracer.c index 0c2c9c9bf..e077ccbc3 100644 --- a/C/tracer.c +++ b/C/tracer.c @@ -162,6 +162,17 @@ low_level_trace(yap_low_level_port port, PredEntry *pred, CELL *args) sc = Yap_heap_regs; vsc_count++; #ifdef COMMENTED + if (vsc_count > 1388060LL && vsc_count < 1388070LL) { + if (vsc_count==1388061LL) + jmp_deb(1); + if (vsc_count % 1LL == 0) { + UInt sz = Yap_regp->H0_[17]; + UInt end = sizeof(MP_INT)/sizeof(CELL)+sz+1; + fprintf(stderr,"VAL %lld %d %x/%x\n",vsc_count,sz,H0[16],H0[16+end]); + } + } else + return; + Yap_DebugPlWrite(Yap_XREGS[2]); if (worker_id != 04 || worker_id != 03) return; // if (vsc_count == 218280) // vsc_xstop = 1; diff --git a/C/utilpreds.c b/C/utilpreds.c index ff123952e..81292d7a1 100644 --- a/C/utilpreds.c +++ b/C/utilpreds.c @@ -380,7 +380,15 @@ CopyTerm(Term inp, UInt arity) { tf = AbsAppl(H); H[0] = (CELL)f; H += 1+ArityOfFunctor(f); - { + if (H > ASP-128) { + H -= 1+ArityOfFunctor(f); + if (!Yap_gcl((ASP-H)*sizeof(CELL),arity+1, ENV, P)) { + Yap_Error(OUT_OF_STACK_ERROR, TermNil, Yap_ErrorMessage); + return FALSE; + } + t = Deref(XREGS[arity+1]); + goto restart_appl; + } else { int res; if ((res = copy_complex_term(ap, ap+ArityOfFunctor(f), HB0+1, HB0)) < 0) { diff --git a/H/Heap.h b/H/Heap.h index 82423788b..be1bdb497 100644 --- a/H/Heap.h +++ b/H/Heap.h @@ -10,7 +10,7 @@ * File: Heap.h * * mods: * * comments: Heap Init Structure * -* version: $Id: Heap.h,v 1.110 2006-11-28 13:46:41 vsc Exp $ * +* version: $Id: Heap.h,v 1.111 2006-12-27 01:32:37 vsc Exp $ * *************************************************************************/ /* information that can be stored in Code Space */ @@ -486,6 +486,7 @@ typedef struct various_codes { terms_module, system_module, readutil_module, + hacks_module, globals_module; void *last_wtime; struct pred_entry *pred_goal_expansion; @@ -783,6 +784,7 @@ struct various_codes *Yap_heap_regs; #define TERMS_MODULE Yap_heap_regs->terms_module #define SYSTEM_MODULE Yap_heap_regs->system_module #define READUTIL_MODULE Yap_heap_regs->readutil_module +#define HACKS_MODULE Yap_heap_regs->hacks_module #define GLOBALS_MODULE Yap_heap_regs->globals_module #define PredGoalExpansion Yap_heap_regs->pred_goal_expansion #define PredMetaCall Yap_heap_regs->pred_meta_call diff --git a/H/compile.h b/H/compile.h index ae655f7f7..704f82e7e 100644 --- a/H/compile.h +++ b/H/compile.h @@ -248,7 +248,7 @@ typedef struct intermediates { yamop *expand_block; UInt i_labelno; /* for expanding code */ - yamop **current_try_lab; + yamop **current_try_lab, **current_trust_lab; yamop *try_instructions; union { struct static_index *si; diff --git a/changes-5.1.html b/changes-5.1.html index 3898548d0..894a33033 100644 --- a/changes-5.1.html +++ b/changes-5.1.html @@ -16,6 +16,8 @@

Yap-5.1.2: