guile-commits
[Top][All Lists]
Advanced

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

[Guile-commits] 30/30: Optimize check-urange in assembler.scm


From: Andy Wingo
Subject: [Guile-commits] 30/30: Optimize check-urange in assembler.scm
Date: Fri, 24 Nov 2017 09:24:25 -0500 (EST)

wingo pushed a commit to branch master
in repository guile.

commit 7d71d9b945f60674ac6e294d731bcb4bc1ef5bd7
Author: Andy Wingo <address@hidden>
Date:   Wed Nov 22 11:53:42 2017 +0100

    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.
---
 module/system/vm/assembler.scm | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/module/system/vm/assembler.scm b/module/system/vm/assembler.scm
index 3fd5bba..6a5b748 100644
--- a/module/system/vm/assembler.scm
+++ b/module/system/vm/assembler.scm
@@ -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)))



reply via email to

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