RFR: JDK-8241503: C2: Share MacroAssembler between mach nodes during code emission

Cesar Soares Lucas cslucas at openjdk.org
Thu Nov 2 23:39:02 UTC 2023


On Thu, 2 Nov 2023 23:21:23 GMT, Martin Doerr <mdoerr at openjdk.org> wrote:

>> # Description
>> 
>> Please review this PR with a patch to re-use the same C2_MacroAssembler object to emit all instructions in the same compilation unit.
>> 
>> Overall, the change is pretty simple. However, due to the renaming of the variable to access C2_MacroAssembler, from `_masm.` to `masm->`, and also some method prototype changes, the patch became quite large.
>> 
>> # Help Needed for Testing
>> 
>> I don't have access to all platforms necessary to test this. I hope some other folks can help with testing on `S390`, `RISC-V` and `PPC`.
>
> PPC64 runs into assert(masm->inst_mark() == nullptr) failed: should be.
> V  [libjvm.so+0x1648528]  PhaseOutput::fill_buffer(C2_MacroAssembler*, unsigned int*)+0x10c8  (output.cpp:1812)
> V  [libjvm.so+0x164b35c]  PhaseOutput::Output()+0xd5c  (output.cpp:362)
> V  [libjvm.so+0x958f9c]  Compile::Code_Gen()+0x4ec  (compile.cpp:2989)
> V  [libjvm.so+0x95e484]  Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x1a84  (compile.cpp:887)
> V  [libjvm.so+0x718f58]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x198  (c2compiler.cpp:119)

@TheRealMDoerr - this is likely because of some missing `clear_inst_mark` call on my part in the PPC ad, I'll take a look into it.

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

PR Comment: https://git.openjdk.org/jdk/pull/16484#issuecomment-1791705658


More information about the shenandoah-dev mailing list