OT Bytecode Attributes/CallinMethodMappings
< OT Bytecode Attributes
Revision as of 00:57, 14 April 2010 by Resix.cs.tu-berlin.de (Talk | contribs) (New page: =Attribute CallinMethodMappings= ===Intent=== The CallinMethodMappings attribute is a variable-length attribute used in the attributes table of the ClassFile structure. ===Location:=== ...)
Contents
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
- TODO
- 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
- TODO
- translation_flags
- TODO