Why do we need StubRoutines::handler_for_unsafe_access()?

John Rose John.Rose at Sun.COM
Thu Nov 6 15:44:34 PST 2008


On Nov 6, 2008, at 2:37 AM, Volker Simonis wrote:

> From my point of view it would be much easier to call
> "thread->set_pending_unsafe_access_error()" right from the signal
> handler, compute the next PC and return from the signal handler right
> to that PC. Are there any objectives why this wouldn't work?

I think it would probably work.  The detour through  
handle_unsafe_access is there simply to move work outside of the  
signal handler.  Probably it is simple enough to push all the work  
into the signal handler as it stands.  The risk of putting more logic  
into the signal handler is that eventually somebody will add a path  
to an innocent looking subroutine that is called by the signal  
handler, and the path will be incompatible with execution in the  
signal handler.  Note, for example, that the signal handler uses  
ThreadLocalStorage::get_thread_slow, whereas most of the JVM code  
uses faster methods.  But if you accidentally do a get-thread  
operation from within the signal handler, you may crash the JVM.

-- John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/hotspot-dev/attachments/20081106/ddfc2e4e/attachment.html 


More information about the hotspot-dev mailing list