RFC: 8136978 Much nearly duplicated code for vmError support (original) (raw)

Coleen Phillimore coleen.phillimore at oracle.com
Tue Oct 13 23:09:34 UTC 2015


Hi Sebastian,

Thank you for taking this RFE. It's really a bug that we have all this duplicate code.

On 10/13/15 3:21 PM, Sebastian Sickelmann wrote:

Hi,

i have looked at the enhancement JDK-8136978 and have 2 solutions how this could be handled and want to ask which seems to be more "hotspot-code-style" like. The common idea behind the change is to move os/linux/vmErrorlinux.cpp to os/posix/vmErrorposix.cpp and change the methods appropriate. Remove of os[]/vmError[].cpp (for [*] = aix,bsd,solaris and linux) I want to concentrate on the "signals stuff" in this mail. Calls to os::Linux::ucontextsetpc and os::Linux::ucontextgetpc will be changed to os::Posix::....... Calls to pthreadsigmask will be replaced with os::Posix::unblocksignals(const sigsett *set). These methods are defined in os/posix/osposix.hpp. I think unblocksignals should be implemented in os/[]/vm/os[].cpp like this: int os::Posix::unblocksignals(const sigsett *set) { return pthreadsigmask(SIGUNBLOCK, set, NULL); } But for ucontextsetpc and ucontextgetpc i see two variants: Implement in in os/[]/vm/os[].cpp like this: address os::Posix::ucontextgetpc(ucontextt* ctx) { return os::Linux::ucontextgetpc(ctx); } and call the existing methods from the oscpu directory. Or remove the ucontextgetpc and ucontextsetpc from the os/[]/vm/os[].hpp and change the implementations in oscpu//vm/os[][**].cpp from os::[*]::ucontext....... to os::Posix::ucontext.........

Yes, please!

I think the solutions are identically from the view of the compile result at least when inlining is used. I think the first solutions would creates a smaller changeset. I think the second solution would lead to a slightly smaller codebase. What do you think? I personally prefer the second.

Yes, I prefer the second also.

Thanks!! Coleen

-- Sebastian



More information about the hotspot-dev mailing list