Eugene Kuleshov wrote:
- ContinuationMethodAdapter.visitMaxs was passing (0,0) to the next visitor. I'm not too familiar with this, but don't we need to basically pass through values?It is actually ok. ClassWriter is used with computeMaxs flag, so visitMaxs() method is basically an indicator and its params are ignored. It might be possible to caclulate stack and locals but I decided not spend time on this for now.
I see. I'll roll back the changes then.
- When moving 'new' instructions, local variables are allocated excessively. I think it would be better for it to be used little more conservatively. Namely, the number of additional local variables for save/restore should be max of all constructor parameter counts, not sum of them.I spotted this too and tried to fix this but haven't completed yet. It seems that instead of using MethodNode.maxLocals as a stackRecorderVar its value should be memorized and vars for param restoration should be always started from that value + 1
Yes.
- When moving 'new' instructions, The maxStacks field isn't updated correctly, but I think we needed this.It will be recalculated automatically when ClassWriter is used with computeMaxs
Hmm. I got "insufficient stack size" error or something like that when I didn't do anything. I added maxStack += 10 for a try and that made it work, which made me suspect of this issue.
- While instrumenting the FinallyFlow class, I found that ContinuationMethodAdapter.visitMethodInsn dies while trying to save a local variable that has a JSR return address in it. I don't think we can instrument method invocations in a finally block, so there needs to be code that checks it (I don't know how BCEL version is doing that, though)Another option could be to inline these blocks. I believe that one of the projects, which been using ASM did that already and we can just reuse it. I actually was thinking to package it with the asm-commons or something.
That sounds like a good idea. With such code where the same set of byte code is copied into multiple places, would it still be possible for a user to set a breakpoint and etc correctly?
-- Kohsuke Kawaguchi Sun Microsystems [EMAIL PROTECTED]
smime.p7s
Description: S/MIME Cryptographic Signature
