comparison src/bytecode.c @ 39634:4baf64844f9c

(syms_of_bytecode) [BYTE_CODE_METER]: Doc fix. (METER_CODE): Use MOST_POSITIVE_FIXNUM.
author Gerd Moellmann <gerd@gnu.org>
date Sat, 06 Oct 2001 23:36:22 +0000
parents b17103d5e3c8
children c6144b4dc5c1
comparison
equal deleted inserted replaced
39633:a0bf0cb8ff3e 39634:4baf64844f9c
64 XFASTINT (XVECTOR (XVECTOR (Vbyte_code_meter)->contents[(code1)]) \ 64 XFASTINT (XVECTOR (XVECTOR (Vbyte_code_meter)->contents[(code1)]) \
65 ->contents[(code2)]) 65 ->contents[(code2)])
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 */
82 82
83 #define METER_CODE(last_code, this_code) 83 #define METER_CODE(last_code, this_code)
1745 1745
1746 #ifdef BYTE_CODE_METER 1746 #ifdef BYTE_CODE_METER
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\
1751 opcode CODE has been executed.\n\ 1751 opcode 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\
1753 indicates how many times the byte opcodes CODE1 and CODE2 have been\n\ 1753 indicates how many times the byte opcodes CODE1 and CODE2 have been\n\
1754 executed in succession."); 1754 executed 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\
1757 The variable byte-code-meter indicates how often each byte opcode is used.\n\ 1758 The variable byte-code-meter indicates how often each byte opcode is used.\n\
1758 If a symbol has a property named `byte-code-meter' whose value is an\n\ 1759 If a symbol has a property named `byte-code-meter' whose value is an\n\
1759 integer, it is incremented each time that symbol's function is called."); 1760 integer, it is incremented each time that symbol's function is called.");