Tatu Saloranta wrote:
Just a quick question about BitVector implementation. Comments for
member variable 'bits' say:

/** This is public just so that methods will inline. Please don't touch.*/
public byte[] bits;

I'm curious about whether this holds true generally... are JIT compilers known
not to inline methods that access protected/private fields? It seems bit counter-intuitive (or at least different from method handling, where private methods are primary candidates for inlining), but if this is the cases it's something good to know (for commonly used data struct classes at least).
[I tried Google search to find references, but couldn't find any... if someone has pointers that'd be great]
I think this dates from earlier days of Java, when javac would inline some methods, and that gave a significant performance boost. Nowadays inlining is done by JITs and this is probably archaic. I would vote to remove the comment and make the field private. (And I hope no other code is relying on direct access to the byte array...)

Doug



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to