RFC: AccessController merge

Casey Marshall csm@gnu.org
Sat Jul 29 04:50:00 GMT 2006


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.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 478 bytes
Desc: This is a digitally signed message part
URL: <http://gcc.gnu.org/pipermail/java-patches/attachments/20060729/4504b9ef/attachment.sig>


More information about the Java-patches mailing list