Re: compting of frame stack content

Rémi Forax <[email protected]>
Newsgroups gmane.comp.java.objectweb.asm
Message-ID <[email protected]>
  Le 14/10/2010 09:23, luc peuvrier at home a écrit :
> I replace the RETURN opcode of the methods by a GOTO "endLabel"
> So in visitMaxs implementation method I have to generate the code as 
> below:
> methodVisitor.visitLabel(label2);
> methodVisitor.visitFrame(F_SAME, 0, null, 1, new Object[]{XXX} );
> methodVisitor.visitMethodInsn(
> /**/INVOKESTATIC, JOAFIP_CALL_BACK,
> /**/"methodEnd$JOAFIP$", LJAVA_LANG_OBJECT_V_DESC);
> methodVisitor.visitInsn(returnOpcode);
> my problem is how compute XXX according to the return type, since the 
> value to return is in stack after the jump.
> I know the return type using "Type returnType = 
> Type.getReturnType(desc);" where desc is the method descriptor.
> Regards
> Luc

Luc don't try to compute frame and max local/stack yourself,
let ASM do that for you.

If you have performance problem, you can add them later.

Rémi
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.