dragonwell-project / dragonwell11

Alibaba Dragonwell11 JDK
https://www.aliyun.com/product/dragonwell
GNU General Public License v2.0
552 stars 111 forks source link

[Backport] 8139457: Relax alignment of array elements #806

Closed weixlu closed 3 months ago

weixlu commented 3 months ago

Summary: With compact object headers, there is always a 32-bit gap between length and first element. Fill the gap only with UseCompactObjectHeaders.

Testing: CICD

Reviewers: yulei, ddh

Issue: https://github.com/dragonwell-project/dragonwell11/issues/727

weixlu commented 3 months ago

About reviewers: original patch is reviewed by yulei and ddh, see https://github.com/dragonwell-project/dragonwell11/pull/728 and now it is cherry-picked and merged again

mmyxym commented 3 months ago

Is cherry-pick clean ? And issue 743 is reproduced?

weixlu commented 3 months ago

Is cherry-pick clean ? And issue 743 is reproduced?

Yes, cherry-pick with no conflict. And easy to reproduce https://github.com/dragonwell-project/dragonwell11/issues/743

duanyangjing commented 3 months ago

With this patch array first element starts at offset 12, which is not heap word aligned. @weixlu Would this introduce any performance degradation?

weixlu commented 3 months ago

With this patch array first element starts at offset 12, which is not heap word aligned. @weixlu Would this introduce any performance degradation?

Hi, thanks for your advice. Yes, misaligned access do introduce performance degradation, but for modern CPUs that won't be a big problem. I have noticed your findings about such regression(https://github.com/dragonwell-project/dragonwell11/issues/809), and we will look into it very soon. Thanks.