Use of Index, Offset and Address of an Item

These fields have different meanings according to what a given item represents. Note: Statements in brackets denote a type, e.g. [Class] means an item of type org.deepjava.classItems.Class.

Classes [Class]

Arrays [Array]

Methoden [Method]

Fields [DataItem]

IMPORTANT Constant References

Important: With constant and static references the const flag dpfConst will not be set. Such fields must be handled like regular non constant fields because the class constructor will access such a field exactly once. Example:
static final Object o = new Object();
  1. Class fields [DataItem]:
    1. Constant fields [NamedConst]:
      • index: Not used, always -1.
      • offset: not used, always -1.
      • address: not used, always -1.
    2. Non-constant fields [DataItem]:
      • index: not used, always -1.
      • offset: Offset in bytes (starting with 0 for the first field).
      • address: Contains the absolute address of the field.
  2. Instanz-Felder [DataItem]:
    • index: Not used, always -1.
    • offset: Offset in bytes starting with 0 (fields of superclasses are accounted for).
    • address: Not used, always -1.

Constants [Constant]

  1. Numbers [StdConstant]:
    • index: If of type float or double → index in the const pool. Else always -1.
    • offset: If of type float or double → offset in bytes in the const pool. Else always -1.
    • address: If of type float or double → absolute address. Else always -1.
  2. Strings [StringLiteral]:
    • index: Index in the string pool.
    • offset: Offset in bytes in the string pool.
    • address: Absolute address.