You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Simon Chow <si...@gmail.com> on 2008/05/06 15:21:30 UTC

[drlvm][opt] what does 'irBuilderFlags.expandMemAddrs' mean?

Hi all
I found this flag is frequently used when generating 'Store' related
instruction.
if it is set, makeMultiSrcInst is used, otherwise makeFieldAccessInst is
used, is that right? and Why is that?

Thanks

-- 
>From : Simon.Chow@Software School of Fudan University

Re: [drlvm][opt] what does 'irBuilderFlags.expandMemAddrs' mean?

Posted by Egor Pasko <eg...@gmail.com>.
On the 0x43D day of Apache Harmony Simon Chow wrote:
> Thank you all~
> so all the 'St*'s (such as StField, StStatic, StElem etc.) are translated
> into TauStInd or TauStRef instruction now?
> additionally, what is the exact meaning of 'Tau' prefix?

On Tau plz first take a look at recent discussions:
http://thread.gmane.org/gmane.comp.java.harmony.devel/32642/focus=33106

Exact meaning is that inst has a Tau prefix iff destination operand is a Tau operand.

> 
> Thanks
> 
> 2008/5/7 George Timoshenko <ge...@gmail.com>:
> 
> > expandMemAddr is true by default.
> > I am not sure if it wrorks correctly in the 'false' case.
> >
> > This flag is obsolet actually.
> > It should be removed.
> >
> >
> > Egor Pasko wrote:
> >
> > > On the 0x43C day of Apache Harmony Simon Chow wrote:
> > >
> > > > Hi all
> > > > I found this flag is frequently used when generating 'Store' related
> > > > instruction.
> > > > if it is set, makeMultiSrcInst is used, otherwise makeFieldAccessInst
> > > > is
> > > > used, is that right? and Why is that?
> > > >
> > >
> > > after "Lazy Resolution" feature has been implemented, you can safely
> > > assume expandMemAddrs is always true, otherwise it just does not
> > > work.
> > >
> > > true makes indirect loads by addresses
> > > false makes special instructions like ldfield
> > >
> > > I dunno why there were two ways to do the same thing for ages. Maybe
> > > true value helped memopt (so you do not have to teach it with ldfield
> > > stuff), not sure.
> > >
> > >
> >
> 
> 
> -- 
> From : Simon.Chow@Software School of Fudan University

-- 
Egor Pasko


Re: [drlvm][opt] what does 'irBuilderFlags.expandMemAddrs' mean?

Posted by Alexey Varlamov <al...@gmail.com>.
2008/5/19, Simon Chow <si...@gmail.com>:
> Thanks George, It is very helpful!
> BTW, what do SystemClasses refers to exactly? kernel classes?

I believe George meant class literals from constant pools, a Java5
feature. These are any classes you refer to as "XXX.class" in Java
code.

--
Alexey

>
> Thanks.
>
> 2008/5/19 George Timoshenko <ge...@gmail.com>:
>
> > I also found LdInd, LdRef, LdVar
> >> Where are they used? and What is the difference between these and
> >> TauLdInd?
> >>
> >
> > LdInd: its a kind of wrapper. It can be used for load of anything from
> > memory. But it is not used for java AFAIR.
> > (For Java you always know what you are trying to load so for example for
> > getfield you calculate field address - LdFieldAddr, make null- and type-
> > checks and TauLdInd w/o that wrapper )
> >
> > LdRef - is used for loading strings and SystemClasses. the address for the
> > load explicitly appears only at code selector. In HLO LdRef instruction
> > keeps enclosing method and constant pool index inside for further address
> > request. (VM provides the address at compile time for such items)
> >
> > LdVar - is used for operations with local variables. It is not actually a
> > real load from memory. Some var may happen to be assigned to a register
> > later in code generator. Code selector selects the inst into PseudoCopy
> > instruction. And later PseudoCopy will disappeare or become a real MOV.
> >
> >
>
>
> --
> From : Simon.Chow@Software School of Fudan University
>

Re: [drlvm][opt] what does 'irBuilderFlags.expandMemAddrs' mean?

Posted by George Timoshenko <ge...@gmail.com>.
Simon Chow wrote:
> Thanks George, It is very helpful!
> BTW, what do SystemClasses refers to exactly? kernel classes?


I have no the exact answer. When I implemented the feature to support 
Java5 it was not important for implementation.

You can track LdRef back to translator and see the byte codes which 
leads to LdRef HIR inst.


Re: [drlvm][opt] what does 'irBuilderFlags.expandMemAddrs' mean?

Posted by Simon Chow <si...@gmail.com>.
Thanks George, It is very helpful!
BTW, what do SystemClasses refers to exactly? kernel classes?

Thanks.

2008/5/19 George Timoshenko <ge...@gmail.com>:

> I also found LdInd, LdRef, LdVar
>> Where are they used? and What is the difference between these and
>> TauLdInd?
>>
>
> LdInd: its a kind of wrapper. It can be used for load of anything from
> memory. But it is not used for java AFAIR.
> (For Java you always know what you are trying to load so for example for
> getfield you calculate field address - LdFieldAddr, make null- and type-
> checks and TauLdInd w/o that wrapper )
>
> LdRef - is used for loading strings and SystemClasses. the address for the
> load explicitly appears only at code selector. In HLO LdRef instruction
> keeps enclosing method and constant pool index inside for further address
> request. (VM provides the address at compile time for such items)
>
> LdVar - is used for operations with local variables. It is not actually a
> real load from memory. Some var may happen to be assigned to a register
> later in code generator. Code selector selects the inst into PseudoCopy
> instruction. And later PseudoCopy will disappeare or become a real MOV.
>
>


-- 
>From : Simon.Chow@Software School of Fudan University

Re: [drlvm][opt] what does 'irBuilderFlags.expandMemAddrs' mean?

Posted by George Timoshenko <ge...@gmail.com>.
> I also found LdInd, LdRef, LdVar
> Where are they used? and What is the difference between these and TauLdInd?

LdInd: its a kind of wrapper. It can be used for load of anything from 
memory. But it is not used for java AFAIR.
(For Java you always know what you are trying to load so for example for 
getfield you calculate field address - LdFieldAddr, make null- and type- 
checks and TauLdInd w/o that wrapper )

LdRef - is used for loading strings and SystemClasses. the address for 
the load explicitly appears only at code selector. In HLO LdRef 
instruction keeps enclosing method and constant pool index inside for 
further address request. (VM provides the address at compile time for 
such items)

LdVar - is used for operations with local variables. It is not actually 
a real load from memory. Some var may happen to be assigned to a 
register later in code generator. Code selector selects the inst into 
PseudoCopy instruction. And later PseudoCopy will disappeare or become a 
real MOV.


Re: [drlvm][opt] what does 'irBuilderFlags.expandMemAddrs' mean?

Posted by Simon Chow <si...@gmail.com>.
Thanks you very much!

I also found LdInd, LdRef, LdVar
Where are they used? and What is the difference between these and TauLdInd?

Thanks

2008/5/7 George Timoshenko <ge...@gmail.com>:

> Simon Chow wrote:
>
>> Thank you all~
>> so all the 'St*'s (such as StField, StStatic, StElem etc.) are translated
>> into TauStInd or TauStRef instruction now?
>> additionally, what is the exact meaning of 'Tau' prefix?
>>
>>
> You are right
>
> StField and similar are being translated into
>
> addr = LdFieldAddr (LdElemAddr for array elements)
> StInd(addr,value)
>
>
> Tau means that the instruction contains some auxiliary operand which are
> the results of null- and type- checks for the base of the memory operation.
>
> For a field it is an object base address.
> Before Ld or St operation this address is being checked for NULL and it is
> marked that it points to the object with exact type.
>
>


-- 
>From : Simon.Chow@Software School of Fudan University

Re: [drlvm][opt] what does 'irBuilderFlags.expandMemAddrs' mean?

Posted by George Timoshenko <ge...@gmail.com>.
Simon Chow wrote:
> Thank you all~
> so all the 'St*'s (such as StField, StStatic, StElem etc.) are translated
> into TauStInd or TauStRef instruction now?
> additionally, what is the exact meaning of 'Tau' prefix?
> 

You are right

StField and similar are being translated into

addr = LdFieldAddr (LdElemAddr for array elements)
StInd(addr,value)


Tau means that the instruction contains some auxiliary operand which are 
the results of null- and type- checks for the base of the memory operation.

For a field it is an object base address.
Before Ld or St operation this address is being checked for NULL and it 
is marked that it points to the object with exact type.


Re: [drlvm][opt] what does 'irBuilderFlags.expandMemAddrs' mean?

Posted by Simon Chow <si...@gmail.com>.
Thank you all~
so all the 'St*'s (such as StField, StStatic, StElem etc.) are translated
into TauStInd or TauStRef instruction now?
additionally, what is the exact meaning of 'Tau' prefix?

Thanks

2008/5/7 George Timoshenko <ge...@gmail.com>:

> expandMemAddr is true by default.
> I am not sure if it wrorks correctly in the 'false' case.
>
> This flag is obsolet actually.
> It should be removed.
>
>
> Egor Pasko wrote:
>
> > On the 0x43C day of Apache Harmony Simon Chow wrote:
> >
> > > Hi all
> > > I found this flag is frequently used when generating 'Store' related
> > > instruction.
> > > if it is set, makeMultiSrcInst is used, otherwise makeFieldAccessInst
> > > is
> > > used, is that right? and Why is that?
> > >
> >
> > after "Lazy Resolution" feature has been implemented, you can safely
> > assume expandMemAddrs is always true, otherwise it just does not
> > work.
> >
> > true makes indirect loads by addresses
> > false makes special instructions like ldfield
> >
> > I dunno why there were two ways to do the same thing for ages. Maybe
> > true value helped memopt (so you do not have to teach it with ldfield
> > stuff), not sure.
> >
> >
>


-- 
>From : Simon.Chow@Software School of Fudan University

Re: [drlvm][opt] what does 'irBuilderFlags.expandMemAddrs' mean?

Posted by George Timoshenko <ge...@gmail.com>.
expandMemAddr is true by default.
I am not sure if it wrorks correctly in the 'false' case.

This flag is obsolet actually.
It should be removed.

Egor Pasko wrote:
> On the 0x43C day of Apache Harmony Simon Chow wrote:
>> Hi all
>> I found this flag is frequently used when generating 'Store' related
>> instruction.
>> if it is set, makeMultiSrcInst is used, otherwise makeFieldAccessInst is
>> used, is that right? and Why is that?
> 
> after "Lazy Resolution" feature has been implemented, you can safely
> assume expandMemAddrs is always true, otherwise it just does not
> work.
> 
> true makes indirect loads by addresses
> false makes special instructions like ldfield
> 
> I dunno why there were two ways to do the same thing for ages. Maybe
> true value helped memopt (so you do not have to teach it with ldfield
> stuff), not sure.
> 


Re: [drlvm][opt] what does 'irBuilderFlags.expandMemAddrs' mean?

Posted by Egor Pasko <eg...@gmail.com>.
On the 0x43C day of Apache Harmony Simon Chow wrote:
> Hi all
> I found this flag is frequently used when generating 'Store' related
> instruction.
> if it is set, makeMultiSrcInst is used, otherwise makeFieldAccessInst is
> used, is that right? and Why is that?

after "Lazy Resolution" feature has been implemented, you can safely
assume expandMemAddrs is always true, otherwise it just does not
work.

true makes indirect loads by addresses
false makes special instructions like ldfield

I dunno why there were two ways to do the same thing for ages. Maybe
true value helped memopt (so you do not have to teach it with ldfield
stuff), not sure.

-- 
Egor Pasko