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

Amit Kumar amitkumar at openjdk.org
Sat Dec 16 05:05:43 UTC 2023


On Wed, 8 Nov 2023 04:34:03 GMT, Amit Kumar <amitkumar 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`.
>> 
>> # Testing status
>> 
>> ## tier1
>> 
>> |          |   Win   |   Mac   |  Linux  |
>> |----------|---------|---------|---------|
>> | ARM64    |         |    ✔     |         |
>> | ARM32    |         |         |         |
>> | x86      |         |         |    ✔     |
>> | x64      |         |         |     ✔    |
>> | PPC64    |         |         |         |
>> | S390x    |         |         |         |
>> | RiscV    |    n/a     |    n/a     |    ✔     |
>
> `s390x` also run into assert failure: `assert(masm->inst_mark() == nullptr) failed: should be.`
> 
> 
> V  [libjvm.so+0xfb0938]  PhaseOutput::fill_buffer(C2_MacroAssembler*, unsigned int*)+0x2370  (output.cpp:1812)
> V  [libjvm.so+0xfb21ce]  PhaseOutput::Output()+0xcae  (output.cpp:362)
> V  [libjvm.so+0x6a90a8]  Compile::Code_Gen()+0x460  (compile.cpp:2989)
> V  [libjvm.so+0x6ad848]  Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x1738  (compile.cpp:887)
> V  [libjvm.so+0x4fb932]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x14a  (c2compiler.cpp:119)
> V  [libjvm.so+0x6b81a2]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0xd9a  (compileBroker.cpp:2282)
> V  [libjvm.so+0x6b8eaa]  CompileBroker::compiler_thread_loop()+0x5a2  (compileBroker.cpp:1943)

>@offamitkumar, @TheRealMDoerr - can you please re-run the tests on the platforms convenient for you?

I run build for fastdebug & release VMs and tier1 test for fastdebug VM. Everything seems good.

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

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


More information about the shenandoah-dev mailing list