aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbjj <bjj>1997-03-21 13:23:23 +0000
committerbjj <bjj>1997-03-21 13:23:23 +0000
commit5b0b8d4d456c535f60f2034a57097567a3d0d75f (patch)
tree82af5099cdc3604058dd2d73caaa44986e362c98
parent04d977b43b499e360626506edea3cd5a3ff6cd8f (diff)
downloadmoo-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.c38
1 files changed, 21 insertions, 17 deletions
diff --git a/execute.c b/execute.c
index a55f996..cbd7bd0 100644
--- a/execute.c
+++ b/execute.c
@@ -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.