Re: New assembly language instructions to support OO languages?

jgd@cix.compulink.co.uk
Sun, 07 Dec 2008 10:30:46 -0600

          From comp.compilers

Related articles
[17 earlier articles]
Re: New assembly language instructions to support OO languages? georgeps@xmission.com (GPS) (2008-12-05)
Re: New assembly language instructions to support OO languages? gah@ugcs.caltech.edu (Glen Herrmannsfeldt) (2008-12-06)
Re: New assembly language instructions to support OO languages? mailbox@dmitry-kazakov.de (Dmitry A. Kazakov) (2008-12-06)
Re: New assembly language instructions to support OO languages? jasen@xnet.co.nz (Jasen Betts) (2008-12-06)
Re: New assembly language instructions to support OO languages? jgd@cix.compulink.co.uk (2008-12-06)
Re: New assembly language instructions to support OO languages? gneuner2@comcast.net (George Neuner) (2008-12-06)
Re: New assembly language instructions to support OO languages? jgd@cix.compulink.co.uk (2008-12-07)
Re: New assembly language instructions to support OO languages? rpw3@rpw3.org (2008-12-08)
Re: New assembly language instructions to support OO languages? torbenm@pc-003.diku.dk (2008-12-08)
Re: New assembly language instructions to support OO languages? gah@ugcs.caltech.edu (Glen Herrmannsfeldt) (2008-12-08)
Re: New assembly language instructions to support OO languages? bowes.brad@gmail.com (Brad) (2008-12-08)
Re: New assembly language instructions to support OO languages? cfc@shell01.TheWorld.com (Chris F Clark) (2008-12-08)
Re: New assembly language instructions to support OO languages? gneuner2@comcast.net (George Neuner) (2008-12-09)
[11 later articles]
| List of all articles for this month |
From: jgd@cix.compulink.co.uk
Newsgroups: comp.compilers,comp.arch
Followup-To: comp.arch
Date: Sun, 07 Dec 2008 10:30:46 -0600
Organization: Compilers Central
References: 08-12-042
Keywords: architecture
Posted-Date: 07 Dec 2008 17:49:00 EST



  gneuner2@comcast.net (George Neuner) wrote:


> Using segments+paging in 32-bit mode on the 386 and 486 was fun.


What were you writing?


> Page tables suffice for isolating processes, but segmentation allows
> isolation within processes and (to me) more logical control of access
> permissions. Page level NX (no execute) is too fine grain - it
> quickly becomes a PITA when you're implementing any kind of in-memory
> code generator, e.g., a JIT compiler ... particular in a GC'd system
> which may relocate the code (temporarily making it data again).


So you want a logical segment which is writable data, and executable
for JIT code? But you presumably don't want the ordinary data that the
JIT code is dealing with to be executable, else there's little point
in having no-execute memory?


What's wrong with just having a reasonably large pool of executable
memory for JIT code, and GC'ing inside that separately from the main
GC? Yes, two separate pools makes GC less efficient. But the
alternative would seem to be having all data executable.


> Most processors will incur a pipeline stall if the code is also in
> the data cache and will flush the pipeline if prefetched code is
> referenced as data again.


Having segments would not appear to help with that problem: it's
surely a problem with where the data is actually stored, and what the
cache and prefetch hardware is doing with it, in the interests of
getting decent throughput.


> AFAIK, no existing processor is able to distinguish "executable data"
> as unique from regular data and code. ISTM that if it could be
> recognized, processors might be able to better streamline some of the
> gyrations that occur when the code is data cached.


Well, tag bits on each word, or maybe byte, of memory should solve the
problem nicely. Good luck with persuading manufacturers to adopt them.


> Of course, a page level XD bit could be implemented (or a multiple bit
> type code),


Err, isn't that what you said was too fine-grained above?


> but I vote for a return to logical segments anyway because
> they are more convenient for programmers ... users don't care.


No, they aren't more convenient for programmers. They're an utter pain
IME. They make talking to the OS much more complex, make pointers and
references far more complex and less portable, and generally add vast
amounts of friction to the tasks of programming, testing and maintenance.


--
John Dallman, jgd@cix.co.uk, HTML mail is treated as probable spam.


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.