I caught this comment on Reddit:
https://www.reddit.com/r/java/comments/1h8uwea/comment/m0wrd43/
Even if the comment above is incorrect, I think accessors potentially have negative impacts on performance compared to direct field accesses due to 2 reasons:
- Currently, ClipInlining takes precedence over inlining of accessors, which means that if the total bytecode gets too large, even accessors do not get inlined.
- Even if the accessor is inlined, it leaves behind a lot of dead nodes that can prevent other methods from being inlined when NodeLimitInliningCutoff is reached.
As a result, I think we should:
- Make accessor inlining take precedence over ClipInlining
- Emit less node for a call to accessors given we know that the accessor would get inlined
Bonus:
- For the purpose of inlining a method, should static accessors get the same special treatment, too?
https://www.reddit.com/r/java/comments/1h8uwea/comment/m0wrd43/
Even if the comment above is incorrect, I think accessors potentially have negative impacts on performance compared to direct field accesses due to 2 reasons:
- Currently, ClipInlining takes precedence over inlining of accessors, which means that if the total bytecode gets too large, even accessors do not get inlined.
- Even if the accessor is inlined, it leaves behind a lot of dead nodes that can prevent other methods from being inlined when NodeLimitInliningCutoff is reached.
As a result, I think we should:
- Make accessor inlining take precedence over ClipInlining
- Emit less node for a call to accessors given we know that the accessor would get inlined
Bonus:
- For the purpose of inlining a method, should static accessors get the same special treatment, too?