Re: Using COMPUTE_FRAMES only for some methods

[email protected] Fri, 8 Sep 2017 20:09:03 +0200 (CEST)
Newsgroups gmane.comp.java.objectweb.asm
Message-ID <[email protected]>
So to answer to your question, no, there is no way to do what you want, you can not specify COMPUTE_FRAMES per method.

Note that it's safe to cut&paste the content of a method only if you also add the content of the constant pool, that why you do not have an API that allow you to copy any content of any Reader.  

Also, most of the cost of COMPUTE_FRAMES is due to the fix point algorithm, if you are able to emit the calls to visitFrame in your transformer, you can avoid COMPUTE_FRAMES and just let ASM to compact the frames.

regards,
Rémi

----- Mail original -----
> De: "Ross Allan" <[email protected]>
> À: "Remi Forax" <[email protected]>
> Envoyé: Jeudi 7 Septembre 2017 12:58:03
> Objet: Re: [asm] Using COMPUTE_FRAMES only for some methods

> Hi Rémi,
> 
> Thanks for the suggestion.
> 
> Unfortunately in this case some of the methods are newly added, but
> have valid stackmap frames, so I do not want these to be computed. As
> the methods have been newly added they will not be copied directly.
> Others are newly added but have invalid/no stackmap frames and need
> computed.
> 
> I know ahead of time which ones are valid but do not have a way to specify this.
> 
> Thanks
> Ross Allan
> 
> On 6 September 2017 at 18:26, Remi Forax <[email protected]> wrote:
>> Hi Ross,
>> there is a way to cut&paste the content of existing methods if there is no
>> transformation in between,
>> see
>> http://asm.ow2.org/asm50/javadoc/user/org/objectweb/asm/ClassWriter.html#ClassWriter-org.objectweb.asm.ClassReader-int-
>> in that case the frames/maxs will not be recomputed.
>>
>> cheers,
>> Rémi
>>
>> ________________________________
>>
>> De: "Ross Allan" <[email protected]>
>> À: "asm" <[email protected]>
>> Envoyé: Mercredi 6 Septembre 2017 19:10:32
>> Objet: [asm] Using COMPUTE_FRAMES only for some methods
>>
>> Hi,
>>
>> Often when transforming a class only some methods' control flow is modified,
>> so most methods' frames can be left alone.
>>
>> Currently it is not possible to use COMPUTE_FRAMES only for some methods
>> with a ClassWriter, so we can only choose to recompute frames for all
>> methods or none.
>>
>> Have I missed something? Is there a way to do this currently?
>>
>> Thanks
>> Ross Allan
>>
>>
>> --
>> 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
>>
>>
>>
>> --
>> 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


-- 
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