diff options
author | bjj <bjj> | 1997-03-21 13:23:23 +0000 |
---|---|---|
committer | bjj <bjj> | 1997-03-21 13:23:23 +0000 |
commit | 5b0b8d4d456c535f60f2034a57097567a3d0d75f (patch) | |
tree | 82af5099cdc3604058dd2d73caaa44986e362c98 | |
parent | 04d977b43b499e360626506edea3cd5a3ff6cd8f (diff) | |
download | moo-5b0b8d4d456c535f60f2034a57097567a3d0d75f.tar.gz moo-5b0b8d4d456c535f60f2034a57097567a3d0d75f.tar.xz moo-5b0b8d4d456c535f60f2034a57097567a3d0d75f.zip |
Reorganize the top of run() slightly to make it slightly more efficientPREMERGE.R5
(we do execute it billions of times, after all). Later we'll want to
get rid of if (task_killed) by introducing BI_KILL or by moving it into
the BI_FUNC_CALL case, at least.
-rw-r--r-- | execute.c | 38 |
1 files changed, 21 insertions, 17 deletions
@@ -763,28 +763,26 @@ do { \ } for (;;) { next_opcode: - op = *bv; error_bv = bv; - bv++; - - if (COUNT_TICK(op)) - ticks_remaining--; + op = *bv++; + if (COUNT_TICK(op)) { + if (--ticks_remaining <= 0) { + STORE_STATE_VARIABLES(); + abort_task(1); + return OUTCOME_ABORTED; + } + if (task_timed_out) { + STORE_STATE_VARIABLES(); + abort_task(0); + return OUTCOME_ABORTED; + } + } if (task_killed) { STORE_STATE_VARIABLES(); unwind_stack(FIN_ABORT, zero, 0); return OUTCOME_ABORTED; } - if (ticks_remaining <= 0) { - STORE_STATE_VARIABLES(); - abort_task(1); - return OUTCOME_ABORTED; - } - if (task_timed_out) { - STORE_STATE_VARIABLES(); - abort_task(0); - return OUTCOME_ABORTED; - } switch (op) { case OP_IF_QUES: @@ -2821,9 +2819,15 @@ read_activ(activation * a, int which_vector) char rcsid_execute[] = "$Id$"; /* $Log$ -/* Revision 1.6 1997/03/08 06:25:39 nop -/* 1.8.0p6 merge by hand. +/* Revision 1.7 1997/03/21 13:23:23 bjj +/* Reorganize the top of run() slightly to make it slightly more efficient +/* (we do execute it billions of times, after all). Later we'll want to +/* get rid of if (task_killed) by introducing BI_KILL or by moving it into +/* the BI_FUNC_CALL case, at least. /* + * Revision 1.6 1997/03/08 06:25:39 nop + * 1.8.0p6 merge by hand. + * * Revision 1.5 1997/03/05 08:41:47 bjj * A few malloc-friendly changes: rt_stacks are now centrally allocated/freed * so that we can keep a pool of them handy. rt_envs are similarly pooled. |