aboutsummaryrefslogtreecommitdiffstats
path: root/src/bytecode.c
diff options
context:
space:
mode:
authorPaul Eggert2012-06-18 15:53:53 -0700
committerPaul Eggert2012-06-18 15:53:53 -0700
commitdefd4196e7acc24a9c5a10799e960a2f3c8c50d3 (patch)
tree2cb2d24b0f4e001fb03ab7a4645c9ec2348d688d /src/bytecode.c
parent25f09295fa146e9e4569f16f2eb41f3452383af9 (diff)
downloademacs-defd4196e7acc24a9c5a10799e960a2f3c8c50d3.tar.gz
emacs-defd4196e7acc24a9c5a10799e960a2f3c8c50d3.zip
Port byte-code-meter to modern targets.
* bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with CHECK_LISP_OBJECT_TYPE reported by Dmitry Andropov in <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>. (METER_1, METER_2): Simplify.
Diffstat (limited to 'src/bytecode.c')
-rw-r--r--src/bytecode.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/bytecode.c b/src/bytecode.c
index 2e6ee3d4445..9c7a3fa30cf 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -58,21 +58,21 @@ by Hallvard:
58#ifdef BYTE_CODE_METER 58#ifdef BYTE_CODE_METER
59 59
60Lisp_Object Qbyte_code_meter; 60Lisp_Object Qbyte_code_meter;
61#define METER_2(code1, code2) \ 61#define METER_2(code1, code2) AREF (AREF (Vbyte_code_meter, code1), code2)
62 XFASTINT (XVECTOR (XVECTOR (Vbyte_code_meter)->contents[(code1)]) \ 62#define METER_1(code) METER_2 (0, code)
63 ->contents[(code2)])
64
65#define METER_1(code) METER_2 (0, (code))
66 63
67#define METER_CODE(last_code, this_code) \ 64#define METER_CODE(last_code, this_code) \
68{ \ 65{ \
69 if (byte_metering_on) \ 66 if (byte_metering_on) \
70 { \ 67 { \
71 if (METER_1 (this_code) < MOST_POSITIVE_FIXNUM) \ 68 if (XFASTINT (METER_1 (this_code)) < MOST_POSITIVE_FIXNUM) \
72 METER_1 (this_code)++; \ 69 XSETFASTINT (METER_1 (this_code), \
70 XFASTINT (METER_1 (this_code)) + 1); \
73 if (last_code \ 71 if (last_code \
74 && METER_2 (last_code, this_code) < MOST_POSITIVE_FIXNUM) \ 72 && (XFASTINT (METER_2 (last_code, this_code)) \
75 METER_2 (last_code, this_code)++; \ 73 < MOST_POSITIVE_FIXNUM)) \
74 XSETFASTINT (METER_2 (last_code, this_code), \
75 XFASTINT (METER_2 (last_code, this_code)) + 1); \
76 } \ 76 } \
77} 77}
78 78