This is the mail archive of the java-patches@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: RFC: AccessController merge


On Jul 28, 2006, at 3:43 AM, Gary Benson wrote:

Andrew Haley wrote:
I'm a bit concerned about efficiency.  For one example: OK, we walk
the stack -- we have to do that -- but we create a string for every
method name , and the only purpose of doing so AFAICS is to compare
it with "doPrivileged".  We then throw away all of those strings we
so laboriously constructed...

I see what you mean. Another thing is that if there is a doPrivileged there then a chunk of the generated stack trace will be ignored. I guess Casey wanted the code he put in stacktrace.cc to be generic.


Yeah, AccessController is somewhat dumb, but it is extremely easy to implement for nearly any VM -- any VM that can produce an exception stack trace can also provide AccessController support. Optimizing it for GCJ is a good project; I suppose we could compare function addresses to doPrivileged instead of constructing strings, or somehow building a stack of class loading contexts instead of building the entire stack, and then inspecting that stack to determine the set of contexts.


Is it pretty easy to just map a PC address from the stack to class loader context? I'd assume it's just a matter of determining which .so a class came from (and then possibly what jar that came from), or if it's interpreted. Would something like that be reasonably efficient?

I will, however, say that some of us do prefer a working, slow implementation over a non-existent fast one most days of the week.

Attachment: PGP.sig
Description: This is a digitally signed message part


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