Kurt W. Hirchert <[log in to unmask]> wrote:
...
> [...] All the copy-in/copy-out implementations with which I have
>had experience still received a reference to the argument; they simply used
>that reference to do a single copy-in and a single copy-out inside the
>procedure rather than using the reference (address) each time the value of
>the argument is accessed or changed. Part of the point of still receiving
>a reference was to make it unnecessary for the caller of the procedure to
>know whether the procedure directly references arguments or does
>copy-in/copy-out.
I once used a compiler which passed by value-in/value-out by putting
the arguments into the registers. If there were more arguments than
a certain percentage of the registers (I think it was three or four
arguments max), then the arguments were passed by reference
instead. I wish I could remember the system this was on so I
could go find the old documentation. I'm not sure how much
of an optimization it was to pass small numbers of scalar arguments
through the registers. It certainly made you aware of the fact
that Fortran allowed either argument passing mechanism.
Cray used to have something similar (for assembly routines only)
called "baselevel" procedures. I don't remember whether you could
call a baselevel routine from Fortran or not.
--
J. Giles
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|