This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: need to focus on java performance?


David Daney writes:
 > Andrew Haley wrote:
 > > David Daney writes:
 > >  > Bryce McKinlay wrote:
 > >  > > David Daney wrote:
 > >  > >> The calling method's address is in the standard location (as 
 > >  > >> specified by the ABI), we know how to find the class given this 
 > >  > >> information. 
 > >  > >
 > >  > > Finding the method's address is easy enough, but what about
 > >  > > the address of the atable entry containing the pointer to
 > >  > > the method?
 > >  > Isn't the atable part the the calling method's class?  The
 > >  > stack trace infrastructure allows you to find the class of a
 > >  > method given an IP that is contained by the method.
 > > 
 > > Mmm, but it's quite expensive.  It would be nice not to do
 > > unwinding in the class initialization path.
 > 
 > If you structured the little trampoline code properly, you would not 
 > have to use the full DWARF unwinder.  You only have to go back one 
 > level.  GCC even has a built-in that allows you to do this 
 > (__builtin_return_address(0)).  Now looking up the class given this 
 > might still be slow,

Yeah.  It might.  :-)

 > but you don't need a complete stacktrace.

That's true.  However, the binary search to find a method's base
address is still pretty expensive.  And once you'd found the calling
class you'd then have to find the appropriate atable entry.  And you'd
have to do it once for every caller into the class, unlike Bryce's
suggestion which could do all of them at once.

In theory we could pass the address of the atable entry in a register.
The cost of doing that would be small on many architectures, since
you's already have that address anyway.  Zero cost would be better.

Andrew.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]