Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

misc: after several years: new JIT...

18 views
Skip to first unread message

BGB

unread,
Jan 22, 2013, 9:48:48 PM1/22/13
to
after several years with no functioning JIT for my VM, I have finally
gotten around to writing a new JIT (sort of, and it is x86 only ATM).

what it produces isn't strictly purely compiled code, but rather a mix
of directly compiled instructions and "subroutine threaded code" for
pretty much everything else (sadly, still most of the ISA at present, as
thus far only a few opcodes have been converted over).


in this case, most of the "hard part" (such as type-inference) is being
handled by the interpreter itself, and to some extent a lot more work
has migrated to the language front-end. this cuts down somewhat on the
complexity of implementing a new JIT.


example of the produced threaded code:
<--
...
mov eax, [ebp+8]
mov [esp+0], eax
mov dword [esp+4], 0x0965EC20
call @0x00452770
mov [esp+4], eax
call @0x00453198
mov [esp+4], eax
call @0x004519CE
mov [esp+8], eax
mov eax, [ebp+12]
mov [esp+4], eax
call @0x00452F22
...
-->

performance is still a bit worse than native C code, but as-is this
isn't really a huge surprise.


or such...
0 new messages