Inlining primitive targets?
Chanwit Kaewkasi
chanwit at gmail.com
Thu Jul 23 01:15:59 PDT 2009
Hello John,
2009/7/21 John Rose <John.Rose at sun.com>:
> On Jul 17, 2009, at 3:10 AM, Chanwit Kaewkasi wrote:
>> I think in several cases, we need binary operators to be primitives.
>
> That's true. Your own plus(int,int) method handle will (almost
> certainly) be inlined into a single instruction. That's what you
> want, right?
Ultimately, yes :-)
>> So is it possible to by-pass this call sun.dyn.FromGeneric
>> $A2::invoke_I2 ?
>> Or is it possible to have a call like
>> sun.dyn.FromGeneric$A2::invoke_I2, but with (II)I.
>
> After inlining it doesn't matter how the pieces were factored in the
> sun.dyn internals. You should always get the code for unbox-unbox-add-
> box.
>
>> BTW, as the last time the target (Integer, Integer)Integer is
>> successfully inlined,
>> If I would like to do a simple boxing/unboxing pairs removal on
>> generated assembly codes,
>> which part of C2 can I start looking at?
>
> That's already in C2, at least partly. Look at
> LoadNode::eliminate_autobox and related functions.
>
> To see if that's what you want, make some test cases that do *not* use
> JSR 292 features, and look at the code to make sure your desired
> optimizations happen.
Thank you very much. I started working from your suggestion. Ideal
nodes of C2 are quite tricky to be working with. However, I am getting
familiar with it and able to do a simple node replacement at the
moment. Papers mentioned in Hotspot Internals wiki also help a lot to
start with this.
> When method handle inlining works, the same optimizations will apply
> to the inlined method handle IR.
I am looking forward to contribute (if possible) as well.
Best regards,
Chanwit
--
Chanwit Kaewkasi
PhD Candidate,
Centre for Novel Computing
School of Computer Science
The University of Manchester
Oxford Road
Manchester
M13 9PL, UK
More information about the mlvm-dev
mailing list