--- gforth/prim 2005/01/19 22:11:52 1.158 +++ gforth/prim 2005/01/24 22:18:34 1.161 @@ -191,7 +191,7 @@ goto *next_code; ip=IP; /* undo any ip updating that may have been performed by NEXT_P0 */ #endif /* !defined(NO_IP) */ SUPER_END; /* !! probably unnecessary and may lead to measurement errors */ -EXEC(*(Xt *)PFA(CFA)); +VM_JUMP(EXEC1(*(Xt *)PFA(CFA))); (dofield) ( n1 -- n2 ) gforth-internal paren_field ""run-time routine for fields"" @@ -251,7 +251,7 @@ ip=IP; #endif IF_spTOS(spTOS = sp[0]); /* inst_tail would produce a NEXT_P1 */ SUPER_END; -EXEC(xt); +VM_JUMP(EXEC1(xt)); perform ( a_addr -- ) gforth ""@code{@@ execute}."" @@ -261,7 +261,7 @@ ip=IP; #endif IF_spTOS(spTOS = sp[0]); /* inst_tail would produce a NEXT_P1 */ SUPER_END; -EXEC(*(Xt *)a_addr); +VM_JUMP(EXEC1(*(Xt *)a_addr)); : @ execute ; @@ -284,7 +284,7 @@ lit-perform ( #a_addr -- ) new lit_perfo ip=IP; #endif SUPER_END; -EXEC(*(Xt *)a_addr); +VM_JUMP(EXEC1(*(Xt *)a_addr)); does-exec ( #a_cfa -- R:nest a_pfa ) new does_exec #ifdef NO_IP @@ -324,19 +324,49 @@ INST_TAIL; JUMP(a_target); #else SET_IP((Xt *)a_target); -INST_TAIL; -NEXT_P2; #endif -SUPER_CONTINUE; /* we do our own control flow, so don't append NEXT etc. */ : r> @ >r ; \ condbranch(forthname,stackeffect,restline,code1,code2,forthcode) \ this is non-syntactical: code must open a brace that is closed by the macro +\ condbranch(forthname,stackeffect,restline,code1,code2,forthcode) +\ this is non-syntactical: code must open a brace that is closed by the macro define(condbranch, $1 ( `#'a_target $2 ) $3 $4 #ifdef NO_IP INST_TAIL; +#endif +$5 #ifdef NO_IP +JUMP(a_target); +#else +SET_IP((Xt *)a_target); +#endif +} +$6 + +\+glocals + +$1-lp+!`#' ( `#'a_target `#'nlocals $2 ) $3_lp_plus_store_number +$4 #ifdef NO_IP +INST_TAIL; +#endif +$5 lp += nlocals; +#ifdef NO_IP +JUMP(a_target); +#else +SET_IP((Xt *)a_target); +#endif +} + +\+ +) + +\ version that generates two jumps (not good for PR 15242 workaround) +define(condbranch_twojump, +$1 ( `#'a_target $2 ) $3 +$4 #ifdef NO_IP +INST_TAIL; #endif $5 #ifdef NO_IP JUMP(a_target);