mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-24 20:30:28 +02:00
Optimize check-urange in assembler.scm
* module/system/vm/assembler.scm (check-urange): Hoist exact-integer? check so that the side effect is entirely in this function and not in `logand'. Allows devirtualize-integers to peel off a nice straight trace.
This commit is contained in:
parent
8d30643751
commit
7d71d9b945
1 changed files with 3 additions and 4 deletions
|
@ -305,10 +305,9 @@
|
|||
;;; These helpers create one 32-bit unit from multiple components.
|
||||
|
||||
(define-inline (check-urange x mask)
|
||||
(let ((x* (logand x mask)))
|
||||
(unless (= x x*)
|
||||
(error "out of range" x))
|
||||
x*))
|
||||
(unless (and (exact-integer? x) (= x (logand x mask)))
|
||||
(error "out of range" x))
|
||||
x)
|
||||
|
||||
(define-inline (check-srange x mask)
|
||||
(let ((x* (logand x mask)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue