(call-with-binary-output-file temporary
(lambda (output-port)
(let ((state (make-state format output-port)))
- (set-port-position! output-port
- (* fasl-header-n-words
- (format.bytes-per-word format)))
+ (set-binary-port-position! output-port
+ (* fasl-header-n-words
+ (format.bytes-per-word format)))
(assert (fasdump-at-address? state 0))
(fasdump-object state object)
(assert (fasdump-at-address? state (format.bytes-per-word format)))
(write-word type datum output-port))
(define (untagged word)
(write-untagged-word word output-port))
- (set-port-position! output-port 0)
+ (set-binary-port-position! output-port 0)
(untagged marker) ;0 fasl-marker
(tagged tc:broken-heart ;1 heap size in words
(state.n-words state))
(untagged 0))
(assert
(= (* fasl-header-n-words (format.bytes-per-word (state.format state)))
- (port-position output-port)))))
+ (binary-port-position output-port)))))
\f
(define (with-fasdump-words state n-words procedure)
(let ((format (state.format state))
(output-port (state.output-port state)))
(let ((bytes-per-word (format.bytes-per-word format))
- (before (port-position output-port)))
+ (before (binary-port-position output-port)))
(begin0 (procedure)
- (let ((after (port-position output-port)))
+ (let ((after (binary-port-position output-port)))
(assert (= (- after before) (* n-words bytes-per-word))
`(n-words ,n-words)
`(n-bytes ,(* n-words bytes-per-word))
(do ((i 0 (+ i 1))) ((>= i n-zeros))
;; XXX fasdump-byte, not write-octet
(write-octet 0 output-port)))))
- (assert (zero? (modulo (port-position output-port) bytes-per-word))))))
+ (assert
+ (zero? (modulo (binary-port-position output-port) bytes-per-word))))))
\f
(define (fasdump-bytevector-n-words format bytevector)
(let ((n-bytes (bytevector-length bytevector)))
(do ((i 0 (+ i 1))) ((>= i n-zeros))
;; XXX fasdump-byte, not write-octet
(write-octet 0 output-port)))))
- (assert (zero? (modulo (port-position output-port) bytes-per-word))))))
+ (assert
+ (zero? (modulo (binary-port-position output-port) bytes-per-word))))))
(define (fasdump-ustring-n-words format string)
(let ((n-cps (string-length string))
(format.bytes-per-word (state.format state)))))))
(define (fasdump-address state)
- (- (port-position (state.output-port state))
+ (- (binary-port-position (state.output-port state))
(* fasl-header-n-words
(format.bytes-per-word (state.format state)))))
(define (rest-object) #!rest)
(define (unspecific-object) #!unspecific)
(define (weak-false)
- (object-new-type (microcode-type 'constant) 10))
-
-(define (port-position port)
- ((access binary-port-position (->environment '(runtime binary-port))) port))
-
-(define (set-port-position! port position)
- ((access set-binary-port-position! (->environment '(runtime binary-port)))
- port
- position))
\ No newline at end of file
+ (object-new-type (microcode-type 'constant) 10))
\ No newline at end of file