diff options
| author | Paul Eggert | 2012-06-18 15:53:53 -0700 |
|---|---|---|
| committer | Paul Eggert | 2012-06-18 15:53:53 -0700 |
| commit | defd4196e7acc24a9c5a10799e960a2f3c8c50d3 (patch) | |
| tree | 2cb2d24b0f4e001fb03ab7a4645c9ec2348d688d /src | |
| parent | 25f09295fa146e9e4569f16f2eb41f3452383af9 (diff) | |
| download | emacs-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')
| -rw-r--r-- | src/ChangeLog | 9 | ||||
| -rw-r--r-- | src/bytecode.c | 18 |
2 files changed, 18 insertions, 9 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 080748236b4..df9fcb9dd87 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2012-06-18 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | Port byte-code-meter to modern targets. | ||
| 4 | * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume | ||
| 5 | !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with | ||
| 6 | CHECK_LISP_OBJECT_TYPE reported by Dmitry Andropov in | ||
| 7 | <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>. | ||
| 8 | (METER_1, METER_2): Simplify. | ||
| 9 | |||
| 1 | 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca> | 10 | 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 11 | ||
| 3 | * data.c (Fdefalias): Return `symbol' (bug#11686). | 12 | * data.c (Fdefalias): Return `symbol' (bug#11686). |
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 | ||
| 60 | Lisp_Object Qbyte_code_meter; | 60 | Lisp_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 | ||