On Fri, 28 Dec 2018 at 13:45, Nick Renieris <makre...@gmail.com> wrote:
> Also, I hope you meant four months for me, not for you - I'm
> completely new to the QEMU codebase. I expect it will take me weeks
> just to understand x86's 'translate.c' (who thought it'd be a good
> idea to put all this stuff in _one_ file?).

x86 suffers from being one of the first and oldest frontends,
and on top of that from not having had a great deal of active
attention. So it has a lot of remnants from older styles of
implementation, as well as the kind of "one big function in
one huge file" that organic growth of a codebase tends to give you.
It doesn't make that much difference whether you have one file
or several, though -- target/arm/translate-a64.c is pretty
well structured and easy (IMHO) to comprehend, but it's
5000 lines longer than target/i386/translate.c. The comprehensibility
improvements come from better breakdown into separate functions
and much clearer commenting of the extent of the decode at any
particular point (plus not having any legacy baggage to deal with).

thanks
-- PMM

Reply via email to