From 2c91ebc7bc425ac3dda5311c76b2e1a6b2e3b113 Mon Sep 17 00:00:00 2001 From: vsc Date: Thu, 30 Sep 2004 21:37:41 +0000 Subject: [PATCH] fixes for thread support git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1153 b08c6af1-5177-4d33-ba66-4b1c6b8b522a --- C/absmi.c | 7 +++++-- C/amasm.c | 14 +++++++++++++- C/cdmgr.c | 6 ++++-- C/heapgc.c | 2 +- C/index.c | 8 +++++++- H/amidefs.h | 14 +++++++++++++- library/regexp.yap | 2 +- 7 files changed, 44 insertions(+), 9 deletions(-) diff --git a/C/absmi.c b/C/absmi.c index 89ab20503..3d0877f81 100644 --- a/C/absmi.c +++ b/C/absmi.c @@ -10,8 +10,11 @@ * * * File: absmi.c * * comments: Portable abstract machine interpreter * -* Last rev: $Date: 2004-09-30 19:51:53 $,$Author: vsc $ * +* Last rev: $Date: 2004-09-30 21:37:40 $,$Author: vsc $ * * $Log: not supported by cvs2svn $ +* Revision 1.147 2004/09/30 19:51:53 vsc +* fix overflow from within clause/2 +* * Revision 1.146 2004/09/27 20:45:02 vsc * Mega clauses * Fixes to sizeof(expand_clauses) which was being overestimated @@ -1240,7 +1243,7 @@ Yap_absmi(int inp) { yamop *ipc; #if defined(YAPOR) || defined(THREADS) - PredEntry *pe = PREG->u.Ill.l1->u.ld.p; + PredEntry *pe = PREG->u.Ill.p; #endif /* update ASP before calling IPred */ diff --git a/C/amasm.c b/C/amasm.c index a39523c31..d4e4073eb 100644 --- a/C/amasm.c +++ b/C/amasm.c @@ -11,8 +11,17 @@ * File: amasm.c * * comments: abstract machine assembler * * * -* Last rev: $Date: 2004-09-27 20:45:02 $ * +* Last rev: $Date: 2004-09-30 21:37:40 $ * * $Log: not supported by cvs2svn $ +* Revision 1.63 2004/09/27 20:45:02 vsc +* Mega clauses +* Fixes to sizeof(expand_clauses) which was being overestimated +* Fixes to profiling+indexing +* Fixes to reallocation of memory after restoring +* Make sure all clauses, even for C, end in _Ystop +* Don't reuse space for Streams +* Fix Stream_F on StreaNo+1 +* * Revision 1.62 2004/08/20 16:16:23 vsc * growheap was not checking some compiler instructions * source was getting confused in reconsult @@ -339,6 +348,9 @@ a_lucl(op_numbers opcode, yamop *code_p, int pass_no, struct intermediates *cip) code_p->u.Ill.l1 = emit_ilabel(cip->cpc->rnd1, cip); code_p->u.Ill.l2 = emit_ilabel(cip->cpc->rnd2, cip); code_p->u.Ill.s = cip->cpc->rnd3; +#if defined(YAPOR) || defined(THREADS) + code_p->u.Ill.p = cip->CurrentPred; +#endif } GONEXT(Ill); return code_p; diff --git a/C/cdmgr.c b/C/cdmgr.c index bda104f44..df8abbd3d 100644 --- a/C/cdmgr.c +++ b/C/cdmgr.c @@ -1,4 +1,3 @@ - /************************************************************************* * * * YAP Prolog * @@ -12,8 +11,11 @@ * File: cdmgr.c * * comments: Code manager * * * -* Last rev: $Date: 2004-09-30 19:51:53 $,$Author: vsc $ * +* Last rev: $Date: 2004-09-30 21:37:40 $,$Author: vsc $ * * $Log: not supported by cvs2svn $ +* Revision 1.134 2004/09/30 19:51:53 vsc +* fix overflow from within clause/2 +* * Revision 1.133 2004/09/27 20:45:02 vsc * Mega clauses * Fixes to sizeof(expand_clauses) which was being overestimated diff --git a/C/heapgc.c b/C/heapgc.c index 3e940a003..16822f1d9 100644 --- a/C/heapgc.c +++ b/C/heapgc.c @@ -504,7 +504,7 @@ RBMalloc(UInt size) if ((ADDR)db_vec > Yap_TrailTop-1024) { Yap_growtrail(64 * 1024L); #if USE_SYSTEM_MALLOC - jump; + /* TODO */ #endif } return (rb_red_blk_node *)new; diff --git a/C/index.c b/C/index.c index cf071c9df..381d4e2b3 100644 --- a/C/index.c +++ b/C/index.c @@ -11,8 +11,11 @@ * File: index.c * * comments: Indexing a Prolog predicate * * * -* Last rev: $Date: 2004-09-30 19:51:54 $,$Author: vsc $ * +* Last rev: $Date: 2004-09-30 21:37:41 $,$Author: vsc $ * * $Log: not supported by cvs2svn $ +* Revision 1.100 2004/09/30 19:51:54 vsc +* fix overflow from within clause/2 +* * Revision 1.99 2004/09/27 20:45:03 vsc * Mega clauses * Fixes to sizeof(expand_clauses) which was being overestimated @@ -5802,6 +5805,9 @@ replace_lu_block(LogUpdIndex *blk, int flag, PredEntry *ap, yamop *code, int has codep->opc = Yap_opcode(_enter_lu_pred); codep->u.Ill.s = begin->u.Ill.s; codep->u.Ill.I = ncl; +#if defined(YAPOR) || defined(THREADS) + codep->u.Ill.p = ap; +#endif codep = NEXTOP(codep,Ill); ocodep = begin->u.Ill.l1; if (flag == RECORDA) { diff --git a/H/amidefs.h b/H/amidefs.h index 1a20218b9..de9aeefa1 100644 --- a/H/amidefs.h +++ b/H/amidefs.h @@ -11,8 +11,17 @@ * File: amidefs.h * * comments: Abstract machine peculiarities * * * -* Last rev: $Date: 2004-09-27 20:45:04 $ * +* Last rev: $Date: 2004-09-30 21:37:41 $ * * $Log: not supported by cvs2svn $ +* Revision 1.25 2004/09/27 20:45:04 vsc +* Mega clauses +* Fixes to sizeof(expand_clauses) which was being overestimated +* Fixes to profiling+indexing +* Fixes to reallocation of memory after restoring +* Make sure all clauses, even for C, end in _Ystop +* Don't reuse space for Streams +* Fix Stream_F on StreaNo+1 +* * Revision 1.24 2004/04/14 19:10:40 vsc * expand_clauses: keep a list of clauses to expand * fix new trail scheme for multi-assignment variables @@ -227,6 +236,9 @@ typedef struct yami { struct yami *l1; struct yami *l2; COUNT s; +#if defined(YAPOR) || defined(THREADS) + struct pred_entry *p; +#endif CELL next; } Ill; struct { diff --git a/library/regexp.yap b/library/regexp.yap index 989334960..3e91494de 100644 --- a/library/regexp.yap +++ b/library/regexp.yap @@ -20,7 +20,7 @@ regexp/4 ]). -:- load_foreign_files([regexp,regcomp,regfree,regerror,regexec], [], init_regexp). +:- load_foreign_files([regexp], [], init_regexp). regexp(RegExp, String, Opts) :- length(RegExp, LRE),