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:
parent
5459617266
commit
0dd21aab71
18
C/alloc.c
18
C/alloc.c
@ -12,7 +12,7 @@
|
|||||||
* Last rev: *
|
* Last rev: *
|
||||||
* mods: *
|
* mods: *
|
||||||
* comments: allocating space *
|
* 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
|
#ifdef SCCS
|
||||||
static char SccsId[] = "%W% %G%";
|
static char SccsId[] = "%W% %G%";
|
||||||
@ -136,6 +136,8 @@ Yap_FreeAtomSpace(char *p)
|
|||||||
Yap_PrologMode &= ~MallocMode;
|
Yap_PrologMode &= ~MallocMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
/* If you need to dinamically allocate space from the heap, this is
|
/* If you need to dinamically allocate space from the heap, this is
|
||||||
* the macro you should use */
|
* the macro you should use */
|
||||||
ADDR
|
ADDR
|
||||||
@ -199,8 +201,6 @@ Yap_ExpandPreAllocCodeSpace(UInt sz0, void *cip)
|
|||||||
return ptr;
|
return ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if USE_SYSTEM_MALLOC
|
#if USE_SYSTEM_MALLOC
|
||||||
|
|
||||||
struct various_codes *Yap_heap_regs;
|
struct various_codes *Yap_heap_regs;
|
||||||
@ -651,18 +651,6 @@ Yap_AllocCodeSpace(unsigned int size)
|
|||||||
return out;
|
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
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
31
C/amasm.c
31
C/amasm.c
@ -11,8 +11,11 @@
|
|||||||
* File: amasm.c *
|
* File: amasm.c *
|
||||||
* comments: abstract machine assembler *
|
* 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 $
|
* $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
|
* Revision 1.99 2008/01/23 17:57:44 vsc
|
||||||
* valgrind it!
|
* valgrind it!
|
||||||
* enable atom garbage collection.
|
* 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)
|
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
|
#ifdef YAPOR
|
||||||
#define EITHER_INST 50
|
#define MAX_DISJ_BRANCHES 256
|
||||||
yamop *either_inst[EITHER_INST];
|
yamop *either_inst[MAX_DISJ_BRANCHES];
|
||||||
int either_cont = 0;
|
int either_cont = 0;
|
||||||
#endif /* YAPOR */
|
#endif /* YAPOR */
|
||||||
int log_update;
|
int log_update;
|
||||||
@ -3086,10 +3089,6 @@ do_pass(int pass_no, yamop **entry_codep, int assembling, int *clause_has_blobsp
|
|||||||
break;
|
break;
|
||||||
case commit_b_op:
|
case commit_b_op:
|
||||||
code_p = a_v(_commit_b_x, code_p, pass_no, cip->cpc);
|
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;
|
break;
|
||||||
case save_pair_op:
|
case save_pair_op:
|
||||||
code_p = a_uv((Ventry *) cip->cpc->rnd1, _save_pair_x, _save_pair_x_write, code_p, pass_no);
|
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;
|
break;
|
||||||
case cut_op:
|
case cut_op:
|
||||||
code_p = a_cut(&clinfo, code_p, pass_no, cip);
|
code_p = a_cut(&clinfo, code_p, pass_no, cip);
|
||||||
#ifdef YAPOR
|
|
||||||
if (pass_no)
|
|
||||||
PUT_YAMOP_CUT(*entry_codep);
|
|
||||||
#endif /* YAPOR */
|
|
||||||
break;
|
break;
|
||||||
case cutexit_op:
|
case cutexit_op:
|
||||||
code_p = a_cut(&clinfo, code_p, pass_no, cip);
|
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) &&
|
(*clause_has_blobsp || *clause_has_dbtermp) &&
|
||||||
!clinfo.alloc_found)
|
!clinfo.alloc_found)
|
||||||
code_p = a_cle(_alloc_for_logical_pred, code_p, pass_no, cip);
|
code_p = a_cle(_alloc_for_logical_pred, code_p, pass_no, cip);
|
||||||
#if THREADS
|
#if defined(THREADS) || defined(YAPOR)
|
||||||
else
|
else
|
||||||
if (cip->CurrentPred->PredFlags & LogUpdatePredFlag &&
|
if (cip->CurrentPred->PredFlags & LogUpdatePredFlag &&
|
||||||
!(cip->CurrentPred->PredFlags & ThreadLocalPredFlag))
|
!(cip->CurrentPred->PredFlags & ThreadLocalPredFlag))
|
||||||
code_p = a_e(_unlock_lu, code_p, pass_no);
|
code_p = a_e(_unlock_lu, code_p, pass_no);
|
||||||
#endif
|
#endif
|
||||||
code_p = a_pl(_procceed, cip->CurrentPred, code_p, pass_no);
|
code_p = a_pl(_procceed, cip->CurrentPred, code_p, pass_no);
|
||||||
#ifdef YAPOR
|
|
||||||
if (pass_no)
|
|
||||||
PUT_YAMOP_CUT(*entry_codep);
|
|
||||||
#endif /* YAPOR */
|
|
||||||
break;
|
break;
|
||||||
case allocate_op:
|
case allocate_op:
|
||||||
clinfo.alloc_found = 2;
|
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) &&
|
(*clause_has_blobsp || *clause_has_dbtermp) &&
|
||||||
!clinfo.alloc_found)
|
!clinfo.alloc_found)
|
||||||
code_p = a_cle(_alloc_for_logical_pred, code_p, pass_no, cip);
|
code_p = a_cle(_alloc_for_logical_pred, code_p, pass_no, cip);
|
||||||
#if THREADS
|
#if defined(THREADS) || defined(YAPOR)
|
||||||
else
|
else
|
||||||
if (cip->CurrentPred->PredFlags & LogUpdatePredFlag &&
|
if (cip->CurrentPred->PredFlags & LogUpdatePredFlag &&
|
||||||
!(cip->CurrentPred->PredFlags & ThreadLocalPredFlag))
|
!(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);
|
code_p = a_p(_call, &clinfo, code_p, pass_no, cip);
|
||||||
break;
|
break;
|
||||||
case execute_op:
|
case execute_op:
|
||||||
#if THREADS
|
#if defined(THREADS) || defined(YAPOR)
|
||||||
if (cip->CurrentPred->PredFlags & LogUpdatePredFlag &&
|
if (cip->CurrentPred->PredFlags & LogUpdatePredFlag &&
|
||||||
!(cip->CurrentPred->PredFlags & ThreadLocalPredFlag))
|
!(cip->CurrentPred->PredFlags & ThreadLocalPredFlag))
|
||||||
code_p = a_e(_unlock_lu, code_p, pass_no);
|
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
|
#ifdef YAPOR
|
||||||
if (pass_no)
|
if (pass_no)
|
||||||
either_inst[either_cont++] = code_p;
|
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,
|
code_p = a_either(_either,
|
||||||
-Signed(RealEnvSize) - CELLSIZE * cip->cpc->rnd2,
|
-Signed(RealEnvSize) - CELLSIZE * cip->cpc->rnd2,
|
||||||
Unsigned(cip->code_addr) + cip->label_offset[cip->cpc->rnd1], 0, 0, code_p, pass_no, cip);
|
Unsigned(cip->code_addr) + cip->label_offset[cip->cpc->rnd1], 0, 0, code_p, pass_no, cip);
|
||||||
|
11
C/cdmgr.c
11
C/cdmgr.c
@ -11,8 +11,11 @@
|
|||||||
* File: cdmgr.c *
|
* File: cdmgr.c *
|
||||||
* comments: Code manager *
|
* 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 $
|
* $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
|
* Revision 1.224 2008/03/31 22:56:21 vsc
|
||||||
* more fixes
|
* more fixes
|
||||||
*
|
*
|
||||||
@ -1554,7 +1557,6 @@ add_first_static(PredEntry *p, yamop *cp, int spy_flag)
|
|||||||
#ifdef YAPOR
|
#ifdef YAPOR
|
||||||
if (SEQUENTIAL_IS_DEFAULT) {
|
if (SEQUENTIAL_IS_DEFAULT) {
|
||||||
p->PredFlags |= SequentialPredFlag;
|
p->PredFlags |= SequentialPredFlag;
|
||||||
PUT_YAMOP_SEQ(pt);
|
|
||||||
}
|
}
|
||||||
#endif /* YAPOR */
|
#endif /* YAPOR */
|
||||||
#ifdef TABLING
|
#ifdef TABLING
|
||||||
@ -1585,7 +1587,6 @@ add_first_static(PredEntry *p, yamop *cp, int spy_flag)
|
|||||||
p->PredFlags &= ~ProfiledPredFlag;
|
p->PredFlags &= ~ProfiledPredFlag;
|
||||||
#ifdef YAPOR
|
#ifdef YAPOR
|
||||||
p->PredFlags |= SequentialPredFlag;
|
p->PredFlags |= SequentialPredFlag;
|
||||||
PUT_YAMOP_SEQ((yamop *)cp);
|
|
||||||
#endif /* YAPOR */
|
#endif /* YAPOR */
|
||||||
if (spy_flag) {
|
if (spy_flag) {
|
||||||
p->OpcodeOfPred = Yap_opcode(_spy_pred);
|
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.s = p->ArityOfPE;
|
||||||
ncp->u.ld.p = p;
|
ncp->u.ld.p = p;
|
||||||
ncp->u.ld.d = cp;
|
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 */
|
/* This is the point we enter the code */
|
||||||
p->cs.p_code.TrueCodeOfPred = p->CodeOfPred = ncp;
|
p->cs.p_code.TrueCodeOfPred = p->CodeOfPred = ncp;
|
||||||
p->cs.p_code.NOfClauses = 1;
|
p->cs.p_code.NOfClauses = 1;
|
||||||
|
10
H/Heap.h
10
H/Heap.h
@ -10,7 +10,7 @@
|
|||||||
* File: Heap.h *
|
* File: Heap.h *
|
||||||
* mods: *
|
* mods: *
|
||||||
* comments: Heap Init Structure *
|
* comments: Heap Init Structure *
|
||||||
* version: $Id: Heap.h,v 1.127 2008-03-25 22:03:13 vsc Exp $ *
|
* version: $Id: Heap.h,v 1.128 2008-04-01 22:28:41 vsc Exp $ *
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
|
|
||||||
/* information that can be stored in Code Space */
|
/* information that can be stored in Code Space */
|
||||||
@ -1030,7 +1030,6 @@ UInt STD_PROTO(Yap_givemallinfo, (void));
|
|||||||
|
|
||||||
ADDR STD_PROTO(Yap_ExpandPreAllocCodeSpace, (UInt, void *));
|
ADDR STD_PROTO(Yap_ExpandPreAllocCodeSpace, (UInt, void *));
|
||||||
#define Yap_ReleasePreAllocCodeSpace(x)
|
#define Yap_ReleasePreAllocCodeSpace(x)
|
||||||
#if defined(USE_SYSTEM_MALLOC)||USE_DL_MALLOC
|
|
||||||
ADDR STD_PROTO(Yap_InitPreAllocCodeSpace, (void));
|
ADDR STD_PROTO(Yap_InitPreAllocCodeSpace, (void));
|
||||||
EXTERN inline ADDR
|
EXTERN inline ADDR
|
||||||
Yap_PreAllocCodeSpace(void)
|
Yap_PreAllocCodeSpace(void)
|
||||||
@ -1039,13 +1038,6 @@ Yap_PreAllocCodeSpace(void)
|
|||||||
if (ptr) return ptr;
|
if (ptr) return ptr;
|
||||||
return Yap_InitPreAllocCodeSpace();
|
return Yap_InitPreAllocCodeSpace();
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
EXTERN inline ADDR
|
|
||||||
Yap_PreAllocCodeSpace(void)
|
|
||||||
{
|
|
||||||
return Addr(HeapTop) + sizeof(CELL);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef THREADS
|
#ifdef THREADS
|
||||||
Prop STD_PROTO(Yap_NewThreadPred, (PredEntry *));
|
Prop STD_PROTO(Yap_NewThreadPred, (PredEntry *));
|
||||||
|
5
configure
vendored
5
configure
vendored
@ -3084,7 +3084,7 @@ fi
|
|||||||
if test "$tabling" = yes -o "$orparallelism" = yes -o "$threads" = yes
|
if test "$tabling" = yes -o "$orparallelism" = yes -o "$threads" = yes
|
||||||
then
|
then
|
||||||
cat >>confdefs.h <<\_ACEOF
|
cat >>confdefs.h <<\_ACEOF
|
||||||
#define MinHeapSpace (600*SIZEOF_INT_P)
|
#define MinHeapSpace (1000*SIZEOF_INT_P)
|
||||||
_ACEOF
|
_ACEOF
|
||||||
|
|
||||||
cat >>confdefs.h <<\_ACEOF
|
cat >>confdefs.h <<\_ACEOF
|
||||||
@ -16112,10 +16112,13 @@ cat >>confdefs.h <<\_ACEOF
|
|||||||
#define GC_NO_TAGS 1
|
#define GC_NO_TAGS 1
|
||||||
_ACEOF
|
_ACEOF
|
||||||
|
|
||||||
|
if test "$orparallelism" != yes
|
||||||
|
then
|
||||||
cat >>confdefs.h <<\_ACEOF
|
cat >>confdefs.h <<\_ACEOF
|
||||||
#define USE_DL_MALLOC 1
|
#define USE_DL_MALLOC 1
|
||||||
_ACEOF
|
_ACEOF
|
||||||
|
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mkdir -p library/matrix
|
mkdir -p library/matrix
|
||||||
|
@ -253,7 +253,7 @@ AC_ARG_WITH(max-workers,
|
|||||||
|
|
||||||
if test "$tabling" = yes -o "$orparallelism" = yes -o "$threads" = yes
|
if test "$tabling" = yes -o "$orparallelism" = yes -o "$threads" = yes
|
||||||
then
|
then
|
||||||
AC_DEFINE(MinHeapSpace, (600*SIZEOF_INT_P))
|
AC_DEFINE(MinHeapSpace, (1000*SIZEOF_INT_P))
|
||||||
AC_DEFINE(MinStackSpace,(300*SIZEOF_INT_P))
|
AC_DEFINE(MinStackSpace,(300*SIZEOF_INT_P))
|
||||||
AC_DEFINE(MinTrailSpace,( 48*SIZEOF_INT_P))
|
AC_DEFINE(MinTrailSpace,( 48*SIZEOF_INT_P))
|
||||||
else
|
else
|
||||||
@ -1377,8 +1377,11 @@ dnl large memory configuration, don't trust Yap allocation routines
|
|||||||
if test "$maxmemory" = yes
|
if test "$maxmemory" = yes
|
||||||
then
|
then
|
||||||
AC_DEFINE(GC_NO_TAGS,1)
|
AC_DEFINE(GC_NO_TAGS,1)
|
||||||
|
if test "$orparallelism" != yes
|
||||||
|
then
|
||||||
AC_DEFINE(USE_DL_MALLOC,1)
|
AC_DEFINE(USE_DL_MALLOC,1)
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
mkdir -p library/matrix
|
mkdir -p library/matrix
|
||||||
mkdir -p library/matlab
|
mkdir -p library/matlab
|
||||||
|
Reference in New Issue
Block a user