emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r108656: Port byte-code-meter to mode


From: Paul Eggert
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r108656: Port byte-code-meter to modern targets.
Date: Mon, 18 Jun 2012 15:53:53 -0700
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 108656
committer: Paul Eggert <address@hidden>
branch nick: trunk
timestamp: Mon 2012-06-18 15:53:53 -0700
message:
  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.
modified:
  src/ChangeLog
  src/bytecode.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-06-18 15:57:41 +0000
+++ b/src/ChangeLog     2012-06-18 22:53:53 +0000
@@ -1,3 +1,12 @@
+2012-06-18  Paul Eggert  <address@hidden>
+
+       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.
+
 2012-06-18  Stefan Monnier  <address@hidden>
 
        * data.c (Fdefalias): Return `symbol' (bug#11686).

=== modified file 'src/bytecode.c'
--- a/src/bytecode.c    2012-06-16 12:24:15 +0000
+++ b/src/bytecode.c    2012-06-18 22:53:53 +0000
@@ -58,21 +58,21 @@
 #ifdef BYTE_CODE_METER
 
 Lisp_Object Qbyte_code_meter;
-#define METER_2(code1, code2) \
-  XFASTINT (XVECTOR (XVECTOR (Vbyte_code_meter)->contents[(code1)]) \
-           ->contents[(code2)])
-
-#define METER_1(code) METER_2 (0, (code))
+#define METER_2(code1, code2) AREF (AREF (Vbyte_code_meter, code1), code2)
+#define METER_1(code) METER_2 (0, code)
 
 #define METER_CODE(last_code, this_code)                               \
 {                                                                      \
   if (byte_metering_on)                                                        
\
     {                                                                  \
-      if (METER_1 (this_code) < MOST_POSITIVE_FIXNUM)                  \
-        METER_1 (this_code)++;                                         \
+      if (XFASTINT (METER_1 (this_code)) < MOST_POSITIVE_FIXNUM)       \
+        XSETFASTINT (METER_1 (this_code),                              \
+                    XFASTINT (METER_1 (this_code)) + 1);               \
       if (last_code                                                    \
-         && METER_2 (last_code, this_code) < MOST_POSITIVE_FIXNUM)     \
-        METER_2 (last_code, this_code)++;                              \
+         && (XFASTINT (METER_2 (last_code, this_code))                 \
+             < MOST_POSITIVE_FIXNUM))                                  \
+        XSETFASTINT (METER_2 (last_code, this_code),                   \
+                    XFASTINT (METER_2 (last_code, this_code)) + 1);    \
     }                                                                  \
 }
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]