RFR(M): 8031997: PPC64: Make the various POLL constants system dependant

Florian Weimer fweimer at redhat.com
Fri Jan 17 14:14:12 UTC 2014

On 01/17/2014 03:04 PM, Volker Simonis wrote:
> On Fri, Jan 17, 2014 at 2:23 PM, Florian Weimer <fweimer at redhat.com> wrote:
>> On 01/17/2014 12:25 PM, Volker Simonis wrote:
>>> To avoid a mapping of the Java constants to the native ones every time
>>> we go from Java to Native and back, this change replaces the currently
>>> used constants with a single instance of constants which is placed in
>>> src/share/classes/sun/nio/ch/Net.java and which are dynamically
>>> initialized from native methods with the correct, platfrom-specific
>>> values.
>> Previously, the constants where inlined at the class file level.  Is there a
>> downside to not doing this?

> I already thought about this. From a performance perspective, I don't
> think it will have any impact considering that these constants will be
> used for doing native system calls anyway.

True, and the few extra bytes of class data hopefully don't matter 
(although they keep adding up).

> It could be of course a problem on AIX (and only there) if third-party
> code had previously inlined these constants. But as these are internal
> classes (i.e. sun.nio.ch) which should be only used by the JDK itself,
>   I hope there's not too such much code outside there.

Some of the classes weren't even public until 8, so this risk is even 
reduced further.

Florian Weimer / Red Hat Product Security Team

More information about the core-libs-dev mailing list