- fixed typo: fxvector-immutable-flag used in place of

bytevector-immutable-flag in computation of type-immutable-bytevector
    cmacros.ss
- reallocated typed-object types, using previously unused tag #b010
  for strings and giving bytevectors both #b001 and #b101 (the
  latter for immutable bytevectors) so that the maximum bytevector
  length on 32-bit machines is once again the most-positive fixnum.
  treating bytevectors rather than strings or fxvectors (or even
  vectors) special in this regard is appropriate since the maximum
  number of bytes in a bytevector is maximum-length x 1 rather than
  maximum-length x 4 for strings, fxvectors, and vectors on 32-bit
  machines.  with this change on 32-bit machines, a vector can
  occupy up to 1/2 of virtual memory, strings and fxvectors 1/4,
  and bytevectors 1/8.
    cmacros.ss
- remade boot files

original commit: 0694b3a5223ab937379e54079bc88d57309dc51f
This commit is contained in:
Kent Dybvig 2017-03-16 11:45:33 -04:00
parent f825e23db2
commit 3daedbcaa6
2 changed files with 36 additions and 6 deletions

15
LOG
View File

@ -404,3 +404,18 @@
patch*
- updated release notes and tweaked user's guide.
release-notes.stex, objects.stex
- fixed typo: fxvector-immutable-flag used in place of
bytevector-immutable-flag in computation of type-immutable-bytevector
cmacros.ss
- reallocated typed-object types, using previously unused tag #b010
for strings and giving bytevectors both #b001 and #b101 (the
latter for immutable bytevectors) so that the maximum bytevector
length on 32-bit machines is once again the most-positive fixnum.
treating bytevectors rather than strings or fxvectors (or even
vectors) special in this regard is appropriate since the maximum
number of bytes in a bytevector is maximum-length x 1 rather than
maximum-length x 4 for strings, fxvectors, and vectors on 32-bit
machines. with this change on 32-bit machines, a vector can
occupy up to 1/2 of virtual memory, strings and fxvectors 1/4,
and bytevectors 1/8.
cmacros.ss

View File

@ -705,14 +705,29 @@
(define-constant ptr black-hole #b01000110)
(define-constant ptr sbwp #b01001110)
;;; on 32-bit machines, vectors get two primary tag bits, including
;;; one for the immutable flag, and so do bytevectors, so their maximum
;;; lengths are equal to the most-positive fixnum on 32-bit machines.
;;; strings and fxvectors get only one primary tag bit each and have
;;; to use a different bit for the immutable flag, so their maximum
;;; lengths are equal to 1/2 of the most-positive fixnum on 32-bit
;;; machines. taking sizes of vector, bytevector, string, and fxvector
;;; elements into account, a vector can occupy up to 1/2 of virtual
;;; memory, a string or fxvector up to 1/4, and a bytevector up to 1/8.
;;; on 64-bit machines, vectors get only one of the primary tag bits,
;;; bytevectors still get two (but don't need two), and strings and
;;; fxvectors still get one. all have maximum lengths equal to the
;;; most-positive fixnum.
;;; vector type/length field must look like a fixnum. an immutable bit sits just above the fixnum tag, with the length above that.
(define-constant type-vector (constant type-fixnum))
; #b000 occupied by vectors on 32- and 64-bit machines
(define-constant type-string #b001)
; #b010 unused
(define-constant type-bytevector #b01)
(define-constant type-string #b010)
(define-constant type-fxvector #b011)
; #b100 occupied by vectors on 32-bit machines, unused on 64-bit machines
(define-constant type-bytevector #b101)
; #b101 occupied by type-immutable-bytevector
(define-constant type-other-number #b0110) ; bit 3 reset for numbers
(define-constant type-bignum #b00110) ; bit 4 reset for bignums
(define-constant type-positive-bignum #b000110)
@ -778,7 +793,7 @@
(constant most-positive-fixnum)))
; bytevector length field (high bits) + immutabilty is stored with type
(define-constant bytevector-length-offset 4)
(define-constant bytevector-length-offset 3)
(define-constant bytevector-immutable-flag
(expt 2 (- (constant bytevector-length-offset) 1)))
(define-constant iptr maximum-bytevector-length
@ -851,9 +866,9 @@
;;; vector type/length field must look like a fixnum. an immutable bit sits just above the fixnum tag, with the length above that.
(define-constant mask-vector (constant mask-fixnum))
(define-constant mask-bytevector #b11)
(define-constant mask-string #b111)
(define-constant mask-fxvector #b111)
(define-constant mask-bytevector #b111)
(define-constant mask-other-number #b1111)
(define-constant mask-bignum #b11111)
(define-constant mask-bignum-sign #b100000)
@ -916,7 +931,7 @@
(define-constant type-mutable-bytevector (constant type-bytevector))
(define-constant type-immutable-bytevector
(fxlogor (constant type-bytevector) (constant fxvector-immutable-flag)))
(fxlogor (constant type-bytevector) (constant bytevector-immutable-flag)))
(define-constant mask-mutable-bytevector
(fxlogor (constant mask-bytevector) (constant bytevector-immutable-flag)))