From c663d13fab3a65902b776c7b3e1c3ff803613136 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Mon, 3 May 2021 10:18:21 -0600 Subject: [PATCH] cs: sync schemified Rebuild schemified files to take advantage of correction for unsafe `fxlshift` and `fxrshift`. --- racket/src/cs/schemified/expander.scm | 73 +++++++++------- racket/src/cs/schemified/io.scm | 117 +++++++++++++++----------- racket/src/cs/schemified/schemify.scm | 36 +++++--- 3 files changed, 133 insertions(+), 93 deletions(-) diff --git a/racket/src/cs/schemified/expander.scm b/racket/src/cs/schemified/expander.scm index c67c7eae60..4bd436ce7e 100644 --- a/racket/src/cs/schemified/expander.scm +++ b/racket/src/cs/schemified/expander.scm @@ -23905,8 +23905,8 @@ (let ((lo_0 (read-byte/no-eof i_0))) (let ((hi_0 (read-byte/no-eof i_0))) (if (fx> hi_0 127) - (fxior (fxlshift (fx+ -256 hi_0) 8) lo_0) - (fxior (fxlshift hi_0 8) lo_0)))) + (fxior (unsafe-fxlshift (fx+ -256 hi_0) 8) lo_0) + (fxior (unsafe-fxlshift hi_0 8) lo_0)))) (if (eqv? b_0 129) (let ((a_0 (read-byte/no-eof i_0))) (let ((b_1 (read-byte/no-eof i_0))) @@ -23916,10 +23916,14 @@ a_0 (arithmetic-shift (if (fx> d_0 127) - (let ((app_0 (fxlshift (fx+ -256 d_0) 16))) - (fxior app_0 (fxlshift c_0 8) b_1)) - (let ((app_0 (fxlshift d_0 16))) - (fxior app_0 (fxlshift c_0 8) b_1))) + (fxior + (unsafe-fxlshift (fx+ -256 d_0) 16) + (unsafe-fxlshift c_0 8) + b_1) + (fxior + (unsafe-fxlshift d_0 16) + (unsafe-fxlshift c_0 8) + b_1)) 8)))))) (if (eqv? b_0 130) (integer-bytes->integer (read-bytes/exactly 8 i_0) #t #f) @@ -23945,8 +23949,8 @@ (let ((lo_0 (read-byte/no-eof* i_0))) (let ((hi_0 (read-byte/no-eof* i_0))) (if (fx> hi_0 127) - (fxior (fxlshift (fx+ -256 hi_0) 8) lo_0) - (fxior (fxlshift hi_0 8) lo_0)))) + (fxior (unsafe-fxlshift (fx+ -256 hi_0) 8) lo_0) + (fxior (unsafe-fxlshift hi_0 8) lo_0)))) (if (eqv? b_0 129) (let ((a_0 (read-byte/no-eof* i_0))) (let ((b_1 (read-byte/no-eof* i_0))) @@ -23956,10 +23960,14 @@ a_0 (arithmetic-shift (if (fx> d_0 127) - (let ((app_0 (fxlshift (fx+ -256 d_0) 16))) - (fxior app_0 (fxlshift c_0 8) b_1)) - (let ((app_0 (fxlshift d_0 16))) - (fxior app_0 (fxlshift c_0 8) b_1))) + (fxior + (unsafe-fxlshift (fx+ -256 d_0) 16) + (unsafe-fxlshift c_0 8) + b_1) + (fxior + (unsafe-fxlshift d_0 16) + (unsafe-fxlshift c_0 8) + b_1)) 8)))))) (if (eqv? b_0 130) (integer-bytes->integer (read-bytes/exactly* 8 i_0) #t #f) @@ -57144,22 +57152,27 @@ (case-lambda (() (begin (namespace-base-phase_0 unsafe-undefined))) ((ns38_0) (namespace-base-phase_0 ns38_0)))))) -(define namespace-call-with-registry-lock - (lambda (ns_0 thunk_0) - (begin - (if (1/namespace? ns_0) - (void) - (raise-argument-error - 'namespace-call-with-registry-lock - "namespace?" - ns_0)) - (if (if (procedure? thunk_0) (procedure-arity-includes? thunk_0 0) #f) - (void) - (raise-argument-error - 'namespace-call-with-registry-lock - "(procedure-arity-includes/c 0)" - thunk_0)) - (registry-call-with-lock (namespace-module-registry$1 ns_0) thunk_0)))) +(define 1/namespace-call-with-registry-lock + (|#%name| + namespace-call-with-registry-lock + (lambda (ns_0 thunk_0) + (begin + (begin + (if (1/namespace? ns_0) + (void) + (raise-argument-error + 'namespace-call-with-registry-lock + "namespace?" + ns_0)) + (if (if (procedure? thunk_0) (procedure-arity-includes? thunk_0 0) #f) + (void) + (raise-argument-error + 'namespace-call-with-registry-lock + "(procedure-arity-includes/c 0)" + thunk_0)) + (registry-call-with-lock + (namespace-module-registry$1 ns_0) + thunk_0)))))) (define 1/eval (let ((eval_0 (|#%name| @@ -64129,7 +64142,7 @@ (begin (if (fx= len_1 1) (if (pair? d_1) (caar d_1) d_1) - (let ((hi-len_0 (fxrshift len_1 1))) + (let ((hi-len_0 (unsafe-fxrshift len_1 1))) (let ((lo-len_0 (fx- len_1 hi-len_0))) (let ((hi_0 (loop_0 d_1 hi-len_0))) (letrec* @@ -74432,7 +74445,7 @@ 'namespace-base-phase 1/namespace-base-phase 'namespace-call-with-registry-lock - namespace-call-with-registry-lock + 1/namespace-call-with-registry-lock 'module-declared? 1/module-declared? 'module-predefined? diff --git a/racket/src/cs/schemified/io.scm b/racket/src/cs/schemified/io.scm index 8be77d58ac..4b272d1ba1 100644 --- a/racket/src/cs/schemified/io.scm +++ b/racket/src/cs/schemified/io.scm @@ -4990,7 +4990,7 @@ (let ((next_0 (fxand b_0 63))) (let ((next-accum_0 (fxior - (fxlshift accum_1 6) + (unsafe-fxlshift accum_1 6) next_0))) (if (fx= 1 remaining_1) (if (if (fx> next-accum_0 127) @@ -5066,7 +5066,7 @@ (if (fx= remaining_0 0) (values #f 0 'error) (let ((next_0 (fxand b_0 63))) - (let ((next-accum_0 (fxior (fxlshift accum_0 6) next_0))) + (let ((next-accum_0 (fxior (unsafe-fxlshift accum_0 6) next_0))) (if (fx= 1 remaining_0) (if (if (fx> next-accum_0 127) (if (fx<= next-accum_0 1114111) @@ -5215,7 +5215,7 @@ (unsafe-bytes-set! out-bstr_0 j_0 - (fxior 192 (fxrshift b_0 6))) + (fxior 192 (unsafe-fxrshift b_0 6))) (let ((app_0 (fx+ j_0 1))) (unsafe-bytes-set! out-bstr_0 @@ -5233,12 +5233,14 @@ (unsafe-bytes-set! out-bstr_0 j_0 - (fxior 224 (fxrshift b_0 12))) + (fxior 224 (unsafe-fxrshift b_0 12))) (let ((app_0 (fx+ j_0 1))) (unsafe-bytes-set! out-bstr_0 app_0 - (fxior 128 (fxand (fxrshift b_0 6) 63)))) + (fxior + 128 + (fxand (unsafe-fxrshift b_0 6) 63)))) (let ((app_0 (fx+ j_0 2))) (unsafe-bytes-set! out-bstr_0 @@ -5255,17 +5257,21 @@ (unsafe-bytes-set! out-bstr_0 j_0 - (fxior 240 (fxrshift b_0 18))) + (fxior 240 (unsafe-fxrshift b_0 18))) (let ((app_0 (fx+ j_0 1))) (unsafe-bytes-set! out-bstr_0 app_0 - (fxior 128 (fxand (fxrshift b_0 12) 63)))) + (fxior + 128 + (fxand (unsafe-fxrshift b_0 12) 63)))) (let ((app_0 (fx+ j_0 2))) (unsafe-bytes-set! out-bstr_0 app_0 - (fxior 128 (fxand (fxrshift b_0 6) 63)))) + (fxior + 128 + (fxand (unsafe-fxrshift b_0 6) 63)))) (let ((app_0 (fx+ j_0 3))) (unsafe-bytes-set! out-bstr_0 @@ -8992,7 +8998,7 @@ (let ((app_2 (fx- end133_0 start132_0))) (fx< app_2 - (fxrshift + (unsafe-fxrshift (unsafe-bytes-length (peek-via-read-input-port-bstr this-id_0)) 1))) @@ -15695,7 +15701,9 @@ j_0 (fxior 192 - (fxrshift v_1 6))) + (unsafe-fxrshift + v_1 + 6))) (let ((app_0 (fx+ j_0 1))) (unsafe-bytes-set! out-bstr22_0 @@ -15732,7 +15740,9 @@ j_0 (fxior 224 - (fxrshift v_1 12))) + (unsafe-fxrshift + v_1 + 12))) (let ((app_0 (fx+ j_0 1))) (unsafe-bytes-set! @@ -15741,7 +15751,9 @@ (fxior 128 (fxand - (fxrshift v_1 6) + (unsafe-fxrshift + v_1 + 6) 63)))) (let ((app_0 (fx+ j_0 2))) @@ -15780,7 +15792,9 @@ j_0 (fxior 240 - (fxrshift v_1 18))) + (unsafe-fxrshift + v_1 + 18))) (let ((app_0 (fx+ j_0 1))) (unsafe-bytes-set! @@ -15789,7 +15803,9 @@ (fxior 128 (fxand - (fxrshift v_1 12) + (unsafe-fxrshift + v_1 + 12) 63)))) (let ((app_0 (fx+ j_0 2))) @@ -15799,7 +15815,9 @@ (fxior 128 (fxand - (fxrshift v_1 6) + (unsafe-fxrshift + v_1 + 6) 63)))) (let ((app_0 (fx+ j_0 3))) @@ -31013,35 +31031,32 @@ (fxior 55296 (fxand - (fxrshift av_0 10) + (unsafe-fxrshift + av_0 + 10) 1023)))) (let ((lo_0 (fxior 56320 (fxand av_0 1023)))) (begin - (let ((app_0 - (fxrshift hi_0 8))) - (bytes-set-two! - bstr_0 - pos_0 - app_0 - (fxand hi_0 255))) - (let ((app_0 - (fxrshift lo_0 8))) - (bytes-set-two! - bstr_0 - pos_0 - app_0 - (fxand lo_0 255))) + (bytes-set-two! + bstr_0 + pos_0 + (unsafe-fxrshift hi_0 8) + (fxand hi_0 255)) + (bytes-set-two! + bstr_0 + pos_0 + (unsafe-fxrshift lo_0 8) + (fxand lo_0 255)) (fx+ pos_0 4))))) (begin - (let ((app_0 (fxrshift v_0 8))) - (bytes-set-two! - bstr_0 - pos_0 - app_0 - (fxand v_0 255))) + (bytes-set-two! + bstr_0 + pos_0 + (unsafe-fxrshift v_0 8) + (fxand v_0 255)) (fx+ pos_0 2)))))) (values pos_2)))) (for-loop_0 pos_2 (unsafe-fx+ 1 pos_1)))) @@ -31086,7 +31101,9 @@ n_0)))))) (for-loop_0 0 start*_0)))) (args (raise-binding-result-arity-error 4 args))))))) - (let ((str_0 (make-string (fx- (fxrshift len_0 1) surrogate-count_0)))) + (let ((str_0 + (make-string + (fx- (unsafe-fxrshift len_0 1) surrogate-count_0)))) (begin (letrec* ((loop_0 @@ -31100,8 +31117,8 @@ (let ((b_0 (unsafe-bytes-ref bstr_0 (fx+ i_0 1)))) (let ((v_0 (if big-endian? - (fxior (fxlshift a_0 8) b_0) - (fxior (fxlshift b_0 8) a_0)))) + (fxior (unsafe-fxlshift a_0 8) b_0) + (fxior (unsafe-fxlshift b_0 8) a_0)))) (if (fx= (fxand v_0 56320) 56320) (let ((a_1 (unsafe-bytes-ref bstr_0 (fx+ i_0 2)))) @@ -31109,13 +31126,15 @@ (unsafe-bytes-ref bstr_0 (fx+ i_0 3)))) (let ((v2_0 (if big-endian? - (fxior (fxlshift a_1 8) b_1) - (fxior (fxlshift b_1 8) a_1)))) + (fxior (unsafe-fxlshift a_1 8) b_1) + (fxior + (unsafe-fxlshift b_1 8) + a_1)))) (let ((all-v_0 (fx+ 65536 (let ((app_0 - (fxlshift + (unsafe-fxlshift (fxand v_0 1023) 10))) (fxior @@ -31223,7 +31242,7 @@ (unsafe-place-local-ref cell.1) up?_0 s-16_0 - (fxrshift (unsafe-bytes-length s-16_0) 1) + (unsafe-fxrshift (unsafe-bytes-length s-16_0) 1) #f))) (let ((sr_0 (|#%app| rktio_to_shorts r_0))) (begin @@ -31265,7 +31284,7 @@ (string (string-ref s_0 - (fxrshift + (unsafe-fxrshift (+ pos_0 in-used_0) 2))))) (if (eqv? pos_0 0) @@ -34356,11 +34375,11 @@ 'subprocess "(or/c (and/c output-port? file-stream-port?) #f 'stdout)" stderr_0)) - (let ((lr1325 unsafe-undefined) + (let ((lr1322 unsafe-undefined) (group_0 unsafe-undefined) (command_0 unsafe-undefined) (exact/args_0 unsafe-undefined)) - (set! lr1325 + (set! lr1322 (call-with-values (lambda () (if (path-string? group/command_0) @@ -34415,9 +34434,9 @@ ((group_1 command_1 exact/args_1) (vector group_1 command_1 exact/args_1)) (args (raise-binding-result-arity-error 3 args))))) - (set! group_0 (unsafe-vector*-ref lr1325 0)) - (set! command_0 (unsafe-vector*-ref lr1325 1)) - (set! exact/args_0 (unsafe-vector*-ref lr1325 2)) + (set! group_0 (unsafe-vector*-ref lr1322 0)) + (set! command_0 (unsafe-vector*-ref lr1322 1)) + (set! exact/args_0 (unsafe-vector*-ref lr1322 2)) (call-with-values (lambda () (if (if (pair? exact/args_0) diff --git a/racket/src/cs/schemified/schemify.scm b/racket/src/cs/schemified/schemify.scm index d637afb09c..faa5b1c912 100644 --- a/racket/src/cs/schemified/schemify.scm +++ b/racket/src/cs/schemified/schemify.scm @@ -14046,14 +14046,14 @@ prim-knowns_0 imports_0 mutated_0 - (fxrshift fuel_0 1)) + (unsafe-fxrshift fuel_0 1)) (single-valued? els_0 knowns_0 prim-knowns_0 imports_0 mutated_0 - (fxrshift fuel_0 1)) + (unsafe-fxrshift fuel_0 1)) #f)) (args (raise-binding-result-arity-error @@ -39877,8 +39877,8 @@ (let ((lo_0 (read-byte/no-eof i_0))) (let ((hi_0 (read-byte/no-eof i_0))) (if (fx> hi_0 127) - (fxior (fxlshift (fx+ -256 hi_0) 8) lo_0) - (fxior (fxlshift hi_0 8) lo_0)))) + (fxior (unsafe-fxlshift (fx+ -256 hi_0) 8) lo_0) + (fxior (unsafe-fxlshift hi_0 8) lo_0)))) (if (eqv? b_0 129) (let ((a_0 (read-byte/no-eof i_0))) (let ((b_1 (read-byte/no-eof i_0))) @@ -39888,10 +39888,14 @@ a_0 (arithmetic-shift (if (fx> d_0 127) - (let ((app_0 (fxlshift (fx+ -256 d_0) 16))) - (fxior app_0 (fxlshift c_0 8) b_1)) - (let ((app_0 (fxlshift d_0 16))) - (fxior app_0 (fxlshift c_0 8) b_1))) + (fxior + (unsafe-fxlshift (fx+ -256 d_0) 16) + (unsafe-fxlshift c_0 8) + b_1) + (fxior + (unsafe-fxlshift d_0 16) + (unsafe-fxlshift c_0 8) + b_1)) 8)))))) (if (eqv? b_0 130) (integer-bytes->integer (read-bytes/exactly 8 i_0) #t #f) @@ -39917,8 +39921,8 @@ (let ((lo_0 (read-byte/no-eof* i_0))) (let ((hi_0 (read-byte/no-eof* i_0))) (if (fx> hi_0 127) - (fxior (fxlshift (fx+ -256 hi_0) 8) lo_0) - (fxior (fxlshift hi_0 8) lo_0)))) + (fxior (unsafe-fxlshift (fx+ -256 hi_0) 8) lo_0) + (fxior (unsafe-fxlshift hi_0 8) lo_0)))) (if (eqv? b_0 129) (let ((a_0 (read-byte/no-eof* i_0))) (let ((b_1 (read-byte/no-eof* i_0))) @@ -39928,10 +39932,14 @@ a_0 (arithmetic-shift (if (fx> d_0 127) - (let ((app_0 (fxlshift (fx+ -256 d_0) 16))) - (fxior app_0 (fxlshift c_0 8) b_1)) - (let ((app_0 (fxlshift d_0 16))) - (fxior app_0 (fxlshift c_0 8) b_1))) + (fxior + (unsafe-fxlshift (fx+ -256 d_0) 16) + (unsafe-fxlshift c_0 8) + b_1) + (fxior + (unsafe-fxlshift d_0 16) + (unsafe-fxlshift c_0 8) + b_1)) 8)))))) (if (eqv? b_0 130) (integer-bytes->integer (read-bytes/exactly* 8 i_0) #t #f)