RFR: 8255339: CodeBuffer::_last_insn is only used on AArch64

Eric Liu github.com+10482586+therealeliu at openjdk.java.net
Mon Jan 18 02:13:42 UTC 2021


On Fri, 8 Jan 2021 09:21:31 GMT, Eric Liu <github.com+10482586+theRealELiu at openjdk.org> wrote:

>> I filed this RFE while looking through and cleaning out unused code in the area. Letting arch-specific behavior like this live on in shared code means static analysis highlights it as unused which is a bit of a nuisance. Any performance benefit is decidedly slim here, though.
>> 
>> While macroing out code looks superficially messy I think the reading and understanding of code is overall helped when being explicit.
>
> Hi Aleksey,
> 
> Thanks for your feedback.
> 
>> I understand the desire to do this, but I really doubt that introducing arch-specific behaviors in shared code buys us enough. 
> 
> I thought the best position for recording the last instruction was macro-assembler, it's architecture dependent and closer to the final code in general. But it's a shame that each instruction has its own macro-assembler instance. The first shared place I can find is exactly the CodeBuffer which was used as an argument of macro-assembler. Perhaps it's not the best way but efficient, otherwise the arch-specific CodeBuffer seems too weird.
> 
>> I believe it saves 8 bytes for a transient code buffer, so ballparking 10K methods are compiled, it saves 80K of temporary allocations? If this was saving more and for non-transient footprint, it would be interesting.
> 
> I'd like to investigate more.
> 
> Thanks,
> -Eric

If no better solution, I prefer to close this PR.

-------------

PR: https://git.openjdk.java.net/jdk/pull/1971


More information about the hotspot-compiler-dev mailing list