Why do we need StubRoutines::handler_for_unsafe_access()?

Volker Simonis volker.simonis at gmail.com
Thu Nov 6 02:37:02 PST 2008


Hi,

does anybody know why we need the stub routine
"handler_for_unsafe_access". As far as I can see, the stub routine
only calls "handle_unsafe_access()" (which is defined in
"stubGenerator_<arch>.cpp) and jumps to the returned address.

"handle_unsafe_access()" in turn calls
"thread->set_pending_unsafe_access_error()" to request an asynchronous
exception and returns the next PC which is calculated based on the
previously saved exception PC ("thread->saved_exception_pc()").

The only place where the "handler_for_unsafe_access" stub is called is
in the signal handler, if a bus error happens during an unsafe
operation. My question is if it is really necessary to go through a
stub? 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?

Thank you and best regards,
Volker



More information about the hotspot-dev mailing list