jakarta-bcel-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Laurent Martelli <laur...@bearteam.org>
Subject Re: Retrieving References of Methods in Methods
Date Mon, 09 Sep 2002 10:11:25 GMT
>>>>> "Markus" ==   <markus.dahm@berlin.de> writes:


  Markus> What you're trying to do is called "dataflow analysis" which
  Markus> is certainly an application area of BCEL but not supported
  Markus> directly.

I'm doing this kind of thing too. I've started to create a simple
stack simulator. Am I welcome to post it on the list ? (It's ~ 250
lines long).

My appraoch was to consider objects on the stack (which can be Object
references, int, long ...) instead of words. I built a custom
CONSUME_STACK table in order to know how may objects are consumed on
the stack for each instruction. It works fine for almost every
instruction. However, there are some strange stack instructions such
as DUP2_X1, which I fail to fit in this scheme. Ah but ... I think
I've got it :-)

Let's see. DUP2_X1 works like this:

Stack: ..., word3, word2, word1 -> ..., word2, word1, word3, word2, word1

If I really understand how it works, word2 and word1 are to considered
a "long" value

Stack: ..., value2, value1.word2, value1.word1 -> ..., value1.word2, value1.word1, word2,
value1.word2, value1.word1

Which in my case means :

Stack: ..., value2, value1 -> ..., value1, word2, value1

Am I right ?

Laurent Martelli                        http://jac.aopsys.com/
laurent@bearteam.org                    http://www.bearteam.org/~laurent/

To unsubscribe, e-mail:   <mailto:bcel-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:bcel-user-help@jakarta.apache.org>

View raw message