====== 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] ==== * //index//: Used to number interfaces, which contain methods called by //invokeinterface//. * //offset//: Not used, always -1. * //address//: Contains the absolute address of the type descriptor (field //size//). ==== Arrays [Array] ==== * //index//: Not used, always -1. * //offset//: Offset in bytes of the type descriptor in the memory segment. * //address//: Contains the absolute address of the array type descriptor. ==== Methoden [Method] ==== * //index//: If instance method -> index into method table (starting with 0), if class method -> always -1. //index// is set by the [[dev:crosscompiler:cfr|Class File Reader]]. * //offset//: Offset in bytes of the method starting from the start address of the code of the class of this method. * //address//: Contains the absolute address of the method. ==== Fields [DataItem] ==== **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(); - **Class fields [DataItem]:** - Constant fields [NamedConst]: * //index//: Not used, always -1. * //offset//: not used, always -1. * //address//: not used, always -1. - 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. - **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] ==== - **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. - **Strings [StringLiteral]:** * //index//: Index in the string pool. * //offset//: Offset in bytes in the string pool. * //address//: Absolute address.