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

⟦ddb3a84cd⟧ TextFile

    Length: 2822 (0xb06)
    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;

--------------------------
-- Record Component Reference
--------------------------

-- This test evaluates the code efficiency of referencing a component
-- of a composite object that has been declared as a record type with
-- a representation clause.

-- The test and noise versions for this evaluation are structurally
-- identical and consist of a procedure that declares and references
-- all the components of a record variable, Local. Prior to referencing
-- each component of the record a camouflaged assignment to the global
-- variable is made to guarantee procedure execution. In addition, the
-- global variable is used in a conditional statement to guard the
-- assignment from potential optimizations.

-- The code efficiency metrics for a single component reference may be
-- derived by averaging the result of this performance evaluation.

procedure Srcra1 is

    package New_Procs is new Procs (Boolean);
    use New_Procs;

    type Enum is (Monday, Tuesday, Wednesday,
                  Thursday, Friday, Saturday, Sunday);
    type Fixed is delta 0.01 range -100.0 .. 100.0;
    subtype Int is Integer range -1000 .. 1000;

    type Representation_Record is

        record
            Enum_Comp : Enum := Enum'Last;
            Int_Comp : Int := Int'Last;
            Fixed_Comp : Fixed := 0.0;
            Bool_Comp : Boolean := True;
        end record;

    type Conventional_Record is

        record
            Enum_Comp : Enum := Enum'Last;
            Int_Comp : Int := Int'Last;
            Fixed_Comp : Fixed := 0.0;
            Bool_Comp : Boolean := True;
        end record;

    -- Representation clause is commented out because it is not
    -- currently supported by a validated compiler.

    --  Storage_Unit : constant := 8;
    --  Word         : constant POSITIVE := 2 * Storage_Unit;
    --
    --  for  REPRESENTATION_RECORD use
    --
    --    record at mod Storage_Unit;
    --      Enum_Comp  at 0 * Word range  0 .. 2;
    --      Int_Comp   at 0 * Word range  3 .. 14;
    --      Fixed_Comp at <storage allocated by compiler>
    --      Bool_Comp  at 1 * Word range 15 .. 15;
    --    end record;

    --  Local : REPRESENTATION_RECORD;        -- included in test version
    Local : Conventional_Record;          -- included in control version

    Local_Enum : Enum;
    Local_Int : Int;
    Local_Fixed : Fixed;
    Local_Bool : Boolean;

begin

    Start ("SRCRA1", "Simple Record Component Ref. (control)");
    for I in 1 .. 10000 loop

        Let (Global, Ident (True));
        if Global = True then
            Local_Enum := Local.Enum_Comp;
            Local_Int := Local.Int_Comp;
            Local_Fixed := Local.Fixed_Comp;
            Local_Bool := Local.Bool_Comp;
        end if;

    end loop;
    Stop;

end Srcra1;