*** empty log message ***

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1612 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
rslopes 2006-04-27 14:13:24 +00:00
parent d9689d50d4
commit 87a481ca45
7 changed files with 85 additions and 10 deletions

View File

@ -10,8 +10,11 @@
* * * *
* File: absmi.c * * File: absmi.c *
* comments: Portable abstract machine interpreter * * comments: Portable abstract machine interpreter *
* Last rev: $Date: 2006-04-12 17:14:58 $,$Author: rslopes $ * * Last rev: $Date: 2006-04-27 14:11:57 $,$Author: rslopes $ *
* $Log: not supported by cvs2svn $ * $Log: not supported by cvs2svn $
* Revision 1.200 2006/04/12 17:14:58 rslopes
* fix needed by the EAM engine
*
* Revision 1.199 2006/04/12 15:51:23 rslopes * Revision 1.199 2006/04/12 15:51:23 rslopes
* small fixes * small fixes
* *
@ -2898,11 +2901,21 @@ Yap_absmi(int inp)
#ifdef BEAM #ifdef BEAM
extern int eam_am(PredEntry *); extern int eam_am(PredEntry *);
Op(retry_eam, e);
printf("Aqui estou eu..................\n");
if (!eam_am(2)) {
abort_eam("Falhei\n");
FAIL();
}
goto procceed;
PREG = NEXTOP(PREG, e);
GONext();
ENDOp();
Op(run_eam, os); Op(run_eam, os);
/* if (inp==-9000) { /* usar a indexação para saber quais as alternativas validas */
printf("%p - %p - %p \n", &&run_eam, (PredEntry *) PREG->u.os.s, (int *) PREG->u.os.opcw);
*/
if (inp==-9000) {
extern CELL *beam_ALTERNATIVES; extern CELL *beam_ALTERNATIVES;
*beam_ALTERNATIVES= (CELL *) PREG->u.os.opcw; *beam_ALTERNATIVES= (CELL *) PREG->u.os.opcw;
beam_ALTERNATIVES++; beam_ALTERNATIVES++;
@ -2916,6 +2929,34 @@ Yap_absmi(int inp)
saveregs(); saveregs();
if (!eam_am((PredEntry *) PREG->u.os.s)) FAIL(); if (!eam_am((PredEntry *) PREG->u.os.s)) FAIL();
setregs(); setregs();
/* cut */
BACKUP_B();
#ifdef CUT_C
while (POP_CHOICE_POINT(B->cp_b)) {
POP_EXECUTE();
}
#endif /* CUT_C */
B = B->cp_b; /* cut_fail */
HB = B->cp_h; /* cut_fail */
RECOVER_B();
if (0) { register choiceptr ccp;
/* initialize ccp */
#define NORM_CP(CP) ((choiceptr)(CP))
YENV = (CELL *) (NORM_CP(YENV) - 1);
ccp = NORM_CP(YENV);
store_yaam_reg_cpdepth(ccp);
ccp->cp_tr = TR;
ccp->cp_ap = BEAM_RETRY_CODE;
ccp->cp_h = H;
ccp->cp_b = B;
ccp->cp_env= ENV;
ccp->cp_cp = CPREG;
B = ccp;
SET_BB(B);
}
goto procceed; goto procceed;
PREG = NEXTOP(PREG, os); PREG = NEXTOP(PREG, os);
GONext(); GONext();

View File

@ -11,8 +11,11 @@
* File: cdmgr.c * * File: cdmgr.c *
* comments: Code manager * * comments: Code manager *
* * * *
* Last rev: $Date: 2006-03-29 16:00:10 $,$Author: vsc $ * * Last rev: $Date: 2006-04-27 14:11:57 $,$Author: rslopes $ *
* $Log: not supported by cvs2svn $ * $Log: not supported by cvs2svn $
* Revision 1.183 2006/03/29 16:00:10 vsc
* make tabling compile
*
* Revision 1.182 2006/03/24 16:26:26 vsc * Revision 1.182 2006/03/24 16:26:26 vsc
* code review * code review
* *
@ -3743,6 +3746,9 @@ ClauseInfoForCode(yamop *codeptr, CODEADDR *startp, CODEADDR *endp) {
case _write_list: case _write_list:
case _write_l_list: case _write_l_list:
case _pop: case _pop:
#ifdef BEAM
case _retry_eam:
#endif
#if THREADS #if THREADS
case _thread_local: case _thread_local:
#endif #endif

View File

@ -11,8 +11,11 @@
* File: index.c * * File: index.c *
* comments: Indexing a Prolog predicate * * comments: Indexing a Prolog predicate *
* * * *
* Last rev: $Date: 2006-04-20 15:28:08 $,$Author: vsc $ * * Last rev: $Date: 2006-04-27 14:10:36 $,$Author: rslopes $ *
* $Log: not supported by cvs2svn $ * $Log: not supported by cvs2svn $
* Revision 1.163 2006/04/20 15:28:08 vsc
* more graph stuff.
*
* Revision 1.162 2006/04/12 18:56:50 vsc * Revision 1.162 2006/04/12 18:56:50 vsc
* fix bug in clause: a trust_me followed by a try should be implemented by * fix bug in clause: a trust_me followed by a try should be implemented by
* reusing the choice-point. * reusing the choice-point.
@ -2330,6 +2333,10 @@ add_info(ClauseDef *clause, UInt regno)
// clause->Tag = (CELL)NULL; // clause->Tag = (CELL)NULL;
cl = NEXTOP(cl,os); cl = NEXTOP(cl,os);
break; break;
case _retry_eam:
cl = NEXTOP(cl,e);
break;
#endif #endif
} }

View File

@ -869,6 +869,9 @@ InitCodes(void)
Yap_heap_regs->charsio_module = MkAtomTerm(Yap_LookupAtom("charsio")); Yap_heap_regs->charsio_module = MkAtomTerm(Yap_LookupAtom("charsio"));
Yap_heap_regs->terms_module = MkAtomTerm(Yap_LookupAtom("terms")); Yap_heap_regs->terms_module = MkAtomTerm(Yap_LookupAtom("terms"));
Yap_InitModules(); Yap_InitModules();
#ifdef BEAM
Yap_heap_regs->beam_retry_code.opc = Yap_opcode(_retry_eam);
#endif
#ifdef YAPOR #ifdef YAPOR
Yap_heap_regs->seq_def = TRUE; Yap_heap_regs->seq_def = TRUE;
Yap_heap_regs->getwork_code.opc = Yap_opcode(_getwork); Yap_heap_regs->getwork_code.opc = Yap_opcode(_getwork);

View File

@ -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.94 2006-03-30 01:11:10 vsc Exp $ * * version: $Id: Heap.h,v 1.95 2006-04-27 14:13:24 rslopes Exp $ *
*************************************************************************/ *************************************************************************/
/* information that can be stored in Code Space */ /* information that can be stored in Code Space */
@ -182,6 +182,9 @@ typedef struct various_codes {
#else #else
worker_local wl; worker_local wl;
#endif #endif
#ifdef BEAM
yamop beam_retry_code;
#endif /* BEAM */
#ifdef YAPOR #ifdef YAPOR
int seq_def; int seq_def;
yamop getwork_code; yamop getwork_code;
@ -525,6 +528,9 @@ struct various_codes *Yap_heap_regs;
#define GETWORK_SEQ (&(Yap_heap_regs->getwork_seq_code)) #define GETWORK_SEQ (&(Yap_heap_regs->getwork_seq_code))
#define GETWORK_FIRST_TIME (&(Yap_heap_regs->getwork_first_time_code)) #define GETWORK_FIRST_TIME (&(Yap_heap_regs->getwork_first_time_code))
#endif /* YAPOR */ #endif /* YAPOR */
#ifdef BEAM
#define BEAM_RETRY_CODE ((yamop *)&(Yap_heap_regs->beam_retry_code))
#endif /* BEAM */
#ifdef TABLING #ifdef TABLING
#define LOAD_ANSWER ((yamop *)&(Yap_heap_regs->table_load_answer_code)) #define LOAD_ANSWER ((yamop *)&(Yap_heap_regs->table_load_answer_code))
#define TRY_ANSWER ((yamop *)&(Yap_heap_regs->table_try_answer_code)) #define TRY_ANSWER ((yamop *)&(Yap_heap_regs->table_try_answer_code))

View File

@ -11,8 +11,12 @@
* File: YapOpcodes.h * * File: YapOpcodes.h *
* comments: Central Table with all YAP opcodes * * comments: Central Table with all YAP opcodes *
* * * *
* Last rev: $Date: 2006-03-24 16:34:21 $ * * Last rev: $Date: 2006-04-27 14:13:24 $ *
* $Log: not supported by cvs2svn $ * $Log: not supported by cvs2svn $
* Revision 1.37 2006/03/24 16:34:21 rslopes
* New update to BEAM engine.
* BEAM now uses YAP Indexing (JITI)
*
* Revision 1.36 2005/12/17 03:25:39 vsc * Revision 1.36 2005/12/17 03:25:39 vsc
* major changes to support online event-based profiling * major changes to support online event-based profiling
* improve error discovery and restart on scanner. * improve error discovery and restart on scanner.
@ -212,6 +216,7 @@
OPCODE(or_last ,p), OPCODE(or_last ,p),
#endif /* YAPOR */ #endif /* YAPOR */
#ifdef BEAM #ifdef BEAM
OPCODE(retry_eam ,e),
OPCODE(run_eam ,os), OPCODE(run_eam ,os),
#endif #endif
OPCODE(call_cpred ,sla), OPCODE(call_cpred ,sla),

View File

@ -12,8 +12,12 @@
* File: rclause.h * * File: rclause.h *
* comments: walk through a clause * * comments: walk through a clause *
* * * *
* Last rev: $Date: 2005-12-17 03:25:39 $,$Author: vsc $ * * Last rev: $Date: 2006-04-27 14:13:24 $,$Author: rslopes $ *
* $Log: not supported by cvs2svn $ * $Log: not supported by cvs2svn $
* Revision 1.14 2005/12/17 03:25:39 vsc
* major changes to support online event-based profiling
* improve error discovery and restart on scanner.
*
* Revision 1.13 2005/11/24 15:35:29 tiagosoares * Revision 1.13 2005/11/24 15:35:29 tiagosoares
* removed some compilation warnings related to the cut-c code * removed some compilation warnings related to the cut-c code
* *
@ -229,6 +233,9 @@ restore_opcodes(yamop *pc)
case _write_l_list: case _write_l_list:
case _pop: case _pop:
case _index_pred: case _index_pred:
#ifdef BEAM
case _retry_eam:
#endif
#if THREADS #if THREADS
case _thread_local: case _thread_local:
#endif #endif