aboutsummaryrefslogtreecommitdiffstats
path: root/opcode.h
diff options
context:
space:
mode:
authornop <nop>1998-12-14 13:17:26 +0000
committernop <nop>1998-12-14 13:17:26 +0000
commitc8db4429501e7e33e519e4f75ca56311e3298128 (patch)
tree3404f267560b4977ad18a43ae9a147d5312382c1 /opcode.h
parentfa306b4cdc64de192c8b034fe8167711799a07a2 (diff)
downloadmoo-cvs-c8db4429501e7e33e519e4f75ca56311e3298128.tar.gz
moo-cvs-c8db4429501e7e33e519e4f75ca56311e3298128.tar.xz
moo-cvs-c8db4429501e7e33e519e4f75ca56311e3298128.zip
Merge UNSAFE_OPTS (ref fixups); fix Log tag placement to fit CVS whims
Diffstat (limited to 'opcode.h')
-rw-r--r--opcode.h33
1 files changed, 29 insertions, 4 deletions
diff --git a/opcode.h b/opcode.h
index df0a460..a884c93 100644
--- a/opcode.h
+++ b/opcode.h
@@ -18,6 +18,8 @@
#ifndef Opcode_h
#define Opcode_h 1
+#include "options.h"
+
#define NUM_READY_VARS 32
enum Extended_Opcode {
@@ -66,6 +68,12 @@ enum Opcode {
OP_PUSH,
OP_G_PUSH = OP_PUSH + NUM_READY_VARS,
+#ifdef BYTECODE_REDUCE_REF
+ /* final variable references, no tick: */
+ OP_PUSH_CLEAR,
+ OP_G_PUSH_CLEAR = OP_PUSH_CLEAR + NUM_READY_VARS,
+#endif /* BYTECODE_REDUCE_REF */
+
/* expr-related opcodes with no tick: */
OP_IMM, OP_MAKE_EMPTY_LIST, OP_LIST_ADD_TAIL, OP_LIST_APPEND,
OP_PUSH_REF, OP_PUT_TEMP, OP_PUSH_TEMP,
@@ -85,6 +93,11 @@ enum Opcode {
#define IS_PUSH_n(o) ((o) >= (unsigned) OP_PUSH \
&& (o) < (unsigned) OP_G_PUSH)
+#ifdef BYTECODE_REDUCE_REF
+#define IS_PUSH_CLEAR_n(o) ((o) >= (unsigned) OP_PUSH_CLEAR \
+ && (o) < (unsigned) OP_G_PUSH_CLEAR)
+#define PUSH_CLEAR_n_INDEX(o) ((o) - OP_PUSH_CLEAR)
+#endif /* BYTECODE_REDUCE_REF */
#define IS_PUT_n(o) ((o) >= (unsigned) OP_PUT \
&& (o) < (unsigned) OP_G_PUT)
#define PUSH_n_INDEX(o) ((o) - OP_PUSH)
@@ -109,10 +122,22 @@ typedef enum Extended_Opcode Extended_Opcode;
#endif
-/* $Log$
-/* Revision 1.2 1997/03/03 04:19:13 nop
-/* GNU Indent normalization
-/*
+/*
+ * $Log$
+ * Revision 1.3 1998/12/14 13:18:40 nop
+ * Merge UNSAFE_OPTS (ref fixups); fix Log tag placement to fit CVS whims
+ *
+ * Revision 1.2.2.1 1997/09/09 07:01:17 bjj
+ * Change bytecode generation so that x=f(x) calls f() without holding a ref
+ * to the value of x in the variable slot. See the options.h comment for
+ * BYTECODE_REDUCE_REF for more details.
+ *
+ * This checkin also makes x[y]=z (OP_INDEXSET) take advantage of that (that
+ * new code is not conditional and still works either way).
+ *
+ * Revision 1.2 1997/03/03 04:19:13 nop
+ * GNU Indent normalization
+ *
* Revision 1.1.1.1 1997/03/03 03:45:04 nop
* LambdaMOO 1.8.0p5
*