Re: Re: Dynamic jumps?

Eugene Kuleshov <[email protected]>
Newsgroups gmane.comp.java.objectweb.asm
Message-ID <[email protected]>
   Unless you know the address at the transformation time, there is no 
way to have dynamic jumps in the Java bytecode, the JVM does not allow 
address arithmetic not can you read, store or pass around an execution 
pointer or address, except JSR/RET opcodes, which are deprecated since 
Java 5.

   The only option is to generate a switch with hardcoded jumps to all 
required bytecode locations and make sure the stack at those locations 
is set as expected. That is what several continuation tools/frameworks 
for Java do. See, for example, Javaflow [1]

   regards,
   Eugene

[1] http://commons.apache.org/sandbox/javaflow/


On 11/17/2010 10:24 AM, Yao Qi wrote:
>> Hi ASMers,
>>
>> I'm wondering if I can implement a dynamic jump using ASM.
>> Something similar to what try/catch/throw achieves?
>>
>> For example, at a point before I call a method I want to take an address,
>> then within the method I call I can conditionally jump to the address I have
>> been passed?
>>
> AFAICS, I don't see any reasons that you can't do that in current ASM.
message-footer.txt (text/plain, 238 B)
-- 
You receive this message as a subscriber of the [email protected] mailing list.
To unsubscribe: mailto:[email protected]
For general help: mailto:[email protected]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.