You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by clara <cl...@gmail.com> on 2006/12/15 04:11:20 UTC

[drrvm][jitrino] How can we start Escape Analysis

Hi,all:

I noticed that there were two kinds of escape analysis implementation in jitrino\src\optimizer.
But what command options can be used to start these Escape Analysis? 
Thanks.

--
Yu Zhang

Univ. of Science & Technology of China(USTC)

Re: [drrvm][jitrino] How can we start Escape Analysis

Posted by Salikh Zakirov <Sa...@Intel.com>.
Yu Zhang wrote:
> But there is another question, you said a new thread manager(TM) in DRLVM
> siginificantly reduced synchronization cost,

I believe that Mikhail referred to "lock reservation" optimization,
implemented in following files

C-implementation:
	vm/thread/src/thread_native_thin_monitor.c

Optimized fast path for IA32 in assembler (actually, in emitter calls):
	vm/thread/src/thread_helpers.cpp


>  could you give me further
> infomation on it, such as the file name or the related documents 

Source files of Thread Manager are located in
	vm/thread/src

The data structures of the thread manager are described in
	vm/thread/src/thread_private.h
and are used as opaque pointers in all other sources of the VM.

Build-wise, thread manager results in two libraries:

	hythr.dll
		thread_native_*.c

	jthread.lib
		all other sources

And jthread.lib is in turn linked into harmonyvm.dll.


> (except the  http://harmony.apache.org/subcomponents/drlvm/TM.html) ? 

Besides this document, you can generate doxygen documentation from thread
manager sources. More details in HARMONY-2351.

Any specific questions would be much appreciated, as I intend to improve
documentation based on feedback.

> Are there several TM implementations in DRLVM? 

No, there exist just one Thread Manager implementation in DRLVM.
However, the native interface of thread manager (hythr.dll/libhythr.so)
which is used by Classlib (particularly by hyprt.dll) has two separate
implementations.

There were many discussions on how to deal with this problem,
but no significant progress yet.


Re: [drrvm][jitrino] How can we start Escape Analysis

Posted by Egor Pasko <eg...@gmail.com>.
On the 0x247 day of Apache Harmony Lei Zhao wrote:
> hi,
> For the feature of memory management optimization in JIT,  
> I want to know if Hotspot and/or JikesRVM have installed it, 
> or if there would be some achievement that we DRLVM can get help from.
> 
> Thanks :)

yeah, and feel free to look at memoryopt.cpp in Jitrino, it removes
loads/stores, not EA-based.

> Lei Zhao
> ----- Original Message ----- 
> From: "Egor Pasko" <eg...@gmail.com>
> To: <de...@harmony.apache.org>
> Sent: Thursday, December 21, 2006 6:20 PM
> Subject: Re: [drrvm][jitrino] How can we start Escape Analysis
> 
> 
> > On the 0x245 day of Apache Harmony Mikhail Fursov wrote:
> >> On 12/19/06, Yu Zhang <cl...@gmail.com> wrote:
> >> >
> >> > Thanks for your helps. :-)
> >> > We are interested not only in the EA, but also in the synchronization
> >> > techniques.
> >> > I further want to know whether EA is used for improving memory management
> >> > in jitrino.
> >> >
> >> Yu Zhang,
> >> AFAIK current EA implementation in Jitrino does not perform any memory
> >> management optimizations. This is an open area for improvements, especially
> >> after interface devirtualization patch was committed to the trunk.
> > 
> > my 2c: "Lazy Exception" optimization pass targets on improving memory
> > management in Jitrino (with VM support), it targets on detection if
> > exception object is used in the 'catch' (of another method) and avoids
> > object creation if it can prove allocation is not necessary. Not EA,
> > but similar.
> > 
> > -- 
> > Egor Pasko
> > 
> >

-- 
Egor Pasko


Re: [drrvm][jitrino] How can we start Escape Analysis

Posted by Lei Zhao <as...@ustc.edu>.
hi,
For the feature of memory management optimization in JIT,  
I want to know if Hotspot and/or JikesRVM have installed it, 
or if there would be some achievement that we DRLVM can get help from.

Thanks :)

Lei Zhao
----- Original Message ----- 
From: "Egor Pasko" <eg...@gmail.com>
To: <de...@harmony.apache.org>
Sent: Thursday, December 21, 2006 6:20 PM
Subject: Re: [drrvm][jitrino] How can we start Escape Analysis


> On the 0x245 day of Apache Harmony Mikhail Fursov wrote:
>> On 12/19/06, Yu Zhang <cl...@gmail.com> wrote:
>> >
>> > Thanks for your helps. :-)
>> > We are interested not only in the EA, but also in the synchronization
>> > techniques.
>> > I further want to know whether EA is used for improving memory management
>> > in jitrino.
>> >
>> Yu Zhang,
>> AFAIK current EA implementation in Jitrino does not perform any memory
>> management optimizations. This is an open area for improvements, especially
>> after interface devirtualization patch was committed to the trunk.
> 
> my 2c: "Lazy Exception" optimization pass targets on improving memory
> management in Jitrino (with VM support), it targets on detection if
> exception object is used in the 'catch' (of another method) and avoids
> object creation if it can prove allocation is not necessary. Not EA,
> but similar.
> 
> -- 
> Egor Pasko
> 
>

Re: [drrvm][jitrino] How can we start Escape Analysis

Posted by Egor Pasko <eg...@gmail.com>.
On the 0x245 day of Apache Harmony Mikhail Fursov wrote:
> On 12/19/06, Yu Zhang <cl...@gmail.com> wrote:
> >
> > Thanks for your helps. :-)
> > We are interested not only in the EA, but also in the synchronization
> > techniques.
> > I further want to know whether EA is used for improving memory management
> > in jitrino.
> >
> Yu Zhang,
> AFAIK current EA implementation in Jitrino does not perform any memory
> management optimizations. This is an open area for improvements, especially
> after interface devirtualization patch was committed to the trunk.

my 2c: "Lazy Exception" optimization pass targets on improving memory
management in Jitrino (with VM support), it targets on detection if
exception object is used in the 'catch' (of another method) and avoids
object creation if it can prove allocation is not necessary. Not EA,
but similar.

-- 
Egor Pasko


Re: [drrvm][jitrino] How can we start Escape Analysis

Posted by Mikhail Fursov <mi...@gmail.com>.
On 12/19/06, Yu Zhang <cl...@gmail.com> wrote:
>
> Thanks for your helps. :-)
> We are interested not only in the EA, but also in the synchronization
> techniques.
> I further want to know whether EA is used for improving memory management
> in jitrino.
>
Yu Zhang,
AFAIK current EA implementation in Jitrino does not perform any memory
management optimizations. This is an open area for improvements, especially
after interface devirtualization patch was committed to the trunk.
-- 
Mikhail Fursov

Re: [drrvm][jitrino] How can we start Escape Analysis

Posted by Yu Zhang <cl...@gmail.com>.
Thanks for your helps. :-)
We are interested not only in the EA, but also in the synchronization techniques.
I further want to know whether EA is used for improving memory management in jitrino.
Thanks,
--
Yu
USTC
----- Original Message ----- 
From: "Mikhail Fursov" <mi...@gmail.com>
To: <de...@harmony.apache.org>
Sent: Monday, December 18, 2006 7:36 PM
Subject: Re: [drrvm][jitrino] How can we start Escape Analysis


> On 12/16/06, Xiao-Feng Li <xi...@gmail.com> wrote:
>>
>> Yu, welcome to Harmony community. :-)
>>
>> On 12/15/06, Mikhail Fursov <mi...@gmail.com> wrote:
>> > In the case if monitors costs nothing, what other targets for escape
>> > analysis could be?
>>
>> Good question. :-)
>>
>> Roughly speaking,
>> 1. Lock reservation tries to remove true locking operations at runtime;
>> 2. Escape analysis tries to remove lock operations at compile-time;
>> 3. Monior inlining tries to imporve locking code sequence.
>>
>> Each of them has respective applicable scenario.
> 
> 
> I asked about EA based scenario for monitors or other helpers that can give
> us performance benefit. I understand that EA uses knowledge about objects
> live-range at compilation time.
> The only scenario I see is removal of recursive monitors for inlined methods
> - this task is already covered by EA code (turned off) today in Jitrino.
> Do you want to improve EA to collect some data for GC?
> + Are there any plans to reuse or improve current EA code?
> 
> -- 
> Mikhail Fursov
>

Re: [drrvm][jitrino] How can we start Escape Analysis

Posted by Mikhail Fursov <mi...@gmail.com>.
On 12/16/06, Xiao-Feng Li <xi...@gmail.com> wrote:
>
> Yu, welcome to Harmony community. :-)
>
> On 12/15/06, Mikhail Fursov <mi...@gmail.com> wrote:
> > In the case if monitors costs nothing, what other targets for escape
> > analysis could be?
>
> Good question. :-)
>
> Roughly speaking,
> 1. Lock reservation tries to remove true locking operations at runtime;
> 2. Escape analysis tries to remove lock operations at compile-time;
> 3. Monior inlining tries to imporve locking code sequence.
>
> Each of them has respective applicable scenario.


I asked about EA based scenario for monitors or other helpers that can give
us performance benefit. I understand that EA uses knowledge about objects
live-range at compilation time.
The only scenario I see is removal of recursive monitors for inlined methods
- this task is already covered by EA code (turned off) today in Jitrino.
Do you want to improve EA to collect some data for GC?
+ Are there any plans to reuse or improve current EA code?

-- 
Mikhail Fursov

Re: [drrvm][jitrino] How can we start Escape Analysis

Posted by Xiao-Feng Li <xi...@gmail.com>.
Yu, welcome to Harmony community. :-)

On 12/15/06, Mikhail Fursov <mi...@gmail.com> wrote:
> In the case if monitors costs nothing, what other targets for escape
> analysis could be?

Good question. :-)

Roughly speaking,
1. Lock reservation tries to remove true locking operations at runtime;
2. Escape analysis tries to remove lock operations at compile-time;
3. Monior inlining tries to imporve locking code sequence.

Each of them has respective applicable scenario.
Lock reservation can optimize even if the lock object is accessed by
multiple threads, but escape analysis can remove the locking code
sequence at all from the beginning when applicable.

Thanks,
xiaofeng

> On 12/15/06, Yu Zhang <cl...@gmail.com> wrote:
> >
> > Pavel,
> >
> > Thanks for your help. I could have started the Escape Analysis already.
> > But there is another question, you said a new thread manager(TM) in DRLVM
> > siginificantly reduced synchronization cost, could you give me further
> > infomation on it, such as the file name or the related documents (except the
> > http://harmony.apache.org/subcomponents/drlvm/TM.html) ? Are there several
> > TM implementations in DRLVM? If so, how can we choose it?
> > Thanks.
> >
> > Yu
> > ----- Original Message -----
> > From: "Pavel Ozhdikhin" <pa...@gmail.com>
> > To: <de...@harmony.apache.org>
> > Sent: Friday, December 15, 2006 1:05 PM
> > Subject: Re: [drrvm][jitrino] How can we start Escape Analysis
> >
> >
> > > Clara,
> > >
> > > There are 2 implementations of Escape Analysis in the optimizer:
> > >
> > > - old_escape (escapeanalyzer.cpp) is an old prototype which does some
> > > analysis but does not actually optimize anything;
> > > - escape (escanalyzer.cpp) is a newer prototype which implements
> > EA-based
> > > sychronization elimination and works on Windows/IA32. It showed a good
> > > performance improvement, but a new thread manager in DRLVM
> > siginificantly
> > > reduced synchronization cost, so performance effect from escape pass
> > became
> > > imperceptible and tjhe optimization has been turned off.
> > >
> > > You can try the 'escape' optimization pass by including it into the
> > > optimization path in the emconf file. For example, to add escape into
> > the
> > > default optimizer path, edit your client.emconf as follows (added pass
> > > marked bold):
> > >
> > > -XDjit.CD_OPT.path.optimizer=ssa
> > ,devirt,inline,uce,purge,simplify,dce,uce,*
> > > escape*,lazyexc,memopt,simplify,dce,uce,lower,dessa,statprof,markglobals
> > >
> > > Thank you,
> > > Pavel
> > >
> > >
> > > On 12/15/06, clara <cl...@gmail.com> wrote:
> > >
> > >> Hi,all:
> > >>
> > >> I noticed that there were two kinds of escape analysis implementation
> > in
> > >> jitrino\src\optimizer.
> > >> But what command options can be used to start these Escape Analysis?
> > >> Thanks.
> > >>
> > >> --
> > >> Yu Zhang
> > >>
> > >> Univ. of Science & Technology of China(USTC)
> > >>
> > >
>
>
>
>
> --
> Mikhail Fursov
>
>

Re: [drrvm][jitrino] How can we start Escape Analysis

Posted by Mikhail Fursov <mi...@gmail.com>.
Yu Zhang,
Inlining of monitor/allocation helpers increases performance even more.
Finally we have the same performance for monitors on microtests as the best
RI (not the default!). To get performance results by yourself check
server.emconf for details. I hope we will enable helper inlining for all
modes this year.

In the case if monitors costs nothing, what other targets for escape
analysis could be?

On 12/15/06, Yu Zhang <cl...@gmail.com> wrote:
>
> Pavel,
>
> Thanks for your help. I could have started the Escape Analysis already.
> But there is another question, you said a new thread manager(TM) in DRLVM
> siginificantly reduced synchronization cost, could you give me further
> infomation on it, such as the file name or the related documents (except the
> http://harmony.apache.org/subcomponents/drlvm/TM.html) ? Are there several
> TM implementations in DRLVM? If so, how can we choose it?
> Thanks.
>
> Yu
> ----- Original Message -----
> From: "Pavel Ozhdikhin" <pa...@gmail.com>
> To: <de...@harmony.apache.org>
> Sent: Friday, December 15, 2006 1:05 PM
> Subject: Re: [drrvm][jitrino] How can we start Escape Analysis
>
>
> > Clara,
> >
> > There are 2 implementations of Escape Analysis in the optimizer:
> >
> > - old_escape (escapeanalyzer.cpp) is an old prototype which does some
> > analysis but does not actually optimize anything;
> > - escape (escanalyzer.cpp) is a newer prototype which implements
> EA-based
> > sychronization elimination and works on Windows/IA32. It showed a good
> > performance improvement, but a new thread manager in DRLVM
> siginificantly
> > reduced synchronization cost, so performance effect from escape pass
> became
> > imperceptible and tjhe optimization has been turned off.
> >
> > You can try the 'escape' optimization pass by including it into the
> > optimization path in the emconf file. For example, to add escape into
> the
> > default optimizer path, edit your client.emconf as follows (added pass
> > marked bold):
> >
> > -XDjit.CD_OPT.path.optimizer=ssa
> ,devirt,inline,uce,purge,simplify,dce,uce,*
> > escape*,lazyexc,memopt,simplify,dce,uce,lower,dessa,statprof,markglobals
> >
> > Thank you,
> > Pavel
> >
> >
> > On 12/15/06, clara <cl...@gmail.com> wrote:
> >
> >> Hi,all:
> >>
> >> I noticed that there were two kinds of escape analysis implementation
> in
> >> jitrino\src\optimizer.
> >> But what command options can be used to start these Escape Analysis?
> >> Thanks.
> >>
> >> --
> >> Yu Zhang
> >>
> >> Univ. of Science & Technology of China(USTC)
> >>
> >




-- 
Mikhail Fursov

Re: [drrvm][jitrino] How can we start Escape Analysis

Posted by Yu Zhang <cl...@gmail.com>.
Pavel,

Thanks for your help. I could have started the Escape Analysis already. 
But there is another question, you said a new thread manager(TM) in DRLVM siginificantly reduced synchronization cost, could you give me further infomation on it, such as the file name or the related documents (except the http://harmony.apache.org/subcomponents/drlvm/TM.html) ? Are there several TM implementations in DRLVM? If so, how can we choose it?
Thanks.

Yu
----- Original Message ----- 
From: "Pavel Ozhdikhin" <pa...@gmail.com>
To: <de...@harmony.apache.org>
Sent: Friday, December 15, 2006 1:05 PM
Subject: Re: [drrvm][jitrino] How can we start Escape Analysis


> Clara,
> 
> There are 2 implementations of Escape Analysis in the optimizer:
> 
> - old_escape (escapeanalyzer.cpp) is an old prototype which does some
> analysis but does not actually optimize anything;
> - escape (escanalyzer.cpp) is a newer prototype which implements EA-based
> sychronization elimination and works on Windows/IA32. It showed a good
> performance improvement, but a new thread manager in DRLVM siginificantly
> reduced synchronization cost, so performance effect from escape pass became
> imperceptible and tjhe optimization has been turned off.
> 
> You can try the 'escape' optimization pass by including it into the
> optimization path in the emconf file. For example, to add escape into the
> default optimizer path, edit your client.emconf as follows (added pass
> marked bold):
> 
> -XDjit.CD_OPT.path.optimizer=ssa,devirt,inline,uce,purge,simplify,dce,uce,*
> escape*,lazyexc,memopt,simplify,dce,uce,lower,dessa,statprof,markglobals
> 
> Thank you,
> Pavel
> 
> 
> On 12/15/06, clara <cl...@gmail.com> wrote:
> 
>> Hi,all:
>>
>> I noticed that there were two kinds of escape analysis implementation in
>> jitrino\src\optimizer.
>> But what command options can be used to start these Escape Analysis?
>> Thanks.
>>
>> --
>> Yu Zhang
>>
>> Univ. of Science & Technology of China(USTC)
>>
>

Re: [drrvm][jitrino] How can we start Escape Analysis

Posted by Pavel Ozhdikhin <pa...@gmail.com>.
Clara,

There are 2 implementations of Escape Analysis in the optimizer:

- old_escape (escapeanalyzer.cpp) is an old prototype which does some
analysis but does not actually optimize anything;
- escape (escanalyzer.cpp) is a newer prototype which implements EA-based
sychronization elimination and works on Windows/IA32. It showed a good
performance improvement, but a new thread manager in DRLVM siginificantly
reduced synchronization cost, so performance effect from escape pass became
imperceptible and tjhe optimization has been turned off.

You can try the 'escape' optimization pass by including it into the
optimization path in the emconf file. For example, to add escape into the
default optimizer path, edit your client.emconf as follows (added pass
marked bold):

-XDjit.CD_OPT.path.optimizer=ssa,devirt,inline,uce,purge,simplify,dce,uce,*
escape*,lazyexc,memopt,simplify,dce,uce,lower,dessa,statprof,markglobals

Thank you,
Pavel


On 12/15/06, clara <cl...@gmail.com> wrote:

> Hi,all:
>
> I noticed that there were two kinds of escape analysis implementation in
> jitrino\src\optimizer.
> But what command options can be used to start these Escape Analysis?
> Thanks.
>
> --
> Yu Zhang
>
> Univ. of Science & Technology of China(USTC)
>