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.3 required=5.0 tests=BAYES_00,INVALID_MSGID, MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,2308afbbe4ecec0b X-Google-Attributes: gid103376,public From: Robert Dewar Subject: Re: Subverting 'Access for Sub-programs Date: 1999/08/13 Message-ID: <7ovrsa$1hn$1@nnrp1.deja.com>#1/1 X-Deja-AN: 512063766 References: <37A71EF1.2201@dera.gov.uk> <37A7FDE8.4F5@dera.gov.uk> <7o9vrv$qgt$1@wanadoo.fr> <7oc5ih$6mb$1@wanadoo.fr> <7oejga$28i$1@nnrp1.deja.com> <37AEF7BF.7BBC8E06@averstar.com> <7oqahu$3s0$1@nnrp1.deja.com> <37B1A8B5.219C9FE6@averstar.com> X-Http-Proxy: 1.0 x27.deja.com:80 (Squid/1.1.22) for client 205.232.38.14 Organization: Deja.com - Share what you know. Learn what you don't. X-Article-Creation-Date: Fri Aug 13 01:20:16 1999 GMT X-MyDeja-Info: XMYDJUIDrobert_dewar Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.04 [en] (OS/2; I) Date: 1999-08-13T00:00:00+00:00 List-Id: In article <37B1A8B5.219C9FE6@averstar.com>, Tucker Taft wrote: > or using some sort of "trampoline" trick. Creating a > trampoline that has the right lifetime is a fair amount of > wor as well, since the place of the 'Unchecked_Access is a bit > late. I realize that GNAT has solved this, but I believe it > takes significant advantage of work already performed as part > of the GCC nested procedure support. Actually I don't see any lifetime problems, as long as the trampoline is placed in the stack frame of the enclosing subprogram, as is done in GNAT. However, there are real problems in trampolines -- first the whole issue of cache coherency in Harvard style architectures, and second the issue of write protection of the stack (Sun has a configuration option to do this, but it is troublesome enough that it is very rarely used). GNAT has solved these problems yes, but there are efficiency concerns on some architectures. SO I would agree with Tuck that the possibility of using trampolines should not be something that is factored in. In other words if the ADa definition *requires* trampolines then I think that is a bad choice. The alternative is as Tuck notes, two words per procedure access value, and an extra load on the call. How bad is that? Hard to say, the trade off is this extra space and time, compared to extra complexity in having a separate type. Note that on some architectures, notably from Digital, where all indirect calls go through a procedure descriptor in any case, there is no additional overhead at all (if you like, it is already incurred unconditionally!) Robert Dewar Ada Core Technologies Sent via Deja.com http://www.deja.com/ Share what you know. Learn what you don't.