[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sbcl-commits
Subject:    [Sbcl-commits] master: Improve scav_boxed et.al. by skipping a word.
From:       "Douglas Katzman" <snuglas () users ! sourceforge ! net>
Date:       2017-03-28 20:12:36
Message-ID: 1490731957.142035.7467 () sfp-scm-5 ! v30 ! ch3 ! sourceforge ! com
[Download RAW message or body]

The branch "master" has been updated in SBCL:
       via  5db73e64041b8f511b20bdc1ee99354e3d98766e (commit)
      from  a99cc9616c97cf776c9e902d4a15fe9aed382eaa (commit)

- Log -----------------------------------------------------------------
commit 5db73e64041b8f511b20bdc1ee99354e3d98766e
Author: Douglas Katzman <dougk@google.com>
Date:   Tue Mar 28 16:11:24 2017 -0400

    Improve scav_boxed et.al. by skipping a word.
---
 src/runtime/gc-common.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/src/runtime/gc-common.c b/src/runtime/gc-common.c
index a7df42d..7f5d21d 100644
--- a/src/runtime/gc-common.c
+++ b/src/runtime/gc-common.c
@@ -731,21 +731,24 @@ scav_funinstance(lispobj *where, lispobj header)
 
 //// Boxed object scav/trans/size functions
 
-#define BOXED_NWORDS(obj) (1+(HeaderValue(obj) | 1))
+/// These sizing macros return the number of *payload* words,
+/// exclusive of the object header word. Payload length is always
+/// an odd number so that total word count is an even number.
+#define BOXED_NWORDS(obj) (HeaderValue(obj) | 1)
 // Payload count expressed in 15 bits
-#define SHORT_BOXED_NWORDS(obj) (1+((HeaderValue(obj) & SHORT_HEADER_MAX_WORDS) | 1))
+#define SHORT_BOXED_NWORDS(obj) ((HeaderValue(obj) & SHORT_HEADER_MAX_WORDS) | 1)
 // Payload count expressed in 8 bits
-#define TINY_BOXED_NWORDS(obj) (1+((HeaderValue(obj) & 0xFF) | 1))
+#define TINY_BOXED_NWORDS(obj) ((HeaderValue(obj) & 0xFF) | 1)
 
 #define DEF_SCAV_BOXED(suffix, sizer) \
   static sword_t __attribute__((unused)) \
   scav_##suffix(lispobj *where, lispobj header) { \
-      return scavenge(where, sizer(header)); \
+      return scavenge(where+1, sizer(header)); \
   } \
   static lispobj trans_##suffix(lispobj object) { \
-      return copy_object(object, sizer(*native_pointer(object))); \
+      return copy_object(object, 1 + sizer(*native_pointer(object))); \
   } \
-  static sword_t size_##suffix(lispobj *where) { return sizer(*where); }
+  static sword_t size_##suffix(lispobj *where) { return 1 + sizer(*where); }
 
 DEF_SCAV_BOXED(boxed, BOXED_NWORDS)
 DEF_SCAV_BOXED(short_boxed, SHORT_BOXED_NWORDS)

-----------------------------------------------------------------------


hooks/post-receive
-- 
SBCL

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Sbcl-commits mailing list
Sbcl-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sbcl-commits
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic