Re: Re: writing two different bytecode parts at the same time
Jochen Theodorou <[email protected]>
| Newsgroups | gmane.comp.java.objectweb.asm |
|---|---|
| Message-ID | <[email protected]> |
Eric Bruneton wrote: > Eugene Kuleshov wrote: >> >> If I understand you correctly, right now, the closest would be to use >> several MethodNode instances from the tree package (those implement >> MethodVisitor interface) and then use InsnLists from those instances >> to assemble them together and call insnList.accept(methodVisitor) >> after that to get the result. > > for me the simplest solution is to generate two versions of each method, > one for the slow path, the other for the fast path. Indeed you can use > several MethodVisitor at the same time, provided they are related to > different methods. Hence this code my problem here is, that the fast path is not the fast path till the end of the method. I have to continuously check if the fast path is still valid. And if it is no longer valid I have to jump to the according slow path part. That means for me I need it in one method and I need to let it share labels. > >> mv1.visitInsn(ILOAD, 1) > >> > >> mv2.visitInsn(ILOAD, 1) > >> mv2.visitMethodcall(SBA.box(I)Object) > > is ok, provided mv1 and mv2 refer to different methods (and use > different labels - you cannot share a label between two visitors). So you say the solution Eugene gave will not work? Or did I get something wrong here? bye Jochen -- Jochen "blackdrag" Theodorou The Groovy Project Tech Lead (http://groovy.codehaus.org) http://blackdragsview.blogspot.com/
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