Skip to content

Commit 043c6ec

Browse files
committed
refine library entries, adjust tag tests, and bump version number
Also, correct number in "release_notes.stex" and the title of an unrelated (but nearby) entry there.
1 parent 5bcdebf commit 043c6ec

File tree

9 files changed

+40
-39
lines changed

9 files changed

+40
-39
lines changed

boot/pb/equates.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* equates.h for Chez Scheme Version 10.3.0-pre-release.1 */
1+
/* equates.h for Chez Scheme Version 10.3.0-pre-release.2 */
22

33
/* Do not edit this file. It is automatically generated and */
44
/* specifically tailored to the version of Chez Scheme named */
@@ -335,7 +335,7 @@ typedef uint64_t U64;
335335
#define int_bits 0x20
336336
#define integer_divide_instruction 1
337337
#define keyboard_interrupt_index 0x3
338-
#define library_entry_vector_size 0x272
338+
#define library_entry_vector_size 0x276
339339
#define libspec_closure_index 0xD
340340
#define libspec_does_not_expect_headroom_index 0x0
341341
#define libspec_error_index 0xE
@@ -1015,7 +1015,7 @@ typedef uint64_t U64;
10151015
#define rtd_sealed 0x4
10161016
#define sbwp (ptr)0x4E
10171017
#define scaled_shot_1_shot_flag -0x8
1018-
#define scheme_version 0xA030001
1018+
#define scheme_version 0xA030002
10191019
#define seginfo_generation_disp 0x1
10201020
#define seginfo_list_bits_disp 0x8
10211021
#define seginfo_space_disp 0x0
@@ -1649,5 +1649,5 @@ typedef uint64_t U64;
16491649
/* library entries we access from C code */
16501650
#define library_nonprocedure_code 162
16511651
#define library_dounderflow 164
1652-
#define library_popcount_slow 622
1653-
#define library_cpu_features 624
1652+
#define library_popcount_slow 626
1653+
#define library_cpu_features 628

boot/pb/petite.boot

4.68 MB
Binary file not shown.

boot/pb/scheme.boot

3.76 MB
Binary file not shown.

boot/pb/scheme.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* scheme.h for Chez Scheme Version 10.3.0-pre-release.1 (pb) */
1+
/* scheme.h for Chez Scheme Version 10.3.0-pre-release.2 (pb) */
22

33
/* Do not edit this file. It is automatically generated and */
44
/* specifically tailored to the version of Chez Scheme named */
@@ -40,7 +40,7 @@
4040
#endif
4141

4242
/* Chez Scheme Version and machine type */
43-
#define VERSION "10.3.0-pre-release.1"
43+
#define VERSION "10.3.0-pre-release.2"
4444
#define MACHINE_TYPE "pb"
4545

4646
/* Integer typedefs */

release_notes/release_notes.stex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,14 @@ Online versions of both books can be found at
116116
%-----------------------------------------------------------------------------
117117
\section{Functionality Changes}\label{section:functionality}
118118

119-
\subsection{Support for setting the default history file location using the \scheme{CHEZSCHEME_HISTORY} environment variable}
119+
\subsection{New \scheme{CHEZSCHEME_HISTORY} environment variable (10.3.0)}
120120

121121
If the environment variable \scheme{CHEZSCHEME_HISTORY} is set during
122122
startup, and the \scheme{--eehistory} command-line option isn't used,
123123
the value of said environment variable will determine the history file
124124
location that will be used.
125125

126-
\subsection{Inlined numeric predicates during compilation (10.4.0)}
126+
\subsection{Inlined numeric predicates during compilation (10.3.0)}
127127

128128
The compiler inlines more numeric predicates during the compilation,
129129
in particular \scheme{real?}, \scheme{rational?}, \scheme{exact?}

s/cmacros.ss

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@
357357
;; ---------------------------------------------------------------------
358358
;; Version and machine types:
359359

360-
(define-constant scheme-version #x0a030001) ; <-- TODO: update this
360+
(define-constant scheme-version #x0a030002)
361361

362362
(define-syntax define-machine-types
363363
(lambda (x)
@@ -2983,7 +2983,8 @@
29832983
(bytevector-ieee-double-native-ref #f 2 #t #t)
29842984
(bytevector-ieee-double-native-set! #f 2 #t #t)
29852985
(real->flonum #f 2 #f #t)
2986-
($number-oops #f 2 #t #t)
2986+
(exact? #f 1 #t #t)
2987+
(inexact? #f 1 #t #t)
29872988
(unsafe-port-eof? #f 1 #f #t)
29882989
(unsafe-lookahead-u8 #f 1 #f #t)
29892990
(unsafe-unget-u8 #f 2 #f #t)

s/cpprim.ss

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,13 @@
411411
(syntax-rules ()
412412
[(_ multiple-ref? (b ...) e)
413413
($bind dirty-store-binder multiple-ref? ptr (b ...) e)]))
414+
(define-syntax bind-type-object-type ; NB: caller must bind expr
415+
(syntax-rules ()
416+
[(_ ([id expr]) body)
417+
(build-and
418+
(%type-check mask-typed-object type-typed-object ,expr)
419+
(bind #t ([id (%mref ,expr ,(constant typed-object-type-disp))])
420+
body))]))
414421
(define lift-fp-unboxed
415422
(lambda (k)
416423
(lambda (e)
@@ -532,10 +539,7 @@
532539
;; by counter-productive by introducing too many branches
533540
(build-simple-or
534541
(%type-check mask-flonum type-flonum ,e1)
535-
(build-and
536-
(%type-check mask-typed-object type-typed-object ,e1)
537-
(%type-check mask-other-number type-other-number
538-
,(%mref ,e1 ,(constant bignum-type-disp)))))
542+
(%typed-object-check mask-other-number type-other-number ,e1))
539543
(build-libcall #f src sexpr eqv? e1 e2))))))
540544
(define make-build-eqv?
541545
(lambda (src sexpr)
@@ -3111,18 +3115,20 @@
31113115
(build-and
31123116
(%type-check mask-flonum type-flonum ,e)
31133117
`(call ,(make-info-call src sexpr #f #f #f) #f ,(lookup-primref 3 'flfinite?) ,e))
3114-
(build-simple-or
3115-
(%typed-object-check mask-bignum type-bignum ,e)
3116-
(%typed-object-check mask-ratnum type-ratnum ,e)))))])
3118+
(bind-type-object-type ([t e])
3119+
(build-simple-or
3120+
(%type-check mask-bignum type-bignum ,t)
3121+
(%type-check mask-ratnum type-ratnum ,t))))))])
31173122
(define-inline 2 real?
31183123
[(e) (bind #t (e)
31193124
(build-simple-or
31203125
(%type-check mask-fixnum type-fixnum ,e)
31213126
(build-simple-or
31223127
(%type-check mask-flonum type-flonum ,e)
3123-
(build-simple-or
3124-
(%typed-object-check mask-bignum type-bignum ,e)
3125-
(%typed-object-check mask-ratnum type-ratnum ,e)))))])
3128+
(bind-type-object-type ([t e])
3129+
(build-simple-or
3130+
(%type-check mask-bignum type-bignum ,t)
3131+
(%type-check mask-ratnum type-ratnum ,t))))))])
31263132
(define-inline 2 inexact?
31273133
[(e) (bind #t (e)
31283134
(build-and
@@ -3132,12 +3138,8 @@
31323138
(build-simple-or
31333139
(%typed-object-check mask-inexactnum type-inexactnum ,e)
31343140
(build-and
3135-
(build-not
3136-
(build-and
3137-
(%type-check mask-typed-object type-typed-object ,e)
3138-
(%type-check mask-other-number type-other-number
3139-
,(%mref ,e ,(constant bignum-type-disp)))))
3140-
(build-libcall #t src sexpr $number-oops `(quote inexact?) e))))))])
3141+
(build-not (%typed-object-check mask-other-number type-other-number ,e))
3142+
(build-libcall #t src sexpr inexact? e))))))])
31413143
(define-inline 2 exact?
31423144
[(e) (bind #t (e)
31433145
(build-simple-or
@@ -3147,11 +3149,8 @@
31473149
(build-and
31483150
(build-not (%typed-object-check mask-inexactnum type-inexactnum ,e))
31493151
(build-simple-or
3150-
(build-and
3151-
(%type-check mask-typed-object type-typed-object ,e)
3152-
(%type-check mask-other-number type-other-number
3153-
,(%mref ,e ,(constant bignum-type-disp))))
3154-
(build-libcall #t src sexpr $number-oops `(quote exact?) e))))))])
3152+
(%typed-object-check mask-other-number type-other-number ,e)
3153+
(build-libcall #t src sexpr exact? e))))))])
31553154
(define-inline 3 inexact?
31563155
[(e) (bind #t (e)
31573156
(build-simple-or
@@ -3170,10 +3169,7 @@
31703169
(%type-check mask-fixnum type-fixnum ,e)
31713170
(build-simple-or
31723171
(%type-check mask-flonum type-flonum ,e)
3173-
(build-and
3174-
(%type-check mask-typed-object type-typed-object ,e)
3175-
(%type-check mask-other-number type-other-number
3176-
,(%mref ,e ,(constant bignum-type-disp)))))))))
3172+
(%typed-object-check mask-other-number type-other-number ,e))))))
31773173
(define-inline 2 number?
31783174
[(e) (build-number? e)])
31793175
(define-inline 2 complex?

s/library.ss

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,9 @@
295295
;; for consistency with error before library entry was introduced:
296296
(lambda (who x i)
297297
($oops who "invalid index ~s for bytevector ~s" i x)))
298+
(define number-oops
299+
(lambda (who x)
300+
($oops who "~s is not a number" x)))
298301

299302
(define stencil-vector-oops
300303
(lambda (who x)
@@ -426,6 +429,9 @@
426429
(define-library-entry (char>? x y) (char-oops 'char>? (if (char? x) y x)))
427430
(define-library-entry (char<=? x y) (char-oops 'char<=? (if (char? x) y x)))
428431
(define-library-entry (char>=? x y) (char-oops 'char>=? (if (char? x) y x)))
432+
433+
(define-library-entry (exact? x) (number-oops 'exact? x))
434+
(define-library-entry (inexact? x) (number-oops 'inexact? x))
429435
)
430436

431437
(define-library-entry (real->flonum x who)
@@ -435,8 +441,6 @@
435441
[(flonum? x) x]
436442
[else ($oops who "~s is not a real number" x)]))
437443

438-
(define-library-entry ($number-oops who x)
439-
($oops who "~s is not a number" x))
440444

441445
(let ()
442446
(define pair-oops

s/np-help.ss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
(with-implicit (k $type-check quasiquote)
2727
#'($type-check (constant mask) (constant type) `expr))])))
2828

29-
(define-syntax %typed-object-check ; NB: caller must bind e
29+
(define-syntax %typed-object-check ; NB: caller must bind expr
3030
(lambda (x)
3131
(syntax-case x ()
3232
[(k mask type expr)

0 commit comments

Comments
 (0)