*
* define BYTE_CODE_METER to enable generation of a byte-op usage histogram.
*/
-#define BYTE_CODE_SAFE
+/* #define BYTE_CODE_SAFE 1 */
/* #define BYTE_CODE_METER */
\f
#define Bconstant 0300
#define CONSTANTLIM 0100
+/* Whether to maintain a `top' and `bottom' field in the stack frame. */
+#define BYTE_MAINTAIN_TOP (BYTE_CODE_SAFE || BYTE_MARK_STACK)
\f
/* Structure describing a value stack used during byte-code execution
in Fbyte_code. */
/* Top and bottom of stack. The bottom points to an area of memory
allocated with alloca in Fbyte_code. */
+#if BYTE_MAINTAIN_TOP
Lisp_Object *top, *bottom;
+#endif
/* The string containing the byte-code, and its current address.
Storing this here protects it from GC because mark_byte_stack
\f
/* Mark objects on byte_stack_list. Called during GC. */
+#if BYTE_MARK_STACK
void
mark_byte_stack (void)
{
mark_object (stack->constants);
}
}
-
+#endif
/* Unmark objects in the stacks on byte_stack_list. Relocate program
counters. Called when GC has completed. */
/* Actions that must be performed before and after calling a function
that might GC. */
+#if !BYTE_MAINTAIN_TOP
+#define BEFORE_POTENTIAL_GC() ((void)0)
+#define AFTER_POTENTIAL_GC() ((void)0)
+#else
#define BEFORE_POTENTIAL_GC() stack.top = top
#define AFTER_POTENTIAL_GC() stack.top = NULL
+#endif
/* Garbage collect if we have consed enough since the last time.
We do this at every branch, to avoid loops that never GC. */
stack.byte_string = bytestr;
stack.pc = stack.byte_string_start = SDATA (bytestr);
stack.constants = vector;
- stack.bottom = (Lisp_Object *) alloca (XFASTINT (maxdepth)
+ top = (Lisp_Object *) alloca (XFASTINT (maxdepth)
* sizeof (Lisp_Object));
- top = stack.bottom - 1;
+#if BYTE_MAINTAIN_TOP
+ stack.bottom = top;
stack.top = NULL;
+#endif
+ top -= 1;
stack.next = byte_stack_list;
byte_stack_list = &stack;
CHECK_CHARACTER (TOP);
AFTER_POTENTIAL_GC ();
c = XFASTINT (TOP);
- if (NILP (current_buffer->enable_multibyte_characters))
+ if (NILP (BVAR (current_buffer, enable_multibyte_characters)))
MAKE_CHAR_MULTIBYTE (c);
XSETFASTINT (TOP, syntax_code_spec[(int) SYNTAX (c)]);
}