[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: annot-fieldrw and annot-side-effect options



On Wed, Sep 03, 2003 at 08:47:57PM -0500, Will Benton wrote:
> Hello,
> 
> Is there any more detailed information on these two options beyond 
> what's in the usage guide?  (i.e. "Enable the generation of field 
> read/write attributes" and "Enable the generation of side-effect 
> attributes".)  Are the algorithms or general approaches documented in 
> any publications, or should I just read the source?  :-)

The side-effect attributes are best documented in section 6.2 of my
master's thesis, available at www.sable.mcgill.ca/publications. Let me
know if you have questions about them that this does not answer.

The field read/write attributes were going to be an easier-to-use form
of side-effect information that we were going to get some other people
to use in their JIT. That project seems to have stalled, so we never
finalized or documented the format. I'm attaching a copy of part of an
e-mail, which is the only documentation of the format that exists.

The field r/w don't convey all the information that the side-effect
attributes do: the only list the fields that may be read or modified
by each instruction, discarding any points-to information about which
objects are having their fields read or modified. That is, if two
instructions are modifying a.f and b.f, and Soot knows that a and b
are not aliased, the side-effect attributes will tell you that the
instructions are modifying different things, while the field r/w
attibutes will only tell you that they are both modifying field f.
However, the field r/w attributes are (in theory) easier to understand
and use.

Here's the info on the format of the attributes:

The field read/write data is encoded in two Code attributes, named
FieldRead and FieldWrite. The contents of each attribute follows the
following format:

<attribute>  ::= <num_records> <record>*
<record>     ::= <bytecode_offset> <length> <field_list>
<field_list> ::= <field_spec> ( '%' <field_spec )*
             |   <empty_string>
<field_spec> ::= <declaring_class> ':' <field_name>

<num_records>, <length>, and <bytecode_offset> are encoded as two-byte
integers, most-significant-byte first. <num_records> indicates the
number of records to follow. Each record applies to a specific invoke
bytecode specified by <bytecode_offset>. <length> indicates the length
of the following <field_list> in bytes. The <field_list> lists the
fields (both static and instance fields) that are read/written by the
method(s) (transitively) invoked, separated by '%' characters. Each
field is written as CLASS:FIELD, where CLASS is the name of the class in
which the field is declared, and FIELD is the name of the field.

Ondrej


> 
> 
> 
> 
> thanks,
> wb
> 
> ---
> Will Benton <willb@cs.wisc.edu>
> "Wir sind Bettler, das ist wahr"
>     full contact info at:  http://www.cs.wisc.edu/~willb/willb.vcf
>