riscv-collab / riscv-openjdk

GNU General Public License v2.0
23 stars 11 forks source link

[BarrierSetAssembler] Fix a temp register usage in eden_allocate #15

Closed zhengxiaolinX closed 3 years ago

zhengxiaolinX commented 3 years ago

Hi team,

This is a trivial fix for a C1 crash found by accident. Directly reproduce this issue by using java -XX:+UseSerialGC -XX:-UseTLAB -XX:TieredStopAtLevel=1. The reason is simple: the eden_allocate uses t2 as a register and zaps it, whereas C1 will use it as a register allocation candidate, leading to a crash. In this function, t0 never gets a use so we can use it safely. Tested in all cases.

Thanks, Xiaolin