[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] feature/bignum e2a78b0 23/24: Bignum fixes for byte-compil
From: |
Tom Tromey |
Subject: |
[Emacs-diffs] feature/bignum e2a78b0 23/24: Bignum fixes for byte-compiler and bytecode interpreter |
Date: |
Fri, 13 Jul 2018 00:25:10 -0400 (EDT) |
branch: feature/bignum
commit e2a78b0d6d844f29acaaddd775c7b1cd6dec7af8
Author: Tom Tromey <address@hidden>
Commit: Tom Tromey <address@hidden>
Bignum fixes for byte-compiler and bytecode interpreter
* lisp/emacs-lisp/byte-opt.el: Mark bignump and fixnump as
side-effect-and-error-free-fns.
* src/bytecode.c (exec_byte_code): Handle bignums.
---
lisp/emacs-lisp/byte-opt.el | 4 ++--
src/bytecode.c | 16 +++++++++++-----
2 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el
index 5c0b5e3..1920503 100644
--- a/lisp/emacs-lisp/byte-opt.el
+++ b/lisp/emacs-lisp/byte-opt.el
@@ -1195,14 +1195,14 @@
window-width zerop))
(side-effect-and-error-free-fns
'(arrayp atom
- bobp bolp bool-vector-p
+ bignump bobp bolp bool-vector-p
buffer-end buffer-list buffer-size buffer-string bufferp
car-safe case-table-p cdr-safe char-or-string-p characterp
charsetp commandp cons consp
current-buffer current-global-map current-indentation
current-local-map current-minor-mode-maps current-time
eobp eolp eq equal eventp
- floatp following-char framep
+ fixnump floatp following-char framep
get-largest-window get-lru-window
hash-table-p
identity ignore integerp integer-or-marker-p interactive-p
diff --git a/src/bytecode.c b/src/bytecode.c
index 282754d..f87983a 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -972,11 +972,15 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector,
Lisp_Object maxdepth,
NEXT;
CASE (Bsub1):
- TOP = FIXNUMP (TOP) ? make_fixnum (XINT (TOP) - 1) : Fsub1 (TOP);
+ TOP = (FIXNUMP (TOP) && XINT (TOP) != MOST_NEGATIVE_FIXNUM
+ ? make_fixnum (XINT (TOP) - 1)
+ : Fsub1 (TOP));
NEXT;
CASE (Badd1):
- TOP = FIXNUMP (TOP) ? make_fixnum (XINT (TOP) + 1) : Fadd1 (TOP);
+ TOP = (FIXNUMP (TOP) && XINT (TOP) != MOST_POSITIVE_FIXNUM
+ ? make_fixnum (XINT (TOP) + 1)
+ : Fadd1 (TOP));
NEXT;
CASE (Beqlsign):
@@ -1027,7 +1031,9 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector,
Lisp_Object maxdepth,
NEXT;
CASE (Bnegate):
- TOP = FIXNUMP (TOP) ? make_fixnum (- XINT (TOP)) : Fminus (1, &TOP);
+ TOP = (FIXNUMP (TOP) && XINT (TOP) != MOST_NEGATIVE_FIXNUM
+ ? make_fixnum (- XINT (TOP))
+ : Fminus (1, &TOP));
NEXT;
CASE (Bplus):
@@ -1324,11 +1330,11 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object
vector, Lisp_Object maxdepth,
NEXT;
CASE (Bnumberp):
- TOP = FIXED_OR_FLOATP (TOP) ? Qt : Qnil;
+ TOP = NUMBERP (TOP) ? Qt : Qnil;
NEXT;
CASE (Bintegerp):
- TOP = FIXNUMP (TOP) ? Qt : Qnil;
+ TOP = INTEGERP (TOP) ? Qt : Qnil;
NEXT;
#if BYTE_CODE_SAFE
- [Emacs-diffs] feature/bignum a770fb4 16/24: Make logcount handle bignums, (continued)
- [Emacs-diffs] feature/bignum a770fb4 16/24: Make logcount handle bignums, Tom Tromey, 2018/07/13
- [Emacs-diffs] feature/bignum 0d86891 14/24: Make 1+ and 1- handle bignums, Tom Tromey, 2018/07/13
- [Emacs-diffs] feature/bignum 8fb995b 17/24: Make min and max handle bignums, Tom Tromey, 2018/07/13
- [Emacs-diffs] feature/bignum 3dea8f8 19/24: Make % and mod handle bignums, Tom Tromey, 2018/07/13
- [Emacs-diffs] feature/bignum d14808c 11/24: Make format handle bignums, Tom Tromey, 2018/07/13
- [Emacs-diffs] feature/bignum c7e393b 15/24: Make lognot handle bignums, Tom Tromey, 2018/07/13
- [Emacs-diffs] feature/bignum 1e8ae6c 06/24: Make the reader accept bignums, Tom Tromey, 2018/07/13
- [Emacs-diffs] feature/bignum 27980e3 21/24: Make ash and lsh handle bignums, Tom Tromey, 2018/07/13
- [Emacs-diffs] feature/bignum cca0e79 20/24: Make logb handle bignums, Tom Tromey, 2018/07/13
- [Emacs-diffs] feature/bignum d0fac17 18/24: Let C modules access bignum values, Tom Tromey, 2018/07/13
- [Emacs-diffs] feature/bignum e2a78b0 23/24: Bignum fixes for byte-compiler and bytecode interpreter,
Tom Tromey <=
- [Emacs-diffs] feature/bignum 45eb3b3 22/24: Use fixnump rather than integerp in some spots, Tom Tromey, 2018/07/13
- [Emacs-diffs] feature/bignum cc3d758 24/24: Document bignums, Tom Tromey, 2018/07/13
- [Emacs-diffs] feature/bignum 7cb45cd 02/24: Add configury for GMP library, Tom Tromey, 2018/07/13
- [Emacs-diffs] feature/bignum 42fe787 01/24: Rename integerp->fixnum, etc, in preparation for bignums, Tom Tromey, 2018/07/13