cisco / ChezScheme

Chez Scheme
Apache License 2.0
6.95k stars 982 forks source link

Disassembly #669

Closed ghost closed 1 year ago

ghost commented 1 year ago

I have what I hope is a simple question. Is there some equivalent in Chez to the "disassemble" function in Common Lisp? It displays the assembly language code for a compiled function. Thank you.

burgerrg commented 1 year ago

No. You can get the source information for a procedure like this:

(define (procedure-source x)
  (let ([src (((inspect/object x) 'code) 'source)])
    (and src (src 'value))))

Setting (#%$assembly-output #t) will cause the compiler to display the assembly output at compile time.

ghost commented 1 year ago

Thanks, that worked. Have a nice day!