aboutsummaryrefslogtreecommitdiffstats
path: root/src/bytecode.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bytecode.c')
-rw-r--r--src/bytecode.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/bytecode.c b/src/bytecode.c
index 48739234a6d..2c4e1cca48d 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -66,16 +66,16 @@ int byte_metering_on;
66 66
67#define METER_1(code) METER_2 (0, (code)) 67#define METER_1(code) METER_2 (0, (code))
68 68
69#define METER_CODE(last_code, this_code) \ 69#define METER_CODE(last_code, this_code) \
70{ \ 70{ \
71 if (byte_metering_on) \ 71 if (byte_metering_on) \
72 { \ 72 { \
73 if (METER_1 (this_code) != ((1<<VALBITS)-1)) \ 73 if (METER_1 (this_code) < MOST_POSITIVE_FIXNUM) \
74 METER_1 (this_code)++; \ 74 METER_1 (this_code)++; \
75 if (last_code \ 75 if (last_code \
76 && METER_2 (last_code, this_code) != ((1<<VALBITS)-1))\ 76 && METER_2 (last_code, this_code) < MOST_POSITIVE_FIXNUM) \
77 METER_2 (last_code, this_code)++; \ 77 METER_2 (last_code, this_code)++; \
78 } \ 78 } \
79} 79}
80 80
81#else /* no BYTE_CODE_METER */ 81#else /* no BYTE_CODE_METER */
@@ -1747,11 +1747,12 @@ syms_of_bytecode ()
1747 1747
1748 DEFVAR_LISP ("byte-code-meter", &Vbyte_code_meter, 1748 DEFVAR_LISP ("byte-code-meter", &Vbyte_code_meter,
1749 "A vector of vectors which holds a histogram of byte-code usage.\n\ 1749 "A vector of vectors which holds a histogram of byte-code usage.\n\
1750(aref (aref byte-code-meter 0) CODE) indicates how many times the byte\n\ 1750\(aref (aref byte-code-meter 0) CODE) indicates how many times the byte\n\
1751opcode CODE has been executed.\n\ 1751opcode CODE has been executed.\n\
1752(aref (aref byte-code-meter CODE1) CODE2), where CODE1 is not 0,\n\ 1752\(aref (aref byte-code-meter CODE1) CODE2), where CODE1 is not 0,\n\
1753indicates how many times the byte opcodes CODE1 and CODE2 have been\n\ 1753indicates how many times the byte opcodes CODE1 and CODE2 have been\n\
1754executed in succession."); 1754executed in succession.");
1755
1755 DEFVAR_BOOL ("byte-metering-on", &byte_metering_on, 1756 DEFVAR_BOOL ("byte-metering-on", &byte_metering_on,
1756 "If non-nil, keep profiling information on byte code usage.\n\ 1757 "If non-nil, keep profiling information on byte code usage.\n\
1757The variable byte-code-meter indicates how often each byte opcode is used.\n\ 1758The variable byte-code-meter indicates how often each byte opcode is used.\n\