Re: AdviceAdapter extends LocalVariablesSorter

Eirik Bjørsnøs (via asm Mailing List) <[email protected]> Thu, 18 Feb 2021 23:05:38 +0100
Newsgroups gmane.comp.java.objectweb.asm
Message-ID <CA+pBWhvKUxM3RHVvcA=V2+hzT-3UCORzYEzAqHCCeqGh88+88w@mail.gmail.com>
This is a multi-part message in MIME format...

------------=_1613685953-2761-17
Content-Type: multipart/alternative; boundary="000000000000c7877a05bba38919"

--000000000000c7877a05bba38919
Content-Type: text/plain; charset="UTF-8"

On Thu, Feb 18, 2021 at 4:52 PM Eugene Kuleshov <[email protected]> wrote:

>   The thought was that transformations you'd need to implement in the
> AdviceAdapter will likely
> require to introduce local variable slots anyways. So, it was
> extending the variable sorter to
> inherit that capability.
>


This got me thinking: Maybe it would be less intrusive to make
GeneratorAdapter delegate to LVS instead of inheriting from it? Then we
could make this delegation optional via a a new pair of constructors. So by
default, you'd get LVS like today, but would be able to opt out if you
don't need it and want the extra performance.

Here's a rough implementation of the idea:

https://gitlab.ow2.org/eirbjo/asm/-/commit/2ea5fcca9f0068bbc5e567f047fbaa736a060c78

This allows me to change my LocalVariablePrepender to extend from ASM's
AdviceAdapter, but using the new constructor. I get the performance I
desire AND I can instrument constructors without copying AdviceAdapter
wholesale.

Cheers,
Eirik.

--000000000000c7877a05bba38919
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr">On Thu, Feb 18, 2021 at 4:52 PM Eugene Ku=
leshov &lt;<a href=3D"mailto:[email protected]">[email protected]</a>&g=
t; wrote:<br></div><div class=3D"gmail_quote"><blockquote class=3D"gmail_qu=
ote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,20=
4);padding-left:1ex">=C2=A0 The thought was that transformations you&#39;d =
need to implement in the<br>
AdviceAdapter will likely<br>
require to introduce local variable slots anyways. So, it was<br>
extending the variable sorter to<br>
inherit that capability.<br></blockquote><div><br></div><div><br></div><div=
>This got me thinking: Maybe it would be less intrusive to make GeneratorAd=
apter delegate to LVS instead of inheriting from it? Then we could make thi=
s delegation optional via a a new pair of constructors. So by default, you&=
#39;d get LVS like today, but would be able to opt out if you don&#39;t nee=
d it and want the extra performance.</div><div><br></div><div>Here&#39;s a =
rough implementation of the idea:=C2=A0</div><div><br></div><div><a href=3D=
"https://gitlab.ow2.org/eirbjo/asm/-/commit/2ea5fcca9f0068bbc5e567f047fbaa7=
36a060c78">https://gitlab.ow2.org/eirbjo/asm/-/commit/2ea5fcca9f0068bbc5e56=
7f047fbaa736a060c78</a></div><div><br></div><div>This allows me to change m=
y LocalVariablePrepender to extend from ASM&#39;s AdviceAdapter, but using =
the new constructor. I get the performance I desire AND I can instrument co=
nstructors without copying AdviceAdapter wholesale.</div><div><br></div><di=
v>Cheers,</div><div>Eirik.=C2=A0=C2=A0</div></div></div>

--000000000000c7877a05bba38919--

------------=_1613685953-2761-17
Content-Type: text/plain; charset="UTF-8"
Content-Disposition: inline
Content-Transfer-Encoding: 8bit


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

------------=_1613685953-2761-17--