History

fn-disasm: fix loadi8 sign; don't call num->str for nothing

Sigrid Solveig Haflínudóttir committed 3 months ago

Commit 570409c1 parent 8e4f7fd2 files · +17 −12Browse files

Unified · Split

2 files
  1. boot/sl.boot +5 −5
  2. src/compiler.sl +12 −7
boot/sl.boot+5−5
@@ -793,7 +793,7 @@ find #fn("O200050007000W2000J7071?24W3000J7072?34W4000J60E?44W5000J70D9?54W6000J · 792 unmodified lines
793793 find-if #fn("O200040006000W2000J7071?24W3000J60E?34W4000J70D9?44W5000J70D9?54DIb:8:2280828:>3_483El23A084J<085J70D9@Q07381838453?14853=0748151?1@40D948:<8161:" #(#(:key
794794 :start :end :from-end) identity #fn("A180S;J>04909180<515136080<:92<80=61:" find-if- 7) subseq
795795 reverse!) 9)
796−fn-disasm #fn("O100030004000W1000J70D9?14W2000J70DA?24W3000J70D9?34DIDIDIDIb:b;21?8422?948:23_48;24_480[3E0752681275347860:@40D9483JL079802:812;822<E5747860:@40D942=80512>8051DIDI2?8283>2?>42@81838:828;>5??4E2A8<51b@DI8@<8AL23\x06242B2C8<8@>2D97D53E8@<L23907850@40D942EE83DI8D8EL23G048D752F51^148DKM?D@\x14/^2514DI48@8@<KM_48B2G8C2H523[08?8B8@<F45348>8=888<8@<52G5148@8@<F4M_@o22G8C2I523V08?8B8@<K5348>8=8<8@<GG5148@8@<KM_@@28C2JC~08?8B8@<K534758<8@<G8EF9c370D9@N08EFAc370DA@A08EFIc370DI@40D9^15148@8@<KM_@\xed12G8C2K523e08?8B8@<K534757L8<8@<G8B2MC70F3@30EM515148@8@<KM_@\xaf12G8C2N523\\08?8B8@<F4534757L888<8@<52515148@8@<F4M_@z12G8C2O523\xb908?8B8@<F88B2PC70F4@30EM534757L888<8@<52512Q5248@8@<F4M_4757L888<8@<52515148@8@<F4M_48B2PCY0752Q514757L888<8@<52512Q5248@8@<F4M_@40D9@\xe808C2Rc3^08?8B8@<F4534757L888<8@<52512Q5248@8@<F4M_@\xb402G8C2S523c08?8B8@<F2534752T8:<8@<898<8@<52M515248@8@<F2M_@x02G8C2U523c08?8B8@<F4534752T8:<8@<888<8@<52M515248@8@<F4M_@<08?8B8@<E53^1^1@T-:" #(#(:ip
796+fn-disasm #fn("O100030004000W1000J70D9?14W2000J70DA?24W3000J70D9?34DIDIDIDIb:b;21?8422?948:23_48;24_480[3E0752681275347860:@40D9483JL079802:812;822<E5747860:@40D942=80512>8051DIDI2?8283>2?>42@81838:828;>5??4E2A8<51b@DI8@<8AL23\x1a242B2C8<8@>2D97D53E8@<L23907850@40D942EE83DI8D8EL23G048D752F51^148DKM?D@\x14/^2514DI48@8@<KM_48B2G8C2H523[08?8B8@<F45348>8=888<8@<52G5148@8@<F4M_@\x8322G8C2I523V08?8B8@<K5348>8=8<8@<GG5148@8@<KM_@T28C2JC~08?8B8@<K534758<8@<G8EF9c370D9@N08EFAc370DA@A08EFIc370DI@40D9^15148@8@<KM_@\x0112G8C2K523a08?8B8@<K534758<8@<G8B2LC70F3@30EM5148@8@<KM_@\xc718C2MCW08?8B8@<K534752N8<8@<G515148@8@<KM_@\x9b12G8C2O523X08?8B8@<F453475888<8@<525148@8@<F4M_@j12G8C2P523\xad08?8B8@<F88B2QC70F4@30EM53475888<8@<522R5248@8@<F4M_475888<8@<525148@8@<F4M_48B2QCU0752R51475888<8@<522R5248@8@<F4M_@40D9@\xe408C2Sc3Z08?8B8@<F453475888<8@<522R5248@8@<F4M_@\xb402G8C2T523c08?8B8@<F2534752U8:<8@<898<8@<52M515248@8@<F2M_@x02G8C2V523c08?8B8@<F4534752U8:<8@<888<8@<52M515248@8@<F4M_@<08?8B8@<E53^1^1@@-:" #(#(:ip
797797 :readable :level) #fn("A220218081EMGE52218081KMGF852218081F2MGF@52218081F3MGFH52g461:" #(#fn(s32)
798798 #fn(ash)) ref-s32-LE 12) #fn("A220218081EMGE52218081KMGF852M61:" #(#fn(s16)
799799 #fn(ash)) ref-s16-LE 10)
@@ -806,10 +806,10 @@ princ " > " " // PC" newline fn-disasm :ip :readable :level #fn(fn-code) · 6 unmodified lines
806806 >= 1- " >" " " ": " #fn(get) " ") print-inst 12)
807807 #fn(size-of) #fn(table-fold) #fn("A382;JD04819091<Gl2;350480:" 7) Instructions #0# "\t" #fn(memq)
808808 (loadv.l loadg.l setg.l) (loadv loadg setg) loade8 (loada seta loadc call tcall list + - * / < =
809−vec argc vargc loadi8 apply tapply closure
810−box shift aref) num->str aref (loada.l seta.l
811−loadc.l argc.l vargc.l call.l tcall.l box.l) (optargs keyargs) keyargs " " bounda (jmp brne brnn
812−brn) "@" (jmp.l brne.l brnn.l brn.l)) 23)
809+vec argc vargc apply tapply closure box shift
810+aref) aref loadi8 #fn(s8)
811+(loada.l seta.l loadc.l argc.l vargc.l call.l tcall.l box.l) (optargs keyargs) keyargs " " bounda
812+(jmp brne brnn brn) "@" (jmp.l brne.l brnn.l brn.l)) 23)
813813 foldl #fn("r22082512172875151DIb9892388878980>4_489<E818263:" #(#fn(length)
814814 #fn(vec-alloc) 1+ #fn("A3DIb78720908087>3_4712280>18252J5081:909181p487<E8252492<7380519390f22425825263:" #(#fn("A281;3z0481<908086];J9047086513:08691G@I02186513=022869152@5086<p492<73805181=62:" #(arr?
815815 #fn(str?) #fn(str-rune) 1+) copy-args 10) every #fn("A170805135080:90218051L2:" #(list? #fn(length)) 7)
src/compiler.sl+12−7
@@ -827,30 +827,35 @@ · 826 unmodified lines
827827 (set! i (+ i 1)))
828828
829829 ((loada seta loadc call tcall list + - * / < = vec
830− argc vargc loadi8 apply tapply closure box shift aref)
830+ argc vargc apply tapply closure box shift aref)
831831 (print-inst inst i 1)
832− (princ (num->str (+ (aref code i) (if (eq? inst 'aref) 3 0))))
832+ (princ (+ (aref code i) (if (eq? inst 'aref) 3 0)))
833+ (set! i (+ i 1)))
834+
835+ (loadi8
836+ (print-inst inst i 1)
837+ (princ (s8 (aref code i)))
833838 (set! i (+ i 1)))
834839
835840 ((loada.l seta.l loadc.l argc.l vargc.l call.l tcall.l box.l)
836841 (print-inst inst i 4)
837− (princ (num->str (ref-s32-LE code i)))
842+ (princ (ref-s32-LE code i))
838843 (set! i (+ i 4)))
839844
840845 ((optargs keyargs)
841846 (print-inst inst i (+ 8 (if (eq? inst 'keyargs) 4 0)))
842− (princ (num->str (ref-s32-LE code i)) " ")
847+ (princ (ref-s32-LE code i) " ")
843848 (set! i (+ i 4))
844− (princ (num->str (ref-s32-LE code i)))
849+ (princ (ref-s32-LE code i))
845850 (set! i (+ i 4))
846851 (when (eq? inst 'keyargs)
847852 (princ " ")
848− (princ (num->str (ref-s32-LE code i)) " ")
853+ (princ (ref-s32-LE code i) " ")
849854 (set! i (+ i 4))))
850855
851856 ((bounda)
852857 (print-inst inst i 4)
853− (princ (num->str (ref-s32-LE code i)) " ")
858+ (princ (ref-s32-LE code i) " ")
854859 (set! i (+ i 4)))
855860
856861 ((jmp brne brnn brn)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t