From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,b1f4420d01b2c4eb X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!out03b.usenetserver.com!news.usenetserver.com!in04.usenetserver.com!news.usenetserver.com!nx01.iad01.newshosting.com!newshosting.com!newsfeed.kamp.net!newsfeed.kamp.net!newsfeed.freenet.de!news.osn.de!diablo1.news.osn.de!feeder.erje.net!nuzba.szn.dk!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: LLVM--Low Level Virtual Machine--and Ada Date: Tue, 24 Jul 2007 14:21:30 -0500 Organization: Jacob's private Usenet server Message-ID: References: <1184730995.862147.208590@g12g2000prg.googlegroups.com> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: jacob-sparre.dk 1185304750 23059 69.95.181.76 (24 Jul 2007 19:19:10 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 24 Jul 2007 19:19:10 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1807 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1896 Xref: g2news2.google.com comp.lang.ada:1132 Date: 2007-07-24T14:21:30-05:00 List-Id: "Duncan Sands" wrote in message news:mailman.7.1185264194.3834.comp.lang.ada@ada-france.org... ... > > Janus/Ada has never used any executable data/stack in its 32-bit versions; > > such code would save no more than a clock cycle or two (out of hundreds or > > thousands) and as such could not be significant. We use compiler-generated > > thunks rather than run-time generated trampolines, and I'm not sure why > > anyone would use the latter (given that they increase the exploitability of > > a program). Most be something I don't understand... > > how do these thunks work? Generally, the compiler passes the address of the thunk to wherever it is needed, and it is called indirectly. The thunks themselves adjust the parameters as needed and call the real routine. This is necessarily a very general description; we use many different kinds of thunks, and the details are different for each. There are some where the address of the routine to call is passed in as well; some of them are just wrappers, and some implement entire operations (like an allocator). In general, the front end generates the thunks; the back end knows about them for optimization and debugger and error message purposes, but it doesn't generate any. I would expect it to be fairly hard to retrofit them if the front end is insisting on doing something else. (It's also possible that trampolines are much faster on some architectures; I've primarily looked at the x86 machines where there is little advantage.) Randy.