Bytecode tags used to support AOP
TOD uses a tagging scheme to identify the role of each bytecode instruction (eg. evaluation of dynamic residue for pointcut x).
Method-level attributes
These attributes associate one value of generic type V to ranges of bytecode. Their binary format is the following: one short indicates the number of entries, and after that each entry is in the form (short pc, V v), where pc is a bytecode index, and v is the value associated to the range starting at pc and ending at the next entry’s pc (or at the end of the bytecode, for the last entry). Note that this is the native tagging format of Soot (see soot.tagkit.Tag).
Three such attributes are currently used by TOD, all with value type V=int:
- ca.mcgill.sable.InstructionKind (
V=int)
This attributes permits to know the kind of each bytecode.
| 0 | BASE_CODE |
| 1 | ADVICE_EXECUTION (call of advice method, not execution of inlined advice) |
| 2 | ADVICE_ARG_SETUP |
| 3 | ADVICE_TEST (evaluation of dynamic residue) |
| 36 | INLINED_ADVICE (execution of inlined advice, not yet supported) |
| 41 | CONTEXT_EXPOSURE |
| 42 | PARAMETER_BACKUP (not yet used) |
- ca.mcgill.sable.InstructionShadow (
V=int)
Indicates the shadow id of each instruction. This is an id assigned by the compiler.
- ca.mcgill.sable.InstructionSource (
V=int)
Indicates the advice id of each instruction. This is an id assigned by the compiler. It permits to retrieve the source location of the advice by using the information of the
Class-level attributes
- zz.abc.AspectInfoAttr
This attributes provides information about all the advice ids used in the class (therefore, when considering several classes, a lot of information is reduntant). The format is the following:
| count | short | number of entries |
| entries | entry[] |
Format of each entry:
| id | int | Advice id |
| sourceFile | UTF | Name of source file |
| startLine | int | |
| startColumn | int | |
| endLine | int | |
| endColumn | int |
![(please configure the [header_logo] section in trac.ini)](/trac/tod/chrome/site/your_project_logo.png)