From: David S. W. <dw...@us...> - 2007-03-23 18:13:31
|
Update of /cvsroot/xsb/XSB/emu In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv25891/emu Modified Files: emuloop.c inst_xsb.h xsb_inst_list.h Log Message: Improved fix to compiler to generate instruction to test heap when necessary on clause return. Index: emuloop.c =================================================================== RCS file: /cvsroot/xsb/XSB/emu/emuloop.c,v retrieving revision 1.155 retrieving revision 1.156 diff -u -r1.155 -r1.156 --- emuloop.c 16 Mar 2007 20:40:30 -0000 1.155 +++ emuloop.c 23 Mar 2007 18:13:27 -0000 1.156 @@ -1881,7 +1881,7 @@ ereg = *(CPtr *)ereg; XSB_End_Instr() - XSB_Start_Instr(deallocate_gc,_deallocate_gc) /* PPA */ + XSB_Start_Instr(deallocate_gc,_deallocate_gc) /* PPA -- instruction no longer used! */ ADVANCE_PC(size_xxx); cpreg = *((byte **)ereg-1); ereg = *(CPtr *)ereg; @@ -1908,6 +1908,25 @@ proceed_sub; XSB_End_Instr() + XSB_Start_Instr(proceed_gc,_proceed_gc) /* PPP */ + proceed_sub; + /* following required for recursive loops that build structure on way back up. */ + if (((pb)ereg - (pb)hreg) < 2048) { + if (gc_heap(CTXTc 0,FALSE)) { // no regs, garbage collection potentially modifies hreg + if (((pb)ereg - (pb)hreg) < 2048) { + if (pflags[STACK_REALLOC]) { + if (glstack_realloc(CTXTc resize_stack(glstack.size,OVERFLOW_MARGIN),0) != 0) { + xsb_basic_abort(local_global_exception); + } + } else { + xsb_warn("Reallocation is turned OFF !"); + xsb_basic_abort(local_global_exception); + } + } + } + } + XSB_End_Instr() + /* This is the WAM-execute. Name was changed because of conflict with some system files for pthreads. */ XSB_Start_Instr(xsb_execute,_xsb_execute) /* PPP-S */ Index: inst_xsb.h =================================================================== RCS file: /cvsroot/xsb/XSB/emu/inst_xsb.h,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- inst_xsb.h 16 Mar 2007 20:40:31 -0000 1.24 +++ inst_xsb.h 23 Mar 2007 18:13:27 -0000 1.25 @@ -371,6 +371,7 @@ #define proceed 0xeb #define xsb_execute 0xec #define deallocate_gc 0xed +#define proceed_gc 0xee #define calld 0xef /* Branching instructions */ Index: xsb_inst_list.h =================================================================== RCS file: /cvsroot/xsb/XSB/emu/xsb_inst_list.h,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- xsb_inst_list.h 16 Mar 2007 20:40:32 -0000 1.17 +++ xsb_inst_list.h 23 Mar 2007 18:13:27 -0000 1.18 @@ -261,7 +261,7 @@ XSB_INST(0xeb, proceed, _proceed, PPP,X, X,X); XSB_INST(0xec, xsb_execute, _xsb_execute, PPP,S, X,X); XSB_INST(0xed, deallocate_gc, _deallocate_gc, PP, A, X,X); -XSB_INST(0xee, no_inst, _no_inst, PPP,X,X,X); +XSB_INST(0xee, proceed_gc, _proceed_gc, PPP,X,X,X); XSB_INST(0xef, calld, _calld, PP, A, L,X); XSB_INST(0xf0, jump, _jump, PPP,L, X,X); |