Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

OT Bytecode Attributes/OTCompilerVersion

Attribute OTCompilerVersion

Intent

The OTCompilerVersion attribute is used to record which compiler version has generated a given class file.

Location:

A team class or a role type.

Content:

An integer encoding the compiler/bytecode version (see below).

Purpose:

Detect bytecode incompatibilities due to changes in the compiler.

Format:

   OTCompilerVersion {
     u2 attribute_name_index;
     u4 attribute_length;
     u2 compiler_version;
    }

The items of the OTCompilerVersion structure are as follows:

  • attribute_name_index
The constant_pool entry at that index must be a CONSTANT_Utf8_info representing the string "OTCompilerVersion".
  • attribute_length
The value of the attribute_length item indicates the length of the attribute, excluding the initial six bytes.
  • compiler_version
The value of the compiler_version item is interpreted as a packed structure of three numbers:
  • bit 16: selects the target weaving scheme: 0 = OTRE, 1 = OTDRE (since 2.3)
  • bits 10-15: major version number (range 0-63)
  • bits 6-9: minor version number (range 0-15)
  • bits 1-5: revision (range 0-31)

Correlation to OTDT versions:

For all versions published from objectteams.org the compiler version matched exactly the version of the OTDT.

During incubation of the Eclipse Object Teams Project the OTDT version 0.7.x is mapped to the internal compiler version 1.5.x in order to keep the evolution of bytecode versions monotonic.

The OTDT version 2.0.0 after project graduation is identified by the internal compiler version 1.6.0 (this version was also used by all milestones called 0.8 Mx, which were actually milestones towards 2.0.0).

Recent versions correlate like this:

OTDT Compiler
2.0.0 1.6.0
2.0.1 1.6.1
2.0.2 1.6.2
2.1.x 1.7.0
2.2.x 1.7.0
2.3.x 1.7.0 - introduces selection of OTRE/OTDRE (see above)

Back to the top