deep

a Cross Development Platform for Java

User Tools

Site Tools


dev:crosscompiler:fields_of_item

This is an old revision of the document!


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 ch.ntb.inf.deep.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 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 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.

Felder [DataItem]

IMPORTANT Konstante Referenzen

Achtung: bei konstanten, statischen Referenzen ist das Const-Flag (dpfConst) nicht gesetzt, da diese wie normale, nicht konstante statische Felder zu behandeln sind. Dies weil auf solche Felder ein einmaliger Zugriff aus dem Klassenkonstruktor stattfindet!

Beispiel:

static final Object o = new Object();
  1. Klassen-Felder [DataItem]:
    1. Konstante Felder [NamedConst]:
      • index: Not used, always -1.
      • offset: not used, always -1.
      • address: not used, always -1.
    2. Nicht konstante Felder [DataItem]:
      • index: not used, always -1.
      • offset: Byteoffset des Feldes (beginnend bei 0 für das erste Feld).
      • address: Contains the absolute address of the field.
  2. Instanz-Felder [DataItem]:
    • index: Wird nicht verwendet, ist immer -1;
    • offset: Byteoffset des Feldes beginnend bei 0 (inkl. Berücksichtung der Felder der Oberklassen).
    • address: Not used, always -1.

Konstanten [Constant]

  1. Zahlen [StdConstant]:
    • index: Wenn die Konstante vom Typ float oder double ist, ist index der Index der Konstante im Konstantenpool. Ansonsten immer -1;
    • offset: Wenn die Konstante vom Typ float oder double ist, ist offset der Byteoffset der Konstante im Konstantenpool. Ansonsten immer -1;
    • address: Wenn es sich um eine Konstante vom Typ float oder double handelt, ist address die absolute Adresse der Konstante (direkt im Konstantenblock). Ansonsten immer -1.
  2. Stings [StringLiteral]:
    • index: Wenn es sich bei der Konstante um einen String handelt, so wird in index der Index des Strings im Stringpool abgelegt.
    • offset: Wenn es sich bei der Konstante um einen String handelt, so wird in offset der Byteoffset des Strings im Stringpool abgelegt.
    • address: Absolute Adresse des konstanten Strings (direkt im Konstantenblock).
dev/crosscompiler/fields_of_item.1427612777.txt.gz · Last modified: 2016/02/25 13:33 (external edit)