shithub: sl

Download patch

ref: 2470c27c1af7259dc2f1e9a2a2399052f022275e
parent: 55b7bab03a1c5586d253c26a3b09ca16bfb1a939
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Tue Apr 15 02:47:18 EDT 2025

brbound → bounda

--- a/boot/sl.boot
+++ b/boot/sl.boot
@@ -113,7 +113,7 @@
             #fn("n10K~:" #() 1-) 1arg-lambda? #fn("n10B;3D040<20Q;3:04710TK62:" #(λ length=) 1arg-lambda?)
             <= #fn("z1Ib6862086>1_486<^10162:" #(#fn("n21S;JL041<0L2;J5040V340q:A<1<1=62:")) <=) >
             #fn("z1Ib6862086>1_486<^10162:" #(#fn("n21S;JE041<0L2;3;04A<1<1=62:")) >) >= #fn("z1Ib6862086>1_486<^10162:" #(#fn("n21S;JL0401<L2;J5040V340q:A<1<1=62:")) >=)
-            Instructions #table(call.l #u8(81)  trycatch #u8(75)  loadg.l #u8(68)  aref2 #u8(23)  box #u8(50)  cadr #u8(36)  argc #u8(62)  setg #u8(71)  load0 #u8(21)  nan? #u8(38)  fixnum? #u8(41)  loadc0 #u8(17)  loada0 #u8(0)  div0 #u8(59)  keyargs #u8(31)  call #u8(5)  loada.l #u8(69)  num? #u8(40)  sub2 #u8(78)  add2 #u8(29)  loadc.l #u8(70)  loadc #u8(9)  builtin? #u8(43)  set-car! #u8(47)  vargc.l #u8(80)  vec #u8(63)  ret #u8(10)  loadi8 #u8(66)  tapply #u8(77)  loadvoid #u8(25)  loada1 #u8(1)  shift #u8(46)  atom? #u8(24)  cdr #u8(13)  brne.l #u8(83)  / #u8(58)  equal? #u8(52)  apply #u8(54)  dup #u8(11)  loadt #u8(20)  jmp.l #u8(48)  = #u8(60)  not #u8(35)  set-cdr! #u8(30)  fn? #u8(44)  eq? #u8(33)  * #u8(57)  load1 #u8(27)  bound? #u8(42)  box.l #u8(86)  < #u8(28)  brnn.l #u8(84)  jmp #u8(16)  loadv #u8(2)  for #u8(76)  dummy_eof #u8(88)  + #u8(55)  brne #u8(19)  argc.l #u8(79)  compare #u8(61)  brn #u8(3)  neg #u8(37)  loadv.l #u8(67)  vargc #u8(74)  brbound #u8(39)  loadc1 #u8(22)  setg.l #u8(72)  cons? #u8(18)  aref #u8(85)  sym? #u8(34)  aset! #u8(64)  car #u8(12)  cons #u8(32)  tcall.l #u8(82)  - #u8(56)  brn.l #u8(49)  optargs #u8(87)  closure #u8(14)  vec? #u8(45)  pop #u8(4)  eqv? #u8(51)  list #u8(53)  seta #u8(15)  seta.l #u8(73)  brnn #u8(26)  loadnil #u8(65)  loadg #u8(7)  loada #u8(8)  tcall #u8(6))
+            Instructions #table(call.l #u8(81)  trycatch #u8(75)  loadg.l #u8(68)  aref2 #u8(23)  box #u8(50)  cadr #u8(36)  argc #u8(62)  setg #u8(71)  load0 #u8(21)  nan? #u8(38)  fixnum? #u8(41)  loadc0 #u8(17)  loada0 #u8(0)  div0 #u8(59)  keyargs #u8(31)  call #u8(5)  loada.l #u8(69)  num? #u8(40)  sub2 #u8(78)  add2 #u8(29)  loadc.l #u8(70)  loadc #u8(9)  builtin? #u8(43)  set-car! #u8(47)  vargc.l #u8(80)  vec #u8(63)  ret #u8(10)  loadi8 #u8(66)  tapply #u8(77)  loadvoid #u8(25)  loada1 #u8(1)  shift #u8(46)  atom? #u8(24)  cdr #u8(13)  brne.l #u8(83)  / #u8(58)  equal? #u8(52)  apply #u8(54)  dup #u8(11)  loadt #u8(20)  bounda #u8(39)  jmp.l #u8(48)  = #u8(60)  not #u8(35)  set-cdr! #u8(30)  fn? #u8(44)  eq? #u8(33)  * #u8(57)  load1 #u8(27)  bound? #u8(42)  box.l #u8(86)  < #u8(28)  brnn.l #u8(84)  jmp #u8(16)  loadv #u8(2)  for #u8(76)  dummy_eof #u8(88)  + #u8(55)  brne #u8(19)  argc.l #u8(79)  compare #u8(61)  brn #u8(3)  neg #u8(37)  loadv.l #u8(67)  vargc #u8(74)  loadc1 #u8(22)  setg.l #u8(72)  cons? #u8(18)  aref #u8(85)  sym? #u8(34)  aset! #u8(64)  car #u8(12)  cons #u8(32)  tcall.l #u8(82)  - #u8(56)  brn.l #u8(49)  optargs #u8(87)  closure #u8(14)  vec? #u8(45)  pop #u8(4)  eqv? #u8(51)  list #u8(53)  seta #u8(15)  seta.l #u8(73)  brnn #u8(26)  loadnil #u8(65)  loadg #u8(7)  loada #u8(8)  tcall #u8(6))
             S #fn("z170021521}2:" #(getprop constructor) S) __finish
             #fn("n120210>17262:" #(#fn(for-each) #fn("n10A61:") *exit-hooks*) __finish)
             __init_globals #fn("n07021d37022@402384w4^147025d;350426;J50427w8429w:4qw;47<w=47>w?47@wA:" #(*os-name*
@@ -247,14 +247,13 @@
                                                                (seta seta.l) (box box.l)) 255 ((loadc
   loadc.l)) loada (0) loada0 (1) loada1 loadc loadc0 loadc1 brn not brnn eq? brne nreconc) emit)
             emit-optional-arg-inits #fn("n582B3\xa60205071022845347382513<07102452@30q4710258953476077178838452q53q7982515447102:845347102;5247102<895347=0182=8384KM65:q:" #(#fn(gensym)
-  emit brbound cddar dup brnn compile-in extend-env list-head cadar seta pop label
+  emit bounda cddar dup brnn compile-in extend-env list-head cadar seta pop label
   emit-optional-arg-inits) emit-optional-arg-inits)
             encode-byte-code #fn("n17005171855172238651r3238651r2ki2M2452238651E255025502650qqI8988L23\xbc148689G?=48=27CP0288:8689KMG298<5153489r2M?9@\x8b12:8<2;7<873k08=8C2=C702>@X08C2?C702@@L08C2AC702B@@08C2CC702D@408=^1@408=5252489KM?948988L2;38048689G?>42E8=2F523`0288;298<518>5342:8<873707G@407HE5152489KM?9@\xeb08=2ICH02:8<2J8>5152489KM?9@\xce08>X3\xc708=2E8?2K523H02:8<2J8>5152489KM?9@\x9f02E8?2L523\x8102:8<2J8>5152489KM?942:8<2J8689G5152489KM?948=2MCK02:8<2J8689G5152489KM?9@30q@E02:8<2N8>5152489KM?9^1@30q@\x9f.42O2P8<878:>38;5242Q8<61:" #(reverse!
   list->vec >= #fn(length) 65536 #fn(table) #fn(buffer) label #fn(put!)
   #fn(sizeof) #fn(io-write) #fn(get) Instructions jmp jmp.l brne brne.l brnn brnn.l brn brn.l #fn(memq)
-  (jmp brne brnn brn) s32 s16 brbound #fn(s32) (loadv.l loadg.l setg.l loada.l seta.l argc.l
-                                                vargc.l call.l tcall.l loadc.l box.l) (optargs
-                                                                                       keyargs)
+  (jmp brne brnn brn) s32 s16 bounda #fn(s32) (loadv.l loadg.l setg.l loada.l seta.l argc.l vargc.l
+                                               call.l tcall.l loadc.l box.l) (optargs keyargs)
   keyargs #fn(u8) #fn(for-each) #fn("n220A052421AF37072@407324921520~5162:" #(#fn(io-seek)
                                                                               #fn(io-write) s32 s16
                                                                               #fn(get)))
@@ -283,7 +282,7 @@
   "\t")) #fn(memq) (loadv.l loadg.l setg.l) ref-s32-LE (loadv loadg setg)
   (loada seta loadc call tcall list + - * / < = vec argc vargc loadi8 apply tapply closure box
    shift aref) #fn(num->str) aref (loada.l seta.l loadc.l argc.l vargc.l call.l tcall.l box.l) (optargs
-  keyargs) keyargs " " brbound (jmp brne brnn brn) "@" hex5 ref-s16-LE (jmp.l brne.l brnn.l brn.l)) fn-disasm)
+  keyargs) keyargs " " bounda (jmp brne brnn brn) "@" hex5 ref-s16-LE (jmp.l brne.l brnn.l brn.l)) fn-disasm)
             foldl #fn("n382J401:700082<15282=63:" #(foldl) foldl) foldr
             #fn("n382J401:082<700182=5362:" #(foldr) foldr) get-defined-vars #fn("n170A<05161:" #(delete-duplicates) #(#2=(#fn("n10H340q:0<20Cd00=B3^00TR;37040Te1;JM040TB;3E0471051R;3:0471051e1:0<22C?07324A<0=52}2:q:" #(def
   caadr begin nconc #fn(map)) #(#2#)))))
--- a/src/compiler.sl
+++ b/src/compiler.sl
@@ -111,7 +111,7 @@
                      (put! fixup-to-label (sizeof bcode) nxt)
                      (io-write bcode ((if long? s32 s16) 0))
                      (set! i (+ i 1)))
-                    ((eq? vi 'brbound)
+                    ((eq? vi 'bounda)
                      (io-write bcode (s32 nxt))
                      (set! i (+ i 1)))
                     ((num? nxt)
@@ -569,7 +569,7 @@
   ; i is the lexical var index of the opt arg to process next
   (when (cons? opta)
     (let ((nxt (make-label g)))
-      (emit g 'brbound i)
+      (emit g 'bounda i)
       (when (cddar opta)
         (emit g 'dup))
       (emit g 'brnn nxt)
@@ -838,7 +838,7 @@
                     (princ (num->str (ref-s32-LE code i)) " ")
                     (set! i (+ i 4))))
 
-                 ((brbound)
+                 ((bounda)
                   (print-inst inst i 4)
                   (princ (num->str (ref-s32-LE code i)) " ")
                   (set! i (+ i 4)))
--- a/src/opcodes.h
+++ b/src/opcodes.h
@@ -38,7 +38,7 @@
 	OP_CADR,
 	OP_NEG,
 	OP_NANP,
-	OP_BRBOUND,
+	OP_BOUNDA,
 	OP_NUMP,
 	OP_FIXNUMP,
 	OP_BOUNDP,
--- a/src/vm.h
+++ b/src/vm.h
@@ -611,7 +611,7 @@
 	sp[-1] = sl_isnum(sp[-1]) ? sl_t : sl_nil;
 	NEXT_OP;
 
-OP(OP_BRBOUND)
+OP(OP_BOUNDA)
 	*sp++ = bp[GET_S32(ip)] != UNBOUND ? sl_t : sl_nil;
 	ip += 4;
 	NEXT_OP;
--- a/tools/gen.sl
+++ b/tools/gen.sl
@@ -159,7 +159,7 @@
     {[(v)
       "Return `T` if `v` is a floating point representation of NaN, either
        negative or positive, `NIL` otherwise."]})
-  (op brbound)
+  (op bounda)
   (op num? 1 (λ (x) (num? x))
     {[(v)
       "Return `T` if `v` is of a numerical type, `NIL` otherwise.