Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "OT Bytecode Attributes/CallinMethodMappings"

(New page: =Attribute CallinMethodMappings= ===Intent=== The CallinMethodMappings attribute is a variable-length attribute used in the attributes table of the ClassFile structure. ===Location:=== ...)
 
(Format:)
Line 71: Line 71:
 
::The constant_pool index representing the signature of RM as type descriptor.
 
::The constant_pool index representing the signature of RM as type descriptor.
 
:*flags
 
:*flags
::TODO
+
::The value of the flags item is a mask of flags. The interpretation of each flag, when set, is as shown in the following:
 +
 
 +
{| cellpadding="5" border="1"
 +
|-
 +
! Flag Name                !! Value        !! Interpretation
 +
|-
 +
| STATIC_ROLE_METHOD        || <tt>1</tt>    ||  the bound role method is static
 +
|-
 +
| QUERY                    || <tt>2</tt>    ||  ? does this flag exit?
 +
|-
 +
| INHERITED                || <tt>4</tt>    ||  the bound role method is inherited
 +
|-
 +
| COVARIANT_BASE_RETURN    || <tt>8</tt>    ||  the role returns a covariant base type (?)
 +
|}
 +
 
 
:*lift_method_name
 
:*lift_method_name
 
::The constant_pool index representing the name of the lift method for the result ("", if no lifting necessary)
 
::The constant_pool index representing the name of the lift method for the result ("", if no lifting necessary)
 
:*lift_method_signature
 
:*lift_method_signature
 
::The constant_pool index representing the signature of the lift method for the result ("", if no lifting necessary)
 
::The constant_pool index representing the signature of the lift method for the result ("", if no lifting necessary)
:*binding_modifier
+
:*binding_modifier
 
::The constant_pool index representing the binding modifier ("after", "before" or "replace").
 
::The constant_pool index representing the binding modifier ("after", "before" or "replace").
:*base_method_mapping_count
+
:*base_method_mapping_count
 
::The value of the base_method_mapping_count item indicates the number of entries in the base_mappings array.
 
::The value of the base_method_mapping_count item indicates the number of entries in the base_mappings array.
 
:*base_mappings[]
 
:*base_mappings[]
Line 92: Line 106:
 
:::The constant_pool index representing the signature of the callin wrapper for the pair RM + BM as type descriptor.
 
:::The constant_pool index representing the signature of the callin wrapper for the pair RM + BM as type descriptor.
 
::*base_flags
 
::*base_flags
:::TODO
+
:::The value of the base_flags item is a mask of flags. The interpretation of each flag, when set, is as shown in the following:
 +
 
 +
{| cellpadding="5" border="1"
 +
|-
 +
! Flag Name          !! Value        !! Interpretation
 +
|-
 +
| CALLIN              || <tt>1</tt>    ||  the bound base method is a callin (role) method
 +
|-
 +
| STATIC_BASE_METHOD  || <tt>2</tt>    ||  the bound base method is static
 +
|}
 
::*translation_flags
 
::*translation_flags
:::TODO
+
:::TODO: result/args needing translation?? (callins with param mappings compute the need for translation only during resolve())
 
    
 
    
 
[[Category:Object Teams Development]]
 
[[Category:Object Teams Development]]

Revision as of 01:35, 14 April 2010

Attribute CallinMethodMappings

Intent

The CallinMethodMappings attribute is a variable-length attribute used in the attributes table of the ClassFile structure.


Location:

A bound role class with a callin binding.

Content:

A list of method bindings. For structure, see below.

Purpose:

The OTRE uses this attribute to determine

  • a) which callins (callin wrapper calls) have to be woven into which base methods
  • b) which base method has to be called while generating a base-call in a callin role method

Format:

   CallinMethodMappings {
     u2 attribute_name_index;
     u4 attribute_length;
     u2 method_mappings_count;
     CallinMethodMapping method_mappings[method_mappings_count];
    }
 
    CallinMethodMapping {
     u2 binding_file_name;
     u2 binding_line_number;
     u2 binding_line_offset;
     u2 binding_label;
     u2 role_method_name_index;
     u2 role_method_signatur_index;
     u2 flags;
     u2 lift_method_name;
     u2 lift_method_signature;
     u2 binding_modifier;
     u2 base_method_mapping_count;
     BaseMethodMapping base_mappings[base_method_mapping_count];
    }
   
    BaseMethodMapping {
     u2 base_method_name_index;
     u2 base_method_signature_index;
     u2 wrapper_name_index;
     u2 wrapper_signature_index;
     u1 base_flags;
     u4 translation_flags;
    }   

The items of the CallinMethodMappings structure are as follows:

  • attribute_name_index
The constant_pool entry at that index must be a CONSTANT_Utf8_info representing the string "CallinRoleBaseBindings".
  • attribute_length
The value of the attribute_length item indicates the length of the attribute, excluding the initial six bytes.
  • method_mappings_count
The value of the method_mappings_count item indicates the number of entries in the method_mappings array.
  • method_mappings[]
Each pair role method RM + bound base method BM are listed here. Each method_mappings array entry contains the following 12 items:
  • binding_file_name
The constant_pool index representing the name of the file which contains the callin binding.
  • binding_line_number
The constant_pool index(?) representing the line number of the callin binding.
  • binding_line_offset
The constant_pool index(?) representing the line number offset of the callin binding.
  • binding_label
The constant_pool index representing the binding label.
  • role_method_name_index
The constant_pool index representing the name of RM.
  • role_method_signatur_index
The constant_pool index representing the signature of RM as type descriptor.
  • flags
The value of the flags item is a mask of flags. The interpretation of each flag, when set, is as shown in the following:
Flag Name Value Interpretation
STATIC_ROLE_METHOD 1 the bound role method is static
QUERY 2  ? does this flag exit?
INHERITED 4 the bound role method is inherited
COVARIANT_BASE_RETURN 8 the role returns a covariant base type (?)
  • lift_method_name
The constant_pool index representing the name of the lift method for the result ("", if no lifting necessary)
  • lift_method_signature
The constant_pool index representing the signature of the lift method for the result ("", if no lifting necessary)
  • binding_modifier
The constant_pool index representing the binding modifier ("after", "before" or "replace").
  • base_method_mapping_count
The value of the base_method_mapping_count item indicates the number of entries in the base_mappings array.
  • base_mappings[]
Each base_mappings array entry contains the following six items:
  • base_method_name_index
The constant_pool index representing the name of BM.
  • base_method_signature_index
The constant_pool index representing the signature of BM as type descriptor.
  • wrapper_name_index
The constant_pool index representing the name of the callin wrapper for the pair RM + BM.
  • wrapper_signature_index
The constant_pool index representing the signature of the callin wrapper for the pair RM + BM as type descriptor.
  • base_flags
The value of the base_flags item is a mask of flags. The interpretation of each flag, when set, is as shown in the following:
Flag Name Value Interpretation
CALLIN 1 the bound base method is a callin (role) method
STATIC_BASE_METHOD 2 the bound base method is static
  • translation_flags
TODO: result/args needing translation?? (callins with param mappings compute the need for translation only during resolve())

Back to the top