From: Terrance S. <ts...@us...> - 2008-07-25 20:56:42
|
Update of /cvsroot/xsb/XSB/emu In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv17328 Modified Files: emuloop.c emudef.h init_xsb.c cell_xsb.h Log Message: fix so that new fast call checks ! properly -- before I was assuming that ! was read as a structure, while it was being read as a string. Now its properly handled. Index: emuloop.c =================================================================== RCS file: /cvsroot/xsb/XSB/emu/emuloop.c,v retrieving revision 1.192 retrieving revision 1.193 diff -u -r1.192 -r1.193 --- emuloop.c 6 Apr 2008 23:04:22 -0000 1.192 +++ emuloop.c 25 Jul 2008 20:56:50 -0000 1.193 @@ -2925,9 +2925,12 @@ case CALLABLE_TEST: jump_cond_fail(iscallable(op2)); break; - case DIRECTLY_CALLABLE_TEST: - jump_cond_fail(is_directly_callable(op2)); + case DIRECTLY_CALLABLE_TEST: { + // printf("op2: %x, %x %x cut_psc %x %x\n",op2,cs_val(op2),get_str_psc(op2),cut_psc,cut_string); + if (isstring(op2)) jump_cond_fail((char *) cs_val(op2) != cut_string); + else jump_cond_fail(is_directly_callable(op2)); break; + } case IS_LIST_TEST: jump_cond_fail(is_proper_list(op2)); break; Index: emudef.h =================================================================== RCS file: /cvsroot/xsb/XSB/emu/emudef.h,v retrieving revision 1.71 retrieving revision 1.72 diff -u -r1.71 -r1.72 --- emudef.h 22 Feb 2008 17:10:16 -0000 1.71 +++ emudef.h 25 Jul 2008 20:56:50 -0000 1.72 @@ -93,7 +93,7 @@ */ byte *inst_begin_gl; -char *nil_string, *true_string; +char *nil_string, *true_string, *cut_string; Pair list_pscPair; Index: init_xsb.c =================================================================== RCS file: /cvsroot/xsb/XSB/emu/init_xsb.c,v retrieving revision 1.148 retrieving revision 1.149 diff -u -r1.148 -r1.149 --- init_xsb.c 8 Jun 2008 22:10:04 -0000 1.148 +++ init_xsb.c 25 Jul 2008 20:56:50 -0000 1.149 @@ -1442,11 +1442,12 @@ true_psc = make_code_psc_rec("true", 0, standard_psc); true_string = get_name(true_psc); + cut_string = string_find("!",1); load_undef_psc = make_code_psc_rec("_$load_undef", 1, loader_psc); comma_psc = make_code_psc_rec(",", 2, standard_psc); colon_psc = make_code_psc_rec(":", 2, standard_psc); - cut_psc = make_code_psc_rec(":", 0, standard_psc); + cut_psc = make_code_psc_rec("!", 0, standard_psc); cond_psc = make_code_psc_rec("->", 2, standard_psc); ccall_mod_psc = pair_psc(insert_module(0,"ccallxsb")); Index: cell_xsb.h =================================================================== RCS file: /cvsroot/xsb/XSB/emu/cell_xsb.h,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- cell_xsb.h 2 Apr 2008 23:48:06 -0000 1.33 +++ cell_xsb.h 25 Jul 2008 20:56:50 -0000 1.34 @@ -215,10 +215,11 @@ #define iscallable(op2) ((isconstr(op2) && !isboxed(op2)) || isstring(op2) || islist(op2)) -#define is_directly_callable(op2) (((isconstr(op2) && !isboxed(op2)) || isstring(op2)) \ - && op2 != (Cell) comma_psc \ - && op2 != (Cell) colon_psc && op2 != (Cell) cut_psc \ - && op2 != (Cell) cond_psc ) +/* TLS: this can be made mre efficient, but I want to get the problem with the cut_psc fixed */ +#define is_directly_callable(op2) ((isconstr(op2) && !isboxed(op2)) \ + && get_str_psc(op2) != comma_psc \ + && get_str_psc(op2) != colon_psc && get_str_psc(op2) != cut_psc \ + && get_str_psc(op2) != cond_psc ) // Saving, in the unlikely possibility that there is a problem with the new call // && op2 != (Cell) pflags[MYSIG_UNDEF+INT_HANDLERS_FLAGS_START]) |