cs375 p. 141

Contents Page-10 Prev Next Page+10 Index

Structure References....

  1. Arrays: The address is the base address of the array plus the offset given by the array formula.
    (AREF base offset )
    The type is the array element type.

  2. Records: The address is the base address of the record plus the offset of the field within the record: (AREF base offset )
    The type is the field type.

  3. Pointers: The address is given by accessing the value of the pointer: (^ pointer )
    The type is the type pointed to. This is called dereferencing the pointer.

Because structure references generate many additive constants, it is an important and easy optimization to keep additive constants at the front of the addressing expression and to combine (fold) additive constants as structure accesses are processed:

Address = Base Address + ∑i=1n Offseti

AltStyle によって変換されたページ (->オリジナル) /