[Soot-list] A question about using a subset of optimizaitons
directly on bytecode
David Beaumont
dbeaumont at google.com
Sat Aug 2 12:47:20 EDT 2008
On Sat, Aug 2, 2008 at 4:08 PM, Eric Bodden <eric.bodden at mail.mcgill.ca> wrote:
> The only problem is the conversion
> to/from Jimple. Soot uses a bytecode parser called Coffi to convert
> bytecode into Jimple. Usually this reads the bytecode from file but I
> am pretty sure that you could easily extend it to use a byte array
> instead.
But I would only want (in the ideal case) to give it the bytecode for
a single method, not the whole class. Does this sound plausible?
I am using ASM to get the class bytecode and reconstruct the class at
the end, so things like local stack size should be recalculated
accordingly.
Or, does Coffi/Jasmin need to see the whole class (It's not clear if a
JimpleBody relates to a whole class or a single method) ?
> Both Coffi and Jasmin operate on streams (Coffi on an InputStream and
> Jasmin on an OutputStream). Therefore it should be easy to just use
> ByteArrayInput/OutputStreams instead to get what you want.
Sounds ideal!
Cheers,
David
--
David Beaumont :: Mobile Software Engineer :: Google
Google UK Ltd, Belgrave House, 76 Buckingham Palace Road, London SW1W 9TQ
Tel +44-20-7031-3000 :: Fax +44-20-7031-3001
More information about the Soot-list
mailing list