DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: B T

⟦59cb6e3a2⟧ TextFile

    Length: 3481 (0xd99)
    Types: TextFile
    Names: »B«

Derivation

└─⟦180fe333a⟧ Bits:30000405 8mm tape, Rational 1000, SW CATALOG, 10_20_0
└─⟦180fe333a⟧ Bits:30000537 8mm tape, Rational 1000, SW Catalog 10_20_0
    └─⟦5cb1d1d7f⟧ »DATA« 
        └─⟦3b1ee7bd8⟧ 
            └─⟦this⟧ 

TextFile

with Instrument;
use Instrument;

------------------------
-- Parameter Association 05
------------------------

-- This test evaluates the code efficiency of a call to a procedure that
-- has five formal in out parameters of the same generic formal type.
-- The objective is to determine whether or not a different parameter
-- passing mechanism is used when more than two parameters are provided.

-- The procedure Param_Assoc is called in the test version using local
-- variables, Outer_1 .. Outer_5 as the actual parameters.  These
-- variables are referenced inside the procedure through the formal
-- parameters to ensure that the required parameter passing is
-- performed.

-- In the noise version, the procedure Param_Assoc is parameterless
-- and references only the local variables, Local_1 .. Local_5, so that
-- there is no parameter passing overhead incurred.  Both the test and
-- noise versions perform the same camouflaged assignments to outer and
-- local variables, respectively.

-- The purpose of using local variables in the noise version is to
-- avoid uplevel referencing of the outer variables.  To prevent the
-- elimination of the local variables in the test version, the values
-- of the locals are used in the assignments just as they are in the
-- noise version.  The same number of assignments are performed in both
-- versions.

procedure Fpanc2 is
    package Pc_Cs is new Procs (Integer);
    use Pc_Cs;

    Outer_1, Outer_2, Outer_3, Outer_4, Outer_5 : T := Ident (Init);

    procedure Param_Assoc (Formal_1 : in out T;      -- included in test version
                           Formal_2 : in out T;      -- included in test version
                           Formal_3 : in out T;      -- included in test version
                           Formal_4 : in out T;      -- included in test version
                           Formal_5 : in out T)   -- included in test version
                  is

        Local_1, Local_2, Local_3, Local_4, Local_5 : T := Ident (Init);

    begin

        Let (Formal_1, Ident (Local_1));      -- included in test version
        Let (Formal_2, Ident (Local_2));      -- included in test version
        Let (Formal_3, Ident (Local_3));      -- included in test version
        Let (Formal_4, Ident (Local_4));      -- included in test version
        Let (Formal_5, Ident (Local_5));      -- included in test version
        --    Let(Local_1,   Ident(Local_1));      -- included in noise version
        --    Let(Local_2,   Ident(Local_2));      -- included in noise version
        --    Let(Local_3,   Ident(Local_3));      -- included in noise version
        --    Let(Local_4,   Ident(Local_4));      -- included in noise version
        --    Let(Local_5,   Ident(Local_5));      -- included in noise version

    end Param_Assoc;

begin
    Start ("FPANC2",
           "Formal in/out Param. Assoc. w/5 param., Non-access type (Test)");
    for I in 1 .. 10000 loop

        Let (Global, Ident (Init));
        Param_Assoc (Formal_1 => Outer_1,        -- included in test version
                     Formal_2 => Outer_2,        -- included in test version
                     Formal_3 => Outer_3,        -- included in test version
                     Formal_4 => Outer_4,        -- included in test version
                     Formal_5 => Outer_5);   -- included in test version
        --  Param_Assoc;                           -- included in noise version

    end loop;
    Stop;

end Fpanc2;