ref: ab269ebae7e261ea53a0c482cd1dd6fe66754794
parent: b6927bf3d2d66c6862d92b3164f39a5b5764b45f
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Fri Mar 14 02:38:28 EDT 2025
disassemble → fn-disasm
--- a/boot/sl.boot
+++ b/boot/sl.boot
@@ -191,20 +191,8 @@
#fn(table) #fn("n20H38070161:21A0<523:0F<0=162:22A0<D534F<0=0<1P62:" #(reverse! #fn(has?)
#fn(put!))) member
delete-duplicates) delete-duplicates)
- diff #fn("n20J40q:200<1523:0710=162:0<710=152P:" #(#fn(memq) diff) diff) disassemble
- #fn("\x871000.///W1000J60q?14z282JG07001E534715047260:@30q482<2305124051II252687>1?:5142527187>2?;514E288851b<I8<<8=L23\x8a24292:888<>2q7;53E8<<L23907150@30q4E87K~2<|48<8<<KM_48>2=8?2>523[08;8>8<<r45348:897?888<<52G5148<8<<r4M_@\x1912=8?2@523V08;8>8<<K5348:89888<<GG5148<8<<KM_@\xea12=8?2A523e08;8>8<<K5347B2C888<<G8>2DC70r3@30EM515148<8<<KM_@\xac12=8?2E523\\08;8>8<<r45347B2C7?888<<52515148<8<<r4M_@w12=8?2F523\xb808;8>8<<r88>2GC70r4@30EM5347B2C7?888<<52512H5248<8<<r4M_47B2C7?888<<52515148<8<<r4M_48>2GCY07B2H5147B2C7?888<<52512H5248<8<<r4M_@30q@\xe608?2Ic3^08;8>8<<r45347B2C7?888<<52512H5248<8<<r4M_@\xb202=8?2J523b08;8>8<<r25347B2K7L8<<7M888<<52M515248<8<<r2M_@w02=8?2N523b08;8>8<<r45347B2K7L8<<7?888<<52M515248<8<<r4M_@<08;8>8<<E53^1^1@\xd0-:" #(disassemble
- newline void #fn(fn-code) #fn(fn-vals) #1=#fn("z0I:" #() void)
- #fn("n10\\3F00[JA070504710qAKM63:72061:" #(newline disassemble print) print-val)
- #fn("n370A3U0FEl23N071A72151523A0A182ML237023@4024751K~512602765:" #(princ >= 1- " >" " " hex5
- ": " " ") print-inst)
- #fn(length) #fn(table-foldl) #fn("n382;J@041AF<Gl2;34040:" #()) Instructions #fn("n1702161:" #(princ
- "\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) princ #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)) disassemble)
- div #fn("n201k0EL2;3D041EL2;3404K;J504r/;J404EM:" #() div) emit
- #fn("z2I2021?75140EG82Jk0122CB088<23C:08824_@R0125CE08788<513;00E88=p@900E188Pp@D126127523A078082<52e1?2@30q42912:52893D02;82<L23:089T?1@30q^142912<52893D02;82<L23:089T?1@30q^1412=C\\0822>d3=02??14q?2@F0822@d3=02A?14q?2@30q@30q412BC\\0822>d3=02C?14q?2@F0822@d3=02D?14q?2@30q@30q488<12EQ;3b04892FCB00E82<2G88=PPp@J0892HCB00E82<2I88=PPp@30q;J@040E7J182P8852p^140:" #(#0#
+ diff #fn("n20J40q:200<1523:0710=162:0<710=152P:" #(#fn(memq) diff) diff) div
+ #fn("n201k0EL2;3D041EL2;3404K;J504r/;J404EM:" #() div) emit #fn("z2I2021?75140EG82Jk0122CB088<23C:08824_@R0125CE08788<513;00E88=p@900E188Pp@D126127523A078082<52e1?2@30q42912:52893D02;82<L23:089T?1@30q^142912<52893D02;82<L23:089T?1@30q^1412=C\\0822>d3=02??14q?2@F0822@d3=02A?14q?2@30q@30q412BC\\0822>d3=02C?14q?2@F0822@d3=02D?14q?2@30q@30q488<12EQ;3b04892FCB00E82<2G88=PPp@J0892HCB00E82<2I88=PPp@30q;J@040E7J182P8852p^140:" #(#0#
#fn("n17002162:" #(member (load0 load1 loadt loadf loadnil loadvoid)) load?) car cdr cadr pop #fn(memq)
(loadv loadg setg) bcode:indexfor #fn(assq) ((loadv loadv.l) (loadg loadg.l) (setg setg.l) (loada
loada.l)
@@ -226,12 +214,24 @@
#fn("n170710515160:" #(compile-thunk macroexpand) eval) even? #fn("n1200K52El2:" #(#fn(logand)) even?)
every #fn("n21H;JD0401<51;3:047001=62:" #(every) every) expand-define
#fn("n10T70051B3:070051@H085R37021@=07223740515285R3@021258586<e3e2:212585<2627e185=e128865185<54e3e2:" #(cddr
- #1# error "compile error: invalid syntax " print-to-str set! #fn(nconc) λ #fn(copy-list)) expand-define)
+ #1=#fn("z0I:" #() void) error "compile error: invalid syntax " print-to-str set! #fn(nconc) λ #fn(copy-list)) expand-define)
extend-env #fn("n370182E530P:" #(vars-to-env) extend-env) filter
#fn("n2I20210>1?65148601qe163:" #(#0# #fn("n382I1B3Q04A1<513?0821<qPN=?2@30q41=?1@\x0e/4=:" #() filter-)) filter)
- fits-i8 #fn("n10Y;3<0470r\xaf0r\xb063:" #(>=) fits-i8) 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<20Cj00=B3d00TR;37040Te1;JS040TB;3E0471051R;3:0471051e1;J404q:0<22C?07324A<0=52}2:q:" #(def
+ fits-i8 #fn("n10Y;3<0470r\xaf0r\xb063:" #(>=) fits-i8) fn-disasm
+ #fn("\x871000.///W1000J60q?14z282JG07001E534715047260:@30q482<2305124051II252687>1?:5142527187>2?;514E288851b<I8<<8=L23\x8a24292:888<>2q7;53E8<<L23907150@30q4E87K~2<|48<8<<KM_48>2=8?2>523[08;8>8<<r45348:897?888<<52G5148<8<<r4M_@\x1912=8?2@523V08;8>8<<K5348:89888<<GG5148<8<<KM_@\xea12=8?2A523e08;8>8<<K5347B2C888<<G8>2DC70r3@30EM515148<8<<KM_@\xac12=8?2E523\\08;8>8<<r45347B2C7?888<<52515148<8<<r4M_@w12=8?2F523\xb808;8>8<<r88>2GC70r4@30EM5347B2C7?888<<52512H5248<8<<r4M_47B2C7?888<<52515148<8<<r4M_48>2GCY07B2H5147B2C7?888<<52512H5248<8<<r4M_@30q@\xe608?2Ic3^08;8>8<<r45347B2C7?888<<52512H5248<8<<r4M_@\xb202=8?2J523b08;8>8<<r25347B2K7L8<<7M888<<52M515248<8<<r2M_@w02=8?2N523b08;8>8<<r45347B2K7L8<<7?888<<52M515248<8<<r4M_@<08;8>8<<E53^1^1@\xd0-:" #(fn-disasm
+ newline void #fn(fn-code) #fn(fn-vals) #1# #fn("n10\\3F00[JA070504710qAKM63:72061:" #(newline
+ fn-disasm
+ print) print-val)
+ #fn("n370A3U0FEl23N071A72151523A0A182ML237023@4024751K~512602765:" #(princ >= 1- " >" " " hex5
+ ": " " ") print-inst)
+ #fn(length) #fn(table-foldl) #fn("n382;J@041AF<Gl2;34040:" #()) Instructions #fn("n1702161:" #(princ
+ "\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) princ #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)
+ 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<20Cj00=B3d00TR;37040Te1;JS040TB;3E0471051R;3:0471051e1;J404q:0<22C?07324A<0=52}2:q:" #(def
caadr begin nconc #fn(map)) #(#2#)))))
getprop #fn("\x8720003000W2000J60q?2420711q5387;3<04208708253;J50482:" #(#fn(get)
*properties*) getprop)
--- a/src/compiler.lsp
+++ b/src/compiler.lsp
@@ -752,9 +752,9 @@
(def (hex5 n)
(str-lpad (num->str n 16) 5 #\0))
-(def (disassemble f (ip nil) . lev?)
+(def (fn-disasm f (ip nil) . lev?)
(when (not lev?)
- (disassemble f ip 0)
+ (fn-disasm f ip 0)
(newline)
(return (void)))
(let ((lev (car lev?))
@@ -763,7 +763,7 @@
(def (print-val v)
(if (and (fn? v) (not (builtin? v)))
(begin (newline)
- (disassemble v nil (+ lev 1)))
+ (fn-disasm v nil (+ lev 1)))
(print v)))
(def (print-inst inst s sz) (princ (if (and ip (= lev 0) (>= ip (1- s)) (< ip (+ s sz)))
" >"
--- a/tools/disenv.lsp
+++ b/tools/disenv.lsp
@@ -5,6 +5,6 @@
(not (builtin? v)))
(print e)
(newline)
- (disassemble v)
+ (fn-disasm v)
(newline))))
(environment))