[racket-dev] Easy disassembly of JIT-compiled procedures

From: Sam Tobin-Hochstadt (samth at cs.indiana.edu)
Date: Wed May 21 19:50:05 EDT 2014

On Wed, May 21, 2014 at 6:12 PM, Neil Toronto <neil.toronto at gmail.com> wrote:
> On 05/21/2014 02:09 PM, Sam Tobin-Hochstadt wrote:
>>
>> Racketeers,
>>
>> Thanks to some improvements from Matthew, my `disassemble` package is
>> now much easier to use.
>>
>> [samth at punge:~/sw/disassemble (master) plt] racket
>> Welcome to Racket v6.0.1.10.
>>>
>>> (require disassemble)
>>> (define (const x) 1)
>>> (disassemble const)
>>
>> 00000000  8943FC            mov [ebx-0x4],eax
>> 00000003  83C3FC            add ebx,byte -0x4
>> 00000006  B803000000        mov eax,0x3
>> 0000000B  83C41C            add esp,byte +0x1c
>> 0000000E  5F                pop edi
>> 0000000F  5E                pop esi
>> 00000010  5B                pop ebx
>> 00000011  5D                pop ebp
>> 00000012  C3                ret
>>>
>>>
>
> That's crazy awesome. What were the improvements?

First, Racket now tells you the end of the machine code for a jitted
procedure with `scheme_jit_find_code_end` (so messing about with
guessing the size is no longer needed) and it also can JIT on-demand
(so you don't have to call a function before disassembling it) with
`scheme_jit_now`.

Sam

Posted on the dev mailing list.