RFR: 8215412: Optimize PrintStream.println methods

Claes Redestad claes.redestad at oracle.com
Wed Jan 2 12:29:18 UTC 2019


Hi Rémi,


On 2019-01-02 13:05, Remi Forax wrote:
> Hi Claes,
> did you try instead of having a field 'internal' to inline the class check (this.getClass() == PrintStream.class) at every call site you are reading that field ?
> 
> for a method like println(), the VM has to do a class check (if CHA is defeated) before entering the method println so the JIT might be able to remove the check this.getClass() == PrintStream.class because it already know at that point that the current class is PrintStream.

interesting idea - I'll try it out. I don't expect it to make much of a
difference in my current (trivial) tests, but perhaps in a slightly more
contrived setup.

happy new year!

/Claes


More information about the core-libs-dev mailing list