put YAPOR back to life.

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2187 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc
2008-04-01 22:28:41 +00:00
parent 5459617266
commit 0dd21aab71
6 changed files with 29 additions and 51 deletions

View File

@@ -12,7 +12,7 @@
* Last rev: *
* mods: *
* comments: allocating space *
* version:$Id: alloc.c,v 1.90 2008-03-25 16:45:52 vsc Exp $ *
* version:$Id: alloc.c,v 1.91 2008-04-01 22:28:41 vsc Exp $ *
*************************************************************************/
#ifdef SCCS
static char SccsId[] = "%W% %G%";
@@ -136,6 +136,8 @@ Yap_FreeAtomSpace(char *p)
Yap_PrologMode &= ~MallocMode;
}
#endif
/* If you need to dinamically allocate space from the heap, this is
* the macro you should use */
ADDR
@@ -199,8 +201,6 @@ Yap_ExpandPreAllocCodeSpace(UInt sz0, void *cip)
return ptr;
}
#endif
#if USE_SYSTEM_MALLOC
struct various_codes *Yap_heap_regs;
@@ -651,18 +651,6 @@ Yap_AllocCodeSpace(unsigned int size)
return out;
}
ADDR
Yap_ExpandPreAllocCodeSpace(UInt sz, void *cip)
{
if (sz < SCRATCH_INC_SIZE)
sz = SCRATCH_INC_SIZE;
sz = AdjustLargePageSize(sz+sz/4);
if (!Yap_growheap((cip!=NULL), sz, cip)) {
Yap_Error(OUT_OF_HEAP_ERROR, TermNil, Yap_ErrorMessage);
return NULL;
}
return Addr(HeapTop) + sizeof(CELL);
}
#endif

View File

@@ -11,8 +11,11 @@
* File: amasm.c *
* comments: abstract machine assembler *
* *
* Last rev: $Date: 2008-03-25 16:45:52 $ *
* Last rev: $Date: 2008-04-01 22:28:41 $ *
* $Log: not supported by cvs2svn $
* Revision 1.100 2008/03/25 16:45:52 vsc
* make or-parallelism compile again
*
* Revision 1.99 2008/01/23 17:57:44 vsc
* valgrind it!
* enable atom garbage collection.
@@ -2705,8 +2708,8 @@ static yamop *
do_pass(int pass_no, yamop **entry_codep, int assembling, int *clause_has_blobsp, int *clause_has_dbtermp, struct intermediates *cip, UInt size)
{
#ifdef YAPOR
#define EITHER_INST 50
yamop *either_inst[EITHER_INST];
#define MAX_DISJ_BRANCHES 256
yamop *either_inst[MAX_DISJ_BRANCHES];
int either_cont = 0;
#endif /* YAPOR */
int log_update;
@@ -3086,10 +3089,6 @@ do_pass(int pass_no, yamop **entry_codep, int assembling, int *clause_has_blobsp
break;
case commit_b_op:
code_p = a_v(_commit_b_x, code_p, pass_no, cip->cpc);
#ifdef YAPOR
if (pass_no)
PUT_YAMOP_CUT(*entry_codep);
#endif /* YAPOR */
break;
case save_pair_op:
code_p = a_uv((Ventry *) cip->cpc->rnd1, _save_pair_x, _save_pair_x_write, code_p, pass_no);
@@ -3103,10 +3102,6 @@ do_pass(int pass_no, yamop **entry_codep, int assembling, int *clause_has_blobsp
break;
case cut_op:
code_p = a_cut(&clinfo, code_p, pass_no, cip);
#ifdef YAPOR
if (pass_no)
PUT_YAMOP_CUT(*entry_codep);
#endif /* YAPOR */
break;
case cutexit_op:
code_p = a_cut(&clinfo, code_p, pass_no, cip);
@@ -3114,17 +3109,13 @@ do_pass(int pass_no, yamop **entry_codep, int assembling, int *clause_has_blobsp
(*clause_has_blobsp || *clause_has_dbtermp) &&
!clinfo.alloc_found)
code_p = a_cle(_alloc_for_logical_pred, code_p, pass_no, cip);
#if THREADS
#if defined(THREADS) || defined(YAPOR)
else
if (cip->CurrentPred->PredFlags & LogUpdatePredFlag &&
!(cip->CurrentPred->PredFlags & ThreadLocalPredFlag))
code_p = a_e(_unlock_lu, code_p, pass_no);
#endif
code_p = a_pl(_procceed, cip->CurrentPred, code_p, pass_no);
#ifdef YAPOR
if (pass_no)
PUT_YAMOP_CUT(*entry_codep);
#endif /* YAPOR */
break;
case allocate_op:
clinfo.alloc_found = 2;
@@ -3217,7 +3208,7 @@ do_pass(int pass_no, yamop **entry_codep, int assembling, int *clause_has_blobsp
(*clause_has_blobsp || *clause_has_dbtermp) &&
!clinfo.alloc_found)
code_p = a_cle(_alloc_for_logical_pred, code_p, pass_no, cip);
#if THREADS
#if defined(THREADS) || defined(YAPOR)
else
if (cip->CurrentPred->PredFlags & LogUpdatePredFlag &&
!(cip->CurrentPred->PredFlags & ThreadLocalPredFlag))
@@ -3229,7 +3220,7 @@ do_pass(int pass_no, yamop **entry_codep, int assembling, int *clause_has_blobsp
code_p = a_p(_call, &clinfo, code_p, pass_no, cip);
break;
case execute_op:
#if THREADS
#if defined(THREADS) || defined(YAPOR)
if (cip->CurrentPred->PredFlags & LogUpdatePredFlag &&
!(cip->CurrentPred->PredFlags & ThreadLocalPredFlag))
code_p = a_e(_unlock_lu, code_p, pass_no);
@@ -3273,6 +3264,10 @@ do_pass(int pass_no, yamop **entry_codep, int assembling, int *clause_has_blobsp
#ifdef YAPOR
if (pass_no)
either_inst[either_cont++] = code_p;
if (either_cont == MAX_DISJ_BRANCHES) {
Yap_Error(FATAL_ERROR,TermNil,"Too Many Branches in disjunction: please increase MAX_DISJ_BRANCHES in amasm.c\n");
exit(1);
}
code_p = a_either(_either,
-Signed(RealEnvSize) - CELLSIZE * cip->cpc->rnd2,
Unsigned(cip->code_addr) + cip->label_offset[cip->cpc->rnd1], 0, 0, code_p, pass_no, cip);

View File

@@ -11,8 +11,11 @@
* File: cdmgr.c *
* comments: Code manager *
* *
* Last rev: $Date: 2008-04-01 08:42:45 $,$Author: vsc $ *
* Last rev: $Date: 2008-04-01 22:28:41 $,$Author: vsc $ *
* $Log: not supported by cvs2svn $
* Revision 1.225 2008/04/01 08:42:45 vsc
* fix restore and small VISTA thingies
*
* Revision 1.224 2008/03/31 22:56:21 vsc
* more fixes
*
@@ -1554,7 +1557,6 @@ add_first_static(PredEntry *p, yamop *cp, int spy_flag)
#ifdef YAPOR
if (SEQUENTIAL_IS_DEFAULT) {
p->PredFlags |= SequentialPredFlag;
PUT_YAMOP_SEQ(pt);
}
#endif /* YAPOR */
#ifdef TABLING
@@ -1585,7 +1587,6 @@ add_first_static(PredEntry *p, yamop *cp, int spy_flag)
p->PredFlags &= ~ProfiledPredFlag;
#ifdef YAPOR
p->PredFlags |= SequentialPredFlag;
PUT_YAMOP_SEQ((yamop *)cp);
#endif /* YAPOR */
if (spy_flag) {
p->OpcodeOfPred = Yap_opcode(_spy_pred);
@@ -1647,10 +1648,6 @@ add_first_dynamic(PredEntry *p, yamop *cp, int spy_flag)
ncp->u.ld.s = p->ArityOfPE;
ncp->u.ld.p = p;
ncp->u.ld.d = cp;
#ifdef YAPOR
INIT_YAMOP_LTT(ncp, 1);
PUT_YAMOP_SEQ(ncp);
#endif /* YAPOR */
/* This is the point we enter the code */
p->cs.p_code.TrueCodeOfPred = p->CodeOfPred = ncp;
p->cs.p_code.NOfClauses = 1;